Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
authorLinus Torvalds <torvalds@linux-foundation.org>
Mon, 21 Apr 2008 22:57:09 +0000 (15:57 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 21 Apr 2008 22:57:09 +0000 (15:57 -0700)
* git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
  [HWRNG] omap: Minor updates
  [CRYPTO] kconfig: Ordering cleanup
  [CRYPTO] all: Clean up init()/fini()
  [CRYPTO] padlock-aes: Use generic setkey function
  [CRYPTO] aes: Export generic setkey
  [CRYPTO] api: Make the crypto subsystem fully modular
  [CRYPTO] cts: Add CTS mode required for Kerberos AES support
  [CRYPTO] lrw: Replace all adds to big endians variables with be*_add_cpu
  [CRYPTO] tcrypt: Change the XTEA test vectors
  [CRYPTO] tcrypt: Shrink the tcrypt module
  [CRYPTO] tcrypt: Change the usage of the test vectors
  [CRYPTO] api: Constify function pointer tables
  [CRYPTO] aes-x86-32: Remove unused return code
  [CRYPTO] tcrypt: Shrink speed templates
  [CRYPTO] tcrypt: Group common speed templates
  [CRYPTO] sha512: Rename sha512 to sha512_generic
  [CRYPTO] sha384: Hardware acceleration for s390
  [CRYPTO] sha512: Hardware acceleration for s390
  [CRYPTO] s390: Generic sha_update and sha_final
  [CRYPTO] api: Switch to proc_create()

1376 files changed:
Documentation/ABI/testing/sysfs-ibft [new file with mode: 0644]
Documentation/DocBook/kernel-api.tmpl
Documentation/DocBook/kernel-locking.tmpl
Documentation/cpusets.txt
Documentation/feature-removal-schedule.txt
Documentation/filesystems/sysfs.txt
Documentation/kernel-parameters.txt
Documentation/power/devices.txt
Documentation/powerpc/booting-without-of.txt
Documentation/powerpc/phyp-assisted-dump.txt [new file with mode: 0644]
Documentation/prctl/disable-tsc-ctxt-sw-stress-test.c [new file with mode: 0644]
Documentation/prctl/disable-tsc-on-off-stress-test.c [new file with mode: 0644]
Documentation/prctl/disable-tsc-test.c [new file with mode: 0644]
Documentation/scheduler/sched-rt-group.txt
MAINTAINERS
arch/arm/Kconfig
arch/arm/Makefile
arch/arm/boot/Makefile
arch/arm/common/rtctime.c
arch/arm/common/scoop.c
arch/arm/configs/am200epdkit_defconfig [new file with mode: 0644]
arch/arm/configs/at91rm9200dk_defconfig
arch/arm/configs/at91rm9200ek_defconfig
arch/arm/configs/at91sam9260ek_defconfig
arch/arm/configs/at91sam9261ek_defconfig
arch/arm/configs/at91sam9263ek_defconfig
arch/arm/configs/at91sam9rlek_defconfig
arch/arm/configs/ateb9200_defconfig
arch/arm/configs/cam60_defconfig [new file with mode: 0644]
arch/arm/configs/csb337_defconfig
arch/arm/configs/csb637_defconfig
arch/arm/configs/ecbat91_defconfig [new file with mode: 0644]
arch/arm/configs/kafa_defconfig
arch/arm/configs/magician_defconfig [new file with mode: 0644]
arch/arm/configs/ns9xxx_defconfig
arch/arm/configs/orion5x_defconfig [moved from arch/arm/configs/orion_defconfig with 99% similarity]
arch/arm/configs/picotux200_defconfig
arch/arm/configs/sam9_l9260_defconfig [new file with mode: 0644]
arch/arm/configs/tct_hammer_defconfig [new file with mode: 0644]
arch/arm/configs/yl9200_defconfig [new file with mode: 0644]
arch/arm/kernel/Makefile
arch/arm/kernel/asm-offsets.c
arch/arm/kernel/calls.S
arch/arm/kernel/entry-armv.S
arch/arm/kernel/entry-common.S
arch/arm/kernel/head-common.S
arch/arm/kernel/thumbee.c [new file with mode: 0644]
arch/arm/mach-aaec2000/clock.c
arch/arm/mach-at91/Kconfig
arch/arm/mach-at91/Makefile
arch/arm/mach-at91/at91cap9.c
arch/arm/mach-at91/at91cap9_devices.c
arch/arm/mach-at91/at91rm9200_devices.c
arch/arm/mach-at91/at91sam9260.c
arch/arm/mach-at91/at91sam9260_devices.c
arch/arm/mach-at91/at91sam9261.c
arch/arm/mach-at91/at91sam9261_devices.c
arch/arm/mach-at91/at91sam9263.c
arch/arm/mach-at91/at91sam9263_devices.c
arch/arm/mach-at91/at91sam926x_time.c
arch/arm/mach-at91/at91sam9rl.c
arch/arm/mach-at91/at91sam9rl_devices.c
arch/arm/mach-at91/board-cam60.c [new file with mode: 0644]
arch/arm/mach-at91/board-cap9adk.c
arch/arm/mach-at91/board-csb337.c
arch/arm/mach-at91/board-csb637.c
arch/arm/mach-at91/board-ecbat91.c [new file with mode: 0644]
arch/arm/mach-at91/board-sam9-l9260.c [new file with mode: 0644]
arch/arm/mach-at91/board-sam9260ek.c
arch/arm/mach-at91/board-sam9261ek.c
arch/arm/mach-at91/board-sam9263ek.c
arch/arm/mach-at91/board-sam9rlek.c
arch/arm/mach-at91/board-yl-9200.c [new file with mode: 0755]
arch/arm/mach-at91/clock.c
arch/arm/mach-at91/pm.c
arch/arm/mach-clps711x/Kconfig
arch/arm/mach-ep93xx/Makefile
arch/arm/mach-ep93xx/core.c
arch/arm/mach-ep93xx/gpio.c [new file with mode: 0644]
arch/arm/mach-integrator/clock.c
arch/arm/mach-integrator/time.c
arch/arm/mach-iop32x/Kconfig
arch/arm/mach-iop32x/iq31244.c
arch/arm/mach-iop32x/iq80321.c
arch/arm/mach-iop33x/Kconfig
arch/arm/mach-iop33x/iq80331.c
arch/arm/mach-iop33x/iq80332.c
arch/arm/mach-ks8695/Makefile
arch/arm/mach-ks8695/devices.c
arch/arm/mach-ks8695/leds.c [new file with mode: 0644]
arch/arm/mach-ns9xxx/Kconfig
arch/arm/mach-ns9xxx/Makefile
arch/arm/mach-ns9xxx/Makefile.boot
arch/arm/mach-ns9xxx/board-a9m9750dev.c
arch/arm/mach-ns9xxx/clock.c [new file with mode: 0644]
arch/arm/mach-ns9xxx/clock.h [new file with mode: 0644]
arch/arm/mach-ns9xxx/generic.c
arch/arm/mach-ns9xxx/generic.h
arch/arm/mach-ns9xxx/gpio-ns9360.c [new file with mode: 0644]
arch/arm/mach-ns9xxx/gpio-ns9360.h [new file with mode: 0644]
arch/arm/mach-ns9xxx/gpio.c
arch/arm/mach-ns9xxx/irq.c
arch/arm/mach-ns9xxx/mach-cc9p9360dev.c
arch/arm/mach-ns9xxx/mach-cc9p9360js.c
arch/arm/mach-ns9xxx/plat-serial8250.c [new file with mode: 0644]
arch/arm/mach-ns9xxx/processor-ns9360.c [new file with mode: 0644]
arch/arm/mach-ns9xxx/time-ns9360.c [moved from arch/arm/mach-ns9xxx/time.c with 62% similarity]
arch/arm/mach-omap1/Makefile
arch/arm/mach-omap1/board-osk.c
arch/arm/mach-omap1/leds-osk.c
arch/arm/mach-omap1/mux.c
arch/arm/mach-omap1/time.c
arch/arm/mach-omap1/timer32k.c [moved from arch/arm/plat-omap/timer32k.c with 75% similarity]
arch/arm/mach-omap2/Makefile
arch/arm/mach-omap2/board-2430sdp.c
arch/arm/mach-omap2/board-apollon.c
arch/arm/mach-omap2/board-h4.c
arch/arm/mach-omap2/clock.c
arch/arm/mach-omap2/clock.h
arch/arm/mach-omap2/clock24xx.c [new file with mode: 0644]
arch/arm/mach-omap2/clock24xx.h [new file with mode: 0644]
arch/arm/mach-omap2/clock34xx.c [new file with mode: 0644]
arch/arm/mach-omap2/clock34xx.h [new file with mode: 0644]
arch/arm/mach-omap2/cm-regbits-24xx.h [new file with mode: 0644]
arch/arm/mach-omap2/cm-regbits-34xx.h [new file with mode: 0644]
arch/arm/mach-omap2/cm.h [new file with mode: 0644]
arch/arm/mach-omap2/control.c [new file with mode: 0644]
arch/arm/mach-omap2/gpmc.c
arch/arm/mach-omap2/memory.c
arch/arm/mach-omap2/memory.h
arch/arm/mach-omap2/mux.c
arch/arm/mach-omap2/pm-domain.c [deleted file]
arch/arm/mach-omap2/pm.c
arch/arm/mach-omap2/prcm-common.h [new file with mode: 0644]
arch/arm/mach-omap2/prcm-regs.h [deleted file]
arch/arm/mach-omap2/prcm.c
arch/arm/mach-omap2/prm-regbits-24xx.h [new file with mode: 0644]
arch/arm/mach-omap2/prm-regbits-34xx.h [new file with mode: 0644]
arch/arm/mach-omap2/prm.h [new file with mode: 0644]
arch/arm/mach-omap2/sdrc.h [new file with mode: 0644]
arch/arm/mach-omap2/sleep.S
arch/arm/mach-omap2/sram-fn.S
arch/arm/mach-omap2/timer-gp.c
arch/arm/mach-orion/addr-map.c [deleted file]
arch/arm/mach-orion/common.h [deleted file]
arch/arm/mach-orion/pci.c [deleted file]
arch/arm/mach-orion/time.c [deleted file]
arch/arm/mach-orion5x/Kconfig [moved from arch/arm/mach-orion/Kconfig with 77% similarity]
arch/arm/mach-orion5x/Makefile [moved from arch/arm/mach-orion/Makefile with 68% similarity]
arch/arm/mach-orion5x/Makefile.boot [moved from arch/arm/mach-orion/Makefile.boot with 100% similarity]
arch/arm/mach-orion5x/addr-map.c [new file with mode: 0644]
arch/arm/mach-orion5x/common.c [moved from arch/arm/mach-orion/common.c with 52% similarity]
arch/arm/mach-orion5x/common.h [new file with mode: 0644]
arch/arm/mach-orion5x/db88f5281-setup.c [moved from arch/arm/mach-orion/db88f5281-setup.c with 88% similarity]
arch/arm/mach-orion5x/dns323-setup.c [moved from arch/arm/mach-orion/dns323-setup.c with 89% similarity]
arch/arm/mach-orion5x/gpio.c [moved from arch/arm/mach-orion/gpio.c with 68% similarity]
arch/arm/mach-orion5x/irq.c [moved from arch/arm/mach-orion/irq.c with 55% similarity]
arch/arm/mach-orion5x/kurobox_pro-setup.c [moved from arch/arm/mach-orion/kurobox_pro-setup.c with 75% similarity]
arch/arm/mach-orion5x/pci.c [new file with mode: 0644]
arch/arm/mach-orion5x/rd88f5182-setup.c [moved from arch/arm/mach-orion/rd88f5182-setup.c with 85% similarity]
arch/arm/mach-orion5x/ts209-setup.c [moved from arch/arm/mach-orion/ts209-setup.c with 76% similarity]
arch/arm/mach-pnx4008/clock.c
arch/arm/mach-pnx4008/gpio.c
arch/arm/mach-pxa/Kconfig
arch/arm/mach-pxa/Makefile
arch/arm/mach-pxa/clock.c
arch/arm/mach-pxa/cm-x270-pci.c
arch/arm/mach-pxa/cm-x270.c
arch/arm/mach-pxa/colibri.c
arch/arm/mach-pxa/corgi.c
arch/arm/mach-pxa/corgi_pm.c
arch/arm/mach-pxa/corgi_ssp.c
arch/arm/mach-pxa/devices.c
arch/arm/mach-pxa/devices.h
arch/arm/mach-pxa/em-x270.c
arch/arm/mach-pxa/generic.c
arch/arm/mach-pxa/generic.h
arch/arm/mach-pxa/gpio.c
arch/arm/mach-pxa/gumstix.c [new file with mode: 0644]
arch/arm/mach-pxa/idp.c
arch/arm/mach-pxa/irq.c
arch/arm/mach-pxa/leds-trizeps4.c
arch/arm/mach-pxa/littleton.c
arch/arm/mach-pxa/lpd270.c
arch/arm/mach-pxa/lubbock.c
arch/arm/mach-pxa/magician.c
arch/arm/mach-pxa/mainstone.c
arch/arm/mach-pxa/mfp-pxa2xx.c [new file with mode: 0644]
arch/arm/mach-pxa/mfp-pxa3xx.c [moved from arch/arm/mach-pxa/mfp.c with 96% similarity]
arch/arm/mach-pxa/pcm027.c
arch/arm/mach-pxa/pcm990-baseboard.c
arch/arm/mach-pxa/poodle.c
arch/arm/mach-pxa/pxa25x.c
arch/arm/mach-pxa/pxa27x.c
arch/arm/mach-pxa/pxa3xx.c
arch/arm/mach-pxa/sharpsl_pm.c
arch/arm/mach-pxa/spitz.c
arch/arm/mach-pxa/spitz_pm.c
arch/arm/mach-pxa/tosa.c
arch/arm/mach-pxa/trizeps4.c
arch/arm/mach-pxa/zylonite.c
arch/arm/mach-pxa/zylonite_pxa300.c
arch/arm/mach-pxa/zylonite_pxa320.c
arch/arm/mach-realview/Kconfig
arch/arm/mach-realview/Makefile
arch/arm/mach-realview/clock.c
arch/arm/mach-realview/core.c
arch/arm/mach-realview/core.h
arch/arm/mach-realview/platsmp.c
arch/arm/mach-realview/realview_eb.c
arch/arm/mach-realview/realview_pb1176.c [new file with mode: 0644]
arch/arm/mach-realview/realview_pb11mp.c [new file with mode: 0644]
arch/arm/mach-s3c2410/Kconfig
arch/arm/mach-s3c2410/Makefile
arch/arm/mach-s3c2410/mach-bast.c
arch/arm/mach-s3c2410/mach-tct_hammer.c [new file with mode: 0644]
arch/arm/mach-s3c2410/mach-vr1000.c
arch/arm/mach-s3c2412/s3c2412.c
arch/arm/mach-s3c2440/mach-anubis.c
arch/arm/mach-s3c2440/mach-osiris.c
arch/arm/mach-sa1100/Makefile
arch/arm/mach-sa1100/generic.c
arch/arm/mach-sa1100/generic.h
arch/arm/mach-sa1100/gpio.c [new file with mode: 0644]
arch/arm/mach-sa1100/irq.c
arch/arm/mach-sa1100/time.c
arch/arm/mach-versatile/clock.c
arch/arm/mm/Kconfig
arch/arm/mm/init.c
arch/arm/mm/proc-arm1020.S
arch/arm/mm/proc-arm1020e.S
arch/arm/mm/proc-arm1022.S
arch/arm/mm/proc-arm1026.S
arch/arm/mm/proc-arm6_7.S
arch/arm/mm/proc-arm720.S
arch/arm/mm/proc-arm920.S
arch/arm/mm/proc-arm922.S
arch/arm/mm/proc-arm925.S
arch/arm/mm/proc-arm926.S
arch/arm/mm/proc-feroceon.S
arch/arm/mm/proc-sa110.S
arch/arm/mm/proc-sa1100.S
arch/arm/mm/proc-v6.S
arch/arm/mm/proc-v7.S
arch/arm/mm/proc-xscale.S
arch/arm/plat-iop/pci.c
arch/arm/plat-mxc/Kconfig
arch/arm/plat-mxc/Makefile
arch/arm/plat-mxc/irq.c
arch/arm/plat-omap/Makefile
arch/arm/plat-omap/clock.c
arch/arm/plat-omap/common.c
arch/arm/plat-omap/gpio.c
arch/arm/plat-omap/mux.c
arch/arm/plat-omap/usb.c
arch/arm/plat-orion/Makefile [new file with mode: 0644]
arch/arm/plat-orion/irq.c [new file with mode: 0644]
arch/arm/plat-orion/pcie.c [new file with mode: 0644]
arch/arm/plat-orion/time.c [new file with mode: 0644]
arch/arm/plat-s3c24xx/clock.c
arch/arm/plat-s3c24xx/cpu.c
arch/arm/tools/mach-types
arch/avr32/Kconfig
arch/avr32/kernel/entry-avr32b.S
arch/avr32/kernel/process.c
arch/avr32/kernel/time.c
arch/avr32/mach-at32ap/Makefile
arch/avr32/mach-at32ap/at32ap700x.c
arch/avr32/mach-at32ap/intc.c
arch/avr32/mach-at32ap/pm-at32ap700x.S [new file with mode: 0644]
arch/avr32/mach-at32ap/time-tc.c [deleted file]
arch/avr32/mm/init.c
arch/avr32/oprofile/op_model_avr32.c
arch/blackfin/kernel/time.c
arch/ia64/kernel/salinfo.c
arch/ia64/sn/kernel/sn2/sn_hwperf.c
arch/m68k/atari/stram.c
arch/m68k/sun3/intersil.c
arch/mips/sgi-ip27/ip27-console.c
arch/parisc/kernel/sys_parisc32.c
arch/powerpc/Kconfig
arch/powerpc/Kconfig.debug
arch/powerpc/Makefile
arch/powerpc/boot/Makefile
arch/powerpc/boot/bamboo.c
arch/powerpc/boot/cpm-serial.c
arch/powerpc/boot/cuboot-pq2.c
arch/powerpc/boot/cuboot-rainier.c
arch/powerpc/boot/cuboot-sequoia.c
arch/powerpc/boot/cuboot-taishan.c
arch/powerpc/boot/cuboot-warp.c
arch/powerpc/boot/cuboot-yosemite.c [new file with mode: 0644]
arch/powerpc/boot/devtree.c
arch/powerpc/boot/dts/bamboo.dts
arch/powerpc/boot/dts/canyonlands.dts [new file with mode: 0644]
arch/powerpc/boot/dts/ebony.dts
arch/powerpc/boot/dts/ep8248e.dts
arch/powerpc/boot/dts/ep88xc.dts
arch/powerpc/boot/dts/glacier.dts [new file with mode: 0644]
arch/powerpc/boot/dts/haleakala.dts
arch/powerpc/boot/dts/katmai.dts
arch/powerpc/boot/dts/kilauea.dts
arch/powerpc/boot/dts/ksi8560.dts [new file with mode: 0644]
arch/powerpc/boot/dts/kuroboxHD.dts
arch/powerpc/boot/dts/kuroboxHG.dts
arch/powerpc/boot/dts/makalu.dts
arch/powerpc/boot/dts/mpc7448hpc2.dts
arch/powerpc/boot/dts/mpc8272ads.dts
arch/powerpc/boot/dts/mpc832x_mds.dts
arch/powerpc/boot/dts/mpc832x_rdb.dts
arch/powerpc/boot/dts/mpc836x_mds.dts
arch/powerpc/boot/dts/mpc8540ads.dts
arch/powerpc/boot/dts/mpc8541cds.dts
arch/powerpc/boot/dts/mpc8544ds.dts
arch/powerpc/boot/dts/mpc8548cds.dts
arch/powerpc/boot/dts/mpc8555cds.dts
arch/powerpc/boot/dts/mpc8560ads.dts
arch/powerpc/boot/dts/mpc8568mds.dts
arch/powerpc/boot/dts/mpc8572ds.dts
arch/powerpc/boot/dts/mpc8641_hpcn.dts
arch/powerpc/boot/dts/mpc866ads.dts
arch/powerpc/boot/dts/mpc885ads.dts
arch/powerpc/boot/dts/pq2fads.dts
arch/powerpc/boot/dts/prpmc2800.dts
arch/powerpc/boot/dts/rainier.dts
arch/powerpc/boot/dts/sbc8641d.dts [new file with mode: 0644]
arch/powerpc/boot/dts/sequoia.dts
arch/powerpc/boot/dts/taishan.dts
arch/powerpc/boot/dts/walnut.dts
arch/powerpc/boot/dts/warp.dts
arch/powerpc/boot/dts/yosemite.dts [new file with mode: 0644]
arch/powerpc/boot/ebony.c
arch/powerpc/boot/libfdt-wrapper.c
arch/powerpc/boot/mpc52xx-psc.c
arch/powerpc/boot/mpsc.c
arch/powerpc/boot/mv64x60.c
arch/powerpc/boot/mv64x60_i2c.c
arch/powerpc/boot/ns16550.c
arch/powerpc/boot/ops.h
arch/powerpc/boot/prpmc2800.c
arch/powerpc/boot/ps3-head.S
arch/powerpc/boot/ps3.c
arch/powerpc/boot/serial.c
arch/powerpc/boot/simpleboot.c [new file with mode: 0644]
arch/powerpc/boot/treeboot-walnut.c
arch/powerpc/boot/virtex405-head.S [new file with mode: 0644]
arch/powerpc/boot/wrapper
arch/powerpc/configs/40x/ep405_defconfig [moved from arch/powerpc/configs/ep405_defconfig with 100% similarity]
arch/powerpc/configs/40x/kilauea_defconfig [moved from arch/powerpc/configs/kilauea_defconfig with 100% similarity]
arch/powerpc/configs/40x/makalu_defconfig [moved from arch/powerpc/configs/makalu_defconfig with 100% similarity]
arch/powerpc/configs/40x/walnut_defconfig [moved from arch/powerpc/configs/walnut_defconfig with 100% similarity]
arch/powerpc/configs/44x/bamboo_defconfig [moved from arch/powerpc/configs/bamboo_defconfig with 100% similarity]
arch/powerpc/configs/44x/canyonlands_defconfig [new file with mode: 0644]
arch/powerpc/configs/44x/ebony_defconfig [moved from arch/powerpc/configs/ebony_defconfig with 100% similarity]
arch/powerpc/configs/44x/katmai_defconfig [moved from arch/powerpc/configs/katmai_defconfig with 100% similarity]
arch/powerpc/configs/44x/rainier_defconfig [moved from arch/powerpc/configs/rainier_defconfig with 100% similarity]
arch/powerpc/configs/44x/sequoia_defconfig [moved from arch/powerpc/configs/sequoia_defconfig with 100% similarity]
arch/powerpc/configs/44x/taishan_defconfig [moved from arch/powerpc/configs/taishan_defconfig with 100% similarity]
arch/powerpc/configs/44x/warp_defconfig [moved from arch/powerpc/configs/warp_defconfig with 100% similarity]
arch/powerpc/configs/83xx/mpc8313_rdb_defconfig [moved from arch/powerpc/configs/mpc8313_rdb_defconfig with 99% similarity]
arch/powerpc/configs/83xx/mpc8315_rdb_defconfig [moved from arch/powerpc/configs/mpc8315_rdb_defconfig with 100% similarity]
arch/powerpc/configs/83xx/mpc832x_mds_defconfig [moved from arch/powerpc/configs/mpc832x_mds_defconfig with 100% similarity]
arch/powerpc/configs/83xx/mpc832x_rdb_defconfig [moved from arch/powerpc/configs/mpc832x_rdb_defconfig with 100% similarity]
arch/powerpc/configs/83xx/mpc834x_itx_defconfig [moved from arch/powerpc/configs/mpc834x_itx_defconfig with 100% similarity]
arch/powerpc/configs/83xx/mpc834x_itxgp_defconfig [moved from arch/powerpc/configs/mpc834x_itxgp_defconfig with 100% similarity]
arch/powerpc/configs/83xx/mpc834x_mds_defconfig [moved from arch/powerpc/configs/mpc834x_mds_defconfig with 100% similarity]
arch/powerpc/configs/83xx/mpc836x_mds_defconfig [moved from arch/powerpc/configs/mpc836x_mds_defconfig with 100% similarity]
arch/powerpc/configs/83xx/mpc837x_mds_defconfig [moved from arch/powerpc/configs/mpc837x_mds_defconfig with 100% similarity]
arch/powerpc/configs/83xx/mpc837x_rdb_defconfig [moved from arch/powerpc/configs/mpc837x_rdb_defconfig with 100% similarity]
arch/powerpc/configs/83xx/sbc834x_defconfig [moved from arch/powerpc/configs/sbc834x_defconfig with 100% similarity]
arch/powerpc/configs/85xx/ksi8560_defconfig [new file with mode: 0644]
arch/powerpc/configs/85xx/mpc8540_ads_defconfig [moved from arch/powerpc/configs/mpc8540_ads_defconfig with 100% similarity]
arch/powerpc/configs/85xx/mpc8544_ds_defconfig [moved from arch/powerpc/configs/mpc8544_ds_defconfig with 99% similarity]
arch/powerpc/configs/85xx/mpc8560_ads_defconfig [moved from arch/powerpc/configs/mpc8560_ads_defconfig with 100% similarity]
arch/powerpc/configs/85xx/mpc8568mds_defconfig [moved from arch/powerpc/configs/mpc8568mds_defconfig with 100% similarity]
arch/powerpc/configs/85xx/mpc8572_ds_defconfig [moved from arch/powerpc/configs/mpc8572_ds_defconfig with 100% similarity]
arch/powerpc/configs/85xx/mpc85xx_cds_defconfig [moved from arch/powerpc/configs/mpc85xx_cds_defconfig with 100% similarity]
arch/powerpc/configs/85xx/sbc8548_defconfig [moved from arch/powerpc/configs/sbc8548_defconfig with 100% similarity]
arch/powerpc/configs/85xx/sbc8560_defconfig [moved from arch/powerpc/configs/sbc8560_defconfig with 100% similarity]
arch/powerpc/configs/85xx/stx_gp3_defconfig [moved from arch/powerpc/configs/stx_gp3_defconfig with 100% similarity]
arch/powerpc/configs/85xx/tqm8540_defconfig [moved from arch/powerpc/configs/tqm8540_defconfig with 100% similarity]
arch/powerpc/configs/85xx/tqm8541_defconfig [moved from arch/powerpc/configs/tqm8541_defconfig with 100% similarity]
arch/powerpc/configs/85xx/tqm8555_defconfig [moved from arch/powerpc/configs/tqm8555_defconfig with 100% similarity]
arch/powerpc/configs/85xx/tqm8560_defconfig [moved from arch/powerpc/configs/tqm8560_defconfig with 100% similarity]
arch/powerpc/configs/chrp32_defconfig
arch/powerpc/configs/g5_defconfig
arch/powerpc/configs/iseries_defconfig
arch/powerpc/configs/maple_defconfig
arch/powerpc/configs/mpc83xx_defconfig
arch/powerpc/configs/pmac32_defconfig
arch/powerpc/configs/ppc40x_defconfig [new file with mode: 0644]
arch/powerpc/configs/ppc44x_defconfig
arch/powerpc/configs/ppc64_defconfig
arch/powerpc/configs/pseries_defconfig
arch/powerpc/configs/sbc8641d_defconfig [new file with mode: 0644]
arch/powerpc/kernel/Makefile
arch/powerpc/kernel/asm-offsets.c
arch/powerpc/kernel/btext.c
arch/powerpc/kernel/cpu_setup_44x.S
arch/powerpc/kernel/cputable.c
arch/powerpc/kernel/crash.c
arch/powerpc/kernel/crash_dump.c
arch/powerpc/kernel/entry_32.S
arch/powerpc/kernel/entry_64.S
arch/powerpc/kernel/head_32.S
arch/powerpc/kernel/head_44x.S
arch/powerpc/kernel/head_64.S
arch/powerpc/kernel/head_booke.h
arch/powerpc/kernel/head_fsl_booke.S
arch/powerpc/kernel/ibmebus.c
arch/powerpc/kernel/iommu.c
arch/powerpc/kernel/irq.c
arch/powerpc/kernel/isa-bridge.c
arch/powerpc/kernel/lparcfg.c
arch/powerpc/kernel/machine_kexec.c
arch/powerpc/kernel/paca.c
arch/powerpc/kernel/ppc32.h
arch/powerpc/kernel/ppc_ksyms.c
arch/powerpc/kernel/process.c
arch/powerpc/kernel/prom.c
arch/powerpc/kernel/prom_init.c
arch/powerpc/kernel/ptrace32.c
arch/powerpc/kernel/rtas.c
arch/powerpc/kernel/rtas_flash.c
arch/powerpc/kernel/rtas_pci.c
arch/powerpc/kernel/setup-common.c
arch/powerpc/kernel/setup_32.c
arch/powerpc/kernel/setup_64.c
arch/powerpc/kernel/signal_32.c
arch/powerpc/kernel/stacktrace.c [new file with mode: 0644]
arch/powerpc/kernel/sys_ppc32.c
arch/powerpc/kernel/syscalls.c
arch/powerpc/kernel/vdso.c
arch/powerpc/kernel/vio.c
arch/powerpc/kernel/vmlinux.lds.S
arch/powerpc/lib/rheap.c
arch/powerpc/lib/string.S
arch/powerpc/math-emu/fabs.c
arch/powerpc/math-emu/fadd.c
arch/powerpc/math-emu/fadds.c
arch/powerpc/math-emu/fcmpo.c
arch/powerpc/math-emu/fcmpu.c
arch/powerpc/math-emu/fctiw.c
arch/powerpc/math-emu/fctiwz.c
arch/powerpc/math-emu/fdiv.c
arch/powerpc/math-emu/fdivs.c
arch/powerpc/math-emu/fmadd.c
arch/powerpc/math-emu/fmadds.c
arch/powerpc/math-emu/fmr.c
arch/powerpc/math-emu/fmsub.c
arch/powerpc/math-emu/fmsubs.c
arch/powerpc/math-emu/fmul.c
arch/powerpc/math-emu/fmuls.c
arch/powerpc/math-emu/fnabs.c
arch/powerpc/math-emu/fneg.c
arch/powerpc/math-emu/fnmadd.c
arch/powerpc/math-emu/fnmadds.c
arch/powerpc/math-emu/fnmsub.c
arch/powerpc/math-emu/fnmsubs.c
arch/powerpc/math-emu/fres.c
arch/powerpc/math-emu/frsp.c
arch/powerpc/math-emu/frsqrte.c
arch/powerpc/math-emu/fsel.c
arch/powerpc/math-emu/fsqrt.c
arch/powerpc/math-emu/fsqrts.c
arch/powerpc/math-emu/fsub.c
arch/powerpc/math-emu/fsubs.c
arch/powerpc/math-emu/lfd.c
arch/powerpc/math-emu/lfs.c
arch/powerpc/math-emu/mcrfs.c
arch/powerpc/math-emu/mffs.c
arch/powerpc/math-emu/mtfsb0.c
arch/powerpc/math-emu/mtfsb1.c
arch/powerpc/math-emu/mtfsf.c
arch/powerpc/math-emu/mtfsfi.c
arch/powerpc/math-emu/stfd.c
arch/powerpc/math-emu/stfiwx.c
arch/powerpc/math-emu/stfs.c
arch/powerpc/mm/40x_mmu.c
arch/powerpc/mm/44x_mmu.c
arch/powerpc/mm/Makefile
arch/powerpc/mm/fsl_booke_mmu.c
arch/powerpc/mm/hash_utils_64.c
arch/powerpc/mm/init_32.c
arch/powerpc/mm/init_64.c
arch/powerpc/mm/lmb.c [deleted file]
arch/powerpc/mm/mem.c
arch/powerpc/mm/mmu_decl.h
arch/powerpc/mm/numa.c
arch/powerpc/mm/pgtable_32.c
arch/powerpc/mm/ppc_mmu_32.c
arch/powerpc/mm/stab.c
arch/powerpc/oprofile/cell/spu_task_sync.c
arch/powerpc/oprofile/cell/vma_map.c
arch/powerpc/oprofile/op_model_cell.c
arch/powerpc/platforms/40x/ep405.c
arch/powerpc/platforms/40x/kilauea.c
arch/powerpc/platforms/40x/makalu.c
arch/powerpc/platforms/40x/virtex.c
arch/powerpc/platforms/40x/walnut.c
arch/powerpc/platforms/44x/44x.h
arch/powerpc/platforms/44x/Kconfig
arch/powerpc/platforms/44x/Makefile
arch/powerpc/platforms/44x/bamboo.c
arch/powerpc/platforms/44x/canyonlands.c [new file with mode: 0644]
arch/powerpc/platforms/44x/ebony.c
arch/powerpc/platforms/44x/idle.c [new file with mode: 0644]
arch/powerpc/platforms/44x/katmai.c
arch/powerpc/platforms/44x/misc_44x.S
arch/powerpc/platforms/44x/rainier.c
arch/powerpc/platforms/44x/sequoia.c
arch/powerpc/platforms/44x/taishan.c
arch/powerpc/platforms/44x/warp-nand.c
arch/powerpc/platforms/44x/warp.c
arch/powerpc/platforms/52xx/lite5200.c
arch/powerpc/platforms/82xx/Kconfig
arch/powerpc/platforms/83xx/mpc837x_rdb.c
arch/powerpc/platforms/83xx/mpc83xx.h
arch/powerpc/platforms/83xx/usb.c
arch/powerpc/platforms/85xx/Kconfig
arch/powerpc/platforms/85xx/Makefile
arch/powerpc/platforms/85xx/ksi8560.c [new file with mode: 0644]
arch/powerpc/platforms/85xx/mpc85xx_ads.c
arch/powerpc/platforms/85xx/mpc85xx_ds.c
arch/powerpc/platforms/86xx/Kconfig
arch/powerpc/platforms/86xx/Makefile
arch/powerpc/platforms/86xx/mpc8610_hpcd.c
arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
arch/powerpc/platforms/86xx/sbc8641d.c [new file with mode: 0644]
arch/powerpc/platforms/8xx/Kconfig
arch/powerpc/platforms/8xx/m8xx_setup.c
arch/powerpc/platforms/Kconfig
arch/powerpc/platforms/Kconfig.cputype
arch/powerpc/platforms/cell/iommu.c
arch/powerpc/platforms/cell/pervasive.c
arch/powerpc/platforms/cell/ras.c
arch/powerpc/platforms/cell/spu_base.c
arch/powerpc/platforms/cell/spu_callbacks.c
arch/powerpc/platforms/cell/spu_manage.c
arch/powerpc/platforms/cell/spufs/coredump.c
arch/powerpc/platforms/cell/spufs/file.c
arch/powerpc/platforms/cell/spufs/inode.c
arch/powerpc/platforms/cell/spufs/run.c
arch/powerpc/platforms/cell/spufs/switch.c
arch/powerpc/platforms/celleb/beat.c
arch/powerpc/platforms/celleb/beat.h
arch/powerpc/platforms/celleb/beat_wrapper.h
arch/powerpc/platforms/celleb/htab.c
arch/powerpc/platforms/celleb/interrupt.c
arch/powerpc/platforms/celleb/scc_epci.c
arch/powerpc/platforms/celleb/scc_sio.c
arch/powerpc/platforms/celleb/spu_priv1.c
arch/powerpc/platforms/celleb/udbg_beat.c
arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c
arch/powerpc/platforms/embedded6xx/prpmc2800.c
arch/powerpc/platforms/iseries/exception.S
arch/powerpc/platforms/iseries/ipl_parms.h
arch/powerpc/platforms/iseries/lpardata.c
arch/powerpc/platforms/iseries/naca.h
arch/powerpc/platforms/iseries/pci.c
arch/powerpc/platforms/iseries/release_data.h
arch/powerpc/platforms/iseries/spcomm_area.h
arch/powerpc/platforms/iseries/vpd_areas.h
arch/powerpc/platforms/maple/pci.c
arch/powerpc/platforms/maple/setup.c
arch/powerpc/platforms/pasemi/dma_lib.c
arch/powerpc/platforms/pasemi/iommu.c
arch/powerpc/platforms/powermac/pfunc_core.c
arch/powerpc/platforms/powermac/setup.c
arch/powerpc/platforms/ps3/device-init.c
arch/powerpc/platforms/ps3/htab.c
arch/powerpc/platforms/ps3/interrupt.c
arch/powerpc/platforms/ps3/mm.c
arch/powerpc/platforms/ps3/os-area.c
arch/powerpc/platforms/ps3/setup.c
arch/powerpc/platforms/ps3/spu.c
arch/powerpc/platforms/pseries/Makefile
arch/powerpc/platforms/pseries/eeh.c
arch/powerpc/platforms/pseries/lpar.c
arch/powerpc/platforms/pseries/pci_dlpar.c
arch/powerpc/platforms/pseries/phyp_dump.c [new file with mode: 0644]
arch/powerpc/platforms/pseries/pseries.h
arch/powerpc/platforms/pseries/reconfig.c
arch/powerpc/platforms/pseries/scanlog.c
arch/powerpc/platforms/pseries/setup.c
arch/powerpc/platforms/pseries/xics.c
arch/powerpc/platforms/pseries/xics.h
arch/powerpc/sysdev/Makefile
arch/powerpc/sysdev/cpm1.c
arch/powerpc/sysdev/cpm2.c
arch/powerpc/sysdev/cpm_common.c
arch/powerpc/sysdev/dart_iommu.c
arch/powerpc/sysdev/fsl_lbc.c [new file with mode: 0644]
arch/powerpc/sysdev/fsl_soc.c
arch/powerpc/sysdev/fsl_soc.h
arch/powerpc/sysdev/mpic.c
arch/powerpc/sysdev/mv64x60_dev.c
arch/powerpc/sysdev/mv64x60_pci.c
arch/powerpc/sysdev/mv64x60_pic.c
arch/powerpc/sysdev/mv64x60_udbg.c
arch/powerpc/sysdev/ppc4xx_pci.c
arch/powerpc/sysdev/ppc4xx_pci.h
arch/powerpc/sysdev/ppc4xx_soc.c [new file with mode: 0644]
arch/powerpc/sysdev/qe_lib/qe.c
arch/powerpc/sysdev/qe_lib/qe_io.c
arch/powerpc/sysdev/qe_lib/ucc_fast.c
arch/powerpc/sysdev/qe_lib/ucc_slow.c
arch/powerpc/sysdev/rtc_cmos_setup.c
arch/powerpc/sysdev/tsi108_dev.c
arch/powerpc/sysdev/tsi108_pci.c
arch/powerpc/xmon/xmon.c
arch/ppc/8xx_io/commproc.c
arch/ppc/8xx_io/fec.c
arch/ppc/kernel/head.S
arch/ppc/mm/init.c
arch/ppc/platforms/radstone_ppc7d.c
arch/ppc/platforms/sbc82xx.c
arch/ppc/syslib/mpc52xx_setup.c
arch/ppc/syslib/ocp.c
arch/s390/kernel/compat_linux.c
arch/s390/kernel/debug.c
arch/sh/Kconfig
arch/sh/Kconfig.debug
arch/sh/Makefile
arch/sh/boards/renesas/migor/setup.c
arch/sh/boards/renesas/r7780rp/irq-r7780mp.c
arch/sh/boards/renesas/r7780rp/setup.c
arch/sh/boards/se/7721/Makefile [new file with mode: 0644]
arch/sh/boards/se/7721/irq.c [new file with mode: 0644]
arch/sh/boards/se/7721/setup.c [new file with mode: 0644]
arch/sh/boards/se/7722/setup.c
arch/sh/configs/se7721_defconfig [new file with mode: 0644]
arch/sh/kernel/cf-enabler.c
arch/sh/kernel/cpu/sh2a/Makefile
arch/sh/kernel/cpu/sh2a/probe.c
arch/sh/kernel/cpu/sh2a/setup-mxg.c [new file with mode: 0644]
arch/sh/kernel/cpu/sh4/probe.c
arch/sh/kernel/cpu/sh4a/Makefile
arch/sh/kernel/cpu/sh4a/setup-sh7722.c
arch/sh/kernel/cpu/sh4a/setup-sh7723.c [new file with mode: 0644]
arch/sh/kernel/cpu/sh4a/setup-sh7763.c
arch/sh/kernel/cpu/sh4a/setup-sh7770.c
arch/sh/kernel/setup.c
arch/sh/lib/clear_page.S
arch/sh/lib/copy_page.S
arch/sh/mm/cache-debugfs.c
arch/sh/mm/pmb.c
arch/sh/tools/mach-types
arch/sparc/kernel/time.c
arch/sparc64/Kconfig
arch/sparc64/kernel/sys_sparc32.c
arch/v850/kernel/syscalls.c
arch/x86/Kconfig
arch/x86/boot/a20.c
arch/x86/boot/apm.c
arch/x86/boot/bitops.h
arch/x86/boot/boot.h
arch/x86/boot/cmdline.c
arch/x86/boot/compressed/head_32.S
arch/x86/boot/compressed/head_64.S
arch/x86/boot/compressed/misc.c
arch/x86/boot/compressed/vmlinux_64.lds
arch/x86/boot/copy.S
arch/x86/boot/cpucheck.c
arch/x86/boot/edd.c
arch/x86/boot/install.sh
arch/x86/boot/main.c
arch/x86/boot/mca.c
arch/x86/boot/memory.c
arch/x86/boot/pm.c
arch/x86/boot/pmjump.S
arch/x86/boot/printf.c
arch/x86/boot/string.c
arch/x86/boot/tty.c
arch/x86/boot/version.c
arch/x86/boot/video-bios.c
arch/x86/boot/video-vesa.c
arch/x86/boot/video-vga.c
arch/x86/boot/video.c
arch/x86/boot/video.h
arch/x86/boot/voyager.c
arch/x86/ia32/sys_ia32.c
arch/x86/kernel/Makefile
arch/x86/kernel/acpi/cstate.c
arch/x86/kernel/acpi/processor.c
arch/x86/kernel/cpu/common.c
arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c
arch/x86/kernel/cpu/cpufreq/p4-clockmod.c
arch/x86/kernel/cpu/cpufreq/powernow-k8.c
arch/x86/kernel/cpu/cpufreq/speedstep-centrino.c
arch/x86/kernel/cpu/cpufreq/speedstep-ich.c
arch/x86/kernel/cpu/intel_cacheinfo.c
arch/x86/kernel/cpu/mcheck/mce_amd_64.c
arch/x86/kernel/cpu/mcheck/therm_throt.c
arch/x86/kernel/cpu/proc.c
arch/x86/kernel/cpuid.c
arch/x86/kernel/e820_32.c
arch/x86/kernel/e820_64.c
arch/x86/kernel/efi.c
arch/x86/kernel/efi_64.c
arch/x86/kernel/entry_32.S
arch/x86/kernel/genx2apic_uv_x.c
arch/x86/kernel/head64.c
arch/x86/kernel/head_32.S
arch/x86/kernel/i387.c
arch/x86/kernel/io_apic_64.c
arch/x86/kernel/kgdb.c
arch/x86/kernel/microcode.c
arch/x86/kernel/msr.c
arch/x86/kernel/nmi_32.c
arch/x86/kernel/nmi_64.c
arch/x86/kernel/pci-calgary_64.c
arch/x86/kernel/pci-dma.c [moved from arch/x86/kernel/pci-dma_64.c with 55% similarity]
arch/x86/kernel/pci-dma_32.c [deleted file]
arch/x86/kernel/pci-gart_64.c
arch/x86/kernel/pci-nommu.c [moved from arch/x86/kernel/pci-nommu_64.c with 77% similarity]
arch/x86/kernel/pci-swiotlb_64.c
arch/x86/kernel/process.c [new file with mode: 0644]
arch/x86/kernel/process_32.c
arch/x86/kernel/process_64.c
arch/x86/kernel/reboot.c
arch/x86/kernel/setup.c
arch/x86/kernel/setup64.c
arch/x86/kernel/setup_32.c
arch/x86/kernel/setup_64.c
arch/x86/kernel/smpboot.c
arch/x86/kernel/traps_32.c
arch/x86/kernel/traps_64.c
arch/x86/kernel/tsc_32.c
arch/x86/kernel/tsc_64.c
arch/x86/mach-visws/visws_apic.c
arch/x86/mach-voyager/voyager_basic.c
arch/x86/mach-voyager/voyager_cat.c
arch/x86/mach-voyager/voyager_smp.c
arch/x86/mach-voyager/voyager_thread.c
arch/x86/math-emu/fpu_entry.c
arch/x86/math-emu/fpu_system.h
arch/x86/math-emu/reg_ld_str.c
arch/x86/mm/discontig_32.c
arch/x86/mm/init_32.c
arch/x86/mm/init_64.c
arch/x86/mm/ioremap.c
arch/x86/mm/k8topology_64.c
arch/x86/mm/numa_64.c
arch/x86/mm/pgtable_32.c
arch/x86/mm/srat_64.c
arch/x86/oprofile/nmi_int.c
arch/x86/vdso/Makefile
arch/x86/video/fbdev.c
block/bsg.c
drivers/acpi/processor_throttling.c
drivers/ata/ahci.c
drivers/ata/libata-core.c
drivers/ata/libata-scsi.c
drivers/ata/sata_mv.c
drivers/atm/iphase.c
drivers/atm/nicstar.c
drivers/atm/nicstar.h
drivers/base/attribute_container.c
drivers/base/bus.c
drivers/base/class.c
drivers/base/core.c
drivers/base/cpu.c
drivers/base/dd.c
drivers/base/firmware_class.c
drivers/base/memory.c
drivers/base/node.c
drivers/base/power/main.c
drivers/base/power/power.h
drivers/base/power/sysfs.c
drivers/base/sys.c
drivers/base/topology.c
drivers/base/transport_class.c
drivers/block/cryptoloop.c
drivers/block/viodasd.c
drivers/bluetooth/hci_usb.c
drivers/bluetooth/hci_usb.h
drivers/char/Kconfig
drivers/char/drm/drmP.h
drivers/char/generic_serial.c
drivers/char/hvc_beat.c
drivers/char/hw_random/core.c
drivers/char/keyboard.c
drivers/char/misc.c
drivers/char/mwave/tp3780i.c
drivers/char/pcmcia/synclink_cs.c
drivers/char/rio/rioboot.c
drivers/char/rio/riocmd.c
drivers/char/rio/rioctrl.c
drivers/char/rio/rioinit.c
drivers/char/rio/riointr.c
drivers/char/rio/rioparam.c
drivers/char/rio/rioroute.c
drivers/char/rio/riotable.c
drivers/char/rio/riotty.c
drivers/char/snsc.h
drivers/char/specialix.c
drivers/char/stallion.c
drivers/char/synclink.c
drivers/char/synclink_gt.c
drivers/char/synclinkmp.c
drivers/char/tpm/tpm_tis.c
drivers/char/xilinx_hwicap/buffer_icap.c
drivers/char/xilinx_hwicap/buffer_icap.h
drivers/char/xilinx_hwicap/fifo_icap.c
drivers/char/xilinx_hwicap/fifo_icap.h
drivers/char/xilinx_hwicap/xilinx_hwicap.c
drivers/char/xilinx_hwicap/xilinx_hwicap.h
drivers/clocksource/Makefile
drivers/clocksource/tcb_clksrc.c [new file with mode: 0644]
drivers/firewire/fw-device.c
drivers/firewire/fw-transaction.c
drivers/firmware/Kconfig
drivers/firmware/Makefile
drivers/firmware/dcdbas.c
drivers/firmware/iscsi_ibft.c [new file with mode: 0644]
drivers/firmware/iscsi_ibft_find.c [new file with mode: 0644]
drivers/i2c/busses/Kconfig
drivers/i2c/busses/i2c-pxa.c
drivers/i2c/chips/Kconfig
drivers/i2c/chips/tps65010.c
drivers/i2c/i2c-core.c
drivers/ieee1394/nodemgr.c
drivers/infiniband/core/sysfs.c
drivers/infiniband/core/ucm.c
drivers/infiniband/core/user_mad.c
drivers/infiniband/core/uverbs.h
drivers/infiniband/core/uverbs_main.c
drivers/infiniband/hw/amso1100/c2.h
drivers/infiniband/hw/amso1100/c2_provider.c
drivers/infiniband/hw/cxgb3/iwch_provider.c
drivers/infiniband/hw/ipath/ipath_diag.c
drivers/infiniband/hw/ipath/ipath_file_ops.c
drivers/infiniband/hw/ipath/ipath_kernel.h
drivers/infiniband/hw/ipath/ipath_verbs.c
drivers/infiniband/hw/mlx4/main.c
drivers/infiniband/hw/mthca/mthca_dev.h
drivers/infiniband/hw/mthca/mthca_provider.c
drivers/infiniband/hw/nes/nes.h
drivers/infiniband/hw/nes/nes_verbs.c
drivers/infiniband/ulp/srp/ib_srp.c
drivers/infiniband/ulp/srp/ib_srp.h
drivers/input/keyboard/Kconfig
drivers/input/keyboard/Makefile
drivers/input/keyboard/corgikbd.c
drivers/input/keyboard/sh_keysc.c [new file with mode: 0644]
drivers/input/keyboard/spitzkbd.c
drivers/input/serio/hp_sdc_mlc.c
drivers/input/touchscreen/ads7846.c
drivers/input/touchscreen/corgi_ts.c
drivers/isdn/hisax/asuscom.c
drivers/isdn/hisax/avm_a1.c
drivers/isdn/hisax/bkm_a4t.c
drivers/isdn/hisax/bkm_a8.c
drivers/isdn/hisax/config.c
drivers/isdn/hisax/elsa.c
drivers/isdn/hisax/elsa_ser.c
drivers/isdn/hisax/gazel.c
drivers/isdn/hisax/hfc_pci.c
drivers/isdn/hisax/hfc_sx.c
drivers/isdn/hisax/hisax.h
drivers/isdn/hisax/hisax_cfg.h
drivers/isdn/hisax/isurf.c
drivers/isdn/hisax/ix1_micro.c
drivers/isdn/hisax/mic.c
drivers/isdn/hisax/netjet.h
drivers/isdn/hisax/niccy.c
drivers/isdn/hisax/nj_s.c
drivers/isdn/hisax/nj_u.c
drivers/isdn/hisax/s0box.c
drivers/isdn/hisax/saphir.c
drivers/isdn/hisax/sportster.c
drivers/isdn/hisax/teleint.c
drivers/isdn/hisax/telespci.c
drivers/isdn/hisax/w6692.c
drivers/leds/Kconfig
drivers/leds/Makefile
drivers/leds/led-class.c
drivers/leds/leds-tosa.c [deleted file]
drivers/lguest/lg.h
drivers/macintosh/adb.c
drivers/macintosh/windfarm_smu_sat.c
drivers/media/radio/radio-aimslab.c
drivers/media/video/ir-kbd-i2c.c
drivers/media/video/ov511.c
drivers/media/video/pvrusb2/pvrusb2-context.c
drivers/media/video/pvrusb2/pvrusb2-hdw.c
drivers/media/video/pvrusb2/pvrusb2-sysfs.c
drivers/memstick/core/memstick.c
drivers/memstick/core/mspro_block.c
drivers/memstick/host/jmb38x_ms.c
drivers/message/fusion/mptscsih.c
drivers/message/fusion/mptscsih.h
drivers/mfd/Kconfig
drivers/mfd/Makefile
drivers/mfd/htc-egpio.c [new file with mode: 0644]
drivers/mfd/htc-pasic3.c [new file with mode: 0644]
drivers/mfd/ucb1x00-ts.c
drivers/misc/Kconfig
drivers/misc/Makefile
drivers/misc/atmel_tclib.c [new file with mode: 0644]
drivers/misc/enclosure.c
drivers/mtd/nand/Kconfig
drivers/mtd/nand/fsl_elbc_nand.c
drivers/mtd/nand/orion_nand.c
drivers/net/3c527.c
drivers/net/Kconfig
drivers/net/Makefile
drivers/net/appletalk/cops.c
drivers/net/arm/at91_ether.c
drivers/net/cxgb3/adapter.h
drivers/net/cxgb3/t3cdev.h
drivers/net/hamradio/6pack.c
drivers/net/ibmveth.c
drivers/net/irda/pxaficp_ir.c
drivers/net/iseries_veth.c
drivers/net/netxen/netxen_nic_hdr.h
drivers/net/pasemi_mac.c
drivers/net/pasemi_mac.h
drivers/net/pasemi_mac_ethtool.c [new file with mode: 0644]
drivers/net/ps3_gelic_net.c
drivers/net/ps3_gelic_net.h
drivers/net/tg3.c
drivers/net/tg3.h
drivers/net/ucc_geth.c
drivers/net/ucc_geth_mii.c
drivers/net/usb/kaweth.c
drivers/net/wireless/b43/leds.c
drivers/net/wireless/b43/main.c
drivers/net/wireless/iwlwifi/iwl-debugfs.c
drivers/of/Kconfig
drivers/of/Makefile
drivers/of/base.c
drivers/of/gpio.c [new file with mode: 0644]
drivers/of/of_i2c.c [new file with mode: 0644]
drivers/parport/Kconfig
drivers/pci/pci-driver.c
drivers/pci/pci-sysfs.c
drivers/pci/probe.c
drivers/pcmcia/Kconfig
drivers/pcmcia/pxa2xx_cm_x270.c
drivers/ps3/ps3-sys-manager.c
drivers/ps3/sys-manager-core.c
drivers/rtc/rtc-sh.c
drivers/s390/cio/ccwgroup.c
drivers/s390/cio/qdio.c
drivers/scsi/3w-9xxx.c
drivers/scsi/3w-xxxx.c
drivers/scsi/aacraid/aachba.c
drivers/scsi/aacraid/aacraid.h
drivers/scsi/aacraid/commctrl.c
drivers/scsi/aacraid/comminit.c
drivers/scsi/aacraid/commsup.c
drivers/scsi/aacraid/dpcsup.c
drivers/scsi/aacraid/linit.c
drivers/scsi/aacraid/rx.c
drivers/scsi/aacraid/sa.c
drivers/scsi/arcmsr/arcmsr.h
drivers/scsi/arcmsr/arcmsr_attr.c
drivers/scsi/ch.c
drivers/scsi/dpt/dpti_i2o.h
drivers/scsi/hosts.c
drivers/scsi/hptiop.c
drivers/scsi/ibmvscsi/ibmvscsi.c
drivers/scsi/ibmvscsi/ibmvstgt.c
drivers/scsi/ipr.c
drivers/scsi/lpfc/lpfc_attr.c
drivers/scsi/lpfc/lpfc_crtn.h
drivers/scsi/megaraid/mega_common.h
drivers/scsi/megaraid/megaraid_ioctl.h
drivers/scsi/megaraid/megaraid_mbox.c
drivers/scsi/ncr53c8xx.c
drivers/scsi/osst.c
drivers/scsi/pcmcia/sym53c500_cs.c
drivers/scsi/qla2xxx/qla_attr.c
drivers/scsi/qla2xxx/qla_def.h
drivers/scsi/qla2xxx/qla_gbl.h
drivers/scsi/raid_class.c
drivers/scsi/scsi_sas_internal.h
drivers/scsi/scsi_sysfs.c
drivers/scsi/scsi_transport_fc.c
drivers/scsi/scsi_transport_iscsi.c
drivers/scsi/scsi_transport_sas.c
drivers/scsi/scsi_transport_spi.c
drivers/scsi/scsi_transport_srp.c
drivers/scsi/sd.c
drivers/scsi/ses.c
drivers/scsi/sg.c
drivers/scsi/st.c
drivers/serial/cpm_uart/cpm_uart.h
drivers/serial/cpm_uart/cpm_uart_core.c
drivers/serial/cpm_uart/cpm_uart_cpm1.c
drivers/serial/cpm_uart/cpm_uart_cpm2.c
drivers/serial/imx.c
drivers/serial/mcfserial.c
drivers/serial/of_serial.c
drivers/serial/serial_core.c
drivers/serial/sh-sci.c
drivers/serial/sh-sci.h
drivers/serial/ucc_uart.c
drivers/uio/Kconfig
drivers/uio/Makefile
drivers/uio/uio.c
drivers/uio/uio_cif.c
drivers/uio/uio_smx.c [new file with mode: 0644]
drivers/usb/atm/usbatm.h
drivers/usb/core/hub.c
drivers/usb/gadget/Kconfig
drivers/usb/gadget/atmel_usba_udc.c
drivers/usb/gadget/atmel_usba_udc.h
drivers/usb/host/ehci-hcd.c
drivers/usb/host/ehci-orion.c
drivers/usb/misc/appledisplay.c
drivers/usb/serial/io_ti.c
drivers/usb/serial/ti_usb_3410_5052.c
drivers/video/pxafb.c
drivers/watchdog/sc1200wdt.c
fs/9p/fid.c
fs/cramfs/inode.c
fs/dlm/dlm_internal.h
fs/ext2/ioctl.c
fs/ext3/ioctl.c
fs/ext4/ioctl.c
fs/fat/file.c
fs/file_table.c
fs/hfsplus/ioctl.c
fs/inode.c
fs/jffs2/jffs2_fs_i.h
fs/jffs2/jffs2_fs_sb.h
fs/jfs/ioctl.c
fs/locks.c
fs/namei.c
fs/namespace.c
fs/ncpfs/ioctl.c
fs/nfs/dir.c
fs/nfsd/nfs4proc.c
fs/nfsd/nfs4recover.c
fs/nfsd/nfs4state.c
fs/nfsd/vfs.c
fs/ocfs2/ioctl.c
fs/open.c
fs/partitions/check.c
fs/reiserfs/ioctl.c
fs/reiserfs/journal.c
fs/reiserfs/xattr.c
fs/super.c
fs/sysfs/dir.c
fs/sysfs/file.c
fs/utimes.c
fs/xattr.c
fs/xfs/linux-2.6/sema.h
fs/xfs/linux-2.6/xfs_ioctl.c
fs/xfs/linux-2.6/xfs_iops.c
fs/xfs/linux-2.6/xfs_lrw.c
include/asm-alpha/topology.h
include/asm-arm/arch-at91/at91_ecc.h
include/asm-arm/arch-at91/at91_pmc.h
include/asm-arm/arch-at91/at91_shdwc.h
include/asm-arm/arch-at91/at91cap9_ddrsdr.h [new file with mode: 0644]
include/asm-arm/arch-at91/at91sam9_sdramc.h [moved from include/asm-arm/arch-at91/at91sam926x_mc.h with 52% similarity]
include/asm-arm/arch-at91/at91sam9_smc.h [new file with mode: 0644]
include/asm-arm/arch-ep93xx/gpio.h
include/asm-arm/arch-ks8695/devices.h
include/asm-arm/arch-mxc/board-mx31ads.h
include/asm-arm/arch-mxc/dma.h
include/asm-arm/arch-mxc/hardware.h
include/asm-arm/arch-mxc/io.h
include/asm-arm/arch-mxc/irqs.h
include/asm-arm/arch-mxc/memory.h
include/asm-arm/arch-mxc/mx31.h
include/asm-arm/arch-mxc/mxc.h
include/asm-arm/arch-mxc/system.h
include/asm-arm/arch-mxc/vmalloc.h
include/asm-arm/arch-ns9xxx/board.h
include/asm-arm/arch-ns9xxx/clock.h [deleted file]
include/asm-arm/arch-ns9xxx/entry-macro.S
include/asm-arm/arch-ns9xxx/irqs.h
include/asm-arm/arch-ns9xxx/module.h [new file with mode: 0644]
include/asm-arm/arch-ns9xxx/processor-ns9360.h [new file with mode: 0644]
include/asm-arm/arch-ns9xxx/processor.h
include/asm-arm/arch-ns9xxx/regs-sys-common.h [new file with mode: 0644]
include/asm-arm/arch-ns9xxx/regs-sys-ns9360.h [moved from include/asm-arm/arch-ns9xxx/regs-sys.h with 90% similarity]
include/asm-arm/arch-ns9xxx/system.h
include/asm-arm/arch-ns9xxx/uncompress.h
include/asm-arm/arch-omap/board-osk.h
include/asm-arm/arch-omap/clock.h
include/asm-arm/arch-omap/control.h [new file with mode: 0644]
include/asm-arm/arch-omap/entry-macro.S
include/asm-arm/arch-omap/gpio.h
include/asm-arm/arch-omap/io.h
include/asm-arm/arch-omap/mux.h
include/asm-arm/arch-omap/omap24xx.h
include/asm-arm/arch-omap/sdrc.h [new file with mode: 0644]
include/asm-arm/arch-omap/usb.h
include/asm-arm/arch-orion/io.h [deleted file]
include/asm-arm/arch-orion/irqs.h [deleted file]
include/asm-arm/arch-orion/orion.h [deleted file]
include/asm-arm/arch-orion/timex.h [deleted file]
include/asm-arm/arch-orion5x/debug-macro.S [moved from include/asm-arm/arch-orion/debug-macro.S with 73% similarity]
include/asm-arm/arch-orion5x/dma.h [moved from include/asm-arm/arch-orion/dma.h with 100% similarity]
include/asm-arm/arch-orion5x/entry-macro.S [moved from include/asm-arm/arch-orion/entry-macro.S with 90% similarity]
include/asm-arm/arch-orion5x/gpio.h [moved from include/asm-arm/arch-orion/gpio.h with 79% similarity]
include/asm-arm/arch-orion5x/hardware.h [moved from include/asm-arm/arch-orion/hardware.h with 64% similarity]
include/asm-arm/arch-orion5x/io.h [new file with mode: 0644]
include/asm-arm/arch-orion5x/irqs.h [new file with mode: 0644]
include/asm-arm/arch-orion5x/memory.h [moved from include/asm-arm/arch-orion/memory.h with 64% similarity]
include/asm-arm/arch-orion5x/orion5x.h [new file with mode: 0644]
include/asm-arm/arch-orion5x/system.h [moved from include/asm-arm/arch-orion/system.h with 54% similarity]
include/asm-arm/arch-orion5x/timex.h [new file with mode: 0644]
include/asm-arm/arch-orion5x/uncompress.h [moved from include/asm-arm/arch-orion/uncompress.h with 71% similarity]
include/asm-arm/arch-orion5x/vmalloc.h [moved from include/asm-arm/arch-orion/vmalloc.h with 51% similarity]
include/asm-arm/arch-pxa/camera.h [new file with mode: 0644]
include/asm-arm/arch-pxa/gumstix.h [new file with mode: 0644]
include/asm-arm/arch-pxa/irda.h
include/asm-arm/arch-pxa/irqs.h
include/asm-arm/arch-pxa/magician.h
include/asm-arm/arch-pxa/mfp-pxa25x.h [new file with mode: 0644]
include/asm-arm/arch-pxa/mfp-pxa27x.h [new file with mode: 0644]
include/asm-arm/arch-pxa/mfp-pxa2xx.h [new file with mode: 0644]
include/asm-arm/arch-pxa/pxa-regs.h
include/asm-arm/arch-pxa/pxa27x_keypad.h
include/asm-arm/arch-pxa/pxa2xx-gpio.h [new file with mode: 0644]
include/asm-arm/arch-pxa/pxa3xx-regs.h
include/asm-arm/arch-pxa/tosa.h
include/asm-arm/arch-pxa/zylonite.h
include/asm-arm/arch-realview/board-eb.h
include/asm-arm/arch-realview/board-pb1176.h [new file with mode: 0644]
include/asm-arm/arch-realview/board-pb11mp.h [new file with mode: 0644]
include/asm-arm/arch-realview/debug-macro.S
include/asm-arm/arch-realview/hardware.h
include/asm-arm/arch-realview/irqs.h
include/asm-arm/arch-realview/platform.h
include/asm-arm/arch-realview/scu.h
include/asm-arm/arch-realview/uncompress.h
include/asm-arm/arch-s3c2410/regs-clock.h
include/asm-arm/arch-s3c2410/regs-gpio.h
include/asm-arm/arch-s3c2410/regs-s3c2412-mem.h [new file with mode: 0644]
include/asm-arm/arch-s3c2410/system-reset.h [new file with mode: 0644]
include/asm-arm/arch-s3c2410/system.h
include/asm-arm/arch-sa1100/gpio.h
include/asm-arm/cpu-multi32.h
include/asm-arm/glue.h
include/asm-arm/hardware/arm_scu.h [deleted file]
include/asm-arm/hardware/iop3xx.h
include/asm-arm/hardware/scoop.h
include/asm-arm/hwcap.h
include/asm-arm/mach/pci.h
include/asm-arm/memory.h
include/asm-arm/plat-orion/ehci-orion.h [new file with mode: 0644]
include/asm-arm/plat-orion/irq.h [new file with mode: 0644]
include/asm-arm/plat-orion/orion_nand.h [moved from include/asm-arm/arch-orion/platform.h with 64% similarity]
include/asm-arm/plat-orion/pcie.h [new file with mode: 0644]
include/asm-arm/plat-orion/time.h [new file with mode: 0644]
include/asm-arm/sparsemem.h [new file with mode: 0644]
include/asm-arm/thread_info.h
include/asm-arm/unistd.h
include/asm-avr32/arch-at32ap/board.h
include/asm-avr32/arch-at32ap/pm.h [new file with mode: 0644]
include/asm-avr32/arch-at32ap/time.h [deleted file]
include/asm-avr32/asm.h
include/asm-avr32/intc.h [deleted file]
include/asm-avr32/irq.h
include/asm-avr32/page.h
include/asm-avr32/serial.h [new file with mode: 0644]
include/asm-avr32/xor.h [new file with mode: 0644]
include/asm-blackfin/dma.h
include/asm-frv/topology.h
include/asm-generic/topology.h
include/asm-ia64/sn/nodepda.h
include/asm-ia64/topology.h
include/asm-powerpc/Kbuild
include/asm-powerpc/abs_addr.h
include/asm-powerpc/bitops.h
include/asm-powerpc/cpm.h
include/asm-powerpc/cpm1.h
include/asm-powerpc/cpm2.h
include/asm-powerpc/cputhreads.h
include/asm-powerpc/dcr-native.h
include/asm-powerpc/dcr-regs.h
include/asm-powerpc/exception.h
include/asm-powerpc/fsl_lbc.h [new file with mode: 0644]
include/asm-powerpc/gpio.h [new file with mode: 0644]
include/asm-powerpc/hw_irq.h
include/asm-powerpc/immap_qe.h
include/asm-powerpc/irqflags.h
include/asm-powerpc/iseries/alpaca.h [new file with mode: 0644]
include/asm-powerpc/iseries/it_lp_reg_save.h [deleted file]
include/asm-powerpc/lmb.h
include/asm-powerpc/machdep.h
include/asm-powerpc/macio.h
include/asm-powerpc/mmu-40x.h
include/asm-powerpc/mmu-44x.h
include/asm-powerpc/mmu-8xx.h
include/asm-powerpc/mmu-fsl-booke.h
include/asm-powerpc/mmu-hash32.h
include/asm-powerpc/mmu-hash64.h
include/asm-powerpc/paca.h
include/asm-powerpc/page.h
include/asm-powerpc/page_32.h
include/asm-powerpc/pasemi_dma.h
include/asm-powerpc/pci-bridge.h
include/asm-powerpc/pgtable-ppc32.h
include/asm-powerpc/phyp_dump.h [new file with mode: 0644]
include/asm-powerpc/pmi.h
include/asm-powerpc/ppc4xx.h [new file with mode: 0644]
include/asm-powerpc/ps3.h
include/asm-powerpc/ptrace.h
include/asm-powerpc/qe.h
include/asm-powerpc/rwsem.h
include/asm-powerpc/sparsemem.h
include/asm-powerpc/spinlock.h
include/asm-powerpc/string.h
include/asm-powerpc/system.h
include/asm-powerpc/topology.h
include/asm-powerpc/types.h
include/asm-ppc/ocp.h
include/asm-sh/bugs.h
include/asm-sh/cpu-sh4/freq.h
include/asm-sh/cpu-sh4/rtc.h
include/asm-sh/migor.h [new file with mode: 0644]
include/asm-sh/processor.h
include/asm-sh/r7780rp.h
include/asm-sh/se7721.h [new file with mode: 0644]
include/asm-sh/se7722.h
include/asm-sh/sh_keysc.h [new file with mode: 0644]
include/asm-sh/system.h
include/asm-sh/topology.h
include/asm-sh/uaccess_32.h
include/asm-sparc/floppy.h
include/asm-sparc64/lmb.h [new file with mode: 0644]
include/asm-x86/boot.h
include/asm-x86/dma-mapping.h
include/asm-x86/dma-mapping_32.h [deleted file]
include/asm-x86/dma-mapping_64.h [deleted file]
include/asm-x86/e820_32.h
include/asm-x86/genapic_32.h
include/asm-x86/i387.h
include/asm-x86/numa_64.h
include/asm-x86/pci_64.h
include/asm-x86/processor.h
include/asm-x86/scatterlist.h
include/asm-x86/thread_info.h
include/asm-x86/thread_info_32.h
include/asm-x86/thread_info_64.h
include/asm-x86/topology.h
include/asm-x86/tsc.h
include/linux/ata_platform.h
include/linux/atmel_tc.h [new file with mode: 0644]
include/linux/attribute_container.h
include/linux/bitmap.h
include/linux/bsg.h
include/linux/cpu.h
include/linux/cpumask.h
include/linux/cpuset.h
include/linux/device.h
include/linux/efi.h
include/linux/enclosure.h
include/linux/file.h
include/linux/fs.h
include/linux/hil_mlc.h
include/linux/hw_random.h
include/linux/i2c/tps65010.h
include/linux/i2o.h
include/linux/ide.h
include/linux/if_pppox.h
include/linux/init_task.h
include/linux/irqflags.h
include/linux/iscsi_ibft.h [new file with mode: 0644]
include/linux/jbd.h
include/linux/jbd2.h
include/linux/jiffies.h
include/linux/kernel.h
include/linux/kernelcapi.h
include/linux/ktime.h
include/linux/leds.h
include/linux/libata.h
include/linux/list.h
include/linux/lmb.h [new file with mode: 0644]
include/linux/mbus.h [new file with mode: 0644]
include/linux/memory.h
include/linux/memstick.h
include/linux/mfd/htc-egpio.h [new file with mode: 0644]
include/linux/mfd/htc-pasic3.h [new file with mode: 0644]
include/linux/miscdevice.h
include/linux/mount.h
include/linux/of.h
include/linux/of_gpio.h [new file with mode: 0644]
include/linux/of_i2c.h [new file with mode: 0644]
include/linux/parport.h
include/linux/pm.h
include/linux/pm_wakeup.h [new file with mode: 0644]
include/linux/prctl.h
include/linux/raid/md.h
include/linux/raid_class.h
include/linux/sched.h
include/linux/skbuff.h
include/linux/syscalls.h
include/linux/sysdev.h
include/linux/sysfs.h
include/linux/topology.h
include/linux/transport_class.h
include/linux/usb/atmel_usba_udc.h [new file with mode: 0644]
include/rdma/ib_verbs.h
include/scsi/libsas.h
include/scsi/scsi_device.h
include/scsi/scsi_host.h
include/scsi/scsi_transport.h
include/scsi/scsi_transport_fc.h
include/scsi/scsi_transport_sas.h
include/scsi/sd.h
init/Kconfig
init/main.c
ipc/mqueue.c
kernel/compat.c
kernel/cpu.c
kernel/cpuset.c
kernel/fork.c
kernel/hrtimer.c
kernel/irq/chip.c
kernel/kexec.c
kernel/kmod.c
kernel/kthread.c
kernel/latencytop.c
kernel/module.c
kernel/posix-timers.c
kernel/profile.c
kernel/ptrace.c
kernel/rcupreempt.c
kernel/rcutorture.c
kernel/sched.c
kernel/sched_debug.c
kernel/sched_fair.c
kernel/sched_features.h [new file with mode: 0644]
kernel/sched_rt.c
kernel/sched_stats.h
kernel/softirq.c
kernel/stop_machine.c
kernel/sys.c
kernel/sysctl.c
kernel/time/tick-broadcast.c
kernel/time/tick-sched.c
kernel/time/timekeeping.c
kernel/user.c
lib/Kconfig
lib/Kconfig.debug
lib/Makefile
lib/bitmap.c
lib/kernel_lock.c
lib/kobject.c
lib/lmb.c [new file with mode: 0644]
lib/reed_solomon/reed_solomon.c
mm/allocpercpu.c
mm/memory_hotplug.c
mm/page_alloc.c
mm/pdflush.c
mm/slab.c
mm/vmscan.c
net/core/flow.c
net/dccp/proto.c
net/ipv4/ipcomp.c
net/ipv4/netfilter/Kconfig
net/ipv6/ipcomp6.c
net/netfilter/nf_conntrack_sip.c
net/rose/af_rose.c
net/sunrpc/svc.c
net/unix/af_unix.c
samples/firmware_class/firmware_sample_driver.c [moved from Documentation/firmware_class/firmware_sample_driver.c with 74% similarity]
samples/firmware_class/firmware_sample_firmware_class.c [moved from Documentation/firmware_class/firmware_sample_firmware_class.c with 90% similarity]
scripts/mod/file2alias.c
security/selinux/selinuxfs.c
security/selinux/ss/conditional.c
security/selinux/xfrm.c
sound/arm/pxa2xx-ac97.c
sound/soc/at91/eti_b1_wm8731.c
sound/soc/pxa/pxa2xx-ac97.c
sound/soc/pxa/pxa2xx-i2s.c

diff --git a/Documentation/ABI/testing/sysfs-ibft b/Documentation/ABI/testing/sysfs-ibft
new file mode 100644 (file)
index 0000000..c2b7d11
--- /dev/null
@@ -0,0 +1,23 @@
+What:          /sys/firmware/ibft/initiator
+Date:          November 2007
+Contact:       Konrad Rzeszutek <ketuzsezr@darnok.org>
+Description:   The /sys/firmware/ibft/initiator directory will contain
+               files that expose the iSCSI Boot Firmware Table initiator data.
+               Usually this contains the Initiator name.
+
+What:          /sys/firmware/ibft/targetX
+Date:          November 2007
+Contact:       Konrad Rzeszutek <ketuzsezr@darnok.org>
+Description:   The /sys/firmware/ibft/targetX directory will contain
+               files that expose the iSCSI Boot Firmware Table target data.
+               Usually this contains the target's IP address, boot LUN,
+               target name, and what NIC it is associated with. It can also
+               contain the CHAP name (and password), the reverse CHAP
+               name (and password)
+
+What:          /sys/firmware/ibft/ethernetX
+Date:          November 2007
+Contact:       Konrad Rzeszutek <ketuzsezr@darnok.org>
+Description:   The /sys/firmware/ibft/ethernetX directory will contain
+               files that expose the iSCSI Boot Firmware Table NIC data.
+               This can this can the IP address, MAC, and gateway of the NIC.
index dc0f30c3e5715d6801e482dc51988fe992d7bf82..488dd4a4945b84205f66fbdec3ba4b3cbe5af003 100644 (file)
@@ -297,11 +297,6 @@ X!Earch/x86/kernel/mca_32.c
 !Ikernel/acct.c
   </chapter>
 
-  <chapter id="pmfuncs">
-     <title>Power Management</title>
-!Ekernel/power/pm.c
-  </chapter>
-
   <chapter id="devdrivers">
      <title>Device drivers infrastructure</title>
      <sect1><title>Device Drivers Base</title>
index 2e9d6b41f034594b3b1af87c97ab1da81f5caccd..435413ca40dcb8148ebdc11c8634bf359af0f1c6 100644 (file)
    </para>
    <para>
      The third type is a semaphore
-     (<filename class="headerfile">include/asm/semaphore.h</filename>): it
+     (<filename class="headerfile">include/linux/semaphore.h</filename>): it
      can have more than one holder at any time (the number decided at
      initialization time), although it is most commonly used as a
      single-holder lock (a mutex).  If you can't get a semaphore, your
      <para>
        If you have a data structure which is only ever accessed from
        user context, then you can use a simple semaphore
-       (<filename>linux/asm/semaphore.h</filename>) to protect it.  This 
+       (<filename>linux/linux/semaphore.h</filename>) to protect it.  This
        is the most trivial case: you initialize the semaphore to the number 
        of resources available (usually 1), and call
        <function>down_interruptible()</function> to grab the semaphore, and 
@@ -1656,7 +1656,7 @@ the amount of locking which needs to be done.
  #include &lt;linux/slab.h&gt;
  #include &lt;linux/string.h&gt;
 +#include &lt;linux/rcupdate.h&gt;
- #include &lt;asm/semaphore.h&gt;
+ #include &lt;linux/semaphore.h&gt;
  #include &lt;asm/errno.h&gt;
 
  struct object
index ad2bb3b3acc1792a2f8a1c2ccdb999c37aaf794c..aa854b9b18cda8de6fae047540a529b55ca81405 100644 (file)
@@ -8,6 +8,7 @@ Portions Copyright (c) 2004-2006 Silicon Graphics, Inc.
 Modified by Paul Jackson <pj@sgi.com>
 Modified by Christoph Lameter <clameter@sgi.com>
 Modified by Paul Menage <menage@google.com>
+Modified by Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
 
 CONTENTS:
 =========
@@ -20,7 +21,8 @@ CONTENTS:
   1.5 What is memory_pressure ?
   1.6 What is memory spread ?
   1.7 What is sched_load_balance ?
-  1.8 How do I use cpusets ?
+  1.8 What is sched_relax_domain_level ?
+  1.9 How do I use cpusets ?
 2. Usage Examples and Syntax
   2.1 Basic Usage
   2.2 Adding/removing cpus
@@ -497,7 +499,73 @@ the cpuset code to update these sched domains, it compares the new
 partition requested with the current, and updates its sched domains,
 removing the old and adding the new, for each change.
 
-1.8 How do I use cpusets ?
+
+1.8 What is sched_relax_domain_level ?
+--------------------------------------
+
+In sched domain, the scheduler migrates tasks in 2 ways; periodic load
+balance on tick, and at time of some schedule events.
+
+When a task is woken up, scheduler try to move the task on idle CPU.
+For example, if a task A running on CPU X activates another task B
+on the same CPU X, and if CPU Y is X's sibling and performing idle,
+then scheduler migrate task B to CPU Y so that task B can start on
+CPU Y without waiting task A on CPU X.
+
+And if a CPU run out of tasks in its runqueue, the CPU try to pull
+extra tasks from other busy CPUs to help them before it is going to
+be idle.
+
+Of course it takes some searching cost to find movable tasks and/or
+idle CPUs, the scheduler might not search all CPUs in the domain
+everytime.  In fact, in some architectures, the searching ranges on
+events are limited in the same socket or node where the CPU locates,
+while the load balance on tick searchs all.
+
+For example, assume CPU Z is relatively far from CPU X.  Even if CPU Z
+is idle while CPU X and the siblings are busy, scheduler can't migrate
+woken task B from X to Z since it is out of its searching range.
+As the result, task B on CPU X need to wait task A or wait load balance
+on the next tick.  For some applications in special situation, waiting
+1 tick may be too long.
+
+The 'sched_relax_domain_level' file allows you to request changing
+this searching range as you like.  This file takes int value which
+indicates size of searching range in levels ideally as follows,
+otherwise initial value -1 that indicates the cpuset has no request.
+
+  -1  : no request. use system default or follow request of others.
+   0  : no search.
+   1  : search siblings (hyperthreads in a core).
+   2  : search cores in a package.
+   3  : search cpus in a node [= system wide on non-NUMA system]
+ ( 4  : search nodes in a chunk of node [on NUMA system] )
+ ( 5~ : search system wide [on NUMA system])
+
+This file is per-cpuset and affect the sched domain where the cpuset
+belongs to.  Therefore if the flag 'sched_load_balance' of a cpuset
+is disabled, then 'sched_relax_domain_level' have no effect since
+there is no sched domain belonging the cpuset.
+
+If multiple cpusets are overlapping and hence they form a single sched
+domain, the largest value among those is used.  Be careful, if one
+requests 0 and others are -1 then 0 is used.
+
+Note that modifying this file will have both good and bad effects,
+and whether it is acceptable or not will be depend on your situation.
+Don't modify this file if you are not sure.
+
+If your situation is:
+ - The migration costs between each cpu can be assumed considerably
+   small(for you) due to your special application's behavior or
+   special hardware support for CPU cache etc.
+ - The searching cost doesn't have impact(for you) or you can make
+   the searching cost enough small by managing cpuset to compact etc.
+ - The latency is required even it sacrifices cache hit rate etc.
+then increasing 'sched_relax_domain_level' would benefit you.
+
+
+1.9 How do I use cpusets ?
 --------------------------
 
 In order to minimize the impact of cpusets on critical kernel
index af0e9393bf684d62c70afcaa1c620709fceebb86..b45ea28abc997c5269f20fdaa331f9a558cb4705 100644 (file)
@@ -282,6 +282,13 @@ Why:       Not used in-tree. The current out-of-tree users used it to
        out-of-tree driver.
 Who:   Thomas Gleixner <tglx@linutronix.de>
 
+----------------------------
+
+What:  usedac i386 kernel parameter
+When:  2.6.27
+Why:   replaced by allowdac and no dac combination
+Who:   Glauber Costa <gcosta@redhat.com>
+
 ---------------------------
 
 What:  /sys/o2cb symlink
@@ -291,3 +298,11 @@ Why:       /sys/fs/o2cb is the proper location for this information - /sys/o2cb
        ocfs2-tools. 2 years should be sufficient time to phase in new versions
        which know to look in /sys/fs/o2cb.
 Who:   ocfs2-devel@oss.oracle.com
+
+---------------------------
+
+What:  asm/semaphore.h
+When:  2.6.26
+Why:   Implementation became generic; users should now include
+       linux/semaphore.h instead.
+Who:   Matthew Wilcox <willy@linux.intel.com>
index 4598ef7b622bb88711cb22595a9b2f85a5050d9c..7f27b8f840d06210df1511db6ef603cedb8f0e58 100644 (file)
@@ -176,8 +176,10 @@ implementations:
   Recall that an attribute should only be exporting one value, or an
   array of similar values, so this shouldn't be that expensive. 
 
-  This allows userspace to do partial reads and seeks arbitrarily over
-  the entire file at will. 
+  This allows userspace to do partial reads and forward seeks
+  arbitrarily over the entire file at will. If userspace seeks back to
+  zero or does a pread(2) with an offset of '0' the show() method will
+  be called again, rearmed, to fill the buffer.
 
 - On write(2), sysfs expects the entire buffer to be passed during the
   first write. Sysfs then passes the entire buffer to the store()
@@ -192,6 +194,9 @@ implementations:
 
 Other notes:
 
+- Writing causes the show() method to be rearmed regardless of current
+  file position.
+
 - The buffer will always be PAGE_SIZE bytes in length. On i386, this
   is 4096. 
 
index 4b0f1ae31a4c152f4547050e2b3d8cc6b375bb31..dfb5bef240132dbb2caccd67da5b65652caef537 100644 (file)
@@ -954,6 +954,8 @@ and is between 256 and 4096 characters. It is defined in the file
 
        l2cr=           [PPC]
 
+       l3cr=           [PPC]
+
        lapic           [X86-32,APIC] Enable the local APIC even if BIOS
                        disabled it.
 
@@ -1280,8 +1282,16 @@ and is between 256 and 4096 characters. It is defined in the file
        noexec          [IA-64]
 
        noexec          [X86-32,X86-64]
+                       On X86-32 available only on PAE configured kernels.
                        noexec=on: enable non-executable mappings (default)
-                       noexec=off: disable nn-executable mappings
+                       noexec=off: disable non-executable mappings
+
+       noexec32        [X86-64]
+                       This affects only 32-bit executables.
+                       noexec32=on: enable non-executable mappings (default)
+                               read doesn't imply executable mappings
+                       noexec32=off: disable non-executable mappings
+                               read implies executable mappings
 
        nofxsr          [BUGS=X86-32] Disables x86 floating point extended
                        register save and restore. The kernel will only save
index 461e4f1dbec418156d2fe5809e49e6f3d8e60031..421e7d00ffd03a81fa1573656b39d489b045cd23 100644 (file)
@@ -196,6 +196,11 @@ its parent; and can't be removed or suspended after that parent.
 
 The policy is that the device tree should match hardware bus topology.
 (Or at least the control bus, for devices which use multiple busses.)
+In particular, this means that a device registration may fail if the parent of
+the device is suspending (ie. has been chosen by the PM core as the next
+device to suspend) or has already suspended, as well as after all of the other
+devices have been suspended.  Device drivers must be prepared to cope with such
+situations.
 
 
 Suspending Devices
index 7b4e8a70882c2ff4fb4d61e4bc12a4987a7d06eb..4cc780024e6c81b02cb3ccc6720655da85e33064 100644 (file)
@@ -59,12 +59,39 @@ Table of Contents
       p) Freescale Synchronous Serial Interface
          q) USB EHCI controllers
 
-  VII - Specifying interrupt information for devices
+  VII - Marvell Discovery mv64[345]6x System Controller chips
+    1) The /system-controller node
+    2) Child nodes of /system-controller
+      a) Marvell Discovery MDIO bus
+      b) Marvell Discovery ethernet controller
+      c) Marvell Discovery PHY nodes
+      d) Marvell Discovery SDMA nodes
+      e) Marvell Discovery BRG nodes
+      f) Marvell Discovery CUNIT nodes
+      g) Marvell Discovery MPSCROUTING nodes
+      h) Marvell Discovery MPSCINTR nodes
+      i) Marvell Discovery MPSC nodes
+      j) Marvell Discovery Watch Dog Timer nodes
+      k) Marvell Discovery I2C nodes
+      l) Marvell Discovery PIC (Programmable Interrupt Controller) nodes
+      m) Marvell Discovery MPP (Multipurpose Pins) multiplexing nodes
+      n) Marvell Discovery GPP (General Purpose Pins) nodes
+      o) Marvell Discovery PCI host bridge node
+      p) Marvell Discovery CPU Error nodes
+      q) Marvell Discovery SRAM Controller nodes
+      r) Marvell Discovery PCI Error Handler nodes
+      s) Marvell Discovery Memory Controller nodes
+
+  VIII - Specifying interrupt information for devices
     1) interrupts property
     2) interrupt-parent property
     3) OpenPIC Interrupt Controllers
     4) ISA Interrupt Controllers
 
+  VIII - Specifying GPIO information for devices
+    1) gpios property
+    2) gpio-controller nodes
+
   Appendix A - Sample SOC node for MPC8540
 
 
@@ -1269,10 +1296,6 @@ platforms are moved over to use the flattened-device-tree model.
 
   Recommended properties:
 
-    - linux,network-index : This is the intended "index" of this
-      network device.  This is used by the bootwrapper to interpret
-      MAC addresses passed by the firmware when no information other
-      than indices is available to associate an address with a device.
     - phy-connection-type : a string naming the controller/PHY interface type,
       i.e., "mii" (default), "rmii", "gmii", "rgmii", "rgmii-id", "sgmii",
       "tbi", or "rtbi".  This property is only really needed if the connection
@@ -1622,8 +1645,7 @@ platforms are moved over to use the flattened-device-tree model.
    - device_type : should be "network", "hldc", "uart", "transparent"
      "bisync", "atm", or "serial".
    - compatible : could be "ucc_geth" or "fsl_atm" and so on.
-   - model : should be "UCC".
-   - device-id : the ucc number(1-8), corresponding to UCCx in UM.
+   - cell-index : the ucc number(1-8), corresponding to UCCx in UM.
    - reg : Offset and length of the register set for the device
    - interrupts : <a b> where a is the interrupt number and b is a
      field that represents an encoding of the sense and level
@@ -1667,10 +1689,6 @@ platforms are moved over to use the flattened-device-tree model.
    - phy-handle : The phandle for the PHY connected to this controller.
 
    Recommended properties:
-   - linux,network-index : This is the intended "index" of this
-     network device.  This is used by the bootwrapper to interpret
-     MAC addresses passed by the firmware when no information other
-     than indices is available to associate an address with a device.
    - phy-connection-type : a string naming the controller/PHY interface type,
      i.e., "mii" (default), "rmii", "gmii", "rgmii", "rgmii-id" (Internal
      Delay), "rgmii-txid" (delay on TX only), "rgmii-rxid" (delay on RX only),
@@ -1680,8 +1698,7 @@ platforms are moved over to use the flattened-device-tree model.
        ucc@2000 {
                device_type = "network";
                compatible = "ucc_geth";
-               model = "UCC";
-               device-id = <1>;
+               cell-index = <1>;
                reg = <2000 200>;
                interrupts = <a0 0>;
                interrupt-parent = <700>;
@@ -1995,7 +2012,6 @@ platforms are moved over to use the flattened-device-tree model.
                interrupts = <20 8>;
                interrupt-parent = <&PIC>;
                phy-handle = <&PHY0>;
-               linux,network-index = <0>;
                fsl,cpm-command = <12000300>;
        };
 
@@ -2217,12 +2233,6 @@ platforms are moved over to use the flattened-device-tree model.
                          EMAC, that is the content of the current (bogus) "phy-port"
                          property.
 
-    Recommended properties:
-    - linux,network-index : This is the intended "index" of this
-      network device.  This is used by the bootwrapper to interpret
-      MAC addresses passed by the firmware when no information other
-      than indices is available to associate an address with a device.
-
     Optional properties:
     - phy-address       : 1 cell, optional, MDIO address of the PHY. If absent,
                          a search is performed.
@@ -2246,7 +2256,6 @@ platforms are moved over to use the flattened-device-tree model.
     Example:
 
        EMAC0: ethernet@40000800 {
-               linux,network-index = <0>;
                device_type = "network";
                compatible = "ibm,emac-440gp", "ibm,emac";
                interrupt-parent = <&UIC1>;
@@ -2817,9 +2826,528 @@ platforms are moved over to use the flattened-device-tree model.
           };
 
 
-   More devices will be defined as this spec matures.
+VII - Marvell Discovery mv64[345]6x System Controller chips
+===========================================================
+
+The Marvell mv64[345]60 series of system controller chips contain
+many of the peripherals needed to implement a complete computer
+system.  In this section, we define device tree nodes to describe
+the system controller chip itself and each of the peripherals
+which it contains.  Compatible string values for each node are
+prefixed with the string "marvell,", for Marvell Technology Group Ltd.
+
+1) The /system-controller node
+
+  This node is used to represent the system-controller and must be
+  present when the system uses a system contller chip. The top-level
+  system-controller node contains information that is global to all
+  devices within the system controller chip. The node name begins
+  with "system-controller" followed by the unit address, which is
+  the base address of the memory-mapped register set for the system
+  controller chip.
+
+  Required properties:
+
+    - ranges : Describes the translation of system controller addresses
+      for memory mapped registers.
+    - clock-frequency: Contains the main clock frequency for the system
+      controller chip.
+    - reg : This property defines the address and size of the
+      memory-mapped registers contained within the system controller
+      chip.  The address specified in the "reg" property should match
+      the unit address of the system-controller node.
+    - #address-cells : Address representation for system controller
+      devices.  This field represents the number of cells needed to
+      represent the address of the memory-mapped registers of devices
+      within the system controller chip.
+    - #size-cells : Size representation for for the memory-mapped
+      registers within the system controller chip.
+    - #interrupt-cells : Defines the width of cells used to represent
+      interrupts.
+
+  Optional properties:
+
+    - model : The specific model of the system controller chip.  Such
+      as, "mv64360", "mv64460", or "mv64560".
+    - compatible : A string identifying the compatibility identifiers
+      of the system controller chip.
+
+  The system-controller node contains child nodes for each system
+  controller device that the platform uses.  Nodes should not be created
+  for devices which exist on the system controller chip but are not used
+
+  Example Marvell Discovery mv64360 system-controller node:
+
+    system-controller@f1000000 { /* Marvell Discovery mv64360 */
+           #address-cells = <1>;
+           #size-cells = <1>;
+           model = "mv64360";                      /* Default */
+           compatible = "marvell,mv64360";
+           clock-frequency = <133333333>;
+           reg = <0xf1000000 0x10000>;
+           virtual-reg = <0xf1000000>;
+           ranges = <0x88000000 0x88000000 0x1000000 /* PCI 0 I/O Space */
+                   0x80000000 0x80000000 0x8000000 /* PCI 0 MEM Space */
+                   0xa0000000 0xa0000000 0x4000000 /* User FLASH */
+                   0x00000000 0xf1000000 0x0010000 /* Bridge's regs */
+                   0xf2000000 0xf2000000 0x0040000>;/* Integrated SRAM */
+
+           [ child node definitions... ]
+    }
+
+2) Child nodes of /system-controller
+
+   a) Marvell Discovery MDIO bus
+
+   The MDIO is a bus to which the PHY devices are connected.  For each
+   device that exists on this bus, a child node should be created.  See
+   the definition of the PHY node below for an example of how to define
+   a PHY.
+
+   Required properties:
+     - #address-cells : Should be <1>
+     - #size-cells : Should be <0>
+     - device_type : Should be "mdio"
+     - compatible : Should be "marvell,mv64360-mdio"
+
+   Example:
+
+     mdio {
+            #address-cells = <1>;
+            #size-cells = <0>;
+            device_type = "mdio";
+            compatible = "marvell,mv64360-mdio";
+
+            ethernet-phy@0 {
+                    ......
+            };
+     };
+
+
+   b) Marvell Discovery ethernet controller
+
+   The Discover ethernet controller is described with two levels
+   of nodes.  The first level describes an ethernet silicon block
+   and the second level describes up to 3 ethernet nodes within
+   that block.  The reason for the multiple levels is that the
+   registers for the node are interleaved within a single set
+   of registers.  The "ethernet-block" level describes the
+   shared register set, and the "ethernet" nodes describe ethernet
+   port-specific properties.
+
+   Ethernet block node
+
+   Required properties:
+     - #address-cells : <1>
+     - #size-cells : <0>
+     - compatible : "marvell,mv64360-eth-block"
+     - reg : Offset and length of the register set for this block
+
+   Example Discovery Ethernet block node:
+     ethernet-block@2000 {
+            #address-cells = <1>;
+            #size-cells = <0>;
+            compatible = "marvell,mv64360-eth-block";
+            reg = <0x2000 0x2000>;
+            ethernet@0 {
+                    .......
+            };
+     };
+
+   Ethernet port node
+
+   Required properties:
+     - device_type : Should be "network".
+     - compatible : Should be "marvell,mv64360-eth".
+     - reg : Should be <0>, <1>, or <2>, according to which registers
+       within the silicon block the device uses.
+     - interrupts : <a> where a is the interrupt number for the port.
+     - interrupt-parent : the phandle for the interrupt controller
+       that services interrupts for this device.
+     - phy : the phandle for the PHY connected to this ethernet
+       controller.
+     - local-mac-address : 6 bytes, MAC address
+
+   Example Discovery Ethernet port node:
+     ethernet@0 {
+            device_type = "network";
+            compatible = "marvell,mv64360-eth";
+            reg = <0>;
+            interrupts = <32>;
+            interrupt-parent = <&PIC>;
+            phy = <&PHY0>;
+            local-mac-address = [ 00 00 00 00 00 00 ];
+     };
+
+
+
+   c) Marvell Discovery PHY nodes
+
+   Required properties:
+     - device_type : Should be "ethernet-phy"
+     - interrupts : <a> where a is the interrupt number for this phy.
+     - interrupt-parent : the phandle for the interrupt controller that
+       services interrupts for this device.
+     - reg : The ID number for the phy, usually a small integer
+
+   Example Discovery PHY node:
+     ethernet-phy@1 {
+            device_type = "ethernet-phy";
+            compatible = "broadcom,bcm5421";
+            interrupts = <76>;      /* GPP 12 */
+            interrupt-parent = <&PIC>;
+            reg = <1>;
+     };
+
+
+   d) Marvell Discovery SDMA nodes
+
+   Represent DMA hardware associated with the MPSC (multiprotocol
+   serial controllers).
+
+   Required properties:
+     - compatible : "marvell,mv64360-sdma"
+     - reg : Offset and length of the register set for this device
+     - interrupts : <a> where a is the interrupt number for the DMA
+       device.
+     - interrupt-parent : the phandle for the interrupt controller
+       that services interrupts for this device.
+
+   Example Discovery SDMA node:
+     sdma@4000 {
+            compatible = "marvell,mv64360-sdma";
+            reg = <0x4000 0xc18>;
+            virtual-reg = <0xf1004000>;
+            interrupts = <36>;
+            interrupt-parent = <&PIC>;
+     };
+
+
+   e) Marvell Discovery BRG nodes
+
+   Represent baud rate generator hardware associated with the MPSC
+   (multiprotocol serial controllers).
+
+   Required properties:
+     - compatible : "marvell,mv64360-brg"
+     - reg : Offset and length of the register set for this device
+     - clock-src : A value from 0 to 15 which selects the clock
+       source for the baud rate generator.  This value corresponds
+       to the CLKS value in the BRGx configuration register.  See
+       the mv64x60 User's Manual.
+     - clock-frequence : The frequency (in Hz) of the baud rate
+       generator's input clock.
+     - current-speed : The current speed setting (presumably by
+       firmware) of the baud rate generator.
+
+   Example Discovery BRG node:
+     brg@b200 {
+            compatible = "marvell,mv64360-brg";
+            reg = <0xb200 0x8>;
+            clock-src = <8>;
+            clock-frequency = <133333333>;
+            current-speed = <9600>;
+     };
+
+
+   f) Marvell Discovery CUNIT nodes
+
+   Represent the Serial Communications Unit device hardware.
+
+   Required properties:
+     - reg : Offset and length of the register set for this device
+
+   Example Discovery CUNIT node:
+     cunit@f200 {
+            reg = <0xf200 0x200>;
+     };
+
+
+   g) Marvell Discovery MPSCROUTING nodes
+
+   Represent the Discovery's MPSC routing hardware
+
+   Required properties:
+     - reg : Offset and length of the register set for this device
+
+   Example Discovery CUNIT node:
+     mpscrouting@b500 {
+            reg = <0xb400 0xc>;
+     };
+
+
+   h) Marvell Discovery MPSCINTR nodes
+
+   Represent the Discovery's MPSC DMA interrupt hardware registers
+   (SDMA cause and mask registers).
+
+   Required properties:
+     - reg : Offset and length of the register set for this device
 
-VII - Specifying interrupt information for devices
+   Example Discovery MPSCINTR node:
+     mpsintr@b800 {
+            reg = <0xb800 0x100>;
+     };
+
+
+   i) Marvell Discovery MPSC nodes
+
+   Represent the Discovery's MPSC (Multiprotocol Serial Controller)
+   serial port.
+
+   Required properties:
+     - device_type : "serial"
+     - compatible : "marvell,mv64360-mpsc"
+     - reg : Offset and length of the register set for this device
+     - sdma : the phandle for the SDMA node used by this port
+     - brg : the phandle for the BRG node used by this port
+     - cunit : the phandle for the CUNIT node used by this port
+     - mpscrouting : the phandle for the MPSCROUTING node used by this port
+     - mpscintr : the phandle for the MPSCINTR node used by this port
+     - cell-index : the hardware index of this cell in the MPSC core
+     - max_idle : value needed for MPSC CHR3 (Maximum Frame Length)
+       register
+     - interrupts : <a> where a is the interrupt number for the MPSC.
+     - interrupt-parent : the phandle for the interrupt controller
+       that services interrupts for this device.
+
+   Example Discovery MPSCINTR node:
+     mpsc@8000 {
+            device_type = "serial";
+            compatible = "marvell,mv64360-mpsc";
+            reg = <0x8000 0x38>;
+            virtual-reg = <0xf1008000>;
+            sdma = <&SDMA0>;
+            brg = <&BRG0>;
+            cunit = <&CUNIT>;
+            mpscrouting = <&MPSCROUTING>;
+            mpscintr = <&MPSCINTR>;
+            cell-index = <0>;
+            max_idle = <40>;
+            interrupts = <40>;
+            interrupt-parent = <&PIC>;
+     };
+
+
+   j) Marvell Discovery Watch Dog Timer nodes
+
+   Represent the Discovery's watchdog timer hardware
+
+   Required properties:
+     - compatible : "marvell,mv64360-wdt"
+     - reg : Offset and length of the register set for this device
+
+   Example Discovery Watch Dog Timer node:
+     wdt@b410 {
+            compatible = "marvell,mv64360-wdt";
+            reg = <0xb410 0x8>;
+     };
+
+
+   k) Marvell Discovery I2C nodes
+
+   Represent the Discovery's I2C hardware
+
+   Required properties:
+     - device_type : "i2c"
+     - compatible : "marvell,mv64360-i2c"
+     - reg : Offset and length of the register set for this device
+     - interrupts : <a> where a is the interrupt number for the I2C.
+     - interrupt-parent : the phandle for the interrupt controller
+       that services interrupts for this device.
+
+   Example Discovery I2C node:
+            compatible = "marvell,mv64360-i2c";
+            reg = <0xc000 0x20>;
+            virtual-reg = <0xf100c000>;
+            interrupts = <37>;
+            interrupt-parent = <&PIC>;
+     };
+
+
+   l) Marvell Discovery PIC (Programmable Interrupt Controller) nodes
+
+   Represent the Discovery's PIC hardware
+
+   Required properties:
+     - #interrupt-cells : <1>
+     - #address-cells : <0>
+     - compatible : "marvell,mv64360-pic"
+     - reg : Offset and length of the register set for this device
+     - interrupt-controller
+
+   Example Discovery PIC node:
+     pic {
+            #interrupt-cells = <1>;
+            #address-cells = <0>;
+            compatible = "marvell,mv64360-pic";
+            reg = <0x0 0x88>;
+            interrupt-controller;
+     };
+
+
+   m) Marvell Discovery MPP (Multipurpose Pins) multiplexing nodes
+
+   Represent the Discovery's MPP hardware
+
+   Required properties:
+     - compatible : "marvell,mv64360-mpp"
+     - reg : Offset and length of the register set for this device
+
+   Example Discovery MPP node:
+     mpp@f000 {
+            compatible = "marvell,mv64360-mpp";
+            reg = <0xf000 0x10>;
+     };
+
+
+   n) Marvell Discovery GPP (General Purpose Pins) nodes
+
+   Represent the Discovery's GPP hardware
+
+   Required properties:
+     - compatible : "marvell,mv64360-gpp"
+     - reg : Offset and length of the register set for this device
+
+   Example Discovery GPP node:
+     gpp@f000 {
+            compatible = "marvell,mv64360-gpp";
+            reg = <0xf100 0x20>;
+     };
+
+
+   o) Marvell Discovery PCI host bridge node
+
+   Represents the Discovery's PCI host bridge device.  The properties
+   for this node conform to Rev 2.1 of the PCI Bus Binding to IEEE
+   1275-1994.  A typical value for the compatible property is
+   "marvell,mv64360-pci".
+
+   Example Discovery PCI host bridge node
+     pci@80000000 {
+            #address-cells = <3>;
+            #size-cells = <2>;
+            #interrupt-cells = <1>;
+            device_type = "pci";
+            compatible = "marvell,mv64360-pci";
+            reg = <0xcf8 0x8>;
+            ranges = <0x01000000 0x0        0x0
+                            0x88000000 0x0 0x01000000
+                      0x02000000 0x0 0x80000000
+                            0x80000000 0x0 0x08000000>;
+            bus-range = <0 255>;
+            clock-frequency = <66000000>;
+            interrupt-parent = <&PIC>;
+            interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
+            interrupt-map = <
+                    /* IDSEL 0x0a */
+                    0x5000 0 0 1 &PIC 80
+                    0x5000 0 0 2 &PIC 81
+                    0x5000 0 0 3 &PIC 91
+                    0x5000 0 0 4 &PIC 93
+
+                    /* IDSEL 0x0b */
+                    0x5800 0 0 1 &PIC 91
+                    0x5800 0 0 2 &PIC 93
+                    0x5800 0 0 3 &PIC 80
+                    0x5800 0 0 4 &PIC 81
+
+                    /* IDSEL 0x0c */
+                    0x6000 0 0 1 &PIC 91
+                    0x6000 0 0 2 &PIC 93
+                    0x6000 0 0 3 &PIC 80
+                    0x6000 0 0 4 &PIC 81
+
+                    /* IDSEL 0x0d */
+                    0x6800 0 0 1 &PIC 93
+                    0x6800 0 0 2 &PIC 80
+                    0x6800 0 0 3 &PIC 81
+                    0x6800 0 0 4 &PIC 91
+            >;
+     };
+
+
+   p) Marvell Discovery CPU Error nodes
+
+   Represent the Discovery's CPU error handler device.
+
+   Required properties:
+     - compatible : "marvell,mv64360-cpu-error"
+     - reg : Offset and length of the register set for this device
+     - interrupts : the interrupt number for this device
+     - interrupt-parent : the phandle for the interrupt controller
+       that services interrupts for this device.
+
+   Example Discovery CPU Error node:
+     cpu-error@0070 {
+            compatible = "marvell,mv64360-cpu-error";
+            reg = <0x70 0x10 0x128 0x28>;
+            interrupts = <3>;
+            interrupt-parent = <&PIC>;
+     };
+
+
+   q) Marvell Discovery SRAM Controller nodes
+
+   Represent the Discovery's SRAM controller device.
+
+   Required properties:
+     - compatible : "marvell,mv64360-sram-ctrl"
+     - reg : Offset and length of the register set for this device
+     - interrupts : the interrupt number for this device
+     - interrupt-parent : the phandle for the interrupt controller
+       that services interrupts for this device.
+
+   Example Discovery SRAM Controller node:
+     sram-ctrl@0380 {
+            compatible = "marvell,mv64360-sram-ctrl";
+            reg = <0x380 0x80>;
+            interrupts = <13>;
+            interrupt-parent = <&PIC>;
+     };
+
+
+   r) Marvell Discovery PCI Error Handler nodes
+
+   Represent the Discovery's PCI error handler device.
+
+   Required properties:
+     - compatible : "marvell,mv64360-pci-error"
+     - reg : Offset and length of the register set for this device
+     - interrupts : the interrupt number for this device
+     - interrupt-parent : the phandle for the interrupt controller
+       that services interrupts for this device.
+
+   Example Discovery PCI Error Handler node:
+     pci-error@1d40 {
+            compatible = "marvell,mv64360-pci-error";
+            reg = <0x1d40 0x40 0xc28 0x4>;
+            interrupts = <12>;
+            interrupt-parent = <&PIC>;
+     };
+
+
+   s) Marvell Discovery Memory Controller nodes
+
+   Represent the Discovery's memory controller device.
+
+   Required properties:
+     - compatible : "marvell,mv64360-mem-ctrl"
+     - reg : Offset and length of the register set for this device
+     - interrupts : the interrupt number for this device
+     - interrupt-parent : the phandle for the interrupt controller
+       that services interrupts for this device.
+
+   Example Discovery Memory Controller node:
+     mem-ctrl@1400 {
+            compatible = "marvell,mv64360-mem-ctrl";
+            reg = <0x1400 0x60>;
+            interrupts = <17>;
+            interrupt-parent = <&PIC>;
+     };
+
+
+VIII - Specifying interrupt information for devices
 ===================================================
 
 The device tree represents the busses and devices of a hardware
@@ -2905,6 +3433,54 @@ encodings listed below:
        2 =  high to low edge sensitive type enabled
        3 =  low to high edge sensitive type enabled
 
+VIII - Specifying GPIO information for devices
+==============================================
+
+1) gpios property
+-----------------
+
+Nodes that makes use of GPIOs should define them using `gpios' property,
+format of which is: <&gpio-controller1-phandle gpio1-specifier
+                    &gpio-controller2-phandle gpio2-specifier
+                    0 /* holes are permitted, means no GPIO 3 */
+                    &gpio-controller4-phandle gpio4-specifier
+                    ...>;
+
+Note that gpio-specifier length is controller dependent.
+
+gpio-specifier may encode: bank, pin position inside the bank,
+whether pin is open-drain and whether pin is logically inverted.
+
+Example of the node using GPIOs:
+
+       node {
+               gpios = <&qe_pio_e 18 0>;
+       };
+
+In this example gpio-specifier is "18 0" and encodes GPIO pin number,
+and empty GPIO flags as accepted by the "qe_pio_e" gpio-controller.
+
+2) gpio-controller nodes
+------------------------
+
+Every GPIO controller node must have #gpio-cells property defined,
+this information will be used to translate gpio-specifiers.
+
+Example of two SOC GPIO banks defined as gpio-controller nodes:
+
+       qe_pio_a: gpio-controller@1400 {
+               #gpio-cells = <2>;
+               compatible = "fsl,qe-pario-bank-a", "fsl,qe-pario-bank";
+               reg = <0x1400 0x18>;
+               gpio-controller;
+       };
+
+       qe_pio_e: gpio-controller@1460 {
+               #gpio-cells = <2>;
+               compatible = "fsl,qe-pario-bank-e", "fsl,qe-pario-bank";
+               reg = <0x1460 0x18>;
+               gpio-controller;
+       };
 
 Appendix A - Sample SOC node for MPC8540
 ========================================
diff --git a/Documentation/powerpc/phyp-assisted-dump.txt b/Documentation/powerpc/phyp-assisted-dump.txt
new file mode 100644 (file)
index 0000000..c4682b9
--- /dev/null
@@ -0,0 +1,127 @@
+
+                   Hypervisor-Assisted Dump
+                   ------------------------
+                       November 2007
+
+The goal of hypervisor-assisted dump is to enable the dump of
+a crashed system, and to do so from a fully-reset system, and
+to minimize the total elapsed time until the system is back
+in production use.
+
+As compared to kdump or other strategies, hypervisor-assisted
+dump offers several strong, practical advantages:
+
+-- Unlike kdump, the system has been reset, and loaded
+   with a fresh copy of the kernel.  In particular,
+   PCI and I/O devices have been reinitialized and are
+   in a clean, consistent state.
+-- As the dump is performed, the dumped memory becomes
+   immediately available to the system for normal use.
+-- After the dump is completed, no further reboots are
+   required; the system will be fully usable, and running
+   in it's normal, production mode on it normal kernel.
+
+The above can only be accomplished by coordination with,
+and assistance from the hypervisor. The procedure is
+as follows:
+
+-- When a system crashes, the hypervisor will save
+   the low 256MB of RAM to a previously registered
+   save region. It will also save system state, system
+   registers, and hardware PTE's.
+
+-- After the low 256MB area has been saved, the
+   hypervisor will reset PCI and other hardware state.
+   It will *not* clear RAM. It will then launch the
+   bootloader, as normal.
+
+-- The freshly booted kernel will notice that there
+   is a new node (ibm,dump-kernel) in the device tree,
+   indicating that there is crash data available from
+   a previous boot. It will boot into only 256MB of RAM,
+   reserving the rest of system memory.
+
+-- Userspace tools will parse /sys/kernel/release_region
+   and read /proc/vmcore to obtain the contents of memory,
+   which holds the previous crashed kernel. The userspace
+   tools may copy this info to disk, or network, nas, san,
+   iscsi, etc. as desired.
+
+   For Example: the values in /sys/kernel/release-region
+   would look something like this (address-range pairs).
+   CPU:0x177fee000-0x10000: HPTE:0x177ffe020-0x1000: /
+   DUMP:0x177fff020-0x10000000, 0x10000000-0x16F1D370A
+
+-- As the userspace tools complete saving a portion of
+   dump, they echo an offset and size to
+   /sys/kernel/release_region to release the reserved
+   memory back to general use.
+
+   An example of this is:
+     "echo 0x40000000 0x10000000 > /sys/kernel/release_region"
+   which will release 256MB at the 1GB boundary.
+
+Please note that the hypervisor-assisted dump feature
+is only available on Power6-based systems with recent
+firmware versions.
+
+Implementation details:
+----------------------
+
+During boot, a check is made to see if firmware supports
+this feature on this particular machine. If it does, then
+we check to see if a active dump is waiting for us. If yes
+then everything but 256 MB of RAM is reserved during early
+boot. This area is released once we collect a dump from user
+land scripts that are run. If there is dump data, then
+the /sys/kernel/release_region file is created, and
+the reserved memory is held.
+
+If there is no waiting dump data, then only the highest
+256MB of the ram is reserved as a scratch area. This area
+is *not* released: this region will be kept permanently
+reserved, so that it can act as a receptacle for a copy
+of the low 256MB in the case a crash does occur. See,
+however, "open issues" below, as to whether
+such a reserved region is really needed.
+
+Currently the dump will be copied from /proc/vmcore to a
+a new file upon user intervention. The starting address
+to be read and the range for each data point in provided
+in /sys/kernel/release_region.
+
+The tools to examine the dump will be same as the ones
+used for kdump.
+
+General notes:
+--------------
+Security: please note that there are potential security issues
+with any sort of dump mechanism. In particular, plaintext
+(unencrypted) data, and possibly passwords, may be present in
+the dump data. Userspace tools must take adequate precautions to
+preserve security.
+
+Open issues/ToDo:
+------------
+ o The various code paths that tell the hypervisor that a crash
+   occurred, vs. it simply being a normal reboot, should be
+   reviewed, and possibly clarified/fixed.
+
+ o Instead of using /sys/kernel, should there be a /sys/dump
+   instead? There is a dump_subsys being created by the s390 code,
+   perhaps the pseries code should use a similar layout as well.
+
+ o Is reserving a 256MB region really required? The goal of
+   reserving a 256MB scratch area is to make sure that no
+   important crash data is clobbered when the hypervisor
+   save low mem to the scratch area. But, if one could assure
+   that nothing important is located in some 256MB area, then
+   it would not need to be reserved. Something that can be
+   improved in subsequent versions.
+
+ o Still working the kdump team to integrate this with kdump,
+   some work remains but this would not affect the current
+   patches.
+
+ o Still need to write a shell script, to copy the dump away.
+   Currently I am parsing it manually.
diff --git a/Documentation/prctl/disable-tsc-ctxt-sw-stress-test.c b/Documentation/prctl/disable-tsc-ctxt-sw-stress-test.c
new file mode 100644 (file)
index 0000000..f8e8e95
--- /dev/null
@@ -0,0 +1,96 @@
+/*
+ * Tests for prctl(PR_GET_TSC, ...) / prctl(PR_SET_TSC, ...)
+ *
+ * Tests if the control register is updated correctly
+ * at context switches
+ *
+ * Warning: this test will cause a very high load for a few seconds
+ *
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <signal.h>
+#include <inttypes.h>
+#include <wait.h>
+
+
+#include <sys/prctl.h>
+#include <linux/prctl.h>
+
+/* Get/set the process' ability to use the timestamp counter instruction */
+#ifndef PR_GET_TSC
+#define PR_GET_TSC 25
+#define PR_SET_TSC 26
+# define PR_TSC_ENABLE         1   /* allow the use of the timestamp counter */
+# define PR_TSC_SIGSEGV                2   /* throw a SIGSEGV instead of reading the TSC */
+#endif
+
+uint64_t rdtsc() {
+uint32_t lo, hi;
+/* We cannot use "=A", since this would use %rax on x86_64 */
+__asm__ __volatile__ ("rdtsc" : "=a" (lo), "=d" (hi));
+return (uint64_t)hi << 32 | lo;
+}
+
+void sigsegv_expect(int sig)
+{
+       /* */
+}
+
+void segvtask(void)
+{
+       if (prctl(PR_SET_TSC, PR_TSC_SIGSEGV) < 0)
+       {
+               perror("prctl");
+               exit(0);
+       }
+       signal(SIGSEGV, sigsegv_expect);
+       alarm(10);
+       rdtsc();
+       fprintf(stderr, "FATAL ERROR, rdtsc() succeeded while disabled\n");
+       exit(0);
+}
+
+
+void sigsegv_fail(int sig)
+{
+       fprintf(stderr, "FATAL ERROR, rdtsc() failed while enabled\n");
+       exit(0);
+}
+
+void rdtsctask(void)
+{
+       if (prctl(PR_SET_TSC, PR_TSC_ENABLE) < 0)
+       {
+               perror("prctl");
+               exit(0);
+       }
+       signal(SIGSEGV, sigsegv_fail);
+       alarm(10);
+       for(;;) rdtsc();
+}
+
+
+int main(int argc, char **argv)
+{
+       int n_tasks = 100, i;
+
+       fprintf(stderr, "[No further output means we're allright]\n");
+
+       for (i=0; i<n_tasks; i++)
+               if (fork() == 0)
+               {
+                       if (i & 1)
+                               segvtask();
+                       else
+                               rdtsctask();
+               }
+
+       for (i=0; i<n_tasks; i++)
+               wait(NULL);
+
+       exit(0);
+}
+
diff --git a/Documentation/prctl/disable-tsc-on-off-stress-test.c b/Documentation/prctl/disable-tsc-on-off-stress-test.c
new file mode 100644 (file)
index 0000000..1fcd914
--- /dev/null
@@ -0,0 +1,95 @@
+/*
+ * Tests for prctl(PR_GET_TSC, ...) / prctl(PR_SET_TSC, ...)
+ *
+ * Tests if the control register is updated correctly
+ * when set with prctl()
+ *
+ * Warning: this test will cause a very high load for a few seconds
+ *
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <signal.h>
+#include <inttypes.h>
+#include <wait.h>
+
+
+#include <sys/prctl.h>
+#include <linux/prctl.h>
+
+/* Get/set the process' ability to use the timestamp counter instruction */
+#ifndef PR_GET_TSC
+#define PR_GET_TSC 25
+#define PR_SET_TSC 26
+# define PR_TSC_ENABLE         1   /* allow the use of the timestamp counter */
+# define PR_TSC_SIGSEGV                2   /* throw a SIGSEGV instead of reading the TSC */
+#endif
+
+/* snippet from wikipedia :-) */
+
+uint64_t rdtsc() {
+uint32_t lo, hi;
+/* We cannot use "=A", since this would use %rax on x86_64 */
+__asm__ __volatile__ ("rdtsc" : "=a" (lo), "=d" (hi));
+return (uint64_t)hi << 32 | lo;
+}
+
+int should_segv = 0;
+
+void sigsegv_cb(int sig)
+{
+       if (!should_segv)
+       {
+               fprintf(stderr, "FATAL ERROR, rdtsc() failed while enabled\n");
+               exit(0);
+       }
+       if (prctl(PR_SET_TSC, PR_TSC_ENABLE) < 0)
+       {
+               perror("prctl");
+               exit(0);
+       }
+       should_segv = 0;
+
+       rdtsc();
+}
+
+void task(void)
+{
+       signal(SIGSEGV, sigsegv_cb);
+       alarm(10);
+       for(;;)
+       {
+               rdtsc();
+               if (should_segv)
+               {
+                       fprintf(stderr, "FATAL ERROR, rdtsc() succeeded while disabled\n");
+                       exit(0);
+               }
+               if (prctl(PR_SET_TSC, PR_TSC_SIGSEGV) < 0)
+               {
+                       perror("prctl");
+                       exit(0);
+               }
+               should_segv = 1;
+       }
+}
+
+
+int main(int argc, char **argv)
+{
+       int n_tasks = 100, i;
+
+       fprintf(stderr, "[No further output means we're allright]\n");
+
+       for (i=0; i<n_tasks; i++)
+               if (fork() == 0)
+                       task();
+
+       for (i=0; i<n_tasks; i++)
+               wait(NULL);
+
+       exit(0);
+}
+
diff --git a/Documentation/prctl/disable-tsc-test.c b/Documentation/prctl/disable-tsc-test.c
new file mode 100644 (file)
index 0000000..843c81e
--- /dev/null
@@ -0,0 +1,94 @@
+/*
+ * Tests for prctl(PR_GET_TSC, ...) / prctl(PR_SET_TSC, ...)
+ *
+ * Basic test to test behaviour of PR_GET_TSC and PR_SET_TSC
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <signal.h>
+#include <inttypes.h>
+
+
+#include <sys/prctl.h>
+#include <linux/prctl.h>
+
+/* Get/set the process' ability to use the timestamp counter instruction */
+#ifndef PR_GET_TSC
+#define PR_GET_TSC 25
+#define PR_SET_TSC 26
+# define PR_TSC_ENABLE         1   /* allow the use of the timestamp counter */
+# define PR_TSC_SIGSEGV                2   /* throw a SIGSEGV instead of reading the TSC */
+#endif
+
+const char *tsc_names[] =
+{
+       [0] = "[not set]",
+       [PR_TSC_ENABLE] = "PR_TSC_ENABLE",
+       [PR_TSC_SIGSEGV] = "PR_TSC_SIGSEGV",
+};
+
+uint64_t rdtsc() {
+uint32_t lo, hi;
+/* We cannot use "=A", since this would use %rax on x86_64 */
+__asm__ __volatile__ ("rdtsc" : "=a" (lo), "=d" (hi));
+return (uint64_t)hi << 32 | lo;
+}
+
+void sigsegv_cb(int sig)
+{
+       int tsc_val = 0;
+
+       printf("[ SIG_SEGV ]\n");
+       printf("prctl(PR_GET_TSC, &tsc_val); ");
+       fflush(stdout);
+
+       if ( prctl(PR_GET_TSC, &tsc_val) == -1)
+               perror("prctl");
+
+       printf("tsc_val == %s\n", tsc_names[tsc_val]);
+       printf("prctl(PR_SET_TSC, PR_TSC_ENABLE)\n");
+       fflush(stdout);
+       if ( prctl(PR_SET_TSC, PR_TSC_ENABLE) == -1)
+               perror("prctl");
+
+       printf("rdtsc() == ");
+}
+
+int main(int argc, char **argv)
+{
+       int tsc_val = 0;
+
+       signal(SIGSEGV, sigsegv_cb);
+
+       printf("rdtsc() == %llu\n", (unsigned long long)rdtsc());
+       printf("prctl(PR_GET_TSC, &tsc_val); ");
+       fflush(stdout);
+
+       if ( prctl(PR_GET_TSC, &tsc_val) == -1)
+               perror("prctl");
+
+       printf("tsc_val == %s\n", tsc_names[tsc_val]);
+       printf("rdtsc() == %llu\n", (unsigned long long)rdtsc());
+       printf("prctl(PR_SET_TSC, PR_TSC_ENABLE)\n");
+       fflush(stdout);
+
+       if ( prctl(PR_SET_TSC, PR_TSC_ENABLE) == -1)
+               perror("prctl");
+
+       printf("rdtsc() == %llu\n", (unsigned long long)rdtsc());
+       printf("prctl(PR_SET_TSC, PR_TSC_SIGSEGV)\n");
+       fflush(stdout);
+
+       if ( prctl(PR_SET_TSC, PR_TSC_SIGSEGV) == -1)
+               perror("prctl");
+
+       printf("rdtsc() == ");
+       fflush(stdout);
+       printf("%llu\n", (unsigned long long)rdtsc());
+       fflush(stdout);
+
+       exit(EXIT_SUCCESS);
+}
+
index 1c6332f4543c350889eae9ba2b4c766270c1b65e..14f901f639ee3df948a5d4cf9b10b802c7e3f310 100644 (file)
+                               Real-Time group scheduling
+                               --------------------------
 
+CONTENTS
+========
 
-Real-Time group scheduling.
+1. Overview
+  1.1 The problem
+  1.2 The solution
+2. The interface
+  2.1 System-wide settings
+  2.2 Default behaviour
+  2.3 Basis for grouping tasks
+3. Future plans
 
-The problem space:
 
-In order to schedule multiple groups of realtime tasks each group must
-be assigned a fixed portion of the CPU time available. Without a minimum
-guarantee a realtime group can obviously fall short. A fuzzy upper limit
-is of no use since it cannot be relied upon. Which leaves us with just
-the single fixed portion.
+1. Overview
+===========
 
-CPU time is divided by means of specifying how much time can be spent
-running in a given period. Say a frame fixed realtime renderer must
-deliver 25 frames a second, which yields a period of 0.04s. Now say
-it will also have to play some music and respond to input, leaving it
-with around 80% for the graphics. We can then give this group a runtime
-of 0.8 * 0.04s = 0.032s.
 
-This way the graphics group will have a 0.04s period with a 0.032s runtime
-limit.
+1.1 The problem
+---------------
 
-Now if the audio thread needs to refill the DMA buffer every 0.005s, but
-needs only about 3% CPU time to do so, it can do with a 0.03 * 0.005s
-= 0.00015s.
+Realtime scheduling is all about determinism, a group has to be able to rely on
+the amount of bandwidth (eg. CPU time) being constant. In order to schedule
+multiple groups of realtime tasks, each group must be assigned a fixed portion
+of the CPU time available.  Without a minimum guarantee a realtime group can
+obviously fall short. A fuzzy upper limit is of no use since it cannot be
+relied upon. Which leaves us with just the single fixed portion.
 
+1.2 The solution
+----------------
 
-The Interface:
+CPU time is divided by means of specifying how much time can be spent running
+in a given period. We allocate this "run time" for each realtime group which
+the other realtime groups will not be permitted to use.
 
-system wide:
+Any time not allocated to a realtime group will be used to run normal priority
+tasks (SCHED_OTHER). Any allocated run time not used will also be picked up by
+SCHED_OTHER.
 
-/proc/sys/kernel/sched_rt_period_ms
-/proc/sys/kernel/sched_rt_runtime_us
+Let's consider an example: a frame fixed realtime renderer must deliver 25
+frames a second, which yields a period of 0.04s per frame. Now say it will also
+have to play some music and respond to input, leaving it with around 80% CPU
+time dedicated for the graphics. We can then give this group a run time of 0.8
+* 0.04s = 0.032s.
 
-CONFIG_FAIR_USER_SCHED
+This way the graphics group will have a 0.04s period with a 0.032s run time
+limit. Now if the audio thread needs to refill the DMA buffer every 0.005s, but
+needs only about 3% CPU time to do so, it can do with a 0.03 * 0.005s =
+0.00015s. So this group can be scheduled with a period of 0.005s and a run time
+of 0.00015s.
 
-/sys/kernel/uids/<uid>/cpu_rt_runtime_us
+The remaining CPU time will be used for user input and other tass. Because
+realtime tasks have explicitly allocated the CPU time they need to perform
+their tasks, buffer underruns in the graphocs or audio can be eliminated.
 
-or
+NOTE: the above example is not fully implemented as of yet (2.6.25). We still
+lack an EDF scheduler to make non-uniform periods usable.
 
-CONFIG_FAIR_CGROUP_SCHED
 
-/cgroup/<cgroup>/cpu.rt_runtime_us
+2. The Interface
+================
 
-[ time is specified in us because the interface is s32; this gives an
-  operating range of ~35m to 1us ]
 
-The period takes values in [ 1, INT_MAX ], runtime in [ -1, INT_MAX - 1 ].
+2.1 System wide settings
+------------------------
 
-A runtime of -1 specifies runtime == period, ie. no limit.
+The system wide settings are configured under the /proc virtual file system:
 
-New groups get the period from /proc/sys/kernel/sched_rt_period_us and
-a runtime of 0.
+/proc/sys/kernel/sched_rt_period_us:
+  The scheduling period that is equivalent to 100% CPU bandwidth
 
-Settings are constrained to:
+/proc/sys/kernel/sched_rt_runtime_us:
+  A global limit on how much time realtime scheduling may use.  Even without
+  CONFIG_RT_GROUP_SCHED enabled, this will limit time reserved to realtime
+  processes. With CONFIG_RT_GROUP_SCHED it signifies the total bandwidth
+  available to all realtime groups.
+
+  * Time is specified in us because the interface is s32. This gives an
+    operating range from 1us to about 35 minutes.
+  * sched_rt_period_us takes values from 1 to INT_MAX.
+  * sched_rt_runtime_us takes values from -1 to (INT_MAX - 1).
+  * A run time of -1 specifies runtime == period, ie. no limit.
+
+
+2.2 Default behaviour
+---------------------
+
+The default values for sched_rt_period_us (1000000 or 1s) and
+sched_rt_runtime_us (950000 or 0.95s).  This gives 0.05s to be used by
+SCHED_OTHER (non-RT tasks). These defaults were chosen so that a run-away
+realtime tasks will not lock up the machine but leave a little time to recover
+it.  By setting runtime to -1 you'd get the old behaviour back.
+
+By default all bandwidth is assigned to the root group and new groups get the
+period from /proc/sys/kernel/sched_rt_period_us and a run time of 0. If you
+want to assign bandwidth to another group, reduce the root group's bandwidth
+and assign some or all of the difference to another group.
+
+Realtime group scheduling means you have to assign a portion of total CPU
+bandwidth to the group before it will accept realtime tasks. Therefore you will
+not be able to run realtime tasks as any user other than root until you have
+done that, even if the user has the rights to run processes with realtime
+priority!
+
+
+2.3 Basis for grouping tasks
+----------------------------
+
+There are two compile-time settings for allocating CPU bandwidth. These are
+configured using the "Basis for grouping tasks" multiple choice menu under
+General setup > Group CPU Scheduler:
+
+a. CONFIG_USER_SCHED (aka "Basis for grouping tasks" =  "user id")
+
+This lets you use the virtual files under
+"/sys/kernel/uids/<uid>/cpu_rt_runtime_us" to control he CPU time reserved for
+each user .
+
+The other option is:
+
+.o CONFIG_CGROUP_SCHED (aka "Basis for grouping tasks" = "Control groups")
+
+This uses the /cgroup virtual file system and "/cgroup/<cgroup>/cpu.rt_runtime_us"
+to control the CPU time reserved for each control group instead.
+
+For more information on working with control groups, you should read
+Documentation/cgroups.txt as well.
+
+Group settings are checked against the following limits in order to keep the configuration
+schedulable:
 
    \Sum_{i} runtime_{i} / global_period <= global_runtime / global_period
 
-in order to keep the configuration schedulable.
+For now, this can be simplified to just the following (but see Future plans):
+
+   \Sum_{i} runtime_{i} <= global_runtime
+
+
+3. Future plans
+===============
+
+There is work in progress to make the scheduling period for each group
+("/sys/kernel/uids/<uid>/cpu_rt_period_us" or
+"/cgroup/<cgroup>/cpu.rt_period_us" respectively) configurable as well.
+
+The constraint on the period is that a subgroup must have a smaller or
+equal period to its parent. But realistically its not very useful _yet_
+as its prone to starvation without deadline scheduling.
+
+Consider two sibling groups A and B; both have 50% bandwidth, but A's
+period is twice the length of B's.
+
+* group A: period=100000us, runtime=10000us
+       - this runs for 0.01s once every 0.1s
+
+* group B: period= 50000us, runtime=10000us
+       - this runs for 0.01s twice every 0.1s (or once every 0.05 sec).
+
+This means that currently a while (1) loop in A will run for the full period of
+B and can starve B's tasks (assuming they are of lower priority) for a whole
+period.
+
+The next project will be SCHED_EDF (Earliest Deadline First scheduling) to bring
+full deadline scheduling to the linux kernel. Deadline scheduling the above
+groups and treating end of the period as a deadline will ensure that they both
+get their allocated time.
+
+Implementing SCHED_EDF might take a while to complete. Priority Inheritance is
+the biggest challenge as the current linux PI infrastructure is geared towards
+the limited static priority levels 0-139. With deadline scheduling you need to
+do deadline inheritance (since priority is inversely proportional to the
+deadline delta (deadline - now).
+
+This means the whole PI machinery will have to be reworked - and that is one of
+the most complex pieces of code we have.
index 45b86ab45d51f52a495b1a9f3be8614ea4bfcc5a..a46ec689f0ac1e14b46301aa66afb4501842bb4b 100644 (file)
@@ -486,6 +486,12 @@ M: kernel@wantstofly.org
 L:     linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
 S:     Maintained
 
+ARM/GUMSTIX MACHINE SUPPORT
+P:     Steve Sakoman
+M:     sakoman@gmail.com
+L:     linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
+S:     Maintained
+
 ARM/HP JORNADA 7XX MACHINE SUPPORT
 P:      Kristoffer Ericson
 M:      kristoffer.ericson@gmail.com
@@ -3604,6 +3610,11 @@ M:       mhoffman@lightlink.com
 L:     lm-sensors@lm-sensors.org
 S:     Maintained
 
+SMX UIO Interface
+P:     Ben Nizette
+M:     bn@niasdigital.com
+S:     Maintained
+
 SOFTWARE RAID (Multiple Disks) SUPPORT
 P:     Ingo Molnar
 M:     mingo@redhat.com
index 4039a133006e8a2c0af987b99914334a6abac90f..d8d253285a94a33c8cc80607b8e811403563e78b 100644 (file)
@@ -255,6 +255,7 @@ config ARCH_EP93XX
        select ARM_AMBA
        select ARM_VIC
        select GENERIC_GPIO
+       select HAVE_GPIO_LIB
        help
          This enables support for the Cirrus EP93xx series of CPUs.
 
@@ -377,15 +378,17 @@ config ARCH_MXC
        help
          Support for Freescale MXC/iMX-based family of processors
 
-config ARCH_ORION
+config ARCH_ORION5X
        bool "Marvell Orion"
        depends on MMU
        select PCI
        select GENERIC_GPIO
        select GENERIC_TIME
        select GENERIC_CLOCKEVENTS
+       select PLAT_ORION
        help
-         Support for Marvell Orion System on Chip family.
+         Support for the following Marvell Orion 5x series SoCs:
+         Orion-1 (5181), Orion-NAS (5182), Orion-2 (5281.)
 
 config ARCH_PNX4008
        bool "Philips Nexperia PNX4008 Mobile"
@@ -422,10 +425,15 @@ config ARCH_SA1100
        bool "SA1100-based"
        select ISA
        select ARCH_DISCONTIGMEM_ENABLE
+       select ARCH_SPARSEMEM_ENABLE
+       select ARCH_SELECT_MEMORY_MODEL
        select ARCH_MTD_XIP
        select GENERIC_GPIO
        select GENERIC_TIME
+       select GENERIC_CLOCKEVENTS
+       select TICK_ONESHOT
        select HAVE_IDE
+       select HAVE_GPIO_LIB
        help
          Support for StrongARM 11x0 based boards.
 
@@ -468,6 +476,7 @@ config ARCH_DAVINCI
 config ARCH_OMAP
        bool "TI OMAP"
        select GENERIC_GPIO
+       select HAVE_GPIO_LIB
        select GENERIC_TIME
        select GENERIC_CLOCKEVENTS
        help
@@ -516,7 +525,7 @@ source "arch/arm/mach-omap1/Kconfig"
 
 source "arch/arm/mach-omap2/Kconfig"
 
-source "arch/arm/mach-orion/Kconfig"
+source "arch/arm/mach-orion5x/Kconfig"
 
 source "arch/arm/plat-s3c24xx/Kconfig"
 source "arch/arm/plat-s3c/Kconfig"
@@ -563,6 +572,9 @@ config ARCH_ACORN
 config PLAT_IOP
        bool
 
+config PLAT_ORION
+       bool
+
 source arch/arm/mm/Kconfig
 
 config IWMMXT
@@ -650,7 +662,7 @@ source "kernel/time/Kconfig"
 
 config SMP
        bool "Symmetric Multi-Processing (EXPERIMENTAL)"
-       depends on EXPERIMENTAL && REALVIEW_EB_ARM11MP
+       depends on EXPERIMENTAL && (REALVIEW_EB_ARM11MP || MACH_REALVIEW_PB11MP)
        help
          This enables support for systems with more than one CPU. If you have
          a system with only one CPU, like most personal computers, say N. If
@@ -683,7 +695,7 @@ config HOTPLUG_CPU
 
 config LOCAL_TIMERS
        bool "Use local timer interrupts"
-       depends on SMP && REALVIEW_EB_ARM11MP
+       depends on SMP && (REALVIEW_EB_ARM11MP || MACH_REALVIEW_PB11MP)
        default y
        help
          Enable support for local timers on SMP platforms, rather then the
@@ -774,6 +786,12 @@ config ARCH_DISCONTIGMEM_ENABLE
          or have huge holes in the physical address space for other reasons.
          See <file:Documentation/vm/numa> for more.
 
+config ARCH_SPARSEMEM_ENABLE
+       bool
+
+config ARCH_SELECT_MEMORY_MODEL
+       bool
+
 config NODES_SHIFT
        int
        default "4" if ARCH_LH7A40X
@@ -1174,6 +1192,8 @@ source "drivers/dma/Kconfig"
 
 source "drivers/dca/Kconfig"
 
+source "drivers/uio/Kconfig"
+
 endmenu
 
 source "fs/Kconfig"
index 1a4649667ec8d420a541ee55c9a88c9b4bf8d5d8..e72db27e0ba074e599d9eda4101c417c19f78362 100644 (file)
@@ -134,12 +134,11 @@ endif
  machine-$(CONFIG_ARCH_PNX4008)           := pnx4008
  machine-$(CONFIG_ARCH_NETX)      := netx
  machine-$(CONFIG_ARCH_NS9XXX)    := ns9xxx
- textofs-$(CONFIG_ARCH_NS9XXX)    := 0x00108000
  machine-$(CONFIG_ARCH_DAVINCI)           := davinci
  machine-$(CONFIG_ARCH_KS8695)     := ks8695
   incdir-$(CONFIG_ARCH_MXC)       := mxc
  machine-$(CONFIG_ARCH_MX3)       := mx3
- machine-$(CONFIG_ARCH_ORION)     := orion
+ machine-$(CONFIG_ARCH_ORION5X)           := orion5x
  machine-$(CONFIG_ARCH_MSM7X00A)   := msm
 
 ifeq ($(CONFIG_ARCH_EBSA110),y)
@@ -185,6 +184,7 @@ core-$(CONFIG_VFP)          += arch/arm/vfp/
 
 # If we have a common platform directory, then include it in the build.
 core-$(CONFIG_PLAT_IOP)                += arch/arm/plat-iop/
+core-$(CONFIG_PLAT_ORION)              += arch/arm/plat-orion/
 core-$(CONFIG_ARCH_OMAP)       += arch/arm/plat-omap/
 core-$(CONFIG_PLAT_S3C24XX)            += arch/arm/plat-s3c24xx/
 core-$(CONFIG_ARCH_MXC)                += arch/arm/plat-mxc/
index 25f12303b1062d163fcbb846b7e8709e609a640b..da226abce2d0972c2a3cebc8a99276f294e57516 100644 (file)
@@ -61,9 +61,15 @@ endif
 
 quiet_cmd_uimage = UIMAGE  $@
       cmd_uimage = $(CONFIG_SHELL) $(MKIMAGE) -A arm -O linux -T kernel \
-                  -C none -a $(ZRELADDR) -e $(ZRELADDR) \
+                  -C none -a $(LOADADDR) -e $(LOADADDR) \
                   -n 'Linux-$(KERNELRELEASE)' -d $< $@
 
+ifeq ($(CONFIG_ZBOOT_ROM),y)
+$(obj)/uImage: LOADADDR=$(CONFIG_ZBOOT_ROM_TEXT)
+else
+$(obj)/uImage: LOADADDR=$(ZRELADDR)
+endif
+
 $(obj)/uImage: $(obj)/zImage FORCE
        $(call if_changed,uimage)
        @echo '  Image $@ is ready'
index f53bca46e23cadb5e35dd847173b5028a7ffa1c8..aa8f7739c822c5efa1a850beda94bbd4ea8b971a 100644 (file)
@@ -22,7 +22,6 @@
 #include <linux/mutex.h>
 
 #include <asm/rtc.h>
-#include <asm/semaphore.h>
 
 static DECLARE_WAIT_QUEUE_HEAD(rtc_wait);
 static struct fasync_struct *rtc_async_queue;
index 314ebd3a1d718c60f2d7f16f2f8a5dcb98239681..bc299b07a6fa8a949ed72fdc352e2cea817f51ac 100644 (file)
@@ -16,6 +16,7 @@
 #include <linux/slab.h>
 #include <linux/platform_device.h>
 #include <asm/io.h>
+#include <asm/gpio.h>
 #include <asm/hardware/scoop.h>
 
 /* PCMCIA to Scoop linkage
 struct scoop_pcmcia_config *platform_scoop_config;
 EXPORT_SYMBOL(platform_scoop_config);
 
-#define SCOOP_REG(d,adr) (*(volatile unsigned short*)(d +(adr)))
-
 struct  scoop_dev {
-       void  *base;
+       void __iomem *base;
+       struct gpio_chip gpio;
        spinlock_t scoop_lock;
        unsigned short suspend_clr;
        unsigned short suspend_set;
@@ -44,13 +44,84 @@ void reset_scoop(struct device *dev)
 {
        struct scoop_dev *sdev = dev_get_drvdata(dev);
 
-       SCOOP_REG(sdev->base,SCOOP_MCR) = 0x0100;  // 00
-       SCOOP_REG(sdev->base,SCOOP_CDR) = 0x0000;  // 04
-       SCOOP_REG(sdev->base,SCOOP_CCR) = 0x0000;  // 10
-       SCOOP_REG(sdev->base,SCOOP_IMR) = 0x0000;  // 18
-       SCOOP_REG(sdev->base,SCOOP_IRM) = 0x00FF;  // 14
-       SCOOP_REG(sdev->base,SCOOP_ISR) = 0x0000;  // 1C
-       SCOOP_REG(sdev->base,SCOOP_IRM) = 0x0000;
+       iowrite16(0x0100, sdev->base + SCOOP_MCR);  // 00
+       iowrite16(0x0000, sdev->base + SCOOP_CDR);  // 04
+       iowrite16(0x0000, sdev->base + SCOOP_CCR);  // 10
+       iowrite16(0x0000, sdev->base + SCOOP_IMR);  // 18
+       iowrite16(0x00FF, sdev->base + SCOOP_IRM);  // 14
+       iowrite16(0x0000, sdev->base + SCOOP_ISR);  // 1C
+       iowrite16(0x0000, sdev->base + SCOOP_IRM);
+}
+
+static void __scoop_gpio_set(struct scoop_dev *sdev,
+                       unsigned offset, int value)
+{
+       unsigned short gpwr;
+
+       gpwr = ioread16(sdev->base + SCOOP_GPWR);
+       if (value)
+               gpwr |= 1 << (offset + 1);
+       else
+               gpwr &= ~(1 << (offset + 1));
+       iowrite16(gpwr, sdev->base + SCOOP_GPWR);
+}
+
+static void scoop_gpio_set(struct gpio_chip *chip, unsigned offset, int value)
+{
+       struct scoop_dev *sdev = container_of(chip, struct scoop_dev, gpio);
+       unsigned long flags;
+
+       spin_lock_irqsave(&sdev->scoop_lock, flags);
+
+       __scoop_gpio_set(sdev, offset, value);
+
+       spin_unlock_irqrestore(&sdev->scoop_lock, flags);
+}
+
+static int scoop_gpio_get(struct gpio_chip *chip, unsigned offset)
+{
+       struct scoop_dev *sdev = container_of(chip, struct scoop_dev, gpio);
+
+       /* XXX: I'm usure,  but it seems so */
+       return ioread16(sdev->base + SCOOP_GPRR) & (1 << (offset + 1));
+}
+
+static int scoop_gpio_direction_input(struct gpio_chip *chip,
+                       unsigned offset)
+{
+       struct scoop_dev *sdev = container_of(chip, struct scoop_dev, gpio);
+       unsigned long flags;
+       unsigned short gpcr;
+
+       spin_lock_irqsave(&sdev->scoop_lock, flags);
+
+       gpcr = ioread16(sdev->base + SCOOP_GPCR);
+       gpcr &= ~(1 << (offset + 1));
+       iowrite16(gpcr, sdev->base + SCOOP_GPCR);
+
+       spin_unlock_irqrestore(&sdev->scoop_lock, flags);
+
+       return 0;
+}
+
+static int scoop_gpio_direction_output(struct gpio_chip *chip,
+                       unsigned offset, int value)
+{
+       struct scoop_dev *sdev = container_of(chip, struct scoop_dev, gpio);
+       unsigned long flags;
+       unsigned short gpcr;
+
+       spin_lock_irqsave(&sdev->scoop_lock, flags);
+
+       __scoop_gpio_set(sdev, offset, value);
+
+       gpcr = ioread16(sdev->base + SCOOP_GPCR);
+       gpcr |= 1 << (offset + 1);
+       iowrite16(gpcr, sdev->base + SCOOP_GPCR);
+
+       spin_unlock_irqrestore(&sdev->scoop_lock, flags);
+
+       return 0;
 }
 
 unsigned short set_scoop_gpio(struct device *dev, unsigned short bit)
@@ -60,8 +131,8 @@ unsigned short set_scoop_gpio(struct device *dev, unsigned short bit)
        struct scoop_dev *sdev = dev_get_drvdata(dev);
 
        spin_lock_irqsave(&sdev->scoop_lock, flag);
-       gpio_bit = SCOOP_REG(sdev->base, SCOOP_GPWR) | bit;
-       SCOOP_REG(sdev->base, SCOOP_GPWR) = gpio_bit;
+       gpio_bit = ioread16(sdev->base + SCOOP_GPWR) | bit;
+       iowrite16(gpio_bit, sdev->base + SCOOP_GPWR);
        spin_unlock_irqrestore(&sdev->scoop_lock, flag);
 
        return gpio_bit;
@@ -74,8 +145,8 @@ unsigned short reset_scoop_gpio(struct device *dev, unsigned short bit)
        struct scoop_dev *sdev = dev_get_drvdata(dev);
 
        spin_lock_irqsave(&sdev->scoop_lock, flag);
-       gpio_bit = SCOOP_REG(sdev->base, SCOOP_GPWR) & ~bit;
-       SCOOP_REG(sdev->base,SCOOP_GPWR) = gpio_bit;
+       gpio_bit = ioread16(sdev->base + SCOOP_GPWR) & ~bit;
+       iowrite16(gpio_bit, sdev->base + SCOOP_GPWR);
        spin_unlock_irqrestore(&sdev->scoop_lock, flag);
 
        return gpio_bit;
@@ -87,13 +158,13 @@ EXPORT_SYMBOL(reset_scoop_gpio);
 unsigned short read_scoop_reg(struct device *dev, unsigned short reg)
 {
        struct scoop_dev *sdev = dev_get_drvdata(dev);
-       return SCOOP_REG(sdev->base,reg);
+       return ioread16(sdev->base + reg);
 }
 
 void write_scoop_reg(struct device *dev, unsigned short reg, unsigned short data)
 {
        struct scoop_dev *sdev = dev_get_drvdata(dev);
-       SCOOP_REG(sdev->base,reg)=data;
+       iowrite16(data, sdev->base + reg);
 }
 
 EXPORT_SYMBOL(reset_scoop);
@@ -104,9 +175,9 @@ static void check_scoop_reg(struct scoop_dev *sdev)
 {
        unsigned short mcr;
 
-       mcr = SCOOP_REG(sdev->base, SCOOP_MCR);
+       mcr = ioread16(sdev->base + SCOOP_MCR);
        if ((mcr & 0x100) == 0)
-               SCOOP_REG(sdev->base, SCOOP_MCR) = 0x0101;
+               iowrite16(0x0101, sdev->base + SCOOP_MCR);
 }
 
 #ifdef CONFIG_PM
@@ -115,8 +186,8 @@ static int scoop_suspend(struct platform_device *dev, pm_message_t state)
        struct scoop_dev *sdev = platform_get_drvdata(dev);
 
        check_scoop_reg(sdev);
-       sdev->scoop_gpwr = SCOOP_REG(sdev->base, SCOOP_GPWR);
-       SCOOP_REG(sdev->base, SCOOP_GPWR) = (sdev->scoop_gpwr & ~sdev->suspend_clr) | sdev->suspend_set;
+       sdev->scoop_gpwr = ioread16(sdev->base + SCOOP_GPWR);
+       iowrite16((sdev->scoop_gpwr & ~sdev->suspend_clr) | sdev->suspend_set, sdev->base + SCOOP_GPWR);
 
        return 0;
 }
@@ -126,7 +197,7 @@ static int scoop_resume(struct platform_device *dev)
        struct scoop_dev *sdev = platform_get_drvdata(dev);
 
        check_scoop_reg(sdev);
-       SCOOP_REG(sdev->base,SCOOP_GPWR) = sdev->scoop_gpwr;
+       iowrite16(sdev->scoop_gpwr, sdev->base + SCOOP_GPWR);
 
        return 0;
 }
@@ -135,11 +206,13 @@ static int scoop_resume(struct platform_device *dev)
 #define scoop_resume   NULL
 #endif
 
-int __init scoop_probe(struct platform_device *pdev)
+static int __devinit scoop_probe(struct platform_device *pdev)
 {
        struct scoop_dev *devptr;
        struct scoop_config *inf;
        struct resource *mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+       int ret;
+       int temp;
 
        if (!mem)
                return -EINVAL;
@@ -154,40 +227,78 @@ int __init scoop_probe(struct platform_device *pdev)
        devptr->base = ioremap(mem->start, mem->end - mem->start + 1);
 
        if (!devptr->base) {
-               kfree(devptr);
-               return -ENOMEM;
+               ret = -ENOMEM;
+               goto err_ioremap;
        }
 
        platform_set_drvdata(pdev, devptr);
 
-       printk("Sharp Scoop Device found at 0x%08x -> 0x%08x\n",(unsigned int)mem->start,(unsigned int)devptr->base);
+       printk("Sharp Scoop Device found at 0x%08x -> 0x%8p\n",(unsigned int)mem->start, devptr->base);
 
-       SCOOP_REG(devptr->base, SCOOP_MCR) = 0x0140;
+       iowrite16(0x0140, devptr->base + SCOOP_MCR);
        reset_scoop(&pdev->dev);
-       SCOOP_REG(devptr->base, SCOOP_CPR) = 0x0000;
-       SCOOP_REG(devptr->base, SCOOP_GPCR) = inf->io_dir & 0xffff;
-       SCOOP_REG(devptr->base, SCOOP_GPWR) = inf->io_out & 0xffff;
+       iowrite16(0x0000, devptr->base + SCOOP_CPR);
+       iowrite16(inf->io_dir & 0xffff, devptr->base + SCOOP_GPCR);
+       iowrite16(inf->io_out & 0xffff, devptr->base + SCOOP_GPWR);
 
        devptr->suspend_clr = inf->suspend_clr;
        devptr->suspend_set = inf->suspend_set;
 
+       devptr->gpio.base = -1;
+
+       if (inf->gpio_base != 0) {
+               devptr->gpio.label = pdev->dev.bus_id;
+               devptr->gpio.base = inf->gpio_base;
+               devptr->gpio.ngpio = 12; /* PA11 = 0, PA12 = 1, etc. up to PA22 = 11 */
+               devptr->gpio.set = scoop_gpio_set;
+               devptr->gpio.get = scoop_gpio_get;
+               devptr->gpio.direction_input = scoop_gpio_direction_input;
+               devptr->gpio.direction_output = scoop_gpio_direction_output;
+
+               ret = gpiochip_add(&devptr->gpio);
+               if (ret)
+                       goto err_gpio;
+       }
+
        return 0;
+
+       if (devptr->gpio.base != -1)
+               temp = gpiochip_remove(&devptr->gpio);
+err_gpio:
+       platform_set_drvdata(pdev, NULL);
+err_ioremap:
+       iounmap(devptr->base);
+       kfree(devptr);
+
+       return ret;
 }
 
-static int scoop_remove(struct platform_device *pdev)
+static int __devexit scoop_remove(struct platform_device *pdev)
 {
        struct scoop_dev *sdev = platform_get_drvdata(pdev);
-       if (sdev) {
-               iounmap(sdev->base);
-               kfree(sdev);
-               platform_set_drvdata(pdev, NULL);
+       int ret;
+
+       if (!sdev)
+               return -EINVAL;
+
+       if (sdev->gpio.base != -1) {
+               ret = gpiochip_remove(&sdev->gpio);
+               if (ret) {
+                       dev_err(&pdev->dev, "Can't remove gpio chip: %d\n", ret);
+                       return ret;
+               }
        }
+
+       platform_set_drvdata(pdev, NULL);
+       iounmap(sdev->base);
+       kfree(sdev);
+
        return 0;
 }
 
 static struct platform_driver scoop_driver = {
        .probe          = scoop_probe,
-       .remove         = scoop_remove,
+       .remove         = __devexit_p(scoop_remove),
        .suspend        = scoop_suspend,
        .resume         = scoop_resume,
        .driver         = {
@@ -195,7 +306,7 @@ static struct platform_driver scoop_driver = {
        },
 };
 
-int __init scoop_init(void)
+static int __init scoop_init(void)
 {
        return platform_driver_register(&scoop_driver);
 }
diff --git a/arch/arm/configs/am200epdkit_defconfig b/arch/arm/configs/am200epdkit_defconfig
new file mode 100644 (file)
index 0000000..dc030cf
--- /dev/null
@@ -0,0 +1,1149 @@
+#
+# Automatically generated make config: don't edit
+# Linux kernel version: 2.6.25-rc3
+# Sun Mar  9 06:33:33 2008
+#
+CONFIG_ARM=y
+CONFIG_SYS_SUPPORTS_APM_EMULATION=y
+CONFIG_GENERIC_GPIO=y
+CONFIG_GENERIC_TIME=y
+CONFIG_GENERIC_CLOCKEVENTS=y
+CONFIG_MMU=y
+# CONFIG_NO_IOPORT is not set
+CONFIG_GENERIC_HARDIRQS=y
+CONFIG_STACKTRACE_SUPPORT=y
+CONFIG_LOCKDEP_SUPPORT=y
+CONFIG_TRACE_IRQFLAGS_SUPPORT=y
+CONFIG_HARDIRQS_SW_RESEND=y
+CONFIG_GENERIC_IRQ_PROBE=y
+CONFIG_RWSEM_GENERIC_SPINLOCK=y
+# CONFIG_ARCH_HAS_ILOG2_U32 is not set
+# CONFIG_ARCH_HAS_ILOG2_U64 is not set
+CONFIG_GENERIC_HWEIGHT=y
+CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_ARCH_SUPPORTS_AOUT=y
+CONFIG_ZONE_DMA=y
+CONFIG_ARCH_MTD_XIP=y
+CONFIG_VECTORS_BASE=0xffff0000
+CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
+
+#
+# General setup
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_BROKEN_ON_SMP=y
+CONFIG_LOCK_KERNEL=y
+CONFIG_INIT_ENV_ARG_LIMIT=32
+CONFIG_LOCALVERSION="gum"
+CONFIG_LOCALVERSION_AUTO=y
+# CONFIG_SWAP is not set
+CONFIG_SYSVIPC=y
+CONFIG_SYSVIPC_SYSCTL=y
+# CONFIG_POSIX_MQUEUE is not set
+# CONFIG_BSD_PROCESS_ACCT is not set
+# CONFIG_TASKSTATS is not set
+# CONFIG_AUDIT is not set
+# CONFIG_IKCONFIG is not set
+CONFIG_LOG_BUF_SHIFT=17
+# CONFIG_CGROUPS is not set
+CONFIG_GROUP_SCHED=y
+CONFIG_FAIR_GROUP_SCHED=y
+# CONFIG_RT_GROUP_SCHED is not set
+CONFIG_USER_SCHED=y
+# CONFIG_CGROUP_SCHED is not set
+# CONFIG_SYSFS_DEPRECATED is not set
+# CONFIG_RELAY is not set
+# CONFIG_NAMESPACES is not set
+# CONFIG_BLK_DEV_INITRD is not set
+CONFIG_CC_OPTIMIZE_FOR_SIZE=y
+CONFIG_SYSCTL=y
+CONFIG_EMBEDDED=y
+CONFIG_UID16=y
+# CONFIG_SYSCTL_SYSCALL is not set
+CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_ALL is not set
+# CONFIG_KALLSYMS_EXTRA_PASS is not set
+CONFIG_HOTPLUG=y
+CONFIG_PRINTK=y
+CONFIG_BUG=y
+CONFIG_ELF_CORE=y
+CONFIG_COMPAT_BRK=y
+CONFIG_BASE_FULL=y
+CONFIG_FUTEX=y
+CONFIG_ANON_INODES=y
+# CONFIG_EPOLL is not set
+CONFIG_SIGNALFD=y
+CONFIG_TIMERFD=y
+CONFIG_EVENTFD=y
+# CONFIG_SHMEM is not set
+# CONFIG_VM_EVENT_COUNTERS is not set
+CONFIG_SLAB=y
+# CONFIG_SLUB is not set
+# CONFIG_SLOB is not set
+# CONFIG_PROFILING is not set
+# CONFIG_MARKERS is not set
+CONFIG_HAVE_OPROFILE=y
+# CONFIG_KPROBES is not set
+CONFIG_HAVE_KPROBES=y
+CONFIG_PROC_PAGE_MONITOR=y
+CONFIG_SLABINFO=y
+CONFIG_RT_MUTEXES=y
+CONFIG_TINY_SHMEM=y
+CONFIG_BASE_SMALL=0
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+# CONFIG_MODULE_FORCE_UNLOAD is not set
+# CONFIG_MODVERSIONS is not set
+# CONFIG_MODULE_SRCVERSION_ALL is not set
+CONFIG_KMOD=y
+CONFIG_BLOCK=y
+# CONFIG_LBD is not set
+# CONFIG_BLK_DEV_IO_TRACE is not set
+# CONFIG_LSF is not set
+# CONFIG_BLK_DEV_BSG is not set
+
+#
+# IO Schedulers
+#
+CONFIG_IOSCHED_NOOP=y
+# CONFIG_IOSCHED_AS is not set
+# CONFIG_IOSCHED_DEADLINE is not set
+# CONFIG_IOSCHED_CFQ is not set
+# CONFIG_DEFAULT_AS is not set
+# CONFIG_DEFAULT_DEADLINE is not set
+# CONFIG_DEFAULT_CFQ is not set
+CONFIG_DEFAULT_NOOP=y
+CONFIG_DEFAULT_IOSCHED="noop"
+CONFIG_CLASSIC_RCU=y
+# CONFIG_PREEMPT_RCU is not set
+
+#
+# System Type
+#
+# CONFIG_ARCH_AAEC2000 is not set
+# CONFIG_ARCH_INTEGRATOR is not set
+# CONFIG_ARCH_REALVIEW is not set
+# CONFIG_ARCH_VERSATILE is not set
+# CONFIG_ARCH_AT91 is not set
+# CONFIG_ARCH_CLPS7500 is not set
+# CONFIG_ARCH_CLPS711X is not set
+# CONFIG_ARCH_CO285 is not set
+# CONFIG_ARCH_EBSA110 is not set
+# CONFIG_ARCH_EP93XX is not set
+# CONFIG_ARCH_FOOTBRIDGE is not set
+# CONFIG_ARCH_NETX is not set
+# CONFIG_ARCH_H720X is not set
+# CONFIG_ARCH_IMX is not set
+# CONFIG_ARCH_IOP13XX is not set
+# CONFIG_ARCH_IOP32X is not set
+# CONFIG_ARCH_IOP33X is not set
+# CONFIG_ARCH_IXP23XX is not set
+# CONFIG_ARCH_IXP2000 is not set
+# CONFIG_ARCH_IXP4XX is not set
+# CONFIG_ARCH_L7200 is not set
+# CONFIG_ARCH_KS8695 is not set
+# CONFIG_ARCH_NS9XXX is not set
+# CONFIG_ARCH_MXC is not set
+# CONFIG_ARCH_ORION is not set
+# CONFIG_ARCH_PNX4008 is not set
+CONFIG_ARCH_PXA=y
+# CONFIG_ARCH_RPC is not set
+# CONFIG_ARCH_SA1100 is not set
+# CONFIG_ARCH_S3C2410 is not set
+# CONFIG_ARCH_SHARK is not set
+# CONFIG_ARCH_LH7A40X is not set
+# CONFIG_ARCH_DAVINCI is not set
+# CONFIG_ARCH_OMAP is not set
+# CONFIG_ARCH_MSM7X00A is not set
+
+#
+# Intel PXA2xx/PXA3xx Implementations
+#
+CONFIG_ARCH_GUMSTIX=y
+# CONFIG_ARCH_LUBBOCK is not set
+# CONFIG_MACH_LOGICPD_PXA270 is not set
+# CONFIG_MACH_MAINSTONE is not set
+# CONFIG_ARCH_PXA_IDP is not set
+# CONFIG_PXA_SHARPSL is not set
+# CONFIG_ARCH_PXA_ESERIES is not set
+# CONFIG_MACH_TRIZEPS4 is not set
+# CONFIG_MACH_EM_X270 is not set
+# CONFIG_MACH_COLIBRI is not set
+# CONFIG_MACH_ZYLONITE is not set
+# CONFIG_MACH_LITTLETON is not set
+# CONFIG_MACH_ARMCORE is not set
+# CONFIG_MACH_MAGICIAN is not set
+# CONFIG_MACH_PCM027 is not set
+CONFIG_MACH_GUMSTIX_F=y
+CONFIG_PXA25x=y
+
+#
+# Boot options
+#
+
+#
+# Power management
+#
+
+#
+# Processor Type
+#
+CONFIG_CPU_32=y
+CONFIG_CPU_XSCALE=y
+CONFIG_CPU_32v5=y
+CONFIG_CPU_ABRT_EV5T=y
+CONFIG_CPU_CACHE_VIVT=y
+CONFIG_CPU_TLB_V4WBI=y
+CONFIG_CPU_CP15=y
+CONFIG_CPU_CP15_MMU=y
+
+#
+# Processor Features
+#
+CONFIG_ARM_THUMB=y
+# CONFIG_CPU_DCACHE_DISABLE is not set
+# CONFIG_OUTER_CACHE is not set
+# CONFIG_IWMMXT is not set
+CONFIG_XSCALE_PMU=y
+
+#
+# Bus support
+#
+# CONFIG_PCI_SYSCALL is not set
+# CONFIG_ARCH_SUPPORTS_MSI is not set
+CONFIG_PCCARD=y
+# CONFIG_PCMCIA_DEBUG is not set
+CONFIG_PCMCIA=y
+CONFIG_PCMCIA_LOAD_CIS=y
+# CONFIG_PCMCIA_IOCTL is not set
+
+#
+# PC-card bridges
+#
+CONFIG_PCMCIA_PXA2XX=y
+
+#
+# Kernel Features
+#
+CONFIG_TICK_ONESHOT=y
+# CONFIG_NO_HZ is not set
+# CONFIG_HIGH_RES_TIMERS is not set
+CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
+CONFIG_PREEMPT=y
+CONFIG_HZ=100
+CONFIG_AEABI=y
+# CONFIG_OABI_COMPAT is not set
+# CONFIG_ARCH_DISCONTIGMEM_ENABLE is not set
+CONFIG_SELECT_MEMORY_MODEL=y
+CONFIG_FLATMEM_MANUAL=y
+# CONFIG_DISCONTIGMEM_MANUAL is not set
+# CONFIG_SPARSEMEM_MANUAL is not set
+CONFIG_FLATMEM=y
+CONFIG_FLAT_NODE_MEM_MAP=y
+# CONFIG_SPARSEMEM_STATIC is not set
+# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
+CONFIG_SPLIT_PTLOCK_CPUS=4096
+# CONFIG_RESOURCES_64BIT is not set
+CONFIG_ZONE_DMA_FLAG=1
+CONFIG_BOUNCE=y
+CONFIG_VIRT_TO_BUS=y
+CONFIG_ALIGNMENT_TRAP=y
+
+#
+# Boot options
+#
+CONFIG_ZBOOT_ROM_TEXT=0x0
+CONFIG_ZBOOT_ROM_BSS=0x0
+CONFIG_CMDLINE="console=ttyS0,115200n8 root=1f01 rootfstype=jffs2"
+# CONFIG_XIP_KERNEL is not set
+# CONFIG_KEXEC is not set
+
+#
+# CPU Frequency scaling
+#
+# CONFIG_CPU_FREQ is not set
+
+#
+# Floating point emulation
+#
+
+#
+# At least one emulation must be selected
+#
+
+#
+# Userspace binary formats
+#
+CONFIG_BINFMT_ELF=y
+# CONFIG_BINFMT_AOUT is not set
+# CONFIG_BINFMT_MISC is not set
+
+#
+# Power management options
+#
+# CONFIG_PM is not set
+CONFIG_ARCH_SUSPEND_POSSIBLE=y
+
+#
+# Networking
+#
+CONFIG_NET=y
+
+#
+# Networking options
+#
+CONFIG_PACKET=m
+CONFIG_PACKET_MMAP=y
+CONFIG_UNIX=y
+# CONFIG_NET_KEY is not set
+CONFIG_INET=y
+# CONFIG_IP_MULTICAST is not set
+# CONFIG_IP_ADVANCED_ROUTER is not set
+CONFIG_IP_FIB_HASH=y
+# CONFIG_IP_PNP is not set
+# CONFIG_NET_IPIP is not set
+# CONFIG_NET_IPGRE is not set
+# CONFIG_ARPD is not set
+# CONFIG_SYN_COOKIES is not set
+# CONFIG_INET_AH is not set
+# CONFIG_INET_ESP is not set
+# CONFIG_INET_IPCOMP is not set
+# CONFIG_INET_XFRM_TUNNEL is not set
+# CONFIG_INET_TUNNEL is not set
+# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
+# CONFIG_INET_XFRM_MODE_TUNNEL is not set
+# CONFIG_INET_XFRM_MODE_BEET is not set
+# CONFIG_INET_LRO is not set
+# CONFIG_INET_DIAG is not set
+# CONFIG_TCP_CONG_ADVANCED is not set
+CONFIG_TCP_CONG_CUBIC=y
+CONFIG_DEFAULT_TCP_CONG="cubic"
+# CONFIG_TCP_MD5SIG is not set
+# CONFIG_IPV6 is not set
+# CONFIG_INET6_XFRM_TUNNEL is not set
+# CONFIG_INET6_TUNNEL is not set
+# CONFIG_NETWORK_SECMARK is not set
+# CONFIG_NETFILTER is not set
+# CONFIG_IP_DCCP is not set
+# CONFIG_IP_SCTP is not set
+# CONFIG_TIPC is not set
+# CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
+# CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
+# CONFIG_LLC2 is not set
+# CONFIG_IPX is not set
+# CONFIG_ATALK is not set
+# CONFIG_X25 is not set
+# CONFIG_LAPB is not set
+# CONFIG_ECONET is not set
+# CONFIG_WAN_ROUTER is not set
+# CONFIG_NET_SCHED is not set
+
+#
+# Network testing
+#
+# CONFIG_NET_PKTGEN is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_CAN is not set
+# CONFIG_IRDA is not set
+CONFIG_BT=m
+CONFIG_BT_L2CAP=m
+CONFIG_BT_SCO=m
+CONFIG_BT_RFCOMM=m
+CONFIG_BT_RFCOMM_TTY=y
+CONFIG_BT_BNEP=m
+# CONFIG_BT_BNEP_MC_FILTER is not set
+# CONFIG_BT_BNEP_PROTO_FILTER is not set
+# CONFIG_BT_HIDP is not set
+
+#
+# Bluetooth device drivers
+#
+# CONFIG_BT_HCIBTSDIO is not set
+CONFIG_BT_HCIUART=m
+CONFIG_BT_HCIUART_H4=y
+# CONFIG_BT_HCIUART_BCSP is not set
+# CONFIG_BT_HCIUART_LL is not set
+# CONFIG_BT_HCIDTL1 is not set
+# CONFIG_BT_HCIBT3C is not set
+# CONFIG_BT_HCIBLUECARD is not set
+# CONFIG_BT_HCIBTUART is not set
+# CONFIG_BT_HCIVHCI is not set
+# CONFIG_AF_RXRPC is not set
+
+#
+# Wireless
+#
+# CONFIG_CFG80211 is not set
+CONFIG_WIRELESS_EXT=y
+# CONFIG_MAC80211 is not set
+CONFIG_IEEE80211=m
+# CONFIG_IEEE80211_DEBUG is not set
+CONFIG_IEEE80211_CRYPT_WEP=m
+# CONFIG_IEEE80211_CRYPT_CCMP is not set
+# CONFIG_IEEE80211_CRYPT_TKIP is not set
+# CONFIG_IEEE80211_SOFTMAC is not set
+# CONFIG_RFKILL is not set
+# CONFIG_NET_9P is not set
+
+#
+# Device Drivers
+#
+
+#
+# Generic Driver Options
+#
+CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
+CONFIG_STANDALONE=y
+CONFIG_PREVENT_FIRMWARE_BUILD=y
+CONFIG_FW_LOADER=y
+# CONFIG_DEBUG_DRIVER is not set
+# CONFIG_DEBUG_DEVRES is not set
+# CONFIG_SYS_HYPERVISOR is not set
+# CONFIG_CONNECTOR is not set
+CONFIG_MTD=y
+# CONFIG_MTD_DEBUG is not set
+# CONFIG_MTD_CONCAT is not set
+CONFIG_MTD_PARTITIONS=y
+# CONFIG_MTD_REDBOOT_PARTS is not set
+# CONFIG_MTD_CMDLINE_PARTS is not set
+# CONFIG_MTD_AFS_PARTS is not set
+
+#
+# User Modules And Translation Layers
+#
+CONFIG_MTD_CHAR=y
+CONFIG_MTD_BLKDEVS=y
+CONFIG_MTD_BLOCK=y
+# CONFIG_FTL is not set
+# CONFIG_NFTL is not set
+# CONFIG_INFTL is not set
+# CONFIG_RFD_FTL is not set
+# CONFIG_SSFDC is not set
+# CONFIG_MTD_OOPS is not set
+
+#
+# RAM/ROM/Flash chip drivers
+#
+CONFIG_MTD_CFI=y
+# CONFIG_MTD_JEDECPROBE is not set
+CONFIG_MTD_GEN_PROBE=y
+CONFIG_MTD_CFI_ADV_OPTIONS=y
+CONFIG_MTD_CFI_NOSWAP=y
+# CONFIG_MTD_CFI_BE_BYTE_SWAP is not set
+# CONFIG_MTD_CFI_LE_BYTE_SWAP is not set
+CONFIG_MTD_CFI_GEOMETRY=y
+# CONFIG_MTD_MAP_BANK_WIDTH_1 is not set
+CONFIG_MTD_MAP_BANK_WIDTH_2=y
+# CONFIG_MTD_MAP_BANK_WIDTH_4 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
+CONFIG_MTD_CFI_I1=y
+# CONFIG_MTD_CFI_I2 is not set
+# CONFIG_MTD_CFI_I4 is not set
+# CONFIG_MTD_CFI_I8 is not set
+# CONFIG_MTD_OTP is not set
+CONFIG_MTD_CFI_INTELEXT=y
+# CONFIG_MTD_CFI_AMDSTD is not set
+# CONFIG_MTD_CFI_STAA is not set
+CONFIG_MTD_CFI_UTIL=y
+# CONFIG_MTD_RAM is not set
+# CONFIG_MTD_ROM is not set
+# CONFIG_MTD_ABSENT is not set
+# CONFIG_MTD_XIP is not set
+
+#
+# Mapping drivers for chip access
+#
+CONFIG_MTD_COMPLEX_MAPPINGS=y
+# CONFIG_MTD_PHYSMAP is not set
+CONFIG_MTD_PXA2XX=y
+# CONFIG_MTD_ARM_INTEGRATOR is not set
+# CONFIG_MTD_SHARP_SL is not set
+# CONFIG_MTD_PLATRAM is not set
+
+#
+# Self-contained MTD device drivers
+#
+# CONFIG_MTD_SLRAM is not set
+# CONFIG_MTD_PHRAM is not set
+# CONFIG_MTD_MTDRAM is not set
+# CONFIG_MTD_BLOCK2MTD is not set
+
+#
+# Disk-On-Chip Device Drivers
+#
+# CONFIG_MTD_DOC2000 is not set
+# CONFIG_MTD_DOC2001 is not set
+# CONFIG_MTD_DOC2001PLUS is not set
+# CONFIG_MTD_NAND is not set
+# CONFIG_MTD_ONENAND is not set
+
+#
+# UBI - Unsorted block images
+#
+# CONFIG_MTD_UBI is not set
+# CONFIG_PARPORT is not set
+CONFIG_BLK_DEV=y
+# CONFIG_BLK_DEV_COW_COMMON is not set
+CONFIG_BLK_DEV_LOOP=m
+# CONFIG_BLK_DEV_CRYPTOLOOP is not set
+# CONFIG_BLK_DEV_NBD is not set
+# CONFIG_BLK_DEV_RAM is not set
+# CONFIG_CDROM_PKTCDVD is not set
+# CONFIG_ATA_OVER_ETH is not set
+CONFIG_MISC_DEVICES=y
+# CONFIG_EEPROM_93CX6 is not set
+# CONFIG_ENCLOSURE_SERVICES is not set
+CONFIG_HAVE_IDE=y
+CONFIG_IDE=m
+CONFIG_IDE_MAX_HWIFS=2
+CONFIG_BLK_DEV_IDE=m
+
+#
+# Please see Documentation/ide.txt for help/info on IDE drives
+#
+# CONFIG_BLK_DEV_IDE_SATA is not set
+CONFIG_BLK_DEV_IDEDISK=m
+# CONFIG_IDEDISK_MULTI_MODE is not set
+CONFIG_BLK_DEV_IDECS=m
+# CONFIG_BLK_DEV_IDECD is not set
+# CONFIG_BLK_DEV_IDETAPE is not set
+# CONFIG_BLK_DEV_IDEFLOPPY is not set
+# CONFIG_IDE_TASK_IOCTL is not set
+CONFIG_IDE_PROC_FS=y
+
+#
+# IDE chipset support/bugfixes
+#
+CONFIG_IDE_GENERIC=m
+# CONFIG_BLK_DEV_PLATFORM is not set
+# CONFIG_BLK_DEV_IDEDMA is not set
+CONFIG_IDE_ARCH_OBSOLETE_INIT=y
+# CONFIG_BLK_DEV_HD is not set
+
+#
+# SCSI device support
+#
+# CONFIG_RAID_ATTRS is not set
+# CONFIG_SCSI is not set
+# CONFIG_SCSI_DMA is not set
+# CONFIG_SCSI_NETLINK is not set
+# CONFIG_ATA is not set
+# CONFIG_MD is not set
+CONFIG_NETDEVICES=y
+# CONFIG_NETDEVICES_MULTIQUEUE is not set
+# CONFIG_DUMMY is not set
+# CONFIG_BONDING is not set
+# CONFIG_MACVLAN is not set
+# CONFIG_EQUALIZER is not set
+# CONFIG_TUN is not set
+# CONFIG_VETH is not set
+# CONFIG_PHYLIB is not set
+CONFIG_NET_ETHERNET=y
+CONFIG_MII=m
+# CONFIG_AX88796 is not set
+CONFIG_SMC91X=m
+# CONFIG_DM9000 is not set
+# CONFIG_SMC911X is not set
+# CONFIG_IBM_NEW_EMAC_ZMII is not set
+# CONFIG_IBM_NEW_EMAC_RGMII is not set
+# CONFIG_IBM_NEW_EMAC_TAH is not set
+# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
+# CONFIG_B44 is not set
+CONFIG_NETDEV_1000=y
+# CONFIG_E1000E_ENABLED is not set
+CONFIG_NETDEV_10000=y
+
+#
+# Wireless LAN
+#
+# CONFIG_WLAN_PRE80211 is not set
+# CONFIG_WLAN_80211 is not set
+# CONFIG_NET_PCMCIA is not set
+# CONFIG_WAN is not set
+# CONFIG_PPP is not set
+# CONFIG_SLIP is not set
+# CONFIG_NETCONSOLE is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_ISDN is not set
+
+#
+# Input device support
+#
+CONFIG_INPUT=y
+# CONFIG_INPUT_FF_MEMLESS is not set
+# CONFIG_INPUT_POLLDEV is not set
+
+#
+# Userland interfaces
+#
+CONFIG_INPUT_MOUSEDEV=y
+CONFIG_INPUT_MOUSEDEV_PSAUX=y
+CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
+CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
+# CONFIG_INPUT_JOYDEV is not set
+# CONFIG_INPUT_EVDEV is not set
+# CONFIG_INPUT_EVBUG is not set
+
+#
+# Input Device Drivers
+#
+CONFIG_INPUT_KEYBOARD=y
+CONFIG_KEYBOARD_ATKBD=y
+# CONFIG_KEYBOARD_SUNKBD is not set
+# CONFIG_KEYBOARD_LKKBD is not set
+# CONFIG_KEYBOARD_XTKBD is not set
+# CONFIG_KEYBOARD_NEWTON is not set
+# CONFIG_KEYBOARD_STOWAWAY is not set
+# CONFIG_KEYBOARD_GPIO is not set
+CONFIG_INPUT_MOUSE=y
+CONFIG_MOUSE_PS2=y
+CONFIG_MOUSE_PS2_ALPS=y
+CONFIG_MOUSE_PS2_LOGIPS2PP=y
+CONFIG_MOUSE_PS2_SYNAPTICS=y
+CONFIG_MOUSE_PS2_LIFEBOOK=y
+CONFIG_MOUSE_PS2_TRACKPOINT=y
+# CONFIG_MOUSE_PS2_TOUCHKIT is not set
+# CONFIG_MOUSE_SERIAL is not set
+# CONFIG_MOUSE_APPLETOUCH is not set
+# CONFIG_MOUSE_VSXXXAA is not set
+# CONFIG_MOUSE_GPIO is not set
+# CONFIG_INPUT_JOYSTICK is not set
+# CONFIG_INPUT_TABLET is not set
+# CONFIG_INPUT_TOUCHSCREEN is not set
+# CONFIG_INPUT_MISC is not set
+
+#
+# Hardware I/O ports
+#
+CONFIG_SERIO=y
+CONFIG_SERIO_SERPORT=y
+CONFIG_SERIO_LIBPS2=y
+# CONFIG_SERIO_RAW is not set
+# CONFIG_GAMEPORT is not set
+
+#
+# Character devices
+#
+CONFIG_VT=y
+CONFIG_VT_CONSOLE=y
+CONFIG_HW_CONSOLE=y
+# CONFIG_VT_HW_CONSOLE_BINDING is not set
+# CONFIG_SERIAL_NONSTANDARD is not set
+
+#
+# Serial drivers
+#
+# CONFIG_SERIAL_8250 is not set
+
+#
+# Non-8250 serial port support
+#
+CONFIG_SERIAL_PXA=y
+CONFIG_SERIAL_PXA_CONSOLE=y
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+CONFIG_UNIX98_PTYS=y
+# CONFIG_LEGACY_PTYS is not set
+# CONFIG_IPMI_HANDLER is not set
+# CONFIG_HW_RANDOM is not set
+# CONFIG_NVRAM is not set
+# CONFIG_R3964 is not set
+
+#
+# PCMCIA character devices
+#
+# CONFIG_SYNCLINK_CS is not set
+# CONFIG_CARDMAN_4000 is not set
+# CONFIG_CARDMAN_4040 is not set
+# CONFIG_IPWIRELESS is not set
+# CONFIG_RAW_DRIVER is not set
+# CONFIG_TCG_TPM is not set
+# CONFIG_I2C is not set
+
+#
+# SPI support
+#
+# CONFIG_SPI is not set
+# CONFIG_SPI_MASTER is not set
+CONFIG_HAVE_GPIO_LIB=y
+
+#
+# GPIO Support
+#
+# CONFIG_DEBUG_GPIO is not set
+
+#
+# I2C GPIO expanders:
+#
+
+#
+# SPI GPIO expanders:
+#
+# CONFIG_W1 is not set
+# CONFIG_POWER_SUPPLY is not set
+# CONFIG_HWMON is not set
+CONFIG_WATCHDOG=y
+# CONFIG_WATCHDOG_NOWAYOUT is not set
+
+#
+# Watchdog Device Drivers
+#
+# CONFIG_SOFT_WATCHDOG is not set
+CONFIG_SA1100_WATCHDOG=m
+
+#
+# Sonics Silicon Backplane
+#
+CONFIG_SSB_POSSIBLE=y
+# CONFIG_SSB is not set
+
+#
+# Multifunction device drivers
+#
+# CONFIG_MFD_SM501 is not set
+# CONFIG_MFD_ASIC3 is not set
+
+#
+# Multimedia devices
+#
+# CONFIG_VIDEO_DEV is not set
+# CONFIG_DVB_CORE is not set
+CONFIG_DAB=y
+
+#
+# Graphics support
+#
+# CONFIG_VGASTATE is not set
+# CONFIG_VIDEO_OUTPUT_CONTROL is not set
+CONFIG_FB=y
+# CONFIG_FIRMWARE_EDID is not set
+# CONFIG_FB_DDC is not set
+CONFIG_FB_CFB_FILLRECT=y
+CONFIG_FB_CFB_COPYAREA=y
+CONFIG_FB_CFB_IMAGEBLIT=y
+# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
+CONFIG_FB_SYS_FILLRECT=m
+CONFIG_FB_SYS_COPYAREA=m
+CONFIG_FB_SYS_IMAGEBLIT=m
+CONFIG_FB_SYS_FOPS=m
+CONFIG_FB_DEFERRED_IO=y
+# CONFIG_FB_SVGALIB is not set
+# CONFIG_FB_MACMODES is not set
+# CONFIG_FB_BACKLIGHT is not set
+CONFIG_FB_MODE_HELPERS=y
+CONFIG_FB_TILEBLITTING=y
+
+#
+# Frame buffer hardware drivers
+#
+# CONFIG_FB_S1D13XXX is not set
+CONFIG_FB_PXA=y
+CONFIG_FB_PXA_PARAMETERS=y
+CONFIG_FB_MBX=m
+CONFIG_FB_VIRTUAL=m
+# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
+
+#
+# Display device support
+#
+# CONFIG_DISPLAY_SUPPORT is not set
+
+#
+# Console display driver support
+#
+# CONFIG_VGA_CONSOLE is not set
+CONFIG_DUMMY_CONSOLE=y
+# CONFIG_FRAMEBUFFER_CONSOLE is not set
+# CONFIG_LOGO is not set
+
+#
+# Sound
+#
+CONFIG_SOUND=m
+
+#
+# Advanced Linux Sound Architecture
+#
+CONFIG_SND=m
+CONFIG_SND_TIMER=m
+CONFIG_SND_PCM=m
+# CONFIG_SND_SEQUENCER is not set
+CONFIG_SND_OSSEMUL=y
+CONFIG_SND_MIXER_OSS=m
+CONFIG_SND_PCM_OSS=m
+CONFIG_SND_PCM_OSS_PLUGINS=y
+# CONFIG_SND_DYNAMIC_MINORS is not set
+# CONFIG_SND_SUPPORT_OLD_API is not set
+# CONFIG_SND_VERBOSE_PROCFS is not set
+# CONFIG_SND_VERBOSE_PRINTK is not set
+# CONFIG_SND_DEBUG is not set
+
+#
+# Generic devices
+#
+CONFIG_SND_AC97_CODEC=m
+# CONFIG_SND_DUMMY is not set
+# CONFIG_SND_MTPAV is not set
+# CONFIG_SND_SERIAL_U16550 is not set
+# CONFIG_SND_MPU401 is not set
+
+#
+# ALSA ARM devices
+#
+CONFIG_SND_PXA2XX_PCM=m
+CONFIG_SND_PXA2XX_AC97=m
+
+#
+# PCMCIA devices
+#
+# CONFIG_SND_VXPOCKET is not set
+# CONFIG_SND_PDAUDIOCF is not set
+
+#
+# System on Chip audio support
+#
+# CONFIG_SND_SOC is not set
+
+#
+# SoC Audio support for SuperH
+#
+
+#
+# ALSA SoC audio for Freescale SOCs
+#
+
+#
+# Open Sound System
+#
+# CONFIG_SOUND_PRIME is not set
+CONFIG_AC97_BUS=m
+CONFIG_HID_SUPPORT=y
+CONFIG_HID=y
+# CONFIG_HID_DEBUG is not set
+# CONFIG_HIDRAW is not set
+CONFIG_USB_SUPPORT=y
+CONFIG_USB_ARCH_HAS_HCD=y
+# CONFIG_USB_ARCH_HAS_OHCI is not set
+# CONFIG_USB_ARCH_HAS_EHCI is not set
+# CONFIG_USB is not set
+
+#
+# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
+#
+CONFIG_USB_GADGET=y
+# CONFIG_USB_GADGET_DEBUG is not set
+# CONFIG_USB_GADGET_DEBUG_FILES is not set
+CONFIG_USB_GADGET_SELECTED=y
+# CONFIG_USB_GADGET_AMD5536UDC is not set
+# CONFIG_USB_GADGET_ATMEL_USBA is not set
+# CONFIG_USB_GADGET_FSL_USB2 is not set
+# CONFIG_USB_GADGET_NET2280 is not set
+CONFIG_USB_GADGET_PXA2XX=y
+CONFIG_USB_PXA2XX=y
+# CONFIG_USB_PXA2XX_SMALL is not set
+# CONFIG_USB_GADGET_M66592 is not set
+# CONFIG_USB_GADGET_GOKU is not set
+# CONFIG_USB_GADGET_LH7A40X is not set
+# CONFIG_USB_GADGET_OMAP is not set
+# CONFIG_USB_GADGET_S3C2410 is not set
+# CONFIG_USB_GADGET_AT91 is not set
+# CONFIG_USB_GADGET_DUMMY_HCD is not set
+# CONFIG_USB_GADGET_DUALSPEED is not set
+# CONFIG_USB_ZERO is not set
+CONFIG_USB_ETH=y
+CONFIG_USB_ETH_RNDIS=y
+# CONFIG_USB_GADGETFS is not set
+# CONFIG_USB_FILE_STORAGE is not set
+# CONFIG_USB_G_SERIAL is not set
+# CONFIG_USB_MIDI_GADGET is not set
+# CONFIG_USB_G_PRINTER is not set
+CONFIG_MMC=y
+# CONFIG_MMC_DEBUG is not set
+# CONFIG_MMC_UNSAFE_RESUME is not set
+
+#
+# MMC/SD Card Drivers
+#
+CONFIG_MMC_BLOCK=y
+CONFIG_MMC_BLOCK_BOUNCE=y
+# CONFIG_SDIO_UART is not set
+
+#
+# MMC/SD Host Controller Drivers
+#
+CONFIG_MMC_PXA=y
+# CONFIG_NEW_LEDS is not set
+CONFIG_RTC_LIB=y
+# CONFIG_RTC_CLASS is not set
+
+#
+# File systems
+#
+# CONFIG_EXT2_FS is not set
+# CONFIG_EXT3_FS is not set
+# CONFIG_EXT4DEV_FS is not set
+# CONFIG_REISERFS_FS is not set
+# CONFIG_JFS_FS is not set
+# CONFIG_FS_POSIX_ACL is not set
+# CONFIG_XFS_FS is not set
+# CONFIG_GFS2_FS is not set
+# CONFIG_OCFS2_FS is not set
+# CONFIG_DNOTIFY is not set
+CONFIG_INOTIFY=y
+CONFIG_INOTIFY_USER=y
+# CONFIG_QUOTA is not set
+# CONFIG_AUTOFS_FS is not set
+# CONFIG_AUTOFS4_FS is not set
+# CONFIG_FUSE_FS is not set
+
+#
+# CD-ROM/DVD Filesystems
+#
+# CONFIG_ISO9660_FS is not set
+# CONFIG_UDF_FS is not set
+
+#
+# DOS/FAT/NT Filesystems
+#
+CONFIG_FAT_FS=y
+# CONFIG_MSDOS_FS is not set
+CONFIG_VFAT_FS=y
+CONFIG_FAT_DEFAULT_CODEPAGE=437
+CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
+# CONFIG_NTFS_FS is not set
+
+#
+# Pseudo filesystems
+#
+CONFIG_PROC_FS=y
+CONFIG_PROC_SYSCTL=y
+CONFIG_SYSFS=y
+CONFIG_TMPFS=y
+# CONFIG_TMPFS_POSIX_ACL is not set
+# CONFIG_HUGETLB_PAGE is not set
+# CONFIG_CONFIGFS_FS is not set
+
+#
+# Miscellaneous filesystems
+#
+# CONFIG_ADFS_FS is not set
+# CONFIG_AFFS_FS is not set
+# CONFIG_HFS_FS is not set
+# CONFIG_HFSPLUS_FS is not set
+# CONFIG_BEFS_FS is not set
+# CONFIG_BFS_FS is not set
+# CONFIG_EFS_FS is not set
+CONFIG_JFFS2_FS=y
+CONFIG_JFFS2_FS_DEBUG=0
+CONFIG_JFFS2_FS_WRITEBUFFER=y
+# CONFIG_JFFS2_FS_WBUF_VERIFY is not set
+# CONFIG_JFFS2_SUMMARY is not set
+# CONFIG_JFFS2_FS_XATTR is not set
+CONFIG_JFFS2_COMPRESSION_OPTIONS=y
+CONFIG_JFFS2_ZLIB=y
+# CONFIG_JFFS2_LZO is not set
+CONFIG_JFFS2_RTIME=y
+CONFIG_JFFS2_RUBIN=y
+# CONFIG_JFFS2_CMODE_NONE is not set
+CONFIG_JFFS2_CMODE_PRIORITY=y
+# CONFIG_JFFS2_CMODE_SIZE is not set
+# CONFIG_JFFS2_CMODE_FAVOURLZO is not set
+# CONFIG_CRAMFS is not set
+# CONFIG_VXFS_FS is not set
+# CONFIG_MINIX_FS is not set
+# CONFIG_HPFS_FS is not set
+# CONFIG_QNX4FS_FS is not set
+# CONFIG_ROMFS_FS is not set
+# CONFIG_SYSV_FS is not set
+# CONFIG_UFS_FS is not set
+CONFIG_NETWORK_FILESYSTEMS=y
+# CONFIG_NFS_FS is not set
+# CONFIG_NFSD is not set
+# CONFIG_SMB_FS is not set
+# CONFIG_CIFS is not set
+# CONFIG_NCP_FS is not set
+# CONFIG_CODA_FS is not set
+# CONFIG_AFS_FS is not set
+
+#
+# Partition Types
+#
+CONFIG_PARTITION_ADVANCED=y
+# CONFIG_ACORN_PARTITION is not set
+# CONFIG_OSF_PARTITION is not set
+# CONFIG_AMIGA_PARTITION is not set
+# CONFIG_ATARI_PARTITION is not set
+# CONFIG_MAC_PARTITION is not set
+CONFIG_MSDOS_PARTITION=y
+# CONFIG_BSD_DISKLABEL is not set
+# CONFIG_MINIX_SUBPARTITION is not set
+# CONFIG_SOLARIS_X86_PARTITION is not set
+# CONFIG_UNIXWARE_DISKLABEL is not set
+# CONFIG_LDM_PARTITION is not set
+# CONFIG_SGI_PARTITION is not set
+# CONFIG_ULTRIX_PARTITION is not set
+# CONFIG_SUN_PARTITION is not set
+# CONFIG_KARMA_PARTITION is not set
+# CONFIG_EFI_PARTITION is not set
+# CONFIG_SYSV68_PARTITION is not set
+CONFIG_NLS=y
+CONFIG_NLS_DEFAULT="iso8859-1"
+CONFIG_NLS_CODEPAGE_437=y
+# CONFIG_NLS_CODEPAGE_737 is not set
+# CONFIG_NLS_CODEPAGE_775 is not set
+# CONFIG_NLS_CODEPAGE_850 is not set
+# CONFIG_NLS_CODEPAGE_852 is not set
+# CONFIG_NLS_CODEPAGE_855 is not set
+# CONFIG_NLS_CODEPAGE_857 is not set
+# CONFIG_NLS_CODEPAGE_860 is not set
+# CONFIG_NLS_CODEPAGE_861 is not set
+# CONFIG_NLS_CODEPAGE_862 is not set
+# CONFIG_NLS_CODEPAGE_863 is not set
+# CONFIG_NLS_CODEPAGE_864 is not set
+# CONFIG_NLS_CODEPAGE_865 is not set
+# CONFIG_NLS_CODEPAGE_866 is not set
+# CONFIG_NLS_CODEPAGE_869 is not set
+# CONFIG_NLS_CODEPAGE_936 is not set
+# CONFIG_NLS_CODEPAGE_950 is not set
+# CONFIG_NLS_CODEPAGE_932 is not set
+# CONFIG_NLS_CODEPAGE_949 is not set
+# CONFIG_NLS_CODEPAGE_874 is not set
+# CONFIG_NLS_ISO8859_8 is not set
+# CONFIG_NLS_CODEPAGE_1250 is not set
+# CONFIG_NLS_CODEPAGE_1251 is not set
+# CONFIG_NLS_ASCII is not set
+CONFIG_NLS_ISO8859_1=y
+# CONFIG_NLS_ISO8859_2 is not set
+# CONFIG_NLS_ISO8859_3 is not set
+# CONFIG_NLS_ISO8859_4 is not set
+# CONFIG_NLS_ISO8859_5 is not set
+# CONFIG_NLS_ISO8859_6 is not set
+# CONFIG_NLS_ISO8859_7 is not set
+# CONFIG_NLS_ISO8859_9 is not set
+# CONFIG_NLS_ISO8859_13 is not set
+# CONFIG_NLS_ISO8859_14 is not set
+# CONFIG_NLS_ISO8859_15 is not set
+# CONFIG_NLS_KOI8_R is not set
+# CONFIG_NLS_KOI8_U is not set
+# CONFIG_NLS_UTF8 is not set
+# CONFIG_DLM is not set
+
+#
+# Kernel hacking
+#
+# CONFIG_PRINTK_TIME is not set
+CONFIG_ENABLE_WARN_DEPRECATED=y
+CONFIG_ENABLE_MUST_CHECK=y
+# CONFIG_MAGIC_SYSRQ is not set
+# CONFIG_UNUSED_SYMBOLS is not set
+# CONFIG_DEBUG_FS is not set
+# CONFIG_HEADERS_CHECK is not set
+CONFIG_DEBUG_KERNEL=y
+# CONFIG_DEBUG_SHIRQ is not set
+# CONFIG_DETECT_SOFTLOCKUP is not set
+CONFIG_SCHED_DEBUG=y
+# CONFIG_SCHEDSTATS is not set
+# CONFIG_TIMER_STATS is not set
+# CONFIG_DEBUG_SLAB is not set
+# CONFIG_DEBUG_PREEMPT is not set
+# CONFIG_DEBUG_RT_MUTEXES is not set
+# CONFIG_RT_MUTEX_TESTER is not set
+# CONFIG_DEBUG_SPINLOCK is not set
+# CONFIG_DEBUG_MUTEXES is not set
+# CONFIG_DEBUG_LOCK_ALLOC is not set
+# CONFIG_PROVE_LOCKING is not set
+# CONFIG_LOCK_STAT is not set
+# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
+# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
+# CONFIG_DEBUG_KOBJECT is not set
+# CONFIG_DEBUG_BUGVERBOSE is not set
+# CONFIG_DEBUG_INFO is not set
+# CONFIG_DEBUG_VM is not set
+# CONFIG_DEBUG_LIST is not set
+# CONFIG_DEBUG_SG is not set
+CONFIG_FRAME_POINTER=y
+# CONFIG_BOOT_PRINTK_DELAY is not set
+# CONFIG_RCU_TORTURE_TEST is not set
+# CONFIG_BACKTRACE_SELF_TEST is not set
+# CONFIG_FAULT_INJECTION is not set
+# CONFIG_SAMPLES is not set
+CONFIG_DEBUG_USER=y
+CONFIG_DEBUG_ERRORS=y
+# CONFIG_DEBUG_STACK_USAGE is not set
+# CONFIG_DEBUG_LL is not set
+
+#
+# Security options
+#
+# CONFIG_KEYS is not set
+# CONFIG_SECURITY is not set
+# CONFIG_SECURITY_FILE_CAPABILITIES is not set
+CONFIG_CRYPTO=y
+CONFIG_CRYPTO_ALGAPI=m
+CONFIG_CRYPTO_BLKCIPHER=m
+# CONFIG_CRYPTO_SEQIV is not set
+CONFIG_CRYPTO_MANAGER=m
+# CONFIG_CRYPTO_HMAC is not set
+# CONFIG_CRYPTO_XCBC is not set
+# CONFIG_CRYPTO_NULL is not set
+# CONFIG_CRYPTO_MD4 is not set
+# CONFIG_CRYPTO_MD5 is not set
+# CONFIG_CRYPTO_SHA1 is not set
+# CONFIG_CRYPTO_SHA256 is not set
+# CONFIG_CRYPTO_SHA512 is not set
+# CONFIG_CRYPTO_WP512 is not set
+# CONFIG_CRYPTO_TGR192 is not set
+# CONFIG_CRYPTO_GF128MUL is not set
+CONFIG_CRYPTO_ECB=m
+CONFIG_CRYPTO_CBC=m
+CONFIG_CRYPTO_PCBC=m
+# CONFIG_CRYPTO_LRW is not set
+# CONFIG_CRYPTO_XTS is not set
+# CONFIG_CRYPTO_CTR is not set
+# CONFIG_CRYPTO_GCM is not set
+# CONFIG_CRYPTO_CCM is not set
+# CONFIG_CRYPTO_CRYPTD is not set
+# CONFIG_CRYPTO_DES is not set
+# CONFIG_CRYPTO_FCRYPT is not set
+# CONFIG_CRYPTO_BLOWFISH is not set
+# CONFIG_CRYPTO_TWOFISH is not set
+# CONFIG_CRYPTO_SERPENT is not set
+# CONFIG_CRYPTO_AES is not set
+# CONFIG_CRYPTO_CAST5 is not set
+# CONFIG_CRYPTO_CAST6 is not set
+# CONFIG_CRYPTO_TEA is not set
+CONFIG_CRYPTO_ARC4=m
+# CONFIG_CRYPTO_KHAZAD is not set
+# CONFIG_CRYPTO_ANUBIS is not set
+# CONFIG_CRYPTO_SEED is not set
+# CONFIG_CRYPTO_SALSA20 is not set
+# CONFIG_CRYPTO_DEFLATE is not set
+# CONFIG_CRYPTO_MICHAEL_MIC is not set
+# CONFIG_CRYPTO_CRC32C is not set
+# CONFIG_CRYPTO_CAMELLIA is not set
+# CONFIG_CRYPTO_TEST is not set
+# CONFIG_CRYPTO_AUTHENC is not set
+# CONFIG_CRYPTO_LZO is not set
+CONFIG_CRYPTO_HW=y
+
+#
+# Library routines
+#
+CONFIG_BITREVERSE=y
+# CONFIG_CRC_CCITT is not set
+# CONFIG_CRC16 is not set
+# CONFIG_CRC_ITU_T is not set
+CONFIG_CRC32=y
+# CONFIG_CRC7 is not set
+# CONFIG_LIBCRC32C is not set
+CONFIG_ZLIB_INFLATE=y
+CONFIG_ZLIB_DEFLATE=y
+CONFIG_PLIST=y
+CONFIG_HAS_IOMEM=y
+CONFIG_HAS_IOPORT=y
+CONFIG_HAS_DMA=y
index e10d003566d6360d937d1f008055a553fb57fe80..2dbbbc3d4ac36d91fafc246a20434af0b9f31c5e 100644 (file)
@@ -620,14 +620,14 @@ CONFIG_I2C_CHARDEV=y
 #
 # I2C Algorithms
 #
-# CONFIG_I2C_ALGOBIT is not set
+CONFIG_I2C_ALGOBIT=y
 # CONFIG_I2C_ALGOPCF is not set
 # CONFIG_I2C_ALGOPCA is not set
 
 #
 # I2C Hardware Bus support
 #
-CONFIG_I2C_AT91=y
+CONFIG_I2C_GPIO=y
 # CONFIG_I2C_PARPORT_LIGHT is not set
 # CONFIG_I2C_STUB is not set
 # CONFIG_I2C_PCA_ISA is not set
index 834dddb513144ce90da4be457d9136bff3086c6f..6e994f7820c6975dbf97fd127017e13c436e518b 100644 (file)
@@ -594,14 +594,14 @@ CONFIG_I2C_CHARDEV=y
 #
 # I2C Algorithms
 #
-# CONFIG_I2C_ALGOBIT is not set
+CONFIG_I2C_ALGOBIT=y
 # CONFIG_I2C_ALGOPCF is not set
 # CONFIG_I2C_ALGOPCA is not set
 
 #
 # I2C Hardware Bus support
 #
-CONFIG_I2C_AT91=y
+CONFIG_I2C_GPIO=y
 # CONFIG_I2C_PARPORT_LIGHT is not set
 # CONFIG_I2C_STUB is not set
 # CONFIG_I2C_PCA_ISA is not set
index 46b0c734aeb92d90537ae62f2619c691d5041672..f659c938473f8da945fc1540a0bcf3bd8d7457fb 100644 (file)
@@ -1,43 +1,56 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.19-rc6
-# Fri Nov 17 18:42:21 2006
+# Linux kernel version: 2.6.24-rc7
+# Tue Jan  8 22:20:50 2008
 #
 CONFIG_ARM=y
+CONFIG_SYS_SUPPORTS_APM_EMULATION=y
+CONFIG_GENERIC_GPIO=y
 # CONFIG_GENERIC_TIME is not set
+# CONFIG_GENERIC_CLOCKEVENTS is not set
 CONFIG_MMU=y
+# CONFIG_NO_IOPORT is not set
 CONFIG_GENERIC_HARDIRQS=y
+CONFIG_STACKTRACE_SUPPORT=y
+CONFIG_LOCKDEP_SUPPORT=y
 CONFIG_TRACE_IRQFLAGS_SUPPORT=y
 CONFIG_HARDIRQS_SW_RESEND=y
 CONFIG_GENERIC_IRQ_PROBE=y
 CONFIG_RWSEM_GENERIC_SPINLOCK=y
+# CONFIG_ARCH_HAS_ILOG2_U32 is not set
+# CONFIG_ARCH_HAS_ILOG2_U64 is not set
 CONFIG_GENERIC_HWEIGHT=y
 CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_ZONE_DMA=y
 CONFIG_VECTORS_BASE=0xffff0000
 CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
 
 #
-# Code maturity level options
+# General setup
 #
 CONFIG_EXPERIMENTAL=y
 CONFIG_BROKEN_ON_SMP=y
 CONFIG_INIT_ENV_ARG_LIMIT=32
-
-#
-# General setup
-#
 CONFIG_LOCALVERSION=""
 # CONFIG_LOCALVERSION_AUTO is not set
 # CONFIG_SWAP is not set
 CONFIG_SYSVIPC=y
-# CONFIG_IPC_NS is not set
+CONFIG_SYSVIPC_SYSCTL=y
 # CONFIG_POSIX_MQUEUE is not set
 # CONFIG_BSD_PROCESS_ACCT is not set
 # CONFIG_TASKSTATS is not set
-# CONFIG_UTS_NS is not set
+# CONFIG_USER_NS is not set
+# CONFIG_PID_NS is not set
 # CONFIG_AUDIT is not set
 # CONFIG_IKCONFIG is not set
+CONFIG_LOG_BUF_SHIFT=14
+# CONFIG_CGROUPS is not set
+CONFIG_FAIR_GROUP_SCHED=y
+CONFIG_FAIR_USER_SCHED=y
+# CONFIG_FAIR_CGROUP_SCHED is not set
+CONFIG_SYSFS_DEPRECATED=y
 # CONFIG_RELAY is not set
+CONFIG_BLK_DEV_INITRD=y
 CONFIG_INITRAMFS_SOURCE=""
 CONFIG_CC_OPTIMIZE_FOR_SIZE=y
 CONFIG_SYSCTL=y
@@ -53,30 +66,30 @@ CONFIG_BUG=y
 CONFIG_ELF_CORE=y
 CONFIG_BASE_FULL=y
 CONFIG_FUTEX=y
+CONFIG_ANON_INODES=y
 CONFIG_EPOLL=y
+CONFIG_SIGNALFD=y
+CONFIG_EVENTFD=y
 CONFIG_SHMEM=y
-CONFIG_SLAB=y
 CONFIG_VM_EVENT_COUNTERS=y
+CONFIG_SLAB=y
+# CONFIG_SLUB is not set
+# CONFIG_SLOB is not set
+CONFIG_SLABINFO=y
 CONFIG_RT_MUTEXES=y
 # CONFIG_TINY_SHMEM is not set
 CONFIG_BASE_SMALL=0
-# CONFIG_SLOB is not set
-
-#
-# Loadable module support
-#
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
 # CONFIG_MODULE_FORCE_UNLOAD is not set
 # CONFIG_MODVERSIONS is not set
 # CONFIG_MODULE_SRCVERSION_ALL is not set
 CONFIG_KMOD=y
-
-#
-# Block layer
-#
 CONFIG_BLOCK=y
+# CONFIG_LBD is not set
 # CONFIG_BLK_DEV_IO_TRACE is not set
+# CONFIG_LSF is not set
+# CONFIG_BLK_DEV_BSG is not set
 
 #
 # IO Schedulers
@@ -108,12 +121,16 @@ CONFIG_ARCH_AT91=y
 # CONFIG_ARCH_NETX is not set
 # CONFIG_ARCH_H720X is not set
 # CONFIG_ARCH_IMX is not set
+# CONFIG_ARCH_IOP13XX is not set
 # CONFIG_ARCH_IOP32X is not set
 # CONFIG_ARCH_IOP33X is not set
-# CONFIG_ARCH_IXP4XX is not set
-# CONFIG_ARCH_IXP2000 is not set
 # CONFIG_ARCH_IXP23XX is not set
+# CONFIG_ARCH_IXP2000 is not set
+# CONFIG_ARCH_IXP4XX is not set
 # CONFIG_ARCH_L7200 is not set
+# CONFIG_ARCH_KS8695 is not set
+# CONFIG_ARCH_NS9XXX is not set
+# CONFIG_ARCH_MXC is not set
 # CONFIG_ARCH_PNX4008 is not set
 # CONFIG_ARCH_PXA is not set
 # CONFIG_ARCH_RPC is not set
@@ -121,29 +138,52 @@ CONFIG_ARCH_AT91=y
 # CONFIG_ARCH_S3C2410 is not set
 # CONFIG_ARCH_SHARK is not set
 # CONFIG_ARCH_LH7A40X is not set
+# CONFIG_ARCH_DAVINCI is not set
 # CONFIG_ARCH_OMAP is not set
 
+#
+# Boot options
+#
+
+#
+# Power management
+#
+
 #
 # Atmel AT91 System-on-Chip
 #
 # CONFIG_ARCH_AT91RM9200 is not set
 CONFIG_ARCH_AT91SAM9260=y
 # CONFIG_ARCH_AT91SAM9261 is not set
+# CONFIG_ARCH_AT91SAM9263 is not set
+# CONFIG_ARCH_AT91SAM9RL is not set
+# CONFIG_ARCH_AT91X40 is not set
+CONFIG_AT91_PMC_UNIT=y
+
+#
+# AT91SAM9260 Variants
+#
+# CONFIG_ARCH_AT91SAM9260_SAM9XE is not set
 
 #
-# AT91SAM9260 Board Type
+# AT91SAM9260 / AT91SAM9XE Board Type
 #
 CONFIG_MACH_AT91SAM9260EK=y
+# CONFIG_MACH_CAM60 is not set
+# CONFIG_MACH_SAM9_L9260 is not set
 
 #
 # AT91 Board Options
 #
+# CONFIG_MTD_AT91_DATAFLASH_CARD is not set
 # CONFIG_MTD_NAND_AT91_BUSWIDTH_16 is not set
 
 #
 # AT91 Feature Selections
 #
-# CONFIG_AT91_PROGRAMMABLE_CLOCKS is not set
+CONFIG_AT91_PROGRAMMABLE_CLOCKS=y
+# CONFIG_ATMEL_TCLIB is not set
+CONFIG_AT91_TIMER_HZ=100
 
 #
 # Processor Type
@@ -166,19 +206,19 @@ CONFIG_CPU_CP15_MMU=y
 # CONFIG_CPU_DCACHE_DISABLE is not set
 # CONFIG_CPU_DCACHE_WRITETHROUGH is not set
 # CONFIG_CPU_CACHE_ROUND_ROBIN is not set
+# CONFIG_OUTER_CACHE is not set
 
 #
 # Bus support
 #
-
-#
-# PCCARD (PCMCIA/CardBus) support
-#
+# CONFIG_PCI_SYSCALL is not set
+# CONFIG_ARCH_SUPPORTS_MSI is not set
 # CONFIG_PCCARD is not set
 
 #
 # Kernel Features
 #
+# CONFIG_TICK_ONESHOT is not set
 # CONFIG_PREEMPT is not set
 # CONFIG_NO_IDLE_HZ is not set
 CONFIG_HZ=100
@@ -191,8 +231,12 @@ CONFIG_FLATMEM_MANUAL=y
 CONFIG_FLATMEM=y
 CONFIG_FLAT_NODE_MEM_MAP=y
 # CONFIG_SPARSEMEM_STATIC is not set
+# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
 CONFIG_SPLIT_PTLOCK_CPUS=4096
 # CONFIG_RESOURCES_64BIT is not set
+CONFIG_ZONE_DMA_FLAG=1
+CONFIG_BOUNCE=y
+CONFIG_VIRT_TO_BUS=y
 # CONFIG_LEDS is not set
 CONFIG_ALIGNMENT_TRAP=y
 
@@ -203,6 +247,7 @@ CONFIG_ZBOOT_ROM_TEXT=0x0
 CONFIG_ZBOOT_ROM_BSS=0x0
 CONFIG_CMDLINE="mem=64M console=ttyS0,115200 initrd=0x21100000,3145728 root=/dev/ram0 rw"
 # CONFIG_XIP_KERNEL is not set
+# CONFIG_KEXEC is not set
 
 #
 # Floating point emulation
@@ -228,7 +273,7 @@ CONFIG_BINFMT_ELF=y
 # Power management options
 #
 # CONFIG_PM is not set
-# CONFIG_APM is not set
+CONFIG_SUSPEND_UP_POSSIBLE=y
 
 #
 # Networking
@@ -238,13 +283,9 @@ CONFIG_NET=y
 #
 # Networking options
 #
-# CONFIG_NETDEBUG is not set
 CONFIG_PACKET=y
 # CONFIG_PACKET_MMAP is not set
 CONFIG_UNIX=y
-CONFIG_XFRM=y
-# CONFIG_XFRM_USER is not set
-# CONFIG_XFRM_SUB_POLICY is not set
 # CONFIG_NET_KEY is not set
 CONFIG_INET=y
 # CONFIG_IP_MULTICAST is not set
@@ -263,33 +304,23 @@ CONFIG_IP_PNP_BOOTP=y
 # CONFIG_INET_IPCOMP is not set
 # CONFIG_INET_XFRM_TUNNEL is not set
 # CONFIG_INET_TUNNEL is not set
-CONFIG_INET_XFRM_MODE_TRANSPORT=y
-CONFIG_INET_XFRM_MODE_TUNNEL=y
-CONFIG_INET_XFRM_MODE_BEET=y
+# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
+# CONFIG_INET_XFRM_MODE_TUNNEL is not set
+# CONFIG_INET_XFRM_MODE_BEET is not set
+# CONFIG_INET_LRO is not set
 CONFIG_INET_DIAG=y
 CONFIG_INET_TCP_DIAG=y
 # CONFIG_TCP_CONG_ADVANCED is not set
 CONFIG_TCP_CONG_CUBIC=y
 CONFIG_DEFAULT_TCP_CONG="cubic"
+# CONFIG_TCP_MD5SIG is not set
 # CONFIG_IPV6 is not set
 # CONFIG_INET6_XFRM_TUNNEL is not set
 # CONFIG_INET6_TUNNEL is not set
 # CONFIG_NETWORK_SECMARK is not set
 # CONFIG_NETFILTER is not set
-
-#
-# DCCP Configuration (EXPERIMENTAL)
-#
 # CONFIG_IP_DCCP is not set
-
-#
-# SCTP Configuration (EXPERIMENTAL)
-#
 # CONFIG_IP_SCTP is not set
-
-#
-# TIPC Configuration (EXPERIMENTAL)
-#
 # CONFIG_TIPC is not set
 # CONFIG_ATM is not set
 # CONFIG_BRIDGE is not set
@@ -302,10 +333,6 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
 # CONFIG_LAPB is not set
 # CONFIG_ECONET is not set
 # CONFIG_WAN_ROUTER is not set
-
-#
-# QoS and/or fair queueing
-#
 # CONFIG_NET_SCHED is not set
 
 #
@@ -315,7 +342,17 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
 # CONFIG_HAMRADIO is not set
 # CONFIG_IRDA is not set
 # CONFIG_BT is not set
+# CONFIG_AF_RXRPC is not set
+
+#
+# Wireless
+#
+# CONFIG_CFG80211 is not set
+# CONFIG_WIRELESS_EXT is not set
+# CONFIG_MAC80211 is not set
 # CONFIG_IEEE80211 is not set
+# CONFIG_RFKILL is not set
+# CONFIG_NET_9P is not set
 
 #
 # Device Drivers
@@ -324,34 +361,17 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
 #
 # Generic Driver Options
 #
+CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
 CONFIG_STANDALONE=y
 CONFIG_PREVENT_FIRMWARE_BUILD=y
 # CONFIG_FW_LOADER is not set
 # CONFIG_DEBUG_DRIVER is not set
+# CONFIG_DEBUG_DEVRES is not set
 # CONFIG_SYS_HYPERVISOR is not set
-
-#
-# Connector - unified userspace <-> kernelspace linker
-#
 # CONFIG_CONNECTOR is not set
-
-#
-# Memory Technology Devices (MTD)
-#
 # CONFIG_MTD is not set
-
-#
-# Parallel port support
-#
 # CONFIG_PARPORT is not set
-
-#
-# Plug and Play support
-#
-
-#
-# Block devices
-#
+CONFIG_BLK_DEV=y
 # CONFIG_BLK_DEV_COW_COMMON is not set
 # CONFIG_BLK_DEV_LOOP is not set
 # CONFIG_BLK_DEV_NBD is not set
@@ -360,15 +380,19 @@ CONFIG_BLK_DEV_RAM=y
 CONFIG_BLK_DEV_RAM_COUNT=16
 CONFIG_BLK_DEV_RAM_SIZE=8192
 CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
-CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CDROM_PKTCDVD is not set
 # CONFIG_ATA_OVER_ETH is not set
+CONFIG_MISC_DEVICES=y
+# CONFIG_EEPROM_93CX6 is not set
+CONFIG_ATMEL_SSC=y
 
 #
 # SCSI device support
 #
 # CONFIG_RAID_ATTRS is not set
 CONFIG_SCSI=y
+CONFIG_SCSI_DMA=y
+# CONFIG_SCSI_TGT is not set
 # CONFIG_SCSI_NETLINK is not set
 CONFIG_SCSI_PROC_FS=y
 
@@ -388,6 +412,8 @@ CONFIG_BLK_DEV_SD=y
 CONFIG_SCSI_MULTI_LUN=y
 # CONFIG_SCSI_CONSTANTS is not set
 # CONFIG_SCSI_LOGGING is not set
+# CONFIG_SCSI_SCAN_ASYNC is not set
+CONFIG_SCSI_WAIT_SCAN=m
 
 #
 # SCSI Transports
@@ -395,43 +421,72 @@ CONFIG_SCSI_MULTI_LUN=y
 # CONFIG_SCSI_SPI_ATTRS is not set
 # CONFIG_SCSI_FC_ATTRS is not set
 # CONFIG_SCSI_ISCSI_ATTRS is not set
-# CONFIG_SCSI_SAS_ATTRS is not set
 # CONFIG_SCSI_SAS_LIBSAS is not set
-
-#
-# SCSI low-level drivers
-#
+# CONFIG_SCSI_SRP_ATTRS is not set
+CONFIG_SCSI_LOWLEVEL=y
 # CONFIG_ISCSI_TCP is not set
 # CONFIG_SCSI_DEBUG is not set
-
-#
-# Multi-device support (RAID and LVM)
-#
+# CONFIG_ATA is not set
 # CONFIG_MD is not set
+CONFIG_NETDEVICES=y
+# CONFIG_NETDEVICES_MULTIQUEUE is not set
+# CONFIG_DUMMY is not set
+# CONFIG_BONDING is not set
+# CONFIG_MACVLAN is not set
+# CONFIG_EQUALIZER is not set
+# CONFIG_TUN is not set
+# CONFIG_VETH is not set
+CONFIG_PHYLIB=y
+
+#
+# MII PHY device drivers
+#
+# CONFIG_MARVELL_PHY is not set
+# CONFIG_DAVICOM_PHY is not set
+# CONFIG_QSEMI_PHY is not set
+# CONFIG_LXT_PHY is not set
+# CONFIG_CICADA_PHY is not set
+# CONFIG_VITESSE_PHY is not set
+# CONFIG_SMSC_PHY is not set
+# CONFIG_BROADCOM_PHY is not set
+# CONFIG_ICPLUS_PHY is not set
+# CONFIG_FIXED_PHY is not set
+# CONFIG_MDIO_BITBANG is not set
+CONFIG_NET_ETHERNET=y
+CONFIG_MII=y
+CONFIG_MACB=y
+# CONFIG_AX88796 is not set
+# CONFIG_SMC91X is not set
+# CONFIG_DM9000 is not set
+# CONFIG_IBM_NEW_EMAC_ZMII is not set
+# CONFIG_IBM_NEW_EMAC_RGMII is not set
+# CONFIG_IBM_NEW_EMAC_TAH is not set
+# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
+# CONFIG_B44 is not set
+CONFIG_NETDEV_1000=y
+CONFIG_NETDEV_10000=y
+
+#
+# Wireless LAN
+#
+# CONFIG_WLAN_PRE80211 is not set
+# CONFIG_WLAN_80211 is not set
 
 #
-# Fusion MPT device support
-#
-# CONFIG_FUSION is not set
-
-#
-# IEEE 1394 (FireWire) support
-#
-
-#
-# I2O device support
-#
-
-#
-# Network device support
+# USB Network Adapters
 #
-# CONFIG_NETDEVICES is not set
+# CONFIG_USB_CATC is not set
+# CONFIG_USB_KAWETH is not set
+# CONFIG_USB_PEGASUS is not set
+# CONFIG_USB_RTL8150 is not set
+# CONFIG_USB_USBNET is not set
+# CONFIG_WAN is not set
+# CONFIG_PPP is not set
+# CONFIG_SLIP is not set
+# CONFIG_SHAPER is not set
+# CONFIG_NETCONSOLE is not set
 # CONFIG_NETPOLL is not set
 # CONFIG_NET_POLL_CONTROLLER is not set
-
-#
-# ISDN subsystem
-#
 # CONFIG_ISDN is not set
 
 #
@@ -439,6 +494,7 @@ CONFIG_SCSI_MULTI_LUN=y
 #
 CONFIG_INPUT=y
 # CONFIG_INPUT_FF_MEMLESS is not set
+# CONFIG_INPUT_POLLDEV is not set
 
 #
 # Userland interfaces
@@ -448,7 +504,6 @@ CONFIG_INPUT_MOUSEDEV=y
 CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
 CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
 # CONFIG_INPUT_JOYDEV is not set
-# CONFIG_INPUT_TSDEV is not set
 # CONFIG_INPUT_EVDEV is not set
 # CONFIG_INPUT_EVBUG is not set
 
@@ -458,6 +513,7 @@ CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
 # CONFIG_INPUT_KEYBOARD is not set
 # CONFIG_INPUT_MOUSE is not set
 # CONFIG_INPUT_JOYSTICK is not set
+# CONFIG_INPUT_TABLET is not set
 # CONFIG_INPUT_TOUCHSCREEN is not set
 # CONFIG_INPUT_MISC is not set
 
@@ -492,114 +548,131 @@ CONFIG_SERIAL_CORE_CONSOLE=y
 CONFIG_UNIX98_PTYS=y
 CONFIG_LEGACY_PTYS=y
 CONFIG_LEGACY_PTY_COUNT=256
-
-#
-# IPMI
-#
 # CONFIG_IPMI_HANDLER is not set
-
-#
-# Watchdog Cards
-#
-CONFIG_WATCHDOG=y
-CONFIG_WATCHDOG_NOWAYOUT=y
-
-#
-# Watchdog Device Drivers
-#
-# CONFIG_SOFT_WATCHDOG is not set
-
-#
-# USB-based Watchdog Cards
-#
-# CONFIG_USBPCWATCHDOG is not set
-CONFIG_HW_RANDOM=y
+# CONFIG_HW_RANDOM is not set
 # CONFIG_NVRAM is not set
-# CONFIG_DTLK is not set
 # CONFIG_R3964 is not set
+# CONFIG_RAW_DRIVER is not set
+# CONFIG_TCG_TPM is not set
+CONFIG_I2C=y
+CONFIG_I2C_BOARDINFO=y
+CONFIG_I2C_CHARDEV=y
 
 #
-# Ftape, the floppy tape device driver
+# I2C Algorithms
 #
-# CONFIG_RAW_DRIVER is not set
+CONFIG_I2C_ALGOBIT=y
+# CONFIG_I2C_ALGOPCF is not set
+# CONFIG_I2C_ALGOPCA is not set
 
 #
-# TPM devices
+# I2C Hardware Bus support
 #
-# CONFIG_TCG_TPM is not set
+CONFIG_I2C_GPIO=y
+# CONFIG_I2C_OCORES is not set
+# CONFIG_I2C_PARPORT_LIGHT is not set
+# CONFIG_I2C_SIMTEC is not set
+# CONFIG_I2C_TAOS_EVM is not set
+# CONFIG_I2C_STUB is not set
+# CONFIG_I2C_TINY_USB is not set
+# CONFIG_I2C_PCA is not set
 
 #
-# I2C support
+# Miscellaneous I2C Chip support
 #
-# CONFIG_I2C is not set
+# CONFIG_SENSORS_DS1337 is not set
+# CONFIG_SENSORS_DS1374 is not set
+# CONFIG_DS1682 is not set
+# CONFIG_SENSORS_EEPROM is not set
+# CONFIG_SENSORS_PCF8574 is not set
+# CONFIG_SENSORS_PCA9539 is not set
+# CONFIG_SENSORS_PCF8591 is not set
+# CONFIG_SENSORS_MAX6875 is not set
+# CONFIG_SENSORS_TSL2550 is not set
+# CONFIG_I2C_DEBUG_CORE is not set
+# CONFIG_I2C_DEBUG_ALGO is not set
+# CONFIG_I2C_DEBUG_BUS is not set
+# CONFIG_I2C_DEBUG_CHIP is not set
 
 #
 # SPI support
 #
 # CONFIG_SPI is not set
 # CONFIG_SPI_MASTER is not set
-
-#
-# Dallas's 1-wire bus
-#
 # CONFIG_W1 is not set
-
-#
-# Hardware Monitoring support
-#
+# CONFIG_POWER_SUPPLY is not set
 # CONFIG_HWMON is not set
-# CONFIG_HWMON_VID is not set
+CONFIG_WATCHDOG=y
+CONFIG_WATCHDOG_NOWAYOUT=y
 
 #
-# Misc devices
+# Watchdog Device Drivers
 #
-# CONFIG_TIFM_CORE is not set
+# CONFIG_SOFT_WATCHDOG is not set
+CONFIG_AT91SAM9_WATCHDOG=y
 
 #
-# LED devices
+# USB-based Watchdog Cards
 #
-# CONFIG_NEW_LEDS is not set
+# CONFIG_USBPCWATCHDOG is not set
 
 #
-# LED drivers
+# Sonics Silicon Backplane
 #
+CONFIG_SSB_POSSIBLE=y
+# CONFIG_SSB is not set
 
 #
-# LED Triggers
+# Multifunction device drivers
 #
+# CONFIG_MFD_SM501 is not set
 
 #
 # Multimedia devices
 #
 # CONFIG_VIDEO_DEV is not set
+# CONFIG_DVB_CORE is not set
+# CONFIG_DAB is not set
 
 #
-# Digital Video Broadcasting Devices
+# Graphics support
 #
-# CONFIG_DVB is not set
-# CONFIG_USB_DABUSB is not set
+# CONFIG_VGASTATE is not set
+# CONFIG_VIDEO_OUTPUT_CONTROL is not set
+# CONFIG_FB is not set
+# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
 
 #
-# Graphics support
+# Display device support
 #
-# CONFIG_FIRMWARE_EDID is not set
-# CONFIG_FB is not set
+# CONFIG_DISPLAY_SUPPORT is not set
 
 #
 # Console display driver support
 #
 # CONFIG_VGA_CONSOLE is not set
 CONFIG_DUMMY_CONSOLE=y
-# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
 
 #
 # Sound
 #
 # CONFIG_SOUND is not set
+CONFIG_HID_SUPPORT=y
+CONFIG_HID=y
+# CONFIG_HID_DEBUG is not set
+# CONFIG_HIDRAW is not set
 
 #
-# USB support
+# USB Input Devices
 #
+# CONFIG_USB_HID is not set
+
+#
+# USB HID Boot Protocol drivers
+#
+# CONFIG_USB_KBD is not set
+# CONFIG_USB_MOUSE is not set
+CONFIG_USB_SUPPORT=y
 CONFIG_USB_ARCH_HAS_HCD=y
 CONFIG_USB_ARCH_HAS_OHCI=y
 # CONFIG_USB_ARCH_HAS_EHCI is not set
@@ -610,7 +683,7 @@ CONFIG_USB=y
 # Miscellaneous USB options
 #
 CONFIG_USB_DEVICEFS=y
-# CONFIG_USB_BANDWIDTH is not set
+CONFIG_USB_DEVICE_CLASS=y
 # CONFIG_USB_DYNAMIC_MINORS is not set
 # CONFIG_USB_OTG is not set
 
@@ -619,9 +692,11 @@ CONFIG_USB_DEVICEFS=y
 #
 # CONFIG_USB_ISP116X_HCD is not set
 CONFIG_USB_OHCI_HCD=y
-# CONFIG_USB_OHCI_BIG_ENDIAN is not set
+# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set
+# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set
 CONFIG_USB_OHCI_LITTLE_ENDIAN=y
 # CONFIG_USB_SL811_HCD is not set
+# CONFIG_USB_R8A66597_HCD is not set
 
 #
 # USB Device Class drivers
@@ -640,6 +715,7 @@ CONFIG_USB_STORAGE=y
 CONFIG_USB_STORAGE_DEBUG=y
 # CONFIG_USB_STORAGE_DATAFAB is not set
 # CONFIG_USB_STORAGE_FREECOM is not set
+# CONFIG_USB_STORAGE_ISD200 is not set
 # CONFIG_USB_STORAGE_DPCM is not set
 # CONFIG_USB_STORAGE_USBAT is not set
 # CONFIG_USB_STORAGE_SDDR09 is not set
@@ -649,44 +725,11 @@ CONFIG_USB_STORAGE_DEBUG=y
 # CONFIG_USB_STORAGE_KARMA is not set
 # CONFIG_USB_LIBUSUAL is not set
 
-#
-# USB Input Devices
-#
-# CONFIG_USB_HID is not set
-
-#
-# USB HID Boot Protocol drivers
-#
-# CONFIG_USB_KBD is not set
-# CONFIG_USB_MOUSE is not set
-# CONFIG_USB_AIPTEK is not set
-# CONFIG_USB_WACOM is not set
-# CONFIG_USB_ACECAD is not set
-# CONFIG_USB_KBTAB is not set
-# CONFIG_USB_POWERMATE is not set
-# CONFIG_USB_TOUCHSCREEN is not set
-# CONFIG_USB_YEALINK is not set
-# CONFIG_USB_XPAD is not set
-# CONFIG_USB_ATI_REMOTE is not set
-# CONFIG_USB_ATI_REMOTE2 is not set
-# CONFIG_USB_KEYSPAN_REMOTE is not set
-# CONFIG_USB_APPLETOUCH is not set
-
 #
 # USB Imaging devices
 #
 # CONFIG_USB_MDC800 is not set
 # CONFIG_USB_MICROTEK is not set
-
-#
-# USB Network Adapters
-#
-# CONFIG_USB_CATC is not set
-# CONFIG_USB_KAWETH is not set
-# CONFIG_USB_PEGASUS is not set
-# CONFIG_USB_RTL8150 is not set
-# CONFIG_USB_USBNET_MII is not set
-# CONFIG_USB_USBNET is not set
 CONFIG_USB_MON=y
 
 #
@@ -708,6 +751,7 @@ CONFIG_USB_MON=y
 # CONFIG_USB_RIO500 is not set
 # CONFIG_USB_LEGOTOWER is not set
 # CONFIG_USB_LCD is not set
+# CONFIG_USB_BERRY_CHARGE is not set
 # CONFIG_USB_LED is not set
 # CONFIG_USB_CYPRESS_CY7C63 is not set
 # CONFIG_USB_CYTHERM is not set
@@ -717,6 +761,7 @@ CONFIG_USB_MON=y
 # CONFIG_USB_APPLEDISPLAY is not set
 # CONFIG_USB_LD is not set
 # CONFIG_USB_TRANCEVIBRATOR is not set
+# CONFIG_USB_IOWARRIOR is not set
 # CONFIG_USB_TEST is not set
 
 #
@@ -727,13 +772,19 @@ CONFIG_USB_MON=y
 # USB Gadget Support
 #
 CONFIG_USB_GADGET=y
+# CONFIG_USB_GADGET_DEBUG is not set
 # CONFIG_USB_GADGET_DEBUG_FILES is not set
 CONFIG_USB_GADGET_SELECTED=y
+# CONFIG_USB_GADGET_AMD5536UDC is not set
+# CONFIG_USB_GADGET_ATMEL_USBA is not set
+# CONFIG_USB_GADGET_FSL_USB2 is not set
 # CONFIG_USB_GADGET_NET2280 is not set
 # CONFIG_USB_GADGET_PXA2XX is not set
+# CONFIG_USB_GADGET_M66592 is not set
 # CONFIG_USB_GADGET_GOKU is not set
 # CONFIG_USB_GADGET_LH7A40X is not set
 # CONFIG_USB_GADGET_OMAP is not set
+# CONFIG_USB_GADGET_S3C2410 is not set
 CONFIG_USB_GADGET_AT91=y
 CONFIG_USB_AT91=y
 # CONFIG_USB_GADGET_DUMMY_HCD is not set
@@ -745,17 +796,56 @@ CONFIG_USB_FILE_STORAGE=m
 # CONFIG_USB_FILE_STORAGE_TEST is not set
 CONFIG_USB_G_SERIAL=m
 # CONFIG_USB_MIDI_GADGET is not set
+# CONFIG_MMC is not set
+# CONFIG_NEW_LEDS is not set
+CONFIG_RTC_LIB=y
+CONFIG_RTC_CLASS=y
+CONFIG_RTC_HCTOSYS=y
+CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
+# CONFIG_RTC_DEBUG is not set
 
 #
-# MMC/SD Card support
+# RTC interfaces
 #
-# CONFIG_MMC is not set
+CONFIG_RTC_INTF_SYSFS=y
+CONFIG_RTC_INTF_PROC=y
+CONFIG_RTC_INTF_DEV=y
+# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
+# CONFIG_RTC_DRV_TEST is not set
 
 #
-# Real Time Clock
+# I2C RTC drivers
+#
+# CONFIG_RTC_DRV_DS1307 is not set
+# CONFIG_RTC_DRV_DS1374 is not set
+# CONFIG_RTC_DRV_DS1672 is not set
+# CONFIG_RTC_DRV_MAX6900 is not set
+# CONFIG_RTC_DRV_RS5C372 is not set
+# CONFIG_RTC_DRV_ISL1208 is not set
+# CONFIG_RTC_DRV_X1205 is not set
+# CONFIG_RTC_DRV_PCF8563 is not set
+# CONFIG_RTC_DRV_PCF8583 is not set
+# CONFIG_RTC_DRV_M41T80 is not set
+
+#
+# SPI RTC drivers
 #
-CONFIG_RTC_LIB=y
-# CONFIG_RTC_CLASS is not set
+
+#
+# Platform RTC drivers
+#
+# CONFIG_RTC_DRV_CMOS is not set
+# CONFIG_RTC_DRV_DS1553 is not set
+# CONFIG_RTC_DRV_STK17TA8 is not set
+# CONFIG_RTC_DRV_DS1742 is not set
+# CONFIG_RTC_DRV_M48T86 is not set
+# CONFIG_RTC_DRV_M48T59 is not set
+# CONFIG_RTC_DRV_V3020 is not set
+
+#
+# on-CPU RTC drivers
+#
+CONFIG_RTC_DRV_AT91SAM9=y
 
 #
 # File systems
@@ -806,7 +896,6 @@ CONFIG_SYSFS=y
 CONFIG_TMPFS=y
 # CONFIG_TMPFS_POSIX_ACL is not set
 # CONFIG_HUGETLB_PAGE is not set
-CONFIG_RAMFS=y
 # CONFIG_CONFIGFS_FS is not set
 
 #
@@ -825,10 +914,7 @@ CONFIG_CRAMFS=y
 # CONFIG_QNX4FS_FS is not set
 # CONFIG_SYSV_FS is not set
 # CONFIG_UFS_FS is not set
-
-#
-# Network File Systems
-#
+CONFIG_NETWORK_FILESYSTEMS=y
 # CONFIG_NFS_FS is not set
 # CONFIG_NFSD is not set
 # CONFIG_SMB_FS is not set
@@ -836,17 +922,12 @@ CONFIG_CRAMFS=y
 # CONFIG_NCP_FS is not set
 # CONFIG_CODA_FS is not set
 # CONFIG_AFS_FS is not set
-# CONFIG_9P_FS is not set
 
 #
 # Partition Types
 #
 # CONFIG_PARTITION_ADVANCED is not set
 CONFIG_MSDOS_PARTITION=y
-
-#
-# Native Language Support
-#
 CONFIG_NLS=y
 CONFIG_NLS_DEFAULT="iso8859-1"
 CONFIG_NLS_CODEPAGE_437=y
@@ -887,41 +968,49 @@ CONFIG_NLS_ISO8859_1=y
 # CONFIG_NLS_KOI8_R is not set
 # CONFIG_NLS_KOI8_U is not set
 # CONFIG_NLS_UTF8 is not set
-
-#
-# Profiling support
-#
+# CONFIG_DLM is not set
+CONFIG_INSTRUMENTATION=y
 # CONFIG_PROFILING is not set
+# CONFIG_MARKERS is not set
 
 #
 # Kernel hacking
 #
 # CONFIG_PRINTK_TIME is not set
+CONFIG_ENABLE_WARN_DEPRECATED=y
 CONFIG_ENABLE_MUST_CHECK=y
 # CONFIG_MAGIC_SYSRQ is not set
 # CONFIG_UNUSED_SYMBOLS is not set
+# CONFIG_DEBUG_FS is not set
+# CONFIG_HEADERS_CHECK is not set
 CONFIG_DEBUG_KERNEL=y
-CONFIG_LOG_BUF_SHIFT=14
+# CONFIG_DEBUG_SHIRQ is not set
 CONFIG_DETECT_SOFTLOCKUP=y
+CONFIG_SCHED_DEBUG=y
 # CONFIG_SCHEDSTATS is not set
+# CONFIG_TIMER_STATS is not set
 # CONFIG_DEBUG_SLAB is not set
 # CONFIG_DEBUG_RT_MUTEXES is not set
 # CONFIG_RT_MUTEX_TESTER is not set
 # CONFIG_DEBUG_SPINLOCK is not set
 # CONFIG_DEBUG_MUTEXES is not set
-# CONFIG_DEBUG_RWSEMS is not set
+# CONFIG_DEBUG_LOCK_ALLOC is not set
+# CONFIG_PROVE_LOCKING is not set
+# CONFIG_LOCK_STAT is not set
 # CONFIG_DEBUG_SPINLOCK_SLEEP is not set
 # CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
 # CONFIG_DEBUG_KOBJECT is not set
 CONFIG_DEBUG_BUGVERBOSE=y
 # CONFIG_DEBUG_INFO is not set
-# CONFIG_DEBUG_FS is not set
 # CONFIG_DEBUG_VM is not set
 # CONFIG_DEBUG_LIST is not set
+# CONFIG_DEBUG_SG is not set
 CONFIG_FRAME_POINTER=y
 CONFIG_FORCED_INLINING=y
-# CONFIG_HEADERS_CHECK is not set
+# CONFIG_BOOT_PRINTK_DELAY is not set
 # CONFIG_RCU_TORTURE_TEST is not set
+# CONFIG_FAULT_INJECTION is not set
+# CONFIG_SAMPLES is not set
 CONFIG_DEBUG_USER=y
 # CONFIG_DEBUG_ERRORS is not set
 CONFIG_DEBUG_LL=y
@@ -932,18 +1021,21 @@ CONFIG_DEBUG_LL=y
 #
 # CONFIG_KEYS is not set
 # CONFIG_SECURITY is not set
-
-#
-# Cryptographic options
-#
+# CONFIG_SECURITY_FILE_CAPABILITIES is not set
 # CONFIG_CRYPTO is not set
 
 #
 # Library routines
 #
+CONFIG_BITREVERSE=y
 # CONFIG_CRC_CCITT is not set
 # CONFIG_CRC16 is not set
+# CONFIG_CRC_ITU_T is not set
 CONFIG_CRC32=y
+# CONFIG_CRC7 is not set
 # CONFIG_LIBCRC32C is not set
 CONFIG_ZLIB_INFLATE=y
 CONFIG_PLIST=y
+CONFIG_HAS_IOMEM=y
+CONFIG_HAS_IOPORT=y
+CONFIG_HAS_DMA=y
index fcd8fa091e9d3eaaea702e58513bb617714705a3..3802e85f7483c65af9e5256debe4a2879749aea4 100644 (file)
@@ -1,43 +1,56 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.19-rc6
-# Fri Nov 17 18:00:38 2006
+# Linux kernel version: 2.6.24-rc7
+# Tue Jan  8 22:21:49 2008
 #
 CONFIG_ARM=y
+CONFIG_SYS_SUPPORTS_APM_EMULATION=y
+CONFIG_GENERIC_GPIO=y
 # CONFIG_GENERIC_TIME is not set
+# CONFIG_GENERIC_CLOCKEVENTS is not set
 CONFIG_MMU=y
+# CONFIG_NO_IOPORT is not set
 CONFIG_GENERIC_HARDIRQS=y
+CONFIG_STACKTRACE_SUPPORT=y
+CONFIG_LOCKDEP_SUPPORT=y
 CONFIG_TRACE_IRQFLAGS_SUPPORT=y
 CONFIG_HARDIRQS_SW_RESEND=y
 CONFIG_GENERIC_IRQ_PROBE=y
 CONFIG_RWSEM_GENERIC_SPINLOCK=y
+# CONFIG_ARCH_HAS_ILOG2_U32 is not set
+# CONFIG_ARCH_HAS_ILOG2_U64 is not set
 CONFIG_GENERIC_HWEIGHT=y
 CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_ZONE_DMA=y
 CONFIG_VECTORS_BASE=0xffff0000
 CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
 
 #
-# Code maturity level options
+# General setup
 #
 CONFIG_EXPERIMENTAL=y
 CONFIG_BROKEN_ON_SMP=y
 CONFIG_INIT_ENV_ARG_LIMIT=32
-
-#
-# General setup
-#
 CONFIG_LOCALVERSION=""
 # CONFIG_LOCALVERSION_AUTO is not set
 # CONFIG_SWAP is not set
 CONFIG_SYSVIPC=y
-# CONFIG_IPC_NS is not set
+CONFIG_SYSVIPC_SYSCTL=y
 # CONFIG_POSIX_MQUEUE is not set
 # CONFIG_BSD_PROCESS_ACCT is not set
 # CONFIG_TASKSTATS is not set
-# CONFIG_UTS_NS is not set
+# CONFIG_USER_NS is not set
+# CONFIG_PID_NS is not set
 # CONFIG_AUDIT is not set
 # CONFIG_IKCONFIG is not set
+CONFIG_LOG_BUF_SHIFT=14
+# CONFIG_CGROUPS is not set
+CONFIG_FAIR_GROUP_SCHED=y
+CONFIG_FAIR_USER_SCHED=y
+# CONFIG_FAIR_CGROUP_SCHED is not set
+CONFIG_SYSFS_DEPRECATED=y
 # CONFIG_RELAY is not set
+CONFIG_BLK_DEV_INITRD=y
 CONFIG_INITRAMFS_SOURCE=""
 CONFIG_CC_OPTIMIZE_FOR_SIZE=y
 CONFIG_SYSCTL=y
@@ -53,30 +66,30 @@ CONFIG_BUG=y
 CONFIG_ELF_CORE=y
 CONFIG_BASE_FULL=y
 CONFIG_FUTEX=y
+CONFIG_ANON_INODES=y
 CONFIG_EPOLL=y
+CONFIG_SIGNALFD=y
+CONFIG_EVENTFD=y
 CONFIG_SHMEM=y
-CONFIG_SLAB=y
 CONFIG_VM_EVENT_COUNTERS=y
+CONFIG_SLAB=y
+# CONFIG_SLUB is not set
+# CONFIG_SLOB is not set
+CONFIG_SLABINFO=y
 CONFIG_RT_MUTEXES=y
 # CONFIG_TINY_SHMEM is not set
 CONFIG_BASE_SMALL=0
-# CONFIG_SLOB is not set
-
-#
-# Loadable module support
-#
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
 # CONFIG_MODULE_FORCE_UNLOAD is not set
 # CONFIG_MODVERSIONS is not set
 # CONFIG_MODULE_SRCVERSION_ALL is not set
 CONFIG_KMOD=y
-
-#
-# Block layer
-#
 CONFIG_BLOCK=y
+# CONFIG_LBD is not set
 # CONFIG_BLK_DEV_IO_TRACE is not set
+# CONFIG_LSF is not set
+# CONFIG_BLK_DEV_BSG is not set
 
 #
 # IO Schedulers
@@ -108,12 +121,16 @@ CONFIG_ARCH_AT91=y
 # CONFIG_ARCH_NETX is not set
 # CONFIG_ARCH_H720X is not set
 # CONFIG_ARCH_IMX is not set
+# CONFIG_ARCH_IOP13XX is not set
 # CONFIG_ARCH_IOP32X is not set
 # CONFIG_ARCH_IOP33X is not set
-# CONFIG_ARCH_IXP4XX is not set
-# CONFIG_ARCH_IXP2000 is not set
 # CONFIG_ARCH_IXP23XX is not set
+# CONFIG_ARCH_IXP2000 is not set
+# CONFIG_ARCH_IXP4XX is not set
 # CONFIG_ARCH_L7200 is not set
+# CONFIG_ARCH_KS8695 is not set
+# CONFIG_ARCH_NS9XXX is not set
+# CONFIG_ARCH_MXC is not set
 # CONFIG_ARCH_PNX4008 is not set
 # CONFIG_ARCH_PXA is not set
 # CONFIG_ARCH_RPC is not set
@@ -121,14 +138,27 @@ CONFIG_ARCH_AT91=y
 # CONFIG_ARCH_S3C2410 is not set
 # CONFIG_ARCH_SHARK is not set
 # CONFIG_ARCH_LH7A40X is not set
+# CONFIG_ARCH_DAVINCI is not set
 # CONFIG_ARCH_OMAP is not set
 
+#
+# Boot options
+#
+
+#
+# Power management
+#
+
 #
 # Atmel AT91 System-on-Chip
 #
 # CONFIG_ARCH_AT91RM9200 is not set
 # CONFIG_ARCH_AT91SAM9260 is not set
 CONFIG_ARCH_AT91SAM9261=y
+# CONFIG_ARCH_AT91SAM9263 is not set
+# CONFIG_ARCH_AT91SAM9RL is not set
+# CONFIG_ARCH_AT91X40 is not set
+CONFIG_AT91_PMC_UNIT=y
 
 #
 # AT91SAM9261 Board Type
@@ -138,12 +168,15 @@ CONFIG_MACH_AT91SAM9261EK=y
 #
 # AT91 Board Options
 #
+# CONFIG_MTD_AT91_DATAFLASH_CARD is not set
 # CONFIG_MTD_NAND_AT91_BUSWIDTH_16 is not set
 
 #
 # AT91 Feature Selections
 #
-# CONFIG_AT91_PROGRAMMABLE_CLOCKS is not set
+CONFIG_AT91_PROGRAMMABLE_CLOCKS=y
+# CONFIG_ATMEL_TCLIB is not set
+CONFIG_AT91_TIMER_HZ=100
 
 #
 # Processor Type
@@ -166,19 +199,19 @@ CONFIG_CPU_CP15_MMU=y
 # CONFIG_CPU_DCACHE_DISABLE is not set
 # CONFIG_CPU_DCACHE_WRITETHROUGH is not set
 # CONFIG_CPU_CACHE_ROUND_ROBIN is not set
+# CONFIG_OUTER_CACHE is not set
 
 #
 # Bus support
 #
-
-#
-# PCCARD (PCMCIA/CardBus) support
-#
+# CONFIG_PCI_SYSCALL is not set
+# CONFIG_ARCH_SUPPORTS_MSI is not set
 # CONFIG_PCCARD is not set
 
 #
 # Kernel Features
 #
+# CONFIG_TICK_ONESHOT is not set
 # CONFIG_PREEMPT is not set
 # CONFIG_NO_IDLE_HZ is not set
 CONFIG_HZ=100
@@ -191,8 +224,12 @@ CONFIG_FLATMEM_MANUAL=y
 CONFIG_FLATMEM=y
 CONFIG_FLAT_NODE_MEM_MAP=y
 # CONFIG_SPARSEMEM_STATIC is not set
+# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
 CONFIG_SPLIT_PTLOCK_CPUS=4096
 # CONFIG_RESOURCES_64BIT is not set
+CONFIG_ZONE_DMA_FLAG=1
+CONFIG_BOUNCE=y
+CONFIG_VIRT_TO_BUS=y
 # CONFIG_LEDS is not set
 CONFIG_ALIGNMENT_TRAP=y
 
@@ -203,6 +240,7 @@ CONFIG_ZBOOT_ROM_TEXT=0x0
 CONFIG_ZBOOT_ROM_BSS=0x0
 CONFIG_CMDLINE="mem=64M console=ttyS0,115200 initrd=0x21100000,3145728 root=/dev/ram0 rw"
 # CONFIG_XIP_KERNEL is not set
+# CONFIG_KEXEC is not set
 
 #
 # Floating point emulation
@@ -228,7 +266,7 @@ CONFIG_BINFMT_ELF=y
 # Power management options
 #
 # CONFIG_PM is not set
-# CONFIG_APM is not set
+CONFIG_SUSPEND_UP_POSSIBLE=y
 
 #
 # Networking
@@ -238,13 +276,13 @@ CONFIG_NET=y
 #
 # Networking options
 #
-# CONFIG_NETDEBUG is not set
 CONFIG_PACKET=y
 # CONFIG_PACKET_MMAP is not set
 CONFIG_UNIX=y
 CONFIG_XFRM=y
 # CONFIG_XFRM_USER is not set
 # CONFIG_XFRM_SUB_POLICY is not set
+# CONFIG_XFRM_MIGRATE is not set
 # CONFIG_NET_KEY is not set
 CONFIG_INET=y
 # CONFIG_IP_MULTICAST is not set
@@ -266,30 +304,20 @@ CONFIG_IP_PNP_BOOTP=y
 CONFIG_INET_XFRM_MODE_TRANSPORT=y
 CONFIG_INET_XFRM_MODE_TUNNEL=y
 CONFIG_INET_XFRM_MODE_BEET=y
+# CONFIG_INET_LRO is not set
 CONFIG_INET_DIAG=y
 CONFIG_INET_TCP_DIAG=y
 # CONFIG_TCP_CONG_ADVANCED is not set
 CONFIG_TCP_CONG_CUBIC=y
 CONFIG_DEFAULT_TCP_CONG="cubic"
+# CONFIG_TCP_MD5SIG is not set
 # CONFIG_IPV6 is not set
 # CONFIG_INET6_XFRM_TUNNEL is not set
 # CONFIG_INET6_TUNNEL is not set
 # CONFIG_NETWORK_SECMARK is not set
 # CONFIG_NETFILTER is not set
-
-#
-# DCCP Configuration (EXPERIMENTAL)
-#
 # CONFIG_IP_DCCP is not set
-
-#
-# SCTP Configuration (EXPERIMENTAL)
-#
 # CONFIG_IP_SCTP is not set
-
-#
-# TIPC Configuration (EXPERIMENTAL)
-#
 # CONFIG_TIPC is not set
 # CONFIG_ATM is not set
 # CONFIG_BRIDGE is not set
@@ -302,10 +330,6 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
 # CONFIG_LAPB is not set
 # CONFIG_ECONET is not set
 # CONFIG_WAN_ROUTER is not set
-
-#
-# QoS and/or fair queueing
-#
 # CONFIG_NET_SCHED is not set
 
 #
@@ -315,7 +339,17 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
 # CONFIG_HAMRADIO is not set
 # CONFIG_IRDA is not set
 # CONFIG_BT is not set
+# CONFIG_AF_RXRPC is not set
+
+#
+# Wireless
+#
+# CONFIG_CFG80211 is not set
+# CONFIG_WIRELESS_EXT is not set
+# CONFIG_MAC80211 is not set
 # CONFIG_IEEE80211 is not set
+# CONFIG_RFKILL is not set
+# CONFIG_NET_9P is not set
 
 #
 # Device Drivers
@@ -324,20 +358,14 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
 #
 # Generic Driver Options
 #
+CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
 CONFIG_STANDALONE=y
 CONFIG_PREVENT_FIRMWARE_BUILD=y
 # CONFIG_FW_LOADER is not set
 # CONFIG_DEBUG_DRIVER is not set
+# CONFIG_DEBUG_DEVRES is not set
 # CONFIG_SYS_HYPERVISOR is not set
-
-#
-# Connector - unified userspace <-> kernelspace linker
-#
 # CONFIG_CONNECTOR is not set
-
-#
-# Memory Technology Devices (MTD)
-#
 CONFIG_MTD=y
 # CONFIG_MTD_DEBUG is not set
 # CONFIG_MTD_CONCAT is not set
@@ -350,12 +378,14 @@ CONFIG_MTD_CMDLINE_PARTS=y
 # User Modules And Translation Layers
 #
 # CONFIG_MTD_CHAR is not set
+CONFIG_MTD_BLKDEVS=y
 CONFIG_MTD_BLOCK=y
 # CONFIG_FTL is not set
 # CONFIG_NFTL is not set
 # CONFIG_INFTL is not set
 # CONFIG_RFD_FTL is not set
 # CONFIG_SSFDC is not set
+# CONFIG_MTD_OOPS is not set
 
 #
 # RAM/ROM/Flash chip drivers
@@ -375,7 +405,6 @@ CONFIG_MTD_CFI_I2=y
 # CONFIG_MTD_RAM is not set
 # CONFIG_MTD_ROM is not set
 # CONFIG_MTD_ABSENT is not set
-# CONFIG_MTD_OBSOLETE_CHIPS is not set
 
 #
 # Mapping drivers for chip access
@@ -386,6 +415,8 @@ CONFIG_MTD_CFI_I2=y
 #
 # Self-contained MTD device drivers
 #
+# CONFIG_MTD_DATAFLASH is not set
+# CONFIG_MTD_M25P80 is not set
 # CONFIG_MTD_SLRAM is not set
 # CONFIG_MTD_PHRAM is not set
 # CONFIG_MTD_MTDRAM is not set
@@ -397,35 +428,24 @@ CONFIG_MTD_CFI_I2=y
 # CONFIG_MTD_DOC2000 is not set
 # CONFIG_MTD_DOC2001 is not set
 # CONFIG_MTD_DOC2001PLUS is not set
-
-#
-# NAND Flash Device Drivers
-#
 CONFIG_MTD_NAND=y
 # CONFIG_MTD_NAND_VERIFY_WRITE is not set
 # CONFIG_MTD_NAND_ECC_SMC is not set
+# CONFIG_MTD_NAND_MUSEUM_IDS is not set
 CONFIG_MTD_NAND_IDS=y
 # CONFIG_MTD_NAND_DISKONCHIP is not set
 CONFIG_MTD_NAND_AT91=y
 # CONFIG_MTD_NAND_NANDSIM is not set
-
-#
-# OneNAND Flash Device Drivers
-#
+# CONFIG_MTD_NAND_PLATFORM is not set
+# CONFIG_MTD_ALAUDA is not set
 # CONFIG_MTD_ONENAND is not set
 
 #
-# Parallel port support
+# UBI - Unsorted block images
 #
+# CONFIG_MTD_UBI is not set
 # CONFIG_PARPORT is not set
-
-#
-# Plug and Play support
-#
-
-#
-# Block devices
-#
+CONFIG_BLK_DEV=y
 # CONFIG_BLK_DEV_COW_COMMON is not set
 # CONFIG_BLK_DEV_LOOP is not set
 # CONFIG_BLK_DEV_NBD is not set
@@ -434,15 +454,19 @@ CONFIG_BLK_DEV_RAM=y
 CONFIG_BLK_DEV_RAM_COUNT=16
 CONFIG_BLK_DEV_RAM_SIZE=8192
 CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
-CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CDROM_PKTCDVD is not set
 # CONFIG_ATA_OVER_ETH is not set
+CONFIG_MISC_DEVICES=y
+# CONFIG_EEPROM_93CX6 is not set
+CONFIG_ATMEL_SSC=y
 
 #
 # SCSI device support
 #
 # CONFIG_RAID_ATTRS is not set
 CONFIG_SCSI=y
+CONFIG_SCSI_DMA=y
+# CONFIG_SCSI_TGT is not set
 # CONFIG_SCSI_NETLINK is not set
 CONFIG_SCSI_PROC_FS=y
 
@@ -462,6 +486,8 @@ CONFIG_BLK_DEV_SD=y
 CONFIG_SCSI_MULTI_LUN=y
 # CONFIG_SCSI_CONSTANTS is not set
 # CONFIG_SCSI_LOGGING is not set
+# CONFIG_SCSI_SCAN_ASYNC is not set
+CONFIG_SCSI_WAIT_SCAN=m
 
 #
 # SCSI Transports
@@ -469,75 +495,49 @@ CONFIG_SCSI_MULTI_LUN=y
 # CONFIG_SCSI_SPI_ATTRS is not set
 # CONFIG_SCSI_FC_ATTRS is not set
 # CONFIG_SCSI_ISCSI_ATTRS is not set
-# CONFIG_SCSI_SAS_ATTRS is not set
 # CONFIG_SCSI_SAS_LIBSAS is not set
-
-#
-# SCSI low-level drivers
-#
+# CONFIG_SCSI_SRP_ATTRS is not set
+CONFIG_SCSI_LOWLEVEL=y
 # CONFIG_ISCSI_TCP is not set
 # CONFIG_SCSI_DEBUG is not set
-
-#
-# Multi-device support (RAID and LVM)
-#
+# CONFIG_ATA is not set
 # CONFIG_MD is not set
-
-#
-# Fusion MPT device support
-#
-# CONFIG_FUSION is not set
-
-#
-# IEEE 1394 (FireWire) support
-#
-
-#
-# I2O device support
-#
-
-#
-# Network device support
-#
 CONFIG_NETDEVICES=y
+# CONFIG_NETDEVICES_MULTIQUEUE is not set
 # CONFIG_DUMMY is not set
 # CONFIG_BONDING is not set
+# CONFIG_MACVLAN is not set
 # CONFIG_EQUALIZER is not set
 # CONFIG_TUN is not set
-
-#
-# PHY device support
-#
+# CONFIG_VETH is not set
 # CONFIG_PHYLIB is not set
-
-#
-# Ethernet (10 or 100Mbit)
-#
 CONFIG_NET_ETHERNET=y
 CONFIG_MII=y
+# CONFIG_AX88796 is not set
 # CONFIG_SMC91X is not set
 CONFIG_DM9000=y
+# CONFIG_IBM_NEW_EMAC_ZMII is not set
+# CONFIG_IBM_NEW_EMAC_RGMII is not set
+# CONFIG_IBM_NEW_EMAC_TAH is not set
+# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
+# CONFIG_B44 is not set
+# CONFIG_NETDEV_1000 is not set
+# CONFIG_NETDEV_10000 is not set
 
 #
-# Ethernet (1000 Mbit)
-#
-
-#
-# Ethernet (10000 Mbit)
-#
-
-#
-# Token Ring devices
+# Wireless LAN
 #
+# CONFIG_WLAN_PRE80211 is not set
+# CONFIG_WLAN_80211 is not set
 
 #
-# Wireless LAN (non-hamradio)
-#
-# CONFIG_NET_RADIO is not set
-
-#
-# Wan interfaces
+# USB Network Adapters
 #
+# CONFIG_USB_CATC is not set
+# CONFIG_USB_KAWETH is not set
+# CONFIG_USB_PEGASUS is not set
+# CONFIG_USB_RTL8150 is not set
+# CONFIG_USB_USBNET is not set
 # CONFIG_WAN is not set
 # CONFIG_PPP is not set
 # CONFIG_SLIP is not set
@@ -545,10 +545,6 @@ CONFIG_DM9000=y
 # CONFIG_NETCONSOLE is not set
 # CONFIG_NETPOLL is not set
 # CONFIG_NET_POLL_CONTROLLER is not set
-
-#
-# ISDN subsystem
-#
 # CONFIG_ISDN is not set
 
 #
@@ -556,6 +552,7 @@ CONFIG_DM9000=y
 #
 CONFIG_INPUT=y
 # CONFIG_INPUT_FF_MEMLESS is not set
+# CONFIG_INPUT_POLLDEV is not set
 
 #
 # Userland interfaces
@@ -565,23 +562,43 @@ CONFIG_INPUT_MOUSEDEV=y
 CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
 CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
 # CONFIG_INPUT_JOYDEV is not set
-# CONFIG_INPUT_TSDEV is not set
 # CONFIG_INPUT_EVDEV is not set
 # CONFIG_INPUT_EVBUG is not set
 
 #
 # Input Device Drivers
 #
-# CONFIG_INPUT_KEYBOARD is not set
+CONFIG_INPUT_KEYBOARD=y
+# CONFIG_KEYBOARD_ATKBD is not set
+# CONFIG_KEYBOARD_SUNKBD is not set
+# CONFIG_KEYBOARD_LKKBD is not set
+# CONFIG_KEYBOARD_XTKBD is not set
+# CONFIG_KEYBOARD_NEWTON is not set
+# CONFIG_KEYBOARD_STOWAWAY is not set
+CONFIG_KEYBOARD_GPIO=y
 # CONFIG_INPUT_MOUSE is not set
 # CONFIG_INPUT_JOYSTICK is not set
-# CONFIG_INPUT_TOUCHSCREEN is not set
+# CONFIG_INPUT_TABLET is not set
+CONFIG_INPUT_TOUCHSCREEN=y
+CONFIG_TOUCHSCREEN_ADS7846=y
+# CONFIG_TOUCHSCREEN_FUJITSU is not set
+# CONFIG_TOUCHSCREEN_GUNZE is not set
+# CONFIG_TOUCHSCREEN_ELO is not set
+# CONFIG_TOUCHSCREEN_MTOUCH is not set
+# CONFIG_TOUCHSCREEN_MK712 is not set
+# CONFIG_TOUCHSCREEN_PENMOUNT is not set
+# CONFIG_TOUCHSCREEN_TOUCHRIGHT is not set
+# CONFIG_TOUCHSCREEN_TOUCHWIN is not set
+# CONFIG_TOUCHSCREEN_UCB1400 is not set
+# CONFIG_TOUCHSCREEN_USB_COMPOSITE is not set
 # CONFIG_INPUT_MISC is not set
 
 #
 # Hardware I/O ports
 #
-# CONFIG_SERIO is not set
+CONFIG_SERIO=y
+CONFIG_SERIO_SERPORT=y
+# CONFIG_SERIO_RAW is not set
 # CONFIG_GAMEPORT is not set
 
 #
@@ -609,75 +626,47 @@ CONFIG_SERIAL_CORE_CONSOLE=y
 CONFIG_UNIX98_PTYS=y
 CONFIG_LEGACY_PTYS=y
 CONFIG_LEGACY_PTY_COUNT=256
-
-#
-# IPMI
-#
 # CONFIG_IPMI_HANDLER is not set
-
-#
-# Watchdog Cards
-#
-CONFIG_WATCHDOG=y
-CONFIG_WATCHDOG_NOWAYOUT=y
-
-#
-# Watchdog Device Drivers
-#
-# CONFIG_SOFT_WATCHDOG is not set
-
-#
-# USB-based Watchdog Cards
-#
-# CONFIG_USBPCWATCHDOG is not set
 CONFIG_HW_RANDOM=y
 # CONFIG_NVRAM is not set
-# CONFIG_DTLK is not set
 # CONFIG_R3964 is not set
-
-#
-# Ftape, the floppy tape device driver
-#
 # CONFIG_RAW_DRIVER is not set
-
-#
-# TPM devices
-#
 # CONFIG_TCG_TPM is not set
-
-#
-# I2C support
-#
 CONFIG_I2C=y
+CONFIG_I2C_BOARDINFO=y
 CONFIG_I2C_CHARDEV=y
 
 #
 # I2C Algorithms
 #
-# CONFIG_I2C_ALGOBIT is not set
+CONFIG_I2C_ALGOBIT=y
 # CONFIG_I2C_ALGOPCF is not set
 # CONFIG_I2C_ALGOPCA is not set
 
 #
 # I2C Hardware Bus support
 #
-CONFIG_I2C_AT91=y
+CONFIG_I2C_GPIO=y
 # CONFIG_I2C_OCORES is not set
 # CONFIG_I2C_PARPORT_LIGHT is not set
+# CONFIG_I2C_SIMTEC is not set
+# CONFIG_I2C_TAOS_EVM is not set
 # CONFIG_I2C_STUB is not set
+# CONFIG_I2C_TINY_USB is not set
 # CONFIG_I2C_PCA is not set
-# CONFIG_I2C_PCA_ISA is not set
 
 #
 # Miscellaneous I2C Chip support
 #
 # CONFIG_SENSORS_DS1337 is not set
 # CONFIG_SENSORS_DS1374 is not set
+# CONFIG_DS1682 is not set
 # CONFIG_SENSORS_EEPROM is not set
 # CONFIG_SENSORS_PCF8574 is not set
 # CONFIG_SENSORS_PCA9539 is not set
 # CONFIG_SENSORS_PCF8591 is not set
 # CONFIG_SENSORS_MAX6875 is not set
+# CONFIG_SENSORS_TSL2550 is not set
 # CONFIG_I2C_DEBUG_CORE is not set
 # CONFIG_I2C_DEBUG_ALGO is not set
 # CONFIG_I2C_DEBUG_BUS is not set
@@ -686,70 +675,125 @@ CONFIG_I2C_AT91=y
 #
 # SPI support
 #
-# CONFIG_SPI is not set
-# CONFIG_SPI_MASTER is not set
+CONFIG_SPI=y
+# CONFIG_SPI_DEBUG is not set
+CONFIG_SPI_MASTER=y
 
 #
-# Dallas's 1-wire bus
+# SPI Master Controller Drivers
 #
-# CONFIG_W1 is not set
+CONFIG_SPI_ATMEL=y
+# CONFIG_SPI_BITBANG is not set
 
 #
-# Hardware Monitoring support
+# SPI Protocol Masters
 #
+# CONFIG_SPI_AT25 is not set
+# CONFIG_SPI_SPIDEV is not set
+# CONFIG_SPI_TLE62X0 is not set
+# CONFIG_W1 is not set
+# CONFIG_POWER_SUPPLY is not set
 # CONFIG_HWMON is not set
-# CONFIG_HWMON_VID is not set
+CONFIG_WATCHDOG=y
+CONFIG_WATCHDOG_NOWAYOUT=y
 
 #
-# Misc devices
+# Watchdog Device Drivers
 #
-# CONFIG_TIFM_CORE is not set
+# CONFIG_SOFT_WATCHDOG is not set
+CONFIG_AT91SAM9_WATCHDOG=y
 
 #
-# LED devices
+# USB-based Watchdog Cards
 #
-# CONFIG_NEW_LEDS is not set
+# CONFIG_USBPCWATCHDOG is not set
 
 #
-# LED drivers
+# Sonics Silicon Backplane
 #
+CONFIG_SSB_POSSIBLE=y
+# CONFIG_SSB is not set
 
 #
-# LED Triggers
+# Multifunction device drivers
 #
+# CONFIG_MFD_SM501 is not set
 
 #
 # Multimedia devices
 #
 # CONFIG_VIDEO_DEV is not set
-
-#
-# Digital Video Broadcasting Devices
-#
-# CONFIG_DVB is not set
+# CONFIG_DVB_CORE is not set
+CONFIG_DAB=y
 # CONFIG_USB_DABUSB is not set
 
 #
 # Graphics support
 #
+# CONFIG_VGASTATE is not set
+# CONFIG_VIDEO_OUTPUT_CONTROL is not set
+CONFIG_FB=y
 # CONFIG_FIRMWARE_EDID is not set
-# CONFIG_FB is not set
+# CONFIG_FB_DDC is not set
+CONFIG_FB_CFB_FILLRECT=y
+CONFIG_FB_CFB_COPYAREA=y
+CONFIG_FB_CFB_IMAGEBLIT=y
+# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
+# CONFIG_FB_SYS_FILLRECT is not set
+# CONFIG_FB_SYS_COPYAREA is not set
+# CONFIG_FB_SYS_IMAGEBLIT is not set
+# CONFIG_FB_SYS_FOPS is not set
+CONFIG_FB_DEFERRED_IO=y
+# CONFIG_FB_SVGALIB is not set
+# CONFIG_FB_MACMODES is not set
+# CONFIG_FB_BACKLIGHT is not set
+# CONFIG_FB_MODE_HELPERS is not set
+# CONFIG_FB_TILEBLITTING is not set
+
+#
+# Frame buffer hardware drivers
+#
+# CONFIG_FB_S1D15605 is not set
+# CONFIG_FB_S1D13XXX is not set
+CONFIG_FB_ATMEL=y
+# CONFIG_FB_INTSRAM is not set
+# CONFIG_FB_ATMEL_STN is not set
+# CONFIG_FB_VIRTUAL is not set
+# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
+
+#
+# Display device support
+#
+# CONFIG_DISPLAY_SUPPORT is not set
 
 #
 # Console display driver support
 #
 # CONFIG_VGA_CONSOLE is not set
 CONFIG_DUMMY_CONSOLE=y
-# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
+# CONFIG_FRAMEBUFFER_CONSOLE is not set
+# CONFIG_LOGO is not set
 
 #
 # Sound
 #
 # CONFIG_SOUND is not set
+CONFIG_HID_SUPPORT=y
+CONFIG_HID=y
+# CONFIG_HID_DEBUG is not set
+# CONFIG_HIDRAW is not set
 
 #
-# USB support
+# USB Input Devices
 #
+# CONFIG_USB_HID is not set
+
+#
+# USB HID Boot Protocol drivers
+#
+# CONFIG_USB_KBD is not set
+# CONFIG_USB_MOUSE is not set
+CONFIG_USB_SUPPORT=y
 CONFIG_USB_ARCH_HAS_HCD=y
 CONFIG_USB_ARCH_HAS_OHCI=y
 # CONFIG_USB_ARCH_HAS_EHCI is not set
@@ -760,7 +804,7 @@ CONFIG_USB=y
 # Miscellaneous USB options
 #
 CONFIG_USB_DEVICEFS=y
-# CONFIG_USB_BANDWIDTH is not set
+CONFIG_USB_DEVICE_CLASS=y
 # CONFIG_USB_DYNAMIC_MINORS is not set
 # CONFIG_USB_OTG is not set
 
@@ -769,9 +813,11 @@ CONFIG_USB_DEVICEFS=y
 #
 # CONFIG_USB_ISP116X_HCD is not set
 CONFIG_USB_OHCI_HCD=y
-# CONFIG_USB_OHCI_BIG_ENDIAN is not set
+# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set
+# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set
 CONFIG_USB_OHCI_LITTLE_ENDIAN=y
 # CONFIG_USB_SL811_HCD is not set
+# CONFIG_USB_R8A66597_HCD is not set
 
 #
 # USB Device Class drivers
@@ -790,6 +836,7 @@ CONFIG_USB_STORAGE=y
 CONFIG_USB_STORAGE_DEBUG=y
 # CONFIG_USB_STORAGE_DATAFAB is not set
 # CONFIG_USB_STORAGE_FREECOM is not set
+# CONFIG_USB_STORAGE_ISD200 is not set
 # CONFIG_USB_STORAGE_DPCM is not set
 # CONFIG_USB_STORAGE_USBAT is not set
 # CONFIG_USB_STORAGE_SDDR09 is not set
@@ -799,44 +846,11 @@ CONFIG_USB_STORAGE_DEBUG=y
 # CONFIG_USB_STORAGE_KARMA is not set
 # CONFIG_USB_LIBUSUAL is not set
 
-#
-# USB Input Devices
-#
-# CONFIG_USB_HID is not set
-
-#
-# USB HID Boot Protocol drivers
-#
-# CONFIG_USB_KBD is not set
-# CONFIG_USB_MOUSE is not set
-# CONFIG_USB_AIPTEK is not set
-# CONFIG_USB_WACOM is not set
-# CONFIG_USB_ACECAD is not set
-# CONFIG_USB_KBTAB is not set
-# CONFIG_USB_POWERMATE is not set
-# CONFIG_USB_TOUCHSCREEN is not set
-# CONFIG_USB_YEALINK is not set
-# CONFIG_USB_XPAD is not set
-# CONFIG_USB_ATI_REMOTE is not set
-# CONFIG_USB_ATI_REMOTE2 is not set
-# CONFIG_USB_KEYSPAN_REMOTE is not set
-# CONFIG_USB_APPLETOUCH is not set
-
 #
 # USB Imaging devices
 #
 # CONFIG_USB_MDC800 is not set
 # CONFIG_USB_MICROTEK is not set
-
-#
-# USB Network Adapters
-#
-# CONFIG_USB_CATC is not set
-# CONFIG_USB_KAWETH is not set
-# CONFIG_USB_PEGASUS is not set
-# CONFIG_USB_RTL8150 is not set
-# CONFIG_USB_USBNET_MII is not set
-# CONFIG_USB_USBNET is not set
 CONFIG_USB_MON=y
 
 #
@@ -858,6 +872,7 @@ CONFIG_USB_MON=y
 # CONFIG_USB_RIO500 is not set
 # CONFIG_USB_LEGOTOWER is not set
 # CONFIG_USB_LCD is not set
+# CONFIG_USB_BERRY_CHARGE is not set
 # CONFIG_USB_LED is not set
 # CONFIG_USB_CYPRESS_CY7C63 is not set
 # CONFIG_USB_CYTHERM is not set
@@ -867,6 +882,7 @@ CONFIG_USB_MON=y
 # CONFIG_USB_APPLEDISPLAY is not set
 # CONFIG_USB_LD is not set
 # CONFIG_USB_TRANCEVIBRATOR is not set
+# CONFIG_USB_IOWARRIOR is not set
 # CONFIG_USB_TEST is not set
 
 #
@@ -877,13 +893,19 @@ CONFIG_USB_MON=y
 # USB Gadget Support
 #
 CONFIG_USB_GADGET=y
+# CONFIG_USB_GADGET_DEBUG is not set
 # CONFIG_USB_GADGET_DEBUG_FILES is not set
 CONFIG_USB_GADGET_SELECTED=y
+# CONFIG_USB_GADGET_AMD5536UDC is not set
+# CONFIG_USB_GADGET_ATMEL_USBA is not set
+# CONFIG_USB_GADGET_FSL_USB2 is not set
 # CONFIG_USB_GADGET_NET2280 is not set
 # CONFIG_USB_GADGET_PXA2XX is not set
+# CONFIG_USB_GADGET_M66592 is not set
 # CONFIG_USB_GADGET_GOKU is not set
 # CONFIG_USB_GADGET_LH7A40X is not set
 # CONFIG_USB_GADGET_OMAP is not set
+# CONFIG_USB_GADGET_S3C2410 is not set
 CONFIG_USB_GADGET_AT91=y
 CONFIG_USB_AT91=y
 # CONFIG_USB_GADGET_DUMMY_HCD is not set
@@ -895,21 +917,73 @@ CONFIG_USB_FILE_STORAGE=m
 # CONFIG_USB_FILE_STORAGE_TEST is not set
 CONFIG_USB_G_SERIAL=m
 # CONFIG_USB_MIDI_GADGET is not set
+CONFIG_MMC=y
+# CONFIG_MMC_DEBUG is not set
+# CONFIG_MMC_UNSAFE_RESUME is not set
 
 #
-# MMC/SD Card support
+# MMC/SD Card Drivers
 #
-CONFIG_MMC=y
-# CONFIG_MMC_DEBUG is not set
 CONFIG_MMC_BLOCK=y
-CONFIG_MMC_AT91=m
-# CONFIG_MMC_TIFM_SD is not set
+CONFIG_MMC_BLOCK_BOUNCE=y
+# CONFIG_SDIO_UART is not set
 
 #
-# Real Time Clock
+# MMC/SD Host Controller Drivers
 #
+CONFIG_MMC_AT91=y
+# CONFIG_MMC_SPI is not set
+# CONFIG_NEW_LEDS is not set
 CONFIG_RTC_LIB=y
-# CONFIG_RTC_CLASS is not set
+CONFIG_RTC_CLASS=y
+CONFIG_RTC_HCTOSYS=y
+CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
+# CONFIG_RTC_DEBUG is not set
+
+#
+# RTC interfaces
+#
+CONFIG_RTC_INTF_SYSFS=y
+CONFIG_RTC_INTF_PROC=y
+CONFIG_RTC_INTF_DEV=y
+# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
+# CONFIG_RTC_DRV_TEST is not set
+
+#
+# I2C RTC drivers
+#
+# CONFIG_RTC_DRV_DS1307 is not set
+# CONFIG_RTC_DRV_DS1374 is not set
+# CONFIG_RTC_DRV_DS1672 is not set
+# CONFIG_RTC_DRV_MAX6900 is not set
+# CONFIG_RTC_DRV_RS5C372 is not set
+# CONFIG_RTC_DRV_ISL1208 is not set
+# CONFIG_RTC_DRV_X1205 is not set
+# CONFIG_RTC_DRV_PCF8563 is not set
+# CONFIG_RTC_DRV_PCF8583 is not set
+# CONFIG_RTC_DRV_M41T80 is not set
+
+#
+# SPI RTC drivers
+#
+# CONFIG_RTC_DRV_RS5C348 is not set
+# CONFIG_RTC_DRV_MAX6902 is not set
+
+#
+# Platform RTC drivers
+#
+# CONFIG_RTC_DRV_CMOS is not set
+# CONFIG_RTC_DRV_DS1553 is not set
+# CONFIG_RTC_DRV_STK17TA8 is not set
+# CONFIG_RTC_DRV_DS1742 is not set
+# CONFIG_RTC_DRV_M48T86 is not set
+# CONFIG_RTC_DRV_M48T59 is not set
+# CONFIG_RTC_DRV_V3020 is not set
+
+#
+# on-CPU RTC drivers
+#
+CONFIG_RTC_DRV_AT91SAM9=y
 
 #
 # File systems
@@ -960,7 +1034,6 @@ CONFIG_SYSFS=y
 CONFIG_TMPFS=y
 # CONFIG_TMPFS_POSIX_ACL is not set
 # CONFIG_HUGETLB_PAGE is not set
-CONFIG_RAMFS=y
 # CONFIG_CONFIGFS_FS is not set
 
 #
@@ -973,7 +1046,6 @@ CONFIG_RAMFS=y
 # CONFIG_BEFS_FS is not set
 # CONFIG_BFS_FS is not set
 # CONFIG_EFS_FS is not set
-# CONFIG_JFFS_FS is not set
 # CONFIG_JFFS2_FS is not set
 CONFIG_CRAMFS=y
 # CONFIG_VXFS_FS is not set
@@ -981,10 +1053,7 @@ CONFIG_CRAMFS=y
 # CONFIG_QNX4FS_FS is not set
 # CONFIG_SYSV_FS is not set
 # CONFIG_UFS_FS is not set
-
-#
-# Network File Systems
-#
+CONFIG_NETWORK_FILESYSTEMS=y
 # CONFIG_NFS_FS is not set
 # CONFIG_NFSD is not set
 # CONFIG_SMB_FS is not set
@@ -992,17 +1061,12 @@ CONFIG_CRAMFS=y
 # CONFIG_NCP_FS is not set
 # CONFIG_CODA_FS is not set
 # CONFIG_AFS_FS is not set
-# CONFIG_9P_FS is not set
 
 #
 # Partition Types
 #
 # CONFIG_PARTITION_ADVANCED is not set
 CONFIG_MSDOS_PARTITION=y
-
-#
-# Native Language Support
-#
 CONFIG_NLS=y
 CONFIG_NLS_DEFAULT="iso8859-1"
 CONFIG_NLS_CODEPAGE_437=y
@@ -1043,41 +1107,49 @@ CONFIG_NLS_ISO8859_1=y
 # CONFIG_NLS_KOI8_R is not set
 # CONFIG_NLS_KOI8_U is not set
 # CONFIG_NLS_UTF8 is not set
-
-#
-# Profiling support
-#
+# CONFIG_DLM is not set
+CONFIG_INSTRUMENTATION=y
 # CONFIG_PROFILING is not set
+# CONFIG_MARKERS is not set
 
 #
 # Kernel hacking
 #
 # CONFIG_PRINTK_TIME is not set
+CONFIG_ENABLE_WARN_DEPRECATED=y
 CONFIG_ENABLE_MUST_CHECK=y
 # CONFIG_MAGIC_SYSRQ is not set
 # CONFIG_UNUSED_SYMBOLS is not set
+# CONFIG_DEBUG_FS is not set
+# CONFIG_HEADERS_CHECK is not set
 CONFIG_DEBUG_KERNEL=y
-CONFIG_LOG_BUF_SHIFT=14
+# CONFIG_DEBUG_SHIRQ is not set
 CONFIG_DETECT_SOFTLOCKUP=y
+CONFIG_SCHED_DEBUG=y
 # CONFIG_SCHEDSTATS is not set
+# CONFIG_TIMER_STATS is not set
 # CONFIG_DEBUG_SLAB is not set
 # CONFIG_DEBUG_RT_MUTEXES is not set
 # CONFIG_RT_MUTEX_TESTER is not set
 # CONFIG_DEBUG_SPINLOCK is not set
 # CONFIG_DEBUG_MUTEXES is not set
-# CONFIG_DEBUG_RWSEMS is not set
+# CONFIG_DEBUG_LOCK_ALLOC is not set
+# CONFIG_PROVE_LOCKING is not set
+# CONFIG_LOCK_STAT is not set
 # CONFIG_DEBUG_SPINLOCK_SLEEP is not set
 # CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
 # CONFIG_DEBUG_KOBJECT is not set
 CONFIG_DEBUG_BUGVERBOSE=y
 # CONFIG_DEBUG_INFO is not set
-# CONFIG_DEBUG_FS is not set
 # CONFIG_DEBUG_VM is not set
 # CONFIG_DEBUG_LIST is not set
+# CONFIG_DEBUG_SG is not set
 CONFIG_FRAME_POINTER=y
 CONFIG_FORCED_INLINING=y
-# CONFIG_HEADERS_CHECK is not set
+# CONFIG_BOOT_PRINTK_DELAY is not set
 # CONFIG_RCU_TORTURE_TEST is not set
+# CONFIG_FAULT_INJECTION is not set
+# CONFIG_SAMPLES is not set
 CONFIG_DEBUG_USER=y
 # CONFIG_DEBUG_ERRORS is not set
 CONFIG_DEBUG_LL=y
@@ -1088,18 +1160,21 @@ CONFIG_DEBUG_LL=y
 #
 # CONFIG_KEYS is not set
 # CONFIG_SECURITY is not set
-
-#
-# Cryptographic options
-#
+# CONFIG_SECURITY_FILE_CAPABILITIES is not set
 # CONFIG_CRYPTO is not set
 
 #
 # Library routines
 #
+CONFIG_BITREVERSE=y
 # CONFIG_CRC_CCITT is not set
 # CONFIG_CRC16 is not set
+# CONFIG_CRC_ITU_T is not set
 CONFIG_CRC32=y
+# CONFIG_CRC7 is not set
 # CONFIG_LIBCRC32C is not set
 CONFIG_ZLIB_INFLATE=y
 CONFIG_PLIST=y
+CONFIG_HAS_IOMEM=y
+CONFIG_HAS_IOPORT=y
+CONFIG_HAS_DMA=y
index c72ab82873d5fc008ba193188ad39c35f9c1a76e..32a0d74e0c8998bb3c3997de96e3d6a11ef23e24 100644 (file)
@@ -1,12 +1,18 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.20-rc1
-# Mon Jan  8 16:06:54 2007
+# Linux kernel version: 2.6.24-rc7
+# Tue Jan  8 22:12:20 2008
 #
 CONFIG_ARM=y
+CONFIG_SYS_SUPPORTS_APM_EMULATION=y
+CONFIG_GENERIC_GPIO=y
 # CONFIG_GENERIC_TIME is not set
+# CONFIG_GENERIC_CLOCKEVENTS is not set
 CONFIG_MMU=y
+# CONFIG_NO_IOPORT is not set
 CONFIG_GENERIC_HARDIRQS=y
+CONFIG_STACKTRACE_SUPPORT=y
+CONFIG_LOCKDEP_SUPPORT=y
 CONFIG_TRACE_IRQFLAGS_SUPPORT=y
 CONFIG_HARDIRQS_SW_RESEND=y
 CONFIG_GENERIC_IRQ_PROBE=y
@@ -15,32 +21,36 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
 # CONFIG_ARCH_HAS_ILOG2_U64 is not set
 CONFIG_GENERIC_HWEIGHT=y
 CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_ZONE_DMA=y
 CONFIG_VECTORS_BASE=0xffff0000
 CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
 
 #
-# Code maturity level options
+# General setup
 #
 CONFIG_EXPERIMENTAL=y
 CONFIG_BROKEN_ON_SMP=y
 CONFIG_INIT_ENV_ARG_LIMIT=32
-
-#
-# General setup
-#
 CONFIG_LOCALVERSION=""
 # CONFIG_LOCALVERSION_AUTO is not set
 # CONFIG_SWAP is not set
 CONFIG_SYSVIPC=y
-# CONFIG_IPC_NS is not set
+CONFIG_SYSVIPC_SYSCTL=y
 # CONFIG_POSIX_MQUEUE is not set
 # CONFIG_BSD_PROCESS_ACCT is not set
 # CONFIG_TASKSTATS is not set
-# CONFIG_UTS_NS is not set
+# CONFIG_USER_NS is not set
+# CONFIG_PID_NS is not set
 # CONFIG_AUDIT is not set
 # CONFIG_IKCONFIG is not set
+CONFIG_LOG_BUF_SHIFT=14
+# CONFIG_CGROUPS is not set
+CONFIG_FAIR_GROUP_SCHED=y
+CONFIG_FAIR_USER_SCHED=y
+# CONFIG_FAIR_CGROUP_SCHED is not set
 CONFIG_SYSFS_DEPRECATED=y
 # CONFIG_RELAY is not set
+CONFIG_BLK_DEV_INITRD=y
 CONFIG_INITRAMFS_SOURCE=""
 CONFIG_CC_OPTIMIZE_FOR_SIZE=y
 CONFIG_SYSCTL=y
@@ -56,32 +66,30 @@ CONFIG_BUG=y
 CONFIG_ELF_CORE=y
 CONFIG_BASE_FULL=y
 CONFIG_FUTEX=y
+CONFIG_ANON_INODES=y
 CONFIG_EPOLL=y
+CONFIG_SIGNALFD=y
+CONFIG_EVENTFD=y
 CONFIG_SHMEM=y
-CONFIG_SLAB=y
 CONFIG_VM_EVENT_COUNTERS=y
+CONFIG_SLAB=y
+# CONFIG_SLUB is not set
+# CONFIG_SLOB is not set
+CONFIG_SLABINFO=y
 CONFIG_RT_MUTEXES=y
 # CONFIG_TINY_SHMEM is not set
 CONFIG_BASE_SMALL=0
-# CONFIG_SLOB is not set
-
-#
-# Loadable module support
-#
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
 # CONFIG_MODULE_FORCE_UNLOAD is not set
 # CONFIG_MODVERSIONS is not set
 # CONFIG_MODULE_SRCVERSION_ALL is not set
 CONFIG_KMOD=y
-
-#
-# Block layer
-#
 CONFIG_BLOCK=y
 # CONFIG_LBD is not set
 # CONFIG_BLK_DEV_IO_TRACE is not set
 # CONFIG_LSF is not set
+# CONFIG_BLK_DEV_BSG is not set
 
 #
 # IO Schedulers
@@ -113,13 +121,16 @@ CONFIG_ARCH_AT91=y
 # CONFIG_ARCH_NETX is not set
 # CONFIG_ARCH_H720X is not set
 # CONFIG_ARCH_IMX is not set
+# CONFIG_ARCH_IOP13XX is not set
 # CONFIG_ARCH_IOP32X is not set
 # CONFIG_ARCH_IOP33X is not set
-# CONFIG_ARCH_IOP13XX is not set
-# CONFIG_ARCH_IXP4XX is not set
-# CONFIG_ARCH_IXP2000 is not set
 # CONFIG_ARCH_IXP23XX is not set
+# CONFIG_ARCH_IXP2000 is not set
+# CONFIG_ARCH_IXP4XX is not set
 # CONFIG_ARCH_L7200 is not set
+# CONFIG_ARCH_KS8695 is not set
+# CONFIG_ARCH_NS9XXX is not set
+# CONFIG_ARCH_MXC is not set
 # CONFIG_ARCH_PNX4008 is not set
 # CONFIG_ARCH_PXA is not set
 # CONFIG_ARCH_RPC is not set
@@ -127,8 +138,17 @@ CONFIG_ARCH_AT91=y
 # CONFIG_ARCH_S3C2410 is not set
 # CONFIG_ARCH_SHARK is not set
 # CONFIG_ARCH_LH7A40X is not set
+# CONFIG_ARCH_DAVINCI is not set
 # CONFIG_ARCH_OMAP is not set
 
+#
+# Boot options
+#
+
+#
+# Power management
+#
+
 #
 # Atmel AT91 System-on-Chip
 #
@@ -136,6 +156,9 @@ CONFIG_ARCH_AT91=y
 # CONFIG_ARCH_AT91SAM9260 is not set
 # CONFIG_ARCH_AT91SAM9261 is not set
 CONFIG_ARCH_AT91SAM9263=y
+# CONFIG_ARCH_AT91SAM9RL is not set
+# CONFIG_ARCH_AT91X40 is not set
+CONFIG_AT91_PMC_UNIT=y
 
 #
 # AT91SAM9263 Board Type
@@ -152,6 +175,8 @@ CONFIG_MTD_AT91_DATAFLASH_CARD=y
 # AT91 Feature Selections
 #
 # CONFIG_AT91_PROGRAMMABLE_CLOCKS is not set
+# CONFIG_ATMEL_TCLIB is not set
+CONFIG_AT91_TIMER_HZ=100
 
 #
 # Processor Type
@@ -174,19 +199,19 @@ CONFIG_CPU_CP15_MMU=y
 # CONFIG_CPU_DCACHE_DISABLE is not set
 # CONFIG_CPU_DCACHE_WRITETHROUGH is not set
 # CONFIG_CPU_CACHE_ROUND_ROBIN is not set
+# CONFIG_OUTER_CACHE is not set
 
 #
 # Bus support
 #
-
-#
-# PCCARD (PCMCIA/CardBus) support
-#
+# CONFIG_PCI_SYSCALL is not set
+# CONFIG_ARCH_SUPPORTS_MSI is not set
 # CONFIG_PCCARD is not set
 
 #
 # Kernel Features
 #
+# CONFIG_TICK_ONESHOT is not set
 # CONFIG_PREEMPT is not set
 # CONFIG_NO_IDLE_HZ is not set
 CONFIG_HZ=100
@@ -199,8 +224,12 @@ CONFIG_FLATMEM_MANUAL=y
 CONFIG_FLATMEM=y
 CONFIG_FLAT_NODE_MEM_MAP=y
 # CONFIG_SPARSEMEM_STATIC is not set
+# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
 CONFIG_SPLIT_PTLOCK_CPUS=4096
 # CONFIG_RESOURCES_64BIT is not set
+CONFIG_ZONE_DMA_FLAG=1
+CONFIG_BOUNCE=y
+CONFIG_VIRT_TO_BUS=y
 # CONFIG_LEDS is not set
 CONFIG_ALIGNMENT_TRAP=y
 
@@ -211,6 +240,7 @@ CONFIG_ZBOOT_ROM_TEXT=0x0
 CONFIG_ZBOOT_ROM_BSS=0x0
 CONFIG_CMDLINE="mem=64M console=ttyS0,115200 initrd=0x21100000,3145728 root=/dev/ram0 rw"
 # CONFIG_XIP_KERNEL is not set
+# CONFIG_KEXEC is not set
 
 #
 # Floating point emulation
@@ -236,7 +266,7 @@ CONFIG_BINFMT_ELF=y
 # Power management options
 #
 # CONFIG_PM is not set
-# CONFIG_APM is not set
+CONFIG_SUSPEND_UP_POSSIBLE=y
 
 #
 # Networking
@@ -246,7 +276,6 @@ CONFIG_NET=y
 #
 # Networking options
 #
-# CONFIG_NETDEBUG is not set
 CONFIG_PACKET=y
 # CONFIG_PACKET_MMAP is not set
 CONFIG_UNIX=y
@@ -271,6 +300,7 @@ CONFIG_IP_PNP_RARP=y
 # CONFIG_INET_XFRM_MODE_TRANSPORT is not set
 # CONFIG_INET_XFRM_MODE_TUNNEL is not set
 # CONFIG_INET_XFRM_MODE_BEET is not set
+# CONFIG_INET_LRO is not set
 # CONFIG_INET_DIAG is not set
 # CONFIG_TCP_CONG_ADVANCED is not set
 CONFIG_TCP_CONG_CUBIC=y
@@ -281,20 +311,8 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
 # CONFIG_INET6_TUNNEL is not set
 # CONFIG_NETWORK_SECMARK is not set
 # CONFIG_NETFILTER is not set
-
-#
-# DCCP Configuration (EXPERIMENTAL)
-#
 # CONFIG_IP_DCCP is not set
-
-#
-# SCTP Configuration (EXPERIMENTAL)
-#
 # CONFIG_IP_SCTP is not set
-
-#
-# TIPC Configuration (EXPERIMENTAL)
-#
 # CONFIG_TIPC is not set
 # CONFIG_ATM is not set
 # CONFIG_BRIDGE is not set
@@ -307,10 +325,6 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
 # CONFIG_LAPB is not set
 # CONFIG_ECONET is not set
 # CONFIG_WAN_ROUTER is not set
-
-#
-# QoS and/or fair queueing
-#
 # CONFIG_NET_SCHED is not set
 
 #
@@ -320,7 +334,17 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
 # CONFIG_HAMRADIO is not set
 # CONFIG_IRDA is not set
 # CONFIG_BT is not set
+# CONFIG_AF_RXRPC is not set
+
+#
+# Wireless
+#
+# CONFIG_CFG80211 is not set
+# CONFIG_WIRELESS_EXT is not set
+# CONFIG_MAC80211 is not set
 # CONFIG_IEEE80211 is not set
+# CONFIG_RFKILL is not set
+# CONFIG_NET_9P is not set
 
 #
 # Device Drivers
@@ -329,20 +353,14 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
 #
 # Generic Driver Options
 #
+CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
 CONFIG_STANDALONE=y
 CONFIG_PREVENT_FIRMWARE_BUILD=y
 # CONFIG_FW_LOADER is not set
 # CONFIG_DEBUG_DRIVER is not set
+# CONFIG_DEBUG_DEVRES is not set
 # CONFIG_SYS_HYPERVISOR is not set
-
-#
-# Connector - unified userspace <-> kernelspace linker
-#
 # CONFIG_CONNECTOR is not set
-
-#
-# Memory Technology Devices (MTD)
-#
 CONFIG_MTD=y
 # CONFIG_MTD_DEBUG is not set
 # CONFIG_MTD_CONCAT is not set
@@ -362,6 +380,7 @@ CONFIG_MTD_BLOCK=y
 # CONFIG_INFTL is not set
 # CONFIG_RFD_FTL is not set
 # CONFIG_SSFDC is not set
+# CONFIG_MTD_OOPS is not set
 
 #
 # RAM/ROM/Flash chip drivers
@@ -381,7 +400,6 @@ CONFIG_MTD_CFI_I2=y
 # CONFIG_MTD_RAM is not set
 # CONFIG_MTD_ROM is not set
 # CONFIG_MTD_ABSENT is not set
-# CONFIG_MTD_OBSOLETE_CHIPS is not set
 
 #
 # Mapping drivers for chip access
@@ -405,35 +423,24 @@ CONFIG_MTD_DATAFLASH=y
 # CONFIG_MTD_DOC2000 is not set
 # CONFIG_MTD_DOC2001 is not set
 # CONFIG_MTD_DOC2001PLUS is not set
-
-#
-# NAND Flash Device Drivers
-#
 CONFIG_MTD_NAND=y
 # CONFIG_MTD_NAND_VERIFY_WRITE is not set
 # CONFIG_MTD_NAND_ECC_SMC is not set
+# CONFIG_MTD_NAND_MUSEUM_IDS is not set
 CONFIG_MTD_NAND_IDS=y
 # CONFIG_MTD_NAND_DISKONCHIP is not set
 CONFIG_MTD_NAND_AT91=y
 # CONFIG_MTD_NAND_NANDSIM is not set
-
-#
-# OneNAND Flash Device Drivers
-#
+# CONFIG_MTD_NAND_PLATFORM is not set
+# CONFIG_MTD_ALAUDA is not set
 # CONFIG_MTD_ONENAND is not set
 
 #
-# Parallel port support
+# UBI - Unsorted block images
 #
+# CONFIG_MTD_UBI is not set
 # CONFIG_PARPORT is not set
-
-#
-# Plug and Play support
-#
-
-#
-# Block devices
-#
+CONFIG_BLK_DEV=y
 # CONFIG_BLK_DEV_COW_COMMON is not set
 CONFIG_BLK_DEV_LOOP=y
 # CONFIG_BLK_DEV_CRYPTOLOOP is not set
@@ -443,15 +450,18 @@ CONFIG_BLK_DEV_RAM=y
 CONFIG_BLK_DEV_RAM_COUNT=16
 CONFIG_BLK_DEV_RAM_SIZE=8192
 CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
-CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CDROM_PKTCDVD is not set
 # CONFIG_ATA_OVER_ETH is not set
+CONFIG_MISC_DEVICES=y
+# CONFIG_EEPROM_93CX6 is not set
+CONFIG_ATMEL_SSC=y
 
 #
 # SCSI device support
 #
 # CONFIG_RAID_ATTRS is not set
 CONFIG_SCSI=y
+CONFIG_SCSI_DMA=y
 # CONFIG_SCSI_TGT is not set
 # CONFIG_SCSI_NETLINK is not set
 CONFIG_SCSI_PROC_FS=y
@@ -473,6 +483,7 @@ CONFIG_SCSI_MULTI_LUN=y
 # CONFIG_SCSI_CONSTANTS is not set
 # CONFIG_SCSI_LOGGING is not set
 # CONFIG_SCSI_SCAN_ASYNC is not set
+CONFIG_SCSI_WAIT_SCAN=m
 
 #
 # SCSI Transports
@@ -480,80 +491,65 @@ CONFIG_SCSI_MULTI_LUN=y
 # CONFIG_SCSI_SPI_ATTRS is not set
 # CONFIG_SCSI_FC_ATTRS is not set
 # CONFIG_SCSI_ISCSI_ATTRS is not set
-# CONFIG_SCSI_SAS_ATTRS is not set
 # CONFIG_SCSI_SAS_LIBSAS is not set
-
-#
-# SCSI low-level drivers
-#
+# CONFIG_SCSI_SRP_ATTRS is not set
+CONFIG_SCSI_LOWLEVEL=y
 # CONFIG_ISCSI_TCP is not set
 # CONFIG_SCSI_DEBUG is not set
-
-#
-# Serial ATA (prod) and Parallel ATA (experimental) drivers
-#
 # CONFIG_ATA is not set
-
-#
-# Multi-device support (RAID and LVM)
-#
 # CONFIG_MD is not set
-
-#
-# Fusion MPT device support
-#
-# CONFIG_FUSION is not set
-
-#
-# IEEE 1394 (FireWire) support
-#
-
-#
-# I2O device support
-#
-
-#
-# Network device support
-#
 CONFIG_NETDEVICES=y
+# CONFIG_NETDEVICES_MULTIQUEUE is not set
 # CONFIG_DUMMY is not set
 # CONFIG_BONDING is not set
+# CONFIG_MACVLAN is not set
 # CONFIG_EQUALIZER is not set
 # CONFIG_TUN is not set
-
-#
-# PHY device support
-#
-# CONFIG_PHYLIB is not set
-
-#
-# Ethernet (10 or 100Mbit)
-#
+# CONFIG_VETH is not set
+CONFIG_PHYLIB=y
+
+#
+# MII PHY device drivers
+#
+# CONFIG_MARVELL_PHY is not set
+# CONFIG_DAVICOM_PHY is not set
+# CONFIG_QSEMI_PHY is not set
+# CONFIG_LXT_PHY is not set
+# CONFIG_CICADA_PHY is not set
+# CONFIG_VITESSE_PHY is not set
+# CONFIG_SMSC_PHY is not set
+# CONFIG_BROADCOM_PHY is not set
+# CONFIG_ICPLUS_PHY is not set
+# CONFIG_FIXED_PHY is not set
+# CONFIG_MDIO_BITBANG is not set
 CONFIG_NET_ETHERNET=y
 CONFIG_MII=y
+CONFIG_MACB=y
+# CONFIG_AX88796 is not set
 # CONFIG_SMC91X is not set
 # CONFIG_DM9000 is not set
+# CONFIG_IBM_NEW_EMAC_ZMII is not set
+# CONFIG_IBM_NEW_EMAC_RGMII is not set
+# CONFIG_IBM_NEW_EMAC_TAH is not set
+# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
+# CONFIG_B44 is not set
+CONFIG_NETDEV_1000=y
+CONFIG_NETDEV_10000=y
 
 #
-# Ethernet (1000 Mbit)
-#
-
-#
-# Ethernet (10000 Mbit)
-#
-
-#
-# Token Ring devices
-#
-
-#
-# Wireless LAN (non-hamradio)
+# Wireless LAN
 #
-# CONFIG_NET_RADIO is not set
+# CONFIG_WLAN_PRE80211 is not set
+# CONFIG_WLAN_80211 is not set
 
 #
-# Wan interfaces
+# USB Network Adapters
 #
+# CONFIG_USB_CATC is not set
+# CONFIG_USB_KAWETH is not set
+# CONFIG_USB_PEGASUS is not set
+# CONFIG_USB_RTL8150 is not set
+# CONFIG_USB_USBNET is not set
 # CONFIG_WAN is not set
 # CONFIG_PPP is not set
 # CONFIG_SLIP is not set
@@ -561,10 +557,6 @@ CONFIG_MII=y
 # CONFIG_NETCONSOLE is not set
 # CONFIG_NETPOLL is not set
 # CONFIG_NET_POLL_CONTROLLER is not set
-
-#
-# ISDN subsystem
-#
 # CONFIG_ISDN is not set
 
 #
@@ -572,6 +564,7 @@ CONFIG_MII=y
 #
 CONFIG_INPUT=y
 # CONFIG_INPUT_FF_MEMLESS is not set
+# CONFIG_INPUT_POLLDEV is not set
 
 #
 # Userland interfaces
@@ -581,20 +574,26 @@ CONFIG_INPUT_MOUSEDEV=y
 CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
 CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
 # CONFIG_INPUT_JOYDEV is not set
-CONFIG_INPUT_TSDEV=y
-CONFIG_INPUT_TSDEV_SCREEN_X=240
-CONFIG_INPUT_TSDEV_SCREEN_Y=320
 CONFIG_INPUT_EVDEV=y
 # CONFIG_INPUT_EVBUG is not set
 
 #
 # Input Device Drivers
 #
-# CONFIG_INPUT_KEYBOARD is not set
+CONFIG_INPUT_KEYBOARD=y
+# CONFIG_KEYBOARD_ATKBD is not set
+# CONFIG_KEYBOARD_SUNKBD is not set
+# CONFIG_KEYBOARD_LKKBD is not set
+# CONFIG_KEYBOARD_XTKBD is not set
+# CONFIG_KEYBOARD_NEWTON is not set
+# CONFIG_KEYBOARD_STOWAWAY is not set
+CONFIG_KEYBOARD_GPIO=y
 # CONFIG_INPUT_MOUSE is not set
 # CONFIG_INPUT_JOYSTICK is not set
+# CONFIG_INPUT_TABLET is not set
 CONFIG_INPUT_TOUCHSCREEN=y
 CONFIG_TOUCHSCREEN_ADS7846=y
+# CONFIG_TOUCHSCREEN_FUJITSU is not set
 # CONFIG_TOUCHSCREEN_GUNZE is not set
 # CONFIG_TOUCHSCREEN_ELO is not set
 # CONFIG_TOUCHSCREEN_MTOUCH is not set
@@ -603,6 +602,7 @@ CONFIG_TOUCHSCREEN_ADS7846=y
 # CONFIG_TOUCHSCREEN_TOUCHRIGHT is not set
 # CONFIG_TOUCHSCREEN_TOUCHWIN is not set
 # CONFIG_TOUCHSCREEN_UCB1400 is not set
+# CONFIG_TOUCHSCREEN_USB_COMPOSITE is not set
 # CONFIG_INPUT_MISC is not set
 
 #
@@ -636,71 +636,47 @@ CONFIG_SERIAL_CORE_CONSOLE=y
 CONFIG_UNIX98_PTYS=y
 CONFIG_LEGACY_PTYS=y
 CONFIG_LEGACY_PTY_COUNT=256
-
-#
-# IPMI
-#
 # CONFIG_IPMI_HANDLER is not set
-
-#
-# Watchdog Cards
-#
-CONFIG_WATCHDOG=y
-CONFIG_WATCHDOG_NOWAYOUT=y
-
-#
-# Watchdog Device Drivers
-#
-# CONFIG_SOFT_WATCHDOG is not set
-
-#
-# USB-based Watchdog Cards
-#
-# CONFIG_USBPCWATCHDOG is not set
 CONFIG_HW_RANDOM=y
 # CONFIG_NVRAM is not set
-# CONFIG_DTLK is not set
 # CONFIG_R3964 is not set
 # CONFIG_RAW_DRIVER is not set
-
-#
-# TPM devices
-#
 # CONFIG_TCG_TPM is not set
-
-#
-# I2C support
-#
 CONFIG_I2C=y
+CONFIG_I2C_BOARDINFO=y
 CONFIG_I2C_CHARDEV=y
 
 #
 # I2C Algorithms
 #
-# CONFIG_I2C_ALGOBIT is not set
+CONFIG_I2C_ALGOBIT=y
 # CONFIG_I2C_ALGOPCF is not set
 # CONFIG_I2C_ALGOPCA is not set
 
 #
 # I2C Hardware Bus support
 #
-CONFIG_I2C_AT91=y
+CONFIG_I2C_GPIO=y
 # CONFIG_I2C_OCORES is not set
 # CONFIG_I2C_PARPORT_LIGHT is not set
+# CONFIG_I2C_SIMTEC is not set
+# CONFIG_I2C_TAOS_EVM is not set
 # CONFIG_I2C_STUB is not set
+# CONFIG_I2C_TINY_USB is not set
 # CONFIG_I2C_PCA is not set
-# CONFIG_I2C_PCA_ISA is not set
 
 #
 # Miscellaneous I2C Chip support
 #
 # CONFIG_SENSORS_DS1337 is not set
 # CONFIG_SENSORS_DS1374 is not set
+# CONFIG_DS1682 is not set
 # CONFIG_SENSORS_EEPROM is not set
 # CONFIG_SENSORS_PCF8574 is not set
 # CONFIG_SENSORS_PCA9539 is not set
 # CONFIG_SENSORS_PCF8591 is not set
 # CONFIG_SENSORS_MAX6875 is not set
+# CONFIG_SENSORS_TSL2550 is not set
 # CONFIG_I2C_DEBUG_CORE is not set
 # CONFIG_I2C_DEBUG_ALGO is not set
 # CONFIG_I2C_DEBUG_BUS is not set
@@ -722,61 +698,80 @@ CONFIG_SPI_ATMEL=y
 #
 # SPI Protocol Masters
 #
-
-#
-# Dallas's 1-wire bus
-#
+# CONFIG_SPI_AT25 is not set
+# CONFIG_SPI_SPIDEV is not set
+# CONFIG_SPI_TLE62X0 is not set
 # CONFIG_W1 is not set
-
-#
-# Hardware Monitoring support
-#
+# CONFIG_POWER_SUPPLY is not set
 # CONFIG_HWMON is not set
-# CONFIG_HWMON_VID is not set
+CONFIG_WATCHDOG=y
+CONFIG_WATCHDOG_NOWAYOUT=y
 
 #
-# Misc devices
+# Watchdog Device Drivers
 #
-# CONFIG_TIFM_CORE is not set
+# CONFIG_SOFT_WATCHDOG is not set
+CONFIG_AT91SAM9_WATCHDOG=y
 
 #
-# LED devices
+# USB-based Watchdog Cards
 #
-# CONFIG_NEW_LEDS is not set
+# CONFIG_USBPCWATCHDOG is not set
 
 #
-# LED drivers
+# Sonics Silicon Backplane
 #
+CONFIG_SSB_POSSIBLE=y
+# CONFIG_SSB is not set
 
 #
-# LED Triggers
+# Multifunction device drivers
 #
+# CONFIG_MFD_SM501 is not set
 
 #
 # Multimedia devices
 #
 # CONFIG_VIDEO_DEV is not set
-
-#
-# Digital Video Broadcasting Devices
-#
-# CONFIG_DVB is not set
-# CONFIG_USB_DABUSB is not set
+# CONFIG_DVB_CORE is not set
+# CONFIG_DAB is not set
 
 #
 # Graphics support
 #
-# CONFIG_FIRMWARE_EDID is not set
+# CONFIG_VGASTATE is not set
+# CONFIG_VIDEO_OUTPUT_CONTROL is not set
 CONFIG_FB=y
-# CONFIG_FB_CFB_FILLRECT is not set
-# CONFIG_FB_CFB_COPYAREA is not set
-# CONFIG_FB_CFB_IMAGEBLIT is not set
+# CONFIG_FIRMWARE_EDID is not set
+# CONFIG_FB_DDC is not set
+CONFIG_FB_CFB_FILLRECT=y
+CONFIG_FB_CFB_COPYAREA=y
+CONFIG_FB_CFB_IMAGEBLIT=y
+# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
+# CONFIG_FB_SYS_FILLRECT is not set
+# CONFIG_FB_SYS_COPYAREA is not set
+# CONFIG_FB_SYS_IMAGEBLIT is not set
+# CONFIG_FB_SYS_FOPS is not set
+CONFIG_FB_DEFERRED_IO=y
+# CONFIG_FB_SVGALIB is not set
 # CONFIG_FB_MACMODES is not set
 # CONFIG_FB_BACKLIGHT is not set
 # CONFIG_FB_MODE_HELPERS is not set
 # CONFIG_FB_TILEBLITTING is not set
+
+#
+# Frame buffer hardware drivers
+#
+# CONFIG_FB_S1D15605 is not set
 # CONFIG_FB_S1D13XXX is not set
+CONFIG_FB_ATMEL=y
 # CONFIG_FB_VIRTUAL is not set
+# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
+
+#
+# Display device support
+#
+# CONFIG_DISPLAY_SUPPORT is not set
 
 #
 # Console display driver support
@@ -784,26 +779,28 @@ CONFIG_FB=y
 # CONFIG_VGA_CONSOLE is not set
 CONFIG_DUMMY_CONSOLE=y
 # CONFIG_FRAMEBUFFER_CONSOLE is not set
-
-#
-# Logo configuration
-#
 # CONFIG_LOGO is not set
-# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
 
 #
 # Sound
 #
 # CONFIG_SOUND is not set
+CONFIG_HID_SUPPORT=y
+CONFIG_HID=y
+# CONFIG_HID_DEBUG is not set
+# CONFIG_HIDRAW is not set
 
 #
-# HID Devices
+# USB Input Devices
 #
-CONFIG_HID=y
+# CONFIG_USB_HID is not set
 
 #
-# USB support
+# USB HID Boot Protocol drivers
 #
+# CONFIG_USB_KBD is not set
+# CONFIG_USB_MOUSE is not set
+CONFIG_USB_SUPPORT=y
 CONFIG_USB_ARCH_HAS_HCD=y
 CONFIG_USB_ARCH_HAS_OHCI=y
 # CONFIG_USB_ARCH_HAS_EHCI is not set
@@ -814,9 +811,8 @@ CONFIG_USB=y
 # Miscellaneous USB options
 #
 CONFIG_USB_DEVICEFS=y
-# CONFIG_USB_BANDWIDTH is not set
+CONFIG_USB_DEVICE_CLASS=y
 # CONFIG_USB_DYNAMIC_MINORS is not set
-# CONFIG_USB_MULTITHREAD_PROBE is not set
 # CONFIG_USB_OTG is not set
 
 #
@@ -824,9 +820,11 @@ CONFIG_USB_DEVICEFS=y
 #
 # CONFIG_USB_ISP116X_HCD is not set
 CONFIG_USB_OHCI_HCD=y
-# CONFIG_USB_OHCI_BIG_ENDIAN is not set
+# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set
+# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set
 CONFIG_USB_OHCI_LITTLE_ENDIAN=y
 # CONFIG_USB_SL811_HCD is not set
+# CONFIG_USB_R8A66597_HCD is not set
 
 #
 # USB Device Class drivers
@@ -845,6 +843,7 @@ CONFIG_USB_STORAGE=y
 # CONFIG_USB_STORAGE_DEBUG is not set
 # CONFIG_USB_STORAGE_DATAFAB is not set
 # CONFIG_USB_STORAGE_FREECOM is not set
+# CONFIG_USB_STORAGE_ISD200 is not set
 # CONFIG_USB_STORAGE_DPCM is not set
 # CONFIG_USB_STORAGE_USBAT is not set
 # CONFIG_USB_STORAGE_SDDR09 is not set
@@ -855,44 +854,11 @@ CONFIG_USB_STORAGE=y
 # CONFIG_USB_STORAGE_KARMA is not set
 # CONFIG_USB_LIBUSUAL is not set
 
-#
-# USB Input Devices
-#
-# CONFIG_USB_HID is not set
-
-#
-# USB HID Boot Protocol drivers
-#
-# CONFIG_USB_KBD is not set
-# CONFIG_USB_MOUSE is not set
-# CONFIG_USB_AIPTEK is not set
-# CONFIG_USB_WACOM is not set
-# CONFIG_USB_ACECAD is not set
-# CONFIG_USB_KBTAB is not set
-# CONFIG_USB_POWERMATE is not set
-# CONFIG_USB_TOUCHSCREEN is not set
-# CONFIG_USB_YEALINK is not set
-# CONFIG_USB_XPAD is not set
-# CONFIG_USB_ATI_REMOTE is not set
-# CONFIG_USB_ATI_REMOTE2 is not set
-# CONFIG_USB_KEYSPAN_REMOTE is not set
-# CONFIG_USB_APPLETOUCH is not set
-
 #
 # USB Imaging devices
 #
 # CONFIG_USB_MDC800 is not set
 # CONFIG_USB_MICROTEK is not set
-
-#
-# USB Network Adapters
-#
-# CONFIG_USB_CATC is not set
-# CONFIG_USB_KAWETH is not set
-# CONFIG_USB_PEGASUS is not set
-# CONFIG_USB_RTL8150 is not set
-# CONFIG_USB_USBNET_MII is not set
-# CONFIG_USB_USBNET is not set
 CONFIG_USB_MON=y
 
 #
@@ -914,6 +880,7 @@ CONFIG_USB_MON=y
 # CONFIG_USB_RIO500 is not set
 # CONFIG_USB_LEGOTOWER is not set
 # CONFIG_USB_LCD is not set
+# CONFIG_USB_BERRY_CHARGE is not set
 # CONFIG_USB_LED is not set
 # CONFIG_USB_CYPRESS_CY7C63 is not set
 # CONFIG_USB_CYTHERM is not set
@@ -923,6 +890,7 @@ CONFIG_USB_MON=y
 # CONFIG_USB_APPLEDISPLAY is not set
 # CONFIG_USB_LD is not set
 # CONFIG_USB_TRANCEVIBRATOR is not set
+# CONFIG_USB_IOWARRIOR is not set
 # CONFIG_USB_TEST is not set
 
 #
@@ -933,13 +901,19 @@ CONFIG_USB_MON=y
 # USB Gadget Support
 #
 CONFIG_USB_GADGET=y
+# CONFIG_USB_GADGET_DEBUG is not set
 # CONFIG_USB_GADGET_DEBUG_FILES is not set
 CONFIG_USB_GADGET_SELECTED=y
+# CONFIG_USB_GADGET_AMD5536UDC is not set
+# CONFIG_USB_GADGET_ATMEL_USBA is not set
+# CONFIG_USB_GADGET_FSL_USB2 is not set
 # CONFIG_USB_GADGET_NET2280 is not set
 # CONFIG_USB_GADGET_PXA2XX is not set
+# CONFIG_USB_GADGET_M66592 is not set
 # CONFIG_USB_GADGET_GOKU is not set
 # CONFIG_USB_GADGET_LH7A40X is not set
 # CONFIG_USB_GADGET_OMAP is not set
+# CONFIG_USB_GADGET_S3C2410 is not set
 CONFIG_USB_GADGET_AT91=y
 CONFIG_USB_AT91=y
 # CONFIG_USB_GADGET_DUMMY_HCD is not set
@@ -951,21 +925,73 @@ CONFIG_USB_FILE_STORAGE=m
 # CONFIG_USB_FILE_STORAGE_TEST is not set
 CONFIG_USB_G_SERIAL=m
 # CONFIG_USB_MIDI_GADGET is not set
+CONFIG_MMC=y
+# CONFIG_MMC_DEBUG is not set
+# CONFIG_MMC_UNSAFE_RESUME is not set
 
 #
-# MMC/SD Card support
+# MMC/SD Card Drivers
 #
-CONFIG_MMC=y
-# CONFIG_MMC_DEBUG is not set
 CONFIG_MMC_BLOCK=y
-CONFIG_MMC_AT91=m
-# CONFIG_MMC_TIFM_SD is not set
+CONFIG_MMC_BLOCK_BOUNCE=y
+# CONFIG_SDIO_UART is not set
 
 #
-# Real Time Clock
+# MMC/SD Host Controller Drivers
 #
+CONFIG_MMC_AT91=m
+# CONFIG_MMC_SPI is not set
+# CONFIG_NEW_LEDS is not set
 CONFIG_RTC_LIB=y
-# CONFIG_RTC_CLASS is not set
+CONFIG_RTC_CLASS=y
+CONFIG_RTC_HCTOSYS=y
+CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
+# CONFIG_RTC_DEBUG is not set
+
+#
+# RTC interfaces
+#
+CONFIG_RTC_INTF_SYSFS=y
+CONFIG_RTC_INTF_PROC=y
+CONFIG_RTC_INTF_DEV=y
+# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
+# CONFIG_RTC_DRV_TEST is not set
+
+#
+# I2C RTC drivers
+#
+# CONFIG_RTC_DRV_DS1307 is not set
+# CONFIG_RTC_DRV_DS1374 is not set
+# CONFIG_RTC_DRV_DS1672 is not set
+# CONFIG_RTC_DRV_MAX6900 is not set
+# CONFIG_RTC_DRV_RS5C372 is not set
+# CONFIG_RTC_DRV_ISL1208 is not set
+# CONFIG_RTC_DRV_X1205 is not set
+# CONFIG_RTC_DRV_PCF8563 is not set
+# CONFIG_RTC_DRV_PCF8583 is not set
+# CONFIG_RTC_DRV_M41T80 is not set
+
+#
+# SPI RTC drivers
+#
+# CONFIG_RTC_DRV_RS5C348 is not set
+# CONFIG_RTC_DRV_MAX6902 is not set
+
+#
+# Platform RTC drivers
+#
+# CONFIG_RTC_DRV_CMOS is not set
+# CONFIG_RTC_DRV_DS1553 is not set
+# CONFIG_RTC_DRV_STK17TA8 is not set
+# CONFIG_RTC_DRV_DS1742 is not set
+# CONFIG_RTC_DRV_M48T86 is not set
+# CONFIG_RTC_DRV_M48T59 is not set
+# CONFIG_RTC_DRV_V3020 is not set
+
+#
+# on-CPU RTC drivers
+#
+CONFIG_RTC_DRV_AT91SAM9=y
 
 #
 # File systems
@@ -1016,7 +1042,6 @@ CONFIG_SYSFS=y
 CONFIG_TMPFS=y
 # CONFIG_TMPFS_POSIX_ACL is not set
 # CONFIG_HUGETLB_PAGE is not set
-CONFIG_RAMFS=y
 # CONFIG_CONFIGFS_FS is not set
 
 #
@@ -1032,10 +1057,12 @@ CONFIG_RAMFS=y
 CONFIG_JFFS2_FS=y
 CONFIG_JFFS2_FS_DEBUG=0
 CONFIG_JFFS2_FS_WRITEBUFFER=y
+# CONFIG_JFFS2_FS_WBUF_VERIFY is not set
 # CONFIG_JFFS2_SUMMARY is not set
 # CONFIG_JFFS2_FS_XATTR is not set
 # CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
 CONFIG_JFFS2_ZLIB=y
+# CONFIG_JFFS2_LZO is not set
 CONFIG_JFFS2_RTIME=y
 # CONFIG_JFFS2_RUBIN is not set
 CONFIG_CRAMFS=y
@@ -1044,10 +1071,7 @@ CONFIG_CRAMFS=y
 # CONFIG_QNX4FS_FS is not set
 # CONFIG_SYSV_FS is not set
 # CONFIG_UFS_FS is not set
-
-#
-# Network File Systems
-#
+CONFIG_NETWORK_FILESYSTEMS=y
 CONFIG_NFS_FS=y
 # CONFIG_NFS_V3 is not set
 # CONFIG_NFS_V4 is not set
@@ -1057,6 +1081,7 @@ CONFIG_ROOT_NFS=y
 CONFIG_LOCKD=y
 CONFIG_NFS_COMMON=y
 CONFIG_SUNRPC=y
+# CONFIG_SUNRPC_BIND34 is not set
 # CONFIG_RPCSEC_GSS_KRB5 is not set
 # CONFIG_RPCSEC_GSS_SPKM3 is not set
 # CONFIG_SMB_FS is not set
@@ -1064,17 +1089,12 @@ CONFIG_SUNRPC=y
 # CONFIG_NCP_FS is not set
 # CONFIG_CODA_FS is not set
 # CONFIG_AFS_FS is not set
-# CONFIG_9P_FS is not set
 
 #
 # Partition Types
 #
 # CONFIG_PARTITION_ADVANCED is not set
 CONFIG_MSDOS_PARTITION=y
-
-#
-# Native Language Support
-#
 CONFIG_NLS=y
 CONFIG_NLS_DEFAULT="iso8859-1"
 CONFIG_NLS_CODEPAGE_437=y
@@ -1115,36 +1135,35 @@ CONFIG_NLS_ISO8859_1=y
 # CONFIG_NLS_KOI8_R is not set
 # CONFIG_NLS_KOI8_U is not set
 # CONFIG_NLS_UTF8 is not set
-
-#
-# Distributed Lock Manager
-#
 # CONFIG_DLM is not set
-
-#
-# Profiling support
-#
+CONFIG_INSTRUMENTATION=y
 # CONFIG_PROFILING is not set
+# CONFIG_MARKERS is not set
 
 #
 # Kernel hacking
 #
 # CONFIG_PRINTK_TIME is not set
+CONFIG_ENABLE_WARN_DEPRECATED=y
 CONFIG_ENABLE_MUST_CHECK=y
 # CONFIG_MAGIC_SYSRQ is not set
 # CONFIG_UNUSED_SYMBOLS is not set
 # CONFIG_DEBUG_FS is not set
 # CONFIG_HEADERS_CHECK is not set
 CONFIG_DEBUG_KERNEL=y
-CONFIG_LOG_BUF_SHIFT=14
+# CONFIG_DEBUG_SHIRQ is not set
 CONFIG_DETECT_SOFTLOCKUP=y
+CONFIG_SCHED_DEBUG=y
 # CONFIG_SCHEDSTATS is not set
+# CONFIG_TIMER_STATS is not set
 # CONFIG_DEBUG_SLAB is not set
 # CONFIG_DEBUG_RT_MUTEXES is not set
 # CONFIG_RT_MUTEX_TESTER is not set
 # CONFIG_DEBUG_SPINLOCK is not set
 # CONFIG_DEBUG_MUTEXES is not set
-# CONFIG_DEBUG_RWSEMS is not set
+# CONFIG_DEBUG_LOCK_ALLOC is not set
+# CONFIG_PROVE_LOCKING is not set
+# CONFIG_LOCK_STAT is not set
 # CONFIG_DEBUG_SPINLOCK_SLEEP is not set
 # CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
 # CONFIG_DEBUG_KOBJECT is not set
@@ -1152,9 +1171,13 @@ CONFIG_DEBUG_BUGVERBOSE=y
 # CONFIG_DEBUG_INFO is not set
 # CONFIG_DEBUG_VM is not set
 # CONFIG_DEBUG_LIST is not set
+# CONFIG_DEBUG_SG is not set
 CONFIG_FRAME_POINTER=y
 CONFIG_FORCED_INLINING=y
+# CONFIG_BOOT_PRINTK_DELAY is not set
 # CONFIG_RCU_TORTURE_TEST is not set
+# CONFIG_FAULT_INJECTION is not set
+# CONFIG_SAMPLES is not set
 CONFIG_DEBUG_USER=y
 # CONFIG_DEBUG_ERRORS is not set
 CONFIG_DEBUG_LL=y
@@ -1165,10 +1188,7 @@ CONFIG_DEBUG_LL=y
 #
 # CONFIG_KEYS is not set
 # CONFIG_SECURITY is not set
-
-#
-# Cryptographic options
-#
+# CONFIG_SECURITY_FILE_CAPABILITIES is not set
 # CONFIG_CRYPTO is not set
 
 #
@@ -1177,8 +1197,13 @@ CONFIG_DEBUG_LL=y
 CONFIG_BITREVERSE=y
 # CONFIG_CRC_CCITT is not set
 # CONFIG_CRC16 is not set
+# CONFIG_CRC_ITU_T is not set
 CONFIG_CRC32=y
+# CONFIG_CRC7 is not set
 # CONFIG_LIBCRC32C is not set
 CONFIG_ZLIB_INFLATE=y
+CONFIG_ZLIB_DEFLATE=y
 CONFIG_PLIST=y
-CONFIG_IOMAP_COPY=y
+CONFIG_HAS_IOMEM=y
+CONFIG_HAS_IOPORT=y
+CONFIG_HAS_DMA=y
index fbe8b30493439f6a2e94d4f854c4747a3886dfab..98e6746d02be22d3849a046114b3838358435278 100644 (file)
@@ -1,15 +1,18 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.21
-# Mon May  7 16:30:40 2007
+# Linux kernel version: 2.6.24-rc7
+# Tue Jan  8 22:24:14 2008
 #
 CONFIG_ARM=y
 CONFIG_SYS_SUPPORTS_APM_EMULATION=y
 CONFIG_GENERIC_GPIO=y
 # CONFIG_GENERIC_TIME is not set
+# CONFIG_GENERIC_CLOCKEVENTS is not set
 CONFIG_MMU=y
 # CONFIG_NO_IOPORT is not set
 CONFIG_GENERIC_HARDIRQS=y
+CONFIG_STACKTRACE_SUPPORT=y
+CONFIG_LOCKDEP_SUPPORT=y
 CONFIG_TRACE_IRQFLAGS_SUPPORT=y
 CONFIG_HARDIRQS_SW_RESEND=y
 CONFIG_GENERIC_IRQ_PROBE=y
@@ -23,27 +26,28 @@ CONFIG_VECTORS_BASE=0xffff0000
 CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
 
 #
-# Code maturity level options
+# General setup
 #
 CONFIG_EXPERIMENTAL=y
 CONFIG_BROKEN_ON_SMP=y
 CONFIG_INIT_ENV_ARG_LIMIT=32
-
-#
-# General setup
-#
 CONFIG_LOCALVERSION=""
 # CONFIG_LOCALVERSION_AUTO is not set
 # CONFIG_SWAP is not set
 CONFIG_SYSVIPC=y
-# CONFIG_IPC_NS is not set
 CONFIG_SYSVIPC_SYSCTL=y
 # CONFIG_POSIX_MQUEUE is not set
 # CONFIG_BSD_PROCESS_ACCT is not set
 # CONFIG_TASKSTATS is not set
-# CONFIG_UTS_NS is not set
+# CONFIG_USER_NS is not set
+# CONFIG_PID_NS is not set
 # CONFIG_AUDIT is not set
 # CONFIG_IKCONFIG is not set
+CONFIG_LOG_BUF_SHIFT=14
+# CONFIG_CGROUPS is not set
+CONFIG_FAIR_GROUP_SCHED=y
+CONFIG_FAIR_USER_SCHED=y
+# CONFIG_FAIR_CGROUP_SCHED is not set
 CONFIG_SYSFS_DEPRECATED=y
 # CONFIG_RELAY is not set
 CONFIG_BLK_DEV_INITRD=y
@@ -62,32 +66,30 @@ CONFIG_BUG=y
 CONFIG_ELF_CORE=y
 CONFIG_BASE_FULL=y
 CONFIG_FUTEX=y
+CONFIG_ANON_INODES=y
 CONFIG_EPOLL=y
+CONFIG_SIGNALFD=y
+CONFIG_EVENTFD=y
 CONFIG_SHMEM=y
-CONFIG_SLAB=y
 CONFIG_VM_EVENT_COUNTERS=y
+CONFIG_SLAB=y
+# CONFIG_SLUB is not set
+# CONFIG_SLOB is not set
+CONFIG_SLABINFO=y
 CONFIG_RT_MUTEXES=y
 # CONFIG_TINY_SHMEM is not set
 CONFIG_BASE_SMALL=0
-# CONFIG_SLOB is not set
-
-#
-# Loadable module support
-#
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
 # CONFIG_MODULE_FORCE_UNLOAD is not set
 # CONFIG_MODVERSIONS is not set
 # CONFIG_MODULE_SRCVERSION_ALL is not set
 CONFIG_KMOD=y
-
-#
-# Block layer
-#
 CONFIG_BLOCK=y
 # CONFIG_LBD is not set
 # CONFIG_BLK_DEV_IO_TRACE is not set
 # CONFIG_LSF is not set
+# CONFIG_BLK_DEV_BSG is not set
 
 #
 # IO Schedulers
@@ -119,14 +121,16 @@ CONFIG_ARCH_AT91=y
 # CONFIG_ARCH_NETX is not set
 # CONFIG_ARCH_H720X is not set
 # CONFIG_ARCH_IMX is not set
+# CONFIG_ARCH_IOP13XX is not set
 # CONFIG_ARCH_IOP32X is not set
 # CONFIG_ARCH_IOP33X is not set
-# CONFIG_ARCH_IOP13XX is not set
-# CONFIG_ARCH_IXP4XX is not set
-# CONFIG_ARCH_IXP2000 is not set
 # CONFIG_ARCH_IXP23XX is not set
+# CONFIG_ARCH_IXP2000 is not set
+# CONFIG_ARCH_IXP4XX is not set
 # CONFIG_ARCH_L7200 is not set
+# CONFIG_ARCH_KS8695 is not set
 # CONFIG_ARCH_NS9XXX is not set
+# CONFIG_ARCH_MXC is not set
 # CONFIG_ARCH_PNX4008 is not set
 # CONFIG_ARCH_PXA is not set
 # CONFIG_ARCH_RPC is not set
@@ -134,8 +138,17 @@ CONFIG_ARCH_AT91=y
 # CONFIG_ARCH_S3C2410 is not set
 # CONFIG_ARCH_SHARK is not set
 # CONFIG_ARCH_LH7A40X is not set
+# CONFIG_ARCH_DAVINCI is not set
 # CONFIG_ARCH_OMAP is not set
 
+#
+# Boot options
+#
+
+#
+# Power management
+#
+
 #
 # Atmel AT91 System-on-Chip
 #
@@ -144,6 +157,8 @@ CONFIG_ARCH_AT91=y
 # CONFIG_ARCH_AT91SAM9261 is not set
 # CONFIG_ARCH_AT91SAM9263 is not set
 CONFIG_ARCH_AT91SAM9RL=y
+# CONFIG_ARCH_AT91X40 is not set
+CONFIG_AT91_PMC_UNIT=y
 
 #
 # AT91SAM9RL Board Type
@@ -157,7 +172,9 @@ CONFIG_MACH_AT91SAM9RLEK=y
 #
 # AT91 Feature Selections
 #
-# CONFIG_AT91_PROGRAMMABLE_CLOCKS is not set
+CONFIG_AT91_PROGRAMMABLE_CLOCKS=y
+# CONFIG_ATMEL_TCLIB is not set
+CONFIG_AT91_TIMER_HZ=100
 
 #
 # Processor Type
@@ -185,15 +202,14 @@ CONFIG_CPU_CP15_MMU=y
 #
 # Bus support
 #
-
-#
-# PCCARD (PCMCIA/CardBus) support
-#
+# CONFIG_PCI_SYSCALL is not set
+# CONFIG_ARCH_SUPPORTS_MSI is not set
 # CONFIG_PCCARD is not set
 
 #
 # Kernel Features
 #
+# CONFIG_TICK_ONESHOT is not set
 # CONFIG_PREEMPT is not set
 # CONFIG_NO_IDLE_HZ is not set
 CONFIG_HZ=100
@@ -206,9 +222,12 @@ CONFIG_FLATMEM_MANUAL=y
 CONFIG_FLATMEM=y
 CONFIG_FLAT_NODE_MEM_MAP=y
 # CONFIG_SPARSEMEM_STATIC is not set
+# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
 CONFIG_SPLIT_PTLOCK_CPUS=4096
 # CONFIG_RESOURCES_64BIT is not set
 CONFIG_ZONE_DMA_FLAG=1
+CONFIG_BOUNCE=y
+CONFIG_VIRT_TO_BUS=y
 # CONFIG_LEDS is not set
 CONFIG_ALIGNMENT_TRAP=y
 
@@ -245,6 +264,7 @@ CONFIG_BINFMT_ELF=y
 # Power management options
 #
 # CONFIG_PM is not set
+CONFIG_SUSPEND_UP_POSSIBLE=y
 
 #
 # Networking
@@ -254,7 +274,6 @@ CONFIG_NET=y
 #
 # Networking options
 #
-# CONFIG_NETDEBUG is not set
 # CONFIG_PACKET is not set
 CONFIG_UNIX=y
 # CONFIG_NET_KEY is not set
@@ -271,10 +290,6 @@ CONFIG_UNIX=y
 # CONFIG_X25 is not set
 # CONFIG_LAPB is not set
 # CONFIG_WAN_ROUTER is not set
-
-#
-# QoS and/or fair queueing
-#
 # CONFIG_NET_SCHED is not set
 
 #
@@ -284,7 +299,16 @@ CONFIG_UNIX=y
 # CONFIG_HAMRADIO is not set
 # CONFIG_IRDA is not set
 # CONFIG_BT is not set
+
+#
+# Wireless
+#
+# CONFIG_CFG80211 is not set
+# CONFIG_WIRELESS_EXT is not set
+# CONFIG_MAC80211 is not set
 # CONFIG_IEEE80211 is not set
+# CONFIG_RFKILL is not set
+# CONFIG_NET_9P is not set
 
 #
 # Device Drivers
@@ -293,21 +317,14 @@ CONFIG_UNIX=y
 #
 # Generic Driver Options
 #
+CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
 CONFIG_STANDALONE=y
 CONFIG_PREVENT_FIRMWARE_BUILD=y
 # CONFIG_FW_LOADER is not set
 # CONFIG_DEBUG_DRIVER is not set
 # CONFIG_DEBUG_DEVRES is not set
 # CONFIG_SYS_HYPERVISOR is not set
-
-#
-# Connector - unified userspace <-> kernelspace linker
-#
 # CONFIG_CONNECTOR is not set
-
-#
-# Memory Technology Devices (MTD)
-#
 CONFIG_MTD=y
 # CONFIG_MTD_DEBUG is not set
 CONFIG_MTD_CONCAT=y
@@ -327,6 +344,7 @@ CONFIG_MTD_BLOCK=y
 # CONFIG_INFTL is not set
 # CONFIG_RFD_FTL is not set
 # CONFIG_SSFDC is not set
+# CONFIG_MTD_OOPS is not set
 
 #
 # RAM/ROM/Flash chip drivers
@@ -346,7 +364,6 @@ CONFIG_MTD_CFI_I2=y
 # CONFIG_MTD_RAM is not set
 # CONFIG_MTD_ROM is not set
 # CONFIG_MTD_ABSENT is not set
-# CONFIG_MTD_OBSOLETE_CHIPS is not set
 
 #
 # Mapping drivers for chip access
@@ -370,36 +387,23 @@ CONFIG_MTD_DATAFLASH=y
 # CONFIG_MTD_DOC2000 is not set
 # CONFIG_MTD_DOC2001 is not set
 # CONFIG_MTD_DOC2001PLUS is not set
-
-#
-# NAND Flash Device Drivers
-#
 CONFIG_MTD_NAND=y
 # CONFIG_MTD_NAND_VERIFY_WRITE is not set
 # CONFIG_MTD_NAND_ECC_SMC is not set
+# CONFIG_MTD_NAND_MUSEUM_IDS is not set
 CONFIG_MTD_NAND_IDS=y
 # CONFIG_MTD_NAND_DISKONCHIP is not set
 CONFIG_MTD_NAND_AT91=y
 # CONFIG_MTD_NAND_NANDSIM is not set
-
-#
-# OneNAND Flash Device Drivers
-#
+# CONFIG_MTD_NAND_PLATFORM is not set
 # CONFIG_MTD_ONENAND is not set
 
 #
-# Parallel port support
+# UBI - Unsorted block images
 #
+# CONFIG_MTD_UBI is not set
 # CONFIG_PARPORT is not set
-
-#
-# Plug and Play support
-#
-# CONFIG_PNPACPI is not set
-
-#
-# Block devices
-#
+CONFIG_BLK_DEV=y
 # CONFIG_BLK_DEV_COW_COMMON is not set
 CONFIG_BLK_DEV_LOOP=y
 # CONFIG_BLK_DEV_CRYPTOLOOP is not set
@@ -410,12 +414,16 @@ CONFIG_BLK_DEV_RAM_SIZE=24576
 CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
 # CONFIG_CDROM_PKTCDVD is not set
 # CONFIG_ATA_OVER_ETH is not set
+CONFIG_MISC_DEVICES=y
+# CONFIG_EEPROM_93CX6 is not set
+CONFIG_ATMEL_SSC=y
 
 #
 # SCSI device support
 #
 # CONFIG_RAID_ATTRS is not set
 CONFIG_SCSI=y
+CONFIG_SCSI_DMA=y
 # CONFIG_SCSI_TGT is not set
 # CONFIG_SCSI_NETLINK is not set
 CONFIG_SCSI_PROC_FS=y
@@ -437,6 +445,7 @@ CONFIG_SCSI_MULTI_LUN=y
 # CONFIG_SCSI_CONSTANTS is not set
 # CONFIG_SCSI_LOGGING is not set
 # CONFIG_SCSI_SCAN_ASYNC is not set
+CONFIG_SCSI_WAIT_SCAN=m
 
 #
 # SCSI Transports
@@ -444,47 +453,13 @@ CONFIG_SCSI_MULTI_LUN=y
 # CONFIG_SCSI_SPI_ATTRS is not set
 # CONFIG_SCSI_FC_ATTRS is not set
 # CONFIG_SCSI_ISCSI_ATTRS is not set
-# CONFIG_SCSI_SAS_ATTRS is not set
 # CONFIG_SCSI_SAS_LIBSAS is not set
-
-#
-# SCSI low-level drivers
-#
+# CONFIG_SCSI_SRP_ATTRS is not set
+CONFIG_SCSI_LOWLEVEL=y
 # CONFIG_SCSI_DEBUG is not set
-
-#
-# Serial ATA (prod) and Parallel ATA (experimental) drivers
-#
 # CONFIG_ATA is not set
-
-#
-# Multi-device support (RAID and LVM)
-#
 # CONFIG_MD is not set
-
-#
-# Fusion MPT device support
-#
-# CONFIG_FUSION is not set
-
-#
-# IEEE 1394 (FireWire) support
-#
-
-#
-# I2O device support
-#
-
-#
-# Network device support
-#
 # CONFIG_NETDEVICES is not set
-# CONFIG_NETPOLL is not set
-# CONFIG_NET_POLL_CONTROLLER is not set
-
-#
-# ISDN subsystem
-#
 # CONFIG_ISDN is not set
 
 #
@@ -492,6 +467,7 @@ CONFIG_SCSI_MULTI_LUN=y
 #
 CONFIG_INPUT=y
 # CONFIG_INPUT_FF_MEMLESS is not set
+# CONFIG_INPUT_POLLDEV is not set
 
 #
 # Userland interfaces
@@ -501,7 +477,6 @@ CONFIG_INPUT_MOUSEDEV=y
 CONFIG_INPUT_MOUSEDEV_SCREEN_X=320
 CONFIG_INPUT_MOUSEDEV_SCREEN_Y=240
 # CONFIG_INPUT_JOYDEV is not set
-# CONFIG_INPUT_TSDEV is not set
 CONFIG_INPUT_EVDEV=y
 # CONFIG_INPUT_EVBUG is not set
 
@@ -511,8 +486,10 @@ CONFIG_INPUT_EVDEV=y
 # CONFIG_INPUT_KEYBOARD is not set
 # CONFIG_INPUT_MOUSE is not set
 # CONFIG_INPUT_JOYSTICK is not set
+# CONFIG_INPUT_TABLET is not set
 CONFIG_INPUT_TOUCHSCREEN=y
 # CONFIG_TOUCHSCREEN_ADS7846 is not set
+# CONFIG_TOUCHSCREEN_FUJITSU is not set
 # CONFIG_TOUCHSCREEN_GUNZE is not set
 # CONFIG_TOUCHSCREEN_ELO is not set
 # CONFIG_TOUCHSCREEN_MTOUCH is not set
@@ -521,6 +498,7 @@ CONFIG_INPUT_TOUCHSCREEN=y
 # CONFIG_TOUCHSCREEN_TOUCHRIGHT is not set
 # CONFIG_TOUCHSCREEN_TOUCHWIN is not set
 # CONFIG_TOUCHSCREEN_UCB1400 is not set
+# CONFIG_TOUCHSCREEN_USB_COMPOSITE is not set
 # CONFIG_INPUT_MISC is not set
 
 #
@@ -554,37 +532,50 @@ CONFIG_SERIAL_CORE_CONSOLE=y
 CONFIG_UNIX98_PTYS=y
 CONFIG_LEGACY_PTYS=y
 CONFIG_LEGACY_PTY_COUNT=256
-
-#
-# IPMI
-#
 # CONFIG_IPMI_HANDLER is not set
-
-#
-# Watchdog Cards
-#
-CONFIG_WATCHDOG=y
-CONFIG_WATCHDOG_NOWAYOUT=y
-
-#
-# Watchdog Device Drivers
-#
-# CONFIG_SOFT_WATCHDOG is not set
-CONFIG_HW_RANDOM=y
+# CONFIG_HW_RANDOM is not set
 # CONFIG_NVRAM is not set
-# CONFIG_DTLK is not set
 # CONFIG_R3964 is not set
 # CONFIG_RAW_DRIVER is not set
+# CONFIG_TCG_TPM is not set
+CONFIG_I2C=y
+CONFIG_I2C_BOARDINFO=y
+CONFIG_I2C_CHARDEV=y
 
 #
-# TPM devices
+# I2C Algorithms
 #
-# CONFIG_TCG_TPM is not set
+CONFIG_I2C_ALGOBIT=y
+# CONFIG_I2C_ALGOPCF is not set
+# CONFIG_I2C_ALGOPCA is not set
 
 #
-# I2C support
+# I2C Hardware Bus support
 #
-# CONFIG_I2C is not set
+CONFIG_I2C_GPIO=y
+# CONFIG_I2C_OCORES is not set
+# CONFIG_I2C_PARPORT_LIGHT is not set
+# CONFIG_I2C_SIMTEC is not set
+# CONFIG_I2C_TAOS_EVM is not set
+# CONFIG_I2C_STUB is not set
+# CONFIG_I2C_PCA is not set
+
+#
+# Miscellaneous I2C Chip support
+#
+# CONFIG_SENSORS_DS1337 is not set
+# CONFIG_SENSORS_DS1374 is not set
+# CONFIG_DS1682 is not set
+# CONFIG_SENSORS_EEPROM is not set
+# CONFIG_SENSORS_PCF8574 is not set
+# CONFIG_SENSORS_PCA9539 is not set
+# CONFIG_SENSORS_PCF8591 is not set
+# CONFIG_SENSORS_MAX6875 is not set
+# CONFIG_SENSORS_TSL2550 is not set
+# CONFIG_I2C_DEBUG_CORE is not set
+# CONFIG_I2C_DEBUG_ALGO is not set
+# CONFIG_I2C_DEBUG_BUS is not set
+# CONFIG_I2C_DEBUG_CHIP is not set
 
 #
 # SPI support
@@ -603,59 +594,54 @@ CONFIG_SPI_ATMEL=y
 # SPI Protocol Masters
 #
 # CONFIG_SPI_AT25 is not set
-
-#
-# Dallas's 1-wire bus
-#
+# CONFIG_SPI_SPIDEV is not set
+# CONFIG_SPI_TLE62X0 is not set
 # CONFIG_W1 is not set
+# CONFIG_POWER_SUPPLY is not set
+# CONFIG_HWMON is not set
+CONFIG_WATCHDOG=y
+CONFIG_WATCHDOG_NOWAYOUT=y
 
 #
-# Hardware Monitoring support
+# Watchdog Device Drivers
 #
-# CONFIG_HWMON is not set
-# CONFIG_HWMON_VID is not set
+# CONFIG_SOFT_WATCHDOG is not set
+CONFIG_AT91SAM9_WATCHDOG=y
 
 #
-# Misc devices
+# Sonics Silicon Backplane
 #
+CONFIG_SSB_POSSIBLE=y
+# CONFIG_SSB is not set
 
 #
 # Multifunction device drivers
 #
 # CONFIG_MFD_SM501 is not set
 
-#
-# LED devices
-#
-# CONFIG_NEW_LEDS is not set
-
-#
-# LED drivers
-#
-
-#
-# LED Triggers
-#
-
 #
 # Multimedia devices
 #
 # CONFIG_VIDEO_DEV is not set
-
-#
-# Digital Video Broadcasting Devices
-#
+# CONFIG_DAB is not set
 
 #
 # Graphics support
 #
-# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
+# CONFIG_VGASTATE is not set
+# CONFIG_VIDEO_OUTPUT_CONTROL is not set
 CONFIG_FB=y
 # CONFIG_FIRMWARE_EDID is not set
 # CONFIG_FB_DDC is not set
 CONFIG_FB_CFB_FILLRECT=y
 CONFIG_FB_CFB_COPYAREA=y
 CONFIG_FB_CFB_IMAGEBLIT=y
+# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
+# CONFIG_FB_SYS_FILLRECT is not set
+# CONFIG_FB_SYS_COPYAREA is not set
+# CONFIG_FB_SYS_IMAGEBLIT is not set
+# CONFIG_FB_SYS_FOPS is not set
+CONFIG_FB_DEFERRED_IO=y
 # CONFIG_FB_SVGALIB is not set
 # CONFIG_FB_MACMODES is not set
 # CONFIG_FB_BACKLIGHT is not set
@@ -665,9 +651,16 @@ CONFIG_FB_CFB_IMAGEBLIT=y
 #
 # Frame buffer hardware drivers
 #
+# CONFIG_FB_S1D15605 is not set
 # CONFIG_FB_S1D13XXX is not set
 CONFIG_FB_ATMEL=y
 # CONFIG_FB_VIRTUAL is not set
+# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
+
+#
+# Display device support
+#
+# CONFIG_DISPLAY_SUPPORT is not set
 
 #
 # Console display driver support
@@ -675,97 +668,97 @@ CONFIG_FB_ATMEL=y
 # CONFIG_VGA_CONSOLE is not set
 CONFIG_DUMMY_CONSOLE=y
 # CONFIG_FRAMEBUFFER_CONSOLE is not set
-
-#
-# Logo configuration
-#
 # CONFIG_LOGO is not set
 
 #
 # Sound
 #
-CONFIG_SOUND=y
-
-#
-# Advanced Linux Sound Architecture
-#
-CONFIG_SND=y
-CONFIG_SND_TIMER=y
-CONFIG_SND_PCM=y
-CONFIG_SND_SEQUENCER=y
-CONFIG_SND_SEQ_DUMMY=y
-CONFIG_SND_OSSEMUL=y
-CONFIG_SND_MIXER_OSS=y
-CONFIG_SND_PCM_OSS=y
-CONFIG_SND_PCM_OSS_PLUGINS=y
-CONFIG_SND_SEQUENCER_OSS=y
-# CONFIG_SND_DYNAMIC_MINORS is not set
-CONFIG_SND_SUPPORT_OLD_API=y
-CONFIG_SND_VERBOSE_PROCFS=y
-CONFIG_SND_VERBOSE_PRINTK=y
-CONFIG_SND_DEBUG=y
-CONFIG_SND_DEBUG_DETECT=y
-# CONFIG_SND_PCM_XRUN_DEBUG is not set
-
-#
-# Generic devices
-#
-# CONFIG_SND_DUMMY is not set
-# CONFIG_SND_VIRMIDI is not set
-# CONFIG_SND_MTPAV is not set
-# CONFIG_SND_SERIAL_U16550 is not set
-# CONFIG_SND_MPU401 is not set
+# CONFIG_SOUND is not set
+CONFIG_HID_SUPPORT=y
+CONFIG_HID=y
+# CONFIG_HID_DEBUG is not set
+# CONFIG_HIDRAW is not set
+CONFIG_USB_SUPPORT=y
+CONFIG_USB_ARCH_HAS_HCD=y
+CONFIG_USB_ARCH_HAS_OHCI=y
+# CONFIG_USB_ARCH_HAS_EHCI is not set
+# CONFIG_USB is not set
 
 #
-# ALSA ARM devices
+# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
 #
 
 #
-# SoC audio support
+# USB Gadget Support
 #
-# CONFIG_SND_SOC is not set
+# CONFIG_USB_GADGET is not set
+CONFIG_MMC=y
+# CONFIG_MMC_DEBUG is not set
+# CONFIG_MMC_UNSAFE_RESUME is not set
 
 #
-# Open Sound System
+# MMC/SD Card Drivers
 #
-# CONFIG_SOUND_PRIME is not set
+CONFIG_MMC_BLOCK=y
+CONFIG_MMC_BLOCK_BOUNCE=y
+# CONFIG_SDIO_UART is not set
 
 #
-# HID Devices
+# MMC/SD Host Controller Drivers
 #
-CONFIG_HID=y
-# CONFIG_HID_DEBUG is not set
+CONFIG_MMC_AT91=y
+# CONFIG_MMC_SPI is not set
+# CONFIG_NEW_LEDS is not set
+CONFIG_RTC_LIB=y
+CONFIG_RTC_CLASS=y
+CONFIG_RTC_HCTOSYS=y
+CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
+# CONFIG_RTC_DEBUG is not set
 
 #
-# USB support
+# RTC interfaces
 #
-CONFIG_USB_ARCH_HAS_HCD=y
-CONFIG_USB_ARCH_HAS_OHCI=y
-# CONFIG_USB_ARCH_HAS_EHCI is not set
-# CONFIG_USB is not set
+CONFIG_RTC_INTF_SYSFS=y
+CONFIG_RTC_INTF_PROC=y
+CONFIG_RTC_INTF_DEV=y
+# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
+# CONFIG_RTC_DRV_TEST is not set
 
 #
-# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
+# I2C RTC drivers
 #
+# CONFIG_RTC_DRV_DS1307 is not set
+# CONFIG_RTC_DRV_DS1374 is not set
+# CONFIG_RTC_DRV_DS1672 is not set
+# CONFIG_RTC_DRV_MAX6900 is not set
+# CONFIG_RTC_DRV_RS5C372 is not set
+# CONFIG_RTC_DRV_ISL1208 is not set
+# CONFIG_RTC_DRV_X1205 is not set
+# CONFIG_RTC_DRV_PCF8563 is not set
+# CONFIG_RTC_DRV_PCF8583 is not set
+# CONFIG_RTC_DRV_M41T80 is not set
 
 #
-# USB Gadget Support
+# SPI RTC drivers
 #
-# CONFIG_USB_GADGET is not set
+# CONFIG_RTC_DRV_RS5C348 is not set
+# CONFIG_RTC_DRV_MAX6902 is not set
 
 #
-# MMC/SD Card support
+# Platform RTC drivers
 #
-CONFIG_MMC=y
-# CONFIG_MMC_DEBUG is not set
-CONFIG_MMC_BLOCK=y
-CONFIG_MMC_AT91=y
+# CONFIG_RTC_DRV_CMOS is not set
+# CONFIG_RTC_DRV_DS1553 is not set
+# CONFIG_RTC_DRV_STK17TA8 is not set
+# CONFIG_RTC_DRV_DS1742 is not set
+# CONFIG_RTC_DRV_M48T86 is not set
+# CONFIG_RTC_DRV_M48T59 is not set
+# CONFIG_RTC_DRV_V3020 is not set
 
 #
-# Real Time Clock
+# on-CPU RTC drivers
 #
-CONFIG_RTC_LIB=y
-# CONFIG_RTC_CLASS is not set
+CONFIG_RTC_DRV_AT91SAM9=y
 
 #
 # File systems
@@ -816,7 +809,6 @@ CONFIG_SYSFS=y
 CONFIG_TMPFS=y
 # CONFIG_TMPFS_POSIX_ACL is not set
 # CONFIG_HUGETLB_PAGE is not set
-CONFIG_RAMFS=y
 # CONFIG_CONFIGFS_FS is not set
 
 #
@@ -836,20 +828,13 @@ CONFIG_CRAMFS=y
 # CONFIG_QNX4FS_FS is not set
 # CONFIG_SYSV_FS is not set
 # CONFIG_UFS_FS is not set
-
-#
-# Network File Systems
-#
+CONFIG_NETWORK_FILESYSTEMS=y
 
 #
 # Partition Types
 #
 # CONFIG_PARTITION_ADVANCED is not set
 CONFIG_MSDOS_PARTITION=y
-
-#
-# Native Language Support
-#
 CONFIG_NLS=y
 CONFIG_NLS_DEFAULT="iso8859-1"
 CONFIG_NLS_CODEPAGE_437=y
@@ -890,16 +875,15 @@ CONFIG_NLS_ISO8859_15=y
 # CONFIG_NLS_KOI8_R is not set
 # CONFIG_NLS_KOI8_U is not set
 CONFIG_NLS_UTF8=y
-
-#
-# Profiling support
-#
+CONFIG_INSTRUMENTATION=y
 # CONFIG_PROFILING is not set
+# CONFIG_MARKERS is not set
 
 #
 # Kernel hacking
 #
 # CONFIG_PRINTK_TIME is not set
+CONFIG_ENABLE_WARN_DEPRECATED=y
 CONFIG_ENABLE_MUST_CHECK=y
 # CONFIG_MAGIC_SYSRQ is not set
 # CONFIG_UNUSED_SYMBOLS is not set
@@ -907,8 +891,8 @@ CONFIG_ENABLE_MUST_CHECK=y
 # CONFIG_HEADERS_CHECK is not set
 CONFIG_DEBUG_KERNEL=y
 # CONFIG_DEBUG_SHIRQ is not set
-CONFIG_LOG_BUF_SHIFT=14
 CONFIG_DETECT_SOFTLOCKUP=y
+CONFIG_SCHED_DEBUG=y
 # CONFIG_SCHEDSTATS is not set
 # CONFIG_TIMER_STATS is not set
 # CONFIG_DEBUG_SLAB is not set
@@ -916,6 +900,9 @@ CONFIG_DETECT_SOFTLOCKUP=y
 # CONFIG_RT_MUTEX_TESTER is not set
 # CONFIG_DEBUG_SPINLOCK is not set
 # CONFIG_DEBUG_MUTEXES is not set
+# CONFIG_DEBUG_LOCK_ALLOC is not set
+# CONFIG_PROVE_LOCKING is not set
+# CONFIG_LOCK_STAT is not set
 # CONFIG_DEBUG_SPINLOCK_SLEEP is not set
 # CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
 # CONFIG_DEBUG_KOBJECT is not set
@@ -923,10 +910,13 @@ CONFIG_DEBUG_BUGVERBOSE=y
 CONFIG_DEBUG_INFO=y
 # CONFIG_DEBUG_VM is not set
 # CONFIG_DEBUG_LIST is not set
+# CONFIG_DEBUG_SG is not set
 CONFIG_FRAME_POINTER=y
 CONFIG_FORCED_INLINING=y
+# CONFIG_BOOT_PRINTK_DELAY is not set
 # CONFIG_RCU_TORTURE_TEST is not set
 # CONFIG_FAULT_INJECTION is not set
+# CONFIG_SAMPLES is not set
 CONFIG_DEBUG_USER=y
 # CONFIG_DEBUG_ERRORS is not set
 CONFIG_DEBUG_LL=y
@@ -937,10 +927,7 @@ CONFIG_DEBUG_LL=y
 #
 # CONFIG_KEYS is not set
 # CONFIG_SECURITY is not set
-
-#
-# Cryptographic options
-#
+# CONFIG_SECURITY_FILE_CAPABILITIES is not set
 # CONFIG_CRYPTO is not set
 
 #
@@ -949,9 +936,12 @@ CONFIG_DEBUG_LL=y
 CONFIG_BITREVERSE=y
 # CONFIG_CRC_CCITT is not set
 # CONFIG_CRC16 is not set
+# CONFIG_CRC_ITU_T is not set
 CONFIG_CRC32=y
+# CONFIG_CRC7 is not set
 # CONFIG_LIBCRC32C is not set
 CONFIG_ZLIB_INFLATE=y
 CONFIG_PLIST=y
 CONFIG_HAS_IOMEM=y
 CONFIG_HAS_IOPORT=y
+CONFIG_HAS_DMA=y
index baa97698c744171069b92985e2c82a6dc8d4ba63..d846a492e5ce2a446f0c1017e1edd1ca891c067f 100644 (file)
@@ -714,7 +714,7 @@ CONFIG_I2C_ALGOPCA=m
 #
 # I2C Hardware Bus support
 #
-CONFIG_I2C_AT91=m
+CONFIG_I2C_GPIO=m
 # CONFIG_I2C_PARPORT_LIGHT is not set
 # CONFIG_I2C_STUB is not set
 # CONFIG_I2C_PCA_ISA is not set
diff --git a/arch/arm/configs/cam60_defconfig b/arch/arm/configs/cam60_defconfig
new file mode 100644 (file)
index 0000000..f3cd4a9
--- /dev/null
@@ -0,0 +1,1228 @@
+#
+# Automatically generated make config: don't edit
+# Linux kernel version: 2.6.24
+# Thu Mar  6 10:07:26 2008
+#
+CONFIG_ARM=y
+CONFIG_SYS_SUPPORTS_APM_EMULATION=y
+CONFIG_GENERIC_GPIO=y
+CONFIG_GENERIC_TIME=y
+CONFIG_GENERIC_CLOCKEVENTS=y
+CONFIG_MMU=y
+# CONFIG_NO_IOPORT is not set
+CONFIG_GENERIC_HARDIRQS=y
+CONFIG_STACKTRACE_SUPPORT=y
+CONFIG_LOCKDEP_SUPPORT=y
+CONFIG_TRACE_IRQFLAGS_SUPPORT=y
+CONFIG_HARDIRQS_SW_RESEND=y
+CONFIG_GENERIC_IRQ_PROBE=y
+CONFIG_RWSEM_GENERIC_SPINLOCK=y
+# CONFIG_ARCH_HAS_ILOG2_U32 is not set
+# CONFIG_ARCH_HAS_ILOG2_U64 is not set
+CONFIG_GENERIC_HWEIGHT=y
+CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_ZONE_DMA=y
+CONFIG_VECTORS_BASE=0xffff0000
+CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
+
+#
+# General setup
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_BROKEN_ON_SMP=y
+CONFIG_INIT_ENV_ARG_LIMIT=32
+CONFIG_LOCALVERSION=""
+# CONFIG_LOCALVERSION_AUTO is not set
+CONFIG_SWAP=y
+CONFIG_SYSVIPC=y
+CONFIG_SYSVIPC_SYSCTL=y
+CONFIG_POSIX_MQUEUE=y
+CONFIG_BSD_PROCESS_ACCT=y
+CONFIG_BSD_PROCESS_ACCT_V3=y
+# CONFIG_TASKSTATS is not set
+# CONFIG_USER_NS is not set
+# CONFIG_PID_NS is not set
+CONFIG_AUDIT=y
+CONFIG_IKCONFIG=y
+CONFIG_IKCONFIG_PROC=y
+CONFIG_LOG_BUF_SHIFT=17
+# CONFIG_CGROUPS is not set
+CONFIG_FAIR_GROUP_SCHED=y
+CONFIG_FAIR_USER_SCHED=y
+# CONFIG_FAIR_CGROUP_SCHED is not set
+CONFIG_SYSFS_DEPRECATED=y
+CONFIG_RELAY=y
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_INITRAMFS_SOURCE=""
+# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
+CONFIG_SYSCTL=y
+# CONFIG_EMBEDDED is not set
+CONFIG_UID16=y
+CONFIG_SYSCTL_SYSCALL=y
+CONFIG_KALLSYMS=y
+CONFIG_KALLSYMS_ALL=y
+# CONFIG_KALLSYMS_EXTRA_PASS is not set
+CONFIG_HOTPLUG=y
+CONFIG_PRINTK=y
+CONFIG_BUG=y
+CONFIG_ELF_CORE=y
+CONFIG_BASE_FULL=y
+CONFIG_FUTEX=y
+CONFIG_ANON_INODES=y
+CONFIG_EPOLL=y
+CONFIG_SIGNALFD=y
+CONFIG_EVENTFD=y
+CONFIG_SHMEM=y
+CONFIG_VM_EVENT_COUNTERS=y
+CONFIG_SLUB_DEBUG=y
+# CONFIG_SLAB is not set
+CONFIG_SLUB=y
+# CONFIG_SLOB is not set
+CONFIG_SLABINFO=y
+CONFIG_RT_MUTEXES=y
+# CONFIG_TINY_SHMEM is not set
+CONFIG_BASE_SMALL=0
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+# CONFIG_MODULE_FORCE_UNLOAD is not set
+CONFIG_MODVERSIONS=y
+# CONFIG_MODULE_SRCVERSION_ALL is not set
+# CONFIG_KMOD is not set
+CONFIG_BLOCK=y
+CONFIG_LBD=y
+CONFIG_BLK_DEV_IO_TRACE=y
+# CONFIG_LSF is not set
+# CONFIG_BLK_DEV_BSG is not set
+
+#
+# IO Schedulers
+#
+CONFIG_IOSCHED_NOOP=y
+CONFIG_IOSCHED_AS=y
+CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
+# CONFIG_DEFAULT_AS is not set
+# CONFIG_DEFAULT_DEADLINE is not set
+CONFIG_DEFAULT_CFQ=y
+# CONFIG_DEFAULT_NOOP is not set
+CONFIG_DEFAULT_IOSCHED="cfq"
+
+#
+# System Type
+#
+# CONFIG_ARCH_AAEC2000 is not set
+# CONFIG_ARCH_INTEGRATOR is not set
+# CONFIG_ARCH_REALVIEW is not set
+# CONFIG_ARCH_VERSATILE is not set
+CONFIG_ARCH_AT91=y
+# CONFIG_ARCH_CLPS7500 is not set
+# CONFIG_ARCH_CLPS711X is not set
+# CONFIG_ARCH_CO285 is not set
+# CONFIG_ARCH_EBSA110 is not set
+# CONFIG_ARCH_EP93XX is not set
+# CONFIG_ARCH_FOOTBRIDGE is not set
+# CONFIG_ARCH_NETX is not set
+# CONFIG_ARCH_H720X is not set
+# CONFIG_ARCH_IMX is not set
+# CONFIG_ARCH_IOP13XX is not set
+# CONFIG_ARCH_IOP32X is not set
+# CONFIG_ARCH_IOP33X is not set
+# CONFIG_ARCH_IXP23XX is not set
+# CONFIG_ARCH_IXP2000 is not set
+# CONFIG_ARCH_IXP4XX is not set
+# CONFIG_ARCH_L7200 is not set
+# CONFIG_ARCH_KS8695 is not set
+# CONFIG_ARCH_NS9XXX is not set
+# CONFIG_ARCH_MXC is not set
+# CONFIG_ARCH_PNX4008 is not set
+# CONFIG_ARCH_PXA is not set
+# CONFIG_ARCH_RPC is not set
+# CONFIG_ARCH_SA1100 is not set
+# CONFIG_ARCH_S3C2410 is not set
+# CONFIG_ARCH_SHARK is not set
+# CONFIG_ARCH_LH7A40X is not set
+# CONFIG_ARCH_DAVINCI is not set
+# CONFIG_ARCH_OMAP is not set
+
+#
+# Boot options
+#
+
+#
+# Power management
+#
+
+#
+# Atmel AT91 System-on-Chip
+#
+# CONFIG_ARCH_AT91RM9200 is not set
+CONFIG_ARCH_AT91SAM9260=y
+# CONFIG_ARCH_AT91SAM9261 is not set
+# CONFIG_ARCH_AT91SAM9263 is not set
+# CONFIG_ARCH_AT91SAM9RL is not set
+# CONFIG_ARCH_AT91CAP9 is not set
+# CONFIG_ARCH_AT91X40 is not set
+CONFIG_AT91_PMC_UNIT=y
+
+#
+# AT91SAM9260 Variants
+#
+# CONFIG_ARCH_AT91SAM9260_SAM9XE is not set
+
+#
+# AT91SAM9260 / AT91SAM9XE Board Type
+#
+# CONFIG_MACH_AT91SAM9260EK is not set
+CONFIG_MACH_CAM60=y
+# CONFIG_MACH_SAM9_L9260 is not set
+
+#
+# AT91 Board Options
+#
+
+#
+# AT91 Feature Selections
+#
+# CONFIG_AT91_PROGRAMMABLE_CLOCKS is not set
+CONFIG_AT91_TIMER_HZ=100
+CONFIG_AT91_EARLY_DBGU=y
+# CONFIG_AT91_EARLY_USART0 is not set
+# CONFIG_AT91_EARLY_USART1 is not set
+# CONFIG_AT91_EARLY_USART2 is not set
+# CONFIG_AT91_EARLY_USART3 is not set
+# CONFIG_AT91_EARLY_USART4 is not set
+# CONFIG_AT91_EARLY_USART5 is not set
+
+#
+# Processor Type
+#
+CONFIG_CPU_32=y
+CONFIG_CPU_ARM926T=y
+CONFIG_CPU_32v5=y
+CONFIG_CPU_ABRT_EV5TJ=y
+CONFIG_CPU_CACHE_VIVT=y
+CONFIG_CPU_COPY_V4WB=y
+CONFIG_CPU_TLB_V4WBI=y
+CONFIG_CPU_CP15=y
+CONFIG_CPU_CP15_MMU=y
+
+#
+# Processor Features
+#
+CONFIG_ARM_THUMB=y
+# CONFIG_CPU_ICACHE_DISABLE is not set
+# CONFIG_CPU_DCACHE_DISABLE is not set
+# CONFIG_CPU_DCACHE_WRITETHROUGH is not set
+# CONFIG_CPU_CACHE_ROUND_ROBIN is not set
+# CONFIG_OUTER_CACHE is not set
+
+#
+# Bus support
+#
+# CONFIG_PCI_SYSCALL is not set
+# CONFIG_ARCH_SUPPORTS_MSI is not set
+# CONFIG_PCCARD is not set
+
+#
+# Kernel Features
+#
+# CONFIG_TICK_ONESHOT is not set
+# CONFIG_NO_HZ is not set
+# CONFIG_HIGH_RES_TIMERS is not set
+CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
+# CONFIG_PREEMPT is not set
+CONFIG_HZ=100
+# CONFIG_AEABI is not set
+# CONFIG_ARCH_DISCONTIGMEM_ENABLE is not set
+CONFIG_SELECT_MEMORY_MODEL=y
+CONFIG_FLATMEM_MANUAL=y
+# CONFIG_DISCONTIGMEM_MANUAL is not set
+# CONFIG_SPARSEMEM_MANUAL is not set
+CONFIG_FLATMEM=y
+CONFIG_FLAT_NODE_MEM_MAP=y
+# CONFIG_SPARSEMEM_STATIC is not set
+# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
+CONFIG_SPLIT_PTLOCK_CPUS=4096
+# CONFIG_RESOURCES_64BIT is not set
+CONFIG_ZONE_DMA_FLAG=1
+CONFIG_BOUNCE=y
+CONFIG_VIRT_TO_BUS=y
+# CONFIG_LEDS is not set
+CONFIG_ALIGNMENT_TRAP=y
+
+#
+# Boot options
+#
+CONFIG_ZBOOT_ROM_TEXT=0
+CONFIG_ZBOOT_ROM_BSS=0x20004000
+# CONFIG_ZBOOT_ROM is not set
+CONFIG_CMDLINE="console=ttyS0,115200 noinitrd root=/dev/mtdblock0 rootfstype=jffs2 mem=64M"
+# CONFIG_XIP_KERNEL is not set
+# CONFIG_KEXEC is not set
+
+#
+# Floating point emulation
+#
+
+#
+# At least one emulation must be selected
+#
+CONFIG_FPE_NWFPE=y
+# CONFIG_FPE_NWFPE_XP is not set
+# CONFIG_FPE_FASTFPE is not set
+# CONFIG_VFP is not set
+
+#
+# Userspace binary formats
+#
+CONFIG_BINFMT_ELF=y
+CONFIG_BINFMT_AOUT=y
+CONFIG_BINFMT_MISC=y
+# CONFIG_ARTHUR is not set
+
+#
+# Power management options
+#
+# CONFIG_PM is not set
+CONFIG_SUSPEND_UP_POSSIBLE=y
+
+#
+# Networking
+#
+CONFIG_NET=y
+
+#
+# Networking options
+#
+CONFIG_PACKET=y
+# CONFIG_PACKET_MMAP is not set
+CONFIG_UNIX=y
+# CONFIG_NET_KEY is not set
+CONFIG_INET=y
+CONFIG_IP_MULTICAST=y
+# CONFIG_IP_ADVANCED_ROUTER is not set
+CONFIG_IP_FIB_HASH=y
+CONFIG_IP_PNP=y
+CONFIG_IP_PNP_DHCP=y
+# CONFIG_IP_PNP_BOOTP is not set
+# CONFIG_IP_PNP_RARP is not set
+# CONFIG_NET_IPIP is not set
+# CONFIG_NET_IPGRE is not set
+# CONFIG_IP_MROUTE is not set
+# CONFIG_ARPD is not set
+# CONFIG_SYN_COOKIES is not set
+# CONFIG_INET_AH is not set
+# CONFIG_INET_ESP is not set
+# CONFIG_INET_IPCOMP is not set
+# CONFIG_INET_XFRM_TUNNEL is not set
+# CONFIG_INET_TUNNEL is not set
+# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
+# CONFIG_INET_XFRM_MODE_TUNNEL is not set
+# CONFIG_INET_XFRM_MODE_BEET is not set
+# CONFIG_INET_LRO is not set
+# CONFIG_INET_DIAG is not set
+# CONFIG_TCP_CONG_ADVANCED is not set
+CONFIG_TCP_CONG_CUBIC=y
+CONFIG_DEFAULT_TCP_CONG="cubic"
+# CONFIG_TCP_MD5SIG is not set
+# CONFIG_IPV6 is not set
+# CONFIG_INET6_XFRM_TUNNEL is not set
+# CONFIG_INET6_TUNNEL is not set
+CONFIG_NETWORK_SECMARK=y
+# CONFIG_NETFILTER is not set
+# CONFIG_IP_DCCP is not set
+# CONFIG_IP_SCTP is not set
+# CONFIG_TIPC is not set
+# CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
+# CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
+# CONFIG_LLC2 is not set
+# CONFIG_IPX is not set
+# CONFIG_ATALK is not set
+# CONFIG_X25 is not set
+# CONFIG_LAPB is not set
+# CONFIG_ECONET is not set
+# CONFIG_WAN_ROUTER is not set
+# CONFIG_NET_SCHED is not set
+CONFIG_NET_SCH_FIFO=y
+
+#
+# Network testing
+#
+# CONFIG_NET_PKTGEN is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
+# CONFIG_AF_RXRPC is not set
+
+#
+# Wireless
+#
+CONFIG_CFG80211=m
+CONFIG_NL80211=y
+CONFIG_WIRELESS_EXT=y
+CONFIG_MAC80211=m
+CONFIG_MAC80211_RCSIMPLE=y
+# CONFIG_MAC80211_DEBUGFS is not set
+# CONFIG_MAC80211_DEBUG is not set
+CONFIG_IEEE80211=m
+# CONFIG_IEEE80211_DEBUG is not set
+CONFIG_IEEE80211_CRYPT_WEP=m
+CONFIG_IEEE80211_CRYPT_CCMP=m
+CONFIG_IEEE80211_CRYPT_TKIP=m
+CONFIG_IEEE80211_SOFTMAC=m
+# CONFIG_IEEE80211_SOFTMAC_DEBUG is not set
+# CONFIG_RFKILL is not set
+# CONFIG_NET_9P is not set
+
+#
+# Device Drivers
+#
+
+#
+# Generic Driver Options
+#
+CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
+CONFIG_STANDALONE=y
+CONFIG_PREVENT_FIRMWARE_BUILD=y
+# CONFIG_FW_LOADER is not set
+# CONFIG_DEBUG_DRIVER is not set
+# CONFIG_DEBUG_DEVRES is not set
+# CONFIG_SYS_HYPERVISOR is not set
+# CONFIG_CONNECTOR is not set
+CONFIG_MTD=y
+# CONFIG_MTD_DEBUG is not set
+CONFIG_MTD_CONCAT=y
+CONFIG_MTD_PARTITIONS=y
+# CONFIG_MTD_REDBOOT_PARTS is not set
+CONFIG_MTD_CMDLINE_PARTS=y
+# CONFIG_MTD_AFS_PARTS is not set
+
+#
+# User Modules And Translation Layers
+#
+CONFIG_MTD_CHAR=y
+CONFIG_MTD_BLKDEVS=y
+CONFIG_MTD_BLOCK=y
+# CONFIG_FTL is not set
+# CONFIG_NFTL is not set
+# CONFIG_INFTL is not set
+# CONFIG_RFD_FTL is not set
+# CONFIG_SSFDC is not set
+# CONFIG_MTD_OOPS is not set
+
+#
+# RAM/ROM/Flash chip drivers
+#
+CONFIG_MTD_CFI=y
+# CONFIG_MTD_JEDECPROBE is not set
+CONFIG_MTD_GEN_PROBE=y
+# CONFIG_MTD_CFI_ADV_OPTIONS is not set
+CONFIG_MTD_MAP_BANK_WIDTH_1=y
+CONFIG_MTD_MAP_BANK_WIDTH_2=y
+CONFIG_MTD_MAP_BANK_WIDTH_4=y
+# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
+CONFIG_MTD_CFI_I1=y
+CONFIG_MTD_CFI_I2=y
+# CONFIG_MTD_CFI_I4 is not set
+# CONFIG_MTD_CFI_I8 is not set
+# CONFIG_MTD_CFI_INTELEXT is not set
+# CONFIG_MTD_CFI_AMDSTD is not set
+# CONFIG_MTD_CFI_STAA is not set
+CONFIG_MTD_RAM=m
+# CONFIG_MTD_ROM is not set
+# CONFIG_MTD_ABSENT is not set
+
+#
+# Mapping drivers for chip access
+#
+CONFIG_MTD_COMPLEX_MAPPINGS=y
+# CONFIG_MTD_PHYSMAP is not set
+# CONFIG_MTD_ARM_INTEGRATOR is not set
+CONFIG_MTD_PLATRAM=m
+
+#
+# Self-contained MTD device drivers
+#
+CONFIG_MTD_DATAFLASH=y
+# CONFIG_MTD_M25P80 is not set
+# CONFIG_MTD_SLRAM is not set
+# CONFIG_MTD_PHRAM is not set
+# CONFIG_MTD_MTDRAM is not set
+# CONFIG_MTD_BLOCK2MTD is not set
+
+#
+# Disk-On-Chip Device Drivers
+#
+# CONFIG_MTD_DOC2000 is not set
+# CONFIG_MTD_DOC2001 is not set
+# CONFIG_MTD_DOC2001PLUS is not set
+CONFIG_MTD_NAND=y
+CONFIG_MTD_NAND_VERIFY_WRITE=y
+# CONFIG_MTD_NAND_ECC_SMC is not set
+# CONFIG_MTD_NAND_MUSEUM_IDS is not set
+CONFIG_MTD_NAND_IDS=y
+# CONFIG_MTD_NAND_DISKONCHIP is not set
+CONFIG_MTD_NAND_AT91=y
+# CONFIG_MTD_NAND_AT91_ECC_SOFT is not set
+CONFIG_MTD_NAND_AT91_ECC_HW=y
+# CONFIG_MTD_NAND_AT91_ECC_NONE is not set
+# CONFIG_MTD_NAND_NANDSIM is not set
+# CONFIG_MTD_NAND_PLATFORM is not set
+# CONFIG_MTD_ALAUDA is not set
+# CONFIG_MTD_ONENAND is not set
+
+#
+# UBI - Unsorted block images
+#
+# CONFIG_MTD_UBI is not set
+# CONFIG_PARPORT is not set
+CONFIG_BLK_DEV=y
+# CONFIG_BLK_DEV_COW_COMMON is not set
+CONFIG_BLK_DEV_LOOP=y
+# CONFIG_BLK_DEV_CRYPTOLOOP is not set
+# CONFIG_BLK_DEV_NBD is not set
+# CONFIG_BLK_DEV_UB is not set
+CONFIG_BLK_DEV_RAM=y
+CONFIG_BLK_DEV_RAM_COUNT=16
+CONFIG_BLK_DEV_RAM_SIZE=4096
+CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
+# CONFIG_CDROM_PKTCDVD is not set
+# CONFIG_ATA_OVER_ETH is not set
+# CONFIG_MISC_DEVICES is not set
+
+#
+# SCSI device support
+#
+# CONFIG_RAID_ATTRS is not set
+CONFIG_SCSI=y
+CONFIG_SCSI_DMA=y
+CONFIG_SCSI_TGT=y
+CONFIG_SCSI_NETLINK=y
+CONFIG_SCSI_PROC_FS=y
+
+#
+# SCSI support type (disk, tape, CD-ROM)
+#
+CONFIG_BLK_DEV_SD=y
+# CONFIG_CHR_DEV_ST is not set
+# CONFIG_CHR_DEV_OSST is not set
+# CONFIG_BLK_DEV_SR is not set
+CONFIG_CHR_DEV_SG=y
+CONFIG_CHR_DEV_SCH=y
+
+#
+# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
+#
+CONFIG_SCSI_MULTI_LUN=y
+# CONFIG_SCSI_CONSTANTS is not set
+CONFIG_SCSI_LOGGING=y
+CONFIG_SCSI_SCAN_ASYNC=y
+CONFIG_SCSI_WAIT_SCAN=m
+
+#
+# SCSI Transports
+#
+CONFIG_SCSI_SPI_ATTRS=m
+CONFIG_SCSI_FC_ATTRS=m
+# CONFIG_SCSI_FC_TGT_ATTRS is not set
+CONFIG_SCSI_ISCSI_ATTRS=m
+CONFIG_SCSI_SAS_ATTRS=m
+CONFIG_SCSI_SAS_LIBSAS=m
+# CONFIG_SCSI_SAS_LIBSAS_DEBUG is not set
+# CONFIG_SCSI_SRP_ATTRS is not set
+# CONFIG_SCSI_LOWLEVEL is not set
+# CONFIG_ATA is not set
+# CONFIG_MD is not set
+CONFIG_NETDEVICES=y
+# CONFIG_NETDEVICES_MULTIQUEUE is not set
+# CONFIG_DUMMY is not set
+# CONFIG_BONDING is not set
+# CONFIG_MACVLAN is not set
+# CONFIG_EQUALIZER is not set
+# CONFIG_TUN is not set
+# CONFIG_VETH is not set
+CONFIG_PHYLIB=y
+
+#
+# MII PHY device drivers
+#
+CONFIG_MARVELL_PHY=m
+CONFIG_DAVICOM_PHY=m
+CONFIG_QSEMI_PHY=m
+CONFIG_LXT_PHY=m
+CONFIG_CICADA_PHY=m
+CONFIG_VITESSE_PHY=m
+CONFIG_SMSC_PHY=m
+CONFIG_BROADCOM_PHY=m
+# CONFIG_ICPLUS_PHY is not set
+CONFIG_FIXED_PHY=m
+# CONFIG_FIXED_MII_10_FDX is not set
+# CONFIG_FIXED_MII_100_FDX is not set
+# CONFIG_FIXED_MII_1000_FDX is not set
+CONFIG_FIXED_MII_AMNT=1
+# CONFIG_MDIO_BITBANG is not set
+CONFIG_NET_ETHERNET=y
+CONFIG_MII=y
+CONFIG_MACB=y
+# CONFIG_AX88796 is not set
+# CONFIG_SMC91X is not set
+# CONFIG_DM9000 is not set
+# CONFIG_IBM_NEW_EMAC_ZMII is not set
+# CONFIG_IBM_NEW_EMAC_RGMII is not set
+# CONFIG_IBM_NEW_EMAC_TAH is not set
+# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
+# CONFIG_B44 is not set
+# CONFIG_NETDEV_1000 is not set
+# CONFIG_NETDEV_10000 is not set
+
+#
+# Wireless LAN
+#
+# CONFIG_WLAN_PRE80211 is not set
+# CONFIG_WLAN_80211 is not set
+
+#
+# USB Network Adapters
+#
+# CONFIG_USB_CATC is not set
+# CONFIG_USB_KAWETH is not set
+# CONFIG_USB_PEGASUS is not set
+# CONFIG_USB_RTL8150 is not set
+# CONFIG_USB_USBNET is not set
+# CONFIG_WAN is not set
+# CONFIG_PPP is not set
+# CONFIG_SLIP is not set
+# CONFIG_SHAPER is not set
+# CONFIG_NETCONSOLE is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_ISDN is not set
+
+#
+# Input device support
+#
+CONFIG_INPUT=y
+# CONFIG_INPUT_FF_MEMLESS is not set
+# CONFIG_INPUT_POLLDEV is not set
+
+#
+# Userland interfaces
+#
+CONFIG_INPUT_MOUSEDEV=y
+CONFIG_INPUT_MOUSEDEV_PSAUX=y
+CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
+CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
+# CONFIG_INPUT_JOYDEV is not set
+CONFIG_INPUT_EVDEV=y
+# CONFIG_INPUT_EVBUG is not set
+
+#
+# Input Device Drivers
+#
+CONFIG_INPUT_KEYBOARD=y
+CONFIG_KEYBOARD_ATKBD=y
+CONFIG_KEYBOARD_SUNKBD=m
+CONFIG_KEYBOARD_LKKBD=m
+CONFIG_KEYBOARD_XTKBD=m
+CONFIG_KEYBOARD_NEWTON=m
+CONFIG_KEYBOARD_STOWAWAY=m
+# CONFIG_KEYBOARD_GPIO is not set
+CONFIG_INPUT_MOUSE=y
+CONFIG_MOUSE_PS2=y
+CONFIG_MOUSE_PS2_ALPS=y
+CONFIG_MOUSE_PS2_LOGIPS2PP=y
+CONFIG_MOUSE_PS2_SYNAPTICS=y
+CONFIG_MOUSE_PS2_LIFEBOOK=y
+CONFIG_MOUSE_PS2_TRACKPOINT=y
+# CONFIG_MOUSE_PS2_TOUCHKIT is not set
+CONFIG_MOUSE_SERIAL=m
+CONFIG_MOUSE_APPLETOUCH=m
+CONFIG_MOUSE_VSXXXAA=m
+# CONFIG_MOUSE_GPIO is not set
+# CONFIG_INPUT_JOYSTICK is not set
+# CONFIG_INPUT_TABLET is not set
+# CONFIG_INPUT_TOUCHSCREEN is not set
+# CONFIG_INPUT_MISC is not set
+
+#
+# Hardware I/O ports
+#
+CONFIG_SERIO=y
+# CONFIG_SERIO_SERPORT is not set
+CONFIG_SERIO_LIBPS2=y
+# CONFIG_SERIO_RAW is not set
+# CONFIG_GAMEPORT is not set
+
+#
+# Character devices
+#
+CONFIG_VT=y
+CONFIG_VT_CONSOLE=y
+CONFIG_HW_CONSOLE=y
+CONFIG_VT_HW_CONSOLE_BINDING=y
+CONFIG_SERIAL_NONSTANDARD=y
+# CONFIG_MOXA_SMARTIO is not set
+# CONFIG_N_HDLC is not set
+# CONFIG_RISCOM8 is not set
+# CONFIG_SPECIALIX is not set
+# CONFIG_RIO is not set
+# CONFIG_STALDRV is not set
+
+#
+# Serial drivers
+#
+# CONFIG_SERIAL_8250 is not set
+
+#
+# Non-8250 serial port support
+#
+CONFIG_SERIAL_ATMEL=y
+CONFIG_SERIAL_ATMEL_CONSOLE=y
+# CONFIG_SERIAL_ATMEL_TTYAT is not set
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+CONFIG_UNIX98_PTYS=y
+# CONFIG_LEGACY_PTYS is not set
+# CONFIG_IPMI_HANDLER is not set
+CONFIG_HW_RANDOM=y
+# CONFIG_NVRAM is not set
+# CONFIG_R3964 is not set
+# CONFIG_RAW_DRIVER is not set
+# CONFIG_TCG_TPM is not set
+CONFIG_I2C=y
+CONFIG_I2C_BOARDINFO=y
+CONFIG_I2C_CHARDEV=y
+
+#
+# I2C Algorithms
+#
+CONFIG_I2C_ALGOBIT=y
+# CONFIG_I2C_ALGOPCF is not set
+# CONFIG_I2C_ALGOPCA is not set
+
+#
+# I2C Hardware Bus support
+#
+# CONFIG_I2C_GPIO is not set
+# CONFIG_I2C_OCORES is not set
+# CONFIG_I2C_PARPORT_LIGHT is not set
+# CONFIG_I2C_SIMTEC is not set
+# CONFIG_I2C_TAOS_EVM is not set
+# CONFIG_I2C_STUB is not set
+# CONFIG_I2C_TINY_USB is not set
+# CONFIG_I2C_PCA is not set
+
+#
+# Miscellaneous I2C Chip support
+#
+# CONFIG_SENSORS_DS1337 is not set
+# CONFIG_SENSORS_DS1374 is not set
+# CONFIG_DS1682 is not set
+# CONFIG_SENSORS_EEPROM is not set
+# CONFIG_SENSORS_PCF8574 is not set
+# CONFIG_SENSORS_PCA9539 is not set
+# CONFIG_SENSORS_PCF8591 is not set
+# CONFIG_SENSORS_MAX6875 is not set
+# CONFIG_SENSORS_TSL2550 is not set
+# CONFIG_I2C_DEBUG_CORE is not set
+# CONFIG_I2C_DEBUG_ALGO is not set
+# CONFIG_I2C_DEBUG_BUS is not set
+# CONFIG_I2C_DEBUG_CHIP is not set
+
+#
+# SPI support
+#
+CONFIG_SPI=y
+# CONFIG_SPI_DEBUG is not set
+CONFIG_SPI_MASTER=y
+
+#
+# SPI Master Controller Drivers
+#
+CONFIG_SPI_ATMEL=y
+# CONFIG_SPI_BITBANG is not set
+
+#
+# SPI Protocol Masters
+#
+# CONFIG_SPI_AT25 is not set
+# CONFIG_SPI_SPIDEV is not set
+# CONFIG_SPI_TLE62X0 is not set
+# CONFIG_W1 is not set
+# CONFIG_POWER_SUPPLY is not set
+# CONFIG_HWMON is not set
+# CONFIG_WATCHDOG is not set
+
+#
+# Sonics Silicon Backplane
+#
+CONFIG_SSB_POSSIBLE=y
+# CONFIG_SSB is not set
+
+#
+# Multifunction device drivers
+#
+# CONFIG_MFD_SM501 is not set
+
+#
+# Multimedia devices
+#
+# CONFIG_VIDEO_DEV is not set
+# CONFIG_DVB_CORE is not set
+# CONFIG_DAB is not set
+
+#
+# Graphics support
+#
+# CONFIG_VGASTATE is not set
+# CONFIG_VIDEO_OUTPUT_CONTROL is not set
+# CONFIG_FB is not set
+# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
+
+#
+# Display device support
+#
+# CONFIG_DISPLAY_SUPPORT is not set
+
+#
+# Console display driver support
+#
+# CONFIG_VGA_CONSOLE is not set
+CONFIG_DUMMY_CONSOLE=y
+
+#
+# Sound
+#
+# CONFIG_SOUND is not set
+# CONFIG_HID_SUPPORT is not set
+CONFIG_USB_SUPPORT=y
+CONFIG_USB_ARCH_HAS_HCD=y
+CONFIG_USB_ARCH_HAS_OHCI=y
+# CONFIG_USB_ARCH_HAS_EHCI is not set
+CONFIG_USB=y
+# CONFIG_USB_DEBUG is not set
+
+#
+# Miscellaneous USB options
+#
+CONFIG_USB_DEVICEFS=y
+CONFIG_USB_DEVICE_CLASS=y
+# CONFIG_USB_DYNAMIC_MINORS is not set
+# CONFIG_USB_OTG is not set
+
+#
+# USB Host Controller Drivers
+#
+# CONFIG_USB_ISP116X_HCD is not set
+CONFIG_USB_OHCI_HCD=y
+# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set
+# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set
+CONFIG_USB_OHCI_LITTLE_ENDIAN=y
+# CONFIG_USB_SL811_HCD is not set
+# CONFIG_USB_R8A66597_HCD is not set
+
+#
+# USB Device Class drivers
+#
+# CONFIG_USB_ACM is not set
+# CONFIG_USB_PRINTER is not set
+
+#
+# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
+#
+
+#
+# may also be needed; see USB_STORAGE Help for more information
+#
+CONFIG_USB_STORAGE=y
+# CONFIG_USB_STORAGE_DEBUG is not set
+# CONFIG_USB_STORAGE_DATAFAB is not set
+# CONFIG_USB_STORAGE_FREECOM is not set
+# CONFIG_USB_STORAGE_ISD200 is not set
+# CONFIG_USB_STORAGE_DPCM is not set
+# CONFIG_USB_STORAGE_USBAT is not set
+# CONFIG_USB_STORAGE_SDDR09 is not set
+# CONFIG_USB_STORAGE_SDDR55 is not set
+# CONFIG_USB_STORAGE_JUMPSHOT is not set
+# CONFIG_USB_STORAGE_ALAUDA is not set
+# CONFIG_USB_STORAGE_ONETOUCH is not set
+# CONFIG_USB_STORAGE_KARMA is not set
+CONFIG_USB_LIBUSUAL=y
+
+#
+# USB Imaging devices
+#
+# CONFIG_USB_MDC800 is not set
+# CONFIG_USB_MICROTEK is not set
+# CONFIG_USB_MON is not set
+
+#
+# USB port drivers
+#
+
+#
+# USB Serial Converter support
+#
+# CONFIG_USB_SERIAL is not set
+
+#
+# USB Miscellaneous drivers
+#
+# CONFIG_USB_EMI62 is not set
+# CONFIG_USB_EMI26 is not set
+# CONFIG_USB_ADUTUX is not set
+# CONFIG_USB_AUERSWALD is not set
+# CONFIG_USB_RIO500 is not set
+# CONFIG_USB_LEGOTOWER is not set
+# CONFIG_USB_LCD is not set
+# CONFIG_USB_BERRY_CHARGE is not set
+# CONFIG_USB_LED is not set
+# CONFIG_USB_CYPRESS_CY7C63 is not set
+# CONFIG_USB_CYTHERM is not set
+# CONFIG_USB_PHIDGET is not set
+# CONFIG_USB_IDMOUSE is not set
+# CONFIG_USB_FTDI_ELAN is not set
+# CONFIG_USB_APPLEDISPLAY is not set
+# CONFIG_USB_LD is not set
+# CONFIG_USB_TRANCEVIBRATOR is not set
+# CONFIG_USB_IOWARRIOR is not set
+# CONFIG_USB_TEST is not set
+
+#
+# USB DSL modem support
+#
+
+#
+# USB Gadget Support
+#
+# CONFIG_USB_GADGET is not set
+# CONFIG_MMC is not set
+# CONFIG_NEW_LEDS is not set
+CONFIG_RTC_LIB=y
+CONFIG_RTC_CLASS=y
+CONFIG_RTC_HCTOSYS=y
+CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
+# CONFIG_RTC_DEBUG is not set
+
+#
+# RTC interfaces
+#
+CONFIG_RTC_INTF_SYSFS=y
+CONFIG_RTC_INTF_PROC=y
+CONFIG_RTC_INTF_DEV=y
+CONFIG_RTC_INTF_DEV_UIE_EMUL=y
+CONFIG_RTC_DRV_TEST=m
+
+#
+# I2C RTC drivers
+#
+# CONFIG_RTC_DRV_DS1307 is not set
+# CONFIG_RTC_DRV_DS1374 is not set
+# CONFIG_RTC_DRV_DS1672 is not set
+# CONFIG_RTC_DRV_MAX6900 is not set
+# CONFIG_RTC_DRV_RS5C372 is not set
+# CONFIG_RTC_DRV_ISL1208 is not set
+# CONFIG_RTC_DRV_X1205 is not set
+# CONFIG_RTC_DRV_PCF8563 is not set
+# CONFIG_RTC_DRV_PCF8583 is not set
+# CONFIG_RTC_DRV_M41T80 is not set
+
+#
+# SPI RTC drivers
+#
+# CONFIG_RTC_DRV_RS5C348 is not set
+# CONFIG_RTC_DRV_MAX6902 is not set
+
+#
+# Platform RTC drivers
+#
+# CONFIG_RTC_DRV_CMOS is not set
+# CONFIG_RTC_DRV_DS1553 is not set
+# CONFIG_RTC_DRV_STK17TA8 is not set
+# CONFIG_RTC_DRV_DS1742 is not set
+# CONFIG_RTC_DRV_M48T86 is not set
+# CONFIG_RTC_DRV_M48T59 is not set
+# CONFIG_RTC_DRV_V3020 is not set
+
+#
+# on-CPU RTC drivers
+#
+CONFIG_RTC_DRV_AT91SAM9=y
+CONFIG_RTC_DRV_AT91SAM9_RTT=0
+CONFIG_RTC_DRV_AT91SAM9_GPBR=0
+
+#
+# File systems
+#
+CONFIG_EXT2_FS=y
+CONFIG_EXT2_FS_XATTR=y
+CONFIG_EXT2_FS_POSIX_ACL=y
+# CONFIG_EXT2_FS_SECURITY is not set
+# CONFIG_EXT2_FS_XIP is not set
+CONFIG_EXT3_FS=y
+CONFIG_EXT3_FS_XATTR=y
+# CONFIG_EXT3_FS_POSIX_ACL is not set
+# CONFIG_EXT3_FS_SECURITY is not set
+# CONFIG_EXT4DEV_FS is not set
+CONFIG_JBD=y
+# CONFIG_JBD_DEBUG is not set
+CONFIG_FS_MBCACHE=y
+# CONFIG_REISERFS_FS is not set
+# CONFIG_JFS_FS is not set
+CONFIG_FS_POSIX_ACL=y
+# CONFIG_XFS_FS is not set
+# CONFIG_GFS2_FS is not set
+# CONFIG_OCFS2_FS is not set
+# CONFIG_MINIX_FS is not set
+# CONFIG_ROMFS_FS is not set
+CONFIG_INOTIFY=y
+CONFIG_INOTIFY_USER=y
+CONFIG_QUOTA=y
+# CONFIG_QUOTA_NETLINK_INTERFACE is not set
+CONFIG_PRINT_QUOTA_WARNING=y
+# CONFIG_QFMT_V1 is not set
+# CONFIG_QFMT_V2 is not set
+CONFIG_QUOTACTL=y
+CONFIG_DNOTIFY=y
+CONFIG_AUTOFS_FS=y
+CONFIG_AUTOFS4_FS=y
+# CONFIG_FUSE_FS is not set
+
+#
+# CD-ROM/DVD Filesystems
+#
+# CONFIG_ISO9660_FS is not set
+# CONFIG_UDF_FS is not set
+
+#
+# DOS/FAT/NT Filesystems
+#
+CONFIG_FAT_FS=y
+CONFIG_MSDOS_FS=y
+CONFIG_VFAT_FS=y
+CONFIG_FAT_DEFAULT_CODEPAGE=437
+CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
+# CONFIG_NTFS_FS is not set
+
+#
+# Pseudo filesystems
+#
+CONFIG_PROC_FS=y
+CONFIG_PROC_SYSCTL=y
+CONFIG_SYSFS=y
+CONFIG_TMPFS=y
+# CONFIG_TMPFS_POSIX_ACL is not set
+# CONFIG_HUGETLB_PAGE is not set
+CONFIG_CONFIGFS_FS=y
+
+#
+# Miscellaneous filesystems
+#
+# CONFIG_ADFS_FS is not set
+# CONFIG_AFFS_FS is not set
+# CONFIG_HFS_FS is not set
+# CONFIG_HFSPLUS_FS is not set
+# CONFIG_BEFS_FS is not set
+# CONFIG_BFS_FS is not set
+# CONFIG_EFS_FS is not set
+CONFIG_YAFFS_FS=y
+CONFIG_YAFFS_YAFFS1=y
+# CONFIG_YAFFS_9BYTE_TAGS is not set
+# CONFIG_YAFFS_DOES_ECC is not set
+CONFIG_YAFFS_YAFFS2=y
+CONFIG_YAFFS_AUTO_YAFFS2=y
+# CONFIG_YAFFS_DISABLE_LAZY_LOAD is not set
+# CONFIG_YAFFS_DISABLE_WIDE_TNODES is not set
+# CONFIG_YAFFS_ALWAYS_CHECK_CHUNK_ERASED is not set
+CONFIG_YAFFS_SHORT_NAMES_IN_RAM=y
+# CONFIG_JFFS2_FS is not set
+# CONFIG_CRAMFS is not set
+# CONFIG_VXFS_FS is not set
+# CONFIG_HPFS_FS is not set
+# CONFIG_QNX4FS_FS is not set
+# CONFIG_SYSV_FS is not set
+# CONFIG_UFS_FS is not set
+CONFIG_NETWORK_FILESYSTEMS=y
+CONFIG_NFS_FS=y
+CONFIG_NFS_V3=y
+# CONFIG_NFS_V3_ACL is not set
+# CONFIG_NFS_V4 is not set
+# CONFIG_NFS_DIRECTIO is not set
+# CONFIG_NFSD is not set
+CONFIG_ROOT_NFS=y
+CONFIG_LOCKD=y
+CONFIG_LOCKD_V4=y
+CONFIG_NFS_COMMON=y
+CONFIG_SUNRPC=y
+# CONFIG_SUNRPC_BIND34 is not set
+# CONFIG_RPCSEC_GSS_KRB5 is not set
+# CONFIG_RPCSEC_GSS_SPKM3 is not set
+# CONFIG_SMB_FS is not set
+# CONFIG_CIFS is not set
+# CONFIG_NCP_FS is not set
+# CONFIG_CODA_FS is not set
+# CONFIG_AFS_FS is not set
+
+#
+# Partition Types
+#
+# CONFIG_PARTITION_ADVANCED is not set
+CONFIG_MSDOS_PARTITION=y
+CONFIG_NLS=y
+CONFIG_NLS_DEFAULT="cp437"
+CONFIG_NLS_CODEPAGE_437=y
+# CONFIG_NLS_CODEPAGE_737 is not set
+# CONFIG_NLS_CODEPAGE_775 is not set
+# CONFIG_NLS_CODEPAGE_850 is not set
+# CONFIG_NLS_CODEPAGE_852 is not set
+# CONFIG_NLS_CODEPAGE_855 is not set
+# CONFIG_NLS_CODEPAGE_857 is not set
+# CONFIG_NLS_CODEPAGE_860 is not set
+# CONFIG_NLS_CODEPAGE_861 is not set
+# CONFIG_NLS_CODEPAGE_862 is not set
+# CONFIG_NLS_CODEPAGE_863 is not set
+# CONFIG_NLS_CODEPAGE_864 is not set
+# CONFIG_NLS_CODEPAGE_865 is not set
+# CONFIG_NLS_CODEPAGE_866 is not set
+# CONFIG_NLS_CODEPAGE_869 is not set
+# CONFIG_NLS_CODEPAGE_936 is not set
+# CONFIG_NLS_CODEPAGE_950 is not set
+# CONFIG_NLS_CODEPAGE_932 is not set
+# CONFIG_NLS_CODEPAGE_949 is not set
+# CONFIG_NLS_CODEPAGE_874 is not set
+# CONFIG_NLS_ISO8859_8 is not set
+# CONFIG_NLS_CODEPAGE_1250 is not set
+# CONFIG_NLS_CODEPAGE_1251 is not set
+CONFIG_NLS_ASCII=y
+CONFIG_NLS_ISO8859_1=y
+# CONFIG_NLS_ISO8859_2 is not set
+# CONFIG_NLS_ISO8859_3 is not set
+# CONFIG_NLS_ISO8859_4 is not set
+# CONFIG_NLS_ISO8859_5 is not set
+# CONFIG_NLS_ISO8859_6 is not set
+# CONFIG_NLS_ISO8859_7 is not set
+# CONFIG_NLS_ISO8859_9 is not set
+# CONFIG_NLS_ISO8859_13 is not set
+# CONFIG_NLS_ISO8859_14 is not set
+# CONFIG_NLS_ISO8859_15 is not set
+# CONFIG_NLS_KOI8_R is not set
+# CONFIG_NLS_KOI8_U is not set
+CONFIG_NLS_UTF8=y
+# CONFIG_DLM is not set
+# CONFIG_INSTRUMENTATION is not set
+
+#
+# Kernel hacking
+#
+CONFIG_PRINTK_TIME=y
+CONFIG_ENABLE_WARN_DEPRECATED=y
+# CONFIG_ENABLE_MUST_CHECK is not set
+CONFIG_MAGIC_SYSRQ=y
+CONFIG_UNUSED_SYMBOLS=y
+CONFIG_DEBUG_FS=y
+# CONFIG_HEADERS_CHECK is not set
+CONFIG_DEBUG_KERNEL=y
+# CONFIG_DEBUG_SHIRQ is not set
+CONFIG_DETECT_SOFTLOCKUP=y
+CONFIG_SCHED_DEBUG=y
+# CONFIG_SCHEDSTATS is not set
+# CONFIG_TIMER_STATS is not set
+# CONFIG_SLUB_DEBUG_ON is not set
+# CONFIG_DEBUG_RT_MUTEXES is not set
+# CONFIG_RT_MUTEX_TESTER is not set
+# CONFIG_DEBUG_SPINLOCK is not set
+# CONFIG_DEBUG_MUTEXES is not set
+# CONFIG_DEBUG_LOCK_ALLOC is not set
+# CONFIG_PROVE_LOCKING is not set
+# CONFIG_LOCK_STAT is not set
+# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
+# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
+# CONFIG_DEBUG_KOBJECT is not set
+CONFIG_DEBUG_BUGVERBOSE=y
+# CONFIG_DEBUG_INFO is not set
+# CONFIG_DEBUG_VM is not set
+# CONFIG_DEBUG_LIST is not set
+# CONFIG_DEBUG_SG is not set
+CONFIG_FRAME_POINTER=y
+# CONFIG_FORCED_INLINING is not set
+# CONFIG_BOOT_PRINTK_DELAY is not set
+# CONFIG_RCU_TORTURE_TEST is not set
+# CONFIG_FAULT_INJECTION is not set
+# CONFIG_SAMPLES is not set
+# CONFIG_DEBUG_USER is not set
+# CONFIG_DEBUG_ERRORS is not set
+CONFIG_DEBUG_LL=y
+# CONFIG_DEBUG_ICEDCC is not set
+
+#
+# Security options
+#
+# CONFIG_KEYS is not set
+# CONFIG_SECURITY is not set
+# CONFIG_SECURITY_FILE_CAPABILITIES is not set
+CONFIG_CRYPTO=y
+CONFIG_CRYPTO_ALGAPI=y
+CONFIG_CRYPTO_ABLKCIPHER=m
+CONFIG_CRYPTO_BLKCIPHER=m
+CONFIG_CRYPTO_HASH=y
+CONFIG_CRYPTO_MANAGER=y
+CONFIG_CRYPTO_HMAC=y
+CONFIG_CRYPTO_XCBC=m
+CONFIG_CRYPTO_NULL=m
+# CONFIG_CRYPTO_MD4 is not set
+CONFIG_CRYPTO_MD5=y
+CONFIG_CRYPTO_SHA1=y
+CONFIG_CRYPTO_SHA256=y
+CONFIG_CRYPTO_SHA512=y
+CONFIG_CRYPTO_WP512=m
+CONFIG_CRYPTO_TGR192=m
+CONFIG_CRYPTO_GF128MUL=m
+CONFIG_CRYPTO_ECB=m
+CONFIG_CRYPTO_CBC=m
+CONFIG_CRYPTO_PCBC=m
+CONFIG_CRYPTO_LRW=m
+# CONFIG_CRYPTO_XTS is not set
+CONFIG_CRYPTO_CRYPTD=m
+CONFIG_CRYPTO_DES=y
+CONFIG_CRYPTO_FCRYPT=m
+CONFIG_CRYPTO_BLOWFISH=m
+CONFIG_CRYPTO_TWOFISH=m
+CONFIG_CRYPTO_TWOFISH_COMMON=m
+CONFIG_CRYPTO_SERPENT=m
+CONFIG_CRYPTO_AES=m
+CONFIG_CRYPTO_CAST5=m
+CONFIG_CRYPTO_CAST6=m
+CONFIG_CRYPTO_TEA=m
+CONFIG_CRYPTO_ARC4=m
+CONFIG_CRYPTO_KHAZAD=m
+CONFIG_CRYPTO_ANUBIS=m
+# CONFIG_CRYPTO_SEED is not set
+CONFIG_CRYPTO_DEFLATE=m
+CONFIG_CRYPTO_MICHAEL_MIC=m
+CONFIG_CRYPTO_CRC32C=m
+CONFIG_CRYPTO_CAMELLIA=m
+CONFIG_CRYPTO_TEST=m
+# CONFIG_CRYPTO_AUTHENC is not set
+# CONFIG_CRYPTO_HW is not set
+
+#
+# Library routines
+#
+CONFIG_BITREVERSE=m
+# CONFIG_CRC_CCITT is not set
+# CONFIG_CRC16 is not set
+# CONFIG_CRC_ITU_T is not set
+CONFIG_CRC32=m
+# CONFIG_CRC7 is not set
+CONFIG_LIBCRC32C=m
+CONFIG_AUDIT_GENERIC=y
+CONFIG_ZLIB_INFLATE=m
+CONFIG_ZLIB_DEFLATE=m
+CONFIG_PLIST=y
+CONFIG_HAS_IOMEM=y
+CONFIG_HAS_IOPORT=y
+CONFIG_HAS_DMA=y
index 88e5d28aeec72585b974590ed68601845852c8d5..67e65e4f0cdc884415b51773f701d6fbf09762dd 100644 (file)
@@ -1,69 +1,96 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.15
-# Mon Jan  9 21:51:31 2006
+# Linux kernel version: 2.6.24-rc7
+# Wed Jan  9 22:19:24 2008
 #
 CONFIG_ARM=y
+CONFIG_SYS_SUPPORTS_APM_EMULATION=y
+CONFIG_GENERIC_GPIO=y
+CONFIG_GENERIC_TIME=y
+CONFIG_GENERIC_CLOCKEVENTS=y
 CONFIG_MMU=y
-CONFIG_UID16=y
+# CONFIG_NO_IOPORT is not set
+CONFIG_GENERIC_HARDIRQS=y
+CONFIG_STACKTRACE_SUPPORT=y
+CONFIG_LOCKDEP_SUPPORT=y
+CONFIG_TRACE_IRQFLAGS_SUPPORT=y
+CONFIG_HARDIRQS_SW_RESEND=y
+CONFIG_GENERIC_IRQ_PROBE=y
 CONFIG_RWSEM_GENERIC_SPINLOCK=y
+# CONFIG_ARCH_HAS_ILOG2_U32 is not set
+# CONFIG_ARCH_HAS_ILOG2_U64 is not set
+CONFIG_GENERIC_HWEIGHT=y
 CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_ZONE_DMA=y
+CONFIG_VECTORS_BASE=0xffff0000
+CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
 
 #
-# Code maturity level options
+# General setup
 #
 CONFIG_EXPERIMENTAL=y
-CONFIG_CLEAN_COMPILE=y
 CONFIG_BROKEN_ON_SMP=y
 CONFIG_INIT_ENV_ARG_LIMIT=32
-
-#
-# General setup
-#
 CONFIG_LOCALVERSION=""
 CONFIG_LOCALVERSION_AUTO=y
 # CONFIG_SWAP is not set
 CONFIG_SYSVIPC=y
+CONFIG_SYSVIPC_SYSCTL=y
 # CONFIG_POSIX_MQUEUE is not set
 # CONFIG_BSD_PROCESS_ACCT is not set
-CONFIG_SYSCTL=y
+# CONFIG_TASKSTATS is not set
+# CONFIG_USER_NS is not set
+# CONFIG_PID_NS is not set
 # CONFIG_AUDIT is not set
-CONFIG_HOTPLUG=y
-CONFIG_KOBJECT_UEVENT=y
 # CONFIG_IKCONFIG is not set
+CONFIG_LOG_BUF_SHIFT=14
+# CONFIG_CGROUPS is not set
+CONFIG_FAIR_GROUP_SCHED=y
+CONFIG_FAIR_USER_SCHED=y
+# CONFIG_FAIR_CGROUP_SCHED is not set
+CONFIG_SYSFS_DEPRECATED=y
+# CONFIG_RELAY is not set
+CONFIG_BLK_DEV_INITRD=y
 CONFIG_INITRAMFS_SOURCE=""
 CONFIG_CC_OPTIMIZE_FOR_SIZE=y
+CONFIG_SYSCTL=y
 # CONFIG_EMBEDDED is not set
+CONFIG_UID16=y
+CONFIG_SYSCTL_SYSCALL=y
 CONFIG_KALLSYMS=y
 # CONFIG_KALLSYMS_ALL is not set
 # CONFIG_KALLSYMS_EXTRA_PASS is not set
+CONFIG_HOTPLUG=y
 CONFIG_PRINTK=y
 CONFIG_BUG=y
+CONFIG_ELF_CORE=y
 CONFIG_BASE_FULL=y
 CONFIG_FUTEX=y
+CONFIG_ANON_INODES=y
 CONFIG_EPOLL=y
+CONFIG_SIGNALFD=y
+CONFIG_EVENTFD=y
 CONFIG_SHMEM=y
-CONFIG_CC_ALIGN_FUNCTIONS=0
-CONFIG_CC_ALIGN_LABELS=0
-CONFIG_CC_ALIGN_LOOPS=0
-CONFIG_CC_ALIGN_JUMPS=0
+CONFIG_VM_EVENT_COUNTERS=y
+CONFIG_SLUB_DEBUG=y
+# CONFIG_SLAB is not set
+CONFIG_SLUB=y
+# CONFIG_SLOB is not set
+CONFIG_SLABINFO=y
+CONFIG_RT_MUTEXES=y
 # CONFIG_TINY_SHMEM is not set
 CONFIG_BASE_SMALL=0
-
-#
-# Loadable module support
-#
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
 # CONFIG_MODULE_FORCE_UNLOAD is not set
-CONFIG_OBSOLETE_MODPARM=y
 # CONFIG_MODVERSIONS is not set
 # CONFIG_MODULE_SRCVERSION_ALL is not set
 CONFIG_KMOD=y
-
-#
-# Block layer
-#
+CONFIG_BLOCK=y
+# CONFIG_LBD is not set
+# CONFIG_BLK_DEV_IO_TRACE is not set
+# CONFIG_LSF is not set
+# CONFIG_BLK_DEV_BSG is not set
 
 #
 # IO Schedulers
@@ -81,62 +108,101 @@ CONFIG_DEFAULT_IOSCHED="anticipatory"
 #
 # System Type
 #
+# CONFIG_ARCH_AAEC2000 is not set
+# CONFIG_ARCH_INTEGRATOR is not set
+# CONFIG_ARCH_REALVIEW is not set
+# CONFIG_ARCH_VERSATILE is not set
+CONFIG_ARCH_AT91=y
 # CONFIG_ARCH_CLPS7500 is not set
 # CONFIG_ARCH_CLPS711X is not set
 # CONFIG_ARCH_CO285 is not set
 # CONFIG_ARCH_EBSA110 is not set
+# CONFIG_ARCH_EP93XX is not set
 # CONFIG_ARCH_FOOTBRIDGE is not set
-# CONFIG_ARCH_INTEGRATOR is not set
-# CONFIG_ARCH_IOP3XX is not set
-# CONFIG_ARCH_IXP4XX is not set
+# CONFIG_ARCH_NETX is not set
+# CONFIG_ARCH_H720X is not set
+# CONFIG_ARCH_IMX is not set
+# CONFIG_ARCH_IOP13XX is not set
+# CONFIG_ARCH_IOP32X is not set
+# CONFIG_ARCH_IOP33X is not set
+# CONFIG_ARCH_IXP23XX is not set
 # CONFIG_ARCH_IXP2000 is not set
+# CONFIG_ARCH_IXP4XX is not set
 # CONFIG_ARCH_L7200 is not set
+# CONFIG_ARCH_KS8695 is not set
+# CONFIG_ARCH_NS9XXX is not set
+# CONFIG_ARCH_MXC is not set
+# CONFIG_ARCH_PNX4008 is not set
 # CONFIG_ARCH_PXA is not set
 # CONFIG_ARCH_RPC is not set
 # CONFIG_ARCH_SA1100 is not set
 # CONFIG_ARCH_S3C2410 is not set
 # CONFIG_ARCH_SHARK is not set
 # CONFIG_ARCH_LH7A40X is not set
+# CONFIG_ARCH_DAVINCI is not set
 # CONFIG_ARCH_OMAP is not set
-# CONFIG_ARCH_VERSATILE is not set
-# CONFIG_ARCH_REALVIEW is not set
-# CONFIG_ARCH_IMX is not set
-# CONFIG_ARCH_H720X is not set
-# CONFIG_ARCH_AAEC2000 is not set
-CONFIG_ARCH_AT91=y
-CONFIG_ARCH_AT91RM9200=y
 
 #
-# AT91RM9200 Implementations
+# Boot options
 #
 
+#
+# Power management
+#
+
+#
+# Atmel AT91 System-on-Chip
+#
+CONFIG_ARCH_AT91RM9200=y
+# CONFIG_ARCH_AT91SAM9260 is not set
+# CONFIG_ARCH_AT91SAM9261 is not set
+# CONFIG_ARCH_AT91SAM9263 is not set
+# CONFIG_ARCH_AT91SAM9RL is not set
+# CONFIG_ARCH_AT91X40 is not set
+CONFIG_AT91_PMC_UNIT=y
+
 #
 # AT91RM9200 Board Type
 #
+# CONFIG_MACH_ONEARM is not set
 # CONFIG_ARCH_AT91RM9200DK is not set
 # CONFIG_MACH_AT91RM9200EK is not set
 CONFIG_MACH_CSB337=y
 # CONFIG_MACH_CSB637 is not set
 # CONFIG_MACH_CARMEVA is not set
-# CONFIG_MACH_KB9200 is not set
 # CONFIG_MACH_ATEB9200 is not set
+# CONFIG_MACH_KB9200 is not set
+# CONFIG_MACH_PICOTUX2XX is not set
+# CONFIG_MACH_KAFA is not set
+# CONFIG_MACH_CHUB is not set
+# CONFIG_MACH_HOMEMATIC is not set
+# CONFIG_MACH_ECBAT91 is not set
+# CONFIG_MACH_SWEDATMS is not set
+
+#
+# AT91 Board Options
+#
 
 #
-# AT91RM9200 Feature Selections
+# AT91 Feature Selections
 #
 CONFIG_AT91_PROGRAMMABLE_CLOCKS=y
+# CONFIG_ATMEL_TCLIB is not set
+CONFIG_AT91_TIMER_HZ=128
 
 #
 # Processor Type
 #
 CONFIG_CPU_32=y
 CONFIG_CPU_ARM920T=y
-CONFIG_CPU_32v4=y
+CONFIG_CPU_32v4T=y
 CONFIG_CPU_ABRT_EV4T=y
 CONFIG_CPU_CACHE_V4WT=y
 CONFIG_CPU_CACHE_VIVT=y
 CONFIG_CPU_COPY_V4WB=y
 CONFIG_CPU_TLB_V4WBI=y
+CONFIG_CPU_CP15=y
+CONFIG_CPU_CP15_MMU=y
 
 #
 # Processor Features
@@ -145,15 +211,13 @@ CONFIG_CPU_TLB_V4WBI=y
 # CONFIG_CPU_ICACHE_DISABLE is not set
 # CONFIG_CPU_DCACHE_DISABLE is not set
 # CONFIG_CPU_DCACHE_WRITETHROUGH is not set
+# CONFIG_OUTER_CACHE is not set
 
 #
 # Bus support
 #
-CONFIG_ISA_DMA_API=y
-
-#
-# PCCARD (PCMCIA/CardBus) support
-#
+# CONFIG_PCI_SYSCALL is not set
+# CONFIG_ARCH_SUPPORTS_MSI is not set
 CONFIG_PCCARD=y
 # CONFIG_PCMCIA_DEBUG is not set
 CONFIG_PCMCIA=y
@@ -168,8 +232,13 @@ CONFIG_AT91_CF=y
 #
 # Kernel Features
 #
+# CONFIG_TICK_ONESHOT is not set
+# CONFIG_NO_HZ is not set
+# CONFIG_HIGH_RES_TIMERS is not set
+CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
 # CONFIG_PREEMPT is not set
-# CONFIG_NO_IDLE_HZ is not set
+CONFIG_HZ=128
+# CONFIG_AEABI is not set
 # CONFIG_ARCH_DISCONTIGMEM_ENABLE is not set
 CONFIG_SELECT_MEMORY_MODEL=y
 CONFIG_FLATMEM_MANUAL=y
@@ -178,9 +247,13 @@ CONFIG_FLATMEM_MANUAL=y
 CONFIG_FLATMEM=y
 CONFIG_FLAT_NODE_MEM_MAP=y
 # CONFIG_SPARSEMEM_STATIC is not set
+# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
 CONFIG_SPLIT_PTLOCK_CPUS=4096
+# CONFIG_RESOURCES_64BIT is not set
+CONFIG_ZONE_DMA_FLAG=1
+CONFIG_BOUNCE=y
+CONFIG_VIRT_TO_BUS=y
 CONFIG_LEDS=y
-CONFIG_LEDS_TIMER=y
 CONFIG_LEDS_CPU=y
 CONFIG_ALIGNMENT_TRAP=y
 
@@ -191,6 +264,7 @@ CONFIG_ZBOOT_ROM_TEXT=0x0
 CONFIG_ZBOOT_ROM_BSS=0x0
 CONFIG_CMDLINE="mem=32M console=ttyS0,38400 initrd=0x20410000,3145728 root=/dev/ram0 rw"
 # CONFIG_XIP_KERNEL is not set
+# CONFIG_KEXEC is not set
 
 #
 # Floating point emulation
@@ -215,6 +289,7 @@ CONFIG_BINFMT_ELF=y
 # Power management options
 #
 # CONFIG_PM is not set
+CONFIG_SUSPEND_UP_POSSIBLE=y
 
 #
 # Networking
@@ -227,6 +302,10 @@ CONFIG_NET=y
 CONFIG_PACKET=y
 # CONFIG_PACKET_MMAP is not set
 CONFIG_UNIX=y
+CONFIG_XFRM=y
+# CONFIG_XFRM_USER is not set
+# CONFIG_XFRM_SUB_POLICY is not set
+# CONFIG_XFRM_MIGRATE is not set
 # CONFIG_NET_KEY is not set
 CONFIG_INET=y
 # CONFIG_IP_MULTICAST is not set
@@ -243,23 +322,26 @@ CONFIG_IP_PNP_BOOTP=y
 # CONFIG_INET_AH is not set
 # CONFIG_INET_ESP is not set
 # CONFIG_INET_IPCOMP is not set
+# CONFIG_INET_XFRM_TUNNEL is not set
 # CONFIG_INET_TUNNEL is not set
+CONFIG_INET_XFRM_MODE_TRANSPORT=y
+CONFIG_INET_XFRM_MODE_TUNNEL=y
+CONFIG_INET_XFRM_MODE_BEET=y
+# CONFIG_INET_LRO is not set
 CONFIG_INET_DIAG=y
 CONFIG_INET_TCP_DIAG=y
 # CONFIG_TCP_CONG_ADVANCED is not set
-CONFIG_TCP_CONG_BIC=y
+CONFIG_TCP_CONG_CUBIC=y
+CONFIG_DEFAULT_TCP_CONG="cubic"
+# CONFIG_TCP_MD5SIG is not set
 # CONFIG_IPV6 is not set
+# CONFIG_INET6_XFRM_TUNNEL is not set
+# CONFIG_INET6_TUNNEL is not set
+# CONFIG_NETWORK_SECMARK is not set
 # CONFIG_NETFILTER is not set
-
-#
-# DCCP Configuration (EXPERIMENTAL)
-#
 # CONFIG_IP_DCCP is not set
-
-#
-# SCTP Configuration (EXPERIMENTAL)
-#
 # CONFIG_IP_SCTP is not set
+# CONFIG_TIPC is not set
 # CONFIG_ATM is not set
 # CONFIG_BRIDGE is not set
 # CONFIG_VLAN_8021Q is not set
@@ -269,13 +351,8 @@ CONFIG_TCP_CONG_BIC=y
 # CONFIG_ATALK is not set
 # CONFIG_X25 is not set
 # CONFIG_LAPB is not set
-# CONFIG_NET_DIVERT is not set
 # CONFIG_ECONET is not set
 # CONFIG_WAN_ROUTER is not set
-
-#
-# QoS and/or fair queueing
-#
 # CONFIG_NET_SCHED is not set
 
 #
@@ -285,7 +362,17 @@ CONFIG_TCP_CONG_BIC=y
 # CONFIG_HAMRADIO is not set
 # CONFIG_IRDA is not set
 # CONFIG_BT is not set
+# CONFIG_AF_RXRPC is not set
+
+#
+# Wireless
+#
+# CONFIG_CFG80211 is not set
+# CONFIG_WIRELESS_EXT is not set
+# CONFIG_MAC80211 is not set
 # CONFIG_IEEE80211 is not set
+# CONFIG_RFKILL is not set
+# CONFIG_NET_9P is not set
 
 #
 # Device Drivers
@@ -294,19 +381,14 @@ CONFIG_TCP_CONG_BIC=y
 #
 # Generic Driver Options
 #
+CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
 CONFIG_STANDALONE=y
 CONFIG_PREVENT_FIRMWARE_BUILD=y
 CONFIG_FW_LOADER=y
 # CONFIG_DEBUG_DRIVER is not set
-
-#
-# Connector - unified userspace <-> kernelspace linker
-#
+# CONFIG_DEBUG_DEVRES is not set
+# CONFIG_SYS_HYPERVISOR is not set
 # CONFIG_CONNECTOR is not set
-
-#
-# Memory Technology Devices (MTD)
-#
 CONFIG_MTD=y
 # CONFIG_MTD_DEBUG is not set
 # CONFIG_MTD_CONCAT is not set
@@ -319,11 +401,14 @@ CONFIG_MTD_CMDLINE_PARTS=y
 # User Modules And Translation Layers
 #
 CONFIG_MTD_CHAR=y
+CONFIG_MTD_BLKDEVS=y
 CONFIG_MTD_BLOCK=y
 # CONFIG_FTL is not set
 # CONFIG_NFTL is not set
 # CONFIG_INFTL is not set
 # CONFIG_RFD_FTL is not set
+# CONFIG_SSFDC is not set
+# CONFIG_MTD_OOPS is not set
 
 #
 # RAM/ROM/Flash chip drivers
@@ -349,15 +434,14 @@ CONFIG_MTD_CFI_UTIL=y
 # CONFIG_MTD_RAM is not set
 # CONFIG_MTD_ROM is not set
 # CONFIG_MTD_ABSENT is not set
-# CONFIG_MTD_XIP is not set
 
 #
 # Mapping drivers for chip access
 #
 # CONFIG_MTD_COMPLEX_MAPPINGS is not set
 CONFIG_MTD_PHYSMAP=y
-CONFIG_MTD_PHYSMAP_START=0
-CONFIG_MTD_PHYSMAP_LEN=0
+CONFIG_MTD_PHYSMAP_START=0x0
+CONFIG_MTD_PHYSMAP_LEN=0x0
 CONFIG_MTD_PHYSMAP_BANKWIDTH=0
 # CONFIG_MTD_ARM_INTEGRATOR is not set
 # CONFIG_MTD_PLATRAM is not set
@@ -368,7 +452,6 @@ CONFIG_MTD_PHYSMAP_BANKWIDTH=0
 # CONFIG_MTD_SLRAM is not set
 # CONFIG_MTD_PHRAM is not set
 # CONFIG_MTD_MTDRAM is not set
-# CONFIG_MTD_BLKMTD is not set
 # CONFIG_MTD_BLOCK2MTD is not set
 
 #
@@ -378,29 +461,15 @@ CONFIG_MTD_PHYSMAP_BANKWIDTH=0
 # CONFIG_MTD_DOC2001 is not set
 # CONFIG_MTD_DOC2001PLUS is not set
 # CONFIG_MTD_AT91_DATAFLASH is not set
-
-#
-# NAND Flash Device Drivers
-#
 # CONFIG_MTD_NAND is not set
-
-#
-# OneNAND Flash Device Drivers
-#
 # CONFIG_MTD_ONENAND is not set
 
 #
-# Parallel port support
+# UBI - Unsorted block images
 #
+# CONFIG_MTD_UBI is not set
 # CONFIG_PARPORT is not set
-
-#
-# Plug and Play support
-#
-
-#
-# Block devices
-#
+CONFIG_BLK_DEV=y
 # CONFIG_BLK_DEV_COW_COMMON is not set
 CONFIG_BLK_DEV_LOOP=y
 # CONFIG_BLK_DEV_CRYPTOLOOP is not set
@@ -409,13 +478,12 @@ CONFIG_BLK_DEV_LOOP=y
 CONFIG_BLK_DEV_RAM=y
 CONFIG_BLK_DEV_RAM_COUNT=16
 CONFIG_BLK_DEV_RAM_SIZE=8192
-CONFIG_BLK_DEV_INITRD=y
+CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
 # CONFIG_CDROM_PKTCDVD is not set
 # CONFIG_ATA_OVER_ETH is not set
-
-#
-# ATA/ATAPI/MFM/RLL support
-#
+CONFIG_MISC_DEVICES=y
+# CONFIG_EEPROM_93CX6 is not set
+CONFIG_ATMEL_SSC=y
 # CONFIG_IDE is not set
 
 #
@@ -423,6 +491,9 @@ CONFIG_BLK_DEV_INITRD=y
 #
 # CONFIG_RAID_ATTRS is not set
 CONFIG_SCSI=y
+CONFIG_SCSI_DMA=y
+# CONFIG_SCSI_TGT is not set
+# CONFIG_SCSI_NETLINK is not set
 CONFIG_SCSI_PROC_FS=y
 
 #
@@ -441,97 +512,61 @@ CONFIG_SCSI_PROC_FS=y
 # CONFIG_SCSI_MULTI_LUN is not set
 # CONFIG_SCSI_CONSTANTS is not set
 # CONFIG_SCSI_LOGGING is not set
+# CONFIG_SCSI_SCAN_ASYNC is not set
+CONFIG_SCSI_WAIT_SCAN=m
 
 #
-# SCSI Transport Attributes
+# SCSI Transports
 #
 # CONFIG_SCSI_SPI_ATTRS is not set
 # CONFIG_SCSI_FC_ATTRS is not set
 # CONFIG_SCSI_ISCSI_ATTRS is not set
-# CONFIG_SCSI_SAS_ATTRS is not set
-
-#
-# SCSI low-level drivers
-#
+# CONFIG_SCSI_SAS_LIBSAS is not set
+# CONFIG_SCSI_SRP_ATTRS is not set
+CONFIG_SCSI_LOWLEVEL=y
 # CONFIG_ISCSI_TCP is not set
-# CONFIG_SCSI_SATA is not set
 # CONFIG_SCSI_DEBUG is not set
-
-#
-# PCMCIA SCSI adapter support
-#
-# CONFIG_PCMCIA_AHA152X is not set
-# CONFIG_PCMCIA_FDOMAIN is not set
-# CONFIG_PCMCIA_NINJA_SCSI is not set
-# CONFIG_PCMCIA_QLOGIC is not set
-# CONFIG_PCMCIA_SYM53C500 is not set
-
-#
-# Multi-device support (RAID and LVM)
-#
+# CONFIG_SCSI_LOWLEVEL_PCMCIA is not set
+# CONFIG_ATA is not set
 # CONFIG_MD is not set
-
-#
-# Fusion MPT device support
-#
-# CONFIG_FUSION is not set
-
-#
-# IEEE 1394 (FireWire) support
-#
-
-#
-# I2O device support
-#
-
-#
-# Network device support
-#
 CONFIG_NETDEVICES=y
+# CONFIG_NETDEVICES_MULTIQUEUE is not set
 # CONFIG_DUMMY is not set
 # CONFIG_BONDING is not set
+# CONFIG_MACVLAN is not set
 # CONFIG_EQUALIZER is not set
 # CONFIG_TUN is not set
-
-#
-# PHY device support
-#
+# CONFIG_VETH is not set
 # CONFIG_PHYLIB is not set
-
-#
-# Ethernet (10 or 100Mbit)
-#
 CONFIG_NET_ETHERNET=y
 CONFIG_MII=y
 CONFIG_ARM_AT91_ETHER=y
+# CONFIG_AX88796 is not set
 # CONFIG_SMC91X is not set
 # CONFIG_DM9000 is not set
+# CONFIG_IBM_NEW_EMAC_ZMII is not set
+# CONFIG_IBM_NEW_EMAC_RGMII is not set
+# CONFIG_IBM_NEW_EMAC_TAH is not set
+# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
+# CONFIG_B44 is not set
+CONFIG_NETDEV_1000=y
+CONFIG_NETDEV_10000=y
 
 #
-# Ethernet (1000 Mbit)
-#
-
-#
-# Ethernet (10000 Mbit)
+# Wireless LAN
 #
+# CONFIG_WLAN_PRE80211 is not set
+# CONFIG_WLAN_80211 is not set
 
 #
-# Token Ring devices
-#
-
-#
-# Wireless LAN (non-hamradio)
-#
-# CONFIG_NET_RADIO is not set
-
-#
-# PCMCIA network device support
+# USB Network Adapters
 #
+# CONFIG_USB_CATC is not set
+# CONFIG_USB_KAWETH is not set
+# CONFIG_USB_PEGASUS is not set
+# CONFIG_USB_RTL8150 is not set
+# CONFIG_USB_USBNET is not set
 # CONFIG_NET_PCMCIA is not set
-
-#
-# Wan interfaces
-#
 # CONFIG_WAN is not set
 # CONFIG_PPP is not set
 # CONFIG_SLIP is not set
@@ -539,26 +574,23 @@ CONFIG_ARM_AT91_ETHER=y
 # CONFIG_NETCONSOLE is not set
 # CONFIG_NETPOLL is not set
 # CONFIG_NET_POLL_CONTROLLER is not set
-
-#
-# ISDN subsystem
-#
 # CONFIG_ISDN is not set
 
 #
 # Input device support
 #
 CONFIG_INPUT=y
+# CONFIG_INPUT_FF_MEMLESS is not set
+# CONFIG_INPUT_POLLDEV is not set
 
 #
 # Userland interfaces
 #
 CONFIG_INPUT_MOUSEDEV=y
-CONFIG_INPUT_MOUSEDEV_PSAUX=y
+# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
 CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
 CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
 # CONFIG_INPUT_JOYDEV is not set
-# CONFIG_INPUT_TSDEV is not set
 # CONFIG_INPUT_EVDEV is not set
 # CONFIG_INPUT_EVBUG is not set
 
@@ -568,6 +600,7 @@ CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
 # CONFIG_INPUT_KEYBOARD is not set
 # CONFIG_INPUT_MOUSE is not set
 # CONFIG_INPUT_JOYSTICK is not set
+# CONFIG_INPUT_TABLET is not set
 # CONFIG_INPUT_TOUCHSCREEN is not set
 # CONFIG_INPUT_MISC is not set
 
@@ -583,6 +616,7 @@ CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
 CONFIG_VT=y
 CONFIG_VT_CONSOLE=y
 CONFIG_HW_CONSOLE=y
+# CONFIG_VT_HW_CONSOLE_BINDING is not set
 # CONFIG_SERIAL_NONSTANDARD is not set
 
 #
@@ -601,37 +635,11 @@ CONFIG_SERIAL_CORE_CONSOLE=y
 CONFIG_UNIX98_PTYS=y
 CONFIG_LEGACY_PTYS=y
 CONFIG_LEGACY_PTY_COUNT=256
-
-#
-# IPMI
-#
 # CONFIG_IPMI_HANDLER is not set
-
-#
-# Watchdog Cards
-#
-CONFIG_WATCHDOG=y
-CONFIG_WATCHDOG_NOWAYOUT=y
-
-#
-# Watchdog Device Drivers
-#
-# CONFIG_SOFT_WATCHDOG is not set
-CONFIG_AT91RM9200_WATCHDOG=y
-
-#
-# USB-based Watchdog Cards
-#
-# CONFIG_USBPCWATCHDOG is not set
 # CONFIG_HW_RANDOM is not set
 # CONFIG_NVRAM is not set
-# CONFIG_DTLK is not set
 # CONFIG_R3964 is not set
 
-#
-# Ftape, the floppy tape device driver
-#
-
 #
 # PCMCIA character devices
 #
@@ -639,114 +647,102 @@ CONFIG_AT91RM9200_WATCHDOG=y
 # CONFIG_CARDMAN_4000 is not set
 # CONFIG_CARDMAN_4040 is not set
 # CONFIG_RAW_DRIVER is not set
-
-#
-# TPM devices
-#
 # CONFIG_TCG_TPM is not set
-# CONFIG_TELCLOCK is not set
 CONFIG_AT91_SPI=y
 CONFIG_AT91_SPIDEV=y
-
-#
-# I2C support
-#
 CONFIG_I2C=y
+CONFIG_I2C_BOARDINFO=y
 CONFIG_I2C_CHARDEV=y
 
 #
 # I2C Algorithms
 #
-# CONFIG_I2C_ALGOBIT is not set
+CONFIG_I2C_ALGOBIT=y
 # CONFIG_I2C_ALGOPCF is not set
 # CONFIG_I2C_ALGOPCA is not set
 
 #
 # I2C Hardware Bus support
 #
-CONFIG_I2C_AT91=y
+CONFIG_I2C_GPIO=y
+# CONFIG_I2C_OCORES is not set
 # CONFIG_I2C_PARPORT_LIGHT is not set
+# CONFIG_I2C_SIMTEC is not set
+# CONFIG_I2C_TAOS_EVM is not set
 # CONFIG_I2C_STUB is not set
-# CONFIG_I2C_PCA_ISA is not set
+# CONFIG_I2C_TINY_USB is not set
+# CONFIG_I2C_PCA is not set
 
 #
 # Miscellaneous I2C Chip support
 #
 # CONFIG_SENSORS_DS1337 is not set
 # CONFIG_SENSORS_DS1374 is not set
+# CONFIG_DS1682 is not set
 # CONFIG_SENSORS_EEPROM is not set
 # CONFIG_SENSORS_PCF8574 is not set
 # CONFIG_SENSORS_PCA9539 is not set
 # CONFIG_SENSORS_PCF8591 is not set
-# CONFIG_SENSORS_RTC8564 is not set
 # CONFIG_SENSORS_MAX6875 is not set
-# CONFIG_RTC_X1205_I2C is not set
+# CONFIG_SENSORS_TSL2550 is not set
 # CONFIG_I2C_DEBUG_CORE is not set
 # CONFIG_I2C_DEBUG_ALGO is not set
 # CONFIG_I2C_DEBUG_BUS is not set
 # CONFIG_I2C_DEBUG_CHIP is not set
 
 #
-# Hardware Monitoring support
-#
-CONFIG_HWMON=y
-# CONFIG_HWMON_VID is not set
-# CONFIG_SENSORS_ADM1021 is not set
-# CONFIG_SENSORS_ADM1025 is not set
-# CONFIG_SENSORS_ADM1026 is not set
-# CONFIG_SENSORS_ADM1031 is not set
-# CONFIG_SENSORS_ADM9240 is not set
-# CONFIG_SENSORS_ASB100 is not set
-# CONFIG_SENSORS_ATXP1 is not set
-# CONFIG_SENSORS_DS1621 is not set
-# CONFIG_SENSORS_FSCHER is not set
-# CONFIG_SENSORS_FSCPOS is not set
-# CONFIG_SENSORS_GL518SM is not set
-# CONFIG_SENSORS_GL520SM is not set
-# CONFIG_SENSORS_IT87 is not set
-# CONFIG_SENSORS_LM63 is not set
-# CONFIG_SENSORS_LM75 is not set
-# CONFIG_SENSORS_LM77 is not set
-# CONFIG_SENSORS_LM78 is not set
-# CONFIG_SENSORS_LM80 is not set
-# CONFIG_SENSORS_LM83 is not set
-# CONFIG_SENSORS_LM85 is not set
-# CONFIG_SENSORS_LM87 is not set
-# CONFIG_SENSORS_LM90 is not set
-# CONFIG_SENSORS_LM92 is not set
-# CONFIG_SENSORS_MAX1619 is not set
-# CONFIG_SENSORS_PC87360 is not set
-# CONFIG_SENSORS_SMSC47M1 is not set
-# CONFIG_SENSORS_SMSC47B397 is not set
-# CONFIG_SENSORS_W83781D is not set
-# CONFIG_SENSORS_W83792D is not set
-# CONFIG_SENSORS_W83L785TS is not set
-# CONFIG_SENSORS_W83627HF is not set
-# CONFIG_SENSORS_W83627EHF is not set
-# CONFIG_HWMON_DEBUG_CHIP is not set
-
-#
-# Misc devices
-#
-
-#
-# Multimedia Capabilities Port drivers
+# SPI support
 #
+# CONFIG_SPI is not set
+# CONFIG_SPI_MASTER is not set
+# CONFIG_W1 is not set
+# CONFIG_POWER_SUPPLY is not set
+# CONFIG_HWMON is not set
+CONFIG_WATCHDOG=y
+CONFIG_WATCHDOG_NOWAYOUT=y
 
 #
-# Multimedia devices
+# Watchdog Device Drivers
 #
-# CONFIG_VIDEO_DEV is not set
+# CONFIG_SOFT_WATCHDOG is not set
+CONFIG_AT91RM9200_WATCHDOG=y
+
+#
+# USB-based Watchdog Cards
+#
+# CONFIG_USBPCWATCHDOG is not set
+
+#
+# Sonics Silicon Backplane
+#
+CONFIG_SSB_POSSIBLE=y
+# CONFIG_SSB is not set
 
 #
-# Digital Video Broadcasting Devices
+# Multifunction device drivers
 #
-# CONFIG_DVB is not set
+# CONFIG_MFD_SM501 is not set
+
+#
+# Multimedia devices
+#
+# CONFIG_VIDEO_DEV is not set
+# CONFIG_DVB_CORE is not set
+CONFIG_DAB=y
+# CONFIG_USB_DABUSB is not set
 
 #
 # Graphics support
 #
+# CONFIG_VGASTATE is not set
+# CONFIG_VIDEO_OUTPUT_CONTROL is not set
 # CONFIG_FB is not set
+# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
+
+#
+# Display device support
+#
+# CONFIG_DISPLAY_SUPPORT is not set
 
 #
 # Console display driver support
@@ -758,12 +754,25 @@ CONFIG_DUMMY_CONSOLE=y
 # Sound
 #
 # CONFIG_SOUND is not set
+CONFIG_HID_SUPPORT=y
+CONFIG_HID=y
+CONFIG_HID_DEBUG=y
+# CONFIG_HIDRAW is not set
+
+#
+# USB Input Devices
+#
+# CONFIG_USB_HID is not set
 
 #
-# USB support
+# USB HID Boot Protocol drivers
 #
+# CONFIG_USB_KBD is not set
+# CONFIG_USB_MOUSE is not set
+CONFIG_USB_SUPPORT=y
 CONFIG_USB_ARCH_HAS_HCD=y
 CONFIG_USB_ARCH_HAS_OHCI=y
+# CONFIG_USB_ARCH_HAS_EHCI is not set
 CONFIG_USB=y
 CONFIG_USB_DEBUG=y
 
@@ -771,7 +780,7 @@ CONFIG_USB_DEBUG=y
 # Miscellaneous USB options
 #
 CONFIG_USB_DEVICEFS=y
-# CONFIG_USB_BANDWIDTH is not set
+CONFIG_USB_DEVICE_CLASS=y
 # CONFIG_USB_DYNAMIC_MINORS is not set
 # CONFIG_USB_OTG is not set
 
@@ -780,9 +789,11 @@ CONFIG_USB_DEVICEFS=y
 #
 # CONFIG_USB_ISP116X_HCD is not set
 CONFIG_USB_OHCI_HCD=y
-# CONFIG_USB_OHCI_BIG_ENDIAN is not set
+# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set
+# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set
 CONFIG_USB_OHCI_LITTLE_ENDIAN=y
 # CONFIG_USB_SL811_HCD is not set
+# CONFIG_USB_R8A66597_HCD is not set
 
 #
 # USB Device Class drivers
@@ -801,59 +812,21 @@ CONFIG_USB_STORAGE=y
 # CONFIG_USB_STORAGE_DEBUG is not set
 # CONFIG_USB_STORAGE_DATAFAB is not set
 # CONFIG_USB_STORAGE_FREECOM is not set
+# CONFIG_USB_STORAGE_ISD200 is not set
 # CONFIG_USB_STORAGE_DPCM is not set
 # CONFIG_USB_STORAGE_USBAT is not set
 # CONFIG_USB_STORAGE_SDDR09 is not set
 # CONFIG_USB_STORAGE_SDDR55 is not set
 # CONFIG_USB_STORAGE_JUMPSHOT is not set
-
-#
-# USB Input Devices
-#
-# CONFIG_USB_HID is not set
-
-#
-# USB HID Boot Protocol drivers
-#
-# CONFIG_USB_KBD is not set
-# CONFIG_USB_MOUSE is not set
-# CONFIG_USB_AIPTEK is not set
-# CONFIG_USB_WACOM is not set
-# CONFIG_USB_ACECAD is not set
-# CONFIG_USB_KBTAB is not set
-# CONFIG_USB_POWERMATE is not set
-# CONFIG_USB_MTOUCH is not set
-# CONFIG_USB_ITMTOUCH is not set
-# CONFIG_USB_EGALAX is not set
-# CONFIG_USB_YEALINK is not set
-# CONFIG_USB_XPAD is not set
-# CONFIG_USB_ATI_REMOTE is not set
-# CONFIG_USB_KEYSPAN_REMOTE is not set
-# CONFIG_USB_APPLETOUCH is not set
+# CONFIG_USB_STORAGE_ALAUDA is not set
+# CONFIG_USB_STORAGE_KARMA is not set
+# CONFIG_USB_LIBUSUAL is not set
 
 #
 # USB Imaging devices
 #
 # CONFIG_USB_MDC800 is not set
 # CONFIG_USB_MICROTEK is not set
-
-#
-# USB Multimedia devices
-#
-# CONFIG_USB_DABUSB is not set
-
-#
-# Video4Linux support is needed for USB Multimedia device support
-#
-
-#
-# USB Network Adapters
-#
-# CONFIG_USB_CATC is not set
-# CONFIG_USB_KAWETH is not set
-# CONFIG_USB_PEGASUS is not set
-# CONFIG_USB_RTL8150 is not set
-# CONFIG_USB_USBNET is not set
 CONFIG_USB_MON=y
 
 #
@@ -866,15 +839,18 @@ CONFIG_USB_MON=y
 CONFIG_USB_SERIAL=y
 CONFIG_USB_SERIAL_CONSOLE=y
 CONFIG_USB_SERIAL_GENERIC=y
+# CONFIG_USB_SERIAL_AIRCABLE is not set
 # CONFIG_USB_SERIAL_AIRPRIME is not set
-# CONFIG_USB_SERIAL_ANYDATA is not set
+# CONFIG_USB_SERIAL_ARK3116 is not set
 # CONFIG_USB_SERIAL_BELKIN is not set
+# CONFIG_USB_SERIAL_CH341 is not set
 # CONFIG_USB_SERIAL_WHITEHEAT is not set
 # CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set
 # CONFIG_USB_SERIAL_CP2101 is not set
 # CONFIG_USB_SERIAL_CYPRESS_M8 is not set
 # CONFIG_USB_SERIAL_EMPEG is not set
 CONFIG_USB_SERIAL_FTDI_SIO=y
+# CONFIG_USB_SERIAL_FUNSOFT is not set
 # CONFIG_USB_SERIAL_VISOR is not set
 # CONFIG_USB_SERIAL_IPAQ is not set
 # CONFIG_USB_SERIAL_IR is not set
@@ -899,14 +875,20 @@ CONFIG_USB_SERIAL_KEYSPAN_USA49WLC=y
 # CONFIG_USB_SERIAL_KLSI is not set
 # CONFIG_USB_SERIAL_KOBIL_SCT is not set
 CONFIG_USB_SERIAL_MCT_U232=y
+# CONFIG_USB_SERIAL_MOS7720 is not set
+# CONFIG_USB_SERIAL_MOS7840 is not set
+# CONFIG_USB_SERIAL_NAVMAN is not set
 # CONFIG_USB_SERIAL_PL2303 is not set
+# CONFIG_USB_SERIAL_OTI6858 is not set
 # CONFIG_USB_SERIAL_HP4X is not set
 # CONFIG_USB_SERIAL_SAFE is not set
+# CONFIG_USB_SERIAL_SIERRAWIRELESS is not set
 # CONFIG_USB_SERIAL_TI is not set
 # CONFIG_USB_SERIAL_CYBERJACK is not set
 # CONFIG_USB_SERIAL_XIRCOM is not set
 # CONFIG_USB_SERIAL_OPTION is not set
 # CONFIG_USB_SERIAL_OMNINET is not set
+# CONFIG_USB_SERIAL_DEBUG is not set
 CONFIG_USB_EZUSB=y
 
 #
@@ -914,16 +896,22 @@ CONFIG_USB_EZUSB=y
 #
 # CONFIG_USB_EMI62 is not set
 # CONFIG_USB_EMI26 is not set
+# CONFIG_USB_ADUTUX is not set
 # CONFIG_USB_AUERSWALD is not set
 # CONFIG_USB_RIO500 is not set
 # CONFIG_USB_LEGOTOWER is not set
 # CONFIG_USB_LCD is not set
+# CONFIG_USB_BERRY_CHARGE is not set
 # CONFIG_USB_LED is not set
+# CONFIG_USB_CYPRESS_CY7C63 is not set
 # CONFIG_USB_CYTHERM is not set
-# CONFIG_USB_PHIDGETKIT is not set
-# CONFIG_USB_PHIDGETSERVO is not set
+# CONFIG_USB_PHIDGET is not set
 # CONFIG_USB_IDMOUSE is not set
+# CONFIG_USB_FTDI_ELAN is not set
+# CONFIG_USB_APPLEDISPLAY is not set
 # CONFIG_USB_LD is not set
+# CONFIG_USB_TRANCEVIBRATOR is not set
+# CONFIG_USB_IOWARRIOR is not set
 # CONFIG_USB_TEST is not set
 
 #
@@ -934,13 +922,19 @@ CONFIG_USB_EZUSB=y
 # USB Gadget Support
 #
 CONFIG_USB_GADGET=y
+# CONFIG_USB_GADGET_DEBUG is not set
 # CONFIG_USB_GADGET_DEBUG_FILES is not set
 CONFIG_USB_GADGET_SELECTED=y
+# CONFIG_USB_GADGET_AMD5536UDC is not set
+# CONFIG_USB_GADGET_ATMEL_USBA is not set
+# CONFIG_USB_GADGET_FSL_USB2 is not set
 # CONFIG_USB_GADGET_NET2280 is not set
 # CONFIG_USB_GADGET_PXA2XX is not set
+# CONFIG_USB_GADGET_M66592 is not set
 # CONFIG_USB_GADGET_GOKU is not set
 # CONFIG_USB_GADGET_LH7A40X is not set
 # CONFIG_USB_GADGET_OMAP is not set
+# CONFIG_USB_GADGET_S3C2410 is not set
 CONFIG_USB_GADGET_AT91=y
 CONFIG_USB_AT91=y
 # CONFIG_USB_GADGET_DUMMY_HCD is not set
@@ -950,22 +944,28 @@ CONFIG_USB_AT91=y
 # CONFIG_USB_GADGETFS is not set
 # CONFIG_USB_FILE_STORAGE is not set
 # CONFIG_USB_G_SERIAL is not set
+# CONFIG_USB_MIDI_GADGET is not set
+CONFIG_MMC=y
+# CONFIG_MMC_DEBUG is not set
+# CONFIG_MMC_UNSAFE_RESUME is not set
 
 #
-# MMC/SD Card support
+# MMC/SD Card Drivers
 #
-CONFIG_MMC=y
-# CONFIG_MMC_DEBUG is not set
 CONFIG_MMC_BLOCK=y
-CONFIG_MMC_AT91RM9200=y
+CONFIG_MMC_BLOCK_BOUNCE=y
+# CONFIG_SDIO_UART is not set
 
 #
-# Real Time Clock
+# MMC/SD Host Controller Drivers
 #
+# CONFIG_MMC_AT91 is not set
+# CONFIG_NEW_LEDS is not set
 CONFIG_RTC_LIB=y
 CONFIG_RTC_CLASS=y
 CONFIG_RTC_HCTOSYS=y
 CONFIG_RTC_HCTOSYS_DEVICE="rtc1"
+# CONFIG_RTC_DEBUG is not set
 
 #
 # RTC interfaces
@@ -974,24 +974,42 @@ CONFIG_RTC_HCTOSYS_DEVICE="rtc1"
 CONFIG_RTC_INTF_PROC=y
 CONFIG_RTC_INTF_DEV=y
 # CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
+# CONFIG_RTC_DRV_TEST is not set
 
 #
-# RTC drivers
+# I2C RTC drivers
 #
-# CONFIG_RTC_DRV_X1205 is not set
 CONFIG_RTC_DRV_DS1307=y
-# CONFIG_RTC_DRV_DS1553 is not set
-# CONFIG_RTC_DRV_ISL1208 is not set
+# CONFIG_RTC_DRV_DS1374 is not set
 # CONFIG_RTC_DRV_DS1672 is not set
-# CONFIG_RTC_DRV_DS1742 is not set
+# CONFIG_RTC_DRV_MAX6900 is not set
+# CONFIG_RTC_DRV_RS5C372 is not set
+# CONFIG_RTC_DRV_ISL1208 is not set
+# CONFIG_RTC_DRV_X1205 is not set
 # CONFIG_RTC_DRV_PCF8563 is not set
 # CONFIG_RTC_DRV_PCF8583 is not set
-# CONFIG_RTC_DRV_RS5C372 is not set
+# CONFIG_RTC_DRV_M41T80 is not set
+
+#
+# SPI RTC drivers
+#
+
+#
+# Platform RTC drivers
+#
+# CONFIG_RTC_DRV_CMOS is not set
+# CONFIG_RTC_DRV_DS1553 is not set
+# CONFIG_RTC_DRV_STK17TA8 is not set
+# CONFIG_RTC_DRV_DS1742 is not set
 # CONFIG_RTC_DRV_M48T86 is not set
-CONFIG_RTC_DRV_AT91RM9200=y
-# CONFIG_RTC_DRV_TEST is not set
+# CONFIG_RTC_DRV_M48T59 is not set
 # CONFIG_RTC_DRV_V3020 is not set
 
+#
+# on-CPU RTC drivers
+#
+CONFIG_RTC_DRV_AT91RM9200=y
+
 #
 # File systems
 #
@@ -999,14 +1017,17 @@ CONFIG_EXT2_FS=y
 # CONFIG_EXT2_FS_XATTR is not set
 # CONFIG_EXT2_FS_XIP is not set
 # CONFIG_EXT3_FS is not set
-# CONFIG_JBD is not set
+# CONFIG_EXT4DEV_FS is not set
 # CONFIG_REISERFS_FS is not set
 # CONFIG_JFS_FS is not set
 # CONFIG_FS_POSIX_ACL is not set
 # CONFIG_XFS_FS is not set
+# CONFIG_GFS2_FS is not set
+# CONFIG_OCFS2_FS is not set
 # CONFIG_MINIX_FS is not set
 # CONFIG_ROMFS_FS is not set
 CONFIG_INOTIFY=y
+CONFIG_INOTIFY_USER=y
 # CONFIG_QUOTA is not set
 CONFIG_DNOTIFY=y
 # CONFIG_AUTOFS_FS is not set
@@ -1030,11 +1051,12 @@ CONFIG_DNOTIFY=y
 # Pseudo filesystems
 #
 CONFIG_PROC_FS=y
+CONFIG_PROC_SYSCTL=y
 CONFIG_SYSFS=y
 CONFIG_TMPFS=y
+# CONFIG_TMPFS_POSIX_ACL is not set
 # CONFIG_HUGETLB_PAGE is not set
-CONFIG_RAMFS=y
-# CONFIG_RELAYFS_FS is not set
+# CONFIG_CONFIGFS_FS is not set
 
 #
 # Miscellaneous filesystems
@@ -1046,7 +1068,6 @@ CONFIG_RAMFS=y
 # CONFIG_BEFS_FS is not set
 # CONFIG_BFS_FS is not set
 # CONFIG_EFS_FS is not set
-# CONFIG_JFFS_FS is not set
 # CONFIG_JFFS2_FS is not set
 CONFIG_CRAMFS=y
 # CONFIG_VXFS_FS is not set
@@ -1054,10 +1075,7 @@ CONFIG_CRAMFS=y
 # CONFIG_QNX4FS_FS is not set
 # CONFIG_SYSV_FS is not set
 # CONFIG_UFS_FS is not set
-
-#
-# Network File Systems
-#
+CONFIG_NETWORK_FILESYSTEMS=y
 CONFIG_NFS_FS=y
 CONFIG_NFS_V3=y
 # CONFIG_NFS_V3_ACL is not set
@@ -1070,6 +1088,7 @@ CONFIG_LOCKD_V4=y
 CONFIG_NFS_COMMON=y
 CONFIG_SUNRPC=y
 CONFIG_SUNRPC_GSS=y
+# CONFIG_SUNRPC_BIND34 is not set
 CONFIG_RPCSEC_GSS_KRB5=y
 # CONFIG_RPCSEC_GSS_SPKM3 is not set
 # CONFIG_SMB_FS is not set
@@ -1077,43 +1096,56 @@ CONFIG_RPCSEC_GSS_KRB5=y
 # CONFIG_NCP_FS is not set
 # CONFIG_CODA_FS is not set
 # CONFIG_AFS_FS is not set
-# CONFIG_9P_FS is not set
 
 #
 # Partition Types
 #
 # CONFIG_PARTITION_ADVANCED is not set
 CONFIG_MSDOS_PARTITION=y
-
-#
-# Native Language Support
-#
 # CONFIG_NLS is not set
-
-#
-# Profiling support
-#
+# CONFIG_DLM is not set
+CONFIG_INSTRUMENTATION=y
 # CONFIG_PROFILING is not set
+# CONFIG_MARKERS is not set
 
 #
 # Kernel hacking
 #
 # CONFIG_PRINTK_TIME is not set
-CONFIG_DEBUG_KERNEL=y
+CONFIG_ENABLE_WARN_DEPRECATED=y
+CONFIG_ENABLE_MUST_CHECK=y
 # CONFIG_MAGIC_SYSRQ is not set
-CONFIG_LOG_BUF_SHIFT=14
+# CONFIG_UNUSED_SYMBOLS is not set
+# CONFIG_DEBUG_FS is not set
+# CONFIG_HEADERS_CHECK is not set
+CONFIG_DEBUG_KERNEL=y
+# CONFIG_DEBUG_SHIRQ is not set
 CONFIG_DETECT_SOFTLOCKUP=y
+CONFIG_SCHED_DEBUG=y
 # CONFIG_SCHEDSTATS is not set
-# CONFIG_DEBUG_SLAB is not set
+# CONFIG_TIMER_STATS is not set
+# CONFIG_SLUB_DEBUG_ON is not set
+# CONFIG_DEBUG_RT_MUTEXES is not set
+# CONFIG_RT_MUTEX_TESTER is not set
 # CONFIG_DEBUG_SPINLOCK is not set
+# CONFIG_DEBUG_MUTEXES is not set
+# CONFIG_DEBUG_LOCK_ALLOC is not set
+# CONFIG_PROVE_LOCKING is not set
+# CONFIG_LOCK_STAT is not set
 # CONFIG_DEBUG_SPINLOCK_SLEEP is not set
+# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
 # CONFIG_DEBUG_KOBJECT is not set
 CONFIG_DEBUG_BUGVERBOSE=y
 # CONFIG_DEBUG_INFO is not set
-# CONFIG_DEBUG_FS is not set
 # CONFIG_DEBUG_VM is not set
+# CONFIG_DEBUG_LIST is not set
+# CONFIG_DEBUG_SG is not set
 CONFIG_FRAME_POINTER=y
+CONFIG_FORCED_INLINING=y
+# CONFIG_BOOT_PRINTK_DELAY is not set
 # CONFIG_RCU_TORTURE_TEST is not set
+# CONFIG_FAULT_INJECTION is not set
+# CONFIG_SAMPLES is not set
 CONFIG_DEBUG_USER=y
 # CONFIG_DEBUG_ERRORS is not set
 CONFIG_DEBUG_LL=y
@@ -1124,12 +1156,13 @@ CONFIG_DEBUG_LL=y
 #
 # CONFIG_KEYS is not set
 # CONFIG_SECURITY is not set
-
-#
-# Cryptographic options
-#
+# CONFIG_SECURITY_FILE_CAPABILITIES is not set
 CONFIG_CRYPTO=y
+CONFIG_CRYPTO_ALGAPI=y
+CONFIG_CRYPTO_BLKCIPHER=y
+CONFIG_CRYPTO_MANAGER=y
 # CONFIG_CRYPTO_HMAC is not set
+# CONFIG_CRYPTO_XCBC is not set
 # CONFIG_CRYPTO_NULL is not set
 # CONFIG_CRYPTO_MD4 is not set
 CONFIG_CRYPTO_MD5=y
@@ -1138,7 +1171,15 @@ CONFIG_CRYPTO_MD5=y
 # CONFIG_CRYPTO_SHA512 is not set
 # CONFIG_CRYPTO_WP512 is not set
 # CONFIG_CRYPTO_TGR192 is not set
+# CONFIG_CRYPTO_GF128MUL is not set
+# CONFIG_CRYPTO_ECB is not set
+CONFIG_CRYPTO_CBC=y
+# CONFIG_CRYPTO_PCBC is not set
+# CONFIG_CRYPTO_LRW is not set
+# CONFIG_CRYPTO_XTS is not set
+# CONFIG_CRYPTO_CRYPTD is not set
 CONFIG_CRYPTO_DES=y
+# CONFIG_CRYPTO_FCRYPT is not set
 # CONFIG_CRYPTO_BLOWFISH is not set
 # CONFIG_CRYPTO_TWOFISH is not set
 # CONFIG_CRYPTO_SERPENT is not set
@@ -1149,20 +1190,27 @@ CONFIG_CRYPTO_DES=y
 # CONFIG_CRYPTO_ARC4 is not set
 # CONFIG_CRYPTO_KHAZAD is not set
 # CONFIG_CRYPTO_ANUBIS is not set
+# CONFIG_CRYPTO_SEED is not set
 # CONFIG_CRYPTO_DEFLATE is not set
 # CONFIG_CRYPTO_MICHAEL_MIC is not set
 # CONFIG_CRYPTO_CRC32C is not set
+# CONFIG_CRYPTO_CAMELLIA is not set
 # CONFIG_CRYPTO_TEST is not set
-
-#
-# Hardware crypto devices
-#
+# CONFIG_CRYPTO_AUTHENC is not set
+CONFIG_CRYPTO_HW=y
 
 #
 # Library routines
 #
+CONFIG_BITREVERSE=y
 # CONFIG_CRC_CCITT is not set
 # CONFIG_CRC16 is not set
+# CONFIG_CRC_ITU_T is not set
 CONFIG_CRC32=y
+# CONFIG_CRC7 is not set
 # CONFIG_LIBCRC32C is not set
 CONFIG_ZLIB_INFLATE=y
+CONFIG_PLIST=y
+CONFIG_HAS_IOMEM=y
+CONFIG_HAS_IOPORT=y
+CONFIG_HAS_DMA=y
index 669f035896f9fc9882d8b77a5b05036dac518ba3..99702146c9fce563aa02fa55b95c10e0b11f216e 100644 (file)
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.15
-# Mon Jan  9 21:52:00 2006
+# Linux kernel version: 2.6.25-rc8
+# Fri Apr  4 22:06:15 2008
 #
 CONFIG_ARM=y
+CONFIG_SYS_SUPPORTS_APM_EMULATION=y
+CONFIG_GENERIC_GPIO=y
+CONFIG_GENERIC_TIME=y
+CONFIG_GENERIC_CLOCKEVENTS=y
 CONFIG_MMU=y
-CONFIG_UID16=y
+# CONFIG_NO_IOPORT is not set
+CONFIG_GENERIC_HARDIRQS=y
+CONFIG_STACKTRACE_SUPPORT=y
+CONFIG_LOCKDEP_SUPPORT=y
+CONFIG_TRACE_IRQFLAGS_SUPPORT=y
+CONFIG_HARDIRQS_SW_RESEND=y
+CONFIG_GENERIC_IRQ_PROBE=y
 CONFIG_RWSEM_GENERIC_SPINLOCK=y
+# CONFIG_ARCH_HAS_ILOG2_U32 is not set
+# CONFIG_ARCH_HAS_ILOG2_U64 is not set
+CONFIG_GENERIC_HWEIGHT=y
 CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_ARCH_SUPPORTS_AOUT=y
+CONFIG_ZONE_DMA=y
+CONFIG_VECTORS_BASE=0xffff0000
+CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
 
 #
-# Code maturity level options
+# General setup
 #
 CONFIG_EXPERIMENTAL=y
-CONFIG_CLEAN_COMPILE=y
 CONFIG_BROKEN_ON_SMP=y
 CONFIG_INIT_ENV_ARG_LIMIT=32
-
-#
-# General setup
-#
 CONFIG_LOCALVERSION=""
 CONFIG_LOCALVERSION_AUTO=y
 # CONFIG_SWAP is not set
 CONFIG_SYSVIPC=y
+CONFIG_SYSVIPC_SYSCTL=y
 # CONFIG_POSIX_MQUEUE is not set
 # CONFIG_BSD_PROCESS_ACCT is not set
-CONFIG_SYSCTL=y
+# CONFIG_TASKSTATS is not set
 # CONFIG_AUDIT is not set
-CONFIG_HOTPLUG=y
-CONFIG_KOBJECT_UEVENT=y
 # CONFIG_IKCONFIG is not set
+CONFIG_LOG_BUF_SHIFT=14
+# CONFIG_CGROUPS is not set
+CONFIG_GROUP_SCHED=y
+CONFIG_FAIR_GROUP_SCHED=y
+# CONFIG_RT_GROUP_SCHED is not set
+CONFIG_USER_SCHED=y
+# CONFIG_CGROUP_SCHED is not set
+CONFIG_SYSFS_DEPRECATED=y
+CONFIG_SYSFS_DEPRECATED_V2=y
+# CONFIG_RELAY is not set
+CONFIG_NAMESPACES=y
+# CONFIG_UTS_NS is not set
+# CONFIG_IPC_NS is not set
+# CONFIG_USER_NS is not set
+# CONFIG_PID_NS is not set
+CONFIG_BLK_DEV_INITRD=y
 CONFIG_INITRAMFS_SOURCE=""
 CONFIG_CC_OPTIMIZE_FOR_SIZE=y
+CONFIG_SYSCTL=y
 # CONFIG_EMBEDDED is not set
+CONFIG_UID16=y
+CONFIG_SYSCTL_SYSCALL=y
 CONFIG_KALLSYMS=y
 # CONFIG_KALLSYMS_ALL is not set
 # CONFIG_KALLSYMS_EXTRA_PASS is not set
+CONFIG_HOTPLUG=y
 CONFIG_PRINTK=y
 CONFIG_BUG=y
+CONFIG_ELF_CORE=y
+CONFIG_COMPAT_BRK=y
 CONFIG_BASE_FULL=y
 CONFIG_FUTEX=y
+CONFIG_ANON_INODES=y
 CONFIG_EPOLL=y
+CONFIG_SIGNALFD=y
+CONFIG_TIMERFD=y
+CONFIG_EVENTFD=y
 CONFIG_SHMEM=y
-CONFIG_CC_ALIGN_FUNCTIONS=0
-CONFIG_CC_ALIGN_LABELS=0
-CONFIG_CC_ALIGN_LOOPS=0
-CONFIG_CC_ALIGN_JUMPS=0
+CONFIG_VM_EVENT_COUNTERS=y
+CONFIG_SLUB_DEBUG=y
+# CONFIG_SLAB is not set
+CONFIG_SLUB=y
+# CONFIG_SLOB is not set
+# CONFIG_PROFILING is not set
+# CONFIG_MARKERS is not set
+CONFIG_HAVE_OPROFILE=y
+# CONFIG_KPROBES is not set
+CONFIG_HAVE_KPROBES=y
+CONFIG_HAVE_KRETPROBES=y
+CONFIG_PROC_PAGE_MONITOR=y
+CONFIG_SLABINFO=y
+CONFIG_RT_MUTEXES=y
 # CONFIG_TINY_SHMEM is not set
 CONFIG_BASE_SMALL=0
-
-#
-# Loadable module support
-#
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
 # CONFIG_MODULE_FORCE_UNLOAD is not set
-CONFIG_OBSOLETE_MODPARM=y
 # CONFIG_MODVERSIONS is not set
 # CONFIG_MODULE_SRCVERSION_ALL is not set
 CONFIG_KMOD=y
-
-#
-# Block layer
-#
+CONFIG_BLOCK=y
+# CONFIG_LBD is not set
+# CONFIG_BLK_DEV_IO_TRACE is not set
+# CONFIG_LSF is not set
+# CONFIG_BLK_DEV_BSG is not set
 
 #
 # IO Schedulers
@@ -77,66 +120,111 @@ CONFIG_DEFAULT_AS=y
 # CONFIG_DEFAULT_CFQ is not set
 # CONFIG_DEFAULT_NOOP is not set
 CONFIG_DEFAULT_IOSCHED="anticipatory"
+CONFIG_CLASSIC_RCU=y
 
 #
 # System Type
 #
+# CONFIG_ARCH_AAEC2000 is not set
+# CONFIG_ARCH_INTEGRATOR is not set
+# CONFIG_ARCH_REALVIEW is not set
+# CONFIG_ARCH_VERSATILE is not set
+CONFIG_ARCH_AT91=y
 # CONFIG_ARCH_CLPS7500 is not set
 # CONFIG_ARCH_CLPS711X is not set
 # CONFIG_ARCH_CO285 is not set
 # CONFIG_ARCH_EBSA110 is not set
+# CONFIG_ARCH_EP93XX is not set
 # CONFIG_ARCH_FOOTBRIDGE is not set
-# CONFIG_ARCH_INTEGRATOR is not set
-# CONFIG_ARCH_IOP3XX is not set
-# CONFIG_ARCH_IXP4XX is not set
+# CONFIG_ARCH_NETX is not set
+# CONFIG_ARCH_H720X is not set
+# CONFIG_ARCH_IMX is not set
+# CONFIG_ARCH_IOP13XX is not set
+# CONFIG_ARCH_IOP32X is not set
+# CONFIG_ARCH_IOP33X is not set
+# CONFIG_ARCH_IXP23XX is not set
 # CONFIG_ARCH_IXP2000 is not set
+# CONFIG_ARCH_IXP4XX is not set
 # CONFIG_ARCH_L7200 is not set
+# CONFIG_ARCH_KS8695 is not set
+# CONFIG_ARCH_NS9XXX is not set
+# CONFIG_ARCH_MXC is not set
+# CONFIG_ARCH_ORION is not set
+# CONFIG_ARCH_PNX4008 is not set
 # CONFIG_ARCH_PXA is not set
 # CONFIG_ARCH_RPC is not set
 # CONFIG_ARCH_SA1100 is not set
 # CONFIG_ARCH_S3C2410 is not set
 # CONFIG_ARCH_SHARK is not set
 # CONFIG_ARCH_LH7A40X is not set
+# CONFIG_ARCH_DAVINCI is not set
 # CONFIG_ARCH_OMAP is not set
-# CONFIG_ARCH_VERSATILE is not set
-# CONFIG_ARCH_REALVIEW is not set
-# CONFIG_ARCH_IMX is not set
-# CONFIG_ARCH_H720X is not set
-# CONFIG_ARCH_AAEC2000 is not set
-CONFIG_ARCH_AT91=y
-CONFIG_ARCH_AT91RM9200=y
+# CONFIG_ARCH_MSM7X00A is not set
+
+#
+# Boot options
+#
+
+#
+# Power management
+#
 
 #
-# AT91RM9200 Implementations
+# Atmel AT91 System-on-Chip
 #
+CONFIG_ARCH_AT91RM9200=y
+# CONFIG_ARCH_AT91SAM9260 is not set
+# CONFIG_ARCH_AT91SAM9261 is not set
+# CONFIG_ARCH_AT91SAM9263 is not set
+# CONFIG_ARCH_AT91SAM9RL is not set
+# CONFIG_ARCH_AT91CAP9 is not set
+# CONFIG_ARCH_AT91X40 is not set
+CONFIG_AT91_PMC_UNIT=y
 
 #
 # AT91RM9200 Board Type
 #
+# CONFIG_MACH_ONEARM is not set
 # CONFIG_ARCH_AT91RM9200DK is not set
 # CONFIG_MACH_AT91RM9200EK is not set
 # CONFIG_MACH_CSB337 is not set
 CONFIG_MACH_CSB637=y
 # CONFIG_MACH_CARMEVA is not set
-# CONFIG_MACH_KB9200 is not set
 # CONFIG_MACH_ATEB9200 is not set
+# CONFIG_MACH_KB9200 is not set
+# CONFIG_MACH_PICOTUX2XX is not set
+# CONFIG_MACH_KAFA is not set
 
 #
-# AT91RM9200 Feature Selections
+# AT91 Board Options
+#
+
+#
+# AT91 Feature Selections
 #
 CONFIG_AT91_PROGRAMMABLE_CLOCKS=y
+CONFIG_AT91_TIMER_HZ=128
+CONFIG_AT91_EARLY_DBGU=y
+# CONFIG_AT91_EARLY_USART0 is not set
+# CONFIG_AT91_EARLY_USART1 is not set
+# CONFIG_AT91_EARLY_USART2 is not set
+# CONFIG_AT91_EARLY_USART3 is not set
+# CONFIG_AT91_EARLY_USART4 is not set
+# CONFIG_AT91_EARLY_USART5 is not set
 
 #
 # Processor Type
 #
 CONFIG_CPU_32=y
 CONFIG_CPU_ARM920T=y
-CONFIG_CPU_32v4=y
+CONFIG_CPU_32v4T=y
 CONFIG_CPU_ABRT_EV4T=y
 CONFIG_CPU_CACHE_V4WT=y
 CONFIG_CPU_CACHE_VIVT=y
 CONFIG_CPU_COPY_V4WB=y
 CONFIG_CPU_TLB_V4WBI=y
+CONFIG_CPU_CP15=y
+CONFIG_CPU_CP15_MMU=y
 
 #
 # Processor Features
@@ -145,15 +233,13 @@ CONFIG_CPU_TLB_V4WBI=y
 # CONFIG_CPU_ICACHE_DISABLE is not set
 # CONFIG_CPU_DCACHE_DISABLE is not set
 # CONFIG_CPU_DCACHE_WRITETHROUGH is not set
+# CONFIG_OUTER_CACHE is not set
 
 #
 # Bus support
 #
-CONFIG_ISA_DMA_API=y
-
-#
-# PCCARD (PCMCIA/CardBus) support
-#
+# CONFIG_PCI_SYSCALL is not set
+# CONFIG_ARCH_SUPPORTS_MSI is not set
 CONFIG_PCCARD=y
 # CONFIG_PCMCIA_DEBUG is not set
 CONFIG_PCMCIA=y
@@ -168,8 +254,13 @@ CONFIG_AT91_CF=y
 #
 # Kernel Features
 #
+# CONFIG_TICK_ONESHOT is not set
+# CONFIG_NO_HZ is not set
+# CONFIG_HIGH_RES_TIMERS is not set
+CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
 # CONFIG_PREEMPT is not set
-# CONFIG_NO_IDLE_HZ is not set
+CONFIG_HZ=128
+# CONFIG_AEABI is not set
 # CONFIG_ARCH_DISCONTIGMEM_ENABLE is not set
 CONFIG_SELECT_MEMORY_MODEL=y
 CONFIG_FLATMEM_MANUAL=y
@@ -178,9 +269,13 @@ CONFIG_FLATMEM_MANUAL=y
 CONFIG_FLATMEM=y
 CONFIG_FLAT_NODE_MEM_MAP=y
 # CONFIG_SPARSEMEM_STATIC is not set
+# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
 CONFIG_SPLIT_PTLOCK_CPUS=4096
+# CONFIG_RESOURCES_64BIT is not set
+CONFIG_ZONE_DMA_FLAG=1
+CONFIG_BOUNCE=y
+CONFIG_VIRT_TO_BUS=y
 CONFIG_LEDS=y
-CONFIG_LEDS_TIMER=y
 CONFIG_LEDS_CPU=y
 CONFIG_ALIGNMENT_TRAP=y
 
@@ -191,6 +286,7 @@ CONFIG_ZBOOT_ROM_TEXT=0x0
 CONFIG_ZBOOT_ROM_BSS=0x0
 CONFIG_CMDLINE="mem=32M console=ttyS0,38400 initrd=0x20410000,3145728 root=/dev/ram0 rw"
 # CONFIG_XIP_KERNEL is not set
+# CONFIG_KEXEC is not set
 
 #
 # Floating point emulation
@@ -215,6 +311,7 @@ CONFIG_BINFMT_ELF=y
 # Power management options
 #
 # CONFIG_PM is not set
+CONFIG_ARCH_SUSPEND_POSSIBLE=y
 
 #
 # Networking
@@ -227,6 +324,11 @@ CONFIG_NET=y
 CONFIG_PACKET=y
 # CONFIG_PACKET_MMAP is not set
 CONFIG_UNIX=y
+CONFIG_XFRM=y
+# CONFIG_XFRM_USER is not set
+# CONFIG_XFRM_SUB_POLICY is not set
+# CONFIG_XFRM_MIGRATE is not set
+# CONFIG_XFRM_STATISTICS is not set
 # CONFIG_NET_KEY is not set
 CONFIG_INET=y
 # CONFIG_IP_MULTICAST is not set
@@ -243,23 +345,26 @@ CONFIG_IP_PNP_BOOTP=y
 # CONFIG_INET_AH is not set
 # CONFIG_INET_ESP is not set
 # CONFIG_INET_IPCOMP is not set
+# CONFIG_INET_XFRM_TUNNEL is not set
 # CONFIG_INET_TUNNEL is not set
+CONFIG_INET_XFRM_MODE_TRANSPORT=y
+CONFIG_INET_XFRM_MODE_TUNNEL=y
+CONFIG_INET_XFRM_MODE_BEET=y
+# CONFIG_INET_LRO is not set
 CONFIG_INET_DIAG=y
 CONFIG_INET_TCP_DIAG=y
 # CONFIG_TCP_CONG_ADVANCED is not set
-CONFIG_TCP_CONG_BIC=y
+CONFIG_TCP_CONG_CUBIC=y
+CONFIG_DEFAULT_TCP_CONG="cubic"
+# CONFIG_TCP_MD5SIG is not set
 # CONFIG_IPV6 is not set
+# CONFIG_INET6_XFRM_TUNNEL is not set
+# CONFIG_INET6_TUNNEL is not set
+# CONFIG_NETWORK_SECMARK is not set
 # CONFIG_NETFILTER is not set
-
-#
-# DCCP Configuration (EXPERIMENTAL)
-#
 # CONFIG_IP_DCCP is not set
-
-#
-# SCTP Configuration (EXPERIMENTAL)
-#
 # CONFIG_IP_SCTP is not set
+# CONFIG_TIPC is not set
 # CONFIG_ATM is not set
 # CONFIG_BRIDGE is not set
 # CONFIG_VLAN_8021Q is not set
@@ -269,13 +374,8 @@ CONFIG_TCP_CONG_BIC=y
 # CONFIG_ATALK is not set
 # CONFIG_X25 is not set
 # CONFIG_LAPB is not set
-# CONFIG_NET_DIVERT is not set
 # CONFIG_ECONET is not set
 # CONFIG_WAN_ROUTER is not set
-
-#
-# QoS and/or fair queueing
-#
 # CONFIG_NET_SCHED is not set
 
 #
@@ -283,9 +383,20 @@ CONFIG_TCP_CONG_BIC=y
 #
 # CONFIG_NET_PKTGEN is not set
 # CONFIG_HAMRADIO is not set
+# CONFIG_CAN is not set
 # CONFIG_IRDA is not set
 # CONFIG_BT is not set
+# CONFIG_AF_RXRPC is not set
+
+#
+# Wireless
+#
+# CONFIG_CFG80211 is not set
+# CONFIG_WIRELESS_EXT is not set
+# CONFIG_MAC80211 is not set
 # CONFIG_IEEE80211 is not set
+# CONFIG_RFKILL is not set
+# CONFIG_NET_9P is not set
 
 #
 # Device Drivers
@@ -294,19 +405,14 @@ CONFIG_TCP_CONG_BIC=y
 #
 # Generic Driver Options
 #
+CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
 CONFIG_STANDALONE=y
 CONFIG_PREVENT_FIRMWARE_BUILD=y
 CONFIG_FW_LOADER=y
 # CONFIG_DEBUG_DRIVER is not set
-
-#
-# Connector - unified userspace <-> kernelspace linker
-#
+# CONFIG_DEBUG_DEVRES is not set
+# CONFIG_SYS_HYPERVISOR is not set
 # CONFIG_CONNECTOR is not set
-
-#
-# Memory Technology Devices (MTD)
-#
 CONFIG_MTD=y
 # CONFIG_MTD_DEBUG is not set
 # CONFIG_MTD_CONCAT is not set
@@ -319,11 +425,14 @@ CONFIG_MTD_CMDLINE_PARTS=y
 # User Modules And Translation Layers
 #
 CONFIG_MTD_CHAR=y
+CONFIG_MTD_BLKDEVS=y
 CONFIG_MTD_BLOCK=y
 # CONFIG_FTL is not set
 # CONFIG_NFTL is not set
 # CONFIG_INFTL is not set
 # CONFIG_RFD_FTL is not set
+# CONFIG_SSFDC is not set
+# CONFIG_MTD_OOPS is not set
 
 #
 # RAM/ROM/Flash chip drivers
@@ -349,15 +458,14 @@ CONFIG_MTD_CFI_UTIL=y
 # CONFIG_MTD_RAM is not set
 # CONFIG_MTD_ROM is not set
 # CONFIG_MTD_ABSENT is not set
-# CONFIG_MTD_XIP is not set
 
 #
 # Mapping drivers for chip access
 #
 # CONFIG_MTD_COMPLEX_MAPPINGS is not set
 CONFIG_MTD_PHYSMAP=y
-CONFIG_MTD_PHYSMAP_START=0
-CONFIG_MTD_PHYSMAP_LEN=0
+CONFIG_MTD_PHYSMAP_START=0x0
+CONFIG_MTD_PHYSMAP_LEN=0x0
 CONFIG_MTD_PHYSMAP_BANKWIDTH=0
 # CONFIG_MTD_ARM_INTEGRATOR is not set
 # CONFIG_MTD_PLATRAM is not set
@@ -368,7 +476,6 @@ CONFIG_MTD_PHYSMAP_BANKWIDTH=0
 # CONFIG_MTD_SLRAM is not set
 # CONFIG_MTD_PHRAM is not set
 # CONFIG_MTD_MTDRAM is not set
-# CONFIG_MTD_BLKMTD is not set
 # CONFIG_MTD_BLOCK2MTD is not set
 
 #
@@ -377,30 +484,15 @@ CONFIG_MTD_PHYSMAP_BANKWIDTH=0
 # CONFIG_MTD_DOC2000 is not set
 # CONFIG_MTD_DOC2001 is not set
 # CONFIG_MTD_DOC2001PLUS is not set
-# CONFIG_MTD_AT91_DATAFLASH is not set
-
-#
-# NAND Flash Device Drivers
-#
 # CONFIG_MTD_NAND is not set
-
-#
-# OneNAND Flash Device Drivers
-#
 # CONFIG_MTD_ONENAND is not set
 
 #
-# Parallel port support
+# UBI - Unsorted block images
 #
+# CONFIG_MTD_UBI is not set
 # CONFIG_PARPORT is not set
-
-#
-# Plug and Play support
-#
-
-#
-# Block devices
-#
+CONFIG_BLK_DEV=y
 # CONFIG_BLK_DEV_COW_COMMON is not set
 CONFIG_BLK_DEV_LOOP=y
 # CONFIG_BLK_DEV_CRYPTOLOOP is not set
@@ -409,13 +501,15 @@ CONFIG_BLK_DEV_LOOP=y
 CONFIG_BLK_DEV_RAM=y
 CONFIG_BLK_DEV_RAM_COUNT=16
 CONFIG_BLK_DEV_RAM_SIZE=8192
-CONFIG_BLK_DEV_INITRD=y
+# CONFIG_BLK_DEV_XIP is not set
 # CONFIG_CDROM_PKTCDVD is not set
 # CONFIG_ATA_OVER_ETH is not set
-
-#
-# ATA/ATAPI/MFM/RLL support
-#
+CONFIG_MISC_DEVICES=y
+# CONFIG_ATMEL_PWM is not set
+# CONFIG_EEPROM_93CX6 is not set
+# CONFIG_ATMEL_SSC is not set
+# CONFIG_ENCLOSURE_SERVICES is not set
+CONFIG_HAVE_IDE=y
 # CONFIG_IDE is not set
 
 #
@@ -423,6 +517,9 @@ CONFIG_BLK_DEV_INITRD=y
 #
 # CONFIG_RAID_ATTRS is not set
 CONFIG_SCSI=y
+CONFIG_SCSI_DMA=y
+# CONFIG_SCSI_TGT is not set
+# CONFIG_SCSI_NETLINK is not set
 CONFIG_SCSI_PROC_FS=y
 
 #
@@ -441,114 +538,78 @@ CONFIG_SCSI_PROC_FS=y
 # CONFIG_SCSI_MULTI_LUN is not set
 # CONFIG_SCSI_CONSTANTS is not set
 # CONFIG_SCSI_LOGGING is not set
+# CONFIG_SCSI_SCAN_ASYNC is not set
+CONFIG_SCSI_WAIT_SCAN=m
 
 #
-# SCSI Transport Attributes
+# SCSI Transports
 #
 # CONFIG_SCSI_SPI_ATTRS is not set
 # CONFIG_SCSI_FC_ATTRS is not set
 # CONFIG_SCSI_ISCSI_ATTRS is not set
-# CONFIG_SCSI_SAS_ATTRS is not set
-
-#
-# SCSI low-level drivers
-#
+# CONFIG_SCSI_SAS_LIBSAS is not set
+# CONFIG_SCSI_SRP_ATTRS is not set
+CONFIG_SCSI_LOWLEVEL=y
 # CONFIG_ISCSI_TCP is not set
-# CONFIG_SCSI_SATA is not set
 # CONFIG_SCSI_DEBUG is not set
-
-#
-# PCMCIA SCSI adapter support
-#
-# CONFIG_PCMCIA_AHA152X is not set
-# CONFIG_PCMCIA_FDOMAIN is not set
-# CONFIG_PCMCIA_NINJA_SCSI is not set
-# CONFIG_PCMCIA_QLOGIC is not set
-# CONFIG_PCMCIA_SYM53C500 is not set
-
-#
-# Multi-device support (RAID and LVM)
-#
+# CONFIG_SCSI_LOWLEVEL_PCMCIA is not set
+# CONFIG_ATA is not set
 # CONFIG_MD is not set
-
-#
-# Fusion MPT device support
-#
-# CONFIG_FUSION is not set
-
-#
-# IEEE 1394 (FireWire) support
-#
-
-#
-# I2O device support
-#
-
-#
-# Network device support
-#
 CONFIG_NETDEVICES=y
+# CONFIG_NETDEVICES_MULTIQUEUE is not set
 # CONFIG_DUMMY is not set
 # CONFIG_BONDING is not set
+# CONFIG_MACVLAN is not set
 # CONFIG_EQUALIZER is not set
 # CONFIG_TUN is not set
-
-#
-# PHY device support
-#
+# CONFIG_VETH is not set
 # CONFIG_PHYLIB is not set
-
-#
-# Ethernet (10 or 100Mbit)
-#
 CONFIG_NET_ETHERNET=y
 CONFIG_MII=y
 CONFIG_ARM_AT91_ETHER=y
+# CONFIG_AX88796 is not set
 # CONFIG_SMC91X is not set
+# CONFIG_SMSC911X is not set
 # CONFIG_DM9000 is not set
+# CONFIG_IBM_NEW_EMAC_ZMII is not set
+# CONFIG_IBM_NEW_EMAC_RGMII is not set
+# CONFIG_IBM_NEW_EMAC_TAH is not set
+# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
+# CONFIG_B44 is not set
+# CONFIG_CS89x0 is not set
+CONFIG_NETDEV_1000=y
+# CONFIG_E1000E_ENABLED is not set
+CONFIG_NETDEV_10000=y
 
 #
-# Ethernet (1000 Mbit)
+# Wireless LAN
 #
+# CONFIG_WLAN_PRE80211 is not set
+# CONFIG_WLAN_80211 is not set
 
 #
-# Ethernet (10000 Mbit)
-#
-
-#
-# Token Ring devices
-#
-
-#
-# Wireless LAN (non-hamradio)
-#
-# CONFIG_NET_RADIO is not set
-
-#
-# PCMCIA network device support
+# USB Network Adapters
 #
+# CONFIG_USB_CATC is not set
+# CONFIG_USB_KAWETH is not set
+# CONFIG_USB_PEGASUS is not set
+# CONFIG_USB_RTL8150 is not set
+# CONFIG_USB_USBNET is not set
 # CONFIG_NET_PCMCIA is not set
-
-#
-# Wan interfaces
-#
 # CONFIG_WAN is not set
 # CONFIG_PPP is not set
 # CONFIG_SLIP is not set
-# CONFIG_SHAPER is not set
 # CONFIG_NETCONSOLE is not set
 # CONFIG_NETPOLL is not set
 # CONFIG_NET_POLL_CONTROLLER is not set
-
-#
-# ISDN subsystem
-#
 # CONFIG_ISDN is not set
 
 #
 # Input device support
 #
 CONFIG_INPUT=y
+# CONFIG_INPUT_FF_MEMLESS is not set
+# CONFIG_INPUT_POLLDEV is not set
 
 #
 # Userland interfaces
@@ -558,7 +619,6 @@ CONFIG_INPUT_MOUSEDEV_PSAUX=y
 CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
 CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
 # CONFIG_INPUT_JOYDEV is not set
-# CONFIG_INPUT_TSDEV is not set
 # CONFIG_INPUT_EVDEV is not set
 # CONFIG_INPUT_EVBUG is not set
 
@@ -568,6 +628,7 @@ CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
 # CONFIG_INPUT_KEYBOARD is not set
 # CONFIG_INPUT_MOUSE is not set
 # CONFIG_INPUT_JOYSTICK is not set
+# CONFIG_INPUT_TABLET is not set
 # CONFIG_INPUT_TOUCHSCREEN is not set
 # CONFIG_INPUT_MISC is not set
 
@@ -583,6 +644,7 @@ CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
 CONFIG_VT=y
 CONFIG_VT_CONSOLE=y
 CONFIG_HW_CONSOLE=y
+# CONFIG_VT_HW_CONSOLE_BINDING is not set
 # CONFIG_SERIAL_NONSTANDARD is not set
 
 #
@@ -595,64 +657,29 @@ CONFIG_HW_CONSOLE=y
 #
 CONFIG_SERIAL_ATMEL=y
 CONFIG_SERIAL_ATMEL_CONSOLE=y
+CONFIG_SERIAL_ATMEL_PDC=y
 # CONFIG_SERIAL_ATMEL_TTYAT is not set
 CONFIG_SERIAL_CORE=y
 CONFIG_SERIAL_CORE_CONSOLE=y
 CONFIG_UNIX98_PTYS=y
 CONFIG_LEGACY_PTYS=y
 CONFIG_LEGACY_PTY_COUNT=256
-
-#
-# IPMI
-#
 # CONFIG_IPMI_HANDLER is not set
-
-#
-# Watchdog Cards
-#
-CONFIG_WATCHDOG=y
-CONFIG_WATCHDOG_NOWAYOUT=y
-
-#
-# Watchdog Device Drivers
-#
-# CONFIG_SOFT_WATCHDOG is not set
-CONFIG_AT91RM9200_WATCHDOG=y
-
-#
-# USB-based Watchdog Cards
-#
-# CONFIG_USBPCWATCHDOG is not set
+CONFIG_HW_RANDOM=m
 # CONFIG_NVRAM is not set
-CONFIG_RTC=y
-# CONFIG_AT91RM9200_RTC is not set
-# CONFIG_DTLK is not set
 # CONFIG_R3964 is not set
 
-#
-# Ftape, the floppy tape device driver
-#
-
 #
 # PCMCIA character devices
 #
 # CONFIG_SYNCLINK_CS is not set
 # CONFIG_CARDMAN_4000 is not set
 # CONFIG_CARDMAN_4040 is not set
+# CONFIG_IPWIRELESS is not set
 # CONFIG_RAW_DRIVER is not set
-
-#
-# TPM devices
-#
 # CONFIG_TCG_TPM is not set
-# CONFIG_TELCLOCK is not set
-CONFIG_AT91_SPI=y
-CONFIG_AT91_SPIDEV=y
-
-#
-# I2C support
-#
 CONFIG_I2C=y
+CONFIG_I2C_BOARDINFO=y
 CONFIG_I2C_CHARDEV=y
 
 #
@@ -665,43 +692,53 @@ CONFIG_I2C_CHARDEV=y
 #
 # I2C Hardware Bus support
 #
-CONFIG_I2C_AT91=y
+# CONFIG_I2C_GPIO is not set
+# CONFIG_I2C_OCORES is not set
 # CONFIG_I2C_PARPORT_LIGHT is not set
+# CONFIG_I2C_SIMTEC is not set
+# CONFIG_I2C_TAOS_EVM is not set
 # CONFIG_I2C_STUB is not set
-# CONFIG_I2C_PCA_ISA is not set
+# CONFIG_I2C_TINY_USB is not set
 
 #
 # Miscellaneous I2C Chip support
 #
-# CONFIG_SENSORS_DS1337 is not set
-# CONFIG_SENSORS_DS1374 is not set
+# CONFIG_DS1682 is not set
 # CONFIG_SENSORS_EEPROM is not set
 # CONFIG_SENSORS_PCF8574 is not set
-# CONFIG_SENSORS_PCA9539 is not set
+# CONFIG_PCF8575 is not set
 # CONFIG_SENSORS_PCF8591 is not set
-# CONFIG_SENSORS_RTC8564 is not set
+# CONFIG_TPS65010 is not set
 # CONFIG_SENSORS_MAX6875 is not set
-# CONFIG_RTC_X1205_I2C is not set
+# CONFIG_SENSORS_TSL2550 is not set
 # CONFIG_I2C_DEBUG_CORE is not set
 # CONFIG_I2C_DEBUG_ALGO is not set
 # CONFIG_I2C_DEBUG_BUS is not set
 # CONFIG_I2C_DEBUG_CHIP is not set
 
 #
-# Hardware Monitoring support
+# SPI support
 #
+# CONFIG_SPI is not set
+# CONFIG_SPI_MASTER is not set
+# CONFIG_W1 is not set
+# CONFIG_POWER_SUPPLY is not set
 CONFIG_HWMON=y
 # CONFIG_HWMON_VID is not set
+# CONFIG_SENSORS_AD7418 is not set
 # CONFIG_SENSORS_ADM1021 is not set
 # CONFIG_SENSORS_ADM1025 is not set
 # CONFIG_SENSORS_ADM1026 is not set
+# CONFIG_SENSORS_ADM1029 is not set
 # CONFIG_SENSORS_ADM1031 is not set
 # CONFIG_SENSORS_ADM9240 is not set
-# CONFIG_SENSORS_ASB100 is not set
+# CONFIG_SENSORS_ADT7470 is not set
+# CONFIG_SENSORS_ADT7473 is not set
 # CONFIG_SENSORS_ATXP1 is not set
 # CONFIG_SENSORS_DS1621 is not set
-# CONFIG_SENSORS_FSCHER is not set
-# CONFIG_SENSORS_FSCPOS is not set
+# CONFIG_SENSORS_F71805F is not set
+# CONFIG_SENSORS_F71882FG is not set
+# CONFIG_SENSORS_F75375S is not set
 # CONFIG_SENSORS_GL518SM is not set
 # CONFIG_SENSORS_GL520SM is not set
 # CONFIG_SENSORS_IT87 is not set
@@ -715,39 +752,72 @@ CONFIG_HWMON=y
 # CONFIG_SENSORS_LM87 is not set
 # CONFIG_SENSORS_LM90 is not set
 # CONFIG_SENSORS_LM92 is not set
+# CONFIG_SENSORS_LM93 is not set
 # CONFIG_SENSORS_MAX1619 is not set
+# CONFIG_SENSORS_MAX6650 is not set
 # CONFIG_SENSORS_PC87360 is not set
+# CONFIG_SENSORS_PC87427 is not set
+# CONFIG_SENSORS_DME1737 is not set
 # CONFIG_SENSORS_SMSC47M1 is not set
+# CONFIG_SENSORS_SMSC47M192 is not set
 # CONFIG_SENSORS_SMSC47B397 is not set
+# CONFIG_SENSORS_ADS7828 is not set
+# CONFIG_SENSORS_THMC50 is not set
+# CONFIG_SENSORS_VT1211 is not set
 # CONFIG_SENSORS_W83781D is not set
+# CONFIG_SENSORS_W83791D is not set
 # CONFIG_SENSORS_W83792D is not set
+# CONFIG_SENSORS_W83793 is not set
 # CONFIG_SENSORS_W83L785TS is not set
+# CONFIG_SENSORS_W83L786NG is not set
 # CONFIG_SENSORS_W83627HF is not set
 # CONFIG_SENSORS_W83627EHF is not set
 # CONFIG_HWMON_DEBUG_CHIP is not set
+CONFIG_WATCHDOG=y
+CONFIG_WATCHDOG_NOWAYOUT=y
 
 #
-# Misc devices
+# Watchdog Device Drivers
 #
+# CONFIG_SOFT_WATCHDOG is not set
+CONFIG_AT91RM9200_WATCHDOG=y
 
 #
-# Multimedia Capabilities Port drivers
+# USB-based Watchdog Cards
 #
+# CONFIG_USBPCWATCHDOG is not set
 
 #
-# Multimedia devices
+# Sonics Silicon Backplane
 #
-# CONFIG_VIDEO_DEV is not set
+CONFIG_SSB_POSSIBLE=y
+# CONFIG_SSB is not set
 
 #
-# Digital Video Broadcasting Devices
+# Multifunction device drivers
 #
-# CONFIG_DVB is not set
+# CONFIG_MFD_SM501 is not set
+# CONFIG_MFD_ASIC3 is not set
+
+#
+# Multimedia devices
+#
+# CONFIG_VIDEO_DEV is not set
+# CONFIG_DVB_CORE is not set
+# CONFIG_DAB is not set
 
 #
 # Graphics support
 #
+# CONFIG_VGASTATE is not set
+# CONFIG_VIDEO_OUTPUT_CONTROL is not set
 # CONFIG_FB is not set
+# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
+
+#
+# Display device support
+#
+# CONFIG_DISPLAY_SUPPORT is not set
 
 #
 # Console display driver support
@@ -759,20 +829,34 @@ CONFIG_DUMMY_CONSOLE=y
 # Sound
 #
 # CONFIG_SOUND is not set
+CONFIG_HID_SUPPORT=y
+CONFIG_HID=y
+CONFIG_HID_DEBUG=y
+# CONFIG_HIDRAW is not set
 
 #
-# USB support
+# USB Input Devices
 #
+# CONFIG_USB_HID is not set
+
+#
+# USB HID Boot Protocol drivers
+#
+# CONFIG_USB_KBD is not set
+# CONFIG_USB_MOUSE is not set
+CONFIG_USB_SUPPORT=y
 CONFIG_USB_ARCH_HAS_HCD=y
 CONFIG_USB_ARCH_HAS_OHCI=y
+# CONFIG_USB_ARCH_HAS_EHCI is not set
 CONFIG_USB=y
 CONFIG_USB_DEBUG=y
+# CONFIG_USB_ANNOUNCE_NEW_DEVICES is not set
 
 #
 # Miscellaneous USB options
 #
 CONFIG_USB_DEVICEFS=y
-# CONFIG_USB_BANDWIDTH is not set
+CONFIG_USB_DEVICE_CLASS=y
 # CONFIG_USB_DYNAMIC_MINORS is not set
 # CONFIG_USB_OTG is not set
 
@@ -781,9 +865,11 @@ CONFIG_USB_DEVICEFS=y
 #
 # CONFIG_USB_ISP116X_HCD is not set
 CONFIG_USB_OHCI_HCD=y
-# CONFIG_USB_OHCI_BIG_ENDIAN is not set
+# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set
+# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set
 CONFIG_USB_OHCI_LITTLE_ENDIAN=y
 # CONFIG_USB_SL811_HCD is not set
+# CONFIG_USB_R8A66597_HCD is not set
 
 #
 # USB Device Class drivers
@@ -802,80 +888,42 @@ CONFIG_USB_STORAGE=y
 # CONFIG_USB_STORAGE_DEBUG is not set
 # CONFIG_USB_STORAGE_DATAFAB is not set
 # CONFIG_USB_STORAGE_FREECOM is not set
+# CONFIG_USB_STORAGE_ISD200 is not set
 # CONFIG_USB_STORAGE_DPCM is not set
 # CONFIG_USB_STORAGE_USBAT is not set
 # CONFIG_USB_STORAGE_SDDR09 is not set
 # CONFIG_USB_STORAGE_SDDR55 is not set
 # CONFIG_USB_STORAGE_JUMPSHOT is not set
-
-#
-# USB Input Devices
-#
-# CONFIG_USB_HID is not set
-
-#
-# USB HID Boot Protocol drivers
-#
-# CONFIG_USB_KBD is not set
-# CONFIG_USB_MOUSE is not set
-# CONFIG_USB_AIPTEK is not set
-# CONFIG_USB_WACOM is not set
-# CONFIG_USB_ACECAD is not set
-# CONFIG_USB_KBTAB is not set
-# CONFIG_USB_POWERMATE is not set
-# CONFIG_USB_MTOUCH is not set
-# CONFIG_USB_ITMTOUCH is not set
-# CONFIG_USB_EGALAX is not set
-# CONFIG_USB_YEALINK is not set
-# CONFIG_USB_XPAD is not set
-# CONFIG_USB_ATI_REMOTE is not set
-# CONFIG_USB_KEYSPAN_REMOTE is not set
-# CONFIG_USB_APPLETOUCH is not set
+# CONFIG_USB_STORAGE_ALAUDA is not set
+# CONFIG_USB_STORAGE_KARMA is not set
+# CONFIG_USB_LIBUSUAL is not set
 
 #
 # USB Imaging devices
 #
 # CONFIG_USB_MDC800 is not set
 # CONFIG_USB_MICROTEK is not set
-
-#
-# USB Multimedia devices
-#
-# CONFIG_USB_DABUSB is not set
-
-#
-# Video4Linux support is needed for USB Multimedia device support
-#
-
-#
-# USB Network Adapters
-#
-# CONFIG_USB_CATC is not set
-# CONFIG_USB_KAWETH is not set
-# CONFIG_USB_PEGASUS is not set
-# CONFIG_USB_RTL8150 is not set
-# CONFIG_USB_USBNET is not set
 CONFIG_USB_MON=y
 
 #
 # USB port drivers
 #
-
-#
-# USB Serial Converter support
-#
 CONFIG_USB_SERIAL=y
 CONFIG_USB_SERIAL_CONSOLE=y
+CONFIG_USB_EZUSB=y
 CONFIG_USB_SERIAL_GENERIC=y
+# CONFIG_USB_SERIAL_AIRCABLE is not set
 # CONFIG_USB_SERIAL_AIRPRIME is not set
-# CONFIG_USB_SERIAL_ANYDATA is not set
+# CONFIG_USB_SERIAL_ARK3116 is not set
 # CONFIG_USB_SERIAL_BELKIN is not set
+# CONFIG_USB_SERIAL_CH341 is not set
 # CONFIG_USB_SERIAL_WHITEHEAT is not set
 # CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set
 # CONFIG_USB_SERIAL_CP2101 is not set
 # CONFIG_USB_SERIAL_CYPRESS_M8 is not set
 # CONFIG_USB_SERIAL_EMPEG is not set
 CONFIG_USB_SERIAL_FTDI_SIO=y
+# CONFIG_USB_SERIAL_FUNSOFT is not set
 # CONFIG_USB_SERIAL_VISOR is not set
 # CONFIG_USB_SERIAL_IPAQ is not set
 # CONFIG_USB_SERIAL_IR is not set
@@ -883,6 +931,7 @@ CONFIG_USB_SERIAL_FTDI_SIO=y
 # CONFIG_USB_SERIAL_EDGEPORT_TI is not set
 # CONFIG_USB_SERIAL_GARMIN is not set
 # CONFIG_USB_SERIAL_IPW is not set
+# CONFIG_USB_SERIAL_IUU is not set
 # CONFIG_USB_SERIAL_KEYSPAN_PDA is not set
 CONFIG_USB_SERIAL_KEYSPAN=y
 CONFIG_USB_SERIAL_KEYSPAN_MPR=y
@@ -900,46 +949,66 @@ CONFIG_USB_SERIAL_KEYSPAN_USA49WLC=y
 # CONFIG_USB_SERIAL_KLSI is not set
 # CONFIG_USB_SERIAL_KOBIL_SCT is not set
 CONFIG_USB_SERIAL_MCT_U232=y
+# CONFIG_USB_SERIAL_MOS7720 is not set
+# CONFIG_USB_SERIAL_MOS7840 is not set
+# CONFIG_USB_SERIAL_NAVMAN is not set
 # CONFIG_USB_SERIAL_PL2303 is not set
+# CONFIG_USB_SERIAL_OTI6858 is not set
 # CONFIG_USB_SERIAL_HP4X is not set
 # CONFIG_USB_SERIAL_SAFE is not set
+# CONFIG_USB_SERIAL_SIERRAWIRELESS is not set
 # CONFIG_USB_SERIAL_TI is not set
 # CONFIG_USB_SERIAL_CYBERJACK is not set
 # CONFIG_USB_SERIAL_XIRCOM is not set
 # CONFIG_USB_SERIAL_OPTION is not set
 # CONFIG_USB_SERIAL_OMNINET is not set
-CONFIG_USB_EZUSB=y
+# CONFIG_USB_SERIAL_DEBUG is not set
 
 #
 # USB Miscellaneous drivers
 #
 # CONFIG_USB_EMI62 is not set
 # CONFIG_USB_EMI26 is not set
+# CONFIG_USB_ADUTUX is not set
 # CONFIG_USB_AUERSWALD is not set
 # CONFIG_USB_RIO500 is not set
 # CONFIG_USB_LEGOTOWER is not set
 # CONFIG_USB_LCD is not set
+# CONFIG_USB_BERRY_CHARGE is not set
 # CONFIG_USB_LED is not set
+# CONFIG_USB_CYPRESS_CY7C63 is not set
 # CONFIG_USB_CYTHERM is not set
-# CONFIG_USB_PHIDGETKIT is not set
-# CONFIG_USB_PHIDGETSERVO is not set
+# CONFIG_USB_PHIDGET is not set
 # CONFIG_USB_IDMOUSE is not set
+# CONFIG_USB_FTDI_ELAN is not set
+# CONFIG_USB_APPLEDISPLAY is not set
 # CONFIG_USB_LD is not set
+# CONFIG_USB_TRANCEVIBRATOR is not set
+# CONFIG_USB_IOWARRIOR is not set
 # CONFIG_USB_TEST is not set
+# CONFIG_USB_GADGET is not set
+# CONFIG_MMC is not set
+CONFIG_NEW_LEDS=y
+CONFIG_LEDS_CLASS=y
 
 #
-# USB DSL modem support
+# LED drivers
 #
+CONFIG_LEDS_GPIO=y
 
 #
-# USB Gadget Support
+# LED Triggers
 #
-# CONFIG_USB_GADGET is not set
+CONFIG_LEDS_TRIGGERS=y
+# CONFIG_LEDS_TRIGGER_TIMER is not set
+CONFIG_LEDS_TRIGGER_HEARTBEAT=y
+CONFIG_RTC_LIB=y
+# CONFIG_RTC_CLASS is not set
 
 #
-# MMC/SD Card support
+# Userspace I/O
 #
-# CONFIG_MMC is not set
+# CONFIG_UIO is not set
 
 #
 # File systems
@@ -948,16 +1017,17 @@ CONFIG_EXT2_FS=y
 # CONFIG_EXT2_FS_XATTR is not set
 # CONFIG_EXT2_FS_XIP is not set
 # CONFIG_EXT3_FS is not set
-# CONFIG_JBD is not set
+# CONFIG_EXT4DEV_FS is not set
 # CONFIG_REISERFS_FS is not set
 # CONFIG_JFS_FS is not set
 # CONFIG_FS_POSIX_ACL is not set
 # CONFIG_XFS_FS is not set
-# CONFIG_MINIX_FS is not set
-# CONFIG_ROMFS_FS is not set
+# CONFIG_GFS2_FS is not set
+# CONFIG_OCFS2_FS is not set
+CONFIG_DNOTIFY=y
 CONFIG_INOTIFY=y
+CONFIG_INOTIFY_USER=y
 # CONFIG_QUOTA is not set
-CONFIG_DNOTIFY=y
 # CONFIG_AUTOFS_FS is not set
 # CONFIG_AUTOFS4_FS is not set
 # CONFIG_FUSE_FS is not set
@@ -979,11 +1049,12 @@ CONFIG_DNOTIFY=y
 # Pseudo filesystems
 #
 CONFIG_PROC_FS=y
+CONFIG_PROC_SYSCTL=y
 CONFIG_SYSFS=y
 CONFIG_TMPFS=y
+# CONFIG_TMPFS_POSIX_ACL is not set
 # CONFIG_HUGETLB_PAGE is not set
-CONFIG_RAMFS=y
-# CONFIG_RELAYFS_FS is not set
+# CONFIG_CONFIGFS_FS is not set
 
 #
 # Miscellaneous filesystems
@@ -995,18 +1066,16 @@ CONFIG_RAMFS=y
 # CONFIG_BEFS_FS is not set
 # CONFIG_BFS_FS is not set
 # CONFIG_EFS_FS is not set
-# CONFIG_JFFS_FS is not set
 # CONFIG_JFFS2_FS is not set
 CONFIG_CRAMFS=y
 # CONFIG_VXFS_FS is not set
+# CONFIG_MINIX_FS is not set
 # CONFIG_HPFS_FS is not set
 # CONFIG_QNX4FS_FS is not set
+# CONFIG_ROMFS_FS is not set
 # CONFIG_SYSV_FS is not set
 # CONFIG_UFS_FS is not set
-
-#
-# Network File Systems
-#
+CONFIG_NETWORK_FILESYSTEMS=y
 CONFIG_NFS_FS=y
 CONFIG_NFS_V3=y
 # CONFIG_NFS_V3_ACL is not set
@@ -1019,6 +1088,7 @@ CONFIG_LOCKD_V4=y
 CONFIG_NFS_COMMON=y
 CONFIG_SUNRPC=y
 CONFIG_SUNRPC_GSS=y
+# CONFIG_SUNRPC_BIND34 is not set
 CONFIG_RPCSEC_GSS_KRB5=y
 # CONFIG_RPCSEC_GSS_SPKM3 is not set
 # CONFIG_SMB_FS is not set
@@ -1026,45 +1096,57 @@ CONFIG_RPCSEC_GSS_KRB5=y
 # CONFIG_NCP_FS is not set
 # CONFIG_CODA_FS is not set
 # CONFIG_AFS_FS is not set
-# CONFIG_9P_FS is not set
 
 #
 # Partition Types
 #
 # CONFIG_PARTITION_ADVANCED is not set
 CONFIG_MSDOS_PARTITION=y
-
-#
-# Native Language Support
-#
 # CONFIG_NLS is not set
-
-#
-# Profiling support
-#
-# CONFIG_PROFILING is not set
+# CONFIG_DLM is not set
 
 #
 # Kernel hacking
 #
 # CONFIG_PRINTK_TIME is not set
-CONFIG_DEBUG_KERNEL=y
+CONFIG_ENABLE_WARN_DEPRECATED=y
+CONFIG_ENABLE_MUST_CHECK=y
 # CONFIG_MAGIC_SYSRQ is not set
-CONFIG_LOG_BUF_SHIFT=14
+# CONFIG_UNUSED_SYMBOLS is not set
+# CONFIG_DEBUG_FS is not set
+# CONFIG_HEADERS_CHECK is not set
+CONFIG_DEBUG_KERNEL=y
+# CONFIG_DEBUG_SHIRQ is not set
 CONFIG_DETECT_SOFTLOCKUP=y
+CONFIG_SCHED_DEBUG=y
 # CONFIG_SCHEDSTATS is not set
-# CONFIG_DEBUG_SLAB is not set
+# CONFIG_TIMER_STATS is not set
+# CONFIG_SLUB_DEBUG_ON is not set
+# CONFIG_SLUB_STATS is not set
+# CONFIG_DEBUG_RT_MUTEXES is not set
+# CONFIG_RT_MUTEX_TESTER is not set
 # CONFIG_DEBUG_SPINLOCK is not set
+# CONFIG_DEBUG_MUTEXES is not set
+# CONFIG_DEBUG_LOCK_ALLOC is not set
+# CONFIG_PROVE_LOCKING is not set
+# CONFIG_LOCK_STAT is not set
 # CONFIG_DEBUG_SPINLOCK_SLEEP is not set
+# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
 # CONFIG_DEBUG_KOBJECT is not set
 CONFIG_DEBUG_BUGVERBOSE=y
 # CONFIG_DEBUG_INFO is not set
-# CONFIG_DEBUG_FS is not set
 # CONFIG_DEBUG_VM is not set
+# CONFIG_DEBUG_LIST is not set
+# CONFIG_DEBUG_SG is not set
 CONFIG_FRAME_POINTER=y
+# CONFIG_BOOT_PRINTK_DELAY is not set
 # CONFIG_RCU_TORTURE_TEST is not set
+# CONFIG_BACKTRACE_SELF_TEST is not set
+# CONFIG_FAULT_INJECTION is not set
+# CONFIG_SAMPLES is not set
 CONFIG_DEBUG_USER=y
 # CONFIG_DEBUG_ERRORS is not set
+# CONFIG_DEBUG_STACK_USAGE is not set
 CONFIG_DEBUG_LL=y
 # CONFIG_DEBUG_ICEDCC is not set
 
@@ -1073,12 +1155,14 @@ CONFIG_DEBUG_LL=y
 #
 # CONFIG_KEYS is not set
 # CONFIG_SECURITY is not set
-
-#
-# Cryptographic options
-#
+# CONFIG_SECURITY_FILE_CAPABILITIES is not set
 CONFIG_CRYPTO=y
+CONFIG_CRYPTO_ALGAPI=y
+CONFIG_CRYPTO_BLKCIPHER=y
+# CONFIG_CRYPTO_SEQIV is not set
+CONFIG_CRYPTO_MANAGER=y
 # CONFIG_CRYPTO_HMAC is not set
+# CONFIG_CRYPTO_XCBC is not set
 # CONFIG_CRYPTO_NULL is not set
 # CONFIG_CRYPTO_MD4 is not set
 CONFIG_CRYPTO_MD5=y
@@ -1087,7 +1171,18 @@ CONFIG_CRYPTO_MD5=y
 # CONFIG_CRYPTO_SHA512 is not set
 # CONFIG_CRYPTO_WP512 is not set
 # CONFIG_CRYPTO_TGR192 is not set
+# CONFIG_CRYPTO_GF128MUL is not set
+# CONFIG_CRYPTO_ECB is not set
+CONFIG_CRYPTO_CBC=y
+# CONFIG_CRYPTO_PCBC is not set
+# CONFIG_CRYPTO_LRW is not set
+# CONFIG_CRYPTO_XTS is not set
+# CONFIG_CRYPTO_CTR is not set
+# CONFIG_CRYPTO_GCM is not set
+# CONFIG_CRYPTO_CCM is not set
+# CONFIG_CRYPTO_CRYPTD is not set
 CONFIG_CRYPTO_DES=y
+# CONFIG_CRYPTO_FCRYPT is not set
 # CONFIG_CRYPTO_BLOWFISH is not set
 # CONFIG_CRYPTO_TWOFISH is not set
 # CONFIG_CRYPTO_SERPENT is not set
@@ -1098,20 +1193,29 @@ CONFIG_CRYPTO_DES=y
 # CONFIG_CRYPTO_ARC4 is not set
 # CONFIG_CRYPTO_KHAZAD is not set
 # CONFIG_CRYPTO_ANUBIS is not set
+# CONFIG_CRYPTO_SEED is not set
+# CONFIG_CRYPTO_SALSA20 is not set
 # CONFIG_CRYPTO_DEFLATE is not set
 # CONFIG_CRYPTO_MICHAEL_MIC is not set
 # CONFIG_CRYPTO_CRC32C is not set
+# CONFIG_CRYPTO_CAMELLIA is not set
 # CONFIG_CRYPTO_TEST is not set
-
-#
-# Hardware crypto devices
-#
+# CONFIG_CRYPTO_AUTHENC is not set
+# CONFIG_CRYPTO_LZO is not set
+CONFIG_CRYPTO_HW=y
 
 #
 # Library routines
 #
+CONFIG_BITREVERSE=y
 # CONFIG_CRC_CCITT is not set
 # CONFIG_CRC16 is not set
+# CONFIG_CRC_ITU_T is not set
 CONFIG_CRC32=y
+# CONFIG_CRC7 is not set
 # CONFIG_LIBCRC32C is not set
 CONFIG_ZLIB_INFLATE=y
+CONFIG_PLIST=y
+CONFIG_HAS_IOMEM=y
+CONFIG_HAS_IOPORT=y
+CONFIG_HAS_DMA=y
diff --git a/arch/arm/configs/ecbat91_defconfig b/arch/arm/configs/ecbat91_defconfig
new file mode 100644 (file)
index 0000000..90ed214
--- /dev/null
@@ -0,0 +1,1315 @@
+#
+# Automatically generated make config: don't edit
+# Linux kernel version: 2.6.22-rc4
+# Sat Jun  9 01:30:18 2007
+#
+CONFIG_ARM=y
+CONFIG_SYS_SUPPORTS_APM_EMULATION=y
+CONFIG_GENERIC_GPIO=y
+# CONFIG_GENERIC_TIME is not set
+# CONFIG_GENERIC_CLOCKEVENTS is not set
+CONFIG_MMU=y
+# CONFIG_NO_IOPORT is not set
+CONFIG_GENERIC_HARDIRQS=y
+CONFIG_STACKTRACE_SUPPORT=y
+CONFIG_LOCKDEP_SUPPORT=y
+CONFIG_TRACE_IRQFLAGS_SUPPORT=y
+CONFIG_HARDIRQS_SW_RESEND=y
+CONFIG_GENERIC_IRQ_PROBE=y
+CONFIG_RWSEM_GENERIC_SPINLOCK=y
+# CONFIG_ARCH_HAS_ILOG2_U32 is not set
+# CONFIG_ARCH_HAS_ILOG2_U64 is not set
+CONFIG_GENERIC_HWEIGHT=y
+CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_ZONE_DMA=y
+CONFIG_VECTORS_BASE=0xffff0000
+CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
+
+#
+# Code maturity level options
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_BROKEN_ON_SMP=y
+CONFIG_LOCK_KERNEL=y
+CONFIG_INIT_ENV_ARG_LIMIT=32
+
+#
+# General setup
+#
+CONFIG_LOCALVERSION=""
+CONFIG_LOCALVERSION_AUTO=y
+CONFIG_SWAP=y
+CONFIG_SYSVIPC=y
+# CONFIG_IPC_NS is not set
+CONFIG_SYSVIPC_SYSCTL=y
+# CONFIG_POSIX_MQUEUE is not set
+# CONFIG_BSD_PROCESS_ACCT is not set
+# CONFIG_TASKSTATS is not set
+# CONFIG_UTS_NS is not set
+# CONFIG_AUDIT is not set
+CONFIG_IKCONFIG=y
+CONFIG_IKCONFIG_PROC=y
+CONFIG_LOG_BUF_SHIFT=14
+CONFIG_SYSFS_DEPRECATED=y
+# CONFIG_RELAY is not set
+# CONFIG_BLK_DEV_INITRD is not set
+CONFIG_CC_OPTIMIZE_FOR_SIZE=y
+CONFIG_SYSCTL=y
+# CONFIG_EMBEDDED is not set
+CONFIG_UID16=y
+CONFIG_SYSCTL_SYSCALL=y
+CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_EXTRA_PASS is not set
+CONFIG_HOTPLUG=y
+CONFIG_PRINTK=y
+CONFIG_BUG=y
+CONFIG_ELF_CORE=y
+CONFIG_BASE_FULL=y
+CONFIG_FUTEX=y
+CONFIG_ANON_INODES=y
+CONFIG_EPOLL=y
+CONFIG_SIGNALFD=y
+CONFIG_TIMERFD=y
+CONFIG_EVENTFD=y
+CONFIG_SHMEM=y
+CONFIG_VM_EVENT_COUNTERS=y
+CONFIG_SLAB=y
+# CONFIG_SLUB is not set
+# CONFIG_SLOB is not set
+CONFIG_RT_MUTEXES=y
+# CONFIG_TINY_SHMEM is not set
+CONFIG_BASE_SMALL=0
+
+#
+# Loadable module support
+#
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+# CONFIG_MODULE_FORCE_UNLOAD is not set
+# CONFIG_MODVERSIONS is not set
+# CONFIG_MODULE_SRCVERSION_ALL is not set
+CONFIG_KMOD=y
+
+#
+# Block layer
+#
+CONFIG_BLOCK=y
+# CONFIG_LBD is not set
+# CONFIG_BLK_DEV_IO_TRACE is not set
+# CONFIG_LSF is not set
+
+#
+# IO Schedulers
+#
+CONFIG_IOSCHED_NOOP=y
+CONFIG_IOSCHED_AS=y
+# CONFIG_IOSCHED_DEADLINE is not set
+# CONFIG_IOSCHED_CFQ is not set
+CONFIG_DEFAULT_AS=y
+# CONFIG_DEFAULT_DEADLINE is not set
+# CONFIG_DEFAULT_CFQ is not set
+# CONFIG_DEFAULT_NOOP is not set
+CONFIG_DEFAULT_IOSCHED="anticipatory"
+
+#
+# System Type
+#
+# CONFIG_ARCH_AAEC2000 is not set
+# CONFIG_ARCH_INTEGRATOR is not set
+# CONFIG_ARCH_REALVIEW is not set
+# CONFIG_ARCH_VERSATILE is not set
+CONFIG_ARCH_AT91=y
+# CONFIG_ARCH_CLPS7500 is not set
+# CONFIG_ARCH_CLPS711X is not set
+# CONFIG_ARCH_CO285 is not set
+# CONFIG_ARCH_EBSA110 is not set
+# CONFIG_ARCH_EP93XX is not set
+# CONFIG_ARCH_FOOTBRIDGE is not set
+# CONFIG_ARCH_NETX is not set
+# CONFIG_ARCH_H720X is not set
+# CONFIG_ARCH_IMX is not set
+# CONFIG_ARCH_IOP13XX is not set
+# CONFIG_ARCH_IOP32X is not set
+# CONFIG_ARCH_IOP33X is not set
+# CONFIG_ARCH_IXP23XX is not set
+# CONFIG_ARCH_IXP2000 is not set
+# CONFIG_ARCH_IXP4XX is not set
+# CONFIG_ARCH_L7200 is not set
+# CONFIG_ARCH_KS8695 is not set
+# CONFIG_ARCH_NS9XXX is not set
+# CONFIG_ARCH_PNX4008 is not set
+# CONFIG_ARCH_PXA is not set
+# CONFIG_ARCH_RPC is not set
+# CONFIG_ARCH_SA1100 is not set
+# CONFIG_ARCH_S3C2410 is not set
+# CONFIG_ARCH_SHARK is not set
+# CONFIG_ARCH_LH7A40X is not set
+# CONFIG_ARCH_DAVINCI is not set
+# CONFIG_ARCH_OMAP is not set
+
+#
+# Atmel AT91 System-on-Chip
+#
+CONFIG_ARCH_AT91RM9200=y
+# CONFIG_ARCH_AT91SAM9260 is not set
+# CONFIG_ARCH_AT91SAM9261 is not set
+# CONFIG_ARCH_AT91SAM9263 is not set
+# CONFIG_ARCH_AT91SAM9RL is not set
+
+#
+# AT91RM9200 Board Type
+#
+# CONFIG_MACH_ONEARM is not set
+# CONFIG_ARCH_AT91RM9200DK is not set
+# CONFIG_MACH_AT91RM9200EK is not set
+# CONFIG_MACH_CSB337 is not set
+# CONFIG_MACH_CSB637 is not set
+# CONFIG_MACH_CARMEVA is not set
+# CONFIG_MACH_ATEB9200 is not set
+# CONFIG_MACH_KB9200 is not set
+# CONFIG_MACH_PICOTUX2XX is not set
+# CONFIG_MACH_KAFA is not set
+# CONFIG_MACH_CHUB is not set
+CONFIG_MACH_ECBAT91=y
+
+#
+# AT91 Board Options
+#
+# CONFIG_MTD_AT91_DATAFLASH_CARD is not set
+
+#
+# AT91 Feature Selections
+#
+CONFIG_AT91_PROGRAMMABLE_CLOCKS=y
+# CONFIG_ATMEL_TCLIB is not set
+
+#
+# Processor Type
+#
+CONFIG_CPU_32=y
+CONFIG_CPU_ARM920T=y
+CONFIG_CPU_32v4T=y
+CONFIG_CPU_ABRT_EV4T=y
+CONFIG_CPU_CACHE_V4WT=y
+CONFIG_CPU_CACHE_VIVT=y
+CONFIG_CPU_COPY_V4WB=y
+CONFIG_CPU_TLB_V4WBI=y
+CONFIG_CPU_CP15=y
+CONFIG_CPU_CP15_MMU=y
+
+#
+# Processor Features
+#
+CONFIG_ARM_THUMB=y
+# CONFIG_CPU_ICACHE_DISABLE is not set
+# CONFIG_CPU_DCACHE_DISABLE is not set
+# CONFIG_CPU_DCACHE_WRITETHROUGH is not set
+# CONFIG_OUTER_CACHE is not set
+
+#
+# Bus support
+#
+# CONFIG_ARCH_SUPPORTS_MSI is not set
+
+#
+# PCCARD (PCMCIA/CardBus) support
+#
+CONFIG_PCCARD=y
+# CONFIG_PCMCIA_DEBUG is not set
+CONFIG_PCMCIA=y
+CONFIG_PCMCIA_LOAD_CIS=y
+CONFIG_PCMCIA_IOCTL=y
+
+#
+# PC-card bridges
+#
+CONFIG_AT91_CF=y
+
+#
+# Kernel Features
+#
+# CONFIG_TICK_ONESHOT is not set
+CONFIG_PREEMPT=y
+# CONFIG_NO_IDLE_HZ is not set
+CONFIG_HZ=100
+# CONFIG_AEABI is not set
+# CONFIG_ARCH_DISCONTIGMEM_ENABLE is not set
+CONFIG_SELECT_MEMORY_MODEL=y
+CONFIG_FLATMEM_MANUAL=y
+# CONFIG_DISCONTIGMEM_MANUAL is not set
+# CONFIG_SPARSEMEM_MANUAL is not set
+CONFIG_FLATMEM=y
+CONFIG_FLAT_NODE_MEM_MAP=y
+# CONFIG_SPARSEMEM_STATIC is not set
+CONFIG_SPLIT_PTLOCK_CPUS=4096
+# CONFIG_RESOURCES_64BIT is not set
+CONFIG_ZONE_DMA_FLAG=1
+CONFIG_LEDS=y
+CONFIG_LEDS_TIMER=y
+CONFIG_LEDS_CPU=y
+CONFIG_ALIGNMENT_TRAP=y
+
+#
+# Boot options
+#
+CONFIG_ZBOOT_ROM_TEXT=0x0
+CONFIG_ZBOOT_ROM_BSS=0x0
+CONFIG_CMDLINE="rootfstype=reiserfs root=/dev/mmcblk0p1 console=ttyS0,115200n8 rootdelay=1"
+# CONFIG_XIP_KERNEL is not set
+# CONFIG_KEXEC is not set
+
+#
+# Floating point emulation
+#
+
+#
+# At least one emulation must be selected
+#
+CONFIG_FPE_NWFPE=y
+# CONFIG_FPE_NWFPE_XP is not set
+# CONFIG_FPE_FASTFPE is not set
+
+#
+# Userspace binary formats
+#
+CONFIG_BINFMT_ELF=y
+# CONFIG_BINFMT_AOUT is not set
+# CONFIG_BINFMT_MISC is not set
+# CONFIG_ARTHUR is not set
+
+#
+# Power management options
+#
+# CONFIG_PM is not set
+
+#
+# Networking
+#
+CONFIG_NET=y
+
+#
+# Networking options
+#
+CONFIG_PACKET=y
+# CONFIG_PACKET_MMAP is not set
+CONFIG_UNIX=y
+CONFIG_XFRM=y
+# CONFIG_XFRM_USER is not set
+# CONFIG_XFRM_SUB_POLICY is not set
+# CONFIG_XFRM_MIGRATE is not set
+# CONFIG_NET_KEY is not set
+CONFIG_INET=y
+# CONFIG_IP_MULTICAST is not set
+# CONFIG_IP_ADVANCED_ROUTER is not set
+CONFIG_IP_FIB_HASH=y
+CONFIG_IP_PNP=y
+CONFIG_IP_PNP_DHCP=y
+# CONFIG_IP_PNP_BOOTP is not set
+# CONFIG_IP_PNP_RARP is not set
+# CONFIG_NET_IPIP is not set
+# CONFIG_NET_IPGRE is not set
+# CONFIG_ARPD is not set
+# CONFIG_SYN_COOKIES is not set
+# CONFIG_INET_AH is not set
+# CONFIG_INET_ESP is not set
+# CONFIG_INET_IPCOMP is not set
+# CONFIG_INET_XFRM_TUNNEL is not set
+# CONFIG_INET_TUNNEL is not set
+CONFIG_INET_XFRM_MODE_TRANSPORT=y
+CONFIG_INET_XFRM_MODE_TUNNEL=y
+CONFIG_INET_XFRM_MODE_BEET=y
+CONFIG_INET_DIAG=y
+CONFIG_INET_TCP_DIAG=y
+# CONFIG_TCP_CONG_ADVANCED is not set
+CONFIG_TCP_CONG_CUBIC=y
+CONFIG_DEFAULT_TCP_CONG="cubic"
+# CONFIG_TCP_MD5SIG is not set
+# CONFIG_IPV6 is not set
+# CONFIG_INET6_XFRM_TUNNEL is not set
+# CONFIG_INET6_TUNNEL is not set
+# CONFIG_NETWORK_SECMARK is not set
+# CONFIG_NETFILTER is not set
+# CONFIG_IP_DCCP is not set
+# CONFIG_IP_SCTP is not set
+# CONFIG_TIPC is not set
+# CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
+# CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
+# CONFIG_LLC2 is not set
+# CONFIG_IPX is not set
+# CONFIG_ATALK is not set
+# CONFIG_X25 is not set
+# CONFIG_LAPB is not set
+# CONFIG_ECONET is not set
+# CONFIG_WAN_ROUTER is not set
+
+#
+# QoS and/or fair queueing
+#
+# CONFIG_NET_SCHED is not set
+CONFIG_NET_SCH_FIFO=y
+
+#
+# Network testing
+#
+# CONFIG_NET_PKTGEN is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
+# CONFIG_AF_RXRPC is not set
+
+#
+# Wireless
+#
+CONFIG_CFG80211=y
+CONFIG_WIRELESS_EXT=y
+CONFIG_MAC80211=y
+# CONFIG_MAC80211_DEBUG is not set
+CONFIG_IEEE80211=y
+# CONFIG_IEEE80211_DEBUG is not set
+CONFIG_IEEE80211_CRYPT_WEP=y
+# CONFIG_IEEE80211_CRYPT_CCMP is not set
+# CONFIG_IEEE80211_CRYPT_TKIP is not set
+CONFIG_IEEE80211_SOFTMAC=y
+CONFIG_IEEE80211_SOFTMAC_DEBUG=y
+# CONFIG_RFKILL is not set
+
+#
+# Device Drivers
+#
+
+#
+# Generic Driver Options
+#
+# CONFIG_STANDALONE is not set
+# CONFIG_PREVENT_FIRMWARE_BUILD is not set
+CONFIG_FW_LOADER=y
+# CONFIG_SYS_HYPERVISOR is not set
+
+#
+# Connector - unified userspace <-> kernelspace linker
+#
+# CONFIG_CONNECTOR is not set
+CONFIG_MTD=y
+# CONFIG_MTD_DEBUG is not set
+# CONFIG_MTD_CONCAT is not set
+CONFIG_MTD_PARTITIONS=y
+# CONFIG_MTD_REDBOOT_PARTS is not set
+CONFIG_MTD_CMDLINE_PARTS=y
+CONFIG_MTD_AFS_PARTS=y
+
+#
+# User Modules And Translation Layers
+#
+CONFIG_MTD_CHAR=y
+CONFIG_MTD_BLKDEVS=y
+CONFIG_MTD_BLOCK=y
+# CONFIG_FTL is not set
+# CONFIG_NFTL is not set
+# CONFIG_INFTL is not set
+# CONFIG_RFD_FTL is not set
+# CONFIG_SSFDC is not set
+
+#
+# RAM/ROM/Flash chip drivers
+#
+# CONFIG_MTD_CFI is not set
+# CONFIG_MTD_JEDECPROBE is not set
+CONFIG_MTD_MAP_BANK_WIDTH_1=y
+CONFIG_MTD_MAP_BANK_WIDTH_2=y
+CONFIG_MTD_MAP_BANK_WIDTH_4=y
+# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
+CONFIG_MTD_CFI_I1=y
+CONFIG_MTD_CFI_I2=y
+# CONFIG_MTD_CFI_I4 is not set
+# CONFIG_MTD_CFI_I8 is not set
+# CONFIG_MTD_RAM is not set
+# CONFIG_MTD_ROM is not set
+# CONFIG_MTD_ABSENT is not set
+
+#
+# Mapping drivers for chip access
+#
+# CONFIG_MTD_COMPLEX_MAPPINGS is not set
+# CONFIG_MTD_PLATRAM is not set
+
+#
+# Self-contained MTD device drivers
+#
+CONFIG_MTD_DATAFLASH=y
+# CONFIG_MTD_M25P80 is not set
+# CONFIG_MTD_SLRAM is not set
+# CONFIG_MTD_PHRAM is not set
+# CONFIG_MTD_MTDRAM is not set
+# CONFIG_MTD_BLOCK2MTD is not set
+
+#
+# Disk-On-Chip Device Drivers
+#
+# CONFIG_MTD_DOC2000 is not set
+# CONFIG_MTD_DOC2001 is not set
+# CONFIG_MTD_DOC2001PLUS is not set
+# CONFIG_MTD_NAND is not set
+# CONFIG_MTD_ONENAND is not set
+
+#
+# UBI - Unsorted block images
+#
+# CONFIG_MTD_UBI is not set
+
+#
+# Parallel port support
+#
+# CONFIG_PARPORT is not set
+
+#
+# Plug and Play support
+#
+# CONFIG_PNPACPI is not set
+
+#
+# Block devices
+#
+# CONFIG_BLK_DEV_COW_COMMON is not set
+CONFIG_BLK_DEV_LOOP=y
+# CONFIG_BLK_DEV_CRYPTOLOOP is not set
+# CONFIG_BLK_DEV_NBD is not set
+# CONFIG_BLK_DEV_UB is not set
+# CONFIG_BLK_DEV_RAM is not set
+# CONFIG_CDROM_PKTCDVD is not set
+# CONFIG_ATA_OVER_ETH is not set
+# CONFIG_IDE is not set
+
+#
+# SCSI device support
+#
+# CONFIG_RAID_ATTRS is not set
+CONFIG_SCSI=y
+# CONFIG_SCSI_TGT is not set
+# CONFIG_SCSI_NETLINK is not set
+CONFIG_SCSI_PROC_FS=y
+
+#
+# SCSI support type (disk, tape, CD-ROM)
+#
+CONFIG_BLK_DEV_SD=y
+# CONFIG_CHR_DEV_ST is not set
+# CONFIG_CHR_DEV_OSST is not set
+# CONFIG_BLK_DEV_SR is not set
+CONFIG_CHR_DEV_SG=y
+# CONFIG_CHR_DEV_SCH is not set
+
+#
+# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
+#
+# CONFIG_SCSI_MULTI_LUN is not set
+# CONFIG_SCSI_CONSTANTS is not set
+# CONFIG_SCSI_LOGGING is not set
+# CONFIG_SCSI_SCAN_ASYNC is not set
+CONFIG_SCSI_WAIT_SCAN=m
+
+#
+# SCSI Transports
+#
+# CONFIG_SCSI_SPI_ATTRS is not set
+# CONFIG_SCSI_FC_ATTRS is not set
+# CONFIG_SCSI_ISCSI_ATTRS is not set
+# CONFIG_SCSI_SAS_ATTRS is not set
+# CONFIG_SCSI_SAS_LIBSAS is not set
+
+#
+# SCSI low-level drivers
+#
+# CONFIG_ISCSI_TCP is not set
+# CONFIG_SCSI_DEBUG is not set
+
+#
+# PCMCIA SCSI adapter support
+#
+# CONFIG_PCMCIA_AHA152X is not set
+# CONFIG_PCMCIA_FDOMAIN is not set
+# CONFIG_PCMCIA_NINJA_SCSI is not set
+# CONFIG_PCMCIA_QLOGIC is not set
+# CONFIG_PCMCIA_SYM53C500 is not set
+# CONFIG_ATA is not set
+
+#
+# Multi-device support (RAID and LVM)
+#
+# CONFIG_MD is not set
+
+#
+# Network device support
+#
+CONFIG_NETDEVICES=y
+# CONFIG_DUMMY is not set
+# CONFIG_BONDING is not set
+# CONFIG_EQUALIZER is not set
+# CONFIG_TUN is not set
+# CONFIG_PHYLIB is not set
+
+#
+# Ethernet (10 or 100Mbit)
+#
+CONFIG_NET_ETHERNET=y
+CONFIG_MII=y
+CONFIG_ARM_AT91_ETHER=y
+# CONFIG_SMC91X is not set
+# CONFIG_DM9000 is not set
+# CONFIG_NETDEV_1000 is not set
+# CONFIG_NETDEV_10000 is not set
+
+#
+# Wireless LAN
+#
+# CONFIG_WLAN_PRE80211 is not set
+# CONFIG_WLAN_80211 is not set
+
+#
+# USB Network Adapters
+#
+# CONFIG_USB_CATC is not set
+# CONFIG_USB_KAWETH is not set
+# CONFIG_USB_PEGASUS is not set
+# CONFIG_USB_RTL8150 is not set
+# CONFIG_USB_USBNET_MII is not set
+# CONFIG_USB_USBNET is not set
+# CONFIG_NET_PCMCIA is not set
+# CONFIG_WAN is not set
+CONFIG_PPP=y
+CONFIG_PPP_MULTILINK=y
+CONFIG_PPP_FILTER=y
+CONFIG_PPP_ASYNC=y
+# CONFIG_PPP_SYNC_TTY is not set
+# CONFIG_PPP_DEFLATE is not set
+# CONFIG_PPP_BSDCOMP is not set
+# CONFIG_PPP_MPPE is not set
+# CONFIG_PPPOE is not set
+# CONFIG_SLIP is not set
+CONFIG_SLHC=y
+# CONFIG_SHAPER is not set
+# CONFIG_NETCONSOLE is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+
+#
+# ISDN subsystem
+#
+# CONFIG_ISDN is not set
+
+#
+# Input device support
+#
+CONFIG_INPUT=y
+# CONFIG_INPUT_FF_MEMLESS is not set
+
+#
+# Userland interfaces
+#
+CONFIG_INPUT_MOUSEDEV=y
+# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
+CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
+CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
+# CONFIG_INPUT_JOYDEV is not set
+# CONFIG_INPUT_TSDEV is not set
+# CONFIG_INPUT_EVDEV is not set
+# CONFIG_INPUT_EVBUG is not set
+
+#
+# Input Device Drivers
+#
+# CONFIG_INPUT_KEYBOARD is not set
+# CONFIG_INPUT_MOUSE is not set
+# CONFIG_INPUT_JOYSTICK is not set
+# CONFIG_INPUT_TABLET is not set
+# CONFIG_INPUT_TOUCHSCREEN is not set
+# CONFIG_INPUT_MISC is not set
+
+#
+# Hardware I/O ports
+#
+# CONFIG_SERIO is not set
+# CONFIG_GAMEPORT is not set
+
+#
+# Character devices
+#
+CONFIG_VT=y
+CONFIG_VT_CONSOLE=y
+CONFIG_HW_CONSOLE=y
+# CONFIG_VT_HW_CONSOLE_BINDING is not set
+# CONFIG_SERIAL_NONSTANDARD is not set
+
+#
+# Serial drivers
+#
+# CONFIG_SERIAL_8250 is not set
+
+#
+# Non-8250 serial port support
+#
+CONFIG_SERIAL_ATMEL=y
+CONFIG_SERIAL_ATMEL_CONSOLE=y
+# CONFIG_SERIAL_ATMEL_TTYAT is not set
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+CONFIG_UNIX98_PTYS=y
+CONFIG_LEGACY_PTYS=y
+CONFIG_LEGACY_PTY_COUNT=256
+
+#
+# IPMI
+#
+# CONFIG_IPMI_HANDLER is not set
+CONFIG_WATCHDOG=y
+CONFIG_WATCHDOG_NOWAYOUT=y
+
+#
+# Watchdog Device Drivers
+#
+# CONFIG_SOFT_WATCHDOG is not set
+# CONFIG_AT91RM9200_WATCHDOG is not set
+
+#
+# USB-based Watchdog Cards
+#
+# CONFIG_USBPCWATCHDOG is not set
+CONFIG_HW_RANDOM=y
+# CONFIG_NVRAM is not set
+# CONFIG_R3964 is not set
+
+#
+# PCMCIA character devices
+#
+# CONFIG_SYNCLINK_CS is not set
+# CONFIG_CARDMAN_4000 is not set
+# CONFIG_CARDMAN_4040 is not set
+# CONFIG_RAW_DRIVER is not set
+
+#
+# TPM devices
+#
+# CONFIG_TCG_TPM is not set
+# CONFIG_AT91_SPI is not set
+CONFIG_I2C=y
+CONFIG_I2C_BOARDINFO=y
+CONFIG_I2C_CHARDEV=y
+
+#
+# I2C Algorithms
+#
+CONFIG_I2C_ALGOBIT=y
+# CONFIG_I2C_ALGOPCF is not set
+# CONFIG_I2C_ALGOPCA is not set
+
+#
+# I2C Hardware Bus support
+#
+CONFIG_I2C_GPIO=y
+# CONFIG_I2C_GPIO is not set
+# CONFIG_I2C_OCORES is not set
+# CONFIG_I2C_PARPORT_LIGHT is not set
+# CONFIG_I2C_SIMTEC is not set
+# CONFIG_I2C_STUB is not set
+# CONFIG_I2C_TINY_USB is not set
+# CONFIG_I2C_PCA is not set
+
+#
+# Miscellaneous I2C Chip support
+#
+# CONFIG_SENSORS_DS1337 is not set
+# CONFIG_SENSORS_DS1374 is not set
+# CONFIG_SENSORS_EEPROM is not set
+# CONFIG_SENSORS_PCF8574 is not set
+# CONFIG_SENSORS_PCA9539 is not set
+# CONFIG_SENSORS_PCF8591 is not set
+# CONFIG_SENSORS_MAX6875 is not set
+# CONFIG_I2C_DEBUG_CORE is not set
+# CONFIG_I2C_DEBUG_ALGO is not set
+# CONFIG_I2C_DEBUG_BUS is not set
+# CONFIG_I2C_DEBUG_CHIP is not set
+
+#
+# SPI support
+#
+CONFIG_SPI=y
+CONFIG_SPI_MASTER=y
+
+#
+# SPI Master Controller Drivers
+#
+# CONFIG_SPI_ATMEL is not set
+CONFIG_SPI_BITBANG=y
+CONFIG_SPI_AT91=y
+
+#
+# SPI Protocol Masters
+#
+# CONFIG_SPI_AT25 is not set
+# CONFIG_SPI_SPIDEV is not set
+
+#
+# Dallas's 1-wire bus
+#
+# CONFIG_W1 is not set
+CONFIG_HWMON=y
+# CONFIG_HWMON_VID is not set
+# CONFIG_SENSORS_ABITUGURU is not set
+# CONFIG_SENSORS_AD7418 is not set
+# CONFIG_SENSORS_ADM1021 is not set
+# CONFIG_SENSORS_ADM1025 is not set
+# CONFIG_SENSORS_ADM1026 is not set
+# CONFIG_SENSORS_ADM1029 is not set
+# CONFIG_SENSORS_ADM1031 is not set
+# CONFIG_SENSORS_ADM9240 is not set
+# CONFIG_SENSORS_ASB100 is not set
+# CONFIG_SENSORS_ATXP1 is not set
+# CONFIG_SENSORS_DS1621 is not set
+# CONFIG_SENSORS_F71805F is not set
+# CONFIG_SENSORS_FSCHER is not set
+# CONFIG_SENSORS_FSCPOS is not set
+# CONFIG_SENSORS_GL518SM is not set
+# CONFIG_SENSORS_GL520SM is not set
+# CONFIG_SENSORS_IT87 is not set
+# CONFIG_SENSORS_LM63 is not set
+# CONFIG_SENSORS_LM70 is not set
+# CONFIG_SENSORS_LM75 is not set
+# CONFIG_SENSORS_LM77 is not set
+# CONFIG_SENSORS_LM78 is not set
+# CONFIG_SENSORS_LM80 is not set
+# CONFIG_SENSORS_LM83 is not set
+# CONFIG_SENSORS_LM85 is not set
+# CONFIG_SENSORS_LM87 is not set
+# CONFIG_SENSORS_LM90 is not set
+# CONFIG_SENSORS_LM92 is not set
+# CONFIG_SENSORS_MAX1619 is not set
+# CONFIG_SENSORS_MAX6650 is not set
+# CONFIG_SENSORS_PC87360 is not set
+# CONFIG_SENSORS_PC87427 is not set
+# CONFIG_SENSORS_SMSC47M1 is not set
+# CONFIG_SENSORS_SMSC47M192 is not set
+# CONFIG_SENSORS_SMSC47B397 is not set
+# CONFIG_SENSORS_VT1211 is not set
+# CONFIG_SENSORS_W83781D is not set
+# CONFIG_SENSORS_W83791D is not set
+# CONFIG_SENSORS_W83792D is not set
+# CONFIG_SENSORS_W83793 is not set
+# CONFIG_SENSORS_W83L785TS is not set
+# CONFIG_SENSORS_W83627HF is not set
+# CONFIG_SENSORS_W83627EHF is not set
+# CONFIG_HWMON_DEBUG_CHIP is not set
+
+#
+# Misc devices
+#
+# CONFIG_BLINK is not set
+
+#
+# Multifunction device drivers
+#
+# CONFIG_MFD_SM501 is not set
+
+#
+# LED devices
+#
+CONFIG_NEW_LEDS=y
+CONFIG_LEDS_CLASS=y
+
+#
+# LED drivers
+#
+
+#
+# LED Triggers
+#
+# CONFIG_LEDS_TRIGGERS is not set
+
+#
+# Multimedia devices
+#
+# CONFIG_VIDEO_DEV is not set
+# CONFIG_DVB_CORE is not set
+CONFIG_DAB=y
+# CONFIG_USB_DABUSB is not set
+
+#
+# Graphics support
+#
+# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
+
+#
+# Display device support
+#
+# CONFIG_DISPLAY_SUPPORT is not set
+# CONFIG_VGASTATE is not set
+# CONFIG_FB is not set
+
+#
+# Console display driver support
+#
+# CONFIG_VGA_CONSOLE is not set
+CONFIG_DUMMY_CONSOLE=y
+
+#
+# Sound
+#
+# CONFIG_SOUND is not set
+
+#
+# HID Devices
+#
+CONFIG_HID=y
+# CONFIG_HID_DEBUG is not set
+
+#
+# USB Input Devices
+#
+# CONFIG_USB_HID is not set
+
+#
+# USB HID Boot Protocol drivers
+#
+# CONFIG_USB_KBD is not set
+# CONFIG_USB_MOUSE is not set
+
+#
+# USB support
+#
+CONFIG_USB_ARCH_HAS_HCD=y
+CONFIG_USB_ARCH_HAS_OHCI=y
+# CONFIG_USB_ARCH_HAS_EHCI is not set
+CONFIG_USB=y
+# CONFIG_USB_DEBUG is not set
+
+#
+# Miscellaneous USB options
+#
+CONFIG_USB_DEVICEFS=y
+# CONFIG_USB_DEVICE_CLASS is not set
+# CONFIG_USB_DYNAMIC_MINORS is not set
+# CONFIG_USB_OTG is not set
+
+#
+# USB Host Controller Drivers
+#
+# CONFIG_USB_ISP116X_HCD is not set
+CONFIG_USB_OHCI_HCD=y
+# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set
+# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set
+CONFIG_USB_OHCI_LITTLE_ENDIAN=y
+# CONFIG_USB_SL811_HCD is not set
+
+#
+# USB Device Class drivers
+#
+# CONFIG_USB_ACM is not set
+CONFIG_USB_PRINTER=y
+
+#
+# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
+#
+
+#
+# may also be needed; see USB_STORAGE Help for more information
+#
+CONFIG_USB_STORAGE=y
+# CONFIG_USB_STORAGE_DEBUG is not set
+# CONFIG_USB_STORAGE_DATAFAB is not set
+# CONFIG_USB_STORAGE_FREECOM is not set
+# CONFIG_USB_STORAGE_DPCM is not set
+# CONFIG_USB_STORAGE_USBAT is not set
+# CONFIG_USB_STORAGE_SDDR09 is not set
+# CONFIG_USB_STORAGE_SDDR55 is not set
+# CONFIG_USB_STORAGE_JUMPSHOT is not set
+# CONFIG_USB_STORAGE_ALAUDA is not set
+# CONFIG_USB_STORAGE_KARMA is not set
+# CONFIG_USB_LIBUSUAL is not set
+
+#
+# USB Imaging devices
+#
+# CONFIG_USB_MDC800 is not set
+# CONFIG_USB_MICROTEK is not set
+# CONFIG_USB_MON is not set
+
+#
+# USB port drivers
+#
+
+#
+# USB Serial Converter support
+#
+# CONFIG_USB_SERIAL is not set
+
+#
+# USB Miscellaneous drivers
+#
+# CONFIG_USB_EMI62 is not set
+# CONFIG_USB_EMI26 is not set
+# CONFIG_USB_ADUTUX is not set
+# CONFIG_USB_AUERSWALD is not set
+# CONFIG_USB_RIO500 is not set
+# CONFIG_USB_LEGOTOWER is not set
+# CONFIG_USB_LCD is not set
+# CONFIG_USB_BERRY_CHARGE is not set
+# CONFIG_USB_LED is not set
+# CONFIG_USB_CYPRESS_CY7C63 is not set
+# CONFIG_USB_CYTHERM is not set
+# CONFIG_USB_PHIDGET is not set
+# CONFIG_USB_IDMOUSE is not set
+# CONFIG_USB_FTDI_ELAN is not set
+# CONFIG_USB_APPLEDISPLAY is not set
+# CONFIG_USB_LD is not set
+# CONFIG_USB_TRANCEVIBRATOR is not set
+# CONFIG_USB_IOWARRIOR is not set
+# CONFIG_USB_TEST is not set
+
+#
+# USB DSL modem support
+#
+
+#
+# USB Gadget Support
+#
+CONFIG_USB_GADGET=y
+# CONFIG_USB_GADGET_DEBUG_FILES is not set
+CONFIG_USB_GADGET_SELECTED=y
+# CONFIG_USB_GADGET_FSL_USB2 is not set
+# CONFIG_USB_GADGET_NET2280 is not set
+# CONFIG_USB_GADGET_PXA2XX is not set
+# CONFIG_USB_GADGET_GOKU is not set
+# CONFIG_USB_GADGET_LH7A40X is not set
+# CONFIG_USB_GADGET_OMAP is not set
+CONFIG_USB_GADGET_AT91=y
+CONFIG_USB_AT91=y
+# CONFIG_USB_GADGET_DUMMY_HCD is not set
+# CONFIG_USB_GADGET_DUALSPEED is not set
+# CONFIG_USB_ZERO is not set
+# CONFIG_USB_ETH is not set
+# CONFIG_USB_GADGETFS is not set
+# CONFIG_USB_FILE_STORAGE is not set
+# CONFIG_USB_G_SERIAL is not set
+# CONFIG_USB_MIDI_GADGET is not set
+CONFIG_MMC=y
+CONFIG_MMC_DEBUG=y
+# CONFIG_MMC_UNSAFE_RESUME is not set
+
+#
+# MMC/SD Card Drivers
+#
+CONFIG_MMC_BLOCK=y
+
+#
+# MMC/SD Host Controller Drivers
+#
+CONFIG_MMC_AT91=y
+
+#
+# Real Time Clock
+#
+CONFIG_RTC_LIB=y
+CONFIG_RTC_CLASS=y
+# CONFIG_RTC_HCTOSYS is not set
+# CONFIG_RTC_DEBUG is not set
+
+#
+# RTC interfaces
+#
+CONFIG_RTC_INTF_SYSFS=y
+CONFIG_RTC_INTF_PROC=y
+CONFIG_RTC_INTF_DEV=y
+# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
+# CONFIG_RTC_DRV_TEST is not set
+
+#
+# I2C RTC drivers
+#
+# CONFIG_RTC_DRV_DS1307 is not set
+# CONFIG_RTC_DRV_DS1672 is not set
+# CONFIG_RTC_DRV_MAX6900 is not set
+# CONFIG_RTC_DRV_RS5C372 is not set
+# CONFIG_RTC_DRV_ISL1208 is not set
+# CONFIG_RTC_DRV_X1205 is not set
+# CONFIG_RTC_DRV_PCF8563 is not set
+# CONFIG_RTC_DRV_PCF8583 is not set
+
+#
+# SPI RTC drivers
+#
+# CONFIG_RTC_DRV_RS5C348 is not set
+# CONFIG_RTC_DRV_MAX6902 is not set
+
+#
+# Platform RTC drivers
+#
+# CONFIG_RTC_DRV_CMOS is not set
+# CONFIG_RTC_DRV_DS1553 is not set
+# CONFIG_RTC_DRV_DS1742 is not set
+# CONFIG_RTC_DRV_M48T86 is not set
+# CONFIG_RTC_DRV_V3020 is not set
+
+#
+# on-CPU RTC drivers
+#
+CONFIG_RTC_DRV_AT91RM9200=y
+
+#
+# File systems
+#
+CONFIG_EXT2_FS=y
+# CONFIG_EXT2_FS_XATTR is not set
+# CONFIG_EXT2_FS_XIP is not set
+CONFIG_EXT3_FS=y
+CONFIG_EXT3_FS_XATTR=y
+# CONFIG_EXT3_FS_POSIX_ACL is not set
+# CONFIG_EXT3_FS_SECURITY is not set
+# CONFIG_EXT4DEV_FS is not set
+CONFIG_JBD=y
+# CONFIG_JBD_DEBUG is not set
+CONFIG_FS_MBCACHE=y
+CONFIG_REISERFS_FS=y
+# CONFIG_REISERFS_CHECK is not set
+# CONFIG_REISERFS_PROC_INFO is not set
+# CONFIG_REISERFS_FS_XATTR is not set
+# CONFIG_JFS_FS is not set
+CONFIG_FS_POSIX_ACL=y
+# CONFIG_XFS_FS is not set
+# CONFIG_GFS2_FS is not set
+# CONFIG_OCFS2_FS is not set
+# CONFIG_MINIX_FS is not set
+# CONFIG_ROMFS_FS is not set
+CONFIG_INOTIFY=y
+CONFIG_INOTIFY_USER=y
+# CONFIG_QUOTA is not set
+CONFIG_DNOTIFY=y
+# CONFIG_AUTOFS_FS is not set
+# CONFIG_AUTOFS4_FS is not set
+# CONFIG_FUSE_FS is not set
+
+#
+# CD-ROM/DVD Filesystems
+#
+# CONFIG_ISO9660_FS is not set
+# CONFIG_UDF_FS is not set
+
+#
+# DOS/FAT/NT Filesystems
+#
+# CONFIG_MSDOS_FS is not set
+# CONFIG_VFAT_FS is not set
+# CONFIG_NTFS_FS is not set
+
+#
+# Pseudo filesystems
+#
+CONFIG_PROC_FS=y
+CONFIG_PROC_SYSCTL=y
+CONFIG_SYSFS=y
+CONFIG_TMPFS=y
+# CONFIG_TMPFS_POSIX_ACL is not set
+# CONFIG_HUGETLB_PAGE is not set
+CONFIG_RAMFS=y
+CONFIG_CONFIGFS_FS=y
+
+#
+# Miscellaneous filesystems
+#
+# CONFIG_ADFS_FS is not set
+# CONFIG_AFFS_FS is not set
+# CONFIG_HFS_FS is not set
+# CONFIG_HFSPLUS_FS is not set
+# CONFIG_BEFS_FS is not set
+# CONFIG_BFS_FS is not set
+# CONFIG_EFS_FS is not set
+# CONFIG_JFFS2_FS is not set
+CONFIG_CRAMFS=y
+# CONFIG_VXFS_FS is not set
+# CONFIG_HPFS_FS is not set
+# CONFIG_QNX4FS_FS is not set
+# CONFIG_SYSV_FS is not set
+# CONFIG_UFS_FS is not set
+
+#
+# Network File Systems
+#
+CONFIG_NFS_FS=y
+CONFIG_NFS_V3=y
+CONFIG_NFS_V3_ACL=y
+CONFIG_NFS_V4=y
+# CONFIG_NFS_DIRECTIO is not set
+# CONFIG_NFSD is not set
+CONFIG_ROOT_NFS=y
+CONFIG_LOCKD=y
+CONFIG_LOCKD_V4=y
+CONFIG_NFS_ACL_SUPPORT=y
+CONFIG_NFS_COMMON=y
+CONFIG_SUNRPC=y
+CONFIG_SUNRPC_GSS=y
+# CONFIG_SUNRPC_BIND34 is not set
+CONFIG_RPCSEC_GSS_KRB5=y
+# CONFIG_RPCSEC_GSS_SPKM3 is not set
+# CONFIG_SMB_FS is not set
+# CONFIG_CIFS is not set
+# CONFIG_NCP_FS is not set
+# CONFIG_CODA_FS is not set
+# CONFIG_AFS_FS is not set
+# CONFIG_9P_FS is not set
+
+#
+# Partition Types
+#
+CONFIG_PARTITION_ADVANCED=y
+# CONFIG_ACORN_PARTITION is not set
+# CONFIG_OSF_PARTITION is not set
+# CONFIG_AMIGA_PARTITION is not set
+# CONFIG_ATARI_PARTITION is not set
+# CONFIG_MAC_PARTITION is not set
+CONFIG_MSDOS_PARTITION=y
+# CONFIG_BSD_DISKLABEL is not set
+# CONFIG_MINIX_SUBPARTITION is not set
+# CONFIG_SOLARIS_X86_PARTITION is not set
+# CONFIG_UNIXWARE_DISKLABEL is not set
+# CONFIG_LDM_PARTITION is not set
+# CONFIG_SGI_PARTITION is not set
+# CONFIG_ULTRIX_PARTITION is not set
+# CONFIG_SUN_PARTITION is not set
+# CONFIG_KARMA_PARTITION is not set
+# CONFIG_EFI_PARTITION is not set
+# CONFIG_SYSV68_PARTITION is not set
+
+#
+# Native Language Support
+#
+CONFIG_NLS=y
+CONFIG_NLS_DEFAULT="iso8859-1"
+# CONFIG_NLS_CODEPAGE_437 is not set
+# CONFIG_NLS_CODEPAGE_737 is not set
+# CONFIG_NLS_CODEPAGE_775 is not set
+# CONFIG_NLS_CODEPAGE_850 is not set
+# CONFIG_NLS_CODEPAGE_852 is not set
+# CONFIG_NLS_CODEPAGE_855 is not set
+# CONFIG_NLS_CODEPAGE_857 is not set
+# CONFIG_NLS_CODEPAGE_860 is not set
+# CONFIG_NLS_CODEPAGE_861 is not set
+# CONFIG_NLS_CODEPAGE_862 is not set
+# CONFIG_NLS_CODEPAGE_863 is not set
+# CONFIG_NLS_CODEPAGE_864 is not set
+# CONFIG_NLS_CODEPAGE_865 is not set
+# CONFIG_NLS_CODEPAGE_866 is not set
+# CONFIG_NLS_CODEPAGE_869 is not set
+# CONFIG_NLS_CODEPAGE_936 is not set
+# CONFIG_NLS_CODEPAGE_950 is not set
+# CONFIG_NLS_CODEPAGE_932 is not set
+# CONFIG_NLS_CODEPAGE_949 is not set
+# CONFIG_NLS_CODEPAGE_874 is not set
+# CONFIG_NLS_ISO8859_8 is not set
+# CONFIG_NLS_CODEPAGE_1250 is not set
+# CONFIG_NLS_CODEPAGE_1251 is not set
+# CONFIG_NLS_ASCII is not set
+# CONFIG_NLS_ISO8859_1 is not set
+# CONFIG_NLS_ISO8859_2 is not set
+# CONFIG_NLS_ISO8859_3 is not set
+# CONFIG_NLS_ISO8859_4 is not set
+# CONFIG_NLS_ISO8859_5 is not set
+# CONFIG_NLS_ISO8859_6 is not set
+# CONFIG_NLS_ISO8859_7 is not set
+# CONFIG_NLS_ISO8859_9 is not set
+# CONFIG_NLS_ISO8859_13 is not set
+# CONFIG_NLS_ISO8859_14 is not set
+# CONFIG_NLS_ISO8859_15 is not set
+# CONFIG_NLS_KOI8_R is not set
+# CONFIG_NLS_KOI8_U is not set
+# CONFIG_NLS_UTF8 is not set
+
+#
+# Distributed Lock Manager
+#
+# CONFIG_DLM is not set
+
+#
+# Profiling support
+#
+# CONFIG_PROFILING is not set
+
+#
+# Kernel hacking
+#
+# CONFIG_PRINTK_TIME is not set
+CONFIG_ENABLE_MUST_CHECK=y
+# CONFIG_MAGIC_SYSRQ is not set
+# CONFIG_UNUSED_SYMBOLS is not set
+# CONFIG_DEBUG_FS is not set
+# CONFIG_HEADERS_CHECK is not set
+# CONFIG_DEBUG_KERNEL is not set
+CONFIG_DEBUG_BUGVERBOSE=y
+CONFIG_FRAME_POINTER=y
+CONFIG_DEBUG_USER=y
+
+#
+# Security options
+#
+# CONFIG_KEYS is not set
+# CONFIG_SECURITY is not set
+
+#
+# Cryptographic options
+#
+CONFIG_CRYPTO=y
+CONFIG_CRYPTO_ALGAPI=y
+CONFIG_CRYPTO_BLKCIPHER=y
+CONFIG_CRYPTO_MANAGER=y
+# CONFIG_CRYPTO_HMAC is not set
+# CONFIG_CRYPTO_XCBC is not set
+# CONFIG_CRYPTO_NULL is not set
+# CONFIG_CRYPTO_MD4 is not set
+CONFIG_CRYPTO_MD5=y
+CONFIG_CRYPTO_SHA1=y
+# CONFIG_CRYPTO_SHA256 is not set
+# CONFIG_CRYPTO_SHA512 is not set
+# CONFIG_CRYPTO_WP512 is not set
+# CONFIG_CRYPTO_TGR192 is not set
+# CONFIG_CRYPTO_GF128MUL is not set
+CONFIG_CRYPTO_ECB=y
+CONFIG_CRYPTO_CBC=y
+CONFIG_CRYPTO_PCBC=y
+# CONFIG_CRYPTO_LRW is not set
+# CONFIG_CRYPTO_CRYPTD is not set
+CONFIG_CRYPTO_DES=y
+# CONFIG_CRYPTO_FCRYPT is not set
+# CONFIG_CRYPTO_BLOWFISH is not set
+# CONFIG_CRYPTO_TWOFISH is not set
+# CONFIG_CRYPTO_SERPENT is not set
+CONFIG_CRYPTO_AES=y
+# CONFIG_CRYPTO_CAST5 is not set
+# CONFIG_CRYPTO_CAST6 is not set
+# CONFIG_CRYPTO_TEA is not set
+CONFIG_CRYPTO_ARC4=y
+# CONFIG_CRYPTO_KHAZAD is not set
+# CONFIG_CRYPTO_ANUBIS is not set
+# CONFIG_CRYPTO_DEFLATE is not set
+# CONFIG_CRYPTO_MICHAEL_MIC is not set
+# CONFIG_CRYPTO_CRC32C is not set
+# CONFIG_CRYPTO_CAMELLIA is not set
+# CONFIG_CRYPTO_TEST is not set
+
+#
+# Hardware crypto devices
+#
+
+#
+# Library routines
+#
+CONFIG_BITREVERSE=y
+CONFIG_CRC_CCITT=y
+# CONFIG_CRC16 is not set
+# CONFIG_CRC_ITU_T is not set
+CONFIG_CRC32=y
+# CONFIG_LIBCRC32C is not set
+CONFIG_ZLIB_INFLATE=y
+CONFIG_PLIST=y
+CONFIG_HAS_IOMEM=y
+CONFIG_HAS_IOPORT=y
+CONFIG_HAS_DMA=y
index a0f48d54fbcc7f0d8402d21cbead1157d330099d..ae51a40db6f99df08cddefbfcc96714f35f8525e 100644 (file)
@@ -587,14 +587,14 @@ CONFIG_I2C_CHARDEV=y
 #
 # I2C Algorithms
 #
-# CONFIG_I2C_ALGOBIT is not set
+CONFIG_I2C_ALGOBIT=y
 # CONFIG_I2C_ALGOPCF is not set
 # CONFIG_I2C_ALGOPCA is not set
 
 #
 # I2C Hardware Bus support
 #
-CONFIG_I2C_AT91=y
+CONFIG_I2C_GPIO=y
 # CONFIG_I2C_PARPORT_LIGHT is not set
 # CONFIG_I2C_STUB is not set
 # CONFIG_I2C_PCA_ISA is not set
diff --git a/arch/arm/configs/magician_defconfig b/arch/arm/configs/magician_defconfig
new file mode 100644 (file)
index 0000000..4d11678
--- /dev/null
@@ -0,0 +1,1182 @@
+#
+# Automatically generated make config: don't edit
+# Linux kernel version: 2.6.24-rc6
+# Sun Dec 30 13:02:54 2007
+#
+CONFIG_ARM=y
+CONFIG_SYS_SUPPORTS_APM_EMULATION=y
+CONFIG_GENERIC_GPIO=y
+CONFIG_GENERIC_TIME=y
+CONFIG_GENERIC_CLOCKEVENTS=y
+CONFIG_MMU=y
+# CONFIG_NO_IOPORT is not set
+CONFIG_GENERIC_HARDIRQS=y
+CONFIG_STACKTRACE_SUPPORT=y
+CONFIG_LOCKDEP_SUPPORT=y
+CONFIG_TRACE_IRQFLAGS_SUPPORT=y
+CONFIG_HARDIRQS_SW_RESEND=y
+CONFIG_GENERIC_IRQ_PROBE=y
+CONFIG_RWSEM_GENERIC_SPINLOCK=y
+# CONFIG_ARCH_HAS_ILOG2_U32 is not set
+# CONFIG_ARCH_HAS_ILOG2_U64 is not set
+CONFIG_GENERIC_HWEIGHT=y
+CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_ZONE_DMA=y
+CONFIG_ARCH_MTD_XIP=y
+CONFIG_VECTORS_BASE=0xffff0000
+CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
+
+#
+# General setup
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_BROKEN_ON_SMP=y
+CONFIG_LOCK_KERNEL=y
+CONFIG_INIT_ENV_ARG_LIMIT=32
+CONFIG_LOCALVERSION=""
+CONFIG_LOCALVERSION_AUTO=y
+CONFIG_SWAP=y
+CONFIG_SYSVIPC=y
+CONFIG_SYSVIPC_SYSCTL=y
+# CONFIG_POSIX_MQUEUE is not set
+# CONFIG_BSD_PROCESS_ACCT is not set
+# CONFIG_TASKSTATS is not set
+# CONFIG_USER_NS is not set
+# CONFIG_PID_NS is not set
+# CONFIG_AUDIT is not set
+CONFIG_IKCONFIG=y
+CONFIG_IKCONFIG_PROC=y
+CONFIG_LOG_BUF_SHIFT=16
+# CONFIG_CGROUPS is not set
+# CONFIG_FAIR_GROUP_SCHED is not set
+# CONFIG_SYSFS_DEPRECATED is not set
+# CONFIG_RELAY is not set
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_INITRAMFS_SOURCE=""
+CONFIG_CC_OPTIMIZE_FOR_SIZE=y
+CONFIG_SYSCTL=y
+CONFIG_EMBEDDED=y
+# CONFIG_UID16 is not set
+CONFIG_SYSCTL_SYSCALL=y
+CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_ALL is not set
+# CONFIG_KALLSYMS_EXTRA_PASS is not set
+CONFIG_HOTPLUG=y
+CONFIG_PRINTK=y
+CONFIG_BUG=y
+CONFIG_ELF_CORE=y
+CONFIG_BASE_FULL=y
+CONFIG_FUTEX=y
+CONFIG_ANON_INODES=y
+CONFIG_EPOLL=y
+CONFIG_SIGNALFD=y
+CONFIG_EVENTFD=y
+CONFIG_SHMEM=y
+CONFIG_VM_EVENT_COUNTERS=y
+CONFIG_SLAB=y
+# CONFIG_SLUB is not set
+# CONFIG_SLOB is not set
+CONFIG_RT_MUTEXES=y
+# CONFIG_TINY_SHMEM is not set
+CONFIG_BASE_SMALL=0
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+CONFIG_MODULE_FORCE_UNLOAD=y
+# CONFIG_MODVERSIONS is not set
+# CONFIG_MODULE_SRCVERSION_ALL is not set
+CONFIG_KMOD=y
+CONFIG_BLOCK=y
+# CONFIG_LBD is not set
+# CONFIG_BLK_DEV_IO_TRACE is not set
+# CONFIG_LSF is not set
+# CONFIG_BLK_DEV_BSG is not set
+
+#
+# IO Schedulers
+#
+CONFIG_IOSCHED_NOOP=y
+# CONFIG_IOSCHED_AS is not set
+# CONFIG_IOSCHED_DEADLINE is not set
+# CONFIG_IOSCHED_CFQ is not set
+# CONFIG_DEFAULT_AS is not set
+# CONFIG_DEFAULT_DEADLINE is not set
+# CONFIG_DEFAULT_CFQ is not set
+CONFIG_DEFAULT_NOOP=y
+CONFIG_DEFAULT_IOSCHED="noop"
+CONFIG_CLASSIC_RCU=y
+# CONFIG_PREEMPT_RCU is not set
+
+#
+# System Type
+#
+# CONFIG_ARCH_AAEC2000 is not set
+# CONFIG_ARCH_INTEGRATOR is not set
+# CONFIG_ARCH_REALVIEW is not set
+# CONFIG_ARCH_VERSATILE is not set
+# CONFIG_ARCH_AT91 is not set
+# CONFIG_ARCH_CLPS7500 is not set
+# CONFIG_ARCH_CLPS711X is not set
+# CONFIG_ARCH_CO285 is not set
+# CONFIG_ARCH_EBSA110 is not set
+# CONFIG_ARCH_EP93XX is not set
+# CONFIG_ARCH_FOOTBRIDGE is not set
+# CONFIG_ARCH_NETX is not set
+# CONFIG_ARCH_H720X is not set
+# CONFIG_ARCH_IMX is not set
+# CONFIG_ARCH_IOP13XX is not set
+# CONFIG_ARCH_IOP32X is not set
+# CONFIG_ARCH_IOP33X is not set
+# CONFIG_ARCH_IXP23XX is not set
+# CONFIG_ARCH_IXP2000 is not set
+# CONFIG_ARCH_IXP4XX is not set
+# CONFIG_ARCH_L7200 is not set
+# CONFIG_ARCH_KS8695 is not set
+# CONFIG_ARCH_NS9XXX is not set
+# CONFIG_ARCH_MXC is not set
+# CONFIG_ARCH_PNX4008 is not set
+CONFIG_ARCH_PXA=y
+# CONFIG_ARCH_RPC is not set
+# CONFIG_ARCH_SA1100 is not set
+# CONFIG_ARCH_S3C2410 is not set
+# CONFIG_ARCH_SHARK is not set
+# CONFIG_ARCH_LH7A40X is not set
+# CONFIG_ARCH_DAVINCI is not set
+# CONFIG_ARCH_OMAP is not set
+
+#
+# Intel PXA2xx/PXA3xx Implementations
+#
+# CONFIG_ARCH_LUBBOCK is not set
+# CONFIG_MACH_LOGICPD_PXA270 is not set
+# CONFIG_MACH_MAINSTONE is not set
+# CONFIG_ARCH_PXA_IDP is not set
+# CONFIG_PXA_SHARPSL is not set
+# CONFIG_MACH_TRIZEPS4 is not set
+# CONFIG_MACH_EM_X270 is not set
+# CONFIG_MACH_ZYLONITE is not set
+# CONFIG_MACH_ARMCORE is not set
+CONFIG_MACH_MAGICIAN=y
+CONFIG_PXA27x=y
+
+#
+# Boot options
+#
+
+#
+# Power management
+#
+
+#
+# Processor Type
+#
+CONFIG_CPU_32=y
+CONFIG_CPU_XSCALE=y
+CONFIG_CPU_32v5=y
+CONFIG_CPU_ABRT_EV5T=y
+CONFIG_CPU_CACHE_VIVT=y
+CONFIG_CPU_TLB_V4WBI=y
+CONFIG_CPU_CP15=y
+CONFIG_CPU_CP15_MMU=y
+
+#
+# Processor Features
+#
+CONFIG_ARM_THUMB=y
+# CONFIG_CPU_DCACHE_DISABLE is not set
+# CONFIG_OUTER_CACHE is not set
+CONFIG_IWMMXT=y
+CONFIG_XSCALE_PMU=y
+
+#
+# Bus support
+#
+# CONFIG_PCI_SYSCALL is not set
+# CONFIG_ARCH_SUPPORTS_MSI is not set
+# CONFIG_PCCARD is not set
+
+#
+# Kernel Features
+#
+# CONFIG_TICK_ONESHOT is not set
+# CONFIG_NO_HZ is not set
+# CONFIG_HIGH_RES_TIMERS is not set
+CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
+CONFIG_PREEMPT=y
+CONFIG_HZ=100
+CONFIG_AEABI=y
+CONFIG_OABI_COMPAT=y
+# CONFIG_ARCH_DISCONTIGMEM_ENABLE is not set
+CONFIG_SELECT_MEMORY_MODEL=y
+CONFIG_FLATMEM_MANUAL=y
+# CONFIG_DISCONTIGMEM_MANUAL is not set
+# CONFIG_SPARSEMEM_MANUAL is not set
+CONFIG_FLATMEM=y
+CONFIG_FLAT_NODE_MEM_MAP=y
+# CONFIG_SPARSEMEM_STATIC is not set
+# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
+CONFIG_SPLIT_PTLOCK_CPUS=4096
+# CONFIG_RESOURCES_64BIT is not set
+CONFIG_ZONE_DMA_FLAG=1
+CONFIG_BOUNCE=y
+CONFIG_VIRT_TO_BUS=y
+CONFIG_ALIGNMENT_TRAP=y
+
+#
+# Boot options
+#
+CONFIG_ZBOOT_ROM_TEXT=0x0
+CONFIG_ZBOOT_ROM_BSS=0x0
+CONFIG_CMDLINE="keepinitrd"
+# CONFIG_XIP_KERNEL is not set
+CONFIG_KEXEC=y
+
+#
+# CPU Frequency scaling
+#
+CONFIG_CPU_FREQ=y
+CONFIG_CPU_FREQ_TABLE=y
+# CONFIG_CPU_FREQ_DEBUG is not set
+CONFIG_CPU_FREQ_STAT=y
+# CONFIG_CPU_FREQ_STAT_DETAILS is not set
+CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y
+# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set
+# CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND is not set
+# CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set
+CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
+# CONFIG_CPU_FREQ_GOV_POWERSAVE is not set
+# CONFIG_CPU_FREQ_GOV_USERSPACE is not set
+CONFIG_CPU_FREQ_GOV_ONDEMAND=y
+# CONFIG_CPU_FREQ_GOV_CONSERVATIVE is not set
+
+#
+# Floating point emulation
+#
+
+#
+# At least one emulation must be selected
+#
+CONFIG_FPE_NWFPE=y
+# CONFIG_FPE_NWFPE_XP is not set
+# CONFIG_FPE_FASTFPE is not set
+
+#
+# Userspace binary formats
+#
+CONFIG_BINFMT_ELF=y
+# CONFIG_BINFMT_AOUT is not set
+# CONFIG_BINFMT_MISC is not set
+
+#
+# Power management options
+#
+CONFIG_PM=y
+# CONFIG_PM_LEGACY is not set
+# CONFIG_PM_DEBUG is not set
+CONFIG_PM_SLEEP=y
+CONFIG_SUSPEND_UP_POSSIBLE=y
+CONFIG_SUSPEND=y
+CONFIG_APM_EMULATION=y
+
+#
+# Networking
+#
+CONFIG_NET=y
+
+#
+# Networking options
+#
+CONFIG_PACKET=y
+CONFIG_PACKET_MMAP=y
+CONFIG_UNIX=y
+# CONFIG_NET_KEY is not set
+CONFIG_INET=y
+CONFIG_IP_MULTICAST=y
+# CONFIG_IP_ADVANCED_ROUTER is not set
+CONFIG_IP_FIB_HASH=y
+CONFIG_IP_PNP=y
+# CONFIG_IP_PNP_DHCP is not set
+# CONFIG_IP_PNP_BOOTP is not set
+# CONFIG_IP_PNP_RARP is not set
+# CONFIG_NET_IPIP is not set
+# CONFIG_NET_IPGRE is not set
+# CONFIG_IP_MROUTE is not set
+# CONFIG_ARPD is not set
+# CONFIG_SYN_COOKIES is not set
+# CONFIG_INET_AH is not set
+# CONFIG_INET_ESP is not set
+# CONFIG_INET_IPCOMP is not set
+# CONFIG_INET_XFRM_TUNNEL is not set
+# CONFIG_INET_TUNNEL is not set
+# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
+# CONFIG_INET_XFRM_MODE_TUNNEL is not set
+# CONFIG_INET_XFRM_MODE_BEET is not set
+# CONFIG_INET_LRO is not set
+# CONFIG_INET_DIAG is not set
+# CONFIG_TCP_CONG_ADVANCED is not set
+CONFIG_TCP_CONG_CUBIC=y
+CONFIG_DEFAULT_TCP_CONG="cubic"
+# CONFIG_TCP_MD5SIG is not set
+# CONFIG_IP_VS is not set
+# CONFIG_IPV6 is not set
+# CONFIG_INET6_XFRM_TUNNEL is not set
+# CONFIG_INET6_TUNNEL is not set
+# CONFIG_NETWORK_SECMARK is not set
+CONFIG_NETFILTER=y
+# CONFIG_NETFILTER_DEBUG is not set
+
+#
+# Core Netfilter Configuration
+#
+# CONFIG_NETFILTER_NETLINK is not set
+# CONFIG_NF_CONNTRACK_ENABLED is not set
+# CONFIG_NF_CONNTRACK is not set
+# CONFIG_NETFILTER_XTABLES is not set
+
+#
+# IP: Netfilter Configuration
+#
+# CONFIG_IP_NF_QUEUE is not set
+# CONFIG_IP_NF_IPTABLES is not set
+# CONFIG_IP_NF_ARPTABLES is not set
+# CONFIG_IP_DCCP is not set
+# CONFIG_IP_SCTP is not set
+# CONFIG_TIPC is not set
+# CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
+# CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
+# CONFIG_LLC2 is not set
+# CONFIG_IPX is not set
+# CONFIG_ATALK is not set
+# CONFIG_X25 is not set
+# CONFIG_LAPB is not set
+# CONFIG_ECONET is not set
+# CONFIG_WAN_ROUTER is not set
+# CONFIG_NET_SCHED is not set
+
+#
+# Network testing
+#
+# CONFIG_NET_PKTGEN is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_CAN is not set
+CONFIG_IRDA=m
+
+#
+# IrDA protocols
+#
+CONFIG_IRLAN=m
+# CONFIG_IRNET is not set
+CONFIG_IRCOMM=m
+CONFIG_IRDA_ULTRA=y
+
+#
+# IrDA options
+#
+CONFIG_IRDA_CACHE_LAST_LSAP=y
+CONFIG_IRDA_FAST_RR=y
+CONFIG_IRDA_DEBUG=y
+
+#
+# Infrared-port device drivers
+#
+
+#
+# SIR device drivers
+#
+CONFIG_IRTTY_SIR=m
+
+#
+# Dongle support
+#
+# CONFIG_DONGLE is not set
+
+#
+# Old SIR device drivers
+#
+# CONFIG_IRPORT_SIR is not set
+
+#
+# Old Serial dongle support
+#
+
+#
+# FIR device drivers
+#
+CONFIG_PXA_FICP=m
+CONFIG_BT=m
+CONFIG_BT_L2CAP=m
+CONFIG_BT_SCO=m
+CONFIG_BT_RFCOMM=m
+CONFIG_BT_RFCOMM_TTY=y
+CONFIG_BT_BNEP=m
+CONFIG_BT_BNEP_MC_FILTER=y
+CONFIG_BT_BNEP_PROTO_FILTER=y
+CONFIG_BT_HIDP=m
+
+#
+# Bluetooth device drivers
+#
+# CONFIG_BT_HCIUART is not set
+# CONFIG_BT_HCIVHCI is not set
+# CONFIG_AF_RXRPC is not set
+
+#
+# Wireless
+#
+# CONFIG_CFG80211 is not set
+# CONFIG_WIRELESS_EXT is not set
+# CONFIG_MAC80211 is not set
+# CONFIG_IEEE80211 is not set
+# CONFIG_RFKILL is not set
+# CONFIG_NET_9P is not set
+
+#
+# Device Drivers
+#
+
+#
+# Generic Driver Options
+#
+CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
+CONFIG_STANDALONE=y
+CONFIG_PREVENT_FIRMWARE_BUILD=y
+CONFIG_FW_LOADER=y
+# CONFIG_DEBUG_DRIVER is not set
+# CONFIG_DEBUG_DEVRES is not set
+# CONFIG_SYS_HYPERVISOR is not set
+# CONFIG_CONNECTOR is not set
+CONFIG_MTD=y
+CONFIG_MTD_DEBUG=y
+CONFIG_MTD_DEBUG_VERBOSE=0
+# CONFIG_MTD_CONCAT is not set
+CONFIG_MTD_PARTITIONS=y
+# CONFIG_MTD_REDBOOT_PARTS is not set
+CONFIG_MTD_CMDLINE_PARTS=y
+# CONFIG_MTD_AFS_PARTS is not set
+
+#
+# User Modules And Translation Layers
+#
+CONFIG_MTD_CHAR=m
+CONFIG_MTD_BLKDEVS=m
+CONFIG_MTD_BLOCK=m
+# CONFIG_FTL is not set
+# CONFIG_NFTL is not set
+# CONFIG_INFTL is not set
+# CONFIG_RFD_FTL is not set
+# CONFIG_SSFDC is not set
+# CONFIG_MTD_OOPS is not set
+
+#
+# RAM/ROM/Flash chip drivers
+#
+CONFIG_MTD_CFI=y
+# CONFIG_MTD_JEDECPROBE is not set
+# CONFIG_MTD_CFI_ADV_OPTIONS is not set
+CONFIG_MTD_MAP_BANK_WIDTH_1=y
+CONFIG_MTD_MAP_BANK_WIDTH_2=y
+CONFIG_MTD_MAP_BANK_WIDTH_4=y
+# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
+CONFIG_MTD_CFI_I1=y
+CONFIG_MTD_CFI_I2=y
+# CONFIG_MTD_CFI_I4 is not set
+# CONFIG_MTD_CFI_I8 is not set
+CONFIG_MTD_CFI_INTELEXT=y
+# CONFIG_MTD_CFI_AMDSTD is not set
+# CONFIG_MTD_CFI_STAA is not set
+# CONFIG_MTD_RAM is not set
+# CONFIG_MTD_ROM is not set
+# CONFIG_MTD_ABSENT is not set
+# CONFIG_MTD_XIP is not set
+
+#
+# Mapping drivers for chip access
+#
+# CONFIG_MTD_COMPLEX_MAPPINGS is not set
+CONFIG_MTD_PHYSMAP=y
+CONFIG_MTD_PHYSMAP_START=0x00000000
+CONFIG_MTD_PHYSMAP_LEN=0x04000000
+CONFIG_MTD_PHYSMAP_BANKWIDTH=4
+# CONFIG_MTD_PXA2XX is not set
+# CONFIG_MTD_ARM_INTEGRATOR is not set
+# CONFIG_MTD_SHARP_SL is not set
+# CONFIG_MTD_PLATRAM is not set
+
+#
+# Self-contained MTD device drivers
+#
+# CONFIG_MTD_SLRAM is not set
+# CONFIG_MTD_PHRAM is not set
+# CONFIG_MTD_MTDRAM is not set
+# CONFIG_MTD_BLOCK2MTD is not set
+
+#
+# Disk-On-Chip Device Drivers
+#
+# CONFIG_MTD_DOC2000 is not set
+# CONFIG_MTD_DOC2001 is not set
+# CONFIG_MTD_DOC2001PLUS is not set
+# CONFIG_MTD_NAND is not set
+# CONFIG_MTD_ONENAND is not set
+
+#
+# UBI - Unsorted block images
+#
+# CONFIG_MTD_UBI is not set
+# CONFIG_PARPORT is not set
+CONFIG_BLK_DEV=y
+# CONFIG_BLK_DEV_COW_COMMON is not set
+# CONFIG_BLK_DEV_LOOP is not set
+# CONFIG_BLK_DEV_NBD is not set
+# CONFIG_BLK_DEV_RAM is not set
+# CONFIG_CDROM_PKTCDVD is not set
+# CONFIG_ATA_OVER_ETH is not set
+# CONFIG_MISC_DEVICES is not set
+# CONFIG_IDE is not set
+
+#
+# SCSI device support
+#
+# CONFIG_RAID_ATTRS is not set
+# CONFIG_SCSI is not set
+# CONFIG_SCSI_DMA is not set
+# CONFIG_SCSI_NETLINK is not set
+# CONFIG_ATA is not set
+# CONFIG_MD is not set
+CONFIG_NETDEVICES=y
+# CONFIG_NETDEVICES_MULTIQUEUE is not set
+# CONFIG_DUMMY is not set
+# CONFIG_BONDING is not set
+# CONFIG_MACVLAN is not set
+# CONFIG_EQUALIZER is not set
+# CONFIG_TUN is not set
+# CONFIG_VETH is not set
+# CONFIG_NET_ETHERNET is not set
+# CONFIG_NETDEV_1000 is not set
+# CONFIG_NETDEV_10000 is not set
+
+#
+# Wireless LAN
+#
+# CONFIG_WLAN_PRE80211 is not set
+# CONFIG_WLAN_80211 is not set
+# CONFIG_WAN is not set
+CONFIG_PPP=m
+# CONFIG_PPP_MULTILINK is not set
+# CONFIG_PPP_FILTER is not set
+CONFIG_PPP_ASYNC=m
+# CONFIG_PPP_SYNC_TTY is not set
+CONFIG_PPP_DEFLATE=m
+CONFIG_PPP_BSDCOMP=m
+CONFIG_PPP_MPPE=m
+# CONFIG_PPPOE is not set
+# CONFIG_PPPOL2TP is not set
+# CONFIG_SLIP is not set
+CONFIG_SLHC=m
+# CONFIG_NETCONSOLE is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_ISDN is not set
+
+#
+# Input device support
+#
+CONFIG_INPUT=y
+# CONFIG_INPUT_FF_MEMLESS is not set
+# CONFIG_INPUT_POLLDEV is not set
+
+#
+# Userland interfaces
+#
+# CONFIG_INPUT_MOUSEDEV is not set
+# CONFIG_INPUT_JOYDEV is not set
+CONFIG_INPUT_EVDEV=y
+# CONFIG_INPUT_EVBUG is not set
+
+#
+# Input Device Drivers
+#
+CONFIG_INPUT_KEYBOARD=y
+# CONFIG_KEYBOARD_ATKBD is not set
+# CONFIG_KEYBOARD_SUNKBD is not set
+# CONFIG_KEYBOARD_LKKBD is not set
+# CONFIG_KEYBOARD_XTKBD is not set
+# CONFIG_KEYBOARD_NEWTON is not set
+# CONFIG_KEYBOARD_STOWAWAY is not set
+# CONFIG_KEYBOARD_PXA27x is not set
+CONFIG_KEYBOARD_GPIO=y
+# CONFIG_INPUT_MOUSE is not set
+# CONFIG_INPUT_JOYSTICK is not set
+# CONFIG_INPUT_TABLET is not set
+CONFIG_INPUT_TOUCHSCREEN=y
+CONFIG_INPUT_MISC=y
+CONFIG_INPUT_UINPUT=m
+
+#
+# Hardware I/O ports
+#
+# CONFIG_SERIO is not set
+# CONFIG_GAMEPORT is not set
+
+#
+# Character devices
+#
+CONFIG_VT=y
+CONFIG_VT_CONSOLE=y
+CONFIG_HW_CONSOLE=y
+# CONFIG_VT_HW_CONSOLE_BINDING is not set
+# CONFIG_SERIAL_NONSTANDARD is not set
+
+#
+# Serial drivers
+#
+# CONFIG_SERIAL_8250 is not set
+
+#
+# Non-8250 serial port support
+#
+CONFIG_SERIAL_PXA=y
+# CONFIG_SERIAL_PXA_CONSOLE is not set
+CONFIG_SERIAL_CORE=y
+CONFIG_UNIX98_PTYS=y
+# CONFIG_LEGACY_PTYS is not set
+# CONFIG_IPMI_HANDLER is not set
+# CONFIG_HW_RANDOM is not set
+# CONFIG_NVRAM is not set
+# CONFIG_R3964 is not set
+# CONFIG_RAW_DRIVER is not set
+# CONFIG_TCG_TPM is not set
+CONFIG_I2C=m
+CONFIG_I2C_BOARDINFO=y
+CONFIG_I2C_CHARDEV=m
+
+#
+# I2C Algorithms
+#
+# CONFIG_I2C_ALGOBIT is not set
+# CONFIG_I2C_ALGOPCF is not set
+# CONFIG_I2C_ALGOPCA is not set
+
+#
+# I2C Hardware Bus support
+#
+# CONFIG_I2C_GPIO is not set
+CONFIG_I2C_PXA=m
+# CONFIG_I2C_PXA_SLAVE is not set
+# CONFIG_I2C_OCORES is not set
+# CONFIG_I2C_PARPORT_LIGHT is not set
+# CONFIG_I2C_SIMTEC is not set
+# CONFIG_I2C_TAOS_EVM is not set
+# CONFIG_I2C_STUB is not set
+
+#
+# Miscellaneous I2C Chip support
+#
+# CONFIG_SENSORS_DS1337 is not set
+# CONFIG_SENSORS_DS1374 is not set
+# CONFIG_DS1682 is not set
+# CONFIG_SENSORS_EEPROM is not set
+# CONFIG_SENSORS_PCF8574 is not set
+# CONFIG_SENSORS_PCA9539 is not set
+# CONFIG_SENSORS_PCF8591 is not set
+# CONFIG_SENSORS_MAX6875 is not set
+# CONFIG_SENSORS_TSL2550 is not set
+# CONFIG_I2C_DEBUG_CORE is not set
+# CONFIG_I2C_DEBUG_ALGO is not set
+# CONFIG_I2C_DEBUG_BUS is not set
+# CONFIG_I2C_DEBUG_CHIP is not set
+
+#
+# SPI support
+#
+# CONFIG_SPI is not set
+# CONFIG_SPI_MASTER is not set
+CONFIG_W1=y
+
+#
+# 1-wire Bus Masters
+#
+# CONFIG_W1_MASTER_DS2482 is not set
+CONFIG_W1_MASTER_DS1WM=y
+
+#
+# 1-wire Slaves
+#
+# CONFIG_W1_SLAVE_THERM is not set
+# CONFIG_W1_SLAVE_SMEM is not set
+# CONFIG_W1_SLAVE_DS2433 is not set
+CONFIG_W1_SLAVE_DS2760=y
+CONFIG_POWER_SUPPLY=y
+# CONFIG_POWER_SUPPLY_DEBUG is not set
+CONFIG_PDA_POWER=y
+# CONFIG_APM_POWER is not set
+CONFIG_BATTERY_DS2760=y
+# CONFIG_HWMON is not set
+# CONFIG_WATCHDOG is not set
+
+#
+# Sonics Silicon Backplane
+#
+CONFIG_SSB_POSSIBLE=y
+# CONFIG_SSB is not set
+
+#
+# Multifunction device drivers
+#
+# CONFIG_MFD_SM501 is not set
+CONFIG_HTC_EGPIO=y
+CONFIG_HTC_PASIC3=y
+
+#
+# Multimedia devices
+#
+# CONFIG_VIDEO_DEV is not set
+# CONFIG_DVB_CORE is not set
+# CONFIG_DAB is not set
+
+#
+# Graphics support
+#
+# CONFIG_VGASTATE is not set
+# CONFIG_VIDEO_OUTPUT_CONTROL is not set
+CONFIG_FB=y
+# CONFIG_FIRMWARE_EDID is not set
+# CONFIG_FB_DDC is not set
+CONFIG_FB_CFB_FILLRECT=y
+CONFIG_FB_CFB_COPYAREA=y
+CONFIG_FB_CFB_IMAGEBLIT=y
+# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
+# CONFIG_FB_SYS_FILLRECT is not set
+# CONFIG_FB_SYS_COPYAREA is not set
+# CONFIG_FB_SYS_IMAGEBLIT is not set
+# CONFIG_FB_SYS_FOPS is not set
+CONFIG_FB_DEFERRED_IO=y
+# CONFIG_FB_SVGALIB is not set
+# CONFIG_FB_MACMODES is not set
+# CONFIG_FB_BACKLIGHT is not set
+# CONFIG_FB_MODE_HELPERS is not set
+# CONFIG_FB_TILEBLITTING is not set
+
+#
+# Frame buffer hardware drivers
+#
+# CONFIG_FB_S1D13XXX is not set
+CONFIG_FB_PXA=y
+# CONFIG_FB_PXA_PARAMETERS is not set
+# CONFIG_FB_MBX is not set
+# CONFIG_FB_VIRTUAL is not set
+CONFIG_BACKLIGHT_LCD_SUPPORT=y
+CONFIG_LCD_CLASS_DEVICE=y
+CONFIG_BACKLIGHT_CLASS_DEVICE=y
+CONFIG_BACKLIGHT_CORGI=y
+
+#
+# Display device support
+#
+CONFIG_DISPLAY_SUPPORT=y
+
+#
+# Display hardware drivers
+#
+
+#
+# Console display driver support
+#
+# CONFIG_VGA_CONSOLE is not set
+CONFIG_DUMMY_CONSOLE=y
+CONFIG_FRAMEBUFFER_CONSOLE=y
+# CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY is not set
+CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y
+CONFIG_FONTS=y
+# CONFIG_FONT_8x8 is not set
+# CONFIG_FONT_8x16 is not set
+# CONFIG_FONT_6x11 is not set
+# CONFIG_FONT_7x14 is not set
+# CONFIG_FONT_PEARL_8x8 is not set
+# CONFIG_FONT_ACORN_8x8 is not set
+CONFIG_FONT_MINI_4x6=y
+# CONFIG_FONT_SUN8x16 is not set
+# CONFIG_FONT_SUN12x22 is not set
+# CONFIG_FONT_10x18 is not set
+# CONFIG_LOGO is not set
+
+#
+# Sound
+#
+CONFIG_SOUND=y
+
+#
+# Advanced Linux Sound Architecture
+#
+CONFIG_SND=m
+CONFIG_SND_TIMER=m
+CONFIG_SND_PCM=m
+# CONFIG_SND_SEQUENCER is not set
+CONFIG_SND_OSSEMUL=y
+CONFIG_SND_MIXER_OSS=m
+CONFIG_SND_PCM_OSS=m
+CONFIG_SND_PCM_OSS_PLUGINS=y
+# CONFIG_SND_DYNAMIC_MINORS is not set
+CONFIG_SND_SUPPORT_OLD_API=y
+CONFIG_SND_VERBOSE_PROCFS=y
+# CONFIG_SND_VERBOSE_PRINTK is not set
+# CONFIG_SND_DEBUG is not set
+
+#
+# Generic devices
+#
+# CONFIG_SND_DUMMY is not set
+# CONFIG_SND_MTPAV is not set
+# CONFIG_SND_SERIAL_U16550 is not set
+# CONFIG_SND_MPU401 is not set
+
+#
+# ALSA ARM devices
+#
+# CONFIG_SND_PXA2XX_AC97 is not set
+
+#
+# System on Chip audio support
+#
+CONFIG_SND_SOC=m
+CONFIG_SND_PXA2XX_SOC=m
+
+#
+# SoC Audio support for SuperH
+#
+
+#
+# Open Sound System
+#
+# CONFIG_SOUND_PRIME is not set
+# CONFIG_HID_SUPPORT is not set
+CONFIG_HID=m
+# CONFIG_USB_SUPPORT is not set
+CONFIG_MMC=y
+# CONFIG_MMC_DEBUG is not set
+# CONFIG_MMC_UNSAFE_RESUME is not set
+
+#
+# MMC/SD Card Drivers
+#
+CONFIG_MMC_BLOCK=y
+CONFIG_MMC_BLOCK_BOUNCE=y
+CONFIG_SDIO_UART=m
+
+#
+# MMC/SD Host Controller Drivers
+#
+CONFIG_MMC_PXA=y
+CONFIG_NEW_LEDS=y
+CONFIG_RTC_LIB=y
+CONFIG_RTC_CLASS=y
+CONFIG_RTC_HCTOSYS=y
+CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
+CONFIG_RTC_DEBUG=y
+
+#
+# RTC interfaces
+#
+CONFIG_RTC_INTF_SYSFS=y
+CONFIG_RTC_INTF_PROC=y
+CONFIG_RTC_INTF_DEV=y
+# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
+# CONFIG_RTC_DRV_TEST is not set
+
+#
+# I2C RTC drivers
+#
+# CONFIG_RTC_DRV_DS1307 is not set
+# CONFIG_RTC_DRV_DS1374 is not set
+# CONFIG_RTC_DRV_DS1672 is not set
+# CONFIG_RTC_DRV_MAX6900 is not set
+# CONFIG_RTC_DRV_RS5C372 is not set
+# CONFIG_RTC_DRV_ISL1208 is not set
+# CONFIG_RTC_DRV_X1205 is not set
+# CONFIG_RTC_DRV_PCF8563 is not set
+# CONFIG_RTC_DRV_PCF8583 is not set
+# CONFIG_RTC_DRV_M41T80 is not set
+
+#
+# SPI RTC drivers
+#
+
+#
+# Platform RTC drivers
+#
+# CONFIG_RTC_DRV_CMOS is not set
+# CONFIG_RTC_DRV_DS1553 is not set
+# CONFIG_RTC_DRV_STK17TA8 is not set
+# CONFIG_RTC_DRV_DS1742 is not set
+# CONFIG_RTC_DRV_M48T86 is not set
+# CONFIG_RTC_DRV_M48T59 is not set
+# CONFIG_RTC_DRV_V3020 is not set
+
+#
+# on-CPU RTC drivers
+#
+CONFIG_RTC_DRV_SA1100=y
+
+#
+# File systems
+#
+CONFIG_EXT2_FS=y
+# CONFIG_EXT2_FS_XATTR is not set
+# CONFIG_EXT2_FS_XIP is not set
+# CONFIG_EXT3_FS is not set
+# CONFIG_EXT4DEV_FS is not set
+# CONFIG_REISERFS_FS is not set
+# CONFIG_JFS_FS is not set
+# CONFIG_FS_POSIX_ACL is not set
+# CONFIG_XFS_FS is not set
+# CONFIG_GFS2_FS is not set
+# CONFIG_OCFS2_FS is not set
+# CONFIG_MINIX_FS is not set
+# CONFIG_ROMFS_FS is not set
+CONFIG_INOTIFY=y
+CONFIG_INOTIFY_USER=y
+# CONFIG_QUOTA is not set
+CONFIG_DNOTIFY=y
+# CONFIG_AUTOFS_FS is not set
+# CONFIG_AUTOFS4_FS is not set
+# CONFIG_FUSE_FS is not set
+
+#
+# CD-ROM/DVD Filesystems
+#
+# CONFIG_ISO9660_FS is not set
+# CONFIG_UDF_FS is not set
+
+#
+# DOS/FAT/NT Filesystems
+#
+CONFIG_FAT_FS=m
+CONFIG_MSDOS_FS=m
+CONFIG_VFAT_FS=m
+CONFIG_FAT_DEFAULT_CODEPAGE=437
+CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
+# CONFIG_NTFS_FS is not set
+
+#
+# Pseudo filesystems
+#
+CONFIG_PROC_FS=y
+CONFIG_PROC_SYSCTL=y
+CONFIG_SYSFS=y
+CONFIG_TMPFS=y
+# CONFIG_TMPFS_POSIX_ACL is not set
+# CONFIG_HUGETLB_PAGE is not set
+# CONFIG_CONFIGFS_FS is not set
+
+#
+# Miscellaneous filesystems
+#
+# CONFIG_ADFS_FS is not set
+# CONFIG_AFFS_FS is not set
+# CONFIG_HFS_FS is not set
+# CONFIG_HFSPLUS_FS is not set
+# CONFIG_BEFS_FS is not set
+# CONFIG_BFS_FS is not set
+# CONFIG_EFS_FS is not set
+CONFIG_JFFS2_FS=y
+CONFIG_JFFS2_FS_DEBUG=0
+CONFIG_JFFS2_FS_WRITEBUFFER=y
+# CONFIG_JFFS2_FS_WBUF_VERIFY is not set
+# CONFIG_JFFS2_SUMMARY is not set
+# CONFIG_JFFS2_FS_XATTR is not set
+CONFIG_JFFS2_COMPRESSION_OPTIONS=y
+CONFIG_JFFS2_ZLIB=y
+CONFIG_JFFS2_LZO=y
+CONFIG_JFFS2_RTIME=y
+# CONFIG_JFFS2_RUBIN is not set
+# CONFIG_JFFS2_CMODE_NONE is not set
+CONFIG_JFFS2_CMODE_PRIORITY=y
+# CONFIG_JFFS2_CMODE_SIZE is not set
+# CONFIG_JFFS2_CMODE_FAVOURLZO is not set
+# CONFIG_CRAMFS is not set
+# CONFIG_VXFS_FS is not set
+# CONFIG_HPFS_FS is not set
+# CONFIG_QNX4FS_FS is not set
+# CONFIG_SYSV_FS is not set
+# CONFIG_UFS_FS is not set
+CONFIG_NETWORK_FILESYSTEMS=y
+CONFIG_NFS_FS=y
+CONFIG_NFS_V3=y
+# CONFIG_NFS_V3_ACL is not set
+# CONFIG_NFS_V4 is not set
+# CONFIG_NFS_DIRECTIO is not set
+# CONFIG_NFSD is not set
+CONFIG_ROOT_NFS=y
+CONFIG_LOCKD=y
+CONFIG_LOCKD_V4=y
+CONFIG_NFS_COMMON=y
+CONFIG_SUNRPC=y
+# CONFIG_SUNRPC_BIND34 is not set
+# CONFIG_RPCSEC_GSS_KRB5 is not set
+# CONFIG_RPCSEC_GSS_SPKM3 is not set
+# CONFIG_SMB_FS is not set
+# CONFIG_CIFS is not set
+# CONFIG_NCP_FS is not set
+# CONFIG_CODA_FS is not set
+# CONFIG_AFS_FS is not set
+
+#
+# Partition Types
+#
+# CONFIG_PARTITION_ADVANCED is not set
+CONFIG_MSDOS_PARTITION=y
+CONFIG_NLS=y
+CONFIG_NLS_DEFAULT="utf8"
+CONFIG_NLS_CODEPAGE_437=y
+# CONFIG_NLS_CODEPAGE_737 is not set
+# CONFIG_NLS_CODEPAGE_775 is not set
+# CONFIG_NLS_CODEPAGE_850 is not set
+# CONFIG_NLS_CODEPAGE_852 is not set
+# CONFIG_NLS_CODEPAGE_855 is not set
+# CONFIG_NLS_CODEPAGE_857 is not set
+# CONFIG_NLS_CODEPAGE_860 is not set
+# CONFIG_NLS_CODEPAGE_861 is not set
+# CONFIG_NLS_CODEPAGE_862 is not set
+# CONFIG_NLS_CODEPAGE_863 is not set
+# CONFIG_NLS_CODEPAGE_864 is not set
+# CONFIG_NLS_CODEPAGE_865 is not set
+# CONFIG_NLS_CODEPAGE_866 is not set
+# CONFIG_NLS_CODEPAGE_869 is not set
+# CONFIG_NLS_CODEPAGE_936 is not set
+# CONFIG_NLS_CODEPAGE_950 is not set
+# CONFIG_NLS_CODEPAGE_932 is not set
+# CONFIG_NLS_CODEPAGE_949 is not set
+# CONFIG_NLS_CODEPAGE_874 is not set
+# CONFIG_NLS_ISO8859_8 is not set
+# CONFIG_NLS_CODEPAGE_1250 is not set
+CONFIG_NLS_CODEPAGE_1251=m
+# CONFIG_NLS_ASCII is not set
+CONFIG_NLS_ISO8859_1=y
+# CONFIG_NLS_ISO8859_2 is not set
+# CONFIG_NLS_ISO8859_3 is not set
+# CONFIG_NLS_ISO8859_4 is not set
+# CONFIG_NLS_ISO8859_5 is not set
+# CONFIG_NLS_ISO8859_6 is not set
+# CONFIG_NLS_ISO8859_7 is not set
+# CONFIG_NLS_ISO8859_9 is not set
+# CONFIG_NLS_ISO8859_13 is not set
+# CONFIG_NLS_ISO8859_14 is not set
+# CONFIG_NLS_ISO8859_15 is not set
+# CONFIG_NLS_KOI8_R is not set
+# CONFIG_NLS_KOI8_U is not set
+CONFIG_NLS_UTF8=y
+# CONFIG_DLM is not set
+
+#
+# Kernel hacking
+#
+CONFIG_PRINTK_TIME=y
+CONFIG_ENABLE_WARN_DEPRECATED=y
+CONFIG_ENABLE_MUST_CHECK=y
+# CONFIG_MAGIC_SYSRQ is not set
+# CONFIG_UNUSED_SYMBOLS is not set
+# CONFIG_DEBUG_FS is not set
+# CONFIG_HEADERS_CHECK is not set
+CONFIG_DEBUG_KERNEL=y
+# CONFIG_DEBUG_SHIRQ is not set
+CONFIG_DETECT_SOFTLOCKUP=y
+# CONFIG_SCHED_DEBUG is not set
+# CONFIG_SCHEDSTATS is not set
+CONFIG_TIMER_STATS=y
+# CONFIG_DEBUG_SLAB is not set
+CONFIG_DEBUG_PREEMPT=y
+# CONFIG_DEBUG_RT_MUTEXES is not set
+# CONFIG_RT_MUTEX_TESTER is not set
+# CONFIG_DEBUG_SPINLOCK is not set
+CONFIG_DEBUG_MUTEXES=y
+# CONFIG_DEBUG_LOCK_ALLOC is not set
+# CONFIG_PROVE_LOCKING is not set
+# CONFIG_LOCK_STAT is not set
+# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
+# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
+# CONFIG_DEBUG_KOBJECT is not set
+CONFIG_DEBUG_BUGVERBOSE=y
+# CONFIG_DEBUG_INFO is not set
+CONFIG_DEBUG_VM=y
+# CONFIG_DEBUG_LIST is not set
+# CONFIG_DEBUG_SG is not set
+CONFIG_FRAME_POINTER=y
+CONFIG_FORCED_INLINING=y
+# CONFIG_BOOT_PRINTK_DELAY is not set
+# CONFIG_RCU_TORTURE_TEST is not set
+# CONFIG_FAULT_INJECTION is not set
+# CONFIG_SAMPLES is not set
+CONFIG_DEBUG_USER=y
+CONFIG_DEBUG_ERRORS=y
+CONFIG_DEBUG_LL=y
+# CONFIG_DEBUG_ICEDCC is not set
+
+#
+# Security options
+#
+# CONFIG_KEYS is not set
+# CONFIG_SECURITY is not set
+# CONFIG_SECURITY_FILE_CAPABILITIES is not set
+CONFIG_CRYPTO=y
+CONFIG_CRYPTO_ALGAPI=m
+CONFIG_CRYPTO_BLKCIPHER=m
+CONFIG_CRYPTO_MANAGER=m
+# CONFIG_CRYPTO_HMAC is not set
+# CONFIG_CRYPTO_XCBC is not set
+# CONFIG_CRYPTO_NULL is not set
+# CONFIG_CRYPTO_MD4 is not set
+# CONFIG_CRYPTO_MD5 is not set
+CONFIG_CRYPTO_SHA1=m
+# CONFIG_CRYPTO_SHA256 is not set
+# CONFIG_CRYPTO_SHA512 is not set
+# CONFIG_CRYPTO_WP512 is not set
+# CONFIG_CRYPTO_TGR192 is not set
+# CONFIG_CRYPTO_GF128MUL is not set
+CONFIG_CRYPTO_ECB=m
+# CONFIG_CRYPTO_CBC is not set
+CONFIG_CRYPTO_PCBC=m
+# CONFIG_CRYPTO_LRW is not set
+# CONFIG_CRYPTO_XTS is not set
+# CONFIG_CRYPTO_CRYPTD is not set
+# CONFIG_CRYPTO_DES is not set
+# CONFIG_CRYPTO_FCRYPT is not set
+# CONFIG_CRYPTO_BLOWFISH is not set
+# CONFIG_CRYPTO_TWOFISH is not set
+# CONFIG_CRYPTO_SERPENT is not set
+# CONFIG_CRYPTO_AES is not set
+# CONFIG_CRYPTO_CAST5 is not set
+# CONFIG_CRYPTO_CAST6 is not set
+# CONFIG_CRYPTO_TEA is not set
+CONFIG_CRYPTO_ARC4=m
+# CONFIG_CRYPTO_KHAZAD is not set
+# CONFIG_CRYPTO_ANUBIS is not set
+# CONFIG_CRYPTO_SEED is not set
+# CONFIG_CRYPTO_DEFLATE is not set
+# CONFIG_CRYPTO_MICHAEL_MIC is not set
+# CONFIG_CRYPTO_CRC32C is not set
+# CONFIG_CRYPTO_CAMELLIA is not set
+# CONFIG_CRYPTO_TEST is not set
+# CONFIG_CRYPTO_AUTHENC is not set
+# CONFIG_CRYPTO_HW is not set
+
+#
+# Library routines
+#
+CONFIG_BITREVERSE=y
+CONFIG_CRC_CCITT=y
+# CONFIG_CRC16 is not set
+# CONFIG_CRC_ITU_T is not set
+CONFIG_CRC32=y
+# CONFIG_CRC7 is not set
+# CONFIG_LIBCRC32C is not set
+CONFIG_ZLIB_INFLATE=y
+CONFIG_ZLIB_DEFLATE=y
+CONFIG_LZO_COMPRESS=y
+CONFIG_LZO_DECOMPRESS=y
+CONFIG_PLIST=y
+CONFIG_HAS_IOMEM=y
+CONFIG_HAS_IOPORT=y
+CONFIG_HAS_DMA=y
index 0e5794c6a48ef3e87721b58751ec3ea460dd63ca..7dc1580e4d99b214e8d988380b7b1a5adbafd96d 100644 (file)
-#
-# Automatically generated make config: don't edit
-# Linux kernel version: 2.6.20
-# Thu Feb 15 20:51:47 2007
-#
-CONFIG_ARM=y
-# CONFIG_GENERIC_TIME is not set
-CONFIG_MMU=y
-CONFIG_GENERIC_HARDIRQS=y
-CONFIG_TRACE_IRQFLAGS_SUPPORT=y
-CONFIG_HARDIRQS_SW_RESEND=y
-CONFIG_GENERIC_IRQ_PROBE=y
-CONFIG_RWSEM_GENERIC_SPINLOCK=y
-# CONFIG_ARCH_HAS_ILOG2_U32 is not set
-# CONFIG_ARCH_HAS_ILOG2_U64 is not set
-CONFIG_GENERIC_HWEIGHT=y
-CONFIG_GENERIC_CALIBRATE_DELAY=y
-CONFIG_VECTORS_BASE=0xffff0000
-CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
-
-#
-# Code maturity level options
-#
-CONFIG_EXPERIMENTAL=y
-CONFIG_BROKEN_ON_SMP=y
-CONFIG_INIT_ENV_ARG_LIMIT=32
-
-#
-# General setup
-#
-CONFIG_LOCALVERSION=""
-CONFIG_LOCALVERSION_AUTO=y
-CONFIG_SWAP=y
-CONFIG_SYSVIPC=y
-# CONFIG_IPC_NS is not set
-# CONFIG_BSD_PROCESS_ACCT is not set
-# CONFIG_UTS_NS is not set
 CONFIG_IKCONFIG=y
 CONFIG_IKCONFIG_PROC=y
-CONFIG_SYSFS_DEPRECATED=y
-# CONFIG_RELAY is not set
-CONFIG_INITRAMFS_SOURCE=""
-# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_SYSCTL=y
-CONFIG_EMBEDDED=y
-CONFIG_UID16=y
-# CONFIG_SYSCTL_SYSCALL is not set
-CONFIG_KALLSYMS=y
-# CONFIG_KALLSYMS_ALL is not set
-# CONFIG_KALLSYMS_EXTRA_PASS is not set
-CONFIG_HOTPLUG=y
-CONFIG_PRINTK=y
-CONFIG_BUG=y
-CONFIG_ELF_CORE=y
-CONFIG_BASE_FULL=y
-CONFIG_FUTEX=y
-CONFIG_EPOLL=y
-CONFIG_SHMEM=y
-CONFIG_SLAB=y
-# CONFIG_VM_EVENT_COUNTERS is not set
-CONFIG_RT_MUTEXES=y
-# CONFIG_TINY_SHMEM is not set
-CONFIG_BASE_SMALL=0
-# CONFIG_SLOB is not set
-
-#
-# Loadable module support
-#
+CONFIG_BLK_DEV_INITRD=y
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
-CONFIG_MODULE_FORCE_UNLOAD=y
-CONFIG_MODVERSIONS=y
-CONFIG_MODULE_SRCVERSION_ALL=y
-CONFIG_KMOD=y
-
-#
-# Block layer
-#
-CONFIG_BLOCK=y
-# CONFIG_LBD is not set
-# CONFIG_BLK_DEV_IO_TRACE is not set
-# CONFIG_LSF is not set
-
-#
-# IO Schedulers
-#
-CONFIG_IOSCHED_NOOP=y
 # CONFIG_IOSCHED_AS is not set
 # CONFIG_IOSCHED_DEADLINE is not set
 # CONFIG_IOSCHED_CFQ is not set
-# CONFIG_DEFAULT_AS is not set
-# CONFIG_DEFAULT_DEADLINE is not set
-# CONFIG_DEFAULT_CFQ is not set
-CONFIG_DEFAULT_NOOP=y
-CONFIG_DEFAULT_IOSCHED="noop"
-
-#
-# System Type
-#
-# CONFIG_ARCH_AAEC2000 is not set
-# CONFIG_ARCH_INTEGRATOR is not set
-# CONFIG_ARCH_REALVIEW is not set
-# CONFIG_ARCH_VERSATILE is not set
-# CONFIG_ARCH_AT91 is not set
-# CONFIG_ARCH_CLPS7500 is not set
-# CONFIG_ARCH_CLPS711X is not set
-# CONFIG_ARCH_CO285 is not set
-# CONFIG_ARCH_EBSA110 is not set
-# CONFIG_ARCH_EP93XX is not set
-# CONFIG_ARCH_FOOTBRIDGE is not set
-# CONFIG_ARCH_NETX is not set
-# CONFIG_ARCH_H720X is not set
-# CONFIG_ARCH_IMX is not set
-# CONFIG_ARCH_IOP32X is not set
-# CONFIG_ARCH_IOP33X is not set
-# CONFIG_ARCH_IOP13XX is not set
-# CONFIG_ARCH_IXP4XX is not set
-# CONFIG_ARCH_IXP2000 is not set
-# CONFIG_ARCH_IXP23XX is not set
-# CONFIG_ARCH_L7200 is not set
 CONFIG_ARCH_NS9XXX=y
-# CONFIG_ARCH_PNX4008 is not set
-# CONFIG_ARCH_PXA is not set
-# CONFIG_ARCH_RPC is not set
-# CONFIG_ARCH_SA1100 is not set
-# CONFIG_ARCH_S3C2410 is not set
-# CONFIG_ARCH_SHARK is not set
-# CONFIG_ARCH_LH7A40X is not set
-# CONFIG_ARCH_OMAP is not set
-
-#
-# NS9xxx Implementations
-#
+CONFIG_MACH_A9M9360=y
+CONFIG_MACH_A9M9750=y
+CONFIG_MACH_CC7UCAMRY=y
+CONFIG_MACH_CC9C=y
+CONFIG_MACH_CC9P9210=y
+CONFIG_MACH_CC9P9210JS=y
+CONFIG_MACH_CC9P9215=y
+CONFIG_MACH_CC9P9215JS=y
 CONFIG_MACH_CC9P9360DEV=y
-CONFIG_PROCESSOR_NS9360=y
-CONFIG_BOARD_A9M9750DEV=y
-
-#
-# Processor Type
-#
-CONFIG_CPU_32=y
-CONFIG_CPU_ARM926T=y
-CONFIG_CPU_32v5=y
-CONFIG_CPU_ABRT_EV5TJ=y
-CONFIG_CPU_CACHE_VIVT=y
-CONFIG_CPU_COPY_V4WB=y
-CONFIG_CPU_TLB_V4WBI=y
-CONFIG_CPU_CP15=y
-CONFIG_CPU_CP15_MMU=y
-
-#
-# Processor Features
-#
-# CONFIG_ARM_THUMB is not set
-# CONFIG_CPU_ICACHE_DISABLE is not set
-# CONFIG_CPU_DCACHE_DISABLE is not set
-# CONFIG_CPU_DCACHE_WRITETHROUGH is not set
-# CONFIG_CPU_CACHE_ROUND_ROBIN is not set
-
-#
-# Bus support
-#
-
-#
-# PCCARD (PCMCIA/CardBus) support
-#
-# CONFIG_PCCARD is not set
-
-#
-# Kernel Features
-#
-# CONFIG_PREEMPT is not set
-# CONFIG_NO_IDLE_HZ is not set
-CONFIG_HZ=100
-# CONFIG_AEABI is not set
-# CONFIG_ARCH_DISCONTIGMEM_ENABLE is not set
-CONFIG_SELECT_MEMORY_MODEL=y
-CONFIG_FLATMEM_MANUAL=y
-# CONFIG_DISCONTIGMEM_MANUAL is not set
-# CONFIG_SPARSEMEM_MANUAL is not set
-CONFIG_FLATMEM=y
-CONFIG_FLAT_NODE_MEM_MAP=y
-# CONFIG_SPARSEMEM_STATIC is not set
-CONFIG_SPLIT_PTLOCK_CPUS=4096
-# CONFIG_RESOURCES_64BIT is not set
-CONFIG_ALIGNMENT_TRAP=y
-
-#
-# Boot options
-#
-CONFIG_ZBOOT_ROM_TEXT=0x0
-CONFIG_ZBOOT_ROM_BSS=0x0
-CONFIG_CMDLINE=""
-# CONFIG_XIP_KERNEL is not set
-
-#
-# Floating point emulation
-#
-
-#
-# At least one emulation must be selected
-#
+CONFIG_MACH_CC9P9360JS=y
+CONFIG_MACH_CC9P9360VAL=y
+CONFIG_MACH_CC9P9750DEV=y
+CONFIG_MACH_CC9P9750VAL=y
+CONFIG_MACH_CCW9C=y
+CONFIG_MACH_INC20OTTER=y
+CONFIG_MACH_OTTER=y
+CONFIG_NO_HZ=y
+CONFIG_HIGH_RES_TIMERS=y
 CONFIG_FPE_NWFPE=y
-# CONFIG_FPE_NWFPE_XP is not set
-# CONFIG_FPE_FASTFPE is not set
-# CONFIG_VFP is not set
-
-#
-# Userspace binary formats
-#
-CONFIG_BINFMT_ELF=y
-# CONFIG_BINFMT_AOUT is not set
-# CONFIG_BINFMT_MISC is not set
-# CONFIG_ARTHUR is not set
-
-#
-# Power management options
-#
-# CONFIG_PM is not set
-# CONFIG_APM is not set
-
-#
-# Networking
-#
-# CONFIG_NET is not set
-
-#
-# Device Drivers
-#
-
-#
-# Generic Driver Options
-#
-CONFIG_STANDALONE=y
-CONFIG_PREVENT_FIRMWARE_BUILD=y
-# CONFIG_FW_LOADER is not set
-# CONFIG_DEBUG_DRIVER is not set
-# CONFIG_SYS_HYPERVISOR is not set
-
-#
-# Connector - unified userspace <-> kernelspace linker
-#
-
-#
-# Memory Technology Devices (MTD)
-#
-# CONFIG_MTD is not set
-
-#
-# Parallel port support
-#
-# CONFIG_PARPORT is not set
-
-#
-# Plug and Play support
-#
-
-#
-# Block devices
-#
-# CONFIG_BLK_DEV_COW_COMMON is not set
-# CONFIG_BLK_DEV_LOOP is not set
-CONFIG_BLK_DEV_RAM=y
-CONFIG_BLK_DEV_RAM_COUNT=16
-CONFIG_BLK_DEV_RAM_SIZE=4096
-CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
-CONFIG_BLK_DEV_INITRD=y
-# CONFIG_CDROM_PKTCDVD is not set
-
-#
-# SCSI device support
-#
-# CONFIG_RAID_ATTRS is not set
-# CONFIG_SCSI is not set
-# CONFIG_SCSI_NETLINK is not set
-
-#
-# Serial ATA (prod) and Parallel ATA (experimental) drivers
-#
-# CONFIG_ATA is not set
-
-#
-# Multi-device support (RAID and LVM)
-#
-# CONFIG_MD is not set
-
-#
-# Fusion MPT device support
-#
-# CONFIG_FUSION is not set
-
-#
-# IEEE 1394 (FireWire) support
-#
-
-#
-# I2O device support
-#
-
-#
-# ISDN subsystem
-#
-
-#
-# Input device support
-#
-CONFIG_INPUT=y
-# CONFIG_INPUT_FF_MEMLESS is not set
-
-#
-# Userland interfaces
-#
-# CONFIG_INPUT_MOUSEDEV is not set
-# CONFIG_INPUT_JOYDEV is not set
-# CONFIG_INPUT_TSDEV is not set
-# CONFIG_INPUT_EVDEV is not set
-# CONFIG_INPUT_EVBUG is not set
-
-#
-# Input Device Drivers
-#
-# CONFIG_INPUT_KEYBOARD is not set
-# CONFIG_INPUT_MOUSE is not set
-# CONFIG_INPUT_JOYSTICK is not set
-# CONFIG_INPUT_TOUCHSCREEN is not set
-# CONFIG_INPUT_MISC is not set
-
-#
-# Hardware I/O ports
-#
-CONFIG_SERIO=y
+CONFIG_NET=y
+CONFIG_PACKET=m
+CONFIG_INET=y
+CONFIG_IP_PNP=y
+CONFIG_SYN_COOKIES=y
+CONFIG_MTD=m
+CONFIG_MTD_CONCAT=m
+CONFIG_MTD_CHAR=m
+CONFIG_MTD_BLOCK=m
+CONFIG_MTD_CFI=m
+CONFIG_MTD_JEDECPROBE=m
+CONFIG_MTD_CFI_AMDSTD=m
+CONFIG_MTD_PHYSMAP=m
+CONFIG_MTD_PHYSMAP_START=0x0
+CONFIG_BLK_DEV_LOOP=m
+CONFIG_NETDEVICES=y
+CONFIG_NET_ETHERNET=y
+CONFIG_NS9XXX_ETH=y
 # CONFIG_SERIO_SERPORT is not set
-CONFIG_SERIO_LIBPS2=y
-# CONFIG_SERIO_RAW is not set
-# CONFIG_GAMEPORT is not set
-
-#
-# Character devices
-#
-CONFIG_VT=y
-CONFIG_VT_CONSOLE=y
-CONFIG_HW_CONSOLE=y
-# CONFIG_VT_HW_CONSOLE_BINDING is not set
-# CONFIG_SERIAL_NONSTANDARD is not set
-
-#
-# Serial drivers
-#
 CONFIG_SERIAL_8250=y
 CONFIG_SERIAL_8250_CONSOLE=y
-CONFIG_SERIAL_8250_NR_UARTS=4
-CONFIG_SERIAL_8250_RUNTIME_UARTS=4
-CONFIG_SERIAL_8250_EXTENDED=y
-# CONFIG_SERIAL_8250_MANY_PORTS is not set
-# CONFIG_SERIAL_8250_SHARE_IRQ is not set
-# CONFIG_SERIAL_8250_DETECT_IRQ is not set
-# CONFIG_SERIAL_8250_RSA is not set
-
-#
-# Non-8250 serial port support
-#
-CONFIG_SERIAL_CORE=y
-CONFIG_SERIAL_CORE_CONSOLE=y
-CONFIG_UNIX98_PTYS=y
+CONFIG_SERIAL_NS921X=y
+CONFIG_SERIAL_NS921X_CONSOLE=y
 # CONFIG_LEGACY_PTYS is not set
-
-#
-# IPMI
-#
-# CONFIG_IPMI_HANDLER is not set
-
-#
-# Watchdog Cards
-#
-# CONFIG_WATCHDOG is not set
 # CONFIG_HW_RANDOM is not set
-# CONFIG_NVRAM is not set
-# CONFIG_DTLK is not set
-# CONFIG_R3964 is not set
-# CONFIG_RAW_DRIVER is not set
-
-#
-# TPM devices
-#
-# CONFIG_TCG_TPM is not set
-
-#
-# I2C support
-#
-# CONFIG_I2C is not set
-
-#
-# SPI support
-#
-# CONFIG_SPI is not set
-# CONFIG_SPI_MASTER is not set
-
-#
-# Dallas's 1-wire bus
-#
-# CONFIG_W1 is not set
-
-#
-# Hardware Monitoring support
-#
+CONFIG_ADC_NS9215=m
+CONFIG_I2C=m
+CONFIG_I2C_GPIO=m
 # CONFIG_HWMON is not set
-# CONFIG_HWMON_VID is not set
-
-#
-# Misc devices
-#
-# CONFIG_TIFM_CORE is not set
-
-#
-# LED devices
-#
-# CONFIG_NEW_LEDS is not set
-
-#
-# LED drivers
-#
-
-#
-# LED Triggers
-#
-
-#
-# Multimedia devices
-#
-# CONFIG_VIDEO_DEV is not set
-
-#
-# Digital Video Broadcasting Devices
-#
-
-#
-# Graphics support
-#
-# CONFIG_FIRMWARE_EDID is not set
-# CONFIG_FB is not set
-
-#
-# Console display driver support
-#
 # CONFIG_VGA_CONSOLE is not set
-CONFIG_DUMMY_CONSOLE=y
-# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
-
-#
-# Sound
-#
-# CONFIG_SOUND is not set
-
-#
-# HID Devices
-#
-CONFIG_HID=y
-
-#
-# USB support
-#
-CONFIG_USB_ARCH_HAS_HCD=y
-# CONFIG_USB_ARCH_HAS_OHCI is not set
-# CONFIG_USB_ARCH_HAS_EHCI is not set
-# CONFIG_USB is not set
-
-#
-# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
-#
-
-#
-# USB Gadget Support
-#
-# CONFIG_USB_GADGET is not set
-
-#
-# MMC/SD Card support
-#
-# CONFIG_MMC is not set
-
-#
-# Real Time Clock
-#
-CONFIG_RTC_LIB=y
-# CONFIG_RTC_CLASS is not set
-
-#
-# File systems
-#
-CONFIG_EXT2_FS=y
-# CONFIG_EXT2_FS_XATTR is not set
-# CONFIG_EXT2_FS_XIP is not set
-# CONFIG_EXT3_FS is not set
-# CONFIG_EXT4DEV_FS is not set
-# CONFIG_REISERFS_FS is not set
-# CONFIG_JFS_FS is not set
-# CONFIG_FS_POSIX_ACL is not set
-# CONFIG_XFS_FS is not set
-# CONFIG_GFS2_FS is not set
-# CONFIG_MINIX_FS is not set
-# CONFIG_ROMFS_FS is not set
-CONFIG_INOTIFY=y
-CONFIG_INOTIFY_USER=y
-# CONFIG_QUOTA is not set
-# CONFIG_DNOTIFY is not set
-# CONFIG_AUTOFS_FS is not set
-# CONFIG_AUTOFS4_FS is not set
-# CONFIG_FUSE_FS is not set
-
-#
-# CD-ROM/DVD Filesystems
-#
-# CONFIG_ISO9660_FS is not set
-# CONFIG_UDF_FS is not set
-
-#
-# DOS/FAT/NT Filesystems
-#
-# CONFIG_MSDOS_FS is not set
-# CONFIG_VFAT_FS is not set
-# CONFIG_NTFS_FS is not set
-
-#
-# Pseudo filesystems
-#
-CONFIG_PROC_FS=y
-CONFIG_PROC_SYSCTL=y
-CONFIG_SYSFS=y
+# CONFIG_HID_DEBUG is not set
+# CONFIG_USB_SUPPORT is not set
+CONFIG_NEW_LEDS=y
+CONFIG_LEDS_CLASS=m
+CONFIG_LEDS_GPIO=m
+CONFIG_LEDS_TRIGGERS=y
+CONFIG_LEDS_TRIGGER_TIMER=m
+CONFIG_LEDS_TRIGGER_HEARTBEAT=m
+CONFIG_RTC_CLASS=m
+CONFIG_RTC_DRV_NS9215=m
+CONFIG_EXT2_FS=m
 CONFIG_TMPFS=y
-# CONFIG_TMPFS_POSIX_ACL is not set
-# CONFIG_HUGETLB_PAGE is not set
-CONFIG_RAMFS=y
-# CONFIG_CONFIGFS_FS is not set
-
-#
-# Miscellaneous filesystems
-#
-# CONFIG_ADFS_FS is not set
-# CONFIG_AFFS_FS is not set
-# CONFIG_HFS_FS is not set
-# CONFIG_HFSPLUS_FS is not set
-# CONFIG_BEFS_FS is not set
-# CONFIG_BFS_FS is not set
-# CONFIG_EFS_FS is not set
-# CONFIG_CRAMFS is not set
-# CONFIG_VXFS_FS is not set
-# CONFIG_HPFS_FS is not set
-# CONFIG_QNX4FS_FS is not set
-# CONFIG_SYSV_FS is not set
-# CONFIG_UFS_FS is not set
-
-#
-# Partition Types
-#
-# CONFIG_PARTITION_ADVANCED is not set
-CONFIG_MSDOS_PARTITION=y
-
-#
-# Native Language Support
-#
-# CONFIG_NLS is not set
-
-#
-# Profiling support
-#
-# CONFIG_PROFILING is not set
-
-#
-# Kernel hacking
-#
-# CONFIG_PRINTK_TIME is not set
+CONFIG_JFFS2_FS=m
+CONFIG_NFS_FS=y
+CONFIG_ROOT_NFS=y
 # CONFIG_ENABLE_MUST_CHECK is not set
-# CONFIG_MAGIC_SYSRQ is not set
-# CONFIG_UNUSED_SYMBOLS is not set
-# CONFIG_DEBUG_FS is not set
-# CONFIG_HEADERS_CHECK is not set
 CONFIG_DEBUG_KERNEL=y
-CONFIG_LOG_BUF_SHIFT=14
-# CONFIG_DETECT_SOFTLOCKUP is not set
-# CONFIG_SCHEDSTATS is not set
-# CONFIG_DEBUG_SLAB is not set
-# CONFIG_DEBUG_RT_MUTEXES is not set
-# CONFIG_RT_MUTEX_TESTER is not set
-# CONFIG_DEBUG_SPINLOCK is not set
-# CONFIG_DEBUG_MUTEXES is not set
-# CONFIG_DEBUG_RWSEMS is not set
-# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
-# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
-# CONFIG_DEBUG_KOBJECT is not set
 CONFIG_DEBUG_BUGVERBOSE=y
 CONFIG_DEBUG_INFO=y
-# CONFIG_DEBUG_VM is not set
-# CONFIG_DEBUG_LIST is not set
-CONFIG_FRAME_POINTER=y
-CONFIG_FORCED_INLINING=y
-# CONFIG_RCU_TORTURE_TEST is not set
 CONFIG_DEBUG_USER=y
 CONFIG_DEBUG_ERRORS=y
-CONFIG_DEBUG_LL=y
-CONFIG_DEBUG_ICEDCC=y
-
-#
-# Security options
-#
-# CONFIG_KEYS is not set
-# CONFIG_SECURITY is not set
-
-#
-# Cryptographic options
-#
-# CONFIG_CRYPTO is not set
-
-#
-# Library routines
-#
-# CONFIG_CRC_CCITT is not set
-# CONFIG_CRC16 is not set
-# CONFIG_CRC32 is not set
-# CONFIG_LIBCRC32C is not set
-CONFIG_PLIST=y
-CONFIG_IOMAP_COPY=y
similarity index 99%
rename from arch/arm/configs/orion_defconfig
rename to arch/arm/configs/orion5x_defconfig
index 1e5aaa645fcd05af428294539902ae8dc8438860..52cd99bd52fbe700b0880143ee84b231094488a7 100644 (file)
@@ -140,7 +140,7 @@ CONFIG_CLASSIC_RCU=y
 # CONFIG_ARCH_KS8695 is not set
 # CONFIG_ARCH_NS9XXX is not set
 # CONFIG_ARCH_MXC is not set
-CONFIG_ARCH_ORION=y
+CONFIG_ARCH_ORION5X=y
 # CONFIG_ARCH_PNX4008 is not set
 # CONFIG_ARCH_PXA is not set
 # CONFIG_ARCH_RPC is not set
index 3c0c4f192dc1110dc2aa04ae2927343b6662d7fc..95a22f5128054528c29fa38b2895a424ee519315 100644 (file)
@@ -727,14 +727,14 @@ CONFIG_I2C_CHARDEV=m
 #
 # I2C Algorithms
 #
-# CONFIG_I2C_ALGOBIT is not set
+CONFIG_I2C_ALGOBIT=m
 # CONFIG_I2C_ALGOPCF is not set
 # CONFIG_I2C_ALGOPCA is not set
 
 #
 # I2C Hardware Bus support
 #
-CONFIG_I2C_AT91=m
+CONFIG_I2C_GPIO=m
 # CONFIG_I2C_OCORES is not set
 # CONFIG_I2C_PARPORT_LIGHT is not set
 # CONFIG_I2C_STUB is not set
diff --git a/arch/arm/configs/sam9_l9260_defconfig b/arch/arm/configs/sam9_l9260_defconfig
new file mode 100644 (file)
index 0000000..484dc97
--- /dev/null
@@ -0,0 +1,1098 @@
+#
+# Automatically generated make config: don't edit
+# Linux kernel version: 2.6.23
+# Sun Oct 14 02:01:07 2007
+#
+CONFIG_ARM=y
+CONFIG_SYS_SUPPORTS_APM_EMULATION=y
+CONFIG_GENERIC_GPIO=y
+# CONFIG_GENERIC_TIME is not set
+# CONFIG_GENERIC_CLOCKEVENTS is not set
+CONFIG_MMU=y
+# CONFIG_NO_IOPORT is not set
+CONFIG_GENERIC_HARDIRQS=y
+CONFIG_STACKTRACE_SUPPORT=y
+CONFIG_LOCKDEP_SUPPORT=y
+CONFIG_TRACE_IRQFLAGS_SUPPORT=y
+CONFIG_HARDIRQS_SW_RESEND=y
+CONFIG_GENERIC_IRQ_PROBE=y
+CONFIG_RWSEM_GENERIC_SPINLOCK=y
+# CONFIG_ARCH_HAS_ILOG2_U32 is not set
+# CONFIG_ARCH_HAS_ILOG2_U64 is not set
+CONFIG_GENERIC_HWEIGHT=y
+CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_ZONE_DMA=y
+CONFIG_VECTORS_BASE=0xffff0000
+CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
+
+#
+# General setup
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_BROKEN_ON_SMP=y
+CONFIG_LOCK_KERNEL=y
+CONFIG_INIT_ENV_ARG_LIMIT=32
+CONFIG_LOCALVERSION=""
+# CONFIG_LOCALVERSION_AUTO is not set
+CONFIG_SWAP=y
+CONFIG_SYSVIPC=y
+CONFIG_SYSVIPC_SYSCTL=y
+CONFIG_POSIX_MQUEUE=y
+CONFIG_BSD_PROCESS_ACCT=y
+CONFIG_BSD_PROCESS_ACCT_V3=y
+# CONFIG_TASKSTATS is not set
+# CONFIG_USER_NS is not set
+CONFIG_AUDIT=y
+# CONFIG_IKCONFIG is not set
+CONFIG_LOG_BUF_SHIFT=15
+CONFIG_SYSFS_DEPRECATED=y
+# CONFIG_RELAY is not set
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_INITRAMFS_SOURCE=""
+CONFIG_CC_OPTIMIZE_FOR_SIZE=y
+CONFIG_SYSCTL=y
+# CONFIG_EMBEDDED is not set
+CONFIG_UID16=y
+CONFIG_SYSCTL_SYSCALL=y
+CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_ALL is not set
+# CONFIG_KALLSYMS_EXTRA_PASS is not set
+CONFIG_HOTPLUG=y
+CONFIG_PRINTK=y
+CONFIG_BUG=y
+CONFIG_ELF_CORE=y
+CONFIG_BASE_FULL=y
+CONFIG_FUTEX=y
+CONFIG_ANON_INODES=y
+CONFIG_EPOLL=y
+CONFIG_SIGNALFD=y
+CONFIG_EVENTFD=y
+CONFIG_SHMEM=y
+CONFIG_VM_EVENT_COUNTERS=y
+CONFIG_SLAB=y
+# CONFIG_SLUB is not set
+# CONFIG_SLOB is not set
+CONFIG_RT_MUTEXES=y
+# CONFIG_TINY_SHMEM is not set
+CONFIG_BASE_SMALL=0
+# CONFIG_MODULES is not set
+CONFIG_BLOCK=y
+CONFIG_LBD=y
+# CONFIG_BLK_DEV_IO_TRACE is not set
+CONFIG_LSF=y
+# CONFIG_BLK_DEV_BSG is not set
+
+#
+# IO Schedulers
+#
+CONFIG_IOSCHED_NOOP=y
+CONFIG_IOSCHED_AS=y
+CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
+# CONFIG_DEFAULT_AS is not set
+# CONFIG_DEFAULT_DEADLINE is not set
+CONFIG_DEFAULT_CFQ=y
+# CONFIG_DEFAULT_NOOP is not set
+CONFIG_DEFAULT_IOSCHED="cfq"
+
+#
+# System Type
+#
+# CONFIG_ARCH_AAEC2000 is not set
+# CONFIG_ARCH_INTEGRATOR is not set
+# CONFIG_ARCH_REALVIEW is not set
+# CONFIG_ARCH_VERSATILE is not set
+CONFIG_ARCH_AT91=y
+# CONFIG_ARCH_CLPS7500 is not set
+# CONFIG_ARCH_CLPS711X is not set
+# CONFIG_ARCH_CO285 is not set
+# CONFIG_ARCH_EBSA110 is not set
+# CONFIG_ARCH_EP93XX is not set
+# CONFIG_ARCH_FOOTBRIDGE is not set
+# CONFIG_ARCH_NETX is not set
+# CONFIG_ARCH_H720X is not set
+# CONFIG_ARCH_IMX is not set
+# CONFIG_ARCH_IOP13XX is not set
+# CONFIG_ARCH_IOP32X is not set
+# CONFIG_ARCH_IOP33X is not set
+# CONFIG_ARCH_IXP23XX is not set
+# CONFIG_ARCH_IXP2000 is not set
+# CONFIG_ARCH_IXP4XX is not set
+# CONFIG_ARCH_L7200 is not set
+# CONFIG_ARCH_KS8695 is not set
+# CONFIG_ARCH_NS9XXX is not set
+# CONFIG_ARCH_MXC is not set
+# CONFIG_ARCH_PNX4008 is not set
+# CONFIG_ARCH_PXA is not set
+# CONFIG_ARCH_RPC is not set
+# CONFIG_ARCH_SA1100 is not set
+# CONFIG_ARCH_S3C2410 is not set
+# CONFIG_ARCH_SHARK is not set
+# CONFIG_ARCH_LH7A40X is not set
+# CONFIG_ARCH_DAVINCI is not set
+# CONFIG_ARCH_OMAP is not set
+
+#
+# Boot options
+#
+
+#
+# Power management
+#
+
+#
+# Atmel AT91 System-on-Chip
+#
+# CONFIG_ARCH_AT91RM9200 is not set
+CONFIG_ARCH_AT91SAM9260=y
+# CONFIG_ARCH_AT91SAM9261 is not set
+# CONFIG_ARCH_AT91SAM9263 is not set
+# CONFIG_ARCH_AT91SAM9RL is not set
+
+#
+# AT91SAM9260 Variants
+#
+# CONFIG_ARCH_AT91SAM9260_SAM9XE is not set
+
+#
+# AT91SAM9260 / AT91SAM9XE Board Type
+#
+# CONFIG_MACH_AT91SAM9260EK is not set
+# CONFIG_MACH_CAM60 is not set
+CONFIG_MACH_SAM9_L9260=y
+
+#
+# AT91 Board Options
+#
+CONFIG_MTD_AT91_DATAFLASH_CARD=y
+
+#
+# AT91 Feature Selections
+#
+# CONFIG_AT91_PROGRAMMABLE_CLOCKS is not set
+# CONFIG_ATMEL_TCLIB is not set
+
+#
+# Processor Type
+#
+CONFIG_CPU_32=y
+CONFIG_CPU_ARM926T=y
+CONFIG_CPU_32v5=y
+CONFIG_CPU_ABRT_EV5TJ=y
+CONFIG_CPU_CACHE_VIVT=y
+CONFIG_CPU_COPY_V4WB=y
+CONFIG_CPU_TLB_V4WBI=y
+CONFIG_CPU_CP15=y
+CONFIG_CPU_CP15_MMU=y
+
+#
+# Processor Features
+#
+CONFIG_ARM_THUMB=y
+# CONFIG_CPU_ICACHE_DISABLE is not set
+# CONFIG_CPU_DCACHE_DISABLE is not set
+# CONFIG_CPU_DCACHE_WRITETHROUGH is not set
+# CONFIG_CPU_CACHE_ROUND_ROBIN is not set
+# CONFIG_OUTER_CACHE is not set
+
+#
+# Bus support
+#
+# CONFIG_PCI_SYSCALL is not set
+# CONFIG_ARCH_SUPPORTS_MSI is not set
+
+#
+# PCCARD (PCMCIA/CardBus) support
+#
+# CONFIG_PCCARD is not set
+
+#
+# Kernel Features
+#
+# CONFIG_TICK_ONESHOT is not set
+CONFIG_PREEMPT=y
+# CONFIG_NO_IDLE_HZ is not set
+CONFIG_HZ=100
+# CONFIG_AEABI is not set
+# CONFIG_ARCH_DISCONTIGMEM_ENABLE is not set
+CONFIG_SELECT_MEMORY_MODEL=y
+CONFIG_FLATMEM_MANUAL=y
+# CONFIG_DISCONTIGMEM_MANUAL is not set
+# CONFIG_SPARSEMEM_MANUAL is not set
+CONFIG_FLATMEM=y
+CONFIG_FLAT_NODE_MEM_MAP=y
+# CONFIG_SPARSEMEM_STATIC is not set
+CONFIG_SPLIT_PTLOCK_CPUS=4096
+# CONFIG_RESOURCES_64BIT is not set
+CONFIG_ZONE_DMA_FLAG=1
+CONFIG_BOUNCE=y
+CONFIG_VIRT_TO_BUS=y
+CONFIG_LEDS=y
+CONFIG_LEDS_TIMER=y
+CONFIG_LEDS_CPU=y
+CONFIG_ALIGNMENT_TRAP=y
+
+#
+# Boot options
+#
+CONFIG_ZBOOT_ROM_TEXT=0x0
+CONFIG_ZBOOT_ROM_BSS=0x0
+CONFIG_CMDLINE="console=ttyS0,115200 mem=64M initrd=0x21100000,4194304 root=/dev/ram0 rw"
+# CONFIG_XIP_KERNEL is not set
+# CONFIG_KEXEC is not set
+
+#
+# Floating point emulation
+#
+
+#
+# At least one emulation must be selected
+#
+CONFIG_FPE_NWFPE=y
+# CONFIG_FPE_NWFPE_XP is not set
+# CONFIG_FPE_FASTFPE is not set
+# CONFIG_VFP is not set
+
+#
+# Userspace binary formats
+#
+CONFIG_BINFMT_ELF=y
+# CONFIG_BINFMT_AOUT is not set
+# CONFIG_BINFMT_MISC is not set
+# CONFIG_ARTHUR is not set
+
+#
+# Power management options
+#
+# CONFIG_PM is not set
+CONFIG_SUSPEND_UP_POSSIBLE=y
+
+#
+# Networking
+#
+CONFIG_NET=y
+
+#
+# Networking options
+#
+CONFIG_PACKET=y
+CONFIG_PACKET_MMAP=y
+CONFIG_UNIX=y
+CONFIG_XFRM=y
+CONFIG_XFRM_USER=y
+# CONFIG_XFRM_SUB_POLICY is not set
+# CONFIG_XFRM_MIGRATE is not set
+CONFIG_NET_KEY=y
+# CONFIG_NET_KEY_MIGRATE is not set
+CONFIG_INET=y
+# CONFIG_IP_MULTICAST is not set
+# CONFIG_IP_ADVANCED_ROUTER is not set
+CONFIG_IP_FIB_HASH=y
+# CONFIG_IP_PNP is not set
+# CONFIG_NET_IPIP is not set
+# CONFIG_NET_IPGRE is not set
+# CONFIG_ARPD is not set
+# CONFIG_SYN_COOKIES is not set
+# CONFIG_INET_AH is not set
+# CONFIG_INET_ESP is not set
+# CONFIG_INET_IPCOMP is not set
+# CONFIG_INET_XFRM_TUNNEL is not set
+# CONFIG_INET_TUNNEL is not set
+# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
+# CONFIG_INET_XFRM_MODE_TUNNEL is not set
+# CONFIG_INET_XFRM_MODE_BEET is not set
+CONFIG_INET_DIAG=y
+CONFIG_INET_TCP_DIAG=y
+# CONFIG_TCP_CONG_ADVANCED is not set
+CONFIG_TCP_CONG_CUBIC=y
+CONFIG_DEFAULT_TCP_CONG="cubic"
+# CONFIG_TCP_MD5SIG is not set
+# CONFIG_IPV6 is not set
+# CONFIG_INET6_XFRM_TUNNEL is not set
+# CONFIG_INET6_TUNNEL is not set
+# CONFIG_NETWORK_SECMARK is not set
+# CONFIG_NETFILTER is not set
+# CONFIG_IP_DCCP is not set
+# CONFIG_IP_SCTP is not set
+# CONFIG_TIPC is not set
+# CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
+# CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
+# CONFIG_LLC2 is not set
+# CONFIG_IPX is not set
+# CONFIG_ATALK is not set
+# CONFIG_X25 is not set
+# CONFIG_LAPB is not set
+# CONFIG_ECONET is not set
+# CONFIG_WAN_ROUTER is not set
+
+#
+# QoS and/or fair queueing
+#
+# CONFIG_NET_SCHED is not set
+
+#
+# Network testing
+#
+# CONFIG_NET_PKTGEN is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
+# CONFIG_AF_RXRPC is not set
+
+#
+# Wireless
+#
+# CONFIG_CFG80211 is not set
+# CONFIG_WIRELESS_EXT is not set
+# CONFIG_MAC80211 is not set
+# CONFIG_IEEE80211 is not set
+# CONFIG_RFKILL is not set
+# CONFIG_NET_9P is not set
+
+#
+# Device Drivers
+#
+
+#
+# Generic Driver Options
+#
+CONFIG_STANDALONE=y
+CONFIG_PREVENT_FIRMWARE_BUILD=y
+CONFIG_FW_LOADER=y
+# CONFIG_DEBUG_DRIVER is not set
+# CONFIG_DEBUG_DEVRES is not set
+# CONFIG_SYS_HYPERVISOR is not set
+# CONFIG_CONNECTOR is not set
+CONFIG_MTD=y
+# CONFIG_MTD_DEBUG is not set
+# CONFIG_MTD_CONCAT is not set
+CONFIG_MTD_PARTITIONS=y
+# CONFIG_MTD_REDBOOT_PARTS is not set
+# CONFIG_MTD_CMDLINE_PARTS is not set
+# CONFIG_MTD_AFS_PARTS is not set
+
+#
+# User Modules And Translation Layers
+#
+CONFIG_MTD_CHAR=y
+CONFIG_MTD_BLKDEVS=y
+CONFIG_MTD_BLOCK=y
+# CONFIG_FTL is not set
+# CONFIG_NFTL is not set
+# CONFIG_INFTL is not set
+# CONFIG_RFD_FTL is not set
+# CONFIG_SSFDC is not set
+
+#
+# RAM/ROM/Flash chip drivers
+#
+# CONFIG_MTD_CFI is not set
+# CONFIG_MTD_JEDECPROBE is not set
+CONFIG_MTD_MAP_BANK_WIDTH_1=y
+CONFIG_MTD_MAP_BANK_WIDTH_2=y
+CONFIG_MTD_MAP_BANK_WIDTH_4=y
+# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
+CONFIG_MTD_CFI_I1=y
+CONFIG_MTD_CFI_I2=y
+# CONFIG_MTD_CFI_I4 is not set
+# CONFIG_MTD_CFI_I8 is not set
+# CONFIG_MTD_RAM is not set
+# CONFIG_MTD_ROM is not set
+# CONFIG_MTD_ABSENT is not set
+
+#
+# Mapping drivers for chip access
+#
+# CONFIG_MTD_COMPLEX_MAPPINGS is not set
+# CONFIG_MTD_PLATRAM is not set
+
+#
+# Self-contained MTD device drivers
+#
+# CONFIG_MTD_SLRAM is not set
+# CONFIG_MTD_PHRAM is not set
+# CONFIG_MTD_MTDRAM is not set
+CONFIG_MTD_BLOCK2MTD=y
+
+#
+# Disk-On-Chip Device Drivers
+#
+# CONFIG_MTD_DOC2000 is not set
+# CONFIG_MTD_DOC2001 is not set
+# CONFIG_MTD_DOC2001PLUS is not set
+CONFIG_MTD_NAND=y
+# CONFIG_MTD_NAND_VERIFY_WRITE is not set
+# CONFIG_MTD_NAND_ECC_SMC is not set
+# CONFIG_MTD_NAND_MUSEUM_IDS is not set
+CONFIG_MTD_NAND_IDS=y
+# CONFIG_MTD_NAND_DISKONCHIP is not set
+CONFIG_MTD_NAND_AT91=y
+# CONFIG_MTD_NAND_NANDSIM is not set
+CONFIG_MTD_NAND_PLATFORM=y
+# CONFIG_MTD_ONENAND is not set
+
+#
+# UBI - Unsorted block images
+#
+CONFIG_MTD_UBI=y
+CONFIG_MTD_UBI_WL_THRESHOLD=4096
+CONFIG_MTD_UBI_BEB_RESERVE=3
+CONFIG_MTD_UBI_GLUEBI=y
+
+#
+# UBI debugging options
+#
+# CONFIG_MTD_UBI_DEBUG is not set
+# CONFIG_PARPORT is not set
+CONFIG_BLK_DEV=y
+# CONFIG_BLK_DEV_COW_COMMON is not set
+CONFIG_BLK_DEV_LOOP=y
+# CONFIG_BLK_DEV_CRYPTOLOOP is not set
+# CONFIG_BLK_DEV_NBD is not set
+# CONFIG_BLK_DEV_UB is not set
+CONFIG_BLK_DEV_RAM=y
+CONFIG_BLK_DEV_RAM_COUNT=16
+CONFIG_BLK_DEV_RAM_SIZE=8192
+CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
+# CONFIG_CDROM_PKTCDVD is not set
+# CONFIG_ATA_OVER_ETH is not set
+
+#
+# SCSI device support
+#
+CONFIG_RAID_ATTRS=y
+CONFIG_SCSI=y
+CONFIG_SCSI_DMA=y
+# CONFIG_SCSI_TGT is not set
+# CONFIG_SCSI_NETLINK is not set
+CONFIG_SCSI_PROC_FS=y
+
+#
+# SCSI support type (disk, tape, CD-ROM)
+#
+CONFIG_BLK_DEV_SD=y
+# CONFIG_CHR_DEV_ST is not set
+# CONFIG_CHR_DEV_OSST is not set
+# CONFIG_BLK_DEV_SR is not set
+CONFIG_CHR_DEV_SG=y
+# CONFIG_CHR_DEV_SCH is not set
+
+#
+# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
+#
+CONFIG_SCSI_MULTI_LUN=y
+CONFIG_SCSI_CONSTANTS=y
+CONFIG_SCSI_LOGGING=y
+# CONFIG_SCSI_SCAN_ASYNC is not set
+
+#
+# SCSI Transports
+#
+# CONFIG_SCSI_SPI_ATTRS is not set
+# CONFIG_SCSI_FC_ATTRS is not set
+# CONFIG_SCSI_ISCSI_ATTRS is not set
+# CONFIG_SCSI_SAS_LIBSAS is not set
+# CONFIG_SCSI_LOWLEVEL is not set
+# CONFIG_ATA is not set
+# CONFIG_MD is not set
+CONFIG_NETDEVICES=y
+# CONFIG_NETDEVICES_MULTIQUEUE is not set
+# CONFIG_DUMMY is not set
+# CONFIG_BONDING is not set
+# CONFIG_MACVLAN is not set
+# CONFIG_EQUALIZER is not set
+# CONFIG_TUN is not set
+CONFIG_PHYLIB=y
+
+#
+# MII PHY device drivers
+#
+# CONFIG_MARVELL_PHY is not set
+# CONFIG_DAVICOM_PHY is not set
+# CONFIG_QSEMI_PHY is not set
+# CONFIG_LXT_PHY is not set
+# CONFIG_CICADA_PHY is not set
+# CONFIG_VITESSE_PHY is not set
+# CONFIG_SMSC_PHY is not set
+# CONFIG_BROADCOM_PHY is not set
+# CONFIG_ICPLUS_PHY is not set
+# CONFIG_FIXED_PHY is not set
+CONFIG_NET_ETHERNET=y
+CONFIG_MII=y
+CONFIG_MACB=y
+# CONFIG_AX88796 is not set
+# CONFIG_SMC91X is not set
+# CONFIG_DM9000 is not set
+# CONFIG_NETDEV_1000 is not set
+# CONFIG_NETDEV_10000 is not set
+
+#
+# Wireless LAN
+#
+# CONFIG_WLAN_PRE80211 is not set
+# CONFIG_WLAN_80211 is not set
+
+#
+# USB Network Adapters
+#
+# CONFIG_USB_CATC is not set
+# CONFIG_USB_KAWETH is not set
+# CONFIG_USB_PEGASUS is not set
+# CONFIG_USB_RTL8150 is not set
+# CONFIG_USB_USBNET_MII is not set
+# CONFIG_USB_USBNET is not set
+# CONFIG_WAN is not set
+# CONFIG_PPP is not set
+# CONFIG_SLIP is not set
+# CONFIG_SHAPER is not set
+# CONFIG_NETCONSOLE is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_ISDN is not set
+
+#
+# Input device support
+#
+CONFIG_INPUT=y
+# CONFIG_INPUT_FF_MEMLESS is not set
+# CONFIG_INPUT_POLLDEV is not set
+
+#
+# Userland interfaces
+#
+CONFIG_INPUT_MOUSEDEV=y
+# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
+CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
+CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
+# CONFIG_INPUT_JOYDEV is not set
+# CONFIG_INPUT_TSDEV is not set
+# CONFIG_INPUT_EVDEV is not set
+# CONFIG_INPUT_EVBUG is not set
+
+#
+# Input Device Drivers
+#
+# CONFIG_INPUT_KEYBOARD is not set
+# CONFIG_INPUT_MOUSE is not set
+# CONFIG_INPUT_JOYSTICK is not set
+# CONFIG_INPUT_TABLET is not set
+# CONFIG_INPUT_TOUCHSCREEN is not set
+# CONFIG_INPUT_MISC is not set
+
+#
+# Hardware I/O ports
+#
+# CONFIG_SERIO is not set
+# CONFIG_GAMEPORT is not set
+
+#
+# Character devices
+#
+CONFIG_VT=y
+CONFIG_VT_CONSOLE=y
+CONFIG_HW_CONSOLE=y
+# CONFIG_VT_HW_CONSOLE_BINDING is not set
+# CONFIG_SERIAL_NONSTANDARD is not set
+
+#
+# Serial drivers
+#
+# CONFIG_SERIAL_8250 is not set
+
+#
+# Non-8250 serial port support
+#
+CONFIG_SERIAL_ATMEL=y
+CONFIG_SERIAL_ATMEL_CONSOLE=y
+# CONFIG_SERIAL_ATMEL_TTYAT is not set
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+CONFIG_UNIX98_PTYS=y
+CONFIG_LEGACY_PTYS=y
+CONFIG_LEGACY_PTY_COUNT=16
+# CONFIG_IPMI_HANDLER is not set
+# CONFIG_WATCHDOG is not set
+# CONFIG_HW_RANDOM is not set
+# CONFIG_NVRAM is not set
+# CONFIG_R3964 is not set
+# CONFIG_RAW_DRIVER is not set
+# CONFIG_TCG_TPM is not set
+# CONFIG_I2C is not set
+
+#
+# SPI support
+#
+# CONFIG_SPI is not set
+# CONFIG_SPI_MASTER is not set
+# CONFIG_W1 is not set
+# CONFIG_HWMON is not set
+# CONFIG_MISC_DEVICES is not set
+
+#
+# Multifunction device drivers
+#
+# CONFIG_MFD_SM501 is not set
+CONFIG_NEW_LEDS=y
+CONFIG_LEDS_CLASS=y
+
+#
+# LED drivers
+#
+CONFIG_LEDS_GPIO=y
+
+#
+# LED Triggers
+#
+CONFIG_LEDS_TRIGGERS=y
+CONFIG_LEDS_TRIGGER_TIMER=y
+CONFIG_LEDS_TRIGGER_HEARTBEAT=y
+
+#
+# Multimedia devices
+#
+# CONFIG_VIDEO_DEV is not set
+# CONFIG_DVB_CORE is not set
+# CONFIG_DAB is not set
+
+#
+# Graphics support
+#
+# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
+
+#
+# Display device support
+#
+# CONFIG_DISPLAY_SUPPORT is not set
+# CONFIG_VGASTATE is not set
+# CONFIG_VIDEO_OUTPUT_CONTROL is not set
+# CONFIG_FB is not set
+
+#
+# Console display driver support
+#
+# CONFIG_VGA_CONSOLE is not set
+CONFIG_DUMMY_CONSOLE=y
+
+#
+# Sound
+#
+# CONFIG_SOUND is not set
+# CONFIG_HID_SUPPORT is not set
+CONFIG_USB_SUPPORT=y
+CONFIG_USB_ARCH_HAS_HCD=y
+CONFIG_USB_ARCH_HAS_OHCI=y
+# CONFIG_USB_ARCH_HAS_EHCI is not set
+CONFIG_USB=y
+# CONFIG_USB_DEBUG is not set
+
+#
+# Miscellaneous USB options
+#
+CONFIG_USB_DEVICEFS=y
+CONFIG_USB_DEVICE_CLASS=y
+# CONFIG_USB_DYNAMIC_MINORS is not set
+# CONFIG_USB_OTG is not set
+
+#
+# USB Host Controller Drivers
+#
+# CONFIG_USB_ISP116X_HCD is not set
+CONFIG_USB_OHCI_HCD=y
+# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set
+# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set
+CONFIG_USB_OHCI_LITTLE_ENDIAN=y
+# CONFIG_USB_SL811_HCD is not set
+# CONFIG_USB_R8A66597_HCD is not set
+
+#
+# USB Device Class drivers
+#
+# CONFIG_USB_ACM is not set
+# CONFIG_USB_PRINTER is not set
+
+#
+# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
+#
+
+#
+# may also be needed; see USB_STORAGE Help for more information
+#
+CONFIG_USB_STORAGE=y
+# CONFIG_USB_STORAGE_DEBUG is not set
+# CONFIG_USB_STORAGE_DATAFAB is not set
+# CONFIG_USB_STORAGE_FREECOM is not set
+# CONFIG_USB_STORAGE_DPCM is not set
+# CONFIG_USB_STORAGE_USBAT is not set
+# CONFIG_USB_STORAGE_SDDR09 is not set
+# CONFIG_USB_STORAGE_SDDR55 is not set
+# CONFIG_USB_STORAGE_JUMPSHOT is not set
+# CONFIG_USB_STORAGE_ALAUDA is not set
+# CONFIG_USB_STORAGE_KARMA is not set
+CONFIG_USB_LIBUSUAL=y
+
+#
+# USB Imaging devices
+#
+# CONFIG_USB_MDC800 is not set
+# CONFIG_USB_MICROTEK is not set
+# CONFIG_USB_MON is not set
+
+#
+# USB port drivers
+#
+
+#
+# USB Serial Converter support
+#
+# CONFIG_USB_SERIAL is not set
+
+#
+# USB Miscellaneous drivers
+#
+# CONFIG_USB_EMI62 is not set
+# CONFIG_USB_EMI26 is not set
+# CONFIG_USB_ADUTUX is not set
+# CONFIG_USB_AUERSWALD is not set
+# CONFIG_USB_RIO500 is not set
+# CONFIG_USB_LEGOTOWER is not set
+# CONFIG_USB_LCD is not set
+# CONFIG_USB_BERRY_CHARGE is not set
+# CONFIG_USB_LED is not set
+# CONFIG_USB_CYPRESS_CY7C63 is not set
+# CONFIG_USB_CYTHERM is not set
+# CONFIG_USB_PHIDGET is not set
+# CONFIG_USB_IDMOUSE is not set
+# CONFIG_USB_FTDI_ELAN is not set
+# CONFIG_USB_APPLEDISPLAY is not set
+# CONFIG_USB_LD is not set
+# CONFIG_USB_TRANCEVIBRATOR is not set
+# CONFIG_USB_IOWARRIOR is not set
+# CONFIG_USB_TEST is not set
+
+#
+# USB DSL modem support
+#
+
+#
+# USB Gadget Support
+#
+CONFIG_USB_GADGET=y
+# CONFIG_USB_GADGET_DEBUG is not set
+# CONFIG_USB_GADGET_DEBUG_FILES is not set
+CONFIG_USB_GADGET_SELECTED=y
+# CONFIG_USB_GADGET_AMD5536UDC is not set
+# CONFIG_USB_GADGET_FSL_USB2 is not set
+# CONFIG_USB_GADGET_NET2280 is not set
+# CONFIG_USB_GADGET_PXA2XX is not set
+# CONFIG_USB_GADGET_M66592 is not set
+# CONFIG_USB_GADGET_GOKU is not set
+# CONFIG_USB_GADGET_LH7A40X is not set
+# CONFIG_USB_GADGET_OMAP is not set
+# CONFIG_USB_GADGET_S3C2410 is not set
+CONFIG_USB_GADGET_AT91=y
+CONFIG_USB_AT91=y
+# CONFIG_USB_GADGET_DUMMY_HCD is not set
+# CONFIG_USB_GADGET_DUALSPEED is not set
+# CONFIG_USB_ZERO is not set
+CONFIG_USB_ETH=y
+CONFIG_USB_ETH_RNDIS=y
+# CONFIG_USB_GADGETFS is not set
+# CONFIG_USB_FILE_STORAGE is not set
+# CONFIG_USB_G_SERIAL is not set
+# CONFIG_USB_MIDI_GADGET is not set
+CONFIG_MMC=y
+CONFIG_MMC_DEBUG=y
+# CONFIG_MMC_UNSAFE_RESUME is not set
+
+#
+# MMC/SD Card Drivers
+#
+CONFIG_MMC_BLOCK=y
+CONFIG_MMC_BLOCK_BOUNCE=y
+
+#
+# MMC/SD Host Controller Drivers
+#
+CONFIG_MMC_AT91=y
+CONFIG_RTC_LIB=y
+CONFIG_RTC_CLASS=y
+CONFIG_RTC_HCTOSYS=y
+CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
+# CONFIG_RTC_DEBUG is not set
+
+#
+# RTC interfaces
+#
+CONFIG_RTC_INTF_SYSFS=y
+CONFIG_RTC_INTF_PROC=y
+CONFIG_RTC_INTF_DEV=y
+# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
+# CONFIG_RTC_DRV_TEST is not set
+
+#
+# SPI RTC drivers
+#
+
+#
+# Platform RTC drivers
+#
+# CONFIG_RTC_DRV_CMOS is not set
+CONFIG_RTC_DRV_DS1553=y
+# CONFIG_RTC_DRV_STK17TA8 is not set
+CONFIG_RTC_DRV_DS1742=y
+CONFIG_RTC_DRV_M48T86=y
+# CONFIG_RTC_DRV_M48T59 is not set
+CONFIG_RTC_DRV_V3020=y
+
+#
+# on-CPU RTC drivers
+#
+
+#
+# DMA Engine support
+#
+# CONFIG_DMA_ENGINE is not set
+
+#
+# DMA Clients
+#
+
+#
+# DMA Devices
+#
+
+#
+# File systems
+#
+CONFIG_EXT2_FS=y
+CONFIG_EXT2_FS_XATTR=y
+CONFIG_EXT2_FS_POSIX_ACL=y
+CONFIG_EXT2_FS_SECURITY=y
+# CONFIG_EXT2_FS_XIP is not set
+CONFIG_EXT3_FS=y
+CONFIG_EXT3_FS_XATTR=y
+CONFIG_EXT3_FS_POSIX_ACL=y
+CONFIG_EXT3_FS_SECURITY=y
+# CONFIG_EXT4DEV_FS is not set
+CONFIG_JBD=y
+# CONFIG_JBD_DEBUG is not set
+CONFIG_FS_MBCACHE=y
+# CONFIG_REISERFS_FS is not set
+# CONFIG_JFS_FS is not set
+CONFIG_FS_POSIX_ACL=y
+# CONFIG_XFS_FS is not set
+# CONFIG_GFS2_FS is not set
+# CONFIG_OCFS2_FS is not set
+# CONFIG_MINIX_FS is not set
+# CONFIG_ROMFS_FS is not set
+CONFIG_INOTIFY=y
+CONFIG_INOTIFY_USER=y
+# CONFIG_QUOTA is not set
+CONFIG_DNOTIFY=y
+# CONFIG_AUTOFS_FS is not set
+# CONFIG_AUTOFS4_FS is not set
+# CONFIG_FUSE_FS is not set
+
+#
+# CD-ROM/DVD Filesystems
+#
+# CONFIG_ISO9660_FS is not set
+# CONFIG_UDF_FS is not set
+
+#
+# DOS/FAT/NT Filesystems
+#
+CONFIG_FAT_FS=y
+CONFIG_MSDOS_FS=y
+CONFIG_VFAT_FS=y
+CONFIG_FAT_DEFAULT_CODEPAGE=437
+CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
+# CONFIG_NTFS_FS is not set
+
+#
+# Pseudo filesystems
+#
+CONFIG_PROC_FS=y
+CONFIG_PROC_SYSCTL=y
+CONFIG_SYSFS=y
+CONFIG_TMPFS=y
+# CONFIG_TMPFS_POSIX_ACL is not set
+# CONFIG_HUGETLB_PAGE is not set
+CONFIG_RAMFS=y
+# CONFIG_CONFIGFS_FS is not set
+
+#
+# Miscellaneous filesystems
+#
+# CONFIG_ADFS_FS is not set
+# CONFIG_AFFS_FS is not set
+# CONFIG_HFS_FS is not set
+# CONFIG_HFSPLUS_FS is not set
+# CONFIG_BEFS_FS is not set
+# CONFIG_BFS_FS is not set
+# CONFIG_EFS_FS is not set
+CONFIG_JFFS2_FS=y
+CONFIG_JFFS2_FS_DEBUG=0
+CONFIG_JFFS2_FS_WRITEBUFFER=y
+# CONFIG_JFFS2_SUMMARY is not set
+# CONFIG_JFFS2_FS_XATTR is not set
+# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
+CONFIG_JFFS2_ZLIB=y
+CONFIG_JFFS2_RTIME=y
+# CONFIG_JFFS2_RUBIN is not set
+# CONFIG_CRAMFS is not set
+# CONFIG_VXFS_FS is not set
+# CONFIG_HPFS_FS is not set
+# CONFIG_QNX4FS_FS is not set
+# CONFIG_SYSV_FS is not set
+# CONFIG_UFS_FS is not set
+
+#
+# Network File Systems
+#
+CONFIG_NFS_FS=y
+CONFIG_NFS_V3=y
+# CONFIG_NFS_V3_ACL is not set
+# CONFIG_NFS_V4 is not set
+CONFIG_NFS_DIRECTIO=y
+# CONFIG_NFSD is not set
+CONFIG_LOCKD=y
+CONFIG_LOCKD_V4=y
+CONFIG_NFS_COMMON=y
+CONFIG_SUNRPC=y
+# CONFIG_SUNRPC_BIND34 is not set
+# CONFIG_RPCSEC_GSS_KRB5 is not set
+# CONFIG_RPCSEC_GSS_SPKM3 is not set
+# CONFIG_SMB_FS is not set
+# CONFIG_CIFS is not set
+# CONFIG_NCP_FS is not set
+# CONFIG_CODA_FS is not set
+# CONFIG_AFS_FS is not set
+
+#
+# Partition Types
+#
+# CONFIG_PARTITION_ADVANCED is not set
+CONFIG_MSDOS_PARTITION=y
+
+#
+# Native Language Support
+#
+CONFIG_NLS=y
+CONFIG_NLS_DEFAULT="iso8859-1"
+CONFIG_NLS_CODEPAGE_437=y
+CONFIG_NLS_CODEPAGE_737=y
+CONFIG_NLS_CODEPAGE_775=y
+CONFIG_NLS_CODEPAGE_850=y
+CONFIG_NLS_CODEPAGE_852=y
+CONFIG_NLS_CODEPAGE_855=y
+CONFIG_NLS_CODEPAGE_857=y
+CONFIG_NLS_CODEPAGE_860=y
+CONFIG_NLS_CODEPAGE_861=y
+CONFIG_NLS_CODEPAGE_862=y
+CONFIG_NLS_CODEPAGE_863=y
+CONFIG_NLS_CODEPAGE_864=y
+CONFIG_NLS_CODEPAGE_865=y
+CONFIG_NLS_CODEPAGE_866=y
+CONFIG_NLS_CODEPAGE_869=y
+CONFIG_NLS_CODEPAGE_936=y
+CONFIG_NLS_CODEPAGE_950=y
+CONFIG_NLS_CODEPAGE_932=y
+CONFIG_NLS_CODEPAGE_949=y
+CONFIG_NLS_CODEPAGE_874=y
+CONFIG_NLS_ISO8859_8=y
+CONFIG_NLS_CODEPAGE_1250=y
+CONFIG_NLS_CODEPAGE_1251=y
+CONFIG_NLS_ASCII=y
+CONFIG_NLS_ISO8859_1=y
+CONFIG_NLS_ISO8859_2=y
+CONFIG_NLS_ISO8859_3=y
+CONFIG_NLS_ISO8859_4=y
+CONFIG_NLS_ISO8859_5=y
+CONFIG_NLS_ISO8859_6=y
+CONFIG_NLS_ISO8859_7=y
+CONFIG_NLS_ISO8859_9=y
+CONFIG_NLS_ISO8859_13=y
+CONFIG_NLS_ISO8859_14=y
+CONFIG_NLS_ISO8859_15=y
+CONFIG_NLS_KOI8_R=y
+CONFIG_NLS_KOI8_U=y
+CONFIG_NLS_UTF8=y
+
+#
+# Distributed Lock Manager
+#
+# CONFIG_DLM is not set
+
+#
+# Profiling support
+#
+# CONFIG_PROFILING is not set
+
+#
+# Kernel hacking
+#
+# CONFIG_PRINTK_TIME is not set
+CONFIG_ENABLE_MUST_CHECK=y
+CONFIG_MAGIC_SYSRQ=y
+CONFIG_UNUSED_SYMBOLS=y
+CONFIG_DEBUG_FS=y
+# CONFIG_HEADERS_CHECK is not set
+CONFIG_DEBUG_KERNEL=y
+# CONFIG_DEBUG_SHIRQ is not set
+CONFIG_DETECT_SOFTLOCKUP=y
+CONFIG_SCHED_DEBUG=y
+# CONFIG_SCHEDSTATS is not set
+# CONFIG_TIMER_STATS is not set
+# CONFIG_DEBUG_SLAB is not set
+CONFIG_DEBUG_PREEMPT=y
+# CONFIG_DEBUG_RT_MUTEXES is not set
+# CONFIG_RT_MUTEX_TESTER is not set
+# CONFIG_DEBUG_SPINLOCK is not set
+# CONFIG_DEBUG_MUTEXES is not set
+# CONFIG_DEBUG_LOCK_ALLOC is not set
+# CONFIG_PROVE_LOCKING is not set
+# CONFIG_LOCK_STAT is not set
+# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
+# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
+# CONFIG_DEBUG_KOBJECT is not set
+CONFIG_DEBUG_BUGVERBOSE=y
+# CONFIG_DEBUG_INFO is not set
+# CONFIG_DEBUG_VM is not set
+# CONFIG_DEBUG_LIST is not set
+CONFIG_FRAME_POINTER=y
+CONFIG_FORCED_INLINING=y
+# CONFIG_FAULT_INJECTION is not set
+# CONFIG_DEBUG_USER is not set
+# CONFIG_DEBUG_ERRORS is not set
+CONFIG_DEBUG_LL=y
+# CONFIG_DEBUG_ICEDCC is not set
+
+#
+# Security options
+#
+# CONFIG_KEYS is not set
+# CONFIG_SECURITY is not set
+# CONFIG_CRYPTO is not set
+
+#
+# Library routines
+#
+CONFIG_BITREVERSE=y
+# CONFIG_CRC_CCITT is not set
+# CONFIG_CRC16 is not set
+# CONFIG_CRC_ITU_T is not set
+CONFIG_CRC32=y
+# CONFIG_CRC7 is not set
+# CONFIG_LIBCRC32C is not set
+CONFIG_AUDIT_GENERIC=y
+CONFIG_ZLIB_INFLATE=y
+CONFIG_ZLIB_DEFLATE=y
+CONFIG_PLIST=y
+CONFIG_HAS_IOMEM=y
+CONFIG_HAS_IOPORT=y
+CONFIG_HAS_DMA=y
diff --git a/arch/arm/configs/tct_hammer_defconfig b/arch/arm/configs/tct_hammer_defconfig
new file mode 100644 (file)
index 0000000..576b833
--- /dev/null
@@ -0,0 +1,886 @@
+#
+# Automatically generated make config: don't edit
+# Linux kernel version: 2.6.25-rc7-hammer
+# Thu Mar 27 16:39:48 2008
+#
+CONFIG_ARM=y
+CONFIG_SYS_SUPPORTS_APM_EMULATION=y
+CONFIG_GENERIC_GPIO=y
+# CONFIG_GENERIC_TIME is not set
+# CONFIG_GENERIC_CLOCKEVENTS is not set
+CONFIG_MMU=y
+CONFIG_NO_IOPORT=y
+CONFIG_GENERIC_HARDIRQS=y
+CONFIG_STACKTRACE_SUPPORT=y
+CONFIG_LOCKDEP_SUPPORT=y
+CONFIG_TRACE_IRQFLAGS_SUPPORT=y
+CONFIG_HARDIRQS_SW_RESEND=y
+CONFIG_GENERIC_IRQ_PROBE=y
+CONFIG_RWSEM_GENERIC_SPINLOCK=y
+# CONFIG_ARCH_HAS_ILOG2_U32 is not set
+# CONFIG_ARCH_HAS_ILOG2_U64 is not set
+CONFIG_GENERIC_HWEIGHT=y
+CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_ARCH_SUPPORTS_AOUT=y
+CONFIG_ZONE_DMA=y
+CONFIG_VECTORS_BASE=0xffff0000
+CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
+
+#
+# General setup
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_BROKEN_ON_SMP=y
+CONFIG_INIT_ENV_ARG_LIMIT=32
+CONFIG_LOCALVERSION=""
+# CONFIG_LOCALVERSION_AUTO is not set
+# CONFIG_SWAP is not set
+CONFIG_SYSVIPC=y
+CONFIG_SYSVIPC_SYSCTL=y
+# CONFIG_POSIX_MQUEUE is not set
+# CONFIG_BSD_PROCESS_ACCT is not set
+# CONFIG_TASKSTATS is not set
+# CONFIG_AUDIT is not set
+# CONFIG_IKCONFIG is not set
+CONFIG_LOG_BUF_SHIFT=14
+# CONFIG_CGROUPS is not set
+CONFIG_GROUP_SCHED=y
+CONFIG_FAIR_GROUP_SCHED=y
+# CONFIG_RT_GROUP_SCHED is not set
+CONFIG_USER_SCHED=y
+# CONFIG_CGROUP_SCHED is not set
+CONFIG_SYSFS_DEPRECATED=y
+CONFIG_SYSFS_DEPRECATED_V2=y
+# CONFIG_RELAY is not set
+# CONFIG_NAMESPACES is not set
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_INITRAMFS_SOURCE=""
+CONFIG_CC_OPTIMIZE_FOR_SIZE=y
+CONFIG_SYSCTL=y
+CONFIG_EMBEDDED=y
+CONFIG_UID16=y
+CONFIG_SYSCTL_SYSCALL=y
+# CONFIG_KALLSYMS is not set
+CONFIG_HOTPLUG=y
+CONFIG_PRINTK=y
+# CONFIG_BUG is not set
+# CONFIG_ELF_CORE is not set
+CONFIG_COMPAT_BRK=y
+CONFIG_BASE_FULL=y
+CONFIG_FUTEX=y
+CONFIG_ANON_INODES=y
+CONFIG_EPOLL=y
+CONFIG_SIGNALFD=y
+CONFIG_TIMERFD=y
+CONFIG_EVENTFD=y
+# CONFIG_SHMEM is not set
+CONFIG_VM_EVENT_COUNTERS=y
+# CONFIG_SLAB is not set
+# CONFIG_SLUB is not set
+CONFIG_SLOB=y
+# CONFIG_PROFILING is not set
+# CONFIG_MARKERS is not set
+CONFIG_HAVE_OPROFILE=y
+CONFIG_HAVE_KPROBES=y
+CONFIG_HAVE_KRETPROBES=y
+CONFIG_PROC_PAGE_MONITOR=y
+CONFIG_RT_MUTEXES=y
+CONFIG_TINY_SHMEM=y
+CONFIG_BASE_SMALL=0
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+# CONFIG_MODULE_FORCE_UNLOAD is not set
+# CONFIG_MODVERSIONS is not set
+# CONFIG_MODULE_SRCVERSION_ALL is not set
+# CONFIG_KMOD is not set
+CONFIG_BLOCK=y
+# CONFIG_LBD is not set
+# CONFIG_BLK_DEV_IO_TRACE is not set
+# CONFIG_LSF is not set
+# CONFIG_BLK_DEV_BSG is not set
+
+#
+# IO Schedulers
+#
+CONFIG_IOSCHED_NOOP=y
+CONFIG_IOSCHED_AS=y
+CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
+CONFIG_DEFAULT_AS=y
+# CONFIG_DEFAULT_DEADLINE is not set
+# CONFIG_DEFAULT_CFQ is not set
+# CONFIG_DEFAULT_NOOP is not set
+CONFIG_DEFAULT_IOSCHED="anticipatory"
+CONFIG_CLASSIC_RCU=y
+
+#
+# System Type
+#
+# CONFIG_ARCH_AAEC2000 is not set
+# CONFIG_ARCH_INTEGRATOR is not set
+# CONFIG_ARCH_REALVIEW is not set
+# CONFIG_ARCH_VERSATILE is not set
+# CONFIG_ARCH_AT91 is not set
+# CONFIG_ARCH_CLPS7500 is not set
+# CONFIG_ARCH_CLPS711X is not set
+# CONFIG_ARCH_CO285 is not set
+# CONFIG_ARCH_EBSA110 is not set
+# CONFIG_ARCH_EP93XX is not set
+# CONFIG_ARCH_FOOTBRIDGE is not set
+# CONFIG_ARCH_NETX is not set
+# CONFIG_ARCH_H720X is not set
+# CONFIG_ARCH_IMX is not set
+# CONFIG_ARCH_IOP13XX is not set
+# CONFIG_ARCH_IOP32X is not set
+# CONFIG_ARCH_IOP33X is not set
+# CONFIG_ARCH_IXP23XX is not set
+# CONFIG_ARCH_IXP2000 is not set
+# CONFIG_ARCH_IXP4XX is not set
+# CONFIG_ARCH_L7200 is not set
+# CONFIG_ARCH_KS8695 is not set
+# CONFIG_ARCH_NS9XXX is not set
+# CONFIG_ARCH_MXC is not set
+# CONFIG_ARCH_ORION is not set
+# CONFIG_ARCH_PNX4008 is not set
+# CONFIG_ARCH_PXA is not set
+# CONFIG_ARCH_RPC is not set
+# CONFIG_ARCH_SA1100 is not set
+CONFIG_ARCH_S3C2410=y
+# CONFIG_ARCH_SHARK is not set
+# CONFIG_ARCH_LH7A40X is not set
+# CONFIG_ARCH_DAVINCI is not set
+# CONFIG_ARCH_OMAP is not set
+# CONFIG_ARCH_MSM7X00A is not set
+CONFIG_PLAT_S3C24XX=y
+# CONFIG_S3C2410_DMA is not set
+CONFIG_PLAT_S3C=y
+CONFIG_CPU_LLSERIAL_S3C2410_ONLY=y
+CONFIG_CPU_LLSERIAL_S3C2410=y
+
+#
+# Boot options
+#
+# CONFIG_S3C_BOOT_ERROR_RESET is not set
+
+#
+# Power management
+#
+CONFIG_S3C_LOWLEVEL_UART_PORT=0
+
+#
+# S3C2400 Machines
+#
+CONFIG_CPU_S3C2410=y
+CONFIG_S3C2410_GPIO=y
+CONFIG_S3C2410_CLOCK=y
+
+#
+# S3C2410 Machines
+#
+# CONFIG_ARCH_SMDK2410 is not set
+# CONFIG_ARCH_H1940 is not set
+# CONFIG_MACH_N30 is not set
+# CONFIG_ARCH_BAST is not set
+# CONFIG_MACH_OTOM is not set
+# CONFIG_MACH_AML_M5900 is not set
+CONFIG_MACH_TCT_HAMMER=y
+# CONFIG_MACH_VR1000 is not set
+# CONFIG_MACH_QT2410 is not set
+
+#
+# S3C2412 Machines
+#
+# CONFIG_MACH_SMDK2413 is not set
+# CONFIG_MACH_SMDK2412 is not set
+# CONFIG_MACH_VSTMS is not set
+
+#
+# S3C2440 Machines
+#
+# CONFIG_MACH_ANUBIS is not set
+# CONFIG_MACH_OSIRIS is not set
+# CONFIG_MACH_RX3715 is not set
+# CONFIG_ARCH_S3C2440 is not set
+# CONFIG_MACH_NEXCODER_2440 is not set
+
+#
+# S3C2442 Machines
+#
+
+#
+# S3C2443 Machines
+#
+# CONFIG_MACH_SMDK2443 is not set
+
+#
+# Processor Type
+#
+CONFIG_CPU_32=y
+CONFIG_CPU_ARM920T=y
+CONFIG_CPU_32v4T=y
+CONFIG_CPU_ABRT_EV4T=y
+CONFIG_CPU_CACHE_V4WT=y
+CONFIG_CPU_CACHE_VIVT=y
+CONFIG_CPU_COPY_V4WB=y
+CONFIG_CPU_TLB_V4WBI=y
+CONFIG_CPU_CP15=y
+CONFIG_CPU_CP15_MMU=y
+
+#
+# Processor Features
+#
+CONFIG_ARM_THUMB=y
+# CONFIG_CPU_ICACHE_DISABLE is not set
+# CONFIG_CPU_DCACHE_DISABLE is not set
+# CONFIG_CPU_DCACHE_WRITETHROUGH is not set
+# CONFIG_OUTER_CACHE is not set
+
+#
+# Bus support
+#
+# CONFIG_PCI_SYSCALL is not set
+# CONFIG_ARCH_SUPPORTS_MSI is not set
+# CONFIG_PCCARD is not set
+
+#
+# Kernel Features
+#
+# CONFIG_TICK_ONESHOT is not set
+# CONFIG_PREEMPT is not set
+# CONFIG_NO_IDLE_HZ is not set
+CONFIG_HZ=200
+# CONFIG_AEABI is not set
+# CONFIG_ARCH_DISCONTIGMEM_ENABLE is not set
+CONFIG_SELECT_MEMORY_MODEL=y
+CONFIG_FLATMEM_MANUAL=y
+# CONFIG_DISCONTIGMEM_MANUAL is not set
+# CONFIG_SPARSEMEM_MANUAL is not set
+CONFIG_FLATMEM=y
+CONFIG_FLAT_NODE_MEM_MAP=y
+# CONFIG_SPARSEMEM_STATIC is not set
+# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
+CONFIG_SPLIT_PTLOCK_CPUS=4096
+# CONFIG_RESOURCES_64BIT is not set
+CONFIG_ZONE_DMA_FLAG=1
+CONFIG_BOUNCE=y
+CONFIG_VIRT_TO_BUS=y
+CONFIG_ALIGNMENT_TRAP=y
+
+#
+# Boot options
+#
+CONFIG_ZBOOT_ROM_TEXT=0x0
+CONFIG_ZBOOT_ROM_BSS=0x0
+CONFIG_CMDLINE="mem=64M root=/dev/ram0 init=/linuxrc rw"
+# CONFIG_XIP_KERNEL is not set
+# CONFIG_KEXEC is not set
+
+#
+# Floating point emulation
+#
+
+#
+# At least one emulation must be selected
+#
+CONFIG_FPE_NWFPE=y
+# CONFIG_FPE_NWFPE_XP is not set
+# CONFIG_FPE_FASTFPE is not set
+
+#
+# Userspace binary formats
+#
+CONFIG_BINFMT_ELF=y
+# CONFIG_BINFMT_AOUT is not set
+# CONFIG_BINFMT_MISC is not set
+# CONFIG_ARTHUR is not set
+
+#
+# Power management options
+#
+# CONFIG_PM is not set
+CONFIG_ARCH_SUSPEND_POSSIBLE=y
+
+#
+# Networking
+#
+CONFIG_NET=y
+
+#
+# Networking options
+#
+CONFIG_PACKET=y
+# CONFIG_PACKET_MMAP is not set
+CONFIG_UNIX=y
+# CONFIG_NET_KEY is not set
+# CONFIG_INET is not set
+# CONFIG_NETWORK_SECMARK is not set
+# CONFIG_NETFILTER is not set
+# CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
+# CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
+# CONFIG_LLC2 is not set
+# CONFIG_IPX is not set
+# CONFIG_ATALK is not set
+# CONFIG_X25 is not set
+# CONFIG_LAPB is not set
+# CONFIG_WAN_ROUTER is not set
+# CONFIG_NET_SCHED is not set
+
+#
+# Network testing
+#
+# CONFIG_NET_PKTGEN is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_CAN is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
+
+#
+# Wireless
+#
+# CONFIG_CFG80211 is not set
+# CONFIG_WIRELESS_EXT is not set
+# CONFIG_MAC80211 is not set
+# CONFIG_IEEE80211 is not set
+# CONFIG_RFKILL is not set
+# CONFIG_NET_9P is not set
+
+#
+# Device Drivers
+#
+
+#
+# Generic Driver Options
+#
+CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
+CONFIG_STANDALONE=y
+# CONFIG_PREVENT_FIRMWARE_BUILD is not set
+CONFIG_FW_LOADER=y
+# CONFIG_DEBUG_DRIVER is not set
+# CONFIG_DEBUG_DEVRES is not set
+# CONFIG_SYS_HYPERVISOR is not set
+# CONFIG_CONNECTOR is not set
+CONFIG_MTD=y
+# CONFIG_MTD_DEBUG is not set
+# CONFIG_MTD_CONCAT is not set
+CONFIG_MTD_PARTITIONS=y
+# CONFIG_MTD_REDBOOT_PARTS is not set
+# CONFIG_MTD_CMDLINE_PARTS is not set
+# CONFIG_MTD_AFS_PARTS is not set
+
+#
+# User Modules And Translation Layers
+#
+CONFIG_MTD_CHAR=y
+CONFIG_MTD_BLKDEVS=y
+CONFIG_MTD_BLOCK=y
+# CONFIG_FTL is not set
+# CONFIG_NFTL is not set
+# CONFIG_INFTL is not set
+# CONFIG_RFD_FTL is not set
+# CONFIG_SSFDC is not set
+# CONFIG_MTD_OOPS is not set
+
+#
+# RAM/ROM/Flash chip drivers
+#
+CONFIG_MTD_CFI=y
+# CONFIG_MTD_JEDECPROBE is not set
+CONFIG_MTD_GEN_PROBE=y
+CONFIG_MTD_CFI_ADV_OPTIONS=y
+CONFIG_MTD_CFI_NOSWAP=y
+# CONFIG_MTD_CFI_BE_BYTE_SWAP is not set
+# CONFIG_MTD_CFI_LE_BYTE_SWAP is not set
+CONFIG_MTD_CFI_GEOMETRY=y
+CONFIG_MTD_MAP_BANK_WIDTH_1=y
+CONFIG_MTD_MAP_BANK_WIDTH_2=y
+CONFIG_MTD_MAP_BANK_WIDTH_4=y
+# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
+CONFIG_MTD_CFI_I1=y
+CONFIG_MTD_CFI_I2=y
+# CONFIG_MTD_CFI_I4 is not set
+# CONFIG_MTD_CFI_I8 is not set
+# CONFIG_MTD_OTP is not set
+CONFIG_MTD_CFI_INTELEXT=y
+# CONFIG_MTD_CFI_AMDSTD is not set
+# CONFIG_MTD_CFI_STAA is not set
+CONFIG_MTD_CFI_UTIL=y
+# CONFIG_MTD_RAM is not set
+# CONFIG_MTD_ROM is not set
+# CONFIG_MTD_ABSENT is not set
+
+#
+# Mapping drivers for chip access
+#
+# CONFIG_MTD_COMPLEX_MAPPINGS is not set
+CONFIG_MTD_PHYSMAP=y
+CONFIG_MTD_PHYSMAP_START=0x00000000
+CONFIG_MTD_PHYSMAP_LEN=0x0
+CONFIG_MTD_PHYSMAP_BANKWIDTH=2
+# CONFIG_MTD_ARM_INTEGRATOR is not set
+# CONFIG_MTD_PLATRAM is not set
+
+#
+# Self-contained MTD device drivers
+#
+# CONFIG_MTD_SLRAM is not set
+# CONFIG_MTD_PHRAM is not set
+# CONFIG_MTD_MTDRAM is not set
+# CONFIG_MTD_BLOCK2MTD is not set
+
+#
+# Disk-On-Chip Device Drivers
+#
+# CONFIG_MTD_DOC2000 is not set
+# CONFIG_MTD_DOC2001 is not set
+# CONFIG_MTD_DOC2001PLUS is not set
+# CONFIG_MTD_NAND is not set
+# CONFIG_MTD_ONENAND is not set
+
+#
+# UBI - Unsorted block images
+#
+# CONFIG_MTD_UBI is not set
+# CONFIG_PARPORT is not set
+CONFIG_BLK_DEV=y
+# CONFIG_BLK_DEV_COW_COMMON is not set
+# CONFIG_BLK_DEV_LOOP is not set
+# CONFIG_BLK_DEV_NBD is not set
+# CONFIG_BLK_DEV_UB is not set
+CONFIG_BLK_DEV_RAM=y
+CONFIG_BLK_DEV_RAM_COUNT=16
+CONFIG_BLK_DEV_RAM_SIZE=10240
+# CONFIG_BLK_DEV_XIP is not set
+# CONFIG_CDROM_PKTCDVD is not set
+# CONFIG_ATA_OVER_ETH is not set
+# CONFIG_MISC_DEVICES is not set
+CONFIG_HAVE_IDE=y
+# CONFIG_IDE is not set
+
+#
+# SCSI device support
+#
+# CONFIG_RAID_ATTRS is not set
+# CONFIG_SCSI is not set
+# CONFIG_SCSI_DMA is not set
+# CONFIG_SCSI_NETLINK is not set
+# CONFIG_ATA is not set
+# CONFIG_MD is not set
+# CONFIG_NETDEVICES is not set
+# CONFIG_ISDN is not set
+
+#
+# Input device support
+#
+CONFIG_INPUT=y
+# CONFIG_INPUT_FF_MEMLESS is not set
+# CONFIG_INPUT_POLLDEV is not set
+
+#
+# Userland interfaces
+#
+# CONFIG_INPUT_MOUSEDEV is not set
+# CONFIG_INPUT_JOYDEV is not set
+# CONFIG_INPUT_EVDEV is not set
+# CONFIG_INPUT_EVBUG is not set
+
+#
+# Input Device Drivers
+#
+# CONFIG_INPUT_KEYBOARD is not set
+# CONFIG_INPUT_MOUSE is not set
+# CONFIG_INPUT_JOYSTICK is not set
+# CONFIG_INPUT_TABLET is not set
+# CONFIG_INPUT_TOUCHSCREEN is not set
+# CONFIG_INPUT_MISC is not set
+
+#
+# Hardware I/O ports
+#
+# CONFIG_SERIO is not set
+# CONFIG_GAMEPORT is not set
+
+#
+# Character devices
+#
+CONFIG_VT=y
+# CONFIG_VT_CONSOLE is not set
+CONFIG_HW_CONSOLE=y
+# CONFIG_VT_HW_CONSOLE_BINDING is not set
+# CONFIG_SERIAL_NONSTANDARD is not set
+
+#
+# Serial drivers
+#
+# CONFIG_SERIAL_8250 is not set
+
+#
+# Non-8250 serial port support
+#
+CONFIG_SERIAL_S3C2410=y
+CONFIG_SERIAL_S3C2410_CONSOLE=y
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+CONFIG_UNIX98_PTYS=y
+CONFIG_LEGACY_PTYS=y
+CONFIG_LEGACY_PTY_COUNT=256
+# CONFIG_IPMI_HANDLER is not set
+# CONFIG_HW_RANDOM is not set
+# CONFIG_NVRAM is not set
+# CONFIG_R3964 is not set
+# CONFIG_RAW_DRIVER is not set
+# CONFIG_TCG_TPM is not set
+# CONFIG_I2C is not set
+
+#
+# SPI support
+#
+# CONFIG_SPI is not set
+# CONFIG_SPI_MASTER is not set
+# CONFIG_W1 is not set
+# CONFIG_POWER_SUPPLY is not set
+# CONFIG_HWMON is not set
+# CONFIG_WATCHDOG is not set
+
+#
+# Sonics Silicon Backplane
+#
+CONFIG_SSB_POSSIBLE=y
+# CONFIG_SSB is not set
+
+#
+# Multifunction device drivers
+#
+# CONFIG_MFD_SM501 is not set
+# CONFIG_MFD_ASIC3 is not set
+
+#
+# Multimedia devices
+#
+# CONFIG_VIDEO_DEV is not set
+# CONFIG_DAB is not set
+
+#
+# Graphics support
+#
+# CONFIG_VGASTATE is not set
+# CONFIG_VIDEO_OUTPUT_CONTROL is not set
+# CONFIG_FB is not set
+# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
+
+#
+# Display device support
+#
+# CONFIG_DISPLAY_SUPPORT is not set
+
+#
+# Console display driver support
+#
+# CONFIG_VGA_CONSOLE is not set
+CONFIG_DUMMY_CONSOLE=y
+
+#
+# Sound
+#
+# CONFIG_SOUND is not set
+# CONFIG_HID_SUPPORT is not set
+CONFIG_USB_SUPPORT=y
+CONFIG_USB_ARCH_HAS_HCD=y
+CONFIG_USB_ARCH_HAS_OHCI=y
+# CONFIG_USB_ARCH_HAS_EHCI is not set
+CONFIG_USB=y
+CONFIG_USB_DEBUG=y
+# CONFIG_USB_ANNOUNCE_NEW_DEVICES is not set
+
+#
+# Miscellaneous USB options
+#
+# CONFIG_USB_DEVICEFS is not set
+# CONFIG_USB_DEVICE_CLASS is not set
+# CONFIG_USB_DYNAMIC_MINORS is not set
+# CONFIG_USB_OTG is not set
+
+#
+# USB Host Controller Drivers
+#
+# CONFIG_USB_ISP116X_HCD is not set
+CONFIG_USB_OHCI_HCD=y
+# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set
+# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set
+CONFIG_USB_OHCI_LITTLE_ENDIAN=y
+# CONFIG_USB_SL811_HCD is not set
+# CONFIG_USB_R8A66597_HCD is not set
+
+#
+# USB Device Class drivers
+#
+# CONFIG_USB_ACM is not set
+# CONFIG_USB_PRINTER is not set
+
+#
+# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
+#
+
+#
+# may also be needed; see USB_STORAGE Help for more information
+#
+# CONFIG_USB_LIBUSUAL is not set
+
+#
+# USB Imaging devices
+#
+# CONFIG_USB_MDC800 is not set
+CONFIG_USB_MON=y
+
+#
+# USB port drivers
+#
+# CONFIG_USB_SERIAL is not set
+
+#
+# USB Miscellaneous drivers
+#
+# CONFIG_USB_EMI62 is not set
+# CONFIG_USB_EMI26 is not set
+# CONFIG_USB_ADUTUX is not set
+# CONFIG_USB_AUERSWALD is not set
+# CONFIG_USB_RIO500 is not set
+# CONFIG_USB_LEGOTOWER is not set
+# CONFIG_USB_LCD is not set
+# CONFIG_USB_BERRY_CHARGE is not set
+# CONFIG_USB_LED is not set
+# CONFIG_USB_CYPRESS_CY7C63 is not set
+# CONFIG_USB_CYTHERM is not set
+# CONFIG_USB_PHIDGET is not set
+# CONFIG_USB_IDMOUSE is not set
+# CONFIG_USB_FTDI_ELAN is not set
+# CONFIG_USB_APPLEDISPLAY is not set
+# CONFIG_USB_LD is not set
+# CONFIG_USB_TRANCEVIBRATOR is not set
+# CONFIG_USB_IOWARRIOR is not set
+CONFIG_USB_GADGET=y
+# CONFIG_USB_GADGET_DEBUG is not set
+# CONFIG_USB_GADGET_DEBUG_FILES is not set
+CONFIG_USB_GADGET_SELECTED=y
+# CONFIG_USB_GADGET_AMD5536UDC is not set
+# CONFIG_USB_GADGET_ATMEL_USBA is not set
+# CONFIG_USB_GADGET_FSL_USB2 is not set
+# CONFIG_USB_GADGET_NET2280 is not set
+# CONFIG_USB_GADGET_PXA2XX is not set
+# CONFIG_USB_GADGET_M66592 is not set
+# CONFIG_USB_GADGET_GOKU is not set
+# CONFIG_USB_GADGET_LH7A40X is not set
+# CONFIG_USB_GADGET_OMAP is not set
+CONFIG_USB_GADGET_S3C2410=y
+CONFIG_USB_S3C2410=y
+# CONFIG_USB_S3C2410_DEBUG is not set
+# CONFIG_USB_GADGET_AT91 is not set
+# CONFIG_USB_GADGET_DUMMY_HCD is not set
+# CONFIG_USB_GADGET_DUALSPEED is not set
+# CONFIG_USB_ZERO is not set
+CONFIG_USB_ETH=y
+CONFIG_USB_ETH_RNDIS=y
+# CONFIG_USB_GADGETFS is not set
+# CONFIG_USB_FILE_STORAGE is not set
+# CONFIG_USB_G_SERIAL is not set
+# CONFIG_USB_MIDI_GADGET is not set
+# CONFIG_USB_G_PRINTER is not set
+# CONFIG_MMC is not set
+# CONFIG_NEW_LEDS is not set
+CONFIG_RTC_LIB=y
+# CONFIG_RTC_CLASS is not set
+
+#
+# File systems
+#
+CONFIG_EXT2_FS=y
+# CONFIG_EXT2_FS_XATTR is not set
+# CONFIG_EXT2_FS_XIP is not set
+# CONFIG_EXT3_FS is not set
+# CONFIG_EXT4DEV_FS is not set
+# CONFIG_REISERFS_FS is not set
+# CONFIG_JFS_FS is not set
+# CONFIG_FS_POSIX_ACL is not set
+# CONFIG_XFS_FS is not set
+# CONFIG_GFS2_FS is not set
+# CONFIG_OCFS2_FS is not set
+# CONFIG_DNOTIFY is not set
+# CONFIG_INOTIFY is not set
+# CONFIG_QUOTA is not set
+# CONFIG_AUTOFS_FS is not set
+# CONFIG_AUTOFS4_FS is not set
+# CONFIG_FUSE_FS is not set
+
+#
+# CD-ROM/DVD Filesystems
+#
+# CONFIG_ISO9660_FS is not set
+# CONFIG_UDF_FS is not set
+
+#
+# DOS/FAT/NT Filesystems
+#
+CONFIG_FAT_FS=y
+CONFIG_MSDOS_FS=y
+CONFIG_VFAT_FS=y
+CONFIG_FAT_DEFAULT_CODEPAGE=437
+CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
+# CONFIG_NTFS_FS is not set
+
+#
+# Pseudo filesystems
+#
+CONFIG_PROC_FS=y
+# CONFIG_PROC_SYSCTL is not set
+CONFIG_SYSFS=y
+# CONFIG_TMPFS is not set
+# CONFIG_HUGETLB_PAGE is not set
+# CONFIG_CONFIGFS_FS is not set
+
+#
+# Miscellaneous filesystems
+#
+# CONFIG_ADFS_FS is not set
+# CONFIG_AFFS_FS is not set
+# CONFIG_HFS_FS is not set
+# CONFIG_HFSPLUS_FS is not set
+# CONFIG_BEFS_FS is not set
+# CONFIG_BFS_FS is not set
+# CONFIG_EFS_FS is not set
+CONFIG_JFFS2_FS=y
+CONFIG_JFFS2_FS_DEBUG=0
+CONFIG_JFFS2_FS_WRITEBUFFER=y
+# CONFIG_JFFS2_FS_WBUF_VERIFY is not set
+# CONFIG_JFFS2_SUMMARY is not set
+# CONFIG_JFFS2_FS_XATTR is not set
+# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
+CONFIG_JFFS2_ZLIB=y
+# CONFIG_JFFS2_LZO is not set
+CONFIG_JFFS2_RTIME=y
+# CONFIG_JFFS2_RUBIN is not set
+# CONFIG_CRAMFS is not set
+# CONFIG_VXFS_FS is not set
+# CONFIG_MINIX_FS is not set
+# CONFIG_HPFS_FS is not set
+# CONFIG_QNX4FS_FS is not set
+# CONFIG_ROMFS_FS is not set
+# CONFIG_SYSV_FS is not set
+# CONFIG_UFS_FS is not set
+CONFIG_NETWORK_FILESYSTEMS=y
+
+#
+# Partition Types
+#
+# CONFIG_PARTITION_ADVANCED is not set
+CONFIG_MSDOS_PARTITION=y
+CONFIG_NLS=y
+CONFIG_NLS_DEFAULT="iso8859-1"
+CONFIG_NLS_CODEPAGE_437=y
+# CONFIG_NLS_CODEPAGE_737 is not set
+# CONFIG_NLS_CODEPAGE_775 is not set
+# CONFIG_NLS_CODEPAGE_850 is not set
+# CONFIG_NLS_CODEPAGE_852 is not set
+# CONFIG_NLS_CODEPAGE_855 is not set
+# CONFIG_NLS_CODEPAGE_857 is not set
+# CONFIG_NLS_CODEPAGE_860 is not set
+# CONFIG_NLS_CODEPAGE_861 is not set
+# CONFIG_NLS_CODEPAGE_862 is not set
+# CONFIG_NLS_CODEPAGE_863 is not set
+# CONFIG_NLS_CODEPAGE_864 is not set
+# CONFIG_NLS_CODEPAGE_865 is not set
+# CONFIG_NLS_CODEPAGE_866 is not set
+# CONFIG_NLS_CODEPAGE_869 is not set
+# CONFIG_NLS_CODEPAGE_936 is not set
+# CONFIG_NLS_CODEPAGE_950 is not set
+# CONFIG_NLS_CODEPAGE_932 is not set
+# CONFIG_NLS_CODEPAGE_949 is not set
+# CONFIG_NLS_CODEPAGE_874 is not set
+# CONFIG_NLS_ISO8859_8 is not set
+# CONFIG_NLS_CODEPAGE_1250 is not set
+# CONFIG_NLS_CODEPAGE_1251 is not set
+# CONFIG_NLS_ASCII is not set
+CONFIG_NLS_ISO8859_1=y
+# CONFIG_NLS_ISO8859_2 is not set
+# CONFIG_NLS_ISO8859_3 is not set
+# CONFIG_NLS_ISO8859_4 is not set
+# CONFIG_NLS_ISO8859_5 is not set
+# CONFIG_NLS_ISO8859_6 is not set
+# CONFIG_NLS_ISO8859_7 is not set
+# CONFIG_NLS_ISO8859_9 is not set
+# CONFIG_NLS_ISO8859_13 is not set
+# CONFIG_NLS_ISO8859_14 is not set
+# CONFIG_NLS_ISO8859_15 is not set
+# CONFIG_NLS_KOI8_R is not set
+# CONFIG_NLS_KOI8_U is not set
+# CONFIG_NLS_UTF8 is not set
+
+#
+# Kernel hacking
+#
+# CONFIG_PRINTK_TIME is not set
+CONFIG_ENABLE_WARN_DEPRECATED=y
+# CONFIG_ENABLE_MUST_CHECK is not set
+# CONFIG_MAGIC_SYSRQ is not set
+# CONFIG_UNUSED_SYMBOLS is not set
+# CONFIG_DEBUG_FS is not set
+# CONFIG_HEADERS_CHECK is not set
+CONFIG_DEBUG_KERNEL=y
+# CONFIG_DEBUG_SHIRQ is not set
+# CONFIG_DETECT_SOFTLOCKUP is not set
+CONFIG_SCHED_DEBUG=y
+# CONFIG_SCHEDSTATS is not set
+# CONFIG_TIMER_STATS is not set
+# CONFIG_DEBUG_RT_MUTEXES is not set
+# CONFIG_RT_MUTEX_TESTER is not set
+# CONFIG_DEBUG_SPINLOCK is not set
+# CONFIG_DEBUG_MUTEXES is not set
+# CONFIG_DEBUG_LOCK_ALLOC is not set
+# CONFIG_PROVE_LOCKING is not set
+# CONFIG_LOCK_STAT is not set
+# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
+# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
+# CONFIG_DEBUG_KOBJECT is not set
+# CONFIG_DEBUG_INFO is not set
+# CONFIG_DEBUG_VM is not set
+# CONFIG_DEBUG_LIST is not set
+# CONFIG_DEBUG_SG is not set
+CONFIG_FRAME_POINTER=y
+# CONFIG_BOOT_PRINTK_DELAY is not set
+# CONFIG_RCU_TORTURE_TEST is not set
+# CONFIG_BACKTRACE_SELF_TEST is not set
+# CONFIG_FAULT_INJECTION is not set
+# CONFIG_SAMPLES is not set
+# CONFIG_DEBUG_USER is not set
+CONFIG_DEBUG_ERRORS=y
+# CONFIG_DEBUG_STACK_USAGE is not set
+CONFIG_DEBUG_LL=y
+# CONFIG_DEBUG_ICEDCC is not set
+# CONFIG_DEBUG_S3C_PORT is not set
+CONFIG_DEBUG_S3C_UART=0
+
+#
+# Security options
+#
+# CONFIG_KEYS is not set
+# CONFIG_SECURITY is not set
+# CONFIG_SECURITY_FILE_CAPABILITIES is not set
+# CONFIG_CRYPTO is not set
+
+#
+# Library routines
+#
+CONFIG_BITREVERSE=y
+CONFIG_CRC_CCITT=y
+# CONFIG_CRC16 is not set
+# CONFIG_CRC_ITU_T is not set
+CONFIG_CRC32=y
+# CONFIG_CRC7 is not set
+# CONFIG_LIBCRC32C is not set
+CONFIG_ZLIB_INFLATE=y
+CONFIG_ZLIB_DEFLATE=y
+CONFIG_PLIST=y
+CONFIG_HAS_IOMEM=y
+CONFIG_HAS_DMA=y
diff --git a/arch/arm/configs/yl9200_defconfig b/arch/arm/configs/yl9200_defconfig
new file mode 100644 (file)
index 0000000..26de37f
--- /dev/null
@@ -0,0 +1,1216 @@
+#
+# Automatically generated make config: don't edit
+# Linux kernel version: 2.6.24-rc6
+# Fri Jan 11 09:53:59 2008
+#
+CONFIG_ARM=y
+CONFIG_SYS_SUPPORTS_APM_EMULATION=y
+CONFIG_GENERIC_GPIO=y
+CONFIG_GENERIC_TIME=y
+CONFIG_GENERIC_CLOCKEVENTS=y
+CONFIG_MMU=y
+# CONFIG_NO_IOPORT is not set
+CONFIG_GENERIC_HARDIRQS=y
+CONFIG_STACKTRACE_SUPPORT=y
+CONFIG_LOCKDEP_SUPPORT=y
+CONFIG_TRACE_IRQFLAGS_SUPPORT=y
+CONFIG_HARDIRQS_SW_RESEND=y
+CONFIG_GENERIC_IRQ_PROBE=y
+CONFIG_RWSEM_GENERIC_SPINLOCK=y
+# CONFIG_ARCH_HAS_ILOG2_U32 is not set
+# CONFIG_ARCH_HAS_ILOG2_U64 is not set
+CONFIG_GENERIC_HWEIGHT=y
+CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_ZONE_DMA=y
+CONFIG_VECTORS_BASE=0xffff0000
+CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
+
+#
+# General setup
+#
+# CONFIG_EXPERIMENTAL is not set
+CONFIG_BROKEN_ON_SMP=y
+CONFIG_INIT_ENV_ARG_LIMIT=32
+CONFIG_LOCALVERSION=""
+CONFIG_LOCALVERSION_AUTO=y
+# CONFIG_SWAP is not set
+CONFIG_SYSVIPC=y
+CONFIG_SYSVIPC_SYSCTL=y
+# CONFIG_BSD_PROCESS_ACCT is not set
+# CONFIG_TASKSTATS is not set
+# CONFIG_AUDIT is not set
+# CONFIG_IKCONFIG is not set
+CONFIG_LOG_BUF_SHIFT=14
+# CONFIG_CGROUPS is not set
+CONFIG_FAIR_GROUP_SCHED=y
+CONFIG_FAIR_USER_SCHED=y
+# CONFIG_FAIR_CGROUP_SCHED is not set
+# CONFIG_SYSFS_DEPRECATED is not set
+# CONFIG_RELAY is not set
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_INITRAMFS_SOURCE=""
+# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
+CONFIG_SYSCTL=y
+# CONFIG_EMBEDDED is not set
+CONFIG_UID16=y
+CONFIG_SYSCTL_SYSCALL=y
+CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_ALL is not set
+# CONFIG_KALLSYMS_EXTRA_PASS is not set
+CONFIG_HOTPLUG=y
+CONFIG_PRINTK=y
+CONFIG_BUG=y
+CONFIG_ELF_CORE=y
+CONFIG_BASE_FULL=y
+CONFIG_FUTEX=y
+CONFIG_ANON_INODES=y
+CONFIG_EPOLL=y
+CONFIG_SIGNALFD=y
+CONFIG_EVENTFD=y
+CONFIG_SHMEM=y
+CONFIG_VM_EVENT_COUNTERS=y
+CONFIG_SLUB_DEBUG=y
+# CONFIG_SLAB is not set
+CONFIG_SLUB=y
+# CONFIG_SLOB is not set
+CONFIG_RT_MUTEXES=y
+# CONFIG_TINY_SHMEM is not set
+CONFIG_BASE_SMALL=0
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+# CONFIG_MODVERSIONS is not set
+# CONFIG_MODULE_SRCVERSION_ALL is not set
+CONFIG_KMOD=y
+CONFIG_BLOCK=y
+# CONFIG_LBD is not set
+# CONFIG_BLK_DEV_IO_TRACE is not set
+# CONFIG_LSF is not set
+
+#
+# IO Schedulers
+#
+CONFIG_IOSCHED_NOOP=y
+# CONFIG_IOSCHED_AS is not set
+# CONFIG_IOSCHED_DEADLINE is not set
+# CONFIG_IOSCHED_CFQ is not set
+# CONFIG_DEFAULT_AS is not set
+# CONFIG_DEFAULT_DEADLINE is not set
+# CONFIG_DEFAULT_CFQ is not set
+CONFIG_DEFAULT_NOOP=y
+CONFIG_DEFAULT_IOSCHED="noop"
+
+#
+# System Type
+#
+# CONFIG_ARCH_AAEC2000 is not set
+# CONFIG_ARCH_INTEGRATOR is not set
+# CONFIG_ARCH_REALVIEW is not set
+# CONFIG_ARCH_VERSATILE is not set
+CONFIG_ARCH_AT91=y
+# CONFIG_ARCH_CLPS7500 is not set
+# CONFIG_ARCH_CLPS711X is not set
+# CONFIG_ARCH_CO285 is not set
+# CONFIG_ARCH_EBSA110 is not set
+# CONFIG_ARCH_EP93XX is not set
+# CONFIG_ARCH_FOOTBRIDGE is not set
+# CONFIG_ARCH_NETX is not set
+# CONFIG_ARCH_H720X is not set
+# CONFIG_ARCH_IMX is not set
+# CONFIG_ARCH_IOP13XX is not set
+# CONFIG_ARCH_IOP32X is not set
+# CONFIG_ARCH_IOP33X is not set
+# CONFIG_ARCH_IXP23XX is not set
+# CONFIG_ARCH_IXP2000 is not set
+# CONFIG_ARCH_IXP4XX is not set
+# CONFIG_ARCH_L7200 is not set
+# CONFIG_ARCH_KS8695 is not set
+# CONFIG_ARCH_NS9XXX is not set
+# CONFIG_ARCH_MXC is not set
+# CONFIG_ARCH_PNX4008 is not set
+# CONFIG_ARCH_PXA is not set
+# CONFIG_ARCH_RPC is not set
+# CONFIG_ARCH_SA1100 is not set
+# CONFIG_ARCH_S3C2410 is not set
+# CONFIG_ARCH_SHARK is not set
+# CONFIG_ARCH_LH7A40X is not set
+# CONFIG_ARCH_DAVINCI is not set
+# CONFIG_ARCH_OMAP is not set
+
+#
+# Boot options
+#
+
+#
+# Power management
+#
+
+#
+# Atmel AT91 System-on-Chip
+#
+CONFIG_ARCH_AT91RM9200=y
+# CONFIG_ARCH_AT91SAM9260 is not set
+# CONFIG_ARCH_AT91SAM9261 is not set
+# CONFIG_ARCH_AT91SAM9263 is not set
+# CONFIG_ARCH_AT91SAM9RL is not set
+# CONFIG_ARCH_AT91X40 is not set
+CONFIG_AT91_PMC_UNIT=y
+
+#
+# AT91RM9200 Board Type
+#
+# CONFIG_MACH_ONEARM is not set
+CONFIG_ARCH_AT91RM9200DK=y
+# CONFIG_MACH_AT91RM9200EK is not set
+# CONFIG_MACH_CSB337 is not set
+# CONFIG_MACH_CSB637 is not set
+# CONFIG_MACH_CARMEVA is not set
+# CONFIG_MACH_ATEB9200 is not set
+# CONFIG_MACH_KB9200 is not set
+# CONFIG_MACH_PICOTUX2XX is not set
+# CONFIG_MACH_KAFA is not set
+CONFIG_MACH_YL9200=y
+
+#
+# AT91 Board Options
+#
+# CONFIG_MTD_AT91_DATAFLASH_CARD is not set
+
+#
+# AT91 Feature Selections
+#
+# CONFIG_AT91_PROGRAMMABLE_CLOCKS is not set
+
+#
+# Processor Type
+#
+CONFIG_CPU_32=y
+CONFIG_CPU_ARM920T=y
+CONFIG_CPU_32v4T=y
+CONFIG_CPU_ABRT_EV4T=y
+CONFIG_CPU_CACHE_V4WT=y
+CONFIG_CPU_CACHE_VIVT=y
+CONFIG_CPU_COPY_V4WB=y
+CONFIG_CPU_TLB_V4WBI=y
+CONFIG_CPU_CP15=y
+CONFIG_CPU_CP15_MMU=y
+
+#
+# Processor Features
+#
+# CONFIG_ARM_THUMB is not set
+# CONFIG_CPU_ICACHE_DISABLE is not set
+# CONFIG_CPU_DCACHE_DISABLE is not set
+# CONFIG_CPU_DCACHE_WRITETHROUGH is not set
+# CONFIG_OUTER_CACHE is not set
+
+#
+# Bus support
+#
+# CONFIG_PCI_SYSCALL is not set
+# CONFIG_ARCH_SUPPORTS_MSI is not set
+# CONFIG_PCCARD is not set
+
+#
+# Kernel Features
+#
+# CONFIG_TICK_ONESHOT is not set
+# CONFIG_NO_HZ is not set
+# CONFIG_HIGH_RES_TIMERS is not set
+CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
+CONFIG_HZ=100
+# CONFIG_AEABI is not set
+# CONFIG_ARCH_DISCONTIGMEM_ENABLE is not set
+CONFIG_FLATMEM=y
+CONFIG_FLAT_NODE_MEM_MAP=y
+# CONFIG_SPARSEMEM_STATIC is not set
+# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
+CONFIG_SPLIT_PTLOCK_CPUS=4096
+# CONFIG_RESOURCES_64BIT is not set
+CONFIG_ZONE_DMA_FLAG=1
+CONFIG_BOUNCE=y
+CONFIG_VIRT_TO_BUS=y
+# CONFIG_LEDS is not set
+CONFIG_ALIGNMENT_TRAP=y
+
+#
+# Boot options
+#
+CONFIG_ZBOOT_ROM_TEXT=0x0
+CONFIG_ZBOOT_ROM_BSS=0x0
+CONFIG_CMDLINE="mem=32M console=ttyS0,115200 initrd=0x20410000,3145728 root=/dev/ram0 rw"
+# CONFIG_XIP_KERNEL is not set
+
+#
+# Floating point emulation
+#
+
+#
+# At least one emulation must be selected
+#
+CONFIG_FPE_NWFPE=y
+# CONFIG_FPE_NWFPE_XP is not set
+
+#
+# Userspace binary formats
+#
+CONFIG_BINFMT_ELF=y
+# CONFIG_BINFMT_AOUT is not set
+# CONFIG_BINFMT_MISC is not set
+# CONFIG_ARTHUR is not set
+
+#
+# Power management options
+#
+# CONFIG_PM is not set
+CONFIG_SUSPEND_UP_POSSIBLE=y
+
+#
+# Networking
+#
+CONFIG_NET=y
+
+#
+# Networking options
+#
+CONFIG_PACKET=y
+# CONFIG_PACKET_MMAP is not set
+CONFIG_UNIX=y
+# CONFIG_NET_KEY is not set
+CONFIG_INET=y
+# CONFIG_IP_MULTICAST is not set
+# CONFIG_IP_ADVANCED_ROUTER is not set
+CONFIG_IP_FIB_HASH=y
+CONFIG_IP_PNP=y
+CONFIG_IP_PNP_DHCP=y
+# CONFIG_IP_PNP_BOOTP is not set
+# CONFIG_IP_PNP_RARP is not set
+# CONFIG_NET_IPIP is not set
+# CONFIG_NET_IPGRE is not set
+# CONFIG_SYN_COOKIES is not set
+# CONFIG_INET_AH is not set
+# CONFIG_INET_ESP is not set
+# CONFIG_INET_IPCOMP is not set
+# CONFIG_INET_XFRM_TUNNEL is not set
+# CONFIG_INET_TUNNEL is not set
+# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
+# CONFIG_INET_XFRM_MODE_TUNNEL is not set
+# CONFIG_INET_XFRM_MODE_BEET is not set
+# CONFIG_INET_LRO is not set
+# CONFIG_INET_DIAG is not set
+# CONFIG_TCP_CONG_ADVANCED is not set
+CONFIG_TCP_CONG_CUBIC=y
+CONFIG_DEFAULT_TCP_CONG="cubic"
+# CONFIG_IPV6 is not set
+# CONFIG_INET6_XFRM_TUNNEL is not set
+# CONFIG_INET6_TUNNEL is not set
+# CONFIG_NETWORK_SECMARK is not set
+# CONFIG_NETFILTER is not set
+# CONFIG_BRIDGE is not set
+# CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
+# CONFIG_LLC2 is not set
+# CONFIG_IPX is not set
+# CONFIG_ATALK is not set
+# CONFIG_NET_SCHED is not set
+
+#
+# Network testing
+#
+# CONFIG_NET_PKTGEN is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
+
+#
+# Wireless
+#
+# CONFIG_CFG80211 is not set
+# CONFIG_WIRELESS_EXT is not set
+# CONFIG_IEEE80211 is not set
+# CONFIG_RFKILL is not set
+
+#
+# Device Drivers
+#
+
+#
+# Generic Driver Options
+#
+CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
+CONFIG_STANDALONE=y
+CONFIG_PREVENT_FIRMWARE_BUILD=y
+CONFIG_FW_LOADER=y
+# CONFIG_DEBUG_DRIVER is not set
+# CONFIG_DEBUG_DEVRES is not set
+# CONFIG_SYS_HYPERVISOR is not set
+# CONFIG_CONNECTOR is not set
+CONFIG_MTD=y
+# CONFIG_MTD_DEBUG is not set
+CONFIG_MTD_CONCAT=y
+CONFIG_MTD_PARTITIONS=y
+# CONFIG_MTD_REDBOOT_PARTS is not set
+CONFIG_MTD_CMDLINE_PARTS=y
+# CONFIG_MTD_AFS_PARTS is not set
+
+#
+# User Modules And Translation Layers
+#
+CONFIG_MTD_CHAR=y
+CONFIG_MTD_BLKDEVS=y
+CONFIG_MTD_BLOCK=y
+# CONFIG_FTL is not set
+# CONFIG_NFTL is not set
+# CONFIG_INFTL is not set
+# CONFIG_RFD_FTL is not set
+# CONFIG_SSFDC is not set
+# CONFIG_MTD_OOPS is not set
+
+#
+# RAM/ROM/Flash chip drivers
+#
+CONFIG_MTD_CFI=y
+CONFIG_MTD_JEDECPROBE=y
+CONFIG_MTD_GEN_PROBE=y
+# CONFIG_MTD_CFI_ADV_OPTIONS is not set
+CONFIG_MTD_MAP_BANK_WIDTH_1=y
+CONFIG_MTD_MAP_BANK_WIDTH_2=y
+CONFIG_MTD_MAP_BANK_WIDTH_4=y
+# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
+CONFIG_MTD_CFI_I1=y
+CONFIG_MTD_CFI_I2=y
+# CONFIG_MTD_CFI_I4 is not set
+# CONFIG_MTD_CFI_I8 is not set
+CONFIG_MTD_CFI_INTELEXT=y
+# CONFIG_MTD_CFI_AMDSTD is not set
+# CONFIG_MTD_CFI_STAA is not set
+CONFIG_MTD_CFI_UTIL=y
+CONFIG_MTD_RAM=y
+# CONFIG_MTD_ROM is not set
+# CONFIG_MTD_ABSENT is not set
+
+#
+# Mapping drivers for chip access
+#
+CONFIG_MTD_COMPLEX_MAPPINGS=y
+CONFIG_MTD_PHYSMAP=y
+CONFIG_MTD_PHYSMAP_START=0x0000000
+CONFIG_MTD_PHYSMAP_LEN=0
+CONFIG_MTD_PHYSMAP_BANKWIDTH=2
+# CONFIG_MTD_ARM_INTEGRATOR is not set
+# CONFIG_MTD_IMPA7 is not set
+CONFIG_MTD_PLATRAM=y
+
+#
+# Self-contained MTD device drivers
+#
+# CONFIG_MTD_SLRAM is not set
+# CONFIG_MTD_PHRAM is not set
+# CONFIG_MTD_MTDRAM is not set
+# CONFIG_MTD_BLOCK2MTD is not set
+
+#
+# Disk-On-Chip Device Drivers
+#
+# CONFIG_MTD_DOC2000 is not set
+# CONFIG_MTD_DOC2001 is not set
+# CONFIG_MTD_DOC2001PLUS is not set
+CONFIG_MTD_NAND=y
+# CONFIG_MTD_NAND_VERIFY_WRITE is not set
+# CONFIG_MTD_NAND_ECC_SMC is not set
+# CONFIG_MTD_NAND_MUSEUM_IDS is not set
+CONFIG_MTD_NAND_IDS=y
+CONFIG_MTD_NAND_AT91=y
+# CONFIG_MTD_NAND_NANDSIM is not set
+CONFIG_MTD_NAND_PLATFORM=y
+# CONFIG_MTD_ALAUDA is not set
+# CONFIG_MTD_ONENAND is not set
+
+#
+# UBI - Unsorted block images
+#
+# CONFIG_MTD_UBI is not set
+# CONFIG_PARPORT is not set
+CONFIG_BLK_DEV=y
+# CONFIG_BLK_DEV_COW_COMMON is not set
+CONFIG_BLK_DEV_LOOP=y
+# CONFIG_BLK_DEV_CRYPTOLOOP is not set
+# CONFIG_BLK_DEV_NBD is not set
+# CONFIG_BLK_DEV_UB is not set
+CONFIG_BLK_DEV_RAM=y
+CONFIG_BLK_DEV_RAM_COUNT=3
+CONFIG_BLK_DEV_RAM_SIZE=8192
+CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
+# CONFIG_CDROM_PKTCDVD is not set
+# CONFIG_ATA_OVER_ETH is not set
+# CONFIG_MISC_DEVICES is not set
+
+#
+# SCSI device support
+#
+# CONFIG_RAID_ATTRS is not set
+CONFIG_SCSI=y
+CONFIG_SCSI_DMA=y
+# CONFIG_SCSI_NETLINK is not set
+CONFIG_SCSI_PROC_FS=y
+
+#
+# SCSI support type (disk, tape, CD-ROM)
+#
+CONFIG_BLK_DEV_SD=y
+# CONFIG_CHR_DEV_ST is not set
+# CONFIG_CHR_DEV_OSST is not set
+# CONFIG_BLK_DEV_SR is not set
+# CONFIG_CHR_DEV_SG is not set
+# CONFIG_CHR_DEV_SCH is not set
+
+#
+# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
+#
+# CONFIG_SCSI_MULTI_LUN is not set
+# CONFIG_SCSI_CONSTANTS is not set
+# CONFIG_SCSI_LOGGING is not set
+# CONFIG_SCSI_SCAN_ASYNC is not set
+CONFIG_SCSI_WAIT_SCAN=m
+
+#
+# SCSI Transports
+#
+# CONFIG_SCSI_SPI_ATTRS is not set
+# CONFIG_SCSI_FC_ATTRS is not set
+# CONFIG_SCSI_ISCSI_ATTRS is not set
+# CONFIG_SCSI_SAS_LIBSAS is not set
+# CONFIG_SCSI_SRP_ATTRS is not set
+CONFIG_SCSI_LOWLEVEL=y
+# CONFIG_ISCSI_TCP is not set
+# CONFIG_SCSI_DEBUG is not set
+CONFIG_ATA=y
+# CONFIG_ATA_NONSTANDARD is not set
+# CONFIG_MD is not set
+CONFIG_NETDEVICES=y
+# CONFIG_NETDEVICES_MULTIQUEUE is not set
+# CONFIG_DUMMY is not set
+# CONFIG_BONDING is not set
+# CONFIG_EQUALIZER is not set
+# CONFIG_TUN is not set
+# CONFIG_VETH is not set
+CONFIG_PHYLIB=y
+
+#
+# MII PHY device drivers
+#
+# CONFIG_MARVELL_PHY is not set
+CONFIG_DAVICOM_PHY=y
+# CONFIG_QSEMI_PHY is not set
+# CONFIG_LXT_PHY is not set
+# CONFIG_CICADA_PHY is not set
+# CONFIG_VITESSE_PHY is not set
+# CONFIG_SMSC_PHY is not set
+# CONFIG_BROADCOM_PHY is not set
+# CONFIG_ICPLUS_PHY is not set
+# CONFIG_FIXED_PHY is not set
+# CONFIG_MDIO_BITBANG is not set
+CONFIG_NET_ETHERNET=y
+CONFIG_MII=y
+CONFIG_ARM_AT91_ETHER=y
+# CONFIG_AX88796 is not set
+# CONFIG_SMC91X is not set
+# CONFIG_DM9000 is not set
+# CONFIG_IBM_NEW_EMAC_ZMII is not set
+# CONFIG_IBM_NEW_EMAC_RGMII is not set
+# CONFIG_IBM_NEW_EMAC_TAH is not set
+# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
+# CONFIG_B44 is not set
+# CONFIG_NETDEV_1000 is not set
+# CONFIG_NETDEV_10000 is not set
+
+#
+# Wireless LAN
+#
+# CONFIG_WLAN_PRE80211 is not set
+# CONFIG_WLAN_80211 is not set
+
+#
+# USB Network Adapters
+#
+# CONFIG_USB_KAWETH is not set
+# CONFIG_USB_PEGASUS is not set
+# CONFIG_USB_USBNET is not set
+# CONFIG_WAN is not set
+# CONFIG_PPP is not set
+# CONFIG_SLIP is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_ISDN is not set
+
+#
+# Input device support
+#
+CONFIG_INPUT=y
+# CONFIG_INPUT_FF_MEMLESS is not set
+# CONFIG_INPUT_POLLDEV is not set
+
+#
+# Userland interfaces
+#
+CONFIG_INPUT_MOUSEDEV=y
+# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
+CONFIG_INPUT_MOUSEDEV_SCREEN_X=640
+CONFIG_INPUT_MOUSEDEV_SCREEN_Y=480
+# CONFIG_INPUT_JOYDEV is not set
+CONFIG_INPUT_EVDEV=y
+# CONFIG_INPUT_EVBUG is not set
+
+#
+# Input Device Drivers
+#
+CONFIG_INPUT_KEYBOARD=y
+# CONFIG_KEYBOARD_ATKBD is not set
+# CONFIG_KEYBOARD_SUNKBD is not set
+# CONFIG_KEYBOARD_LKKBD is not set
+# CONFIG_KEYBOARD_XTKBD is not set
+# CONFIG_KEYBOARD_NEWTON is not set
+# CONFIG_KEYBOARD_STOWAWAY is not set
+CONFIG_KEYBOARD_GPIO=y
+CONFIG_INPUT_MOUSE=y
+CONFIG_MOUSE_PS2=y
+CONFIG_MOUSE_PS2_ALPS=y
+CONFIG_MOUSE_PS2_LOGIPS2PP=y
+CONFIG_MOUSE_PS2_SYNAPTICS=y
+CONFIG_MOUSE_PS2_LIFEBOOK=y
+CONFIG_MOUSE_PS2_TRACKPOINT=y
+# CONFIG_MOUSE_PS2_TOUCHKIT is not set
+# CONFIG_MOUSE_SERIAL is not set
+# CONFIG_MOUSE_APPLETOUCH is not set
+# CONFIG_MOUSE_VSXXXAA is not set
+# CONFIG_MOUSE_GPIO is not set
+# CONFIG_INPUT_JOYSTICK is not set
+# CONFIG_INPUT_TABLET is not set
+CONFIG_INPUT_TOUCHSCREEN=y
+CONFIG_TOUCHSCREEN_ADS7846=y
+# CONFIG_TOUCHSCREEN_FUJITSU is not set
+# CONFIG_TOUCHSCREEN_GUNZE is not set
+# CONFIG_TOUCHSCREEN_ELO is not set
+# CONFIG_TOUCHSCREEN_MTOUCH is not set
+# CONFIG_TOUCHSCREEN_MK712 is not set
+# CONFIG_TOUCHSCREEN_PENMOUNT is not set
+# CONFIG_TOUCHSCREEN_TOUCHRIGHT is not set
+# CONFIG_TOUCHSCREEN_TOUCHWIN is not set
+# CONFIG_TOUCHSCREEN_UCB1400 is not set
+# CONFIG_TOUCHSCREEN_USB_COMPOSITE is not set
+# CONFIG_INPUT_MISC is not set
+
+#
+# Hardware I/O ports
+#
+CONFIG_SERIO=y
+# CONFIG_SERIO_SERPORT is not set
+CONFIG_SERIO_LIBPS2=y
+# CONFIG_SERIO_RAW is not set
+# CONFIG_GAMEPORT is not set
+
+#
+# Character devices
+#
+CONFIG_VT=y
+CONFIG_VT_CONSOLE=y
+CONFIG_HW_CONSOLE=y
+# CONFIG_VT_HW_CONSOLE_BINDING is not set
+# CONFIG_SERIAL_NONSTANDARD is not set
+
+#
+# Serial drivers
+#
+# CONFIG_SERIAL_8250 is not set
+
+#
+# Non-8250 serial port support
+#
+CONFIG_SERIAL_ATMEL=y
+CONFIG_SERIAL_ATMEL_CONSOLE=y
+# CONFIG_SERIAL_ATMEL_TTYAT is not set
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+CONFIG_UNIX98_PTYS=y
+CONFIG_LEGACY_PTYS=y
+CONFIG_LEGACY_PTY_COUNT=256
+# CONFIG_IPMI_HANDLER is not set
+# CONFIG_HW_RANDOM is not set
+# CONFIG_NVRAM is not set
+# CONFIG_R3964 is not set
+# CONFIG_RAW_DRIVER is not set
+CONFIG_I2C=y
+CONFIG_I2C_BOARDINFO=y
+# CONFIG_I2C_CHARDEV is not set
+
+#
+# I2C Algorithms
+#
+# CONFIG_I2C_ALGOBIT is not set
+# CONFIG_I2C_ALGOPCF is not set
+# CONFIG_I2C_ALGOPCA is not set
+
+#
+# I2C Hardware Bus support
+#
+# CONFIG_I2C_GPIO is not set
+# CONFIG_I2C_PARPORT_LIGHT is not set
+# CONFIG_I2C_SIMTEC is not set
+# CONFIG_I2C_TINY_USB is not set
+
+#
+# Miscellaneous I2C Chip support
+#
+# CONFIG_I2C_DEBUG_CORE is not set
+# CONFIG_I2C_DEBUG_ALGO is not set
+# CONFIG_I2C_DEBUG_BUS is not set
+# CONFIG_I2C_DEBUG_CHIP is not set
+
+#
+# SPI support
+#
+CONFIG_SPI=y
+CONFIG_SPI_DEBUG=y
+CONFIG_SPI_MASTER=y
+
+#
+# SPI Master Controller Drivers
+#
+CONFIG_SPI_ATMEL=y
+
+#
+# SPI Protocol Masters
+#
+# CONFIG_SPI_AT25 is not set
+# CONFIG_SPI_TLE62X0 is not set
+# CONFIG_W1 is not set
+# CONFIG_POWER_SUPPLY is not set
+CONFIG_HWMON=y
+# CONFIG_HWMON_VID is not set
+# CONFIG_SENSORS_ADM1021 is not set
+# CONFIG_SENSORS_ADM1025 is not set
+# CONFIG_SENSORS_DS1621 is not set
+# CONFIG_SENSORS_GL518SM is not set
+# CONFIG_SENSORS_GL520SM is not set
+# CONFIG_SENSORS_IT87 is not set
+# CONFIG_SENSORS_LM63 is not set
+# CONFIG_SENSORS_LM75 is not set
+# CONFIG_SENSORS_LM77 is not set
+# CONFIG_SENSORS_LM78 is not set
+# CONFIG_SENSORS_LM83 is not set
+# CONFIG_SENSORS_LM87 is not set
+# CONFIG_SENSORS_LM90 is not set
+# CONFIG_SENSORS_LM92 is not set
+# CONFIG_SENSORS_LM93 is not set
+# CONFIG_SENSORS_MAX1619 is not set
+# CONFIG_SENSORS_PC87360 is not set
+# CONFIG_SENSORS_SMSC47M1 is not set
+# CONFIG_SENSORS_W83781D is not set
+# CONFIG_SENSORS_W83627HF is not set
+# CONFIG_SENSORS_W83627EHF is not set
+# CONFIG_HWMON_DEBUG_CHIP is not set
+# CONFIG_WATCHDOG is not set
+
+#
+# Sonics Silicon Backplane
+#
+CONFIG_SSB_POSSIBLE=y
+# CONFIG_SSB is not set
+
+#
+# Multifunction device drivers
+#
+# CONFIG_MFD_SM501 is not set
+
+#
+# Multimedia devices
+#
+# CONFIG_VIDEO_DEV is not set
+# CONFIG_DVB_CORE is not set
+# CONFIG_DAB is not set
+
+#
+# Graphics support
+#
+# CONFIG_VGASTATE is not set
+# CONFIG_VIDEO_OUTPUT_CONTROL is not set
+CONFIG_FB=y
+# CONFIG_FIRMWARE_EDID is not set
+# CONFIG_FB_DDC is not set
+CONFIG_FB_CFB_FILLRECT=y
+CONFIG_FB_CFB_COPYAREA=y
+CONFIG_FB_CFB_IMAGEBLIT=y
+# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
+# CONFIG_FB_SYS_FILLRECT is not set
+# CONFIG_FB_SYS_COPYAREA is not set
+# CONFIG_FB_SYS_IMAGEBLIT is not set
+# CONFIG_FB_SYS_FOPS is not set
+CONFIG_FB_DEFERRED_IO=y
+# CONFIG_FB_SVGALIB is not set
+# CONFIG_FB_MACMODES is not set
+# CONFIG_FB_BACKLIGHT is not set
+# CONFIG_FB_MODE_HELPERS is not set
+# CONFIG_FB_TILEBLITTING is not set
+
+#
+# Frame buffer hardware drivers
+#
+# CONFIG_FB_S1D13XXX is not set
+CONFIG_FB_S1D135XX=y
+# CONFIG_FB_VIRTUAL is not set
+CONFIG_BACKLIGHT_LCD_SUPPORT=y
+CONFIG_LCD_CLASS_DEVICE=y
+# CONFIG_LCD_LTV350QV is not set
+CONFIG_BACKLIGHT_CLASS_DEVICE=y
+# CONFIG_BACKLIGHT_CORGI is not set
+
+#
+# Display device support
+#
+CONFIG_DISPLAY_SUPPORT=y
+
+#
+# Display hardware drivers
+#
+
+#
+# Console display driver support
+#
+# CONFIG_VGA_CONSOLE is not set
+CONFIG_DUMMY_CONSOLE=y
+# CONFIG_FRAMEBUFFER_CONSOLE is not set
+CONFIG_LOGO=y
+# CONFIG_LOGO_LINUX_MONO is not set
+# CONFIG_LOGO_LINUX_VGA16 is not set
+CONFIG_LOGO_LINUX_CLUT224=y
+
+#
+# Sound
+#
+# CONFIG_SOUND is not set
+CONFIG_HID_SUPPORT=y
+CONFIG_HID=y
+CONFIG_HID_DEBUG=y
+# CONFIG_HIDRAW is not set
+
+#
+# USB Input Devices
+#
+CONFIG_USB_HID=y
+# CONFIG_USB_HIDINPUT_POWERBOOK is not set
+# CONFIG_USB_HIDDEV is not set
+CONFIG_USB_SUPPORT=y
+CONFIG_USB_ARCH_HAS_HCD=y
+CONFIG_USB_ARCH_HAS_OHCI=y
+# CONFIG_USB_ARCH_HAS_EHCI is not set
+CONFIG_USB=y
+CONFIG_USB_DEBUG=y
+
+#
+# Miscellaneous USB options
+#
+CONFIG_USB_DEVICEFS=y
+# CONFIG_USB_DEVICE_CLASS is not set
+
+#
+# USB Host Controller Drivers
+#
+# CONFIG_USB_ISP116X_HCD is not set
+CONFIG_USB_OHCI_HCD=y
+# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set
+# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set
+CONFIG_USB_OHCI_LITTLE_ENDIAN=y
+# CONFIG_USB_SL811_HCD is not set
+# CONFIG_USB_R8A66597_HCD is not set
+
+#
+# USB Device Class drivers
+#
+# CONFIG_USB_ACM is not set
+# CONFIG_USB_PRINTER is not set
+
+#
+# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
+#
+
+#
+# may also be needed; see USB_STORAGE Help for more information
+#
+CONFIG_USB_STORAGE=y
+# CONFIG_USB_STORAGE_DEBUG is not set
+# CONFIG_USB_STORAGE_FREECOM is not set
+# CONFIG_USB_STORAGE_ISD200 is not set
+# CONFIG_USB_STORAGE_DPCM is not set
+# CONFIG_USB_STORAGE_KARMA is not set
+# CONFIG_USB_LIBUSUAL is not set
+
+#
+# USB Imaging devices
+#
+# CONFIG_USB_MICROTEK is not set
+CONFIG_USB_MON=y
+
+#
+# USB port drivers
+#
+
+#
+# USB Serial Converter support
+#
+# CONFIG_USB_SERIAL is not set
+
+#
+# USB Miscellaneous drivers
+#
+# CONFIG_USB_EMI62 is not set
+# CONFIG_USB_EMI26 is not set
+# CONFIG_USB_LCD is not set
+# CONFIG_USB_BERRY_CHARGE is not set
+# CONFIG_USB_LED is not set
+# CONFIG_USB_CYPRESS_CY7C63 is not set
+# CONFIG_USB_CYTHERM is not set
+# CONFIG_USB_PHIDGET is not set
+# CONFIG_USB_IDMOUSE is not set
+# CONFIG_USB_FTDI_ELAN is not set
+# CONFIG_USB_APPLEDISPLAY is not set
+# CONFIG_USB_LD is not set
+# CONFIG_USB_TRANCEVIBRATOR is not set
+# CONFIG_USB_IOWARRIOR is not set
+
+#
+# USB DSL modem support
+#
+
+#
+# USB Gadget Support
+#
+CONFIG_USB_GADGET=y
+# CONFIG_USB_GADGET_DEBUG_FILES is not set
+# CONFIG_USB_GADGET_DEBUG_FS is not set
+CONFIG_USB_GADGET_SELECTED=y
+# CONFIG_USB_GADGET_AMD5536UDC is not set
+# CONFIG_USB_GADGET_ATMEL_USBA is not set
+# CONFIG_USB_GADGET_FSL_USB2 is not set
+# CONFIG_USB_GADGET_NET2280 is not set
+# CONFIG_USB_GADGET_PXA2XX is not set
+CONFIG_USB_GADGET_M66592=y
+CONFIG_USB_M66592=y
+# CONFIG_USB_GADGET_GOKU is not set
+# CONFIG_USB_GADGET_LH7A40X is not set
+# CONFIG_USB_GADGET_OMAP is not set
+# CONFIG_USB_GADGET_S3C2410 is not set
+# CONFIG_USB_GADGET_AT91 is not set
+# CONFIG_USB_GADGET_DUMMY_HCD is not set
+CONFIG_USB_GADGET_DUALSPEED=y
+# CONFIG_USB_ZERO is not set
+# CONFIG_USB_ETH is not set
+# CONFIG_USB_GADGETFS is not set
+CONFIG_USB_FILE_STORAGE=y
+# CONFIG_USB_FILE_STORAGE_TEST is not set
+# CONFIG_USB_G_SERIAL is not set
+# CONFIG_USB_MIDI_GADGET is not set
+CONFIG_MMC=y
+CONFIG_MMC_DEBUG=y
+# CONFIG_MMC_UNSAFE_RESUME is not set
+
+#
+# MMC/SD Card Drivers
+#
+CONFIG_MMC_BLOCK=y
+# CONFIG_MMC_BLOCK_BOUNCE is not set
+# CONFIG_SDIO_UART is not set
+
+#
+# MMC/SD Host Controller Drivers
+#
+CONFIG_MMC_AT91=y
+CONFIG_NEW_LEDS=y
+CONFIG_LEDS_CLASS=y
+
+#
+# LED drivers
+#
+CONFIG_LEDS_GPIO=y
+
+#
+# LED Triggers
+#
+CONFIG_LEDS_TRIGGERS=y
+CONFIG_LEDS_TRIGGER_TIMER=y
+CONFIG_LEDS_TRIGGER_HEARTBEAT=y
+CONFIG_RTC_LIB=y
+CONFIG_RTC_CLASS=y
+CONFIG_RTC_HCTOSYS=y
+CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
+# CONFIG_RTC_DEBUG is not set
+
+#
+# RTC interfaces
+#
+CONFIG_RTC_INTF_SYSFS=y
+CONFIG_RTC_INTF_PROC=y
+CONFIG_RTC_INTF_DEV=y
+# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
+# CONFIG_RTC_DRV_TEST is not set
+
+#
+# I2C RTC drivers
+#
+# CONFIG_RTC_DRV_DS1307 is not set
+# CONFIG_RTC_DRV_DS1374 is not set
+# CONFIG_RTC_DRV_DS1672 is not set
+# CONFIG_RTC_DRV_MAX6900 is not set
+# CONFIG_RTC_DRV_RS5C372 is not set
+# CONFIG_RTC_DRV_ISL1208 is not set
+# CONFIG_RTC_DRV_X1205 is not set
+# CONFIG_RTC_DRV_PCF8563 is not set
+# CONFIG_RTC_DRV_PCF8583 is not set
+# CONFIG_RTC_DRV_M41T80 is not set
+
+#
+# SPI RTC drivers
+#
+# CONFIG_RTC_DRV_RS5C348 is not set
+# CONFIG_RTC_DRV_MAX6902 is not set
+
+#
+# Platform RTC drivers
+#
+# CONFIG_RTC_DRV_CMOS is not set
+# CONFIG_RTC_DRV_DS1553 is not set
+# CONFIG_RTC_DRV_STK17TA8 is not set
+# CONFIG_RTC_DRV_DS1742 is not set
+# CONFIG_RTC_DRV_M48T86 is not set
+# CONFIG_RTC_DRV_M48T59 is not set
+# CONFIG_RTC_DRV_V3020 is not set
+
+#
+# on-CPU RTC drivers
+#
+CONFIG_RTC_DRV_AT91RM9200=y
+
+#
+# File systems
+#
+CONFIG_EXT2_FS=y
+CONFIG_EXT2_FS_XATTR=y
+# CONFIG_EXT2_FS_POSIX_ACL is not set
+# CONFIG_EXT2_FS_SECURITY is not set
+# CONFIG_EXT2_FS_XIP is not set
+CONFIG_EXT3_FS=y
+CONFIG_EXT3_FS_XATTR=y
+# CONFIG_EXT3_FS_POSIX_ACL is not set
+# CONFIG_EXT3_FS_SECURITY is not set
+CONFIG_JBD=y
+# CONFIG_JBD_DEBUG is not set
+CONFIG_FS_MBCACHE=y
+CONFIG_REISERFS_FS=y
+# CONFIG_REISERFS_CHECK is not set
+# CONFIG_REISERFS_PROC_INFO is not set
+# CONFIG_REISERFS_FS_XATTR is not set
+# CONFIG_JFS_FS is not set
+# CONFIG_FS_POSIX_ACL is not set
+# CONFIG_XFS_FS is not set
+# CONFIG_OCFS2_FS is not set
+# CONFIG_MINIX_FS is not set
+# CONFIG_ROMFS_FS is not set
+CONFIG_INOTIFY=y
+CONFIG_INOTIFY_USER=y
+# CONFIG_QUOTA is not set
+CONFIG_DNOTIFY=y
+# CONFIG_AUTOFS_FS is not set
+# CONFIG_AUTOFS4_FS is not set
+# CONFIG_FUSE_FS is not set
+
+#
+# CD-ROM/DVD Filesystems
+#
+CONFIG_ISO9660_FS=y
+CONFIG_JOLIET=y
+CONFIG_ZISOFS=y
+CONFIG_UDF_FS=y
+CONFIG_UDF_NLS=y
+
+#
+# DOS/FAT/NT Filesystems
+#
+CONFIG_FAT_FS=y
+CONFIG_MSDOS_FS=y
+CONFIG_VFAT_FS=y
+CONFIG_FAT_DEFAULT_CODEPAGE=437
+CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
+# CONFIG_NTFS_FS is not set
+
+#
+# Pseudo filesystems
+#
+CONFIG_PROC_FS=y
+CONFIG_PROC_SYSCTL=y
+CONFIG_SYSFS=y
+CONFIG_TMPFS=y
+# CONFIG_TMPFS_POSIX_ACL is not set
+# CONFIG_HUGETLB_PAGE is not set
+
+#
+# Miscellaneous filesystems
+#
+# CONFIG_HFSPLUS_FS is not set
+CONFIG_JFFS2_FS=y
+CONFIG_JFFS2_FS_DEBUG=1
+CONFIG_JFFS2_FS_WRITEBUFFER=y
+# CONFIG_JFFS2_FS_WBUF_VERIFY is not set
+CONFIG_JFFS2_COMPRESSION_OPTIONS=y
+CONFIG_JFFS2_ZLIB=y
+# CONFIG_JFFS2_LZO is not set
+CONFIG_JFFS2_RTIME=y
+CONFIG_JFFS2_RUBIN=y
+# CONFIG_JFFS2_CMODE_NONE is not set
+CONFIG_JFFS2_CMODE_PRIORITY=y
+# CONFIG_JFFS2_CMODE_SIZE is not set
+# CONFIG_JFFS2_CMODE_FAVOURLZO is not set
+CONFIG_CRAMFS=y
+# CONFIG_VXFS_FS is not set
+# CONFIG_HPFS_FS is not set
+# CONFIG_QNX4FS_FS is not set
+# CONFIG_SYSV_FS is not set
+# CONFIG_UFS_FS is not set
+CONFIG_NETWORK_FILESYSTEMS=y
+# CONFIG_NFS_FS is not set
+# CONFIG_NFSD is not set
+# CONFIG_SMB_FS is not set
+# CONFIG_CIFS is not set
+# CONFIG_NCP_FS is not set
+# CONFIG_CODA_FS is not set
+
+#
+# Partition Types
+#
+CONFIG_PARTITION_ADVANCED=y
+# CONFIG_ACORN_PARTITION is not set
+# CONFIG_OSF_PARTITION is not set
+# CONFIG_AMIGA_PARTITION is not set
+# CONFIG_ATARI_PARTITION is not set
+CONFIG_MAC_PARTITION=y
+CONFIG_MSDOS_PARTITION=y
+# CONFIG_BSD_DISKLABEL is not set
+# CONFIG_MINIX_SUBPARTITION is not set
+# CONFIG_SOLARIS_X86_PARTITION is not set
+# CONFIG_UNIXWARE_DISKLABEL is not set
+# CONFIG_LDM_PARTITION is not set
+# CONFIG_SGI_PARTITION is not set
+# CONFIG_ULTRIX_PARTITION is not set
+# CONFIG_SUN_PARTITION is not set
+# CONFIG_KARMA_PARTITION is not set
+# CONFIG_EFI_PARTITION is not set
+# CONFIG_SYSV68_PARTITION is not set
+CONFIG_NLS=y
+CONFIG_NLS_DEFAULT="iso8859-1"
+CONFIG_NLS_CODEPAGE_437=y
+# CONFIG_NLS_CODEPAGE_737 is not set
+# CONFIG_NLS_CODEPAGE_775 is not set
+# CONFIG_NLS_CODEPAGE_850 is not set
+# CONFIG_NLS_CODEPAGE_852 is not set
+# CONFIG_NLS_CODEPAGE_855 is not set
+# CONFIG_NLS_CODEPAGE_857 is not set
+# CONFIG_NLS_CODEPAGE_860 is not set
+# CONFIG_NLS_CODEPAGE_861 is not set
+# CONFIG_NLS_CODEPAGE_862 is not set
+# CONFIG_NLS_CODEPAGE_863 is not set
+# CONFIG_NLS_CODEPAGE_864 is not set
+# CONFIG_NLS_CODEPAGE_865 is not set
+# CONFIG_NLS_CODEPAGE_866 is not set
+# CONFIG_NLS_CODEPAGE_869 is not set
+# CONFIG_NLS_CODEPAGE_936 is not set
+# CONFIG_NLS_CODEPAGE_950 is not set
+# CONFIG_NLS_CODEPAGE_932 is not set
+# CONFIG_NLS_CODEPAGE_949 is not set
+# CONFIG_NLS_CODEPAGE_874 is not set
+# CONFIG_NLS_ISO8859_8 is not set
+# CONFIG_NLS_CODEPAGE_1250 is not set
+# CONFIG_NLS_CODEPAGE_1251 is not set
+# CONFIG_NLS_ASCII is not set
+CONFIG_NLS_ISO8859_1=y
+# CONFIG_NLS_ISO8859_2 is not set
+# CONFIG_NLS_ISO8859_3 is not set
+# CONFIG_NLS_ISO8859_4 is not set
+# CONFIG_NLS_ISO8859_5 is not set
+# CONFIG_NLS_ISO8859_6 is not set
+# CONFIG_NLS_ISO8859_7 is not set
+# CONFIG_NLS_ISO8859_9 is not set
+# CONFIG_NLS_ISO8859_13 is not set
+# CONFIG_NLS_ISO8859_14 is not set
+# CONFIG_NLS_ISO8859_15 is not set
+# CONFIG_NLS_KOI8_R is not set
+# CONFIG_NLS_KOI8_U is not set
+# CONFIG_NLS_UTF8 is not set
+CONFIG_INSTRUMENTATION=y
+# CONFIG_PROFILING is not set
+# CONFIG_MARKERS is not set
+
+#
+# Kernel hacking
+#
+# CONFIG_PRINTK_TIME is not set
+CONFIG_ENABLE_WARN_DEPRECATED=y
+# CONFIG_ENABLE_MUST_CHECK is not set
+# CONFIG_MAGIC_SYSRQ is not set
+# CONFIG_UNUSED_SYMBOLS is not set
+CONFIG_DEBUG_FS=y
+# CONFIG_HEADERS_CHECK is not set
+CONFIG_DEBUG_KERNEL=y
+# CONFIG_DEBUG_SHIRQ is not set
+CONFIG_DETECT_SOFTLOCKUP=y
+CONFIG_SCHED_DEBUG=y
+# CONFIG_SCHEDSTATS is not set
+# CONFIG_TIMER_STATS is not set
+CONFIG_SLUB_DEBUG_ON=y
+# CONFIG_DEBUG_RT_MUTEXES is not set
+# CONFIG_RT_MUTEX_TESTER is not set
+# CONFIG_DEBUG_SPINLOCK is not set
+# CONFIG_DEBUG_MUTEXES is not set
+# CONFIG_DEBUG_LOCK_ALLOC is not set
+# CONFIG_PROVE_LOCKING is not set
+# CONFIG_LOCK_STAT is not set
+# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
+# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
+CONFIG_DEBUG_KOBJECT=y
+CONFIG_DEBUG_BUGVERBOSE=y
+CONFIG_DEBUG_INFO=y
+# CONFIG_DEBUG_VM is not set
+CONFIG_DEBUG_LIST=y
+# CONFIG_DEBUG_SG is not set
+CONFIG_FRAME_POINTER=y
+CONFIG_FORCED_INLINING=y
+# CONFIG_BOOT_PRINTK_DELAY is not set
+# CONFIG_RCU_TORTURE_TEST is not set
+# CONFIG_FAULT_INJECTION is not set
+# CONFIG_SAMPLES is not set
+CONFIG_DEBUG_USER=y
+CONFIG_DEBUG_ERRORS=y
+CONFIG_DEBUG_LL=y
+# CONFIG_DEBUG_ICEDCC is not set
+
+#
+# Security options
+#
+# CONFIG_KEYS is not set
+# CONFIG_SECURITY is not set
+# CONFIG_CRYPTO is not set
+
+#
+# Library routines
+#
+CONFIG_BITREVERSE=y
+# CONFIG_CRC_CCITT is not set
+# CONFIG_CRC16 is not set
+# CONFIG_CRC_ITU_T is not set
+CONFIG_CRC32=y
+# CONFIG_CRC7 is not set
+# CONFIG_LIBCRC32C is not set
+CONFIG_ZLIB_INFLATE=y
+CONFIG_ZLIB_DEFLATE=y
+CONFIG_PLIST=y
+CONFIG_HAS_IOMEM=y
+CONFIG_HAS_IOPORT=y
+CONFIG_HAS_DMA=y
index 6235f72a14f0d1c2b629a5b60557fe597080ae7a..ad455ff5aebe5379841cede6d11ae29c504b8841 100644 (file)
@@ -22,6 +22,7 @@ obj-$(CONFIG_KEXEC)           += machine_kexec.o relocate_kernel.o
 obj-$(CONFIG_KPROBES)          += kprobes.o kprobes-decode.o
 obj-$(CONFIG_ATAGS_PROC)       += atags.o
 obj-$(CONFIG_OABI_COMPAT)      += sys_oabi-compat.o
+obj-$(CONFIG_ARM_THUMBEE)      += thumbee.o
 
 obj-$(CONFIG_CRUNCH)           += crunch.o crunch-bits.o
 AFLAGS_crunch-bits.o           := -Wa,-mcpu=ep9312
index 3278e713c32a106f191a0f925ecf2252d89c5c90..0a0d2479274b6c749c905aa5efcf4c2beb01b407 100644 (file)
@@ -58,6 +58,9 @@ int main(void)
   DEFINE(TI_TP_VALUE,          offsetof(struct thread_info, tp_value));
   DEFINE(TI_FPSTATE,           offsetof(struct thread_info, fpstate));
   DEFINE(TI_VFPSTATE,          offsetof(struct thread_info, vfpstate));
+#ifdef CONFIG_ARM_THUMBEE
+  DEFINE(TI_THUMBEE_STATE,     offsetof(struct thread_info, thumbee_state));
+#endif
 #ifdef CONFIG_IWMMXT
   DEFINE(TI_IWMMXT_STATE,      offsetof(struct thread_info, fpstate.iwmmxt));
 #endif
@@ -108,5 +111,12 @@ int main(void)
   DEFINE(PROCINFO_INITFUNC,    offsetof(struct proc_info_list, __cpu_flush));
   DEFINE(PROCINFO_MM_MMUFLAGS, offsetof(struct proc_info_list, __cpu_mm_mmu_flags));
   DEFINE(PROCINFO_IO_MMUFLAGS, offsetof(struct proc_info_list, __cpu_io_mmu_flags));
+  BLANK();
+#ifdef MULTI_DABORT
+  DEFINE(PROCESSOR_DABT_FUNC,  offsetof(struct processor, _data_abort));
+#endif
+#ifdef MULTI_PABORT
+  DEFINE(PROCESSOR_PABT_FUNC,  offsetof(struct processor, _prefetch_abort));
+#endif
   return 0; 
 }
index 7e97b7376563d2b6afbce8803b2ab796d29e87d9..30a67a5a40a81e472c2049e91765a3190b1eb2a4 100644 (file)
                CALL(sys_kexec_load)
                CALL(sys_utimensat)
                CALL(sys_signalfd)
-/* 350 */      CALL(sys_ni_syscall)
+/* 350 */      CALL(sys_timerfd_create)
                CALL(sys_eventfd)
                CALL(sys_fallocate)
+               CALL(sys_timerfd_settime)
+               CALL(sys_timerfd_gettime)
 #ifndef syscalls_counted
 .equ syscalls_padding, ((NR_syscalls + 3) & ~3) - NR_syscalls
 #define syscalls_counted
index a46d5b456765e1416485d2d6eca7919b764c9756..7dca225752c1c49e1e77c9014bf831e3045b1ffa 100644 (file)
@@ -166,12 +166,12 @@ __dabt_svc:
        @ The abort handler must return the aborted address in r0, and
        @ the fault status register in r1.  r9 must be preserved.
        @
-#ifdef MULTI_ABORT
+#ifdef MULTI_DABORT
        ldr     r4, .LCprocfns
        mov     lr, pc
-       ldr     pc, [r4]
+       ldr     pc, [r4, #PROCESSOR_DABT_FUNC]
 #else
-       bl      CPU_ABORT_HANDLER
+       bl      CPU_DABORT_HANDLER
 #endif
 
        @
@@ -209,14 +209,12 @@ __irq_svc:
 
        irq_handler
 #ifdef CONFIG_PREEMPT
+       str     r8, [tsk, #TI_PREEMPT]          @ restore preempt count
        ldr     r0, [tsk, #TI_FLAGS]            @ get flags
+       teq     r8, #0                          @ if preempt count != 0
+       movne   r0, #0                          @ force flags to 0
        tst     r0, #_TIF_NEED_RESCHED
        blne    svc_preempt
-preempt_return:
-       ldr     r0, [tsk, #TI_PREEMPT]          @ read preempt value
-       str     r8, [tsk, #TI_PREEMPT]          @ restore preempt count
-       teq     r0, r7
-       strne   r0, [r0, -r0]                   @ bug()
 #endif
        ldr     r0, [sp, #S_PSR]                @ irqs are already disabled
        msr     spsr_cxsf, r0
@@ -230,19 +228,11 @@ preempt_return:
 
 #ifdef CONFIG_PREEMPT
 svc_preempt:
-       teq     r8, #0                          @ was preempt count = 0
-       ldreq   r6, .LCirq_stat
-       movne   pc, lr                          @ no
-       ldr     r0, [r6, #4]                    @ local_irq_count
-       ldr     r1, [r6, #8]                    @ local_bh_count
-       adds    r0, r0, r1
-       movne   pc, lr
-       mov     r7, #0                          @ preempt_schedule_irq
-       str     r7, [tsk, #TI_PREEMPT]          @ expects preempt_count == 0
+       mov     r8, lr
 1:     bl      preempt_schedule_irq            @ irq en/disable is done inside
        ldr     r0, [tsk, #TI_FLAGS]            @ get new tasks TI_FLAGS
        tst     r0, #_TIF_NEED_RESCHED
-       beq     preempt_return                  @ go again
+       moveq   pc, r8                          @ go again
        b       1b
 #endif
 
@@ -293,7 +283,6 @@ __pabt_svc:
        mrs     r9, cpsr
        tst     r3, #PSR_I_BIT
        biceq   r9, r9, #PSR_I_BIT
-       msr     cpsr_c, r9
 
        @
        @ set args, then call main handler
@@ -301,7 +290,15 @@ __pabt_svc:
        @  r0 - address of faulting instruction
        @  r1 - pointer to registers on stack
        @
-       mov     r0, r2                          @ address (pc)
+#ifdef MULTI_PABORT
+       mov     r0, r2                  @ pass address of aborted instruction.
+       ldr     r4, .LCprocfns
+       mov     lr, pc
+       ldr     pc, [r4, #PROCESSOR_PABT_FUNC]
+#else
+       CPU_PABORT_HANDLER(r0, r2)
+#endif
+       msr     cpsr_c, r9                      @ Maybe enable interrupts
        mov     r1, sp                          @ regs
        bl      do_PrefetchAbort                @ call abort handler
 
@@ -320,16 +317,12 @@ __pabt_svc:
        .align  5
 .LCcralign:
        .word   cr_alignment
-#ifdef MULTI_ABORT
+#ifdef MULTI_DABORT
 .LCprocfns:
        .word   processor
 #endif
 .LCfp:
        .word   fp_enter
-#ifdef CONFIG_PREEMPT
-.LCirq_stat:
-       .word   irq_stat
-#endif
 
 /*
  * User mode handlers
@@ -404,12 +397,12 @@ __dabt_usr:
        @ The abort handler must return the aborted address in r0, and
        @ the fault status register in r1.
        @
-#ifdef MULTI_ABORT
+#ifdef MULTI_DABORT
        ldr     r4, .LCprocfns
        mov     lr, pc
-       ldr     pc, [r4]
+       ldr     pc, [r4, #PROCESSOR_DABT_FUNC]
 #else
-       bl      CPU_ABORT_HANDLER
+       bl      CPU_DABORT_HANDLER
 #endif
 
        @
@@ -455,10 +448,6 @@ __irq_usr:
 __und_usr:
        usr_entry
 
-       tst     r3, #PSR_T_BIT                  @ Thumb mode?
-       bne     __und_usr_unknown               @ ignore FP
-       sub     r4, r2, #4
-
        @
        @ fall through to the emulation code, which returns using r9 if
        @ it has emulated the instruction, or the more conventional lr
@@ -468,7 +457,24 @@ __und_usr:
        @
        adr     r9, ret_from_exception
        adr     lr, __und_usr_unknown
-1:     ldrt    r0, [r4]
+       tst     r3, #PSR_T_BIT                  @ Thumb mode?
+       subeq   r4, r2, #4                      @ ARM instr at LR - 4
+       subne   r4, r2, #2                      @ Thumb instr at LR - 2
+1:     ldreqt  r0, [r4]
+       beq     call_fpe
+       @ Thumb instruction
+#if __LINUX_ARM_ARCH__ >= 7
+2:     ldrht   r5, [r4], #2
+       and     r0, r5, #0xf800                 @ mask bits 111x x... .... ....
+       cmp     r0, #0xe800                     @ 32bit instruction if xx != 0
+       blo     __und_usr_unknown
+3:     ldrht   r0, [r4]
+       add     r2, r2, #2                      @ r2 is PC + 2, make it PC + 4
+       orr     r0, r0, r5, lsl #16
+#else
+       b       __und_usr_unknown
+#endif
+
        @
        @ fallthrough to call_fpe
        @
@@ -477,10 +483,14 @@ __und_usr:
  * The out of line fixup for the ldrt above.
  */
        .section .fixup, "ax"
-2:     mov     pc, r9
+4:     mov     pc, r9
        .previous
        .section __ex_table,"a"
-       .long   1b, 2b
+       .long   1b, 4b
+#if __LINUX_ARM_ARCH__ >= 7
+       .long   2b, 4b
+       .long   3b, 4b
+#endif
        .previous
 
 /*
@@ -507,9 +517,16 @@ __und_usr:
  *  r10 = this threads thread_info structure.
  *  lr  = unrecognised instruction return address
  */
+       @
+       @ Fall-through from Thumb-2 __und_usr
+       @
+#ifdef CONFIG_NEON
+       adr     r6, .LCneon_thumb_opcodes
+       b       2f
+#endif
 call_fpe:
 #ifdef CONFIG_NEON
-       adr     r6, .LCneon_opcodes
+       adr     r6, .LCneon_arm_opcodes
 2:
        ldr     r7, [r6], #4                    @ mask value
        cmp     r7, #0                          @ end mask?
@@ -526,6 +543,7 @@ call_fpe:
 1:
 #endif
        tst     r0, #0x08000000                 @ only CDP/CPRT/LDC/STC have bit 27
+       tstne   r0, #0x04000000                 @ bit 26 set on both ARM and Thumb-2
 #if defined(CONFIG_CPU_ARM610) || defined(CONFIG_CPU_ARM710)
        and     r8, r0, #0x0f000000             @ mask out op-code bits
        teqne   r8, #0x0f000000                 @ SWI (ARM6/7 bug)?
@@ -577,13 +595,23 @@ call_fpe:
 #ifdef CONFIG_NEON
        .align  6
 
-.LCneon_opcodes:
+.LCneon_arm_opcodes:
        .word   0xfe000000                      @ mask
        .word   0xf2000000                      @ opcode
 
        .word   0xff100000                      @ mask
        .word   0xf4000000                      @ opcode
 
+       .word   0x00000000                      @ mask
+       .word   0x00000000                      @ opcode
+
+.LCneon_thumb_opcodes:
+       .word   0xef000000                      @ mask
+       .word   0xef000000                      @ opcode
+
+       .word   0xff100000                      @ mask
+       .word   0xf9000000                      @ opcode
+
        .word   0x00000000                      @ mask
        .word   0x00000000                      @ opcode
 #endif
@@ -619,8 +647,15 @@ __und_usr_unknown:
 __pabt_usr:
        usr_entry
 
+#ifdef MULTI_PABORT
+       mov     r0, r2                  @ pass address of aborted instruction.
+       ldr     r4, .LCprocfns
+       mov     lr, pc
+       ldr     pc, [r4, #PROCESSOR_PABT_FUNC]
+#else
+       CPU_PABORT_HANDLER(r0, r2)
+#endif
        enable_irq                              @ Enable interrupts
-       mov     r0, r2                          @ address (pc)
        mov     r1, sp                          @ regs
        bl      do_PrefetchAbort                @ call abort handler
        /* fall through */
index 6c90c50a9ee3bc12578ef1ac40fc66678a4ace4e..597ed00a08d87e68fa84cb81256179283668d821 100644 (file)
@@ -352,6 +352,11 @@ sys_mmap2:
                b       do_mmap2
 #endif
 
+ENTRY(pabort_ifar)
+               mrc     p15, 0, r0, cr6, cr0, 2
+ENTRY(pabort_noifar)
+               mov     pc, lr
+
 #ifdef CONFIG_OABI_COMPAT
 
 /*
index 50f667febe29ff638f2fa1544ab3217f1eb26a0d..7e9c00a8a4127ee35dad9507b109f13f319f23a3 100644 (file)
@@ -75,8 +75,13 @@ __error_p:
 #ifdef CONFIG_DEBUG_LL
        adr     r0, str_p1
        bl      printascii
+       mov     r0, r9
+       bl      printhex8
+       adr     r0, str_p2
+       bl      printascii
        b       __error
-str_p1:        .asciz  "\nError: unrecognized/unsupported processor variant.\n"
+str_p1:        .asciz  "\nError: unrecognized/unsupported processor variant (0x"
+str_p2:        .asciz  ").\n"
        .align
 #endif
 
diff --git a/arch/arm/kernel/thumbee.c b/arch/arm/kernel/thumbee.c
new file mode 100644 (file)
index 0000000..df3f6b7
--- /dev/null
@@ -0,0 +1,81 @@
+/*
+ * arch/arm/kernel/thumbee.c
+ *
+ * Copyright (C) 2008 ARM Limited
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include <linux/kernel.h>
+#include <linux/init.h>
+
+#include <asm/thread_notify.h>
+
+/*
+ * Access to the ThumbEE Handler Base register
+ */
+static inline unsigned long teehbr_read()
+{
+       unsigned long v;
+       asm("mrc        p14, 6, %0, c1, c0, 0\n" : "=r" (v));
+       return v;
+}
+
+static inline void teehbr_write(unsigned long v)
+{
+       asm("mcr        p14, 6, %0, c1, c0, 0\n" : : "r" (v));
+}
+
+static int thumbee_notifier(struct notifier_block *self, unsigned long cmd, void *t)
+{
+       struct thread_info *thread = t;
+
+       switch (cmd) {
+       case THREAD_NOTIFY_FLUSH:
+               thread->thumbee_state = 0;
+               break;
+       case THREAD_NOTIFY_SWITCH:
+               current_thread_info()->thumbee_state = teehbr_read();
+               teehbr_write(thread->thumbee_state);
+               break;
+       }
+
+       return NOTIFY_DONE;
+}
+
+static struct notifier_block thumbee_notifier_block = {
+       .notifier_call  = thumbee_notifier,
+};
+
+static int __init thumbee_init(void)
+{
+       unsigned long pfr0;
+       unsigned int cpu_arch = cpu_architecture();
+
+       if (cpu_arch < CPU_ARCH_ARMv7)
+               return 0;
+
+       /* processor feature register 0 */
+       asm("mrc        p15, 0, %0, c0, c1, 0\n" : "=r" (pfr0));
+       if ((pfr0 & 0x0000f000) != 0x00001000)
+               return 0;
+
+       printk(KERN_INFO "ThumbEE CPU extension supported.\n");
+       elf_hwcap |= HWCAP_THUMBEE;
+       thread_register_notifier(&thumbee_notifier_block);
+
+       return 0;
+}
+
+late_initcall(thumbee_init);
index 74aa7a39bb68d9d09c281dd7c97612c206291afd..e10ee158d72058dcaee136eb198ff8383110df96 100644 (file)
@@ -18,8 +18,6 @@
 #include <linux/clk.h>
 #include <linux/mutex.h>
 
-#include <asm/semaphore.h>
-
 #include "clock.h"
 
 static LIST_HEAD(clocks);
index 074dcd5d9a7ef185d4f81d80538f5744fa440e89..0fc07b6db749ea98c7b42f87d4536e28ae2b1ad7 100644 (file)
@@ -12,18 +12,28 @@ config ARCH_AT91RM9200
 
 config ARCH_AT91SAM9260
        bool "AT91SAM9260 or AT91SAM9XE"
+       select GENERIC_TIME
+       select GENERIC_CLOCKEVENTS
 
 config ARCH_AT91SAM9261
        bool "AT91SAM9261"
+       select GENERIC_TIME
+       select GENERIC_CLOCKEVENTS
 
 config ARCH_AT91SAM9263
        bool "AT91SAM9263"
+       select GENERIC_TIME
+       select GENERIC_CLOCKEVENTS
 
 config ARCH_AT91SAM9RL
        bool "AT91SAM9RL"
+       select GENERIC_TIME
+       select GENERIC_CLOCKEVENTS
 
 config ARCH_AT91CAP9
        bool "AT91CAP9"
+       select GENERIC_TIME
+       select GENERIC_CLOCKEVENTS
 
 config ARCH_AT91X40
        bool "AT91x40"
@@ -109,6 +119,13 @@ config MACH_KAFA
        help
          Select this if you are using Sperry-Sun's KAFA board.
 
+config MACH_ECBAT91
+       bool "emQbit ECB_AT91 SBC"
+       depends on ARCH_AT91RM9200
+       help
+         Select this if you are using emQbit's ECB_AT91 board.
+         <http://wiki.emqbit.com/free-ecb-at91>
+
 endif
 
 # ----------------------------------------------------------
@@ -133,6 +150,20 @@ config MACH_AT91SAM9260EK
          Select this if you are using Atmel's AT91SAM9260-EK or AT91SAM9XE Evaluation Kit
          <http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3933>
 
+config MACH_CAM60
+       bool "KwikByte KB9260 (CAM60) board"
+       depends on ARCH_AT91SAM9260
+       help
+         Select this if you are using KwikByte's KB9260 (CAM60) board based on the Atmel AT91SAM9260.
+         <http://www.kwikbyte.com/KB9260.html>
+
+config MACH_SAM9_L9260
+       bool "Olimex SAM9-L9260 board"
+       depends on ARCH_AT91SAM9260
+       help
+         Select this if you are using Olimex's SAM9-L9260 board based on the Atmel AT91SAM9260.
+         <http://www.olimex.com/dev/sam9-L9260.html>
+
 endif
 
 # ----------------------------------------------------------
@@ -216,7 +247,7 @@ comment "AT91 Board Options"
 
 config MTD_AT91_DATAFLASH_CARD
        bool "Enable DataFlash Card support"
-       depends on (ARCH_AT91RM9200DK || MACH_AT91RM9200EK || MACH_AT91SAM9260EK || MACH_AT91SAM9261EK || MACH_AT91SAM9263EK || MACH_AT91CAP9ADK)
+       depends on (ARCH_AT91RM9200DK || MACH_AT91RM9200EK || MACH_AT91SAM9260EK || MACH_AT91SAM9261EK || MACH_AT91SAM9263EK || MACH_AT91CAP9ADK || MACH_SAM9_L9260 || MACH_ECBAT91)
        help
          Enable support for the DataFlash card.
 
index bf5f293dccf8f5ffee383d9ffb91874d48fb209a..8d9bc0153b183ecd21c9f35d49956191437defb1 100644 (file)
@@ -29,9 +29,12 @@ obj-$(CONFIG_MACH_KB9200)    += board-kb9202.o
 obj-$(CONFIG_MACH_ATEB9200)    += board-eb9200.o
 obj-$(CONFIG_MACH_KAFA)                += board-kafa.o
 obj-$(CONFIG_MACH_PICOTUX2XX)  += board-picotux200.o
+obj-$(CONFIG_MACH_ECBAT91)     += board-ecbat91.o
 
 # AT91SAM9260 board-specific support
 obj-$(CONFIG_MACH_AT91SAM9260EK) += board-sam9260ek.o
+obj-$(CONFIG_MACH_CAM60)       += board-cam60.o
+obj-$(CONFIG_MACH_SAM9_L9260)  += board-sam9-l9260.o
 
 # AT91SAM9261 board-specific support
 obj-$(CONFIG_MACH_AT91SAM9261EK) += board-sam9261ek.o
index 48d27d8000b0e8da5f696ad902c36c19fe7b6f6f..933fa8f55cbc76fa60c6b52d714245dff2503125 100644 (file)
  */
 
 #include <linux/module.h>
+#include <linux/pm.h>
 
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
 #include <asm/arch/at91cap9.h>
 #include <asm/arch/at91_pmc.h>
 #include <asm/arch/at91_rstc.h>
+#include <asm/arch/at91_shdwc.h>
 
 #include "generic.h"
 #include "clock.h"
@@ -288,6 +290,12 @@ static void at91cap9_reset(void)
        at91_sys_write(AT91_RSTC_CR, AT91_RSTC_KEY | AT91_RSTC_PROCRST | AT91_RSTC_PERRST);
 }
 
+static void at91cap9_poweroff(void)
+{
+       at91_sys_write(AT91_SHDW_CR, AT91_SHDW_KEY | AT91_SHDW_SHDW);
+}
+
+
 /* --------------------------------------------------------------------
  *  AT91CAP9 processor initialization
  * -------------------------------------------------------------------- */
@@ -298,6 +306,7 @@ void __init at91cap9_initialize(unsigned long main_clock)
        iotable_init(at91cap9_io_desc, ARRAY_SIZE(at91cap9_io_desc));
 
        at91_arch_reset = at91cap9_reset;
+       pm_power_off = at91cap9_poweroff;
        at91_extern_irq = (1 << AT91CAP9_ID_IRQ0) | (1 << AT91CAP9_ID_IRQ1);
 
        /* Init clock subsystem */
index c50fad9cd143abb0929b070ce03233b06f2dba9d..f1a80d74a4b659bde31a4402453f0bfa0232c19b 100644 (file)
 
 #include <linux/dma-mapping.h>
 #include <linux/platform_device.h>
-#include <linux/mtd/physmap.h>
+#include <linux/i2c-gpio.h>
 
 #include <video/atmel_lcdc.h>
 
 #include <asm/arch/board.h>
 #include <asm/arch/gpio.h>
 #include <asm/arch/at91cap9.h>
-#include <asm/arch/at91sam926x_mc.h>
 #include <asm/arch/at91cap9_matrix.h>
+#include <asm/arch/at91sam9_smc.h>
 
 #include "generic.h"
 
@@ -283,10 +283,15 @@ static struct at91_nand_data nand_data;
 #define NAND_BASE      AT91_CHIPSELECT_3
 
 static struct resource nand_resources[] = {
-       {
+       [0] = {
                .start  = NAND_BASE,
                .end    = NAND_BASE + SZ_256M - 1,
                .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = AT91_BASE_SYS + AT91_ECC,
+               .end    = AT91_BASE_SYS + AT91_ECC + SZ_512 - 1,
+               .flags  = IORESOURCE_MEM,
        }
 };
 
@@ -344,6 +349,7 @@ void __init at91_add_device_nand(struct at91_nand_data *data)
 void __init at91_add_device_nand(struct at91_nand_data *data) {}
 #endif
 
+
 /* --------------------------------------------------------------------
  *  TWI (i2c)
  * -------------------------------------------------------------------- */
@@ -531,14 +537,60 @@ void __init at91_add_device_spi(struct spi_board_info *devices, int nr_devices)
 #endif
 
 
+/* --------------------------------------------------------------------
+ *  Timer/Counter block
+ * -------------------------------------------------------------------- */
+
+#ifdef CONFIG_ATMEL_TCLIB
+
+static struct resource tcb_resources[] = {
+       [0] = {
+               .start  = AT91CAP9_BASE_TCB0,
+               .end    = AT91CAP9_BASE_TCB0 + SZ_16K - 1,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = AT91CAP9_ID_TCB,
+               .end    = AT91CAP9_ID_TCB,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device at91cap9_tcb_device = {
+       .name           = "atmel_tcb",
+       .id             = 0,
+       .resource       = tcb_resources,
+       .num_resources  = ARRAY_SIZE(tcb_resources),
+};
+
+static void __init at91_add_device_tc(void)
+{
+       /* this chip has one clock and irq for all three TC channels */
+       at91_clock_associate("tcb_clk", &at91cap9_tcb_device.dev, "t0_clk");
+       platform_device_register(&at91cap9_tcb_device);
+}
+#else
+static void __init at91_add_device_tc(void) { }
+#endif
+
+
 /* --------------------------------------------------------------------
  *  RTT
  * -------------------------------------------------------------------- */
 
+static struct resource rtt_resources[] = {
+       {
+               .start  = AT91_BASE_SYS + AT91_RTT,
+               .end    = AT91_BASE_SYS + AT91_RTT + SZ_16 - 1,
+               .flags  = IORESOURCE_MEM,
+       }
+};
+
 static struct platform_device at91cap9_rtt_device = {
        .name           = "at91_rtt",
-       .id             = -1,
-       .num_resources  = 0,
+       .id             = 0,
+       .resource       = rtt_resources,
+       .num_resources  = ARRAY_SIZE(rtt_resources),
 };
 
 static void __init at91_add_device_rtt(void)
@@ -990,7 +1042,7 @@ static inline void configure_usart2_pins(unsigned pins)
                at91_set_B_periph(AT91_PIN_PD6, 0);     /* CTS2 */
 }
 
-static struct platform_device *at91_uarts[ATMEL_MAX_UART];     /* the UARTs to use */
+static struct platform_device *__initdata at91_uarts[ATMEL_MAX_UART];  /* the UARTs to use */
 struct platform_device *atmel_default_console_device;  /* the serial console device */
 
 void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins)
@@ -1031,8 +1083,6 @@ void __init at91_set_serial_console(unsigned portnr)
 {
        if (portnr < ATMEL_MAX_UART)
                atmel_default_console_device = at91_uarts[portnr];
-       if (!atmel_default_console_device)
-               printk(KERN_INFO "AT91: No default serial console defined.\n");
 }
 
 void __init at91_add_device_serial(void)
@@ -1043,6 +1093,9 @@ void __init at91_add_device_serial(void)
                if (at91_uarts[i])
                        platform_device_register(at91_uarts[i]);
        }
+
+       if (!atmel_default_console_device)
+               printk(KERN_INFO "AT91: No default serial console defined.\n");
 }
 #else
 void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins) {}
@@ -1060,6 +1113,7 @@ static int __init at91_add_standard_devices(void)
 {
        at91_add_device_rtt();
        at91_add_device_watchdog();
+       at91_add_device_tc();
        return 0;
 }
 
index ef6aeb86e9805ba402c58cc70afdece13b009419..de19bee83f758c55c4b092428b31cfdc573048ce 100644 (file)
@@ -576,6 +576,90 @@ void __init at91_add_device_spi(struct spi_board_info *devices, int nr_devices)
 #endif
 
 
+/* --------------------------------------------------------------------
+ *  Timer/Counter blocks
+ * -------------------------------------------------------------------- */
+
+#ifdef CONFIG_ATMEL_TCLIB
+
+static struct resource tcb0_resources[] = {
+       [0] = {
+               .start  = AT91RM9200_BASE_TCB0,
+               .end    = AT91RM9200_BASE_TCB0 + SZ_16K - 1,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = AT91RM9200_ID_TC0,
+               .end    = AT91RM9200_ID_TC0,
+               .flags  = IORESOURCE_IRQ,
+       },
+       [2] = {
+               .start  = AT91RM9200_ID_TC1,
+               .end    = AT91RM9200_ID_TC1,
+               .flags  = IORESOURCE_IRQ,
+       },
+       [3] = {
+               .start  = AT91RM9200_ID_TC2,
+               .end    = AT91RM9200_ID_TC2,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device at91rm9200_tcb0_device = {
+       .name           = "atmel_tcb",
+       .id             = 0,
+       .resource       = tcb0_resources,
+       .num_resources  = ARRAY_SIZE(tcb0_resources),
+};
+
+static struct resource tcb1_resources[] = {
+       [0] = {
+               .start  = AT91RM9200_BASE_TCB1,
+               .end    = AT91RM9200_BASE_TCB1 + SZ_16K - 1,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = AT91RM9200_ID_TC3,
+               .end    = AT91RM9200_ID_TC3,
+               .flags  = IORESOURCE_IRQ,
+       },
+       [2] = {
+               .start  = AT91RM9200_ID_TC4,
+               .end    = AT91RM9200_ID_TC4,
+               .flags  = IORESOURCE_IRQ,
+       },
+       [3] = {
+               .start  = AT91RM9200_ID_TC5,
+               .end    = AT91RM9200_ID_TC5,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device at91rm9200_tcb1_device = {
+       .name           = "atmel_tcb",
+       .id             = 1,
+       .resource       = tcb1_resources,
+       .num_resources  = ARRAY_SIZE(tcb1_resources),
+};
+
+static void __init at91_add_device_tc(void)
+{
+       /* this chip has a separate clock and irq for each TC channel */
+       at91_clock_associate("tc0_clk", &at91rm9200_tcb0_device.dev, "t0_clk");
+       at91_clock_associate("tc1_clk", &at91rm9200_tcb0_device.dev, "t1_clk");
+       at91_clock_associate("tc2_clk", &at91rm9200_tcb0_device.dev, "t2_clk");
+       platform_device_register(&at91rm9200_tcb0_device);
+
+       at91_clock_associate("tc3_clk", &at91rm9200_tcb1_device.dev, "t0_clk");
+       at91_clock_associate("tc4_clk", &at91rm9200_tcb1_device.dev, "t1_clk");
+       at91_clock_associate("tc5_clk", &at91rm9200_tcb1_device.dev, "t2_clk");
+       platform_device_register(&at91rm9200_tcb1_device);
+}
+#else
+static void __init at91_add_device_tc(void) { }
+#endif
+
+
 /* --------------------------------------------------------------------
  *  RTC
  * -------------------------------------------------------------------- */
@@ -1019,7 +1103,7 @@ static inline void configure_usart3_pins(unsigned pins)
                at91_set_B_periph(AT91_PIN_PB0, 0);     /* RTS3 */
 }
 
-static struct platform_device *at91_uarts[ATMEL_MAX_UART];     /* the UARTs to use */
+static struct platform_device *__initdata at91_uarts[ATMEL_MAX_UART];  /* the UARTs to use */
 struct platform_device *atmel_default_console_device;  /* the serial console device */
 
 void __init __deprecated at91_init_serial(struct at91_uart_config *config)
@@ -1110,8 +1194,6 @@ void __init at91_set_serial_console(unsigned portnr)
 {
        if (portnr < ATMEL_MAX_UART)
                atmel_default_console_device = at91_uarts[portnr];
-       if (!atmel_default_console_device)
-               printk(KERN_INFO "AT91: No default serial console defined.\n");
 }
 
 void __init at91_add_device_serial(void)
@@ -1122,6 +1204,9 @@ void __init at91_add_device_serial(void)
                if (at91_uarts[i])
                        platform_device_register(at91_uarts[i]);
        }
+
+       if (!atmel_default_console_device)
+               printk(KERN_INFO "AT91: No default serial console defined.\n");
 }
 #else
 void __init __deprecated at91_init_serial(struct at91_uart_config *config) {}
@@ -1141,6 +1226,7 @@ static int __init at91_add_standard_devices(void)
 {
        at91_add_device_rtc();
        at91_add_device_watchdog();
+       at91_add_device_tc();
        return 0;
 }
 
index 18d06612ce8a0e921d52b8451cd4eda588d6f51f..ee26550cdc21ed76923f1a869179372747ab10b1 100644 (file)
@@ -11,6 +11,7 @@
  */
 
 #include <linux/module.h>
+#include <linux/pm.h>
 
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
@@ -18,6 +19,7 @@
 #include <asm/arch/at91sam9260.h>
 #include <asm/arch/at91_pmc.h>
 #include <asm/arch/at91_rstc.h>
+#include <asm/arch/at91_shdwc.h>
 
 #include "generic.h"
 #include "clock.h"
@@ -267,6 +269,11 @@ static void at91sam9260_reset(void)
        at91_sys_write(AT91_RSTC_CR, AT91_RSTC_KEY | AT91_RSTC_PROCRST | AT91_RSTC_PERRST);
 }
 
+static void at91sam9260_poweroff(void)
+{
+       at91_sys_write(AT91_SHDW_CR, AT91_SHDW_KEY | AT91_SHDW_SHDW);
+}
+
 
 /* --------------------------------------------------------------------
  *  AT91SAM9260 processor initialization
@@ -304,6 +311,7 @@ void __init at91sam9260_initialize(unsigned long main_clock)
                iotable_init(at91sam9260_sram_desc, ARRAY_SIZE(at91sam9260_sram_desc));
 
        at91_arch_reset = at91sam9260_reset;
+       pm_power_off = at91sam9260_poweroff;
        at91_extern_irq = (1 << AT91SAM9260_ID_IRQ0) | (1 << AT91SAM9260_ID_IRQ1)
                        | (1 << AT91SAM9260_ID_IRQ2);
 
index 105f8403860bbd648842bf2e1479b165262d38fb..393a32aefce5cd167795b615e88c7efeb971477d 100644 (file)
@@ -19,8 +19,8 @@
 #include <asm/arch/board.h>
 #include <asm/arch/gpio.h>
 #include <asm/arch/at91sam9260.h>
-#include <asm/arch/at91sam926x_mc.h>
 #include <asm/arch/at91sam9260_matrix.h>
+#include <asm/arch/at91sam9_smc.h>
 
 #include "generic.h"
 
@@ -288,10 +288,15 @@ static struct at91_nand_data nand_data;
 #define NAND_BASE      AT91_CHIPSELECT_3
 
 static struct resource nand_resources[] = {
-       {
+       [0] = {
                .start  = NAND_BASE,
                .end    = NAND_BASE + SZ_256M - 1,
                .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = AT91_BASE_SYS + AT91_ECC,
+               .end    = AT91_BASE_SYS + AT91_ECC + SZ_512 - 1,
+               .flags  = IORESOURCE_MEM,
        }
 };
 
@@ -539,6 +544,90 @@ void __init at91_add_device_spi(struct spi_board_info *devices, int nr_devices)
 #endif
 
 
+/* --------------------------------------------------------------------
+ *  Timer/Counter blocks
+ * -------------------------------------------------------------------- */
+
+#ifdef CONFIG_ATMEL_TCLIB
+
+static struct resource tcb0_resources[] = {
+       [0] = {
+               .start  = AT91SAM9260_BASE_TCB0,
+               .end    = AT91SAM9260_BASE_TCB0 + SZ_16K - 1,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = AT91SAM9260_ID_TC0,
+               .end    = AT91SAM9260_ID_TC0,
+               .flags  = IORESOURCE_IRQ,
+       },
+       [2] = {
+               .start  = AT91SAM9260_ID_TC1,
+               .end    = AT91SAM9260_ID_TC1,
+               .flags  = IORESOURCE_IRQ,
+       },
+       [3] = {
+               .start  = AT91SAM9260_ID_TC2,
+               .end    = AT91SAM9260_ID_TC2,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device at91sam9260_tcb0_device = {
+       .name           = "atmel_tcb",
+       .id             = 0,
+       .resource       = tcb0_resources,
+       .num_resources  = ARRAY_SIZE(tcb0_resources),
+};
+
+static struct resource tcb1_resources[] = {
+       [0] = {
+               .start  = AT91SAM9260_BASE_TCB1,
+               .end    = AT91SAM9260_BASE_TCB1 + SZ_16K - 1,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = AT91SAM9260_ID_TC3,
+               .end    = AT91SAM9260_ID_TC3,
+               .flags  = IORESOURCE_IRQ,
+       },
+       [2] = {
+               .start  = AT91SAM9260_ID_TC4,
+               .end    = AT91SAM9260_ID_TC4,
+               .flags  = IORESOURCE_IRQ,
+       },
+       [3] = {
+               .start  = AT91SAM9260_ID_TC5,
+               .end    = AT91SAM9260_ID_TC5,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device at91sam9260_tcb1_device = {
+       .name           = "atmel_tcb",
+       .id             = 1,
+       .resource       = tcb1_resources,
+       .num_resources  = ARRAY_SIZE(tcb1_resources),
+};
+
+static void __init at91_add_device_tc(void)
+{
+       /* this chip has a separate clock and irq for each TC channel */
+       at91_clock_associate("tc0_clk", &at91sam9260_tcb0_device.dev, "t0_clk");
+       at91_clock_associate("tc1_clk", &at91sam9260_tcb0_device.dev, "t1_clk");
+       at91_clock_associate("tc2_clk", &at91sam9260_tcb0_device.dev, "t2_clk");
+       platform_device_register(&at91sam9260_tcb0_device);
+
+       at91_clock_associate("tc3_clk", &at91sam9260_tcb1_device.dev, "t0_clk");
+       at91_clock_associate("tc4_clk", &at91sam9260_tcb1_device.dev, "t1_clk");
+       at91_clock_associate("tc5_clk", &at91sam9260_tcb1_device.dev, "t2_clk");
+       platform_device_register(&at91sam9260_tcb1_device);
+}
+#else
+static void __init at91_add_device_tc(void) { }
+#endif
+
+
 /* --------------------------------------------------------------------
  *  RTT
  * -------------------------------------------------------------------- */
@@ -553,7 +642,7 @@ static struct resource rtt_resources[] = {
 
 static struct platform_device at91sam9260_rtt_device = {
        .name           = "at91_rtt",
-       .id             = -1,
+       .id             = 0,
        .resource       = rtt_resources,
        .num_resources  = ARRAY_SIZE(rtt_resources),
 };
@@ -962,64 +1051,9 @@ static inline void configure_usart5_pins(void)
        at91_set_A_periph(AT91_PIN_PB13, 0);            /* RXD5 */
 }
 
-static struct platform_device *at91_uarts[ATMEL_MAX_UART];     /* the UARTs to use */
+static struct platform_device *__initdata at91_uarts[ATMEL_MAX_UART];  /* the UARTs to use */
 struct platform_device *atmel_default_console_device;  /* the serial console device */
 
-void __init __deprecated at91_init_serial(struct at91_uart_config *config)
-{
-       int i;
-
-       /* Fill in list of supported UARTs */
-       for (i = 0; i < config->nr_tty; i++) {
-               switch (config->tty_map[i]) {
-                       case 0:
-                               configure_usart0_pins(ATMEL_UART_CTS | ATMEL_UART_RTS | ATMEL_UART_DSR | ATMEL_UART_DTR | ATMEL_UART_DCD | ATMEL_UART_RI);
-                               at91_uarts[i] = &at91sam9260_uart0_device;
-                               at91_clock_associate("usart0_clk", &at91sam9260_uart0_device.dev, "usart");
-                               break;
-                       case 1:
-                               configure_usart1_pins(ATMEL_UART_CTS | ATMEL_UART_RTS);
-                               at91_uarts[i] = &at91sam9260_uart1_device;
-                               at91_clock_associate("usart1_clk", &at91sam9260_uart1_device.dev, "usart");
-                               break;
-                       case 2:
-                               configure_usart2_pins(0);
-                               at91_uarts[i] = &at91sam9260_uart2_device;
-                               at91_clock_associate("usart2_clk", &at91sam9260_uart2_device.dev, "usart");
-                               break;
-                       case 3:
-                               configure_usart3_pins(0);
-                               at91_uarts[i] = &at91sam9260_uart3_device;
-                               at91_clock_associate("usart3_clk", &at91sam9260_uart3_device.dev, "usart");
-                               break;
-                       case 4:
-                               configure_usart4_pins();
-                               at91_uarts[i] = &at91sam9260_uart4_device;
-                               at91_clock_associate("usart4_clk", &at91sam9260_uart4_device.dev, "usart");
-                               break;
-                       case 5:
-                               configure_usart5_pins();
-                               at91_uarts[i] = &at91sam9260_uart5_device;
-                               at91_clock_associate("usart5_clk", &at91sam9260_uart5_device.dev, "usart");
-                               break;
-                       case 6:
-                               configure_dbgu_pins();
-                               at91_uarts[i] = &at91sam9260_dbgu_device;
-                               at91_clock_associate("mck", &at91sam9260_dbgu_device.dev, "usart");
-                               break;
-                       default:
-                               continue;
-               }
-               at91_uarts[i]->id = i;          /* update ID number to mapped ID */
-       }
-
-       /* Set serial console device */
-       if (config->console_tty < ATMEL_MAX_UART)
-               atmel_default_console_device = at91_uarts[config->console_tty];
-       if (!atmel_default_console_device)
-               printk(KERN_INFO "AT91: No default serial console defined.\n");
-}
-
 void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins)
 {
        struct platform_device *pdev;
@@ -1073,8 +1107,6 @@ void __init at91_set_serial_console(unsigned portnr)
 {
        if (portnr < ATMEL_MAX_UART)
                atmel_default_console_device = at91_uarts[portnr];
-       if (!atmel_default_console_device)
-               printk(KERN_INFO "AT91: No default serial console defined.\n");
 }
 
 void __init at91_add_device_serial(void)
@@ -1085,9 +1117,11 @@ void __init at91_add_device_serial(void)
                if (at91_uarts[i])
                        platform_device_register(at91_uarts[i]);
        }
+
+       if (!atmel_default_console_device)
+               printk(KERN_INFO "AT91: No default serial console defined.\n");
 }
 #else
-void __init __deprecated at91_init_serial(struct at91_uart_config *config) {}
 void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins) {}
 void __init at91_set_serial_console(unsigned portnr) {}
 void __init at91_add_device_serial(void) {}
@@ -1103,6 +1137,7 @@ static int __init at91_add_standard_devices(void)
 {
        at91_add_device_rtt();
        at91_add_device_watchdog();
+       at91_add_device_tc();
        return 0;
 }
 
index 90b87e1877d9006e7555f735c34876a401d5e3ee..35bf6fd52516d8ba20dc8a363ea0c1bf2b67929b 100644 (file)
  */
 
 #include <linux/module.h>
+#include <linux/pm.h>
 
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
 #include <asm/arch/at91sam9261.h>
 #include <asm/arch/at91_pmc.h>
 #include <asm/arch/at91_rstc.h>
+#include <asm/arch/at91_shdwc.h>
 
 #include "generic.h"
 #include "clock.h"
@@ -245,6 +247,11 @@ static void at91sam9261_reset(void)
        at91_sys_write(AT91_RSTC_CR, AT91_RSTC_KEY | AT91_RSTC_PROCRST | AT91_RSTC_PERRST);
 }
 
+static void at91sam9261_poweroff(void)
+{
+       at91_sys_write(AT91_SHDW_CR, AT91_SHDW_KEY | AT91_SHDW_SHDW);
+}
+
 
 /* --------------------------------------------------------------------
  *  AT91SAM9261 processor initialization
@@ -256,6 +263,7 @@ void __init at91sam9261_initialize(unsigned long main_clock)
        iotable_init(at91sam9261_io_desc, ARRAY_SIZE(at91sam9261_io_desc));
 
        at91_arch_reset = at91sam9261_reset;
+       pm_power_off = at91sam9261_poweroff;
        at91_extern_irq = (1 << AT91SAM9261_ID_IRQ0) | (1 << AT91SAM9261_ID_IRQ1)
                        | (1 << AT91SAM9261_ID_IRQ2);
 
index 245641263fce1cc1269d55e3b9abda85159235c5..37cd547855b1baa5dbd894b3942c35d5cebbd5cd 100644 (file)
@@ -24,7 +24,7 @@
 #include <asm/arch/gpio.h>
 #include <asm/arch/at91sam9261.h>
 #include <asm/arch/at91sam9261_matrix.h>
-#include <asm/arch/at91sam926x_mc.h>
+#include <asm/arch/at91sam9_smc.h>
 
 #include "generic.h"
 
@@ -547,6 +547,55 @@ void __init at91_add_device_lcdc(struct atmel_lcdfb_info *data) {}
 #endif
 
 
+/* --------------------------------------------------------------------
+ *  Timer/Counter block
+ * -------------------------------------------------------------------- */
+
+#ifdef CONFIG_ATMEL_TCLIB
+
+static struct resource tcb_resources[] = {
+       [0] = {
+               .start  = AT91SAM9261_BASE_TCB0,
+               .end    = AT91SAM9261_BASE_TCB0 + SZ_16K - 1,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = AT91SAM9261_ID_TC0,
+               .end    = AT91SAM9261_ID_TC0,
+               .flags  = IORESOURCE_IRQ,
+       },
+       [2] = {
+               .start  = AT91SAM9261_ID_TC1,
+               .end    = AT91SAM9261_ID_TC1,
+               .flags  = IORESOURCE_IRQ,
+       },
+       [3] = {
+               .start  = AT91SAM9261_ID_TC2,
+               .end    = AT91SAM9261_ID_TC2,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device at91sam9261_tcb_device = {
+       .name           = "atmel_tcb",
+       .id             = 0,
+       .resource       = tcb_resources,
+       .num_resources  = ARRAY_SIZE(tcb_resources),
+};
+
+static void __init at91_add_device_tc(void)
+{
+       /* this chip has a separate clock and irq for each TC channel */
+       at91_clock_associate("tc0_clk", &at91sam9261_tcb_device.dev, "t0_clk");
+       at91_clock_associate("tc1_clk", &at91sam9261_tcb_device.dev, "t1_clk");
+       at91_clock_associate("tc2_clk", &at91sam9261_tcb_device.dev, "t2_clk");
+       platform_device_register(&at91sam9261_tcb_device);
+}
+#else
+static void __init at91_add_device_tc(void) { }
+#endif
+
+
 /* --------------------------------------------------------------------
  *  RTT
  * -------------------------------------------------------------------- */
@@ -561,7 +610,7 @@ static struct resource rtt_resources[] = {
 
 static struct platform_device at91sam9261_rtt_device = {
        .name           = "at91_rtt",
-       .id             = -1,
+       .id             = 0,
        .resource       = rtt_resources,
        .num_resources  = ARRAY_SIZE(rtt_resources),
 };
@@ -938,49 +987,9 @@ static inline void configure_usart2_pins(unsigned pins)
                at91_set_B_periph(AT91_PIN_PA16, 0);    /* CTS2 */
 }
 
-static struct platform_device *at91_uarts[ATMEL_MAX_UART];     /* the UARTs to use */
+static struct platform_device *__initdata at91_uarts[ATMEL_MAX_UART];  /* the UARTs to use */
 struct platform_device *atmel_default_console_device;  /* the serial console device */
 
-void __init __deprecated at91_init_serial(struct at91_uart_config *config)
-{
-       int i;
-
-       /* Fill in list of supported UARTs */
-       for (i = 0; i < config->nr_tty; i++) {
-               switch (config->tty_map[i]) {
-                       case 0:
-                               configure_usart0_pins(ATMEL_UART_CTS | ATMEL_UART_RTS);
-                               at91_uarts[i] = &at91sam9261_uart0_device;
-                               at91_clock_associate("usart0_clk", &at91sam9261_uart0_device.dev, "usart");
-                               break;
-                       case 1:
-                               configure_usart1_pins(0);
-                               at91_uarts[i] = &at91sam9261_uart1_device;
-                               at91_clock_associate("usart1_clk", &at91sam9261_uart1_device.dev, "usart");
-                               break;
-                       case 2:
-                               configure_usart2_pins(0);
-                               at91_uarts[i] = &at91sam9261_uart2_device;
-                               at91_clock_associate("usart2_clk", &at91sam9261_uart2_device.dev, "usart");
-                               break;
-                       case 3:
-                               configure_dbgu_pins();
-                               at91_uarts[i] = &at91sam9261_dbgu_device;
-                               at91_clock_associate("mck", &at91sam9261_dbgu_device.dev, "usart");
-                               break;
-                       default:
-                               continue;
-               }
-               at91_uarts[i]->id = i;          /* update ID number to mapped ID */
-       }
-
-       /* Set serial console device */
-       if (config->console_tty < ATMEL_MAX_UART)
-               atmel_default_console_device = at91_uarts[config->console_tty];
-       if (!atmel_default_console_device)
-               printk(KERN_INFO "AT91: No default serial console defined.\n");
-}
-
 void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins)
 {
        struct platform_device *pdev;
@@ -1019,8 +1028,6 @@ void __init at91_set_serial_console(unsigned portnr)
 {
        if (portnr < ATMEL_MAX_UART)
                atmel_default_console_device = at91_uarts[portnr];
-       if (!atmel_default_console_device)
-               printk(KERN_INFO "AT91: No default serial console defined.\n");
 }
 
 void __init at91_add_device_serial(void)
@@ -1031,9 +1038,11 @@ void __init at91_add_device_serial(void)
                if (at91_uarts[i])
                        platform_device_register(at91_uarts[i]);
        }
+
+       if (!atmel_default_console_device)
+               printk(KERN_INFO "AT91: No default serial console defined.\n");
 }
 #else
-void __init __deprecated at91_init_serial(struct at91_uart_config *config) {}
 void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins) {}
 void __init at91_set_serial_console(unsigned portnr) {}
 void __init at91_add_device_serial(void) {}
@@ -1050,6 +1059,7 @@ static int __init at91_add_standard_devices(void)
 {
        at91_add_device_rtt();
        at91_add_device_watchdog();
+       at91_add_device_tc();
        return 0;
 }
 
index a53ba0f743519cd188c762e2f352eed89f44a8e8..052074a9f2d30334cada72af48903f64d5801292 100644 (file)
  */
 
 #include <linux/module.h>
+#include <linux/pm.h>
 
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
 #include <asm/arch/at91sam9263.h>
 #include <asm/arch/at91_pmc.h>
 #include <asm/arch/at91_rstc.h>
+#include <asm/arch/at91_shdwc.h>
 
 #include "generic.h"
 #include "clock.h"
@@ -271,6 +273,11 @@ static void at91sam9263_reset(void)
        at91_sys_write(AT91_RSTC_CR, AT91_RSTC_KEY | AT91_RSTC_PROCRST | AT91_RSTC_PERRST);
 }
 
+static void at91sam9263_poweroff(void)
+{
+       at91_sys_write(AT91_SHDW_CR, AT91_SHDW_KEY | AT91_SHDW_SHDW);
+}
+
 
 /* --------------------------------------------------------------------
  *  AT91SAM9263 processor initialization
@@ -282,6 +289,7 @@ void __init at91sam9263_initialize(unsigned long main_clock)
        iotable_init(at91sam9263_io_desc, ARRAY_SIZE(at91sam9263_io_desc));
 
        at91_arch_reset = at91sam9263_reset;
+       pm_power_off = at91sam9263_poweroff;
        at91_extern_irq = (1 << AT91SAM9263_ID_IRQ0) | (1 << AT91SAM9263_ID_IRQ1);
 
        /* Init clock subsystem */
index 0b12e1adcc8e6588445dd6029a9d8f0dc0ebc872..b6454c52596227a640c77b15ec3699d05fcd1b3e 100644 (file)
@@ -22,8 +22,8 @@
 #include <asm/arch/board.h>
 #include <asm/arch/gpio.h>
 #include <asm/arch/at91sam9263.h>
-#include <asm/arch/at91sam926x_mc.h>
 #include <asm/arch/at91sam9263_matrix.h>
+#include <asm/arch/at91sam9_smc.h>
 
 #include "generic.h"
 
@@ -358,10 +358,15 @@ static struct at91_nand_data nand_data;
 #define NAND_BASE      AT91_CHIPSELECT_3
 
 static struct resource nand_resources[] = {
-       {
+       [0] = {
                .start  = NAND_BASE,
                .end    = NAND_BASE + SZ_256M - 1,
                .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = AT91_BASE_SYS + AT91_ECC0,
+               .end    = AT91_BASE_SYS + AT91_ECC0 + SZ_512 - 1,
+               .flags  = IORESOURCE_MEM,
        }
 };
 
@@ -782,6 +787,43 @@ void __init at91_add_device_isi(void) {}
 #endif
 
 
+/* --------------------------------------------------------------------
+ *  Timer/Counter block
+ * -------------------------------------------------------------------- */
+
+#ifdef CONFIG_ATMEL_TCLIB
+
+static struct resource tcb_resources[] = {
+       [0] = {
+               .start  = AT91SAM9263_BASE_TCB0,
+               .end    = AT91SAM9263_BASE_TCB0 + SZ_16K - 1,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = AT91SAM9263_ID_TCB,
+               .end    = AT91SAM9263_ID_TCB,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device at91sam9263_tcb_device = {
+       .name           = "atmel_tcb",
+       .id             = 0,
+       .resource       = tcb_resources,
+       .num_resources  = ARRAY_SIZE(tcb_resources),
+};
+
+static void __init at91_add_device_tc(void)
+{
+       /* this chip has one clock and irq for all three TC channels */
+       at91_clock_associate("tcb_clk", &at91sam9263_tcb_device.dev, "t0_clk");
+       platform_device_register(&at91sam9263_tcb_device);
+}
+#else
+static void __init at91_add_device_tc(void) { }
+#endif
+
+
 /* --------------------------------------------------------------------
  *  RTT
  * -------------------------------------------------------------------- */
@@ -933,9 +975,6 @@ static inline void configure_ssc1_pins(unsigned pins)
 }
 
 /*
- * Return the device node so that board init code can use it as the
- * parent for the device node reflecting how it's used on this board.
- *
  * SSC controllers are accessed through library code, instead of any
  * kind of all-singing/all-dancing driver.  For example one could be
  * used by a particular I2S audio codec's driver, while another one
@@ -1146,49 +1185,9 @@ static inline void configure_usart2_pins(unsigned pins)
                at91_set_B_periph(AT91_PIN_PD6, 0);     /* CTS2 */
 }
 
-static struct platform_device *at91_uarts[ATMEL_MAX_UART];     /* the UARTs to use */
+static struct platform_device *__initdata at91_uarts[ATMEL_MAX_UART];  /* the UARTs to use */
 struct platform_device *atmel_default_console_device;  /* the serial console device */
 
-void __init __deprecated at91_init_serial(struct at91_uart_config *config)
-{
-       int i;
-
-       /* Fill in list of supported UARTs */
-       for (i = 0; i < config->nr_tty; i++) {
-               switch (config->tty_map[i]) {
-                       case 0:
-                               configure_usart0_pins(ATMEL_UART_CTS | ATMEL_UART_RTS);
-                               at91_uarts[i] = &at91sam9263_uart0_device;
-                               at91_clock_associate("usart0_clk", &at91sam9263_uart0_device.dev, "usart");
-                               break;
-                       case 1:
-                               configure_usart1_pins(ATMEL_UART_CTS | ATMEL_UART_RTS);
-                               at91_uarts[i] = &at91sam9263_uart1_device;
-                               at91_clock_associate("usart1_clk", &at91sam9263_uart1_device.dev, "usart");
-                               break;
-                       case 2:
-                               configure_usart2_pins(ATMEL_UART_CTS | ATMEL_UART_RTS);
-                               at91_uarts[i] = &at91sam9263_uart2_device;
-                               at91_clock_associate("usart2_clk", &at91sam9263_uart2_device.dev, "usart");
-                               break;
-                       case 3:
-                               configure_dbgu_pins();
-                               at91_uarts[i] = &at91sam9263_dbgu_device;
-                               at91_clock_associate("mck", &at91sam9263_dbgu_device.dev, "usart");
-                               break;
-                       default:
-                               continue;
-               }
-               at91_uarts[i]->id = i;          /* update ID number to mapped ID */
-       }
-
-       /* Set serial console device */
-       if (config->console_tty < ATMEL_MAX_UART)
-               atmel_default_console_device = at91_uarts[config->console_tty];
-       if (!atmel_default_console_device)
-               printk(KERN_INFO "AT91: No default serial console defined.\n");
-}
-
 void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins)
 {
        struct platform_device *pdev;
@@ -1227,8 +1226,6 @@ void __init at91_set_serial_console(unsigned portnr)
 {
        if (portnr < ATMEL_MAX_UART)
                atmel_default_console_device = at91_uarts[portnr];
-       if (!atmel_default_console_device)
-               printk(KERN_INFO "AT91: No default serial console defined.\n");
 }
 
 void __init at91_add_device_serial(void)
@@ -1239,9 +1236,11 @@ void __init at91_add_device_serial(void)
                if (at91_uarts[i])
                        platform_device_register(at91_uarts[i]);
        }
+
+       if (!atmel_default_console_device)
+               printk(KERN_INFO "AT91: No default serial console defined.\n");
 }
 #else
-void __init at91_init_serial(struct at91_uart_config *config) {}
 void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins) {}
 void __init at91_set_serial_console(unsigned portnr) {}
 void __init at91_add_device_serial(void) {}
@@ -1257,6 +1256,7 @@ static int __init at91_add_standard_devices(void)
 {
        at91_add_device_rtt();
        at91_add_device_watchdog();
+       at91_add_device_tc();
        return 0;
 }
 
index e38d237709928d2e17fc5f2fb693d96e05bdc050..5cecbd7de6a6d76b70d0cb14c0a7a210ff8932ca 100644 (file)
@@ -1,23 +1,20 @@
 /*
- * linux/arch/arm/mach-at91/at91sam926x_time.c
+ * at91sam926x_time.c - Periodic Interval Timer (PIT) for at91sam926x
  *
  * Copyright (C) 2005-2006 M. Amine SAYA, ATMEL Rousset, France
  * Revision     2005 M. Nicolas Diremdjian, ATMEL Rousset, France
+ * Converted to ClockSource/ClockEvents by David Brownell.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
  */
-
-#include <linux/init.h>
 #include <linux/interrupt.h>
 #include <linux/irq.h>
 #include <linux/kernel.h>
-#include <linux/sched.h>
-#include <linux/time.h>
+#include <linux/clk.h>
+#include <linux/clockchips.h>
 
-#include <asm/hardware.h>
-#include <asm/io.h>
 #include <asm/mach/time.h>
 
 #include <asm/arch/at91_pit.h>
 #define PIT_CPIV(x)    ((x) & AT91_PIT_CPIV)
 #define PIT_PICNT(x)   (((x) & AT91_PIT_PICNT) >> 20)
 
+static u32 pit_cycle;          /* write-once */
+static u32 pit_cnt;            /* access only w/system irq blocked */
+
+
 /*
- * Returns number of microseconds since last timer interrupt.  Note that interrupts
- * will have been disabled by do_gettimeofday()
- *  'LATCH' is hwclock ticks (see CLOCK_TICK_RATE in timex.h) per jiffy.
+ * Clocksource:  just a monotonic counter of MCK/16 cycles.
+ * We don't care whether or not PIT irqs are enabled.
  */
-static unsigned long at91sam926x_gettimeoffset(void)
+static cycle_t read_pit_clk(void)
 {
-       unsigned long elapsed;
-       unsigned long t = at91_sys_read(AT91_PIT_PIIR);
+       unsigned long flags;
+       u32 elapsed;
+       u32 t;
+
+       raw_local_irq_save(flags);
+       elapsed = pit_cnt;
+       t = at91_sys_read(AT91_PIT_PIIR);
+       raw_local_irq_restore(flags);
+
+       elapsed += PIT_PICNT(t) * pit_cycle;
+       elapsed += PIT_CPIV(t);
+       return elapsed;
+}
+
+static struct clocksource pit_clk = {
+       .name           = "pit",
+       .rating         = 175,
+       .read           = read_pit_clk,
+       .shift          = 20,
+       .flags          = CLOCK_SOURCE_IS_CONTINUOUS,
+};
 
-       elapsed = (PIT_PICNT(t) * LATCH) + PIT_CPIV(t);         /* hardware clock cycles */
 
-       return (unsigned long)(elapsed * jiffies_to_usecs(1)) / LATCH;
+/*
+ * Clockevent device:  interrupts every 1/HZ (== pit_cycles * MCK/16)
+ */
+static void
+pit_clkevt_mode(enum clock_event_mode mode, struct clock_event_device *dev)
+{
+       unsigned long   flags;
+
+       switch (mode) {
+       case CLOCK_EVT_MODE_PERIODIC:
+               /* update clocksource counter, then enable the IRQ */
+               raw_local_irq_save(flags);
+               pit_cnt += pit_cycle * PIT_PICNT(at91_sys_read(AT91_PIT_PIVR));
+               at91_sys_write(AT91_PIT_MR, (pit_cycle - 1) | AT91_PIT_PITEN
+                               | AT91_PIT_PITIEN);
+               raw_local_irq_restore(flags);
+               break;
+       case CLOCK_EVT_MODE_ONESHOT:
+               BUG();
+               /* FALLTHROUGH */
+       case CLOCK_EVT_MODE_SHUTDOWN:
+       case CLOCK_EVT_MODE_UNUSED:
+               /* disable irq, leaving the clocksource active */
+               at91_sys_write(AT91_PIT_MR, (pit_cycle - 1) | AT91_PIT_PITEN);
+               break;
+       case CLOCK_EVT_MODE_RESUME:
+               break;
+       }
 }
 
+static struct clock_event_device pit_clkevt = {
+       .name           = "pit",
+       .features       = CLOCK_EVT_FEAT_PERIODIC,
+       .shift          = 32,
+       .rating         = 100,
+       .cpumask        = CPU_MASK_CPU0,
+       .set_mode       = pit_clkevt_mode,
+};
+
+
 /*
  * IRQ handler for the timer.
  */
-static irqreturn_t at91sam926x_timer_interrupt(int irq, void *dev_id)
+static irqreturn_t at91sam926x_pit_interrupt(int irq, void *dev_id)
 {
-       volatile long nr_ticks;
 
-       if (at91_sys_read(AT91_PIT_SR) & AT91_PIT_PITS) {       /* This is a shared interrupt */
-               /* Get number to ticks performed before interrupt and clear PIT interrupt */
+       /* The PIT interrupt may be disabled, and is shared */
+       if ((pit_clkevt.mode == CLOCK_EVT_MODE_PERIODIC)
+                       && (at91_sys_read(AT91_PIT_SR) & AT91_PIT_PITS)) {
+               unsigned nr_ticks;
+
+               /* Get number of ticks performed before irq, and ack it */
                nr_ticks = PIT_PICNT(at91_sys_read(AT91_PIT_PIVR));
                do {
-                       timer_tick();
+                       pit_cnt += pit_cycle;
+                       pit_clkevt.event_handler(&pit_clkevt);
                        nr_ticks--;
                } while (nr_ticks);
 
                return IRQ_HANDLED;
-       } else
-               return IRQ_NONE;                /* not handled */
+       }
+
+       return IRQ_NONE;
 }
 
-static struct irqaction at91sam926x_timer_irq = {
+static struct irqaction at91sam926x_pit_irq = {
        .name           = "at91_tick",
        .flags          = IRQF_SHARED | IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL,
-       .handler        = at91sam926x_timer_interrupt
+       .handler        = at91sam926x_pit_interrupt
 };
 
-void at91sam926x_timer_reset(void)
+static void at91sam926x_pit_reset(void)
 {
-       /* Disable timer */
+       /* Disable timer and irqs */
        at91_sys_write(AT91_PIT_MR, 0);
 
-       /* Clear any pending interrupts */
-       (void) at91_sys_read(AT91_PIT_PIVR);
+       /* Clear any pending interrupts, wait for PIT to stop counting */
+       while (PIT_CPIV(at91_sys_read(AT91_PIT_PIVR)) != 0)
+               cpu_relax();
 
-       /* Set Period Interval timer and enable its interrupt */
-       at91_sys_write(AT91_PIT_MR, (LATCH & AT91_PIT_PIV) | AT91_PIT_PITIEN | AT91_PIT_PITEN);
+       /* Start PIT but don't enable IRQ */
+       at91_sys_write(AT91_PIT_MR, (pit_cycle - 1) | AT91_PIT_PITEN);
 }
 
 /*
- * Set up timer interrupt.
+ * Set up both clocksource and clockevent support.
  */
-void __init at91sam926x_timer_init(void)
+static void __init at91sam926x_pit_init(void)
 {
-       /* Initialize and enable the timer */
-       at91sam926x_timer_reset();
+       unsigned long   pit_rate;
+       unsigned        bits;
+
+       /*
+        * Use our actual MCK to figure out how many MCK/16 ticks per
+        * 1/HZ period (instead of a compile-time constant LATCH).
+        */
+       pit_rate = clk_get_rate(clk_get(NULL, "mck")) / 16;
+       pit_cycle = (pit_rate + HZ/2) / HZ;
+       WARN_ON(((pit_cycle - 1) & ~AT91_PIT_PIV) != 0);
 
-       /* Make IRQs happen for the system timer. */
-       setup_irq(AT91_ID_SYS, &at91sam926x_timer_irq);
+       /* Initialize and enable the timer */
+       at91sam926x_pit_reset();
+
+       /*
+        * Register clocksource.  The high order bits of PIV are unused,
+        * so this isn't a 32-bit counter unless we get clockevent irqs.
+        */
+       pit_clk.mult = clocksource_hz2mult(pit_rate, pit_clk.shift);
+       bits = 12 /* PICNT */ + ilog2(pit_cycle) /* PIV */;
+       pit_clk.mask = CLOCKSOURCE_MASK(bits);
+       clocksource_register(&pit_clk);
+
+       /* Set up irq handler */
+       setup_irq(AT91_ID_SYS, &at91sam926x_pit_irq);
+
+       /* Set up and register clockevents */
+       pit_clkevt.mult = div_sc(pit_rate, NSEC_PER_SEC, pit_clkevt.shift);
+       clockevents_register_device(&pit_clkevt);
 }
 
-#ifdef CONFIG_PM
-static void at91sam926x_timer_suspend(void)
+static void at91sam926x_pit_suspend(void)
 {
        /* Disable timer */
        at91_sys_write(AT91_PIT_MR, 0);
 }
-#else
-#define at91sam926x_timer_suspend      NULL
-#endif
 
 struct sys_timer at91sam926x_timer = {
-       .init           = at91sam926x_timer_init,
-       .offset         = at91sam926x_gettimeoffset,
-       .suspend        = at91sam926x_timer_suspend,
-       .resume         = at91sam926x_timer_reset,
+       .init           = at91sam926x_pit_init,
+       .suspend        = at91sam926x_pit_suspend,
+       .resume         = at91sam926x_pit_reset,
 };
-
index 4813a35f6cf54c63fdd517c5a3adcbc7c49726d7..902c79893ec7dfd1603230ddb25f548357929f22 100644 (file)
@@ -10,6 +10,7 @@
  */
 
 #include <linux/module.h>
+#include <linux/pm.h>
 
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
@@ -17,6 +18,7 @@
 #include <asm/arch/at91sam9rl.h>
 #include <asm/arch/at91_pmc.h>
 #include <asm/arch/at91_rstc.h>
+#include <asm/arch/at91_shdwc.h>
 
 #include "generic.h"
 #include "clock.h"
@@ -244,6 +246,11 @@ static void at91sam9rl_reset(void)
        at91_sys_write(AT91_RSTC_CR, AT91_RSTC_KEY | AT91_RSTC_PROCRST | AT91_RSTC_PERRST);
 }
 
+static void at91sam9rl_poweroff(void)
+{
+       at91_sys_write(AT91_SHDW_CR, AT91_SHDW_KEY | AT91_SHDW_SHDW);
+}
+
 
 /* --------------------------------------------------------------------
  *  AT91SAM9RL processor initialization
@@ -274,6 +281,7 @@ void __init at91sam9rl_initialize(unsigned long main_clock)
        iotable_init(at91sam9rl_sram_desc, ARRAY_SIZE(at91sam9rl_sram_desc));
 
        at91_arch_reset = at91sam9rl_reset;
+       pm_power_off = at91sam9rl_poweroff;
        at91_extern_irq = (1 << AT91SAM9RL_ID_IRQ0);
 
        /* Init clock subsystem */
index f43b5c33e45d7c77be4ecd37df3526fa6819cf8c..dbb9a5fc2090250855daa02b7d6f65a9dfce7fe3 100644 (file)
@@ -20,7 +20,7 @@
 #include <asm/arch/gpio.h>
 #include <asm/arch/at91sam9rl.h>
 #include <asm/arch/at91sam9rl_matrix.h>
-#include <asm/arch/at91sam926x_mc.h>
+#include <asm/arch/at91sam9_smc.h>
 
 #include "generic.h"
 
@@ -105,10 +105,15 @@ static struct at91_nand_data nand_data;
 #define NAND_BASE      AT91_CHIPSELECT_3
 
 static struct resource nand_resources[] = {
-       {
+       [0] = {
                .start  = NAND_BASE,
                .end    = NAND_BASE + SZ_256M - 1,
                .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = AT91_BASE_SYS + AT91_ECC,
+               .end    = AT91_BASE_SYS + AT91_ECC + SZ_512 - 1,
+               .flags  = IORESOURCE_MEM,
        }
 };
 
@@ -384,6 +389,55 @@ void __init at91_add_device_lcdc(struct atmel_lcdfb_info *data) {}
 #endif
 
 
+/* --------------------------------------------------------------------
+ *  Timer/Counter block
+ * -------------------------------------------------------------------- */
+
+#ifdef CONFIG_ATMEL_TCLIB
+
+static struct resource tcb_resources[] = {
+       [0] = {
+               .start  = AT91SAM9RL_BASE_TCB0,
+               .end    = AT91SAM9RL_BASE_TCB0 + SZ_16K - 1,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = AT91SAM9RL_ID_TC0,
+               .end    = AT91SAM9RL_ID_TC0,
+               .flags  = IORESOURCE_IRQ,
+       },
+       [2] = {
+               .start  = AT91SAM9RL_ID_TC1,
+               .end    = AT91SAM9RL_ID_TC1,
+               .flags  = IORESOURCE_IRQ,
+       },
+       [3] = {
+               .start  = AT91SAM9RL_ID_TC2,
+               .end    = AT91SAM9RL_ID_TC2,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device at91sam9rl_tcb_device = {
+       .name           = "atmel_tcb",
+       .id             = 0,
+       .resource       = tcb_resources,
+       .num_resources  = ARRAY_SIZE(tcb_resources),
+};
+
+static void __init at91_add_device_tc(void)
+{
+       /* this chip has a separate clock and irq for each TC channel */
+       at91_clock_associate("tc0_clk", &at91sam9rl_tcb_device.dev, "t0_clk");
+       at91_clock_associate("tc1_clk", &at91sam9rl_tcb_device.dev, "t1_clk");
+       at91_clock_associate("tc2_clk", &at91sam9rl_tcb_device.dev, "t2_clk");
+       platform_device_register(&at91sam9rl_tcb_device);
+}
+#else
+static void __init at91_add_device_tc(void) { }
+#endif
+
+
 /* --------------------------------------------------------------------
  *  RTC
  * -------------------------------------------------------------------- */
@@ -418,7 +472,7 @@ static struct resource rtt_resources[] = {
 
 static struct platform_device at91sam9rl_rtt_device = {
        .name           = "at91_rtt",
-       .id             = -1,
+       .id             = 0,
        .resource       = rtt_resources,
        .num_resources  = ARRAY_SIZE(rtt_resources),
 };
@@ -539,9 +593,6 @@ static inline void configure_ssc1_pins(unsigned pins)
 }
 
 /*
- * Return the device node so that board init code can use it as the
- * parent for the device node reflecting how it's used on this board.
- *
  * SSC controllers are accessed through library code, instead of any
  * kind of all-singing/all-dancing driver.  For example one could be
  * used by a particular I2S audio codec's driver, while another one
@@ -802,54 +853,9 @@ static inline void configure_usart3_pins(unsigned pins)
                at91_set_B_periph(AT91_PIN_PD3, 0);     /* CTS3 */
 }
 
-static struct platform_device *at91_uarts[ATMEL_MAX_UART];     /* the UARTs to use */
+static struct platform_device *__initdata at91_uarts[ATMEL_MAX_UART];  /* the UARTs to use */
 struct platform_device *atmel_default_console_device;  /* the serial console device */
 
-void __init __deprecated at91_init_serial(struct at91_uart_config *config)
-{
-       int i;
-
-       /* Fill in list of supported UARTs */
-       for (i = 0; i < config->nr_tty; i++) {
-               switch (config->tty_map[i]) {
-                       case 0:
-                               configure_usart0_pins(ATMEL_UART_CTS | ATMEL_UART_RTS);
-                               at91_uarts[i] = &at91sam9rl_uart0_device;
-                               at91_clock_associate("usart0_clk", &at91sam9rl_uart0_device.dev, "usart");
-                               break;
-                       case 1:
-                               configure_usart1_pins(0);
-                               at91_uarts[i] = &at91sam9rl_uart1_device;
-                               at91_clock_associate("usart1_clk", &at91sam9rl_uart1_device.dev, "usart");
-                               break;
-                       case 2:
-                               configure_usart2_pins(0);
-                               at91_uarts[i] = &at91sam9rl_uart2_device;
-                               at91_clock_associate("usart2_clk", &at91sam9rl_uart2_device.dev, "usart");
-                               break;
-                       case 3:
-                               configure_usart3_pins(0);
-                               at91_uarts[i] = &at91sam9rl_uart3_device;
-                               at91_clock_associate("usart3_clk", &at91sam9rl_uart3_device.dev, "usart");
-                               break;
-                       case 4:
-                               configure_dbgu_pins();
-                               at91_uarts[i] = &at91sam9rl_dbgu_device;
-                               at91_clock_associate("mck", &at91sam9rl_dbgu_device.dev, "usart");
-                               break;
-                       default:
-                               continue;
-               }
-               at91_uarts[i]->id = i;          /* update ID number to mapped ID */
-       }
-
-       /* Set serial console device */
-       if (config->console_tty < ATMEL_MAX_UART)
-               atmel_default_console_device = at91_uarts[config->console_tty];
-       if (!atmel_default_console_device)
-               printk(KERN_INFO "AT91: No default serial console defined.\n");
-}
-
 void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins)
 {
        struct platform_device *pdev;
@@ -893,8 +899,6 @@ void __init at91_set_serial_console(unsigned portnr)
 {
        if (portnr < ATMEL_MAX_UART)
                atmel_default_console_device = at91_uarts[portnr];
-       if (!atmel_default_console_device)
-               printk(KERN_INFO "AT91: No default serial console defined.\n");
 }
 
 void __init at91_add_device_serial(void)
@@ -905,9 +909,11 @@ void __init at91_add_device_serial(void)
                if (at91_uarts[i])
                        platform_device_register(at91_uarts[i]);
        }
+
+       if (!atmel_default_console_device)
+               printk(KERN_INFO "AT91: No default serial console defined.\n");
 }
 #else
-void __init __deprecated at91_init_serial(struct at91_uart_config *config) {}
 void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins) {}
 void __init at91_set_serial_console(unsigned portnr) {}
 void __init at91_add_device_serial(void) {}
@@ -925,6 +931,7 @@ static int __init at91_add_standard_devices(void)
        at91_add_device_rtc();
        at91_add_device_rtt();
        at91_add_device_watchdog();
+       at91_add_device_tc();
        return 0;
 }
 
diff --git a/arch/arm/mach-at91/board-cam60.c b/arch/arm/mach-at91/board-cam60.c
new file mode 100644 (file)
index 0000000..b22a1a0
--- /dev/null
@@ -0,0 +1,180 @@
+/*
+ * KwikByte CAM60 (KB9260)
+ *
+ * based on board-sam9260ek.c
+ *   Copyright (C) 2005 SAN People
+ *   Copyright (C) 2006 Atmel
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#include <linux/types.h>
+#include <linux/init.h>
+#include <linux/mm.h>
+#include <linux/module.h>
+#include <linux/platform_device.h>
+#include <linux/spi/spi.h>
+#include <linux/spi/flash.h>
+
+#include <asm/hardware.h>
+#include <asm/setup.h>
+#include <asm/mach-types.h>
+#include <asm/irq.h>
+
+#include <asm/mach/arch.h>
+#include <asm/mach/map.h>
+#include <asm/mach/irq.h>
+
+#include <asm/arch/board.h>
+#include <asm/arch/gpio.h>
+
+#include "generic.h"
+
+
+static void __init cam60_map_io(void)
+{
+       /* Initialize processor: 10 MHz crystal */
+       at91sam9260_initialize(10000000);
+
+       /* DGBU on ttyS0. (Rx & Tx only) */
+       at91_register_uart(0, 0, 0);
+
+       /* set serial console to ttyS0 (ie, DBGU) */
+       at91_set_serial_console(0);
+}
+
+static void __init cam60_init_irq(void)
+{
+       at91sam9260_init_interrupts(NULL);
+}
+
+
+/*
+ * USB Host
+ */
+static struct at91_usbh_data __initdata cam60_usbh_data = {
+       .ports          = 1,
+};
+
+
+/*
+ * SPI devices.
+ */
+#if defined(CONFIG_MTD_DATAFLASH)
+static struct mtd_partition __initdata cam60_spi_partitions[] = {
+       {
+               .name   = "BOOT1",
+               .offset = 0,
+               .size   = 4 * 1056,
+       },
+       {
+               .name   = "BOOT2",
+               .offset = MTDPART_OFS_NXTBLK,
+               .size   = 256 * 1056,
+       },
+       {
+               .name   = "kernel",
+               .offset = MTDPART_OFS_NXTBLK,
+               .size   = 2222 * 1056,
+       },
+       {
+               .name   = "file system",
+               .offset = MTDPART_OFS_NXTBLK,
+               .size   = MTDPART_SIZ_FULL,
+       },
+};
+
+static struct flash_platform_data __initdata cam60_spi_flash_platform_data = {
+       .name           = "spi_flash",
+       .parts          = cam60_spi_partitions,
+       .nr_parts       = ARRAY_SIZE(cam60_spi_partitions)
+};
+#endif
+
+static struct spi_board_info cam60_spi_devices[] = {
+#if defined(CONFIG_MTD_DATAFLASH)
+       {       /* DataFlash chip */
+               .modalias       = "mtd_dataflash",
+               .chip_select    = 0,
+               .max_speed_hz   = 15 * 1000 * 1000,
+               .bus_num        = 0,
+               .platform_data  = &cam60_spi_flash_platform_data
+       },
+#endif
+};
+
+
+/*
+ * MACB Ethernet device
+ */
+static struct __initdata at91_eth_data cam60_macb_data = {
+       .phy_irq_pin    = AT91_PIN_PB5,
+       .is_rmii        = 0,
+};
+
+
+/*
+ * NAND Flash
+ */
+static struct mtd_partition __initdata cam60_nand_partition[] = {
+       {
+               .name   = "nand_fs",
+               .offset = 0,
+               .size   = MTDPART_SIZ_FULL,
+       },
+};
+
+static struct mtd_partition * __init nand_partitions(int size, int *num_partitions)
+{
+       *num_partitions = ARRAY_SIZE(cam60_nand_partition);
+       return cam60_nand_partition;
+}
+
+static struct at91_nand_data __initdata cam60_nand_data = {
+       .ale            = 21,
+       .cle            = 22,
+       // .det_pin     = ... not there
+       .rdy_pin        = AT91_PIN_PA9,
+       .enable_pin     = AT91_PIN_PA7,
+       .partition_info = nand_partitions,
+};
+
+
+static void __init cam60_board_init(void)
+{
+       /* Serial */
+       at91_add_device_serial();
+       /* SPI */
+       at91_add_device_spi(cam60_spi_devices, ARRAY_SIZE(cam60_spi_devices));
+       /* Ethernet */
+       at91_add_device_eth(&cam60_macb_data);
+       /* USB Host */
+       /* enable USB power supply circuit */
+       at91_set_gpio_output(AT91_PIN_PB18, 1);
+       at91_add_device_usbh(&cam60_usbh_data);
+       /* NAND */
+       at91_add_device_nand(&cam60_nand_data);
+}
+
+MACHINE_START(CAM60, "KwikByte CAM60")
+       /* Maintainer: KwikByte */
+       .phys_io        = AT91_BASE_SYS,
+       .io_pg_offst    = (AT91_VA_BASE_SYS >> 18) & 0xfffc,
+       .boot_params    = AT91_SDRAM_BASE + 0x100,
+       .timer          = &at91sam926x_timer,
+       .map_io         = cam60_map_io,
+       .init_irq       = cam60_init_irq,
+       .init_machine   = cam60_board_init,
+MACHINE_END
index 1854371315411bef6dbbaac7d6b86a2e18c1cdd7..e5512d1ff21750e7593fa7ad4f183fe53baa61d7 100644 (file)
@@ -45,7 +45,7 @@
 #include <asm/arch/board.h>
 #include <asm/arch/gpio.h>
 #include <asm/arch/at91cap9_matrix.h>
-#include <asm/arch/at91sam926x_mc.h>
+#include <asm/arch/at91sam9_smc.h>
 
 #include "generic.h"
 
index 0e2a11fc5bbd587315b0a6f0a78d8ee3ef31dc25..26fea4dcc3a013edbd14f41c58c88b3b8b098e2d 100644 (file)
 #include "generic.h"
 
 
-/*
- * Serial port configuration.
- *    0 .. 3 = USART0 .. USART3
- *    4      = DBGU
- */
-static struct at91_uart_config __initdata csb337_uart_config = {
-       .console_tty    = 0,                            /* ttyS0 */
-       .nr_tty         = 2,
-       .tty_map        = { 4, 1, -1, -1, -1 }          /* ttyS0, ..., ttyS4 */
-};
-
 static void __init csb337_map_io(void)
 {
        /* Initialize processor: 3.6864 MHz crystal */
@@ -62,8 +51,11 @@ static void __init csb337_map_io(void)
        /* Setup the LEDs */
        at91_init_leds(AT91_PIN_PB0, AT91_PIN_PB1);
 
-       /* Setup the serial ports and console */
-       at91_init_serial(&csb337_uart_config);
+       /* DBGU on ttyS0 */
+       at91_register_uart(0, 0, 0);
+
+       /* make console=ttyS0 the default */
+       at91_set_serial_console(0);
 }
 
 static void __init csb337_init_irq(void)
index c5c721d27f429291d2f86efb925f2fa1e1dd07be..419fd19b620b9bbfb92bc4517d58e28f3682c213 100644 (file)
 #include "generic.h"
 
 
-/*
- * Serial port configuration.
- *    0 .. 3 = USART0 .. USART3
- *    4      = DBGU
- */
-static struct at91_uart_config __initdata csb637_uart_config = {
-       .console_tty    = 0,                            /* ttyS0 */
-       .nr_tty         = 2,
-       .tty_map        = { 4, 1, -1, -1, -1 }          /* ttyS0, ..., ttyS4 */
-};
-
 static void __init csb637_map_io(void)
 {
        /* Initialize processor: 3.6864 MHz crystal */
        at91rm9200_initialize(3686400, AT91RM9200_BGA);
 
-       /* Setup the LEDs */
-       at91_init_leds(AT91_PIN_PB2, AT91_PIN_PB2);
+       /* DBGU on ttyS0 */
+       at91_register_uart(0, 0, 0);
 
-       /* Setup the serial ports and console */
-       at91_init_serial(&csb637_uart_config);
+       /* make console=ttyS0 the default */
+       at91_set_serial_console(0);
 }
 
 static void __init csb637_init_irq(void)
@@ -118,8 +107,19 @@ static struct platform_device csb_flash = {
        .num_resources  = ARRAY_SIZE(csb_flash_resources),
 };
 
+static struct gpio_led csb_leds[] = {
+       {       /* "d1", red */
+               .name                   = "d1",
+               .gpio                   = AT91_PIN_PB2,
+               .active_low             = 1,
+               .default_trigger        = "heartbeat",
+       },
+};
+
 static void __init csb637_board_init(void)
 {
+       /* LED(s) */
+       at91_gpio_leds(csb_leds, ARRAY_SIZE(csb_leds));
        /* Serial */
        at91_add_device_serial();
        /* Ethernet */
diff --git a/arch/arm/mach-at91/board-ecbat91.c b/arch/arm/mach-at91/board-ecbat91.c
new file mode 100644 (file)
index 0000000..e77fad4
--- /dev/null
@@ -0,0 +1,178 @@
+/*
+ * linux/arch/arm/mach-at91rm9200/board-ecbat91.c
+ * Copyright (C) 2007 emQbit.com.
+ *
+ * We started from board-dk.c, which is Copyright (C) 2005 SAN People.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#include <linux/types.h>
+#include <linux/init.h>
+#include <linux/mm.h>
+#include <linux/module.h>
+#include <linux/platform_device.h>
+#include <linux/spi/spi.h>
+#include <linux/spi/flash.h>
+
+#include <asm/hardware.h>
+#include <asm/setup.h>
+#include <asm/mach-types.h>
+#include <asm/irq.h>
+
+#include <asm/mach/arch.h>
+#include <asm/mach/map.h>
+#include <asm/mach/irq.h>
+
+#include <asm/arch/board.h>
+#include <asm/arch/gpio.h>
+
+#include "generic.h"
+
+
+static void __init ecb_at91map_io(void)
+{
+       /* Initialize processor: 18.432 MHz crystal */
+       at91rm9200_initialize(18432000, AT91RM9200_PQFP);
+
+       /* Setup the LEDs */
+       at91_init_leds(AT91_PIN_PC7, AT91_PIN_PC7);
+
+       /* DBGU on ttyS0. (Rx & Tx only) */
+       at91_register_uart(0, 0, 0);
+
+       /* USART0 on ttyS1. (Rx & Tx only) */
+       at91_register_uart(AT91RM9200_ID_US0, 1, 0);
+
+       /* set serial console to ttyS0 (ie, DBGU) */
+       at91_set_serial_console(0);
+}
+
+static void __init ecb_at91init_irq(void)
+{
+       at91rm9200_init_interrupts(NULL);
+}
+
+static struct at91_eth_data __initdata ecb_at91eth_data = {
+       .phy_irq_pin    = AT91_PIN_PC4,
+       .is_rmii        = 0,
+};
+
+static struct at91_usbh_data __initdata ecb_at91usbh_data = {
+       .ports          = 1,
+};
+
+static struct at91_mmc_data __initdata ecb_at91mmc_data = {
+       .slot_b         = 0,
+       .wire4          = 1,
+};
+
+
+#if defined(CONFIG_MTD_DATAFLASH)
+static struct mtd_partition __initdata my_flash0_partitions[] =
+{
+       {       /* 0x8400 */
+               .name   = "Darrell-loader",
+               .offset = 0,
+               .size   = 12* 1056,
+       },
+       {
+               .name   = "U-boot",
+               .offset = MTDPART_OFS_NXTBLK,
+               .size   = 110 * 1056,
+       },
+       {       /* 1336 (167 blocks) pages * 1056 bytes = 0x158700 bytes */
+               .name   = "UBoot-env",
+               .offset = MTDPART_OFS_NXTBLK,
+               .size   = 8 * 1056,
+       },
+       {       /* 1336 (167 blocks) pages * 1056 bytes = 0x158700 bytes */
+               .name   = "Kernel",
+               .offset = MTDPART_OFS_NXTBLK,
+               .size   = 1534 * 1056,
+       },
+       {       /* 190200 - jffs2 root filesystem */
+               .name   = "Filesystem",
+               .offset = MTDPART_OFS_NXTBLK,
+               .size   = MTDPART_SIZ_FULL,     /* 26 sectors */
+       }
+};
+
+static struct flash_platform_data __initdata my_flash0_platform = {
+       .name           = "Removable flash card",
+       .parts          = my_flash0_partitions,
+       .nr_parts       = ARRAY_SIZE(my_flash0_partitions)
+};
+
+#endif
+
+static struct spi_board_info __initdata ecb_at91spi_devices[] = {
+       {       /* DataFlash chip */
+               .modalias       = "mtd_dataflash",
+               .chip_select    = 0,
+               .max_speed_hz   = 10 * 1000 * 1000,
+               .bus_num        = 0,
+#if defined(CONFIG_MTD_DATAFLASH)
+               .platform_data  = &my_flash0_platform,
+#endif
+       },
+       {       /* User accessable spi - cs1 (250KHz) */
+               .modalias       = "spi-cs1",
+               .chip_select    = 1,
+               .max_speed_hz   = 250 * 1000,
+       },
+       {       /* User accessable spi - cs2 (1MHz) */
+               .modalias       = "spi-cs2",
+               .chip_select    = 2,
+               .max_speed_hz   = 1 * 1000 * 1000,
+       },
+       {       /* User accessable spi - cs3 (10MHz) */
+               .modalias       = "spi-cs3",
+               .chip_select    = 3,
+               .max_speed_hz   = 10 * 1000 * 1000,
+       },
+};
+
+static void __init ecb_at91board_init(void)
+{
+       /* Serial */
+       at91_add_device_serial();
+
+       /* Ethernet */
+       at91_add_device_eth(&ecb_at91eth_data);
+
+       /* USB Host */
+       at91_add_device_usbh(&ecb_at91usbh_data);
+
+       /* I2C */
+       at91_add_device_i2c(NULL, 0);
+
+       /* MMC */
+       at91_add_device_mmc(0, &ecb_at91mmc_data);
+
+       /* SPI */
+       at91_add_device_spi(ecb_at91spi_devices, ARRAY_SIZE(ecb_at91spi_devices));
+}
+
+MACHINE_START(ECBAT91, "emQbit's ECB_AT91")
+       /* Maintainer: emQbit.com */
+       .phys_io        = AT91_BASE_SYS,
+       .io_pg_offst    = (AT91_VA_BASE_SYS >> 18) & 0xfffc,
+       .boot_params    = AT91_SDRAM_BASE + 0x100,
+       .timer          = &at91rm9200_timer,
+       .map_io         = ecb_at91map_io,
+       .init_irq       = ecb_at91init_irq,
+       .init_machine   = ecb_at91board_init,
+MACHINE_END
diff --git a/arch/arm/mach-at91/board-sam9-l9260.c b/arch/arm/mach-at91/board-sam9-l9260.c
new file mode 100644 (file)
index 0000000..8f76af5
--- /dev/null
@@ -0,0 +1,199 @@
+/*
+ * linux/arch/arm/mach-at91/board-sam9-l9260.c
+ *
+ *  Copyright (C) 2005 SAN People
+ *  Copyright (C) 2006 Atmel
+ *  Copyright (C) 2007 Olimex Ltd
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#include <linux/types.h>
+#include <linux/init.h>
+#include <linux/mm.h>
+#include <linux/module.h>
+#include <linux/platform_device.h>
+#include <linux/spi/spi.h>
+
+#include <asm/hardware.h>
+#include <asm/setup.h>
+#include <asm/mach-types.h>
+#include <asm/irq.h>
+
+#include <asm/mach/arch.h>
+#include <asm/mach/map.h>
+#include <asm/mach/irq.h>
+
+#include <asm/arch/board.h>
+#include <asm/arch/gpio.h>
+
+#include "generic.h"
+
+
+static void __init ek_map_io(void)
+{
+       /* Initialize processor: 18.432 MHz crystal */
+       at91sam9260_initialize(18432000);
+
+       /* Setup the LEDs */
+       at91_init_leds(AT91_PIN_PA9, AT91_PIN_PA6);
+
+       /* DBGU on ttyS0. (Rx & Tx only) */
+       at91_register_uart(0, 0, 0);
+
+       /* USART0 on ttyS1. (Rx, Tx, CTS, RTS, DTR, DSR, DCD, RI) */
+       at91_register_uart(AT91SAM9260_ID_US0, 1, ATMEL_UART_CTS | ATMEL_UART_RTS
+                          | ATMEL_UART_DTR | ATMEL_UART_DSR | ATMEL_UART_DCD
+                          | ATMEL_UART_RI);
+
+       /* USART1 on ttyS2. (Rx, Tx, CTS, RTS) */
+       at91_register_uart(AT91SAM9260_ID_US1, 2, ATMEL_UART_CTS | ATMEL_UART_RTS);
+
+       /* set serial console to ttyS0 (ie, DBGU) */
+       at91_set_serial_console(0);
+}
+
+static void __init ek_init_irq(void)
+{
+       at91sam9260_init_interrupts(NULL);
+}
+
+
+/*
+ * USB Host port
+ */
+static struct at91_usbh_data __initdata ek_usbh_data = {
+       .ports          = 2,
+};
+
+/*
+ * USB Device port
+ */
+static struct at91_udc_data __initdata ek_udc_data = {
+       .vbus_pin       = AT91_PIN_PC5,
+       .pullup_pin     = 0,            /* pull-up driven by UDC */
+};
+
+
+/*
+ * SPI devices.
+ */
+static struct spi_board_info ek_spi_devices[] = {
+#if !defined(CONFIG_MMC_AT91)
+       {       /* DataFlash chip */
+               .modalias       = "mtd_dataflash",
+               .chip_select    = 1,
+               .max_speed_hz   = 15 * 1000 * 1000,
+               .bus_num        = 0,
+       },
+#if defined(CONFIG_MTD_AT91_DATAFLASH_CARD)
+       {       /* DataFlash card */
+               .modalias       = "mtd_dataflash",
+               .chip_select    = 0,
+               .max_speed_hz   = 15 * 1000 * 1000,
+               .bus_num        = 0,
+       },
+#endif
+#endif
+};
+
+
+/*
+ * MACB Ethernet device
+ */
+static struct at91_eth_data __initdata ek_macb_data = {
+       .phy_irq_pin    = AT91_PIN_PA7,
+       .is_rmii        = 0,
+};
+
+
+/*
+ * NAND flash
+ */
+static struct mtd_partition __initdata ek_nand_partition[] = {
+       {
+               .name   = "Bootloader Area",
+               .offset = 0,
+               .size   = 10 * 1024 * 1024,
+       },
+       {
+               .name   = "User Area",
+               .offset = 10 * 1024 * 1024,
+               .size   = MTDPART_SIZ_FULL,
+       },
+};
+
+static struct mtd_partition * __init nand_partitions(int size, int *num_partitions)
+{
+       *num_partitions = ARRAY_SIZE(ek_nand_partition);
+       return ek_nand_partition;
+}
+
+static struct at91_nand_data __initdata ek_nand_data = {
+       .ale            = 21,
+       .cle            = 22,
+//     .det_pin        = ... not connected
+       .rdy_pin        = AT91_PIN_PC13,
+       .enable_pin     = AT91_PIN_PC14,
+       .partition_info = nand_partitions,
+#if defined(CONFIG_MTD_NAND_AT91_BUSWIDTH_16)
+       .bus_width_16   = 1,
+#else
+       .bus_width_16   = 0,
+#endif
+};
+
+
+/*
+ * MCI (SD/MMC)
+ */
+static struct at91_mmc_data __initdata ek_mmc_data = {
+       .slot_b         = 1,
+       .wire4          = 1,
+       .det_pin        = AT91_PIN_PC8,
+       .wp_pin         = AT91_PIN_PC4,
+//     .vcc_pin        = ... not connected
+};
+
+static void __init ek_board_init(void)
+{
+       /* Serial */
+       at91_add_device_serial();
+       /* USB Host */
+       at91_add_device_usbh(&ek_usbh_data);
+       /* USB Device */
+       at91_add_device_udc(&ek_udc_data);
+       /* SPI */
+       at91_add_device_spi(ek_spi_devices, ARRAY_SIZE(ek_spi_devices));
+       /* NAND */
+       at91_add_device_nand(&ek_nand_data);
+       /* Ethernet */
+       at91_add_device_eth(&ek_macb_data);
+       /* MMC */
+       at91_add_device_mmc(0, &ek_mmc_data);
+       /* I2C */
+       at91_add_device_i2c(NULL, 0);
+}
+
+MACHINE_START(SAM9_L9260, "Olimex SAM9-L9260")
+       /* Maintainer: Olimex */
+       .phys_io        = AT91_BASE_SYS,
+       .io_pg_offst    = (AT91_VA_BASE_SYS >> 18) & 0xfffc,
+       .boot_params    = AT91_SDRAM_BASE + 0x100,
+       .timer          = &at91sam926x_timer,
+       .map_io         = ek_map_io,
+       .init_irq       = ek_init_irq,
+       .init_machine   = ek_board_init,
+MACHINE_END
index b343a6c28120b2824597d11ab8754a2a699107da..4d1d9c777084dfb3f695bebcffc1b1ab8b11d2ae 100644 (file)
@@ -25,6 +25,8 @@
 #include <linux/module.h>
 #include <linux/platform_device.h>
 #include <linux/spi/spi.h>
+#include <linux/spi/at73c213.h>
+#include <linux/clk.h>
 
 #include <asm/hardware.h>
 #include <asm/setup.h>
 
 #include <asm/arch/board.h>
 #include <asm/arch/gpio.h>
-#include <asm/arch/at91sam926x_mc.h>
 
 #include "generic.h"
 
 
-/*
- * Serial port configuration.
- *    0 .. 5 = USART0 .. USART5
- *    6      = DBGU
- */
-static struct at91_uart_config __initdata ek_uart_config = {
-       .console_tty    = 0,                            /* ttyS0 */
-       .nr_tty         = 3,
-       .tty_map        = { 6, 0, 1, -1, -1, -1, -1 }   /* ttyS0, ..., ttyS6 */
-};
-
 static void __init ek_map_io(void)
 {
        /* Initialize processor: 18.432 MHz crystal */
        at91sam9260_initialize(18432000);
 
-       /* Setup the serial ports and console */
-       at91_init_serial(&ek_uart_config);
+       /* DGBU on ttyS0. (Rx & Tx only) */
+       at91_register_uart(0, 0, 0);
+
+       /* USART0 on ttyS1. (Rx, Tx, CTS, RTS, DTR, DSR, DCD, RI) */
+       at91_register_uart(AT91SAM9260_ID_US0, 1, ATMEL_UART_CTS | ATMEL_UART_RTS
+                          | ATMEL_UART_DTR | ATMEL_UART_DSR | ATMEL_UART_DCD
+                          | ATMEL_UART_RI);
+
+       /* USART1 on ttyS2. (Rx, Tx, RTS, CTS) */
+       at91_register_uart(AT91SAM9260_ID_US1, 2, ATMEL_UART_CTS | ATMEL_UART_RTS);
+
+       /* set serial console to ttyS0 (ie, DBGU) */
+       at91_set_serial_console(0);
 }
 
 static void __init ek_init_irq(void)
@@ -84,6 +85,35 @@ static struct at91_udc_data __initdata ek_udc_data = {
 };
 
 
+/*
+ * Audio
+ */
+static struct at73c213_board_info at73c213_data = {
+       .ssc_id         = 0,
+       .shortname      = "AT91SAM9260-EK external DAC",
+};
+
+#if defined(CONFIG_SND_AT73C213) || defined(CONFIG_SND_AT73C213_MODULE)
+static void __init at73c213_set_clk(struct at73c213_board_info *info)
+{
+       struct clk *pck0;
+       struct clk *plla;
+
+       pck0 = clk_get(NULL, "pck0");
+       plla = clk_get(NULL, "plla");
+
+       /* AT73C213 MCK Clock */
+       at91_set_B_periph(AT91_PIN_PC1, 0);     /* PCK0 */
+
+       clk_set_parent(pck0, plla);
+       clk_put(plla);
+
+       info->dac_clk = pck0;
+}
+#else
+static void __init at73c213_set_clk(struct at73c213_board_info *info) {}
+#endif
+
 /*
  * SPI devices.
  */
@@ -110,6 +140,8 @@ static struct spi_board_info ek_spi_devices[] = {
                .chip_select    = 0,
                .max_speed_hz   = 10 * 1000 * 1000,
                .bus_num        = 1,
+               .mode           = SPI_MODE_1,
+               .platform_data  = &at73c213_data,
        },
 #endif
 };
@@ -172,6 +204,24 @@ static struct at91_mmc_data __initdata ek_mmc_data = {
 //     .vcc_pin        = ... not connected
 };
 
+
+/*
+ * LEDs
+ */
+static struct gpio_led ek_leds[] = {
+       {       /* "bottom" led, green, userled1 to be defined */
+               .name                   = "ds5",
+               .gpio                   = AT91_PIN_PA6,
+               .active_low             = 1,
+               .default_trigger        = "none",
+       },
+       {       /* "power" led, yellow */
+               .name                   = "ds1",
+               .gpio                   = AT91_PIN_PA9,
+               .default_trigger        = "heartbeat",
+       }
+};
+
 static void __init ek_board_init(void)
 {
        /* Serial */
@@ -190,6 +240,11 @@ static void __init ek_board_init(void)
        at91_add_device_mmc(0, &ek_mmc_data);
        /* I2C */
        at91_add_device_i2c(NULL, 0);
+       /* SSC (to AT73C213) */
+       at73c213_set_clk(&at73c213_data);
+       at91_add_device_ssc(AT91SAM9260_ID_SSC, ATMEL_SSC_TX);
+       /* LEDs */
+       at91_gpio_leds(ek_leds, ARRAY_SIZE(ek_leds));
 }
 
 MACHINE_START(AT91SAM9260EK, "Atmel AT91SAM9260-EK")
index 0ce38dfa6ebe3cdc1e3140a9cc030b99707feb24..08382c0df2211401c1ccb04887a45a938901f4de 100644 (file)
@@ -26,6 +26,8 @@
 #include <linux/platform_device.h>
 #include <linux/spi/spi.h>
 #include <linux/spi/ads7846.h>
+#include <linux/spi/at73c213.h>
+#include <linux/clk.h>
 #include <linux/dm9000.h>
 #include <linux/fb.h>
 #include <linux/gpio_keys.h>
 
 #include <asm/arch/board.h>
 #include <asm/arch/gpio.h>
-#include <asm/arch/at91sam926x_mc.h>
+#include <asm/arch/at91sam9_smc.h>
 
 #include "generic.h"
 
 
-/*
- * Serial port configuration.
- *    0 .. 2 = USART0 .. USART2
- *    3      = DBGU
- */
-static struct at91_uart_config __initdata ek_uart_config = {
-       .console_tty    = 0,                            /* ttyS0 */
-       .nr_tty         = 1,
-       .tty_map        = { 3, -1, -1, -1 }             /* ttyS0, ..., ttyS3 */
-};
-
 static void __init ek_map_io(void)
 {
        /* Initialize processor: 18.432 MHz crystal */
@@ -68,8 +59,11 @@ static void __init ek_map_io(void)
        /* Setup the LEDs */
        at91_init_leds(AT91_PIN_PA13, AT91_PIN_PA14);
 
-       /* Setup the serial ports and console */
-       at91_init_serial(&ek_uart_config);
+       /* DGBU on ttyS0. (Rx & Tx only) */
+       at91_register_uart(0, 0, 0);
+
+       /* set serial console to ttyS0 (ie, DBGU) */
+       at91_set_serial_console(0);
 }
 
 static void __init ek_init_irq(void)
@@ -238,6 +232,35 @@ static void __init ek_add_device_ts(void)
 static void __init ek_add_device_ts(void) {}
 #endif
 
+/*
+ * Audio
+ */
+static struct at73c213_board_info at73c213_data = {
+       .ssc_id         = 1,
+       .shortname      = "AT91SAM9261-EK external DAC",
+};
+
+#if defined(CONFIG_SND_AT73C213) || defined(CONFIG_SND_AT73C213_MODULE)
+static void __init at73c213_set_clk(struct at73c213_board_info *info)
+{
+       struct clk *pck2;
+       struct clk *plla;
+
+       pck2 = clk_get(NULL, "pck2");
+       plla = clk_get(NULL, "plla");
+
+       /* AT73C213 MCK Clock */
+       at91_set_B_periph(AT91_PIN_PB31, 0);    /* PCK2 */
+
+       clk_set_parent(pck2, plla);
+       clk_put(plla);
+
+       info->dac_clk = pck2;
+}
+#else
+static void __init at73c213_set_clk(struct at73c213_board_info *info) {}
+#endif
+
 /*
  * SPI devices
  */
@@ -256,6 +279,7 @@ static struct spi_board_info ek_spi_devices[] = {
                .bus_num        = 0,
                .platform_data  = &ads_info,
                .irq            = AT91SAM9261_ID_IRQ0,
+               .controller_data = (void *) AT91_PIN_PA28,      /* CS pin */
        },
 #endif
 #if defined(CONFIG_MTD_AT91_DATAFLASH_CARD)
@@ -271,6 +295,9 @@ static struct spi_board_info ek_spi_devices[] = {
                .chip_select    = 3,
                .max_speed_hz   = 10 * 1000 * 1000,
                .bus_num        = 0,
+               .mode           = SPI_MODE_1,
+               .platform_data  = &at73c213_data,
+               .controller_data = (void*) AT91_PIN_PA29,       /* default for CS3 is PA6, but it must be PA29 */
        },
 #endif
 };
@@ -460,6 +487,29 @@ static void __init ek_add_device_buttons(void)
 static void __init ek_add_device_buttons(void) {}
 #endif
 
+/*
+ * LEDs
+ */
+static struct gpio_led ek_leds[] = {
+       {       /* "bottom" led, green, userled1 to be defined */
+               .name                   = "ds7",
+               .gpio                   = AT91_PIN_PA14,
+               .active_low             = 1,
+               .default_trigger        = "none",
+       },
+       {       /* "top" led, green, userled2 to be defined */
+               .name                   = "ds8",
+               .gpio                   = AT91_PIN_PA13,
+               .active_low             = 1,
+               .default_trigger        = "none",
+       },
+       {       /* "power" led, yellow */
+               .name                   = "ds1",
+               .gpio                   = AT91_PIN_PA23,
+               .default_trigger        = "heartbeat",
+       }
+};
+
 static void __init ek_board_init(void)
 {
        /* Serial */
@@ -481,6 +531,9 @@ static void __init ek_board_init(void)
        at91_add_device_spi(ek_spi_devices, ARRAY_SIZE(ek_spi_devices));
        /* Touchscreen */
        ek_add_device_ts();
+       /* SSC (to AT73C213) */
+       at73c213_set_clk(&at73c213_data);
+       at91_add_device_ssc(AT91SAM9261_ID_SSC1, ATMEL_SSC_TX);
 #else
        /* MMC */
        at91_add_device_mmc(0, &ek_mmc_data);
@@ -489,6 +542,8 @@ static void __init ek_board_init(void)
        at91_add_device_lcdc(&ek_lcdc_data);
        /* Push Buttons */
        ek_add_device_buttons();
+       /* LEDs */
+       at91_gpio_leds(ek_leds, ARRAY_SIZE(ek_leds));
 }
 
 MACHINE_START(AT91SAM9261EK, "Atmel AT91SAM9261-EK")
index bf103b24c9379e208bf395bfdc9499aea0963daa..b4cd5d0ed597ed57bbd90460b1e8b8b7797f3d2f 100644 (file)
 
 #include <asm/arch/board.h>
 #include <asm/arch/gpio.h>
-#include <asm/arch/at91sam926x_mc.h>
+#include <asm/arch/at91sam9_smc.h>
 
 #include "generic.h"
 
 
-/*
- * Serial port configuration.
- *    0 .. 2 = USART0 .. USART2
- *    3      = DBGU
- */
-static struct at91_uart_config __initdata ek_uart_config = {
-       .console_tty    = 0,                            /* ttyS0 */
-       .nr_tty         = 2,
-       .tty_map        = { 3, 0, -1, -1, }             /* ttyS0, ..., ttyS3 */
-};
-
 static void __init ek_map_io(void)
 {
        /* Initialize processor: 16.367 MHz crystal */
        at91sam9263_initialize(16367660);
 
-       /* Setup the serial ports and console */
-       at91_init_serial(&ek_uart_config);
+       /* DGBU on ttyS0. (Rx & Tx only) */
+       at91_register_uart(0, 0, 0);
+
+       /* USART0 on ttyS1. (Rx, Tx, RTS, CTS) */
+       at91_register_uart(AT91SAM9263_ID_US0, 1, ATMEL_UART_CTS | ATMEL_UART_RTS);
+
+       /* set serial console to ttyS0 (ie, DBGU) */
+       at91_set_serial_console(0);
 }
 
 static void __init ek_init_irq(void)
@@ -341,7 +336,7 @@ static struct gpio_led ek_leds[] = {
                .name                   = "ds3",
                .gpio                   = AT91_PIN_PB7,
                .default_trigger        = "heartbeat",
-       },
+       }
 };
 
 
index bc0546d7245f7b7df7f125ee4545335cbc1a0586..ffc0597aee8dfd5df7f3f5795cf53c33d4dc4c2a 100644 (file)
 
 #include <asm/arch/board.h>
 #include <asm/arch/gpio.h>
-#include <asm/arch/at91sam926x_mc.h>
+#include <asm/arch/at91sam9_smc.h>
 
 #include "generic.h"
 
 
-/*
- * Serial port configuration.
- *    0 .. 3 = USART0 .. USART3
- *    4      = DBGU
- */
-static struct at91_uart_config __initdata ek_uart_config = {
-       .console_tty    = 0,                            /* ttyS0 */
-       .nr_tty         = 2,
-       .tty_map        = { 4, 0, -1, -1, -1 }          /* ttyS0, ..., ttyS4 */
-};
-
 static void __init ek_map_io(void)
 {
        /* Initialize processor: 12.000 MHz crystal */
        at91sam9rl_initialize(12000000);
 
-       /* Setup the serial ports and console */
-       at91_init_serial(&ek_uart_config);
+       /* DGBU on ttyS0. (Rx & Tx only) */
+       at91_register_uart(0, 0, 0);
+
+       /* USART0 on ttyS1. (Rx, Tx, CTS, RTS) */
+       at91_register_uart(AT91SAM9RL_ID_US0, 1, ATMEL_UART_CTS | ATMEL_UART_RTS);
+
+       /* set serial console to ttyS0 (ie, DBGU) */
+       at91_set_serial_console(0);
 }
 
 static void __init ek_init_irq(void)
diff --git a/arch/arm/mach-at91/board-yl-9200.c b/arch/arm/mach-at91/board-yl-9200.c
new file mode 100755 (executable)
index 0000000..b571710
--- /dev/null
@@ -0,0 +1,683 @@
+/*
+ * linux/arch/arm/mach-at91/board-yl-9200.c
+ *
+ * Adapted from:
+ *various board files in
+ * /arch/arm/mach-at91
+ * modifications  to convert to  YL-9200 platform
+ *  Copyright (C) 2007 S.Birtles
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#include <linux/types.h>
+#include <linux/init.h>
+#include <linux/mm.h>
+#include <linux/module.h>
+#include <linux/platform_device.h>
+#include <linux/spi/spi.h>
+/*#include <linux/can_bus/candata.h>*/
+#include <linux/spi/ads7846.h>
+#include <linux/mtd/physmap.h>
+
+/*#include <sound/gpio_sounder.h>*/
+#include <asm/hardware.h>
+#include <asm/setup.h>
+#include <asm/mach-types.h>
+#include <asm/irq.h>
+
+#include <asm/mach/arch.h>
+#include <asm/mach/map.h>
+#include <asm/mach/irq.h>
+
+#include <asm/arch/board.h>
+#include <asm/arch/gpio.h>
+#include <asm/arch/at91rm9200_mc.h>
+#include <linux/gpio_keys.h>
+#include <linux/input.h>
+
+#include "generic.h"
+#include <asm/arch/at91_pio.h>
+
+#define YL_9200_FLASH_BASE     AT91_CHIPSELECT_0
+#define YL_9200_FLASH_SIZE     0x800000
+
+/*
+ * Serial port configuration.
+ *    0 .. 3 = USART0 .. USART3
+ *    4      = DBGU
+ *atmel_usart.0: ttyS0 at MMIO 0xfefff200 (irq = 1) is a ATMEL_SERIAL
+ *atmel_usart.1: ttyS1 at MMIO 0xfffc0000 (irq = 6) is a ATMEL_SERIAL
+ *atmel_usart.2: ttyS2 at MMIO 0xfffc4000 (irq = 7) is a ATMEL_SERIAL
+ *atmel_usart.3: ttyS3 at MMIO 0xfffc8000 (irq = 8) is a ATMEL_SERIAL
+ *atmel_usart.4: ttyS4 at MMIO 0xfffcc000 (irq = 9) is a ATMEL_SERIAL
+ * on the YL-9200 we are sitting at the following
+ *ttyS0 at MMIO 0xfefff200 (irq = 1) is a AT91_SERIAL
+ *ttyS1 at MMIO 0xfefc4000 (irq = 7) is a AT91_SERIAL
+ */
+
+/* extern void __init yl_9200_add_device_sounder(struct gpio_sounder *sounders, int nr);*/
+
+static struct at91_uart_config __initdata yl_9200_uart_config = {
+       .console_tty    = 0,                            /* ttyS0 */
+       .nr_tty         = 3,
+       .tty_map        = { 4, 1, 0, -1, -1 }           /* ttyS0, ..., ttyS4 */
+};
+
+static void __init yl_9200_map_io(void)
+{
+       /* Initialize processor: 18.432 MHz crystal */
+       /*Also initialises register clocks & gpio*/
+       at91rm9200_initialize(18432000, AT91RM9200_PQFP); /*we have a 3 bank system*/
+
+       /* Setup the serial ports and console */
+       at91_init_serial(&yl_9200_uart_config);
+
+       /* Setup the LEDs D2=PB17,D3=PB16 */
+       at91_init_leds(AT91_PIN_PB16,AT91_PIN_PB17); /*cpu-led,timer-led*/
+}
+
+static void __init yl_9200_init_irq(void)
+{
+       at91rm9200_init_interrupts(NULL);
+}
+
+static struct at91_eth_data __initdata yl_9200_eth_data = {
+       .phy_irq_pin    = AT91_PIN_PB28,
+       .is_rmii        = 1,
+};
+
+static struct at91_usbh_data __initdata yl_9200_usbh_data = {
+       .ports          = 1,  /* this should be 1 not 2 for the Yl9200*/
+};
+
+static struct at91_udc_data __initdata yl_9200_udc_data = {
+/*on sheet 7 Schemitic rev 1.0*/
+       .pullup_pin     = AT91_PIN_PC4,
+       .vbus_pin=  AT91_PIN_PC5,
+       .pullup_active_low = 1, /*ACTIVE LOW!! due to PNP transistor on page 7*/
+
+};
+/*
+static struct at91_cf_data __initdata yl_9200_cf_data = {
+TODO S.BIRTLES
+       .det_pin        = AT91_PIN_xxx,
+       .rst_pin        = AT91_PIN_xxx,
+       .irq_pin        = ... not connected
+       .vcc_pin        = ... always powered
+
+};
+*/
+static struct at91_mmc_data __initdata yl_9200_mmc_data = {
+       .det_pin        = AT91_PIN_PB9, /*THIS LOOKS CORRECT SHEET7*/
+/*     .wp_pin         = ... not connected  SHEET7*/
+       .slot_b         = 0,
+       .wire4          = 1,
+
+};
+
+/* --------------------------------------------------------------------
+ *  Touch screen
+ * -------------------------------------------------------------------- */
+#if defined(CONFIG_TOUCHSCREEN_ADS7846) || defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE)
+static int ads7843_pendown_state(void)
+{
+       return !at91_get_gpio_value(AT91_PIN_PB11);     /* Touchscreen PENIRQ */
+}
+
+static void __init at91_init_device_ts(void)
+{
+/*IMPORTANT NOTE THE SPI INTERFACE IS ALREADY CONFIGURED BY XXX_DEVICES.C
+THAT IS TO SAY THAT  MISO,MOSI,SPCK AND CS  are already configured
+we only need to enable the other datapins which are:
+PB10/RK1 BUSY
+*/
+/* Touchscreen BUSY signal ,  pin,use pullup ( TODO not currently used in the ADS7843/6.c driver)*/
+at91_set_gpio_input(AT91_PIN_PB10, 1);
+}
+
+#else
+static void __init at91_init_device_ts(void) {}
+#endif
+
+static struct ads7846_platform_data ads_info = {
+       .model                  = 7843,
+       .x_min                  = 150,
+       .x_max                  = 3830,
+       .y_min                  = 190,
+       .y_max                  = 3830,
+       .vref_delay_usecs       = 100,
+/* for a 8" touch screen*/
+       //.x_plate_ohms         = 603, //= 450, S.Birtles TODO
+       //.y_plate_ohms         = 332, //= 250, S.Birtles TODO
+/*for a 10.4" touch screen*/
+       //.x_plate_ohms         =611,
+       //.y_plate_ohms         =325,
+
+       .x_plate_ohms   = 576,
+       .y_plate_ohms   = 366,
+               //
+       .pressure_max           = 15000, /*generally nonsense on the 7843*/
+        /*number of times to send query to chip in a given run 0 equals one time (do not set to 0!! ,there is a bug in ADS 7846 code)*/
+       .debounce_max           = 1,
+       .debounce_rep           = 0,
+       .debounce_tol           = (~0),
+       .get_pendown_state      = ads7843_pendown_state,
+};
+
+/*static struct canbus_platform_data can_info = {
+       .model                  = 2510,
+};
+*/
+
+static struct spi_board_info yl_9200_spi_devices[] = {
+/*this sticks it at:
+ /sys/devices/platform/atmel_spi.0/spi0.0
+ /sys/bus/platform/devices/
+Documentation/spi IIRC*/
+
+#if defined(CONFIG_TOUCHSCREEN_ADS7846) || defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE)
+ /*(this IS correct 04-NOV-2007)*/
+       {
+               .modalias               = "ads7846", /* because the driver is called ads7846*/
+               .chip_select    = 0, /*THIS MUST BE AN INDEX INTO AN ARRAY OF  pins */
+/*this is ONLY TO BE USED if chipselect above is not used, it passes a pin directly for the chip select*/
+               /*.controller_data =AT91_PIN_PA3 ,*/
+               .max_speed_hz   = 5000*26, /*(4700 * 26)-125000 * 26, (max sample rate @ 3V) * (cmd + data + overhead) */
+               .bus_num                = 0,
+               .platform_data  = &ads_info,
+               .irq                    = AT91_PIN_PB11,
+       },
+#endif
+/*we need to put our CAN driver data here!!*/
+/*THIS IS ALL DUMMY DATA*/
+/*     {
+               .modalias               = "mcp2510", //DUMMY for MCP2510 chip
+               .chip_select    = 1,*/ /*THIS MUST BE AN INDEX INTO AN ARRAY OF  pins */
+       /*this is ONLY TO BE USED if chipselect above is not used, it passes a pin directly for the chip select */
+       /*  .controller_data =AT91_PIN_PA4 ,
+               .max_speed_hz   = 25000 * 26,
+               .bus_num                = 0,
+               .platform_data  = &can_info,
+               .irq                    = AT91_PIN_PC0,
+       },
+       */
+       //max SPI chip needs to go here
+};
+
+static struct mtd_partition __initdata yl_9200_nand_partition[] = {
+       {
+               .name   = "AT91 NAND partition 1, boot",
+               .offset = 0,
+               .size   = 1 * SZ_256K
+       },
+       {
+               .name   = "AT91 NAND partition 2, kernel",
+               .offset = 1 * SZ_256K,
+               .size   = 2 * SZ_1M - 1 * SZ_256K
+       },
+       {
+               .name   = "AT91 NAND partition 3, filesystem",
+               .offset = 2 * SZ_1M,
+               .size   = 14 * SZ_1M
+       },
+       {
+               .name   = "AT91 NAND partition 4, storage",
+               .offset = 16 * SZ_1M,
+               .size   = 16 * SZ_1M
+       },
+       {
+               .name   = "AT91 NAND partition 5, ext-fs",
+               .offset = 32 * SZ_1M,
+               .size   = 32 * SZ_1M
+       },
+};
+
+static struct mtd_partition * __init nand_partitions(int size, int *num_partitions)
+{
+       *num_partitions = ARRAY_SIZE(yl_9200_nand_partition);
+       return yl_9200_nand_partition;
+}
+
+static struct at91_nand_data __initdata yl_9200_nand_data = {
+       .ale= 6,
+       .cle= 7,
+       /*.det_pin      = AT91_PIN_PCxx,*/   /*we don't have a det pin because NandFlash is fixed to board*/
+       .rdy_pin        = AT91_PIN_PC14,  /*R/!B Sheet10*/
+       .enable_pin     = AT91_PIN_PC15,  /*!CE  Sheet10 */
+       .partition_info = nand_partitions,
+};
+
+
+
+/*
+TODO S.Birtles
+potentially a problem with the size above
+physmap platform flash device: 00800000 at 10000000
+physmap-flash.0: Found 1 x16 devices at 0x0 in 16-bit bank
+NOR chip too large to fit in mapping. Attempting to cope...
+ Intel/Sharp Extended Query Table at 0x0031
+Using buffer write method
+cfi_cmdset_0001: Erase suspend on write enabled
+Reducing visibility of 16384KiB chip to 8192KiB
+*/
+
+static struct mtd_partition yl_9200_flash_partitions[] = {
+       {
+               .name =         "Bootloader",
+               .size =         0x00040000,
+               .offset =       0,
+               .mask_flags =   MTD_WRITEABLE  /* force read-only */
+       },{
+               .name =         "Kernel",
+               .size =         0x001C0000,
+               .offset =       0x00040000,
+       },{
+               .name =         "Filesystem",
+               .size =         MTDPART_SIZ_FULL,
+               .offset =       0x00200000
+       }
+
+};
+
+static struct physmap_flash_data yl_9200_flash_data = {
+       .width  = 2,
+       .parts          = yl_9200_flash_partitions,
+       .nr_parts       = ARRAY_SIZE(yl_9200_flash_partitions),
+};
+
+static struct resource yl_9200_flash_resources[] = {
+{
+       .start          = YL_9200_FLASH_BASE,
+       .end            = YL_9200_FLASH_BASE + YL_9200_FLASH_SIZE - 1,
+       .flags          = IORESOURCE_MEM,
+       }
+};
+
+static struct platform_device yl_9200_flash = {
+       .name           = "physmap-flash",
+       .id             = 0,
+       .dev            = {
+                               .platform_data  = &yl_9200_flash_data,
+                       },
+       .resource       = yl_9200_flash_resources,
+       .num_resources  = ARRAY_SIZE(yl_9200_flash_resources),
+};
+
+
+static struct gpio_led yl_9200_leds[] = {
+/*D2 &D3 are passed directly in via at91_init_leds*/
+       {
+               .name                   = "led4",  /*D4*/
+               .gpio                   = AT91_PIN_PB15,
+               .active_low             = 1,
+               .default_trigger        = "heartbeat",
+               /*.default_trigger      = "timer",*/
+       },
+       {
+               .name                   = "led5",  /*D5*/
+               .gpio                   = AT91_PIN_PB8,
+               .active_low             = 1,
+               .default_trigger        = "heartbeat",
+       }
+};
+
+//static struct gpio_sounder yl_9200_sounder[] = {*/
+/*This is a simple speaker attached to a gpo line*/
+
+//     {
+//             .name                   = "Speaker",  /*LS1*/
+//             .gpio                   = AT91_PIN_PA22,
+//             .active_low             = 0,
+//             .default_trigger        = "heartbeat",
+               /*.default_trigger      = "timer",*/
+//     },
+//};
+
+
+
+static struct i2c_board_info __initdata yl_9200_i2c_devices[] = {
+       {
+       /*TODO*/
+               I2C_BOARD_INFO("CS4334", 0x00),
+       }
+};
+
+
+ /*
+ * GPIO Buttons
+ */
+#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
+static struct gpio_keys_button yl_9200_buttons[] = {
+       {
+               .gpio           = AT91_PIN_PA24,
+               .code   = BTN_2,
+               .desc           = "SW2",
+               .active_low     = 1,
+               .wakeup         = 1,
+       },
+       {
+               .gpio           = AT91_PIN_PB1,
+               .code   = BTN_3,
+               .desc           = "SW3",
+               .active_low     = 1,
+               .wakeup         = 1,
+       },
+       {
+               .gpio           = AT91_PIN_PB2,
+               .code   = BTN_4,
+               .desc           = "SW4",
+               .active_low     = 1,
+               .wakeup         = 1,
+       },
+       {
+               .gpio           = AT91_PIN_PB6,
+               .code   = BTN_5,
+               .desc           = "SW5",
+               .active_low     = 1,
+               .wakeup         = 1,
+       },
+
+};
+
+static struct gpio_keys_platform_data yl_9200_button_data = {
+       .buttons        = yl_9200_buttons,
+       .nbuttons       = ARRAY_SIZE(yl_9200_buttons),
+};
+
+static struct platform_device yl_9200_button_device = {
+       .name           = "gpio-keys",
+       .id             = -1,
+       .num_resources  = 0,
+       .dev            = {
+       .platform_data  = &yl_9200_button_data,
+       }
+};
+
+static void __init yl_9200_add_device_buttons(void)
+{
+       //SW2
+       at91_set_gpio_input(AT91_PIN_PA24, 0);
+       at91_set_deglitch(AT91_PIN_PA24, 1);
+
+       //SW3
+       at91_set_gpio_input(AT91_PIN_PB1, 0);
+       at91_set_deglitch(AT91_PIN_PB1, 1);
+       //SW4
+       at91_set_gpio_input(AT91_PIN_PB2, 0);
+       at91_set_deglitch(AT91_PIN_PB2, 1);
+
+       //SW5
+       at91_set_gpio_input(AT91_PIN_PB6, 0);
+       at91_set_deglitch(AT91_PIN_PB6, 1);
+
+
+       at91_set_gpio_output(AT91_PIN_PB7, 1);  /* #TURN BUTTONS ON, SHEET 5  of schematics */
+       platform_device_register(&yl_9200_button_device);
+}
+#else
+static void __init yl_9200_add_device_buttons(void) {}
+#endif
+
+#if defined(CONFIG_FB_S1D135XX) || defined(CONFIG_FB_S1D13XXX_MODULE)
+#include <video/s1d13xxxfb.h>
+
+/* EPSON S1D13806 FB (discontinued chip)*/
+/* EPSON S1D13506 FB */
+
+#define AT91_FB_REG_BASE       0x80000000L
+#define AT91_FB_REG_SIZE       0x200
+#define AT91_FB_VMEM_BASE      0x80200000L
+#define AT91_FB_VMEM_SIZE      0x200000L
+
+/*#define S1D_DISPLAY_WIDTH           640*/
+/*#define S1D_DISPLAY_HEIGHT          480*/
+
+
+static void __init yl_9200_init_video(void)
+{
+       at91_sys_write(AT91_PIOC + PIO_ASR,AT91_PIN_PC6);
+       at91_sys_write(AT91_PIOC + PIO_BSR,0);
+       at91_sys_write(AT91_PIOC + PIO_ASR,AT91_PIN_PC6);
+
+       at91_sys_write( AT91_SMC_CSR(2),
+       AT91_SMC_NWS_(0x4) |
+       AT91_SMC_WSEN |
+       AT91_SMC_TDF_(0x100) |
+       AT91_SMC_DBW
+       );
+
+
+
+}
+
+
+static struct s1d13xxxfb_regval yl_9200_s1dfb_initregs[] =
+{
+       {S1DREG_MISC,                           0x00},   /* Miscellaneous Register*/
+       {S1DREG_COM_DISP_MODE,          0x01},   /* Display Mode Register, LCD only*/
+       {S1DREG_GPIO_CNF0,                      0x00},   /* General IO Pins Configuration Register*/
+       {S1DREG_GPIO_CTL0,                      0x00},   /* General IO Pins Control Register*/
+       {S1DREG_CLK_CNF,                        0x11},   /* Memory Clock Configuration Register*/
+       {S1DREG_LCD_CLK_CNF,            0x10},   /* LCD Pixel Clock Configuration Register*/
+       {S1DREG_CRT_CLK_CNF,            0x12},   /* CRT/TV Pixel Clock Configuration Register*/
+       {S1DREG_MPLUG_CLK_CNF,          0x01},   /* MediaPlug Clock Configuration Register*/
+       {S1DREG_CPU2MEM_WST_SEL,        0x02},   /* CPU To Memory Wait State Select Register*/
+       {S1DREG_MEM_CNF,                        0x00},   /* Memory Configuration Register*/
+       {S1DREG_SDRAM_REF_RATE,         0x04},   /* DRAM Refresh Rate Register, MCLK source*/
+       {S1DREG_SDRAM_TC0,                      0x12},   /* DRAM Timings Control Register 0*/
+       {S1DREG_SDRAM_TC1,                      0x02},   /* DRAM Timings Control Register 1*/
+       {S1DREG_PANEL_TYPE,                     0x25},   /* Panel Type Register*/
+       {S1DREG_MOD_RATE,                       0x00},   /* MOD Rate Register*/
+       {S1DREG_LCD_DISP_HWIDTH,        0x4F},   /* LCD Horizontal Display Width Register*/
+       {S1DREG_LCD_NDISP_HPER,         0x13},   /* LCD Horizontal Non-Display Period Register*/
+       {S1DREG_TFT_FPLINE_START,       0x01},   /* TFT FPLINE Start Position Register*/
+       {S1DREG_TFT_FPLINE_PWIDTH,      0x0c},   /* TFT FPLINE Pulse Width Register*/
+       {S1DREG_LCD_DISP_VHEIGHT0,      0xDF},   /* LCD Vertical Display Height Register 0*/
+       {S1DREG_LCD_DISP_VHEIGHT1,      0x01},   /* LCD Vertical Display Height Register 1*/
+       {S1DREG_LCD_NDISP_VPER,         0x2c},   /* LCD Vertical Non-Display Period Register*/
+       {S1DREG_TFT_FPFRAME_START,      0x0a},   /* TFT FPFRAME Start Position Register*/
+       {S1DREG_TFT_FPFRAME_PWIDTH,     0x02},   /* TFT FPFRAME Pulse Width Register*/
+       {S1DREG_LCD_DISP_MODE,          0x05},   /* LCD Display Mode Register*/
+       {S1DREG_LCD_MISC,                       0x01},   /* LCD Miscellaneous Register*/
+       {S1DREG_LCD_DISP_START0,        0x00},   /* LCD Display Start Address Register 0*/
+       {S1DREG_LCD_DISP_START1,        0x00},   /* LCD Display Start Address Register 1*/
+       {S1DREG_LCD_DISP_START2,        0x00},   /* LCD Display Start Address Register 2*/
+       {S1DREG_LCD_MEM_OFF0,           0x80},   /* LCD Memory Address Offset Register 0*/
+       {S1DREG_LCD_MEM_OFF1,           0x02},   /* LCD Memory Address Offset Register 1*/
+       {S1DREG_LCD_PIX_PAN,            0x03},   /* LCD Pixel Panning Register*/
+       {S1DREG_LCD_DISP_FIFO_HTC,      0x00},   /* LCD Display FIFO High Threshold Control Register*/
+       {S1DREG_LCD_DISP_FIFO_LTC,      0x00},   /* LCD Display FIFO Low Threshold Control Register*/
+       {S1DREG_CRT_DISP_HWIDTH,        0x4F},   /* CRT/TV Horizontal Display Width Register*/
+       {S1DREG_CRT_NDISP_HPER,         0x13},   /* CRT/TV Horizontal Non-Display Period Register*/
+       {S1DREG_CRT_HRTC_START,         0x01},   /* CRT/TV HRTC Start Position Register*/
+       {S1DREG_CRT_HRTC_PWIDTH,        0x0B},   /* CRT/TV HRTC Pulse Width Register*/
+       {S1DREG_CRT_DISP_VHEIGHT0,      0xDF},   /* CRT/TV Vertical Display Height Register 0*/
+       {S1DREG_CRT_DISP_VHEIGHT1,      0x01},   /* CRT/TV Vertical Display Height Register 1*/
+       {S1DREG_CRT_NDISP_VPER,         0x2B},   /* CRT/TV Vertical Non-Display Period Register*/
+       {S1DREG_CRT_VRTC_START,         0x09},   /* CRT/TV VRTC Start Position Register*/
+       {S1DREG_CRT_VRTC_PWIDTH,        0x01},   /* CRT/TV VRTC Pulse Width Register*/
+       {S1DREG_TV_OUT_CTL,                     0x18},   /* TV Output Control Register */
+       {S1DREG_CRT_DISP_MODE,          0x05},   /* CRT/TV Display Mode Register, 16BPP*/
+       {S1DREG_CRT_DISP_START0,        0x00},   /* CRT/TV Display Start Address Register 0*/
+       {S1DREG_CRT_DISP_START1,        0x00},   /* CRT/TV Display Start Address Register 1*/
+       {S1DREG_CRT_DISP_START2,        0x00},   /* CRT/TV Display Start Address Register 2*/
+       {S1DREG_CRT_MEM_OFF0,           0x80},   /* CRT/TV Memory Address Offset Register 0*/
+       {S1DREG_CRT_MEM_OFF1,           0x02},   /* CRT/TV Memory Address Offset Register 1*/
+       {S1DREG_CRT_PIX_PAN,            0x00},   /* CRT/TV Pixel Panning Register*/
+       {S1DREG_CRT_DISP_FIFO_HTC,      0x00},   /* CRT/TV Display FIFO High Threshold Control Register*/
+       {S1DREG_CRT_DISP_FIFO_LTC,      0x00},   /* CRT/TV Display FIFO Low Threshold Control Register*/
+       {S1DREG_LCD_CUR_CTL,            0x00},   /* LCD Ink/Cursor Control Register*/
+       {S1DREG_LCD_CUR_START,          0x01},   /* LCD Ink/Cursor Start Address Register*/
+       {S1DREG_LCD_CUR_XPOS0,          0x00},   /* LCD Cursor X Position Register 0*/
+       {S1DREG_LCD_CUR_XPOS1,          0x00},   /* LCD Cursor X Position Register 1*/
+       {S1DREG_LCD_CUR_YPOS0,          0x00},   /* LCD Cursor Y Position Register 0*/
+       {S1DREG_LCD_CUR_YPOS1,          0x00},   /* LCD Cursor Y Position Register 1*/
+       {S1DREG_LCD_CUR_BCTL0,          0x00},   /* LCD Ink/Cursor Blue Color 0 Register*/
+       {S1DREG_LCD_CUR_GCTL0,          0x00},   /* LCD Ink/Cursor Green Color 0 Register*/
+       {S1DREG_LCD_CUR_RCTL0,          0x00},   /* LCD Ink/Cursor Red Color 0 Register*/
+       {S1DREG_LCD_CUR_BCTL1,          0x1F},   /* LCD Ink/Cursor Blue Color 1 Register*/
+       {S1DREG_LCD_CUR_GCTL1,          0x3F},   /* LCD Ink/Cursor Green Color 1 Register*/
+       {S1DREG_LCD_CUR_RCTL1,          0x1F},   /* LCD Ink/Cursor Red Color 1 Register*/
+       {S1DREG_LCD_CUR_FIFO_HTC,       0x00},   /* LCD Ink/Cursor FIFO Threshold Register*/
+       {S1DREG_CRT_CUR_CTL,            0x00},   /* CRT/TV Ink/Cursor Control Register*/
+       {S1DREG_CRT_CUR_START,          0x01},   /* CRT/TV Ink/Cursor Start Address Register*/
+       {S1DREG_CRT_CUR_XPOS0,          0x00},   /* CRT/TV Cursor X Position Register 0*/
+       {S1DREG_CRT_CUR_XPOS1,          0x00},   /* CRT/TV Cursor X Position Register 1*/
+       {S1DREG_CRT_CUR_YPOS0,          0x00},   /* CRT/TV Cursor Y Position Register 0*/
+       {S1DREG_CRT_CUR_YPOS1,          0x00},   /* CRT/TV Cursor Y Position Register 1*/
+       {S1DREG_CRT_CUR_BCTL0,          0x00},   /* CRT/TV Ink/Cursor Blue Color 0 Register*/
+       {S1DREG_CRT_CUR_GCTL0,          0x00},   /* CRT/TV Ink/Cursor Green Color 0 Register*/
+       {S1DREG_CRT_CUR_RCTL0,          0x00},   /* CRT/TV Ink/Cursor Red Color 0 Register*/
+       {S1DREG_CRT_CUR_BCTL1,          0x1F},   /* CRT/TV Ink/Cursor Blue Color 1 Register*/
+       {S1DREG_CRT_CUR_GCTL1,          0x3F},   /* CRT/TV Ink/Cursor Green Color 1 Register*/
+       {S1DREG_CRT_CUR_RCTL1,          0x1F},   /* CRT/TV Ink/Cursor Red Color 1 Register*/
+       {S1DREG_CRT_CUR_FIFO_HTC,       0x00},   /* CRT/TV Ink/Cursor FIFO Threshold Register*/
+       {S1DREG_BBLT_CTL0,                      0x00},   /* BitBlt Control Register 0*/
+       {S1DREG_BBLT_CTL1,                      0x01},   /* BitBlt Control Register 1*/
+       {S1DREG_BBLT_CC_EXP,            0x00},   /* BitBlt ROP Code/Color Expansion Register*/
+       {S1DREG_BBLT_OP,                        0x00},   /* BitBlt Operation Register*/
+       {S1DREG_BBLT_SRC_START0,        0x00},   /* BitBlt Source Start Address Register 0*/
+       {S1DREG_BBLT_SRC_START1,        0x00},   /* BitBlt Source Start Address Register 1*/
+       {S1DREG_BBLT_SRC_START2,        0x00},   /* BitBlt Source Start Address Register 2*/
+       {S1DREG_BBLT_DST_START0,        0x00},   /* BitBlt Destination Start Address Register 0*/
+       {S1DREG_BBLT_DST_START1,        0x00},   /* BitBlt Destination Start Address Register 1*/
+       {S1DREG_BBLT_DST_START2,        0x00},   /* BitBlt Destination Start Address Register 2*/
+       {S1DREG_BBLT_MEM_OFF0,          0x00},   /* BitBlt Memory Address Offset Register 0*/
+       {S1DREG_BBLT_MEM_OFF1,          0x00},   /* BitBlt Memory Address Offset Register 1*/
+       {S1DREG_BBLT_WIDTH0,            0x00},   /* BitBlt Width Register 0*/
+       {S1DREG_BBLT_WIDTH1,            0x00},   /* BitBlt Width Register 1*/
+       {S1DREG_BBLT_HEIGHT0,           0x00},   /* BitBlt Height Register 0*/
+       {S1DREG_BBLT_HEIGHT1,           0x00},   /* BitBlt Height Register 1*/
+       {S1DREG_BBLT_BGC0,                      0x00},   /* BitBlt Background Color Register 0*/
+       {S1DREG_BBLT_BGC1,                      0x00},   /* BitBlt Background Color Register 1*/
+       {S1DREG_BBLT_FGC0,                      0x00},   /* BitBlt Foreground Color Register 0*/
+       {S1DREG_BBLT_FGC1,                      0x00},   /* BitBlt Foreground Color Register 1*/
+       {S1DREG_LKUP_MODE,                      0x00},   /* Look-Up Table Mode Register*/
+       {S1DREG_LKUP_ADDR,                      0x00},   /* Look-Up Table Address Register*/
+       {S1DREG_PS_CNF,                         0x00},   /* Power Save Configuration Register*/
+       {S1DREG_PS_STATUS,                      0x00},   /* Power Save Status Register*/
+       {S1DREG_CPU2MEM_WDOGT,          0x00},   /* CPU-to-Memory Access Watchdog Timer Register*/
+       {S1DREG_COM_DISP_MODE,          0x01},   /* Display Mode Register, LCD only*/
+};
+
+static u64 s1dfb_dmamask = 0xffffffffUL;
+
+static struct s1d13xxxfb_pdata yl_9200_s1dfb_pdata = {
+               .initregs                               = yl_9200_s1dfb_initregs,
+               .initregssize                   = ARRAY_SIZE(yl_9200_s1dfb_initregs),
+               .platform_init_video    = yl_9200_init_video,
+};
+
+static struct resource yl_9200_s1dfb_resource[] = {
+       [0] = { /* video mem */
+               .name   = "s1d13xxxfb memory",
+       /*      .name   = "s1d13806 memory",*/
+               .start  = AT91_FB_VMEM_BASE,
+               .end    = AT91_FB_VMEM_BASE + AT91_FB_VMEM_SIZE -1,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = { /* video registers */
+               .name   = "s1d13xxxfb registers",
+       /*      .name   = "s1d13806 registers",*/
+               .start  = AT91_FB_REG_BASE,
+               .end    = AT91_FB_REG_BASE + AT91_FB_REG_SIZE -1,
+               .flags  = IORESOURCE_MEM,
+       },
+};
+
+static struct platform_device yl_9200_s1dfb_device = {
+       /*TODO S.Birtles , really we need the chip revision in here as well*/
+               .name           = "s1d13806fb",
+       /*  .name               = "s1d13506fb",*/
+               .id                     = -1,
+               .dev            = {
+       /*TODO theres a waring here!!*/
+       /*WARNING: vmlinux.o(.data+0x2dbc): Section mismatch: reference to .init.text: (between 'yl_9200_s1dfb_pdata' and 's1dfb_dmamask')*/
+               .dma_mask               = &s1dfb_dmamask,
+               .coherent_dma_mask      = 0xffffffff,
+               .platform_data          = &yl_9200_s1dfb_pdata,
+       },
+       .resource       = yl_9200_s1dfb_resource,
+       .num_resources  = ARRAY_SIZE(yl_9200_s1dfb_resource),
+};
+
+void __init yl_9200_add_device_video(void)
+{
+       platform_device_register(&yl_9200_s1dfb_device);
+}
+#else
+       void __init yl_9200_add_device_video(void) {}
+#endif
+
+/*this is not called first , yl_9200_map_io is called first*/
+static void __init yl_9200_board_init(void)
+{
+       /* Serial */
+       at91_add_device_serial();
+       /* Ethernet */
+       at91_add_device_eth(&yl_9200_eth_data);
+       /* USB Host */
+       at91_add_device_usbh(&yl_9200_usbh_data);
+       /* USB Device */
+       at91_add_device_udc(&yl_9200_udc_data);
+       /* pullup_pin it is  actually active low, but this is not needed, driver sets it up */
+       /*at91_set_multi_drive(yl_9200_udc_data.pullup_pin, 0);*/
+
+       /* Compact Flash */
+       /*at91_add_device_cf(&yl_9200_cf_data);*/
+
+       /* I2C */
+       at91_add_device_i2c(yl_9200_i2c_devices, ARRAY_SIZE(yl_9200_i2c_devices));
+       /* SPI */
+       /*TODO YL9200 we have 2 spi interfaces touch screen & CAN*/
+       /* AT91_PIN_PA5, AT91_PIN_PA6 , are used on the  max 485 NOT SPI*/
+
+       /*touch screen and CAN*/
+       at91_add_device_spi(yl_9200_spi_devices, ARRAY_SIZE(yl_9200_spi_devices));
+
+       /*Basically the  TS uses  PB11 & PB10 , PB11 is configured by the SPI system BP10 IS NOT USED!!*/
+       /* we need this incase the board is running without a touch screen*/
+       #if defined(CONFIG_TOUCHSCREEN_ADS7846) || defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE)
+       at91_init_device_ts(); /*init the touch screen device*/
+       #endif
+       /* DataFlash card */
+       at91_add_device_mmc(0, &yl_9200_mmc_data);
+       /* NAND */
+       at91_add_device_nand(&yl_9200_nand_data);
+       /* NOR Flash */
+       platform_device_register(&yl_9200_flash);
+       /* LEDs. Note!! this does not include the led's we passed for the processor status */
+       at91_gpio_leds(yl_9200_leds, ARRAY_SIZE(yl_9200_leds));
+       /* VGA  */
+       /*this is self registered by including the s1d13xxx chip in the kernel build*/
+       yl_9200_add_device_video();
+       /* Push Buttons */
+       yl_9200_add_device_buttons();
+       /*TODO fixup the Sounder */
+//     yl_9200_add_device_sounder(yl_9200_sounder,ARRAY_SIZE(yl_9200_sounder));
+
+}
+
+MACHINE_START(YL9200, "uCdragon YL-9200")
+       /* Maintainer: S.Birtles*/
+       .phys_io                = AT91_BASE_SYS,
+       .io_pg_offst    = (AT91_VA_BASE_SYS >> 18) & 0xfffc,
+       .boot_params    = AT91_SDRAM_BASE + 0x100,
+       .timer                  = &at91rm9200_timer,
+       .map_io                 = yl_9200_map_io,
+       .init_irq               = yl_9200_init_irq,
+       .init_machine   = yl_9200_board_init,
+MACHINE_END
index de6424e9ac0231f0123b50470d18984dd4d58888..a33dfe4507264bb9e2943f1a04699ccf7f155d76 100644 (file)
@@ -23,7 +23,6 @@
 #include <linux/delay.h>
 #include <linux/clk.h>
 
-#include <asm/semaphore.h>
 #include <asm/io.h>
 #include <asm/mach-types.h>
 
index a67defd504387a2fc610be020695323947b60333..39733b6992aa3126ee5e715dbaa0ef97faceefd3 100644 (file)
 #include <asm/mach-types.h>
 
 #include <asm/arch/at91_pmc.h>
-#include <asm/arch/at91rm9200_mc.h>
 #include <asm/arch/gpio.h>
 #include <asm/arch/cpu.h>
 
 #include "generic.h"
 
+#ifdef CONFIG_ARCH_AT91RM9200
+#include <asm/arch/at91rm9200_mc.h>
+
+/*
+ * The AT91RM9200 goes into self-refresh mode with this command, and will
+ * terminate self-refresh automatically on the next SDRAM access.
+ */
+#define sdram_selfrefresh_enable()     at91_sys_write(AT91_SDRAMC_SRR, 1)
+#define sdram_selfrefresh_disable()    do {} while (0)
+
+#elif defined(CONFIG_ARCH_AT91CAP9)
+#include <asm/arch/at91cap9_ddrsdr.h>
+
+static u32 saved_lpr;
+
+static inline void sdram_selfrefresh_enable(void)
+{
+       u32 lpr;
+
+       saved_lpr = at91_sys_read(AT91_DDRSDRC_LPR);
+
+       lpr = saved_lpr & ~AT91_DDRSDRC_LPCB;
+       at91_sys_write(AT91_DDRSDRC_LPR, lpr | AT91_DDRSDRC_LPCB_SELF_REFRESH);
+}
+
+#define sdram_selfrefresh_disable()    at91_sys_write(AT91_DDRSDRC_LPR, saved_lpr)
+
+#else
+#include <asm/arch/at91sam9_sdramc.h>
+
+static u32 saved_lpr;
+
+static inline void sdram_selfrefresh_enable(void)
+{
+       u32 lpr;
+
+       saved_lpr = at91_sys_read(AT91_SDRAMC_LPR);
+
+       lpr = saved_lpr & ~AT91_SDRAMC_LPCB;
+       at91_sys_write(AT91_SDRAMC_LPR, lpr | AT91_SDRAMC_LPCB_SELF_REFRESH);
+}
+
+#define sdram_selfrefresh_disable()    at91_sys_write(AT91_SDRAMC_LPR, saved_lpr)
+
+/*
+ * FIXME: The AT91SAM9263 has a second EBI controller which may have
+ *        additional SDRAM.  pm_slowclock.S will require a similar fix.
+ */
+
+#endif
+
+
+/*
+ * Show the reason for the previous system reset.
+ */
+#if defined(AT91_SHDWC)
+
+#include <asm/arch/at91_rstc.h>
+#include <asm/arch/at91_shdwc.h>
+
+static void __init show_reset_status(void)
+{
+       static char reset[] __initdata = "reset";
+
+       static char general[] __initdata = "general";
+       static char wakeup[] __initdata = "wakeup";
+       static char watchdog[] __initdata = "watchdog";
+       static char software[] __initdata = "software";
+       static char user[] __initdata = "user";
+       static char unknown[] __initdata = "unknown";
+
+       static char signal[] __initdata = "signal";
+       static char rtc[] __initdata = "rtc";
+       static char rtt[] __initdata = "rtt";
+       static char restore[] __initdata = "power-restored";
+
+       char *reason, *r2 = reset;
+       u32 reset_type, wake_type;
+
+       reset_type = at91_sys_read(AT91_RSTC_SR) & AT91_RSTC_RSTTYP;
+       wake_type = at91_sys_read(AT91_SHDW_SR);
+
+       switch (reset_type) {
+       case AT91_RSTC_RSTTYP_GENERAL:
+               reason = general;
+               break;
+       case AT91_RSTC_RSTTYP_WAKEUP:
+               /* board-specific code enabled the wakeup sources */
+               reason = wakeup;
+
+               /* "wakeup signal" */
+               if (wake_type & AT91_SHDW_WAKEUP0)
+                       r2 = signal;
+               else {
+                       r2 = reason;
+                       if (wake_type & AT91_SHDW_RTTWK)        /* rtt wakeup */
+                               reason = rtt;
+                       else if (wake_type & AT91_SHDW_RTCWK)   /* rtc wakeup */
+                               reason = rtc;
+                       else if (wake_type == 0)        /* power-restored wakeup */
+                               reason = restore;
+                       else                            /* unknown wakeup */
+                               reason = unknown;
+               }
+               break;
+       case AT91_RSTC_RSTTYP_WATCHDOG:
+               reason = watchdog;
+               break;
+       case AT91_RSTC_RSTTYP_SOFTWARE:
+               reason = software;
+               break;
+       case AT91_RSTC_RSTTYP_USER:
+               reason = user;
+               break;
+       default:
+               reason = unknown;
+               break;
+       }
+       pr_info("AT91: Starting after %s %s\n", reason, r2);
+}
+#else
+static void __init show_reset_status(void) {}
+#endif
+
 
 static int at91_pm_valid_state(suspend_state_t state)
 {
@@ -125,6 +248,11 @@ EXPORT_SYMBOL(at91_suspend_entering_slow_clock);
 
 static void (*slow_clock)(void);
 
+#ifdef CONFIG_AT91_SLOW_CLOCK
+extern void at91_slow_clock(void);
+extern u32 at91_slow_clock_sz;
+#endif
+
 
 static int at91_pm_enter(suspend_state_t state)
 {
@@ -158,11 +286,14 @@ static int at91_pm_enter(suspend_state_t state)
                         * turning off the main oscillator; reverse on wakeup.
                         */
                        if (slow_clock) {
+#ifdef CONFIG_AT91_SLOW_CLOCK
+                               /* copy slow_clock handler to SRAM, and call it */
+                               memcpy(slow_clock, at91_slow_clock, at91_slow_clock_sz);
+#endif
                                slow_clock();
                                break;
                        } else {
-                               /* DEVELOPMENT ONLY */
-                               pr_info("AT91: PM - no slow clock mode yet ...\n");
+                               pr_info("AT91: PM - no slow clock mode enabled ...\n");
                                /* FALLTHROUGH leaving master clock alone */
                        }
 
@@ -175,13 +306,15 @@ static int at91_pm_enter(suspend_state_t state)
                case PM_SUSPEND_STANDBY:
                        /*
                         * NOTE: the Wait-for-Interrupt instruction needs to be
-                        * in icache so the SDRAM stays in self-refresh mode until
-                        * the wakeup IRQ occurs.
+                        * in icache so no SDRAM accesses are needed until the
+                        * wakeup IRQ occurs and self-refresh is terminated.
                         */
                        asm("b 1f; .align 5; 1:");
                        asm("mcr p15, 0, r0, c7, c10, 4");      /* drain write buffer */
-                       at91_sys_write(AT91_SDRAMC_SRR, 1);     /* self-refresh mode */
-                       /* fall though to next state */
+                       sdram_selfrefresh_enable();
+                       asm("mcr p15, 0, r0, c7, c0, 4");       /* wait for interrupt */
+                       sdram_selfrefresh_disable();
+                       break;
 
                case PM_SUSPEND_ON:
                        asm("mcr p15, 0, r0, c7, c0, 4");       /* wait for interrupt */
@@ -196,6 +329,7 @@ static int at91_pm_enter(suspend_state_t state)
                        at91_sys_read(AT91_AIC_IPR) & at91_sys_read(AT91_AIC_IMR));
 
 error:
+       sdram_selfrefresh_disable();
        target_state = PM_SUSPEND_ON;
        at91_irq_resume();
        at91_gpio_resume();
@@ -220,21 +354,20 @@ static struct platform_suspend_ops at91_pm_ops ={
 
 static int __init at91_pm_init(void)
 {
-       printk("AT91: Power Management\n");
-
-#ifdef CONFIG_AT91_PM_SLOW_CLOCK
-       /* REVISIT allocations of SRAM should be dynamically managed.
-        * FIQ handlers and other components will want SRAM/TCM too...
-        */
-       slow_clock = (void *) (AT91_VA_BASE_SRAM + (3 * SZ_4K));
-       memcpy(slow_clock, at91rm9200_slow_clock, at91rm9200_slow_clock_sz);
+#ifdef CONFIG_AT91_SLOW_CLOCK
+       slow_clock = (void *) (AT91_IO_VIRT_BASE - at91_slow_clock_sz);
 #endif
 
-       /* Disable SDRAM low-power mode.  Cannot be used with self-refresh. */
+       pr_info("AT91: Power Management%s\n", (slow_clock ? " (with slow clock mode)" : ""));
+
+#ifdef CONFIG_ARCH_AT91RM9200
+       /* AT91RM9200 SDRAM low-power mode cannot be used with self-refresh. */
        at91_sys_write(AT91_SDRAMC_LPR, 0);
+#endif
 
        suspend_set_ops(&at91_pm_ops);
 
+       show_reset_status();
        return 0;
 }
 arch_initcall(at91_pm_init);
index 0e2b641268ad172d4f4a481fbeba0918dbe4a170..dbaae5f746a1ced107faf56439c7f2bf71bc845c 100644 (file)
@@ -31,6 +31,8 @@ config ARCH_EDB7211
        bool "EDB7211"
        select ISA
        select ARCH_DISCONTIGMEM_ENABLE
+       select ARCH_SPARSEMEM_ENABLE
+       select ARCH_SELECT_MEMORY_MODEL
        help
          Say Y here if you intend to run this kernel on a Cirrus Logic EDB-7211
          evaluation board.
index 0ecf99761feb0607e3496875aa0407bc3dd700c2..c1252ca9648e9d9dcb2b91d6338cba448e94c8da 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Makefile for the linux kernel.
 #
-obj-y                  := core.o clock.o
+obj-y                  := core.o clock.o gpio.o
 obj-m                  :=
 obj-n                  :=
 obj-                   :=
index 91f6a07a51d54d16d28b8111f953b9b4fe0a04a3..8bc187240542e6611f051809c233796f331fcfef 100644 (file)
@@ -159,7 +159,7 @@ static const u8 int_type2_register_offset[3]        = { 0x94, 0xb0, 0x50 };
 static const u8 eoi_register_offset[3]         = { 0x98, 0xb4, 0x54 };
 static const u8 int_en_register_offset[3]      = { 0x9c, 0xb8, 0x5c };
 
-static void update_gpio_int_params(unsigned port)
+void ep93xx_gpio_update_int_params(unsigned port)
 {
        BUG_ON(port > 2);
 
@@ -175,98 +175,10 @@ static void update_gpio_int_params(unsigned port)
                EP93XX_GPIO_REG(int_en_register_offset[port]));
 }
 
-/* Port ordering is: A B F D E C G H */
-static const u8 data_register_offset[8] = {
-       0x00, 0x04, 0x30, 0x0c, 0x20, 0x08, 0x38, 0x40,
-};
-
-static const u8 data_direction_register_offset[8] = {
-       0x10, 0x14, 0x34, 0x1c, 0x24, 0x18, 0x3c, 0x44,
-};
-
-#define GPIO_IN                0
-#define GPIO_OUT       1
-
-static void ep93xx_gpio_set_direction(unsigned line, int direction)
-{
-       unsigned int data_direction_register;
-       unsigned long flags;
-       unsigned char v;
-
-       data_direction_register =
-               EP93XX_GPIO_REG(data_direction_register_offset[line >> 3]);
-
-       local_irq_save(flags);
-       if (direction == GPIO_OUT) {
-               if (line >= 0 && line <= EP93XX_GPIO_LINE_MAX_IRQ) {
-                       /* Port A/B/F */
-                       gpio_int_unmasked[line >> 3] &= ~(1 << (line & 7));
-                       update_gpio_int_params(line >> 3);
-               }
-
-               v = __raw_readb(data_direction_register);
-               v |= 1 << (line & 7);
-               __raw_writeb(v, data_direction_register);
-       } else if (direction == GPIO_IN) {
-               v = __raw_readb(data_direction_register);
-               v &= ~(1 << (line & 7));
-               __raw_writeb(v, data_direction_register);
-       }
-       local_irq_restore(flags);
-}
-
-int gpio_direction_input(unsigned gpio)
-{
-       if (gpio > EP93XX_GPIO_LINE_MAX)
-               return -EINVAL;
-
-       ep93xx_gpio_set_direction(gpio, GPIO_IN);
-
-       return 0;
-}
-EXPORT_SYMBOL(gpio_direction_input);
-
-int gpio_direction_output(unsigned gpio, int value)
-{
-       if (gpio > EP93XX_GPIO_LINE_MAX)
-               return -EINVAL;
-
-       gpio_set_value(gpio, value);
-       ep93xx_gpio_set_direction(gpio, GPIO_OUT);
-
-       return 0;
-}
-EXPORT_SYMBOL(gpio_direction_output);
-
-int gpio_get_value(unsigned gpio)
-{
-       unsigned int data_register;
-
-       data_register = EP93XX_GPIO_REG(data_register_offset[gpio >> 3]);
-
-       return !!(__raw_readb(data_register) & (1 << (gpio & 7)));
-}
-EXPORT_SYMBOL(gpio_get_value);
-
-void gpio_set_value(unsigned gpio, int value)
+void ep93xx_gpio_int_mask(unsigned line)
 {
-       unsigned int data_register;
-       unsigned long flags;
-       unsigned char v;
-
-       data_register = EP93XX_GPIO_REG(data_register_offset[gpio >> 3]);
-
-       local_irq_save(flags);
-       v = __raw_readb(data_register);
-       if (value)
-               v |= 1 << (gpio & 7);
-       else
-               v &= ~(1 << (gpio & 7));
-       __raw_writeb(v, data_register);
-       local_irq_restore(flags);
+       gpio_int_unmasked[line >> 3] &= ~(1 << (line & 7));
 }
-EXPORT_SYMBOL(gpio_set_value);
-
 
 /*************************************************************************
  * EP93xx IRQ handling
@@ -316,7 +228,7 @@ static void ep93xx_gpio_irq_ack(unsigned int irq)
 
        if ((irq_desc[irq].status & IRQ_TYPE_SENSE_MASK) == IRQT_BOTHEDGE) {
                gpio_int_type2[port] ^= port_mask; /* switch edge direction */
-               update_gpio_int_params(port);
+               ep93xx_gpio_update_int_params(port);
        }
 
        __raw_writeb(port_mask, EP93XX_GPIO_REG(eoi_register_offset[port]));
@@ -332,7 +244,7 @@ static void ep93xx_gpio_irq_mask_ack(unsigned int irq)
                gpio_int_type2[port] ^= port_mask; /* switch edge direction */
 
        gpio_int_unmasked[port] &= ~port_mask;
-       update_gpio_int_params(port);
+       ep93xx_gpio_update_int_params(port);
 
        __raw_writeb(port_mask, EP93XX_GPIO_REG(eoi_register_offset[port]));
 }
@@ -343,7 +255,7 @@ static void ep93xx_gpio_irq_mask(unsigned int irq)
        int port = line >> 3;
 
        gpio_int_unmasked[port] &= ~(1 << (line & 7));
-       update_gpio_int_params(port);
+       ep93xx_gpio_update_int_params(port);
 }
 
 static void ep93xx_gpio_irq_unmask(unsigned int irq)
@@ -352,7 +264,7 @@ static void ep93xx_gpio_irq_unmask(unsigned int irq)
        int port = line >> 3;
 
        gpio_int_unmasked[port] |= 1 << (line & 7);
-       update_gpio_int_params(port);
+       ep93xx_gpio_update_int_params(port);
 }
 
 
@@ -368,7 +280,7 @@ static int ep93xx_gpio_irq_type(unsigned int irq, unsigned int type)
        const int port = gpio >> 3;
        const int port_mask = 1 << (gpio & 7);
 
-       ep93xx_gpio_set_direction(gpio, GPIO_IN);
+       gpio_direction_output(gpio, gpio_get_value(gpio));
 
        switch (type) {
        case IRQT_RISING:
@@ -411,7 +323,7 @@ static int ep93xx_gpio_irq_type(unsigned int irq, unsigned int type)
        desc->status &= ~IRQ_TYPE_SENSE_MASK;
        desc->status |= type & IRQ_TYPE_SENSE_MASK;
 
-       update_gpio_int_params(port);
+       ep93xx_gpio_update_int_params(port);
 
        return 0;
 }
@@ -549,6 +461,7 @@ static struct platform_device ep93xx_ohci_device = {
        .resource       = ep93xx_ohci_resources,
 };
 
+extern void ep93xx_gpio_init(void);
 
 void __init ep93xx_init_devices(void)
 {
@@ -562,6 +475,8 @@ void __init ep93xx_init_devices(void)
        __raw_writel(0xaa, EP93XX_SYSCON_SWLOCK);
        __raw_writel(v, EP93XX_SYSCON_DEVICE_CONFIG);
 
+       ep93xx_gpio_init();
+
        amba_device_register(&uart1_device, &iomem_resource);
        amba_device_register(&uart2_device, &iomem_resource);
        amba_device_register(&uart3_device, &iomem_resource);
diff --git a/arch/arm/mach-ep93xx/gpio.c b/arch/arm/mach-ep93xx/gpio.c
new file mode 100644 (file)
index 0000000..dc2e4c0
--- /dev/null
@@ -0,0 +1,158 @@
+/*
+ * linux/arch/arm/mach-ep93xx/gpio.c
+ *
+ * Generic EP93xx GPIO handling
+ *
+ * Copyright (c) 2008 Ryan Mallon <ryan@bluewatersys.com>
+ *
+ * Based on code originally from:
+ *  linux/arch/arm/mach-ep93xx/core.c
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License version 2 as
+ *  published by the Free Software Foundation.
+ */
+
+#include <linux/init.h>
+#include <linux/module.h>
+#include <linux/seq_file.h>
+
+#include <asm/arch/ep93xx-regs.h>
+#include <asm/io.h>
+#include <asm/gpio.h>
+
+struct ep93xx_gpio_chip {
+       struct gpio_chip        chip;
+
+       unsigned int            data_reg;
+       unsigned int            data_dir_reg;
+};
+
+#define to_ep93xx_gpio_chip(c) container_of(c, struct ep93xx_gpio_chip, chip)
+
+/* From core.c */
+extern void ep93xx_gpio_int_mask(unsigned line);
+extern void ep93xx_gpio_update_int_params(unsigned port);
+
+static int ep93xx_gpio_direction_input(struct gpio_chip *chip, unsigned offset)
+{
+       struct ep93xx_gpio_chip *ep93xx_chip = to_ep93xx_gpio_chip(chip);
+       unsigned long flags;
+       u8 v;
+
+       local_irq_save(flags);
+       v = __raw_readb(ep93xx_chip->data_dir_reg);
+       v &= ~(1 << offset);
+       __raw_writeb(v, ep93xx_chip->data_dir_reg);
+       local_irq_restore(flags);
+
+       return 0;
+}
+
+static int ep93xx_gpio_direction_output(struct gpio_chip *chip,
+                                       unsigned offset, int val)
+{
+       struct ep93xx_gpio_chip *ep93xx_chip = to_ep93xx_gpio_chip(chip);
+       unsigned long flags;
+       int line;
+       u8 v;
+
+       local_irq_save(flags);
+
+       /* Set the value */
+       v = __raw_readb(ep93xx_chip->data_reg);
+       if (val)
+               v |= (1 << offset);
+       else
+               v &= ~(1 << offset);
+       __raw_writeb(v, ep93xx_chip->data_reg);
+
+       /* Drive as an output */
+       line = chip->base + offset;
+       if (line <= EP93XX_GPIO_LINE_MAX_IRQ) {
+               /* Ports A/B/F */
+               ep93xx_gpio_int_mask(line);
+               ep93xx_gpio_update_int_params(line >> 3);
+       }
+
+       v = __raw_readb(ep93xx_chip->data_dir_reg);
+       v |= (1 << offset);
+       __raw_writeb(v, ep93xx_chip->data_dir_reg);
+
+       local_irq_restore(flags);
+
+       return 0;
+}
+
+static int ep93xx_gpio_get(struct gpio_chip *chip, unsigned offset)
+{
+       struct ep93xx_gpio_chip *ep93xx_chip = to_ep93xx_gpio_chip(chip);
+
+       return !!(__raw_readb(ep93xx_chip->data_reg) & (1 << offset));
+}
+
+static void ep93xx_gpio_set(struct gpio_chip *chip, unsigned offset, int val)
+{
+       struct ep93xx_gpio_chip *ep93xx_chip = to_ep93xx_gpio_chip(chip);
+       unsigned long flags;
+       u8 v;
+
+       local_irq_save(flags);
+       v = __raw_readb(ep93xx_chip->data_reg);
+       if (val)
+               v |= (1 << offset);
+       else
+               v &= ~(1 << offset);
+       __raw_writeb(v, ep93xx_chip->data_reg);
+       local_irq_restore(flags);
+}
+
+static void ep93xx_gpio_dbg_show(struct seq_file *s, struct gpio_chip *chip)
+{
+       struct ep93xx_gpio_chip *ep93xx_chip = to_ep93xx_gpio_chip(chip);
+       u8 data_reg, data_dir_reg;
+       int i;
+
+       data_reg = __raw_readb(ep93xx_chip->data_reg);
+       data_dir_reg = __raw_readb(ep93xx_chip->data_dir_reg);
+
+       for (i = 0; i < chip->ngpio; i++)
+               seq_printf(s, "GPIO %s%d: %s %s\n", chip->label, i,
+                          (data_reg & (1 << i)) ? "set" : "clear",
+                          (data_dir_reg & (1 << i)) ? "out" : "in");
+}
+
+#define EP93XX_GPIO_BANK(name, dr, ddr, base_gpio)                     \
+       {                                                               \
+               .chip = {                                               \
+                       .label            = name,                       \
+                       .direction_input  = ep93xx_gpio_direction_input, \
+                       .direction_output = ep93xx_gpio_direction_output, \
+                       .get              = ep93xx_gpio_get,            \
+                       .set              = ep93xx_gpio_set,            \
+                       .dbg_show         = ep93xx_gpio_dbg_show,       \
+                       .base             = base_gpio,                  \
+                       .ngpio            = 8,                          \
+               },                                                      \
+               .data_reg       = EP93XX_GPIO_REG(dr),                  \
+               .data_dir_reg   = EP93XX_GPIO_REG(ddr),                 \
+       }
+
+static struct ep93xx_gpio_chip ep93xx_gpio_banks[] = {
+       EP93XX_GPIO_BANK("A", 0x00, 0x10, 0),
+       EP93XX_GPIO_BANK("B", 0x04, 0x14, 8),
+       EP93XX_GPIO_BANK("C", 0x30, 0x34, 40),
+       EP93XX_GPIO_BANK("D", 0x0c, 0x1c, 24),
+       EP93XX_GPIO_BANK("E", 0x20, 0x24, 32),
+       EP93XX_GPIO_BANK("F", 0x08, 0x18, 16),
+       EP93XX_GPIO_BANK("G", 0x38, 0x3c, 48),
+       EP93XX_GPIO_BANK("H", 0x40, 0x44, 56),
+};
+
+void __init ep93xx_gpio_init(void)
+{
+       int i;
+
+       for (i = 0; i < ARRAY_SIZE(ep93xx_gpio_banks); i++)
+               gpiochip_add(&ep93xx_gpio_banks[i].chip);
+}
index 95a1e263f7fa59e488adecdba1f0637005528471..8d761fdd2ecdaf3b44ea2e0f926f581963780766 100644 (file)
@@ -17,7 +17,6 @@
 #include <linux/clk.h>
 #include <linux/mutex.h>
 
-#include <asm/semaphore.h>
 #include <asm/hardware/icst525.h>
 
 #include "clock.h"
index 5278f589fcee29ea4204bc44be9adc9a8b41835b..5235f64f235b87f4b66355025a3d06a86dcaedfc 100644 (file)
@@ -125,7 +125,7 @@ static int rtc_probe(struct amba_device *dev, void *id)
        xtime.tv_sec = __raw_readl(rtc_base + RTC_DR);
 
        ret = request_irq(dev->irq[0], arm_rtc_interrupt, IRQF_DISABLED,
-                         "rtc-pl030", dev);
+                         "rtc-pl030", NULL);
        if (ret)
                goto map_out;
 
index dbe07c9472edcc41130d0ba0a523cdf3e8e31fac..5e8c6f7dfabb4cc8c351316ab50ffd6a32988204 100644 (file)
@@ -34,14 +34,6 @@ config MACH_N2100
          Say Y here if you want to run your kernel on the Thecus n2100
          NAS appliance.
 
-config IOP3XX_ATU
-        bool "Enable the PCI Controller"
-        default y
-        help
-          Say Y here if you want the IOP to initialize its PCI Controller.
-          Say N if the IOP is an add in card, the host system owns the PCI
-          bus in this case.
-
 config MACH_EM7210
        bool "Enable support for the Lanner EM7210"
        help
index 98cfa1cd6bdb577c7bab28eb37a8c14c503cee8c..4a89823bcebbc763ba5bb8324cf01920ae871324 100644 (file)
@@ -178,10 +178,9 @@ static struct hw_pci iq31244_pci __initdata = {
 
 static int __init iq31244_pci_init(void)
 {
-       if (is_ep80219()) {
-               if (iop3xx_get_init_atu() == IOP3XX_INIT_ATU_ENABLE)
-                       pci_common_init(&ep80219_pci);
-       } else if (machine_is_iq31244()) {
+       if (is_ep80219())
+               pci_common_init(&ep80219_pci);
+       else if (machine_is_iq31244()) {
                if (is_80219()) {
                        printk("note: iq31244 board type has been selected\n");
                        printk("note: to select ep80219 operation:\n");
@@ -190,9 +189,7 @@ static int __init iq31244_pci_init(void)
                        printk("\t2/ update boot loader to pass"
                                " the ep80219 id: %d\n", MACH_TYPE_EP80219);
                }
-
-               if (iop3xx_get_init_atu() == IOP3XX_INIT_ATU_ENABLE)
-                       pci_common_init(&iq31244_pci);
+               pci_common_init(&iq31244_pci);
        }
 
        return 0;
index 18ad29f213b2a42759b97cacf11a78f3adfc9e1f..1da3c911edd3bb3941c955b16ea783f161bd154a 100644 (file)
@@ -106,7 +106,7 @@ static struct hw_pci iq80321_pci __initdata = {
        .swizzle        = pci_std_swizzle,
        .nr_controllers = 1,
        .setup          = iop3xx_pci_setup,
-       .preinit        = iop3xx_pci_preinit,
+       .preinit        = iop3xx_pci_preinit_cond,
        .scan           = iop3xx_pci_scan_bus,
        .map_irq        = iq80321_pci_map_irq,
 };
index 45598e09689859025143a233e5407194421d4715..9aa016bb18f9d1012b32d0a05ce320c7cbbe32d3 100644 (file)
@@ -16,14 +16,6 @@ config MACH_IQ80332
          Say Y here if you want to run your kernel on the Intel IQ80332
          evaluation kit for the IOP332 chipset.
 
-config IOP3XX_ATU
-       bool "Enable the PCI Controller"
-       default y
-       help
-         Say Y here if you want the IOP to initialize its PCI Controller.
-         Say N if the IOP is an add in card, the host system owns the PCI
-         bus in this case.
-
 endmenu
 
 endif
index 433188ebff2a6dd9f6ad04ab9b8c640b25f7067f..de39fd778579722c8ac99c2eea39659dbf9862bb 100644 (file)
@@ -89,7 +89,7 @@ static struct hw_pci iq80331_pci __initdata = {
        .swizzle        = pci_std_swizzle,
        .nr_controllers = 1,
        .setup          = iop3xx_pci_setup,
-       .preinit        = iop3xx_pci_preinit,
+       .preinit        = iop3xx_pci_preinit_cond,
        .scan           = iop3xx_pci_scan_bus,
        .map_irq        = iq80331_pci_map_irq,
 };
index 416c09564cc6ead75b84b98bdb122527fdc0343a..4904fd78445f0c661a3742e2294756a2f316a13b 100644 (file)
@@ -89,7 +89,7 @@ static struct hw_pci iq80332_pci __initdata = {
        .swizzle        = pci_std_swizzle,
        .nr_controllers = 1,
        .setup          = iop3xx_pci_setup,
-       .preinit        = iop3xx_pci_preinit,
+       .preinit        = iop3xx_pci_preinit_cond,
        .scan           = iop3xx_pci_scan_bus,
        .map_irq        = iq80332_pci_map_irq,
 };
index 730a3af12c985f53467c6281209f864dc9e5cd74..ade42b73afbb2cea2c6c5722be88a2904af65e78 100644 (file)
@@ -11,5 +11,8 @@ obj-                          :=
 # PCI support is optional
 obj-$(CONFIG_PCI)              += pci.o
 
+# LEDs
+obj-$(CONFIG_LEDS)             += leds.o
+
 # Board-specific support
 obj-$(CONFIG_MACH_KS8695)      += board-micrel.o
index 386593f8ac65b8476bba078a666a55cb3f951be0..3db2ec61d06f5f5206bfa46e935712bfc1abf382 100644 (file)
@@ -176,6 +176,27 @@ static void __init ks8695_add_device_watchdog(void) {}
 #endif
 
 
+/* --------------------------------------------------------------------
+ *  LEDs
+ * -------------------------------------------------------------------- */
+
+#if defined(CONFIG_LEDS)
+short ks8695_leds_cpu = -1;
+short ks8695_leds_timer = -1;
+
+void __init ks8695_init_leds(u8 cpu_led, u8 timer_led)
+{
+       /* Enable GPIO to access the LEDs */
+       gpio_direction_output(cpu_led, 1);
+       gpio_direction_output(timer_led, 1);
+
+       ks8695_leds_cpu   = cpu_led;
+       ks8695_leds_timer = timer_led;
+}
+#else
+void __init ks8695_init_leds(u8 cpu_led, u8 timer_led) {}
+#endif
+
 /* -------------------------------------------------------------------- */
 
 /*
diff --git a/arch/arm/mach-ks8695/leds.c b/arch/arm/mach-ks8695/leds.c
new file mode 100644 (file)
index 0000000..d61762a
--- /dev/null
@@ -0,0 +1,94 @@
+/*
+ * LED driver for KS8695-based boards.
+ *
+ * Copyright (C) Andrew Victor
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/init.h>
+
+#include <asm/mach-types.h>
+#include <asm/leds.h>
+#include <asm/arch/devices.h>
+#include <asm/arch/gpio.h>
+
+
+static inline void ks8695_led_on(unsigned int led)
+{
+       gpio_set_value(led, 0);
+}
+
+static inline void ks8695_led_off(unsigned int led)
+{
+       gpio_set_value(led, 1);
+}
+
+static inline void ks8695_led_toggle(unsigned int led)
+{
+       unsigned long is_off = gpio_get_value(led);
+       if (is_off)
+               ks8695_led_on(led);
+       else
+               ks8695_led_off(led);
+}
+
+
+/*
+ * Handle LED events.
+ */
+static void ks8695_leds_event(led_event_t evt)
+{
+       unsigned long flags;
+
+       local_irq_save(flags);
+
+       switch(evt) {
+       case led_start:         /* System startup */
+               ks8695_led_on(ks8695_leds_cpu);
+               break;
+
+       case led_stop:          /* System stop / suspend */
+               ks8695_led_off(ks8695_leds_cpu);
+               break;
+
+#ifdef CONFIG_LEDS_TIMER
+       case led_timer:         /* Every 50 timer ticks */
+               ks8695_led_toggle(ks8695_leds_timer);
+               break;
+#endif
+
+#ifdef CONFIG_LEDS_CPU
+       case led_idle_start:    /* Entering idle state */
+               ks8695_led_off(ks8695_leds_cpu);
+               break;
+
+       case led_idle_end:      /* Exit idle state */
+               ks8695_led_on(ks8695_leds_cpu);
+               break;
+#endif
+
+       default:
+               break;
+       }
+
+       local_irq_restore(flags);
+}
+
+
+static int __init leds_init(void)
+{
+       if ((ks8695_leds_timer == -1) || (ks8695_leds_cpu == -1))
+               return -ENODEV;
+
+       leds_event = ks8695_leds_event;
+
+       leds_event(led_start);
+       return 0;
+}
+
+__initcall(leds_init);
index 8584ed107991bee83fb8ffc57d07cead0d5c32c3..dd0cd5ac4b8b895b1d96e47662028e99a345f80c 100644 (file)
@@ -2,9 +2,26 @@ if ARCH_NS9XXX
 
 menu "NS9xxx Implementations"
 
+config NS9XXX_HAVE_SERIAL8250
+       bool
+
+config PROCESSOR_NS9360
+       bool
+
+config MODULE_CC9P9360
+       bool
+       select PROCESSOR_NS9360
+
+config BOARD_A9M9750DEV
+       select NS9XXX_HAVE_SERIAL8250
+       bool
+
+config BOARD_JSCC9P9360
+       bool
+
 config MACH_CC9P9360DEV
        bool "ConnectCore 9P 9360 on an A9M9750 Devboard"
-       select PROCESSOR_NS9360
+       select MODULE_CC9P9360
        select BOARD_A9M9750DEV
        help
          Say Y here if you are using the Digi ConnectCore 9P 9360
@@ -12,21 +29,12 @@ config MACH_CC9P9360DEV
 
 config MACH_CC9P9360JS
        bool "ConnectCore 9P 9360 on a JSCC9P9360 Devboard"
-       select PROCESSOR_NS9360
+       select MODULE_CC9P9360
        select BOARD_JSCC9P9360
        help
          Say Y here if you are using the Digi ConnectCore 9P 9360
          on an JSCC9P9360 Development Board.
 
-config PROCESSOR_NS9360
-       bool
-
-config BOARD_A9M9750DEV
-       bool
-
-config BOARD_JSCC9P9360
-       bool
-
 endmenu
 
 endif
index 6fb82b855a55aa6a81b8f525d7db816b8b5d4bad..41efaf9ad50ba18f7bdbae94ecee052dfb0b7fd9 100644 (file)
@@ -1,7 +1,12 @@
-obj-y := irq.o time.o generic.o gpio.o
+obj-y := clock.o generic.o gpio.o irq.o
 
 obj-$(CONFIG_MACH_CC9P9360DEV) += mach-cc9p9360dev.o
 obj-$(CONFIG_MACH_CC9P9360JS) += mach-cc9p9360js.o
 
+obj-$(CONFIG_PROCESSOR_NS9360) += gpio-ns9360.o processor-ns9360.o time-ns9360.o
+
 obj-$(CONFIG_BOARD_A9M9750DEV) += board-a9m9750dev.o
 obj-$(CONFIG_BOARD_JSCC9P9360) += board-jscc9p9360.o
+
+# platform devices
+obj-$(CONFIG_NS9XXX_HAVE_SERIAL8250) += plat-serial8250.o
index 75ed64e90fa423672c7f4a530bf93189d58a6a10..54654919229b0972954911f301f0928cee6f771c 100644 (file)
@@ -1,2 +1,2 @@
-zreladdr-y := 0x108000
+zreladdr-y := 0x8000
 params_phys-y := 0x100
index 0f65177f9e5fafabcd897ee610915d1e4409d49a..a494b71c0195b32198e5f3497e6dac9c6cc6b2ee 100644 (file)
@@ -8,15 +8,14 @@
  * under the terms of the GNU General Public License version 2 as published by
  * the Free Software Foundation.
  */
-#include <linux/platform_device.h>
-#include <linux/serial_8250.h>
 #include <linux/irq.h>
 
 #include <asm/mach/map.h>
 #include <asm/gpio.h>
 
 #include <asm/arch-ns9xxx/board.h>
-#include <asm/arch-ns9xxx/regs-sys.h>
+#include <asm/arch-ns9xxx/processor-ns9360.h>
+#include <asm/arch-ns9xxx/regs-sys-ns9360.h>
 #include <asm/arch-ns9xxx/regs-mem.h>
 #include <asm/arch-ns9xxx/regs-bbu.h>
 #include <asm/arch-ns9xxx/regs-board-a9m9750dev.h>
@@ -105,9 +104,9 @@ void __init board_a9m9750dev_init_irq(void)
        int i;
 
        if (gpio_request(11, "board a9m9750dev extirq2") == 0)
-               ns9xxx_gpio_configure(11, 0, 1);
+               ns9360_gpio_configure(11, 0, 1);
        else
-               printk(KERN_ERR "%s: cannot get gpio 11 for IRQ_EXT2\n",
+               printk(KERN_ERR "%s: cannot get gpio 11 for IRQ_NS9XXX_EXT2\n",
                                __func__);
 
        for (i = FPGA_IRQ(0); i <= FPGA_IRQ(7); ++i) {
@@ -116,69 +115,16 @@ void __init board_a9m9750dev_init_irq(void)
                set_irq_flags(i, IRQF_VALID);
        }
 
-       /* IRQ_EXT2: level sensitive + active low */
+       /* IRQ_NS9XXX_EXT2: level sensitive + active low */
        eic = __raw_readl(SYS_EIC(2));
        REGSET(eic, SYS_EIC, PLTY, AL);
        REGSET(eic, SYS_EIC, LVEDG, LEVEL);
        __raw_writel(eic, SYS_EIC(2));
 
-       set_irq_chained_handler(IRQ_EXT2,
+       set_irq_chained_handler(IRQ_NS9XXX_EXT2,
                        a9m9750dev_fpga_demux_handler);
 }
 
-static struct plat_serial8250_port board_a9m9750dev_serial8250_port[] = {
-       {
-               .iobase         = FPGA_UARTA_BASE,
-               .membase        = (unsigned char*)FPGA_UARTA_BASE,
-               .mapbase        = FPGA_UARTA_BASE,
-               .irq            = IRQ_FPGA_UARTA,
-               .iotype         = UPIO_MEM,
-               .uartclk        = 18432000,
-               .regshift       = 0,
-               .flags          = UPF_BOOT_AUTOCONF | UPF_SHARE_IRQ,
-       }, {
-               .iobase         = FPGA_UARTB_BASE,
-               .membase        = (unsigned char*)FPGA_UARTB_BASE,
-               .mapbase        = FPGA_UARTB_BASE,
-               .irq            = IRQ_FPGA_UARTB,
-               .iotype         = UPIO_MEM,
-               .uartclk        = 18432000,
-               .regshift       = 0,
-               .flags          = UPF_BOOT_AUTOCONF | UPF_SHARE_IRQ,
-       }, {
-               .iobase         = FPGA_UARTC_BASE,
-               .membase        = (unsigned char*)FPGA_UARTC_BASE,
-               .mapbase        = FPGA_UARTC_BASE,
-               .irq            = IRQ_FPGA_UARTC,
-               .iotype         = UPIO_MEM,
-               .uartclk        = 18432000,
-               .regshift       = 0,
-               .flags          = UPF_BOOT_AUTOCONF | UPF_SHARE_IRQ,
-       }, {
-               .iobase         = FPGA_UARTD_BASE,
-               .membase        = (unsigned char*)FPGA_UARTD_BASE,
-               .mapbase        = FPGA_UARTD_BASE,
-               .irq            = IRQ_FPGA_UARTD,
-               .iotype         = UPIO_MEM,
-               .uartclk        = 18432000,
-               .regshift       = 0,
-               .flags          = UPF_BOOT_AUTOCONF | UPF_SHARE_IRQ,
-       }, {
-               /* end marker */
-       },
-};
-
-static struct platform_device board_a9m9750dev_serial_device = {
-       .name = "serial8250",
-       .dev = {
-               .platform_data = board_a9m9750dev_serial8250_port,
-       },
-};
-
-static struct platform_device *board_a9m9750dev_devices[] __initdata = {
-       &board_a9m9750dev_serial_device,
-};
-
 void __init board_a9m9750dev_init_machine(void)
 {
        u32 reg;
@@ -210,7 +156,4 @@ void __init board_a9m9750dev_init_machine(void)
        __raw_writel(0x2, MEM_SMOED(0));
        __raw_writel(0x6, MEM_SMRD(0));
        __raw_writel(0x6, MEM_SMWD(0));
-
-       platform_add_devices(board_a9m9750dev_devices,
-                       ARRAY_SIZE(board_a9m9750dev_devices));
 }
diff --git a/arch/arm/mach-ns9xxx/clock.c b/arch/arm/mach-ns9xxx/clock.c
new file mode 100644 (file)
index 0000000..f863916
--- /dev/null
@@ -0,0 +1,215 @@
+/*
+ * arch/arm/mach-ns9xxx/clock.c
+ *
+ * Copyright (C) 2007 by Digi International Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published by
+ * the Free Software Foundation.
+ */
+#include <linux/err.h>
+#include <linux/module.h>
+#include <linux/list.h>
+#include <linux/clk.h>
+#include <linux/string.h>
+#include <linux/platform_device.h>
+
+#include <asm/semaphore.h>
+#include "clock.h"
+
+static LIST_HEAD(clocks);
+static DEFINE_SPINLOCK(clk_lock);
+
+struct clk *clk_get(struct device *dev, const char *id)
+{
+       struct clk *p, *ret = NULL, *retgen = NULL;
+       unsigned long flags;
+       int idno;
+
+       if (dev == NULL || dev->bus != &platform_bus_type)
+               idno = -1;
+       else
+               idno = to_platform_device(dev)->id;
+
+       spin_lock_irqsave(&clk_lock, flags);
+       list_for_each_entry(p, &clocks, node) {
+               if (strcmp(id, p->name) == 0) {
+                       if (p->id == idno) {
+                               if (!try_module_get(p->owner))
+                                       continue;
+                               ret = p;
+                               break;
+                       } else if (p->id == -1)
+                               /* remember match with id == -1 in case there is
+                                * no clock for idno */
+                               retgen = p;
+               }
+       }
+
+       if (!ret && retgen && try_module_get(retgen->owner))
+               ret = retgen;
+
+       if (ret)
+               ++ret->refcount;
+
+       spin_unlock_irqrestore(&clk_lock, flags);
+
+       return ret ? ret : ERR_PTR(-ENOENT);
+}
+EXPORT_SYMBOL(clk_get);
+
+void clk_put(struct clk *clk)
+{
+       module_put(clk->owner);
+       --clk->refcount;
+}
+EXPORT_SYMBOL(clk_put);
+
+static int clk_enable_unlocked(struct clk *clk)
+{
+       int ret = 0;
+       if (clk->parent) {
+               ret = clk_enable_unlocked(clk->parent);
+               if (ret)
+                       return ret;
+       }
+
+       if (clk->usage++ == 0 && clk->endisable)
+               ret = clk->endisable(clk, 1);
+
+       return ret;
+}
+
+int clk_enable(struct clk *clk)
+{
+       int ret;
+       unsigned long flags;
+
+       spin_lock_irqsave(&clk_lock, flags);
+
+       ret = clk_enable_unlocked(clk);
+
+       spin_unlock_irqrestore(&clk_lock, flags);
+
+       return ret;
+}
+EXPORT_SYMBOL(clk_enable);
+
+static void clk_disable_unlocked(struct clk *clk)
+{
+       if (--clk->usage == 0 && clk->endisable)
+               clk->endisable(clk, 0);
+
+       if (clk->parent)
+               clk_disable_unlocked(clk->parent);
+}
+
+void clk_disable(struct clk *clk)
+{
+       unsigned long flags;
+
+       spin_lock_irqsave(&clk_lock, flags);
+
+       clk_disable_unlocked(clk);
+
+       spin_unlock_irqrestore(&clk_lock, flags);
+}
+EXPORT_SYMBOL(clk_disable);
+
+unsigned long clk_get_rate(struct clk *clk)
+{
+       if (clk->get_rate)
+               return clk->get_rate(clk);
+
+       if (clk->rate)
+               return clk->rate;
+
+       if (clk->parent)
+               return clk_get_rate(clk->parent);
+
+       return 0;
+}
+EXPORT_SYMBOL(clk_get_rate);
+
+int clk_register(struct clk *clk)
+{
+       unsigned long flags;
+
+       spin_lock_irqsave(&clk_lock, flags);
+
+       list_add(&clk->node, &clocks);
+
+       if (clk->parent)
+               ++clk->parent->refcount;
+
+       spin_unlock_irqrestore(&clk_lock, flags);
+
+       return 0;
+}
+
+int clk_unregister(struct clk *clk)
+{
+       int ret = 0;
+       unsigned long flags;
+
+       spin_lock_irqsave(&clk_lock, flags);
+
+       if (clk->usage || clk->refcount)
+               ret = -EBUSY;
+       else
+               list_del(&clk->node);
+
+       if (clk->parent)
+               --clk->parent->refcount;
+
+       spin_unlock_irqrestore(&clk_lock, flags);
+
+       return ret;
+}
+
+#if defined CONFIG_DEBUG_FS
+
+#include <linux/debugfs.h>
+#include <linux/seq_file.h>
+
+static int clk_debugfs_show(struct seq_file *s, void *null)
+{
+       unsigned long flags;
+       struct clk *p;
+
+       spin_lock_irqsave(&clk_lock, flags);
+
+       list_for_each_entry(p, &clocks, node)
+               seq_printf(s, "%s.%d: usage=%lu refcount=%lu rate=%lu\n",
+                               p->name, p->id, p->usage, p->refcount,
+                               p->usage ? clk_get_rate(p) : 0);
+
+       spin_unlock_irqrestore(&clk_lock, flags);
+
+       return 0;
+}
+
+static int clk_debugfs_open(struct inode *inode, struct file *file)
+{
+       return single_open(file, clk_debugfs_show, NULL);
+}
+
+static struct file_operations clk_debugfs_operations = {
+       .open = clk_debugfs_open,
+       .read = seq_read,
+       .llseek = seq_lseek,
+       .release = single_release,
+};
+
+static int __init clk_debugfs_init(void)
+{
+       struct dentry *dentry;
+
+       dentry = debugfs_create_file("clk", S_IFREG | S_IRUGO, NULL, NULL,
+                       &clk_debugfs_operations);
+       return IS_ERR(dentry) ? PTR_ERR(dentry) : 0;
+}
+subsys_initcall(clk_debugfs_init);
+
+#endif /* if defined CONFIG_DEBUG_FS */
diff --git a/arch/arm/mach-ns9xxx/clock.h b/arch/arm/mach-ns9xxx/clock.h
new file mode 100644 (file)
index 0000000..b86c30d
--- /dev/null
@@ -0,0 +1,35 @@
+/*
+ * arch/arm/mach-ns9xxx/clock.h
+ *
+ * Copyright (C) 2007 by Digi International Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published by
+ * the Free Software Foundation.
+ */
+#ifndef __NS9XXX_CLOCK_H
+#define __NS9XXX_CLOCK_H
+
+#include <linux/list.h>
+
+struct clk {
+       struct module *owner;
+       const char *name;
+       int id;
+
+       struct clk *parent;
+
+       unsigned long rate;
+       int (*endisable)(struct clk *, int enable);
+       unsigned long (*get_rate)(struct clk *);
+
+       struct list_head node;
+       unsigned long refcount;
+       unsigned long usage;
+};
+
+int clk_register(struct clk *clk);
+int clk_unregister(struct clk *clk);
+
+#endif /* ifndef __NS9XXX_CLOCK_H */
index d742c921e34dabb42ed10948c32599c4d12dcedb..1e0f467879ccceb1a7289fabaaabb7915fd870db 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * arch/arm/mach-ns9xxx/generic.c
  *
- * Copyright (C) 2006 by Digi International Inc.
+ * Copyright (C) 2006,2007 by Digi International Inc.
  * All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <asm/memory.h>
-#include <asm/page.h>
-#include <asm/mach-types.h>
-#include <asm/mach/map.h>
-#include <asm/arch-ns9xxx/regs-sys.h>
-#include <asm/arch-ns9xxx/regs-mem.h>
-#include <asm/arch-ns9xxx/board.h>
 
 #include "generic.h"
 
-static struct map_desc standard_io_desc[] __initdata = {
-       { /* BBus */
-               .virtual = io_p2v(0x90000000),
-               .pfn = __phys_to_pfn(0x90000000),
-               .length = 0x00700000,
-               .type = MT_DEVICE,
-       }, { /* AHB */
-               .virtual = io_p2v(0xa0100000),
-               .pfn = __phys_to_pfn(0xa0100000),
-               .length = 0x00900000,
-               .type = MT_DEVICE,
-       },
-};
-
-void __init ns9xxx_map_io(void)
-{
-       iotable_init(standard_io_desc, ARRAY_SIZE(standard_io_desc));
-}
-
 void __init ns9xxx_init_machine(void)
 {
 }
index 687e291773f4be613c576b0439dd1ac398e3ff2f..82493191aad6519b3cd6d6fe3937c51fcf1eabfe 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * arch/arm/mach-ns9xxx/generic.h
  *
- * Copyright (C) 2006 by Digi International Inc.
+ * Copyright (C) 2006,2007 by Digi International Inc.
  * All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
@@ -13,7 +13,4 @@
 #include <linux/init.h>
 
 void __init ns9xxx_init_irq(void);
-void __init ns9xxx_map_io(void);
 void __init ns9xxx_init_machine(void);
-
-extern struct sys_timer ns9xxx_timer;
diff --git a/arch/arm/mach-ns9xxx/gpio-ns9360.c b/arch/arm/mach-ns9xxx/gpio-ns9360.c
new file mode 100644 (file)
index 0000000..cabfb87
--- /dev/null
@@ -0,0 +1,118 @@
+/*
+ * arch/arm/mach-ns9xxx/gpio-ns9360.c
+ *
+ * Copyright (C) 2006,2007 by Digi International Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published by
+ * the Free Software Foundation.
+ */
+#include <linux/bug.h>
+#include <linux/errno.h>
+#include <linux/io.h>
+#include <linux/kernel.h>
+#include <linux/module.h>
+
+#include <asm/arch-ns9xxx/regs-bbu.h>
+#include <asm/arch-ns9xxx/processor-ns9360.h>
+
+#include "gpio-ns9360.h"
+
+static inline int ns9360_valid_gpio(unsigned gpio)
+{
+       return gpio <= 72;
+}
+
+static inline void __iomem *ns9360_gpio_get_gconfaddr(unsigned gpio)
+{
+       if (gpio < 56)
+               return BBU_GCONFb1(gpio / 8);
+       else
+               /*
+                * this could be optimised away on
+                * ns9750 only builds, but it isn't ...
+                */
+               return BBU_GCONFb2((gpio - 56) / 8);
+}
+
+static inline void __iomem *ns9360_gpio_get_gctrladdr(unsigned gpio)
+{
+       if (gpio < 32)
+               return BBU_GCTRL1;
+       else if (gpio < 64)
+               return BBU_GCTRL2;
+       else
+               /* this could be optimised away on ns9750 only builds */
+               return BBU_GCTRL3;
+}
+
+static inline void __iomem *ns9360_gpio_get_gstataddr(unsigned gpio)
+{
+       if (gpio < 32)
+               return BBU_GSTAT1;
+       else if (gpio < 64)
+               return BBU_GSTAT2;
+       else
+               /* this could be optimised away on ns9750 only builds */
+               return BBU_GSTAT3;
+}
+
+/*
+ * each gpio can serve for 4 different purposes [0..3].  These are called
+ * "functions" and passed in the parameter func.  Functions 0-2 are always some
+ * special things, function 3 is GPIO.  If func == 3 dir specifies input or
+ * output, and with inv you can enable an inverter (independent of func).
+ */
+int __ns9360_gpio_configure(unsigned gpio, int dir, int inv, int func)
+{
+       void __iomem *conf = ns9360_gpio_get_gconfaddr(gpio);
+       u32 confval;
+
+       confval = __raw_readl(conf);
+       REGSETIM_IDX(confval, BBU_GCONFx, DIR, gpio & 7, dir);
+       REGSETIM_IDX(confval, BBU_GCONFx, INV, gpio & 7, inv);
+       REGSETIM_IDX(confval, BBU_GCONFx, FUNC, gpio & 7, func);
+       __raw_writel(confval, conf);
+
+       return 0;
+}
+
+int ns9360_gpio_configure(unsigned gpio, int inv, int func)
+{
+       if (likely(ns9360_valid_gpio(gpio))) {
+               if (func == 3) {
+                       printk(KERN_WARNING "use gpio_direction_input "
+                                       "or gpio_direction_output\n");
+                       return -EINVAL;
+               } else
+                       return __ns9360_gpio_configure(gpio, 0, inv, func);
+       } else
+               return -EINVAL;
+}
+EXPORT_SYMBOL(ns9360_gpio_configure);
+
+int ns9360_gpio_get_value(unsigned gpio)
+{
+       void __iomem *stat = ns9360_gpio_get_gstataddr(gpio);
+       int ret;
+
+       ret = 1 & (__raw_readl(stat) >> (gpio & 31));
+
+       return ret;
+}
+
+void ns9360_gpio_set_value(unsigned gpio, int value)
+{
+       void __iomem *ctrl = ns9360_gpio_get_gctrladdr(gpio);
+       u32 ctrlval;
+
+       ctrlval = __raw_readl(ctrl);
+
+       if (value)
+               ctrlval |= 1 << (gpio & 31);
+       else
+               ctrlval &= ~(1 << (gpio & 31));
+
+       __raw_writel(ctrlval, ctrl);
+}
diff --git a/arch/arm/mach-ns9xxx/gpio-ns9360.h b/arch/arm/mach-ns9xxx/gpio-ns9360.h
new file mode 100644 (file)
index 0000000..131cd17
--- /dev/null
@@ -0,0 +1,13 @@
+/*
+ * arch/arm/mach-ns9xxx/gpio-ns9360.h
+ *
+ * Copyright (C) 2006,2007 by Digi International Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published by
+ * the Free Software Foundation.
+ */
+int __ns9360_gpio_configure(unsigned gpio, int dir, int inv, int func);
+int ns9360_gpio_get_value(unsigned gpio);
+void ns9360_gpio_set_value(unsigned gpio, int value);
index 5286e9fc1d307bac62f1341dd6c4e728a83be33a..b3c963b0c8f5414bb9713d6897a8040da3736703 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * arch/arm/mach-ns9xxx/gpio.c
  *
- * Copyright (C) 2006 by Digi International Inc.
+ * Copyright (C) 2006,2007 by Digi International Inc.
  * All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
 
 #include <asm/arch-ns9xxx/gpio.h>
 #include <asm/arch-ns9xxx/processor.h>
-#include <asm/arch-ns9xxx/regs-bbu.h>
-#include <asm/io.h>
+#include <asm/arch-ns9xxx/processor-ns9360.h>
 #include <asm/bug.h>
 #include <asm/types.h>
 #include <asm/bitops.h>
 
+#include "gpio-ns9360.h"
+
 #if defined(CONFIG_PROCESSOR_NS9360)
 #define GPIO_MAX 72
 #elif defined(CONFIG_PROCESSOR_NS9750)
@@ -45,41 +46,10 @@ static inline int ns9xxx_valid_gpio(unsigned gpio)
                return gpio <= 49;
        else
 #endif
+       {
                BUG();
-}
-
-static inline void __iomem *ns9xxx_gpio_get_gconfaddr(unsigned gpio)
-{
-       if (gpio < 56)
-               return BBU_GCONFb1(gpio / 8);
-       else
-               /*
-                * this could be optimised away on
-                * ns9750 only builds, but it isn't ...
-                */
-               return BBU_GCONFb2((gpio - 56) / 8);
-}
-
-static inline void __iomem *ns9xxx_gpio_get_gctrladdr(unsigned gpio)
-{
-       if (gpio < 32)
-               return BBU_GCTRL1;
-       else if (gpio < 64)
-               return BBU_GCTRL2;
-       else
-               /* this could be optimised away on ns9750 only builds */
-               return BBU_GCTRL3;
-}
-
-static inline void __iomem *ns9xxx_gpio_get_gstataddr(unsigned gpio)
-{
-       if (gpio < 32)
-               return BBU_GSTAT1;
-       else if (gpio < 64)
-               return BBU_GSTAT2;
-       else
-               /* this could be optimised away on ns9750 only builds */
-               return BBU_GSTAT3;
+               return 0;
+       }
 }
 
 int gpio_request(unsigned gpio, const char *label)
@@ -98,49 +68,24 @@ void gpio_free(unsigned gpio)
 }
 EXPORT_SYMBOL(gpio_free);
 
-/*
- * each gpio can serve for 4 different purposes [0..3].  These are called
- * "functions" and passed in the parameter func.  Functions 0-2 are always some
- * special things, function 3 is GPIO.  If func == 3 dir specifies input or
- * output, and with inv you can enable an inverter (independent of func).
- */
-static int __ns9xxx_gpio_configure(unsigned gpio, int dir, int inv, int func)
+int gpio_direction_input(unsigned gpio)
 {
-       void __iomem *conf = ns9xxx_gpio_get_gconfaddr(gpio);
-       u32 confval;
-       unsigned long flags;
-
-       spin_lock_irqsave(&gpio_lock, flags);
-
-       confval = __raw_readl(conf);
-       REGSETIM_IDX(confval, BBU_GCONFx, DIR, gpio & 7, dir);
-       REGSETIM_IDX(confval, BBU_GCONFx, INV, gpio & 7, inv);
-       REGSETIM_IDX(confval, BBU_GCONFx, FUNC, gpio & 7, func);
-       __raw_writel(confval, conf);
+       if (likely(ns9xxx_valid_gpio(gpio))) {
+               int ret = -EINVAL;
+               unsigned long flags;
 
-       spin_unlock_irqrestore(&gpio_lock, flags);
+               spin_lock_irqsave(&gpio_lock, flags);
+#if defined(CONFIG_PROCESSOR_NS9360)
+               if (processor_is_ns9360())
+                       ret = __ns9360_gpio_configure(gpio, 0, 0, 3);
+               else
+#endif
+                       BUG();
 
-       return 0;
-}
+               spin_unlock_irqrestore(&gpio_lock, flags);
 
-int ns9xxx_gpio_configure(unsigned gpio, int inv, int func)
-{
-       if (likely(ns9xxx_valid_gpio(gpio))) {
-               if (func == 3) {
-                       printk(KERN_WARNING "use gpio_direction_input "
-                                       "or gpio_direction_output\n");
-                       return -EINVAL;
-               } else
-                       return __ns9xxx_gpio_configure(gpio, 0, inv, func);
-       } else
-               return -EINVAL;
-}
-EXPORT_SYMBOL(ns9xxx_gpio_configure);
+               return ret;
 
-int gpio_direction_input(unsigned gpio)
-{
-       if (likely(ns9xxx_valid_gpio(gpio))) {
-               return __ns9xxx_gpio_configure(gpio, 0, 0, 3);
        } else
                return -EINVAL;
 }
@@ -149,9 +94,22 @@ EXPORT_SYMBOL(gpio_direction_input);
 int gpio_direction_output(unsigned gpio, int value)
 {
        if (likely(ns9xxx_valid_gpio(gpio))) {
+               int ret = -EINVAL;
+               unsigned long flags;
+
                gpio_set_value(gpio, value);
 
-               return __ns9xxx_gpio_configure(gpio, 1, 0, 3);
+               spin_lock_irqsave(&gpio_lock, flags);
+#if defined(CONFIG_PROCESSOR_NS9360)
+               if (processor_is_ns9360())
+                       ret = __ns9360_gpio_configure(gpio, 1, 0, 3);
+               else
+#endif
+                       BUG();
+
+               spin_unlock_irqrestore(&gpio_lock, flags);
+
+               return ret;
        } else
                return -EINVAL;
 }
@@ -159,31 +117,28 @@ EXPORT_SYMBOL(gpio_direction_output);
 
 int gpio_get_value(unsigned gpio)
 {
-       void __iomem *stat = ns9xxx_gpio_get_gstataddr(gpio);
-       int ret;
-
-       ret = 1 & (__raw_readl(stat) >> (gpio & 31));
-
-       return ret;
+#if defined(CONFIG_PROCESSOR_NS9360)
+       if (processor_is_ns9360())
+               return ns9360_gpio_get_value(gpio);
+       else
+#endif
+       {
+               BUG();
+               return -EINVAL;
+       }
 }
 EXPORT_SYMBOL(gpio_get_value);
 
 void gpio_set_value(unsigned gpio, int value)
 {
-       void __iomem *ctrl = ns9xxx_gpio_get_gctrladdr(gpio);
-       u32 ctrlval;
        unsigned long flags;
-
        spin_lock_irqsave(&gpio_lock, flags);
-
-       ctrlval = __raw_readl(ctrl);
-
-       if (value)
-               ctrlval |= 1 << (gpio & 31);
+#if defined(CONFIG_PROCESSOR_NS9360)
+       if (processor_is_ns9360())
+               ns9360_gpio_set_value(gpio, value);
        else
-               ctrlval &= ~(1 << (gpio & 31));
-
-       __raw_writel(ctrlval, ctrl);
+#endif
+               BUG();
 
        spin_unlock_irqrestore(&gpio_lock, flags);
 }
index 00001b874e97e317ad5f0e5ee90998d930fb0144..36e5835e60975127b798b28b8fe756238f354feb 100644 (file)
@@ -9,21 +9,27 @@
  * the Free Software Foundation.
  */
 #include <linux/interrupt.h>
+#include <linux/kernel_stat.h>
 #include <asm/io.h>
 #include <asm/mach/irq.h>
 #include <asm/mach-types.h>
-#include <asm/arch-ns9xxx/regs-sys.h>
+#include <asm/arch-ns9xxx/regs-sys-common.h>
 #include <asm/arch-ns9xxx/irqs.h>
 #include <asm/arch-ns9xxx/board.h>
 
 #include "generic.h"
 
+/* simple interrupt prio table: prio(x) < prio(y) <=> x < y */
+#define irq2prio(i) (i)
+#define prio2irq(p) (p)
+
 static void ns9xxx_mask_irq(unsigned int irq)
 {
        /* XXX: better use cpp symbols */
-       u32 ic = __raw_readl(SYS_IC(irq / 4));
-       ic &= ~(1 << (7 + 8 * (3 - (irq & 3))));
-       __raw_writel(ic, SYS_IC(irq / 4));
+       int prio = irq2prio(irq);
+       u32 ic = __raw_readl(SYS_IC(prio / 4));
+       ic &= ~(1 << (7 + 8 * (3 - (prio & 3))));
+       __raw_writel(ic, SYS_IC(prio / 4));
 }
 
 static void ns9xxx_ack_irq(unsigned int irq)
@@ -40,9 +46,10 @@ static void ns9xxx_maskack_irq(unsigned int irq)
 static void ns9xxx_unmask_irq(unsigned int irq)
 {
        /* XXX: better use cpp symbols */
-       u32 ic = __raw_readl(SYS_IC(irq / 4));
-       ic |= 1 << (7 + 8 * (3 - (irq & 3)));
-       __raw_writel(ic, SYS_IC(irq / 4));
+       int prio = irq2prio(irq);
+       u32 ic = __raw_readl(SYS_IC(prio / 4));
+       ic |= 1 << (7 + 8 * (3 - (prio & 3)));
+       __raw_writel(ic, SYS_IC(prio / 4));
 }
 
 static struct irq_chip ns9xxx_chip = {
@@ -52,24 +59,61 @@ static struct irq_chip ns9xxx_chip = {
        .unmask         = ns9xxx_unmask_irq,
 };
 
+#if 0
+#define handle_irq handle_level_irq
+#else
+void handle_prio_irq(unsigned int irq, struct irq_desc *desc)
+{
+       unsigned int cpu = smp_processor_id();
+       struct irqaction *action;
+       irqreturn_t action_ret;
+
+       spin_lock(&desc->lock);
+
+       if (unlikely(desc->status & IRQ_INPROGRESS))
+               goto out_unlock;
+
+       desc->status &= ~(IRQ_REPLAY | IRQ_WAITING);
+       kstat_cpu(cpu).irqs[irq]++;
+
+       action = desc->action;
+       if (unlikely(!action || (desc->status & IRQ_DISABLED)))
+               goto out_unlock;
+
+       desc->status |= IRQ_INPROGRESS;
+       spin_unlock(&desc->lock);
+
+       action_ret = handle_IRQ_event(irq, action);
+
+       spin_lock(&desc->lock);
+       desc->status &= ~IRQ_INPROGRESS;
+       if (!(desc->status & IRQ_DISABLED) && desc->chip->ack)
+               desc->chip->ack(irq);
+
+out_unlock:
+       spin_unlock(&desc->lock);
+}
+#define handle_irq handle_prio_irq
+#endif
+
 void __init ns9xxx_init_irq(void)
 {
        int i;
 
        /* disable all IRQs */
        for (i = 0; i < 8; ++i)
-               __raw_writel((4 * i) << 24 | (4 * i + 1) << 16 |
-                               (4 * i + 2) << 8 | (4 * i + 3), SYS_IC(i));
+               __raw_writel(prio2irq(4 * i) << 24 |
+                               prio2irq(4 * i + 1) << 16 |
+                               prio2irq(4 * i + 2) << 8 |
+                               prio2irq(4 * i + 3),
+                               SYS_IC(i));
 
-       /* simple interrupt prio table:
-        * prio(x) < prio(y) <=> x < y
-        */
        for (i = 0; i < 32; ++i)
-               __raw_writel(i, SYS_IVA(i));
+               __raw_writel(prio2irq(i), SYS_IVA(i));
 
-       for (i = IRQ_WATCHDOG; i <= IRQ_EXT3; ++i) {
+       for (i = 0; i <= 31; ++i) {
                set_irq_chip(i, &ns9xxx_chip);
-               set_irq_handler(i, handle_level_irq);
+               set_irq_handler(i, handle_irq);
                set_irq_flags(i, IRQF_VALID);
        }
 }
index 760c9d0db7c368f2dcaef406fcdcdaedded81a3c..9623fff6b3bcc48f93375572402a9b16339af8d0 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * arch/arm/mach-ns9xxx/mach-cc9p9360dev.c
  *
- * Copyright (C) 2006 by Digi International Inc.
+ * Copyright (C) 2006,2007 by Digi International Inc.
  * All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
 #include <asm/mach/arch.h>
 #include <asm/mach-types.h>
 
+#include <asm/arch-ns9xxx/processor-ns9360.h>
+
 #include "board-a9m9750dev.h"
 #include "generic.h"
 
 static void __init mach_cc9p9360dev_map_io(void)
 {
-       ns9xxx_map_io();
+       ns9360_map_io();
        board_a9m9750dev_map_io();
 }
 
@@ -36,6 +38,6 @@ MACHINE_START(CC9P9360DEV, "Digi ConnectCore 9P 9360 on an A9M9750 Devboard")
        .map_io = mach_cc9p9360dev_map_io,
        .init_irq = mach_cc9p9360dev_init_irq,
        .init_machine = mach_cc9p9360dev_init_machine,
-       .timer = &ns9xxx_timer,
+       .timer = &ns9360_timer,
        .boot_params = 0x100,
 MACHINE_END
index 85c8b41105c915818d430ba52c0654817f3fb167..fcc815bdd291d8666e770925c074ae0d63491660 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * arch/arm/mach-ns9xxx/mach-cc9p9360js.c
  *
- * Copyright (C) 2006 by Digi International Inc.
+ * Copyright (C) 2006,2007 by Digi International Inc.
  * All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
@@ -11,6 +11,8 @@
 #include <asm/mach/arch.h>
 #include <asm/mach-types.h>
 
+#include <asm/arch-ns9xxx/processor-ns9360.h>
+
 #include "board-jscc9p9360.h"
 #include "generic.h"
 
@@ -21,9 +23,9 @@ static void __init mach_cc9p9360js_init_machine(void)
 }
 
 MACHINE_START(CC9P9360JS, "Digi ConnectCore 9P 9360 on an JSCC9P9360 Devboard")
-       .map_io = ns9xxx_map_io,
+       .map_io = ns9360_map_io,
        .init_irq = ns9xxx_init_irq,
        .init_machine = mach_cc9p9360js_init_machine,
-       .timer = &ns9xxx_timer,
+       .timer = &ns9360_timer,
        .boot_params = 0x100,
 MACHINE_END
diff --git a/arch/arm/mach-ns9xxx/plat-serial8250.c b/arch/arm/mach-ns9xxx/plat-serial8250.c
new file mode 100644 (file)
index 0000000..5aa5d9b
--- /dev/null
@@ -0,0 +1,69 @@
+/*
+ * arch/arm/mach-ns9xxx/plat-serial8250.c
+ *
+ * Copyright (C) 2008 by Digi International Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published by
+ * the Free Software Foundation.
+ */
+#include <linux/platform_device.h>
+#include <linux/serial_8250.h>
+
+#include <asm/arch-ns9xxx/regs-board-a9m9750dev.h>
+#include <asm/arch-ns9xxx/board.h>
+
+#define DRIVER_NAME "serial8250"
+
+static int __init ns9xxx_plat_serial8250_init(void)
+{
+       struct plat_serial8250_port *pdata;
+       struct platform_device *pdev;
+       int ret = -ENOMEM;
+       int i;
+
+       if (!board_is_a9m9750dev())
+               return -ENODEV;
+
+       pdev = platform_device_alloc(DRIVER_NAME, 0);
+       if (!pdev)
+               goto err;
+
+       pdata = kzalloc(5 * sizeof(*pdata), GFP_KERNEL);
+       if (!pdata)
+               goto err;
+
+       pdev->dev.platform_data = pdata;
+
+       pdata[0].iobase = FPGA_UARTA_BASE;
+       pdata[1].iobase = FPGA_UARTB_BASE;
+       pdata[2].iobase = FPGA_UARTC_BASE;
+       pdata[3].iobase = FPGA_UARTD_BASE;
+
+       for (i = 0; i < 4; ++i) {
+               pdata[i].membase = (void __iomem *)pdata[i].iobase;
+               pdata[i].mapbase = pdata[i].iobase;
+               pdata[i].iotype = UPIO_MEM;
+               pdata[i].uartclk = 18432000;
+               pdata[i].flags = UPF_BOOT_AUTOCONF | UPF_SHARE_IRQ;
+       }
+
+       pdata[0].irq = IRQ_FPGA_UARTA;
+       pdata[1].irq = IRQ_FPGA_UARTB;
+       pdata[2].irq = IRQ_FPGA_UARTC;
+       pdata[3].irq = IRQ_FPGA_UARTD;
+
+       ret = platform_device_add(pdev);
+       if (ret) {
+err:
+               platform_device_put(pdev);
+
+               printk(KERN_WARNING "Could not add %s (errno=%d)\n",
+                               DRIVER_NAME, ret);
+       }
+
+       return 0;
+}
+
+arch_initcall(ns9xxx_plat_serial8250_init);
diff --git a/arch/arm/mach-ns9xxx/processor-ns9360.c b/arch/arm/mach-ns9xxx/processor-ns9360.c
new file mode 100644 (file)
index 0000000..2bee0b7
--- /dev/null
@@ -0,0 +1,54 @@
+/*
+ * arch/arm/mach-ns9xxx/processor-ns9360.c
+ *
+ * Copyright (C) 2007 by Digi International Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published by
+ * the Free Software Foundation.
+ */
+#include <linux/io.h>
+#include <linux/kernel.h>
+#include <linux/slab.h>
+
+#include <asm/page.h>
+#include <asm/mach/map.h>
+#include <asm/arch-ns9xxx/processor-ns9360.h>
+#include <asm/arch-ns9xxx/regs-sys-ns9360.h>
+
+void ns9360_reset(char mode)
+{
+       u32 reg;
+
+       reg = __raw_readl(SYS_PLL) >> 16;
+       REGSET(reg, SYS_PLL, SWC, YES);
+       __raw_writel(reg, SYS_PLL);
+}
+
+#define CRYSTAL 29491200 /* Hz */
+unsigned long ns9360_systemclock(void)
+{
+       u32 pll = __raw_readl(SYS_PLL);
+       return CRYSTAL * (REGGETIM(pll, SYS_PLL, ND) + 1)
+               >> REGGETIM(pll, SYS_PLL, FS);
+}
+
+static struct map_desc ns9360_io_desc[] __initdata = {
+       { /* BBus */
+               .virtual = io_p2v(0x90000000),
+               .pfn = __phys_to_pfn(0x90000000),
+               .length = 0x00700000,
+               .type = MT_DEVICE,
+       }, { /* AHB */
+               .virtual = io_p2v(0xa0100000),
+               .pfn = __phys_to_pfn(0xa0100000),
+               .length = 0x00900000,
+               .type = MT_DEVICE,
+       },
+};
+
+void __init ns9360_map_io(void)
+{
+       iotable_init(ns9360_io_desc, ARRAY_SIZE(ns9360_io_desc));
+}
similarity index 62%
rename from arch/arm/mach-ns9xxx/time.c
rename to arch/arm/mach-ns9xxx/time-ns9360.c
index c3dd1f4acb9919e20141c2f187c3ec7ee7f51be2..4d573c9793edcb940f17de5f3d3c519bad996434 100644 (file)
@@ -1,7 +1,7 @@
 /*
- * arch/arm/mach-ns9xxx/time.c
+ * arch/arm/mach-ns9xxx/time-ns9360.c
  *
- * Copyright (C) 2006 by Digi International Inc.
+ * Copyright (C) 2006,2007 by Digi International Inc.
  * All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
@@ -15,8 +15,8 @@
 #include <linux/clocksource.h>
 #include <linux/clockchips.h>
 
-#include <asm/arch-ns9xxx/regs-sys.h>
-#include <asm/arch-ns9xxx/clock.h>
+#include <asm/arch-ns9xxx/processor-ns9360.h>
+#include <asm/arch-ns9xxx/regs-sys-ns9360.h>
 #include <asm/arch-ns9xxx/irqs.h>
 #include <asm/arch/system.h>
 #include "generic.h"
 #define TIMER_CLOCKEVENT 1
 static u32 latch;
 
-static cycle_t ns9xxx_clocksource_read(void)
+static cycle_t ns9360_clocksource_read(void)
 {
        return __raw_readl(SYS_TR(TIMER_CLOCKSOURCE));
 }
 
-static struct clocksource ns9xxx_clocksource = {
-       .name   = "ns9xxx-timer" __stringify(TIMER_CLOCKSOURCE),
+static struct clocksource ns9360_clocksource = {
+       .name   = "ns9360-timer" __stringify(TIMER_CLOCKSOURCE),
        .rating = 300,
-       .read   = ns9xxx_clocksource_read,
+       .read   = ns9360_clocksource_read,
        .mask   = CLOCKSOURCE_MASK(32),
        .shift  = 20,
        .flags  = CLOCK_SOURCE_IS_CONTINUOUS,
 };
 
-static void ns9xxx_clockevent_setmode(enum clock_event_mode mode,
+static void ns9360_clockevent_setmode(enum clock_event_mode mode,
                struct clock_event_device *clk)
 {
        u32 tc = __raw_readl(SYS_TC(TIMER_CLOCKEVENT));
 
-       switch(mode) {
+       switch (mode) {
        case CLOCK_EVT_MODE_PERIODIC:
                __raw_writel(latch, SYS_TRC(TIMER_CLOCKEVENT));
                REGSET(tc, SYS_TCx, REN, EN);
@@ -69,7 +69,7 @@ static void ns9xxx_clockevent_setmode(enum clock_event_mode mode,
        __raw_writel(tc, SYS_TC(TIMER_CLOCKEVENT));
 }
 
-static int ns9xxx_clockevent_setnextevent(unsigned long evt,
+static int ns9360_clockevent_setnextevent(unsigned long evt,
                struct clock_event_device *clk)
 {
        u32 tc = __raw_readl(SYS_TC(TIMER_CLOCKEVENT));
@@ -88,20 +88,20 @@ static int ns9xxx_clockevent_setnextevent(unsigned long evt,
        return 0;
 }
 
-static struct clock_event_device ns9xxx_clockevent_device = {
-       .name           = "ns9xxx-timer" __stringify(TIMER_CLOCKEVENT),
+static struct clock_event_device ns9360_clockevent_device = {
+       .name           = "ns9360-timer" __stringify(TIMER_CLOCKEVENT),
        .shift          = 20,
        .features       = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT,
-       .set_mode       = ns9xxx_clockevent_setmode,
-       .set_next_event = ns9xxx_clockevent_setnextevent,
+       .set_mode       = ns9360_clockevent_setmode,
+       .set_next_event = ns9360_clockevent_setnextevent,
 };
 
-static irqreturn_t ns9xxx_clockevent_handler(int irq, void *dev_id)
+static irqreturn_t ns9360_clockevent_handler(int irq, void *dev_id)
 {
-       int timerno = irq - IRQ_TIMER0;
+       int timerno = irq - IRQ_NS9360_TIMER0;
        u32 tc;
 
-       struct clock_event_device *evt = &ns9xxx_clockevent_device;
+       struct clock_event_device *evt = &ns9360_clockevent_device;
 
        /* clear irq */
        tc = __raw_readl(SYS_TC(timerno));
@@ -119,13 +119,13 @@ static irqreturn_t ns9xxx_clockevent_handler(int irq, void *dev_id)
        return IRQ_HANDLED;
 }
 
-static struct irqaction ns9xxx_clockevent_action = {
-       .name           = "ns9xxx-timer" __stringify(TIMER_CLOCKEVENT),
+static struct irqaction ns9360_clockevent_action = {
+       .name           = "ns9360-timer" __stringify(TIMER_CLOCKEVENT),
        .flags          = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL,
-       .handler        = ns9xxx_clockevent_handler,
+       .handler        = ns9360_clockevent_handler,
 };
 
-static void __init ns9xxx_timer_init(void)
+static void __init ns9360_timer_init(void)
 {
        int tc;
 
@@ -148,12 +148,12 @@ static void __init ns9xxx_timer_init(void)
 
        __raw_writel(tc, SYS_TC(TIMER_CLOCKSOURCE));
 
-       ns9xxx_clocksource.mult = clocksource_hz2mult(ns9xxx_cpuclock(),
-                       ns9xxx_clocksource.shift);
+       ns9360_clocksource.mult = clocksource_hz2mult(ns9360_cpuclock(),
+                       ns9360_clocksource.shift);
 
-       clocksource_register(&ns9xxx_clocksource);
+       clocksource_register(&ns9360_clocksource);
 
-       latch = SH_DIV(ns9xxx_cpuclock(), HZ, 0);
+       latch = SH_DIV(ns9360_cpuclock(), HZ, 0);
 
        tc = __raw_readl(SYS_TC(TIMER_CLOCKEVENT));
        REGSET(tc, SYS_TCx, TEN, DIS);
@@ -166,19 +166,20 @@ static void __init ns9xxx_timer_init(void)
        REGSET(tc, SYS_TCx, REN, EN);
        __raw_writel(tc, SYS_TC(TIMER_CLOCKEVENT));
 
-       ns9xxx_clockevent_device.mult = div_sc(ns9xxx_cpuclock(),
-                       NSEC_PER_SEC, ns9xxx_clockevent_device.shift);
-       ns9xxx_clockevent_device.max_delta_ns =
-               clockevent_delta2ns(-1, &ns9xxx_clockevent_device);
-       ns9xxx_clockevent_device.min_delta_ns =
-               clockevent_delta2ns(1, &ns9xxx_clockevent_device);
+       ns9360_clockevent_device.mult = div_sc(ns9360_cpuclock(),
+                       NSEC_PER_SEC, ns9360_clockevent_device.shift);
+       ns9360_clockevent_device.max_delta_ns =
+               clockevent_delta2ns(-1, &ns9360_clockevent_device);
+       ns9360_clockevent_device.min_delta_ns =
+               clockevent_delta2ns(1, &ns9360_clockevent_device);
 
-       ns9xxx_clockevent_device.cpumask = cpumask_of_cpu(0);
-       clockevents_register_device(&ns9xxx_clockevent_device);
+       ns9360_clockevent_device.cpumask = cpumask_of_cpu(0);
+       clockevents_register_device(&ns9360_clockevent_device);
 
-       setup_irq(IRQ_TIMER0 + TIMER_CLOCKEVENT, &ns9xxx_clockevent_action);
+       setup_irq(IRQ_NS9360_TIMER0 + TIMER_CLOCKEVENT,
+                       &ns9360_clockevent_action);
 }
 
-struct sys_timer ns9xxx_timer = {
-       .init = ns9xxx_timer_init,
+struct sys_timer ns9360_timer = {
+       .init = ns9360_timer_init,
 };
index 015a66b3ca8e3e9631daab5fc6b99753c9bc4267..c06f5254c0f334eed235802f1905a2c9def0771e 100644 (file)
@@ -5,7 +5,8 @@
 # Common support
 obj-y := io.o id.o clock.o irq.o mux.o serial.o devices.o
 
-obj-$(CONFIG_OMAP_MPU_TIMER)           += time.o
+obj-$(CONFIG_OMAP_MPU_TIMER)   += time.o
+obj-$(CONFIG_OMAP_32K_TIMER)   += timer32k.o
 
 # Power Management
 obj-$(CONFIG_PM) += pm.o sleep.o
index 5279e35a8aec17ef89f397f43c1c90939e96864c..4f9baba7d893e2c1b263019b868768876c78ec52 100644 (file)
@@ -32,6 +32,7 @@
 #include <linux/interrupt.h>
 #include <linux/irq.h>
 #include <linux/i2c.h>
+#include <linux/leds.h>
 
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/partitions.h>
@@ -183,11 +184,80 @@ static struct platform_device *osk5912_devices[] __initdata = {
        &osk5912_mcbsp1_device,
 };
 
+static struct gpio_led tps_leds[] = {
+       /* NOTE:  D9 and D2 have hardware blink support.
+        * Also, D9 requires non-battery power.
+        */
+       { .gpio = OSK_TPS_GPIO_LED_D9, .name = "d9", },
+       { .gpio = OSK_TPS_GPIO_LED_D2, .name = "d2", },
+       { .gpio = OSK_TPS_GPIO_LED_D3, .name = "d3", .active_low = 1,
+                       .default_trigger = "heartbeat", },
+};
+
+static struct gpio_led_platform_data tps_leds_data = {
+       .num_leds       = 3,
+       .leds           = tps_leds,
+};
+
+static struct platform_device osk5912_tps_leds = {
+       .name                   = "leds-gpio",
+       .id                     = 0,
+       .dev.platform_data      = &tps_leds_data,
+};
+
+static int osk_tps_setup(struct i2c_client *client, void *context)
+{
+       /* Set GPIO 1 HIGH to disable VBUS power supply;
+        * OHCI driver powers it up/down as needed.
+        */
+       gpio_request(OSK_TPS_GPIO_USB_PWR_EN, "n_vbus_en");
+       gpio_direction_output(OSK_TPS_GPIO_USB_PWR_EN, 1);
+
+       /* Set GPIO 2 high so LED D3 is off by default */
+       tps65010_set_gpio_out_value(GPIO2, HIGH);
+
+       /* Set GPIO 3 low to take ethernet out of reset */
+       gpio_request(OSK_TPS_GPIO_LAN_RESET, "smc_reset");
+       gpio_direction_output(OSK_TPS_GPIO_LAN_RESET, 0);
+
+       /* GPIO4 is VDD_DSP */
+       gpio_request(OSK_TPS_GPIO_DSP_PWR_EN, "dsp_power");
+       gpio_direction_output(OSK_TPS_GPIO_DSP_PWR_EN, 1);
+       /* REVISIT if DSP support isn't configured, power it off ... */
+
+       /* Let LED1 (D9) blink; leds-gpio may override it */
+       tps65010_set_led(LED1, BLINK);
+
+       /* Set LED2 off by default */
+       tps65010_set_led(LED2, OFF);
+
+       /* Enable LOW_PWR handshake */
+       tps65010_set_low_pwr(ON);
+
+       /* Switch VLDO2 to 3.0V for AIC23 */
+       tps65010_config_vregs1(TPS_LDO2_ENABLE | TPS_VLDO2_3_0V
+                       | TPS_LDO1_ENABLE);
+
+       /* register these three LEDs */
+       osk5912_tps_leds.dev.parent = &client->dev;
+       platform_device_register(&osk5912_tps_leds);
+
+       return 0;
+}
+
+static struct tps65010_board tps_board = {
+       .base           = OSK_TPS_GPIO_BASE,
+       .outmask        = 0x0f,
+       .setup          = osk_tps_setup,
+};
+
 static struct i2c_board_info __initdata osk_i2c_board_info[] = {
        {
                I2C_BOARD_INFO("tps65010", 0x48),
                .type           = "tps65010",
                .irq            = OMAP_GPIO_IRQ(OMAP_MPUIO(1)),
+               .platform_data  = &tps_board,
+
        },
        /* TODO when driver support is ready:
         *  - aic23 audio chip at 0x1a
@@ -198,7 +268,7 @@ static struct i2c_board_info __initdata osk_i2c_board_info[] = {
 
 static void __init osk_init_smc91x(void)
 {
-       if ((omap_request_gpio(0)) < 0) {
+       if ((gpio_request(0, "smc_irq")) < 0) {
                printk("Error requesting gpio 0 for smc91x irq\n");
                return;
        }
@@ -210,7 +280,7 @@ static void __init osk_init_smc91x(void)
 static void __init osk_init_cf(void)
 {
        omap_cfg_reg(M7_1610_GPIO62);
-       if ((omap_request_gpio(62)) < 0) {
+       if ((gpio_request(62, "cf_irq")) < 0) {
                printk("Error requesting gpio 62 for CF irq\n");
                return;
        }
@@ -334,7 +404,7 @@ static struct platform_device *mistral_devices[] __initdata = {
 
 static int mistral_get_pendown_state(void)
 {
-       return !omap_get_gpio_datain(4);
+       return !gpio_get_value(4);
 }
 
 static const struct ads7846_platform_data mistral_ts_info = {
@@ -396,25 +466,31 @@ static void __init osk_mistral_init(void)
        omap_cfg_reg(W14_1610_CCP_DATAP);
 
        /* CAM_PWDN */
-       if (omap_request_gpio(11) == 0) {
+       if (gpio_request(11, "cam_pwdn") == 0) {
                omap_cfg_reg(N20_1610_GPIO11);
-               omap_set_gpio_direction(11, 0 /* out */);
-               omap_set_gpio_dataout(11, 0 /* off */);
+               gpio_direction_output(11, 0);
        } else
                pr_debug("OSK+Mistral: CAM_PWDN is awol\n");
 
 
        /* omap_cfg_reg(P19_1610_GPIO6); */     /* BUSY */
+       gpio_request(6, "ts_busy");
+       gpio_direction_input(6);
+
        omap_cfg_reg(P20_1610_GPIO4);   /* PENIRQ */
+       gpio_request(4, "ts_int");
+       gpio_direction_input(4);
        set_irq_type(OMAP_GPIO_IRQ(4), IRQT_FALLING);
+
        spi_register_board_info(mistral_boardinfo,
                        ARRAY_SIZE(mistral_boardinfo));
 
        /* the sideways button (SW1) is for use as a "wakeup" button */
        omap_cfg_reg(N15_1610_MPUIO2);
-       if (omap_request_gpio(OMAP_MPUIO(2)) == 0) {
+       if (gpio_request(OMAP_MPUIO(2), "wakeup") == 0) {
                int ret = 0;
-               omap_set_gpio_direction(OMAP_MPUIO(2), 1);
+
+               gpio_direction_input(OMAP_MPUIO(2));
                set_irq_type(OMAP_GPIO_IRQ(OMAP_MPUIO(2)), IRQT_RISING);
 #ifdef CONFIG_PM
                /* share the IRQ in case someone wants to use the
@@ -425,7 +501,7 @@ static void __init osk_mistral_init(void)
                                IRQF_SHARED, "mistral_wakeup",
                                &osk_mistral_wake_interrupt);
                if (ret != 0) {
-                       omap_free_gpio(OMAP_MPUIO(2));
+                       gpio_free(OMAP_MPUIO(2));
                        printk(KERN_ERR "OSK+Mistral: no wakeup irq, %d?\n",
                                ret);
                } else
@@ -438,10 +514,8 @@ static void __init osk_mistral_init(void)
         * board, like the touchscreen, EEPROM, and wakeup (!) switch.
         */
        omap_cfg_reg(PWL);
-       if (omap_request_gpio(2) == 0) {
-               omap_set_gpio_direction(2, 0 /* out */);
-               omap_set_gpio_dataout(2, 1 /* on */);
-       }
+       if (gpio_request(2, "lcd_pwr") == 0)
+               gpio_direction_output(2, 1);
 
        platform_add_devices(mistral_devices, ARRAY_SIZE(mistral_devices));
 }
@@ -484,44 +558,6 @@ static void __init osk_map_io(void)
        omap1_map_common_io();
 }
 
-#ifdef CONFIG_TPS65010
-static int __init osk_tps_init(void)
-{
-       if (!machine_is_omap_osk())
-               return 0;
-
-       /* Let LED1 (D9) blink */
-       tps65010_set_led(LED1, BLINK);
-
-       /* Disable LED 2 (D2) */
-       tps65010_set_led(LED2, OFF);
-
-       /* Set GPIO 1 HIGH to disable VBUS power supply;
-        * OHCI driver powers it up/down as needed.
-        */
-       tps65010_set_gpio_out_value(GPIO1, HIGH);
-
-       /* Set GPIO 2 low to turn on LED D3 */
-       tps65010_set_gpio_out_value(GPIO2, HIGH);
-
-       /* Set GPIO 3 low to take ethernet out of reset */
-       tps65010_set_gpio_out_value(GPIO3, LOW);
-
-       /* gpio4 for VDD_DSP */
-       /* FIXME send power to DSP iff it's configured */
-
-       /* Enable LOW_PWR */
-       tps65010_set_low_pwr(ON);
-
-       /* Switch VLDO2 to 3.0V for AIC23 */
-       tps65010_config_vregs1(TPS_LDO2_ENABLE | TPS_VLDO2_3_0V
-                       | TPS_LDO1_ENABLE);
-
-       return 0;
-}
-fs_initcall(osk_tps_init);
-#endif
-
 MACHINE_START(OMAP_OSK, "TI-OSK")
        /* Maintainer: Dirk Behme <dirk.behme@de.bosch.com> */
        .phys_io        = 0xfff00000,
index 026685ed461aab5b3c2c7864aa47f83eff40db4f..754383dde807c4050908ae4ea7fa0d438a27b101 100644 (file)
@@ -1,11 +1,9 @@
 /*
  * linux/arch/arm/mach-omap1/leds-osk.c
  *
- * LED driver for OSK, and optionally Mistral QVGA, boards
+ * LED driver for OSK with optional Mistral QVGA board
  */
 #include <linux/init.h>
-#include <linux/workqueue.h>
-#include <linux/i2c/tps65010.h>
 
 #include <asm/hardware.h>
 #include <asm/leds.h>
 #define LED_STATE_CLAIMED      (1 << 1)
 static u8 led_state;
 
-#define        GREEN_LED               (1 << 0)        /* TPS65010 LED1 */
-#define        AMBER_LED               (1 << 1)        /* TPS65010 LED2 */
-#define        RED_LED                 (1 << 2)        /* TPS65010 GPIO2 */
 #define        TIMER_LED               (1 << 3)        /* Mistral board */
 #define        IDLE_LED                (1 << 4)        /* Mistral board */
 static u8 hw_led_state;
 
 
-/* TPS65010 leds are changed using i2c -- from a task context.
- * Using one of these for the "idle" LED would be impractical...
- */
-#define        TPS_LEDS        (GREEN_LED | RED_LED | AMBER_LED)
-
-static u8 tps_leds_change;
-
-static void tps_work(struct work_struct *unused)
-{
-       for (;;) {
-               u8      leds;
-
-               local_irq_disable();
-               leds = tps_leds_change;
-               tps_leds_change = 0;
-               local_irq_enable();
-
-               if (!leds)
-                       break;
-
-               /* careful:  the set_led() value is on/off/blink */
-               if (leds & GREEN_LED)
-                       tps65010_set_led(LED1, !!(hw_led_state & GREEN_LED));
-               if (leds & AMBER_LED)
-                       tps65010_set_led(LED2, !!(hw_led_state & AMBER_LED));
-
-               /* the gpio led doesn't have that issue */
-               if (leds & RED_LED)
-                       tps65010_set_gpio_out_value(GPIO2,
-                                       !(hw_led_state & RED_LED));
-       }
-}
-
-static DECLARE_WORK(work, tps_work);
-
 #ifdef CONFIG_OMAP_OSK_MISTRAL
 
 /* For now, all system indicators require the Mistral board, since that
@@ -112,7 +72,6 @@ void osk_leds_event(led_event_t evt)
        case led_stop:
                led_state &= ~LED_STATE_ENABLED;
                hw_led_state = 0;
-               /* NOTE:  work may still be pending!! */
                break;
 
        case led_claim:
@@ -145,48 +104,11 @@ void osk_leds_event(led_event_t evt)
 
 #endif /* CONFIG_OMAP_OSK_MISTRAL */
 
-       /* "green" == tps LED1 (leftmost, normally power-good)
-        * works only with DC adapter, not on battery power!
-        */
-       case led_green_on:
-               if (led_state & LED_STATE_CLAIMED)
-                       hw_led_state |= GREEN_LED;
-               break;
-       case led_green_off:
-               if (led_state & LED_STATE_CLAIMED)
-                       hw_led_state &= ~GREEN_LED;
-               break;
-
-       /* "amber" == tps LED2 (middle) */
-       case led_amber_on:
-               if (led_state & LED_STATE_CLAIMED)
-                       hw_led_state |= AMBER_LED;
-               break;
-       case led_amber_off:
-               if (led_state & LED_STATE_CLAIMED)
-                       hw_led_state &= ~AMBER_LED;
-               break;
-
-       /* "red" == LED on tps gpio3 (rightmost) */
-       case led_red_on:
-               if (led_state & LED_STATE_CLAIMED)
-                       hw_led_state |= RED_LED;
-               break;
-       case led_red_off:
-               if (led_state & LED_STATE_CLAIMED)
-                       hw_led_state &= ~RED_LED;
-               break;
-
        default:
                break;
        }
 
        leds ^= hw_led_state;
-       leds &= TPS_LEDS;
-       if (leds && (led_state & LED_STATE_CLAIMED)) {
-               tps_leds_change |= leds;
-               schedule_work(&work);
-       }
 
 done:
        local_irq_restore(flags);
index 52c70e5fcf65ea459e6443be8ec5a221a627be99..e207bf7cb8537aa0c8f89d2664276604a3e9c848 100644 (file)
@@ -3,9 +3,9 @@
  *
  * OMAP1 pin multiplexing configurations
  *
- * Copyright (C) 2003 - 2005 Nokia Corporation
+ * Copyright (C) 2003 - 2008 Nokia Corporation
  *
- * Written by Tony Lindgren <tony.lindgren@nokia.com>
+ * Written by Tony Lindgren
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
 
 #ifdef CONFIG_OMAP_MUX
 
+static struct omap_mux_cfg arch_mux_cfg;
+
 #ifdef CONFIG_ARCH_OMAP730
-struct pin_config __initdata_or_module omap730_pins[] = {
+static struct pin_config __initdata_or_module omap730_pins[] = {
 MUX_CFG_730("E2_730_KBR0",        12,   21,    0,   20,   1, 0)
 MUX_CFG_730("J7_730_KBR1",        12,   25,    0,   24,   1, 0)
 MUX_CFG_730("E1_730_KBR2",        12,   29,    0,   28,   1, 0)
@@ -49,10 +51,14 @@ MUX_CFG_730("AA17_730_USB_DM",     2,   21,    0,   20,   0, 0)
 MUX_CFG_730("W16_730_USB_PU_EN",   2,   25,    0,   24,   0, 0)
 MUX_CFG_730("W17_730_USB_VBUSI",   2,   29,    0,   28,   0, 0)
 };
-#endif
+#define OMAP730_PINS_SZ                ARRAY_SIZE(omap730_pins)
+#else
+#define omap730_pins           NULL
+#define OMAP730_PINS_SZ                0
+#endif /* CONFIG_ARCH_OMAP730 */
 
 #if defined(CONFIG_ARCH_OMAP15XX) || defined(CONFIG_ARCH_OMAP16XX)
-struct pin_config __initdata_or_module omap1xxx_pins[] = {
+static struct pin_config __initdata_or_module omap1xxx_pins[] = {
 /*
  *      description            mux  mode   mux  pull pull  pull  pu_pd  pu  dbg
  *                             reg  offset mode reg  bit   ena   reg
@@ -306,22 +312,136 @@ MUX_CFG("Y12_1610_CCP_CLKP",      8,   18,    6,   1,  24,   1,    1,     0,  0)
 MUX_CFG("W13_1610_CCP_CLKM",    9,    0,    6,   1,  28,   1,    1,     0,  0)
 MUX_CFG("W14_1610_CCP_DATAP",   9,   24,    6,   2,   4,   1,    2,     0,  0)
 MUX_CFG("Y14_1610_CCP_DATAM",   9,   21,    6,   2,   3,   1,    2,     0,  0)
-
 };
+#define OMAP1XXX_PINS_SZ       ARRAY_SIZE(omap1xxx_pins)
+#else
+#define omap1xxx_pins          NULL
+#define OMAP1XXX_PINS_SZ       0
 #endif /* CONFIG_ARCH_OMAP15XX || CONFIG_ARCH_OMAP16XX */
 
-int __init omap1_mux_init(void)
+int __init_or_module omap1_cfg_reg(const struct pin_config *cfg)
 {
-
-#ifdef CONFIG_ARCH_OMAP730
-       omap_mux_register(omap730_pins, ARRAY_SIZE(omap730_pins));
+       static DEFINE_SPINLOCK(mux_spin_lock);
+       unsigned long flags;
+       unsigned int reg_orig = 0, reg = 0, pu_pd_orig = 0, pu_pd = 0,
+               pull_orig = 0, pull = 0;
+       unsigned int mask, warn = 0;
+
+       /* Check the mux register in question */
+       if (cfg->mux_reg) {
+               unsigned        tmp1, tmp2;
+
+               spin_lock_irqsave(&mux_spin_lock, flags);
+               reg_orig = omap_readl(cfg->mux_reg);
+
+               /* The mux registers always seem to be 3 bits long */
+               mask = (0x7 << cfg->mask_offset);
+               tmp1 = reg_orig & mask;
+               reg = reg_orig & ~mask;
+
+               tmp2 = (cfg->mask << cfg->mask_offset);
+               reg |= tmp2;
+
+               if (tmp1 != tmp2)
+                       warn = 1;
+
+               omap_writel(reg, cfg->mux_reg);
+               spin_unlock_irqrestore(&mux_spin_lock, flags);
+       }
+
+       /* Check for pull up or pull down selection on 1610 */
+       if (!cpu_is_omap15xx()) {
+               if (cfg->pu_pd_reg && cfg->pull_val) {
+                       spin_lock_irqsave(&mux_spin_lock, flags);
+                       pu_pd_orig = omap_readl(cfg->pu_pd_reg);
+                       mask = 1 << cfg->pull_bit;
+
+                       if (cfg->pu_pd_val) {
+                               if (!(pu_pd_orig & mask))
+                                       warn = 1;
+                               /* Use pull up */
+                               pu_pd = pu_pd_orig | mask;
+                       } else {
+                               if (pu_pd_orig & mask)
+                                       warn = 1;
+                               /* Use pull down */
+                               pu_pd = pu_pd_orig & ~mask;
+                       }
+                       omap_writel(pu_pd, cfg->pu_pd_reg);
+                       spin_unlock_irqrestore(&mux_spin_lock, flags);
+               }
+       }
+
+       /* Check for an associated pull down register */
+       if (cfg->pull_reg) {
+               spin_lock_irqsave(&mux_spin_lock, flags);
+               pull_orig = omap_readl(cfg->pull_reg);
+               mask = 1 << cfg->pull_bit;
+
+               if (cfg->pull_val) {
+                       if (pull_orig & mask)
+                               warn = 1;
+                       /* Low bit = pull enabled */
+                       pull = pull_orig & ~mask;
+               } else {
+                       if (!(pull_orig & mask))
+                               warn = 1;
+                       /* High bit = pull disabled */
+                       pull = pull_orig | mask;
+               }
+
+               omap_writel(pull, cfg->pull_reg);
+               spin_unlock_irqrestore(&mux_spin_lock, flags);
+       }
+
+       if (warn) {
+#ifdef CONFIG_OMAP_MUX_WARNINGS
+               printk(KERN_WARNING "MUX: initialized %s\n", cfg->name);
 #endif
-
-#if defined(CONFIG_ARCH_OMAP15XX) || defined(CONFIG_ARCH_OMAP16XX)
-       omap_mux_register(omap1xxx_pins, ARRAY_SIZE(omap1xxx_pins));
+       }
+
+#ifdef CONFIG_OMAP_MUX_DEBUG
+       if (cfg->debug || warn) {
+               printk("MUX: Setting register %s\n", cfg->name);
+               printk("      %s (0x%08x) = 0x%08x -> 0x%08x\n",
+                      cfg->mux_reg_name, cfg->mux_reg, reg_orig, reg);
+
+               if (!cpu_is_omap15xx()) {
+                       if (cfg->pu_pd_reg && cfg->pull_val) {
+                               printk("      %s (0x%08x) = 0x%08x -> 0x%08x\n",
+                                      cfg->pu_pd_name, cfg->pu_pd_reg,
+                                      pu_pd_orig, pu_pd);
+                       }
+               }
+
+               if (cfg->pull_reg)
+                       printk("      %s (0x%08x) = 0x%08x -> 0x%08x\n",
+                              cfg->pull_name, cfg->pull_reg, pull_orig, pull);
+       }
 #endif
 
+#ifdef CONFIG_OMAP_MUX_ERRORS
+       return warn ? -ETXTBSY : 0;
+#else
        return 0;
+#endif
+}
+
+int __init omap1_mux_init(void)
+{
+       if (cpu_is_omap730()) {
+               arch_mux_cfg.pins       = omap730_pins;
+               arch_mux_cfg.size       = OMAP730_PINS_SZ;
+               arch_mux_cfg.cfg_reg    = omap1_cfg_reg;
+       }
+
+       if (cpu_is_omap15xx() || cpu_is_omap16xx()) {
+               arch_mux_cfg.pins       = omap1xxx_pins;
+               arch_mux_cfg.size       = OMAP1XXX_PINS_SZ;
+               arch_mux_cfg.cfg_reg    = omap1_cfg_reg;
+       }
+
+       return omap_mux_register(&arch_mux_cfg);
 }
 
 #endif
index a4f8b2055437af7efe56dbbe85edc4dfa9084331..5d2b270935a2f32bee749c8e1818d153c7ad74a6 100644 (file)
 #define OMAP_MPU_TIMER_BASE            OMAP_MPU_TIMER1_BASE
 #define OMAP_MPU_TIMER_OFFSET          0x100
 
-/* cycles to nsec conversions taken from arch/i386/kernel/timers/timer_tsc.c,
- * converted to use kHz by Kevin Hilman */
-/* convert from cycles(64bits) => nanoseconds (64bits)
- *  basic equation:
- *             ns = cycles / (freq / ns_per_sec)
- *             ns = cycles * (ns_per_sec / freq)
- *             ns = cycles * (10^9 / (cpu_khz * 10^3))
- *             ns = cycles * (10^6 / cpu_khz)
- *
- *     Then we use scaling math (suggested by george at mvista.com) to get:
- *             ns = cycles * (10^6 * SC / cpu_khz / SC
- *             ns = cycles * cyc2ns_scale / SC
- *
- *     And since SC is a constant power of two, we can convert the div
- *  into a shift.
- *                     -johnstul at us.ibm.com "math is hard, lets go shopping!"
- */
-static unsigned long cyc2ns_scale;
-#define CYC2NS_SCALE_FACTOR 10 /* 2^10, carefully chosen */
-
-static inline void set_cyc2ns_scale(unsigned long cpu_khz)
-{
-       cyc2ns_scale = (1000000 << CYC2NS_SCALE_FACTOR)/cpu_khz;
-}
-
-static inline unsigned long long cycles_2_ns(unsigned long long cyc)
-{
-       return (cyc * cyc2ns_scale) >> CYC2NS_SCALE_FACTOR;
-}
-
-
 typedef struct {
        u32 cntl;                       /* CNTL_TIMER, R/W */
        u32 load_tim;                   /* LOAD_TIM,   W */
@@ -194,8 +163,6 @@ static struct irqaction omap_mpu_timer1_irq = {
 
 static __init void omap_init_mpu_timer(unsigned long rate)
 {
-       set_cyc2ns_scale(rate / 1000);
-
        setup_irq(INT_TIMER1, &omap_mpu_timer1_irq);
        omap_mpu_timer_start(0, (rate / HZ) - 1, 1);
 
@@ -260,22 +227,6 @@ static void __init omap_init_clocksource(unsigned long rate)
                printk(err, clocksource_mpu.name);
 }
 
-
-/*
- * Scheduler clock - returns current time in nanosec units.
- */
-unsigned long long sched_clock(void)
-{
-       unsigned long ticks = 0 - omap_mpu_timer_read(1);
-       unsigned long long ticks64;
-
-       ticks64 = omap_mpu_timer2_overflows;
-       ticks64 <<= 32;
-       ticks64 |= ticks;
-
-       return cycles_2_ns(ticks64);
-}
-
 /*
  * ---------------------------------------------------------------------------
  * Timer initialization
similarity index 75%
rename from arch/arm/plat-omap/timer32k.c
rename to arch/arm/mach-omap1/timer32k.c
index ea76f1979a3de0a178021d68f5c2f8927694e3c0..fbbdb806c95a57e6f338250b6760605a43a064ba 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * linux/arch/arm/plat-omap/timer32k.c
+ * linux/arch/arm/mach-omap1/timer32k.c
  *
  * OMAP 32K Timer
  *
@@ -70,8 +70,6 @@ struct sys_timer omap_timer;
 
 #if defined(CONFIG_ARCH_OMAP16XX)
 #define TIMER_32K_SYNCHRONIZED         0xfffbc410
-#elif defined(CONFIG_ARCH_OMAP24XX)
-#define TIMER_32K_SYNCHRONIZED         (OMAP24XX_32KSYNCT_BASE + 0x10)
 #else
 #error OMAP 32KHz timer does not currently work on 15XX!
 #endif
@@ -93,8 +91,6 @@ struct sys_timer omap_timer;
 #define JIFFIES_TO_HW_TICKS(nr_jiffies, clock_rate)                    \
                                (((nr_jiffies) * (clock_rate)) / HZ)
 
-#if defined(CONFIG_ARCH_OMAP1)
-
 static inline void omap_32k_timer_write(int val, int reg)
 {
        omap_writew(val, OMAP1_32K_TIMER_BASE + reg);
@@ -120,30 +116,14 @@ static inline void omap_32k_timer_stop(void)
 
 #define omap_32k_timer_ack_irq()
 
-#elif defined(CONFIG_ARCH_OMAP2)
-
-static struct omap_dm_timer *gptimer;
-
-static inline void omap_32k_timer_start(unsigned long load_val)
-{
-       omap_dm_timer_set_load(gptimer, 1, 0xffffffff - load_val);
-       omap_dm_timer_set_int_enable(gptimer, OMAP_TIMER_INT_OVERFLOW);
-       omap_dm_timer_start(gptimer);
-}
-
-static inline void omap_32k_timer_stop(void)
+static int omap_32k_timer_set_next_event(unsigned long delta,
+                                        struct clock_event_device *dev)
 {
-       omap_dm_timer_stop(gptimer);
-}
+       omap_32k_timer_start(delta);
 
-static inline void omap_32k_timer_ack_irq(void)
-{
-       u32 status = omap_dm_timer_read_status(gptimer);
-       omap_dm_timer_write_status(gptimer, status);
+       return 0;
 }
 
-#endif
-
 static void omap_32k_timer_set_mode(enum clock_event_mode mode,
                                    struct clock_event_device *evt)
 {
@@ -164,8 +144,9 @@ static void omap_32k_timer_set_mode(enum clock_event_mode mode,
 
 static struct clock_event_device clockevent_32k_timer = {
        .name           = "32k-timer",
-       .features       = CLOCK_EVT_FEAT_PERIODIC,
+       .features       = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT,
        .shift          = 32,
+       .set_next_event = omap_32k_timer_set_next_event,
        .set_mode       = omap_32k_timer_set_mode,
 };
 
@@ -178,32 +159,6 @@ static inline unsigned long omap_32k_sync_timer_read(void)
        return omap_readl(TIMER_32K_SYNCHRONIZED);
 }
 
-/*
- * Rounds down to nearest usec. Note that this will overflow for larger values.
- */
-static inline unsigned long omap_32k_ticks_to_usecs(unsigned long ticks_32k)
-{
-       return (ticks_32k * 5*5*5*5*5*5) >> 9;
-}
-
-/*
- * Rounds down to nearest nsec.
- */
-static inline unsigned long long
-omap_32k_ticks_to_nsecs(unsigned long ticks_32k)
-{
-       return (unsigned long long) ticks_32k * 1000 * 5*5*5*5*5*5 >> 9;
-}
-
-/*
- * Returns current time from boot in nsecs. It's OK for this to wrap
- * around for now, as it's just a relative time stamp.
- */
-unsigned long long sched_clock(void)
-{
-       return omap_32k_ticks_to_nsecs(omap_32k_sync_timer_read());
-}
-
 static irqreturn_t omap_32k_timer_interrupt(int irq, void *dev_id)
 {
        struct clock_event_device *evt = &clockevent_32k_timer;
@@ -222,22 +177,7 @@ static struct irqaction omap_32k_timer_irq = {
 
 static __init void omap_init_32k_timer(void)
 {
-       if (cpu_class_is_omap1())
-               setup_irq(INT_OS_TIMER, &omap_32k_timer_irq);
-
-#ifdef CONFIG_ARCH_OMAP2
-       /* REVISIT: Check 24xx TIOCP_CFG settings after idle works */
-       if (cpu_is_omap24xx()) {
-               gptimer = omap_dm_timer_request_specific(1);
-               BUG_ON(gptimer == NULL);
-
-               omap_dm_timer_set_source(gptimer, OMAP_TIMER_SRC_32_KHZ);
-               setup_irq(omap_dm_timer_get_irq(gptimer), &omap_32k_timer_irq);
-               omap_dm_timer_set_int_enable(gptimer,
-                       OMAP_TIMER_INT_CAPTURE | OMAP_TIMER_INT_OVERFLOW |
-                       OMAP_TIMER_INT_MATCH);
-       }
-#endif
+       setup_irq(INT_OS_TIMER, &omap_32k_timer_irq);
 
        clockevent_32k_timer.mult = div_sc(OMAP_32K_TICKS_PER_SEC,
                                           NSEC_PER_SEC,
index b05b738d31e64df26d190c0a2a359e6e76a03708..2feb6870b735d8ed49297a51ecb223fad90e47bd 100644 (file)
@@ -3,13 +3,15 @@
 #
 
 # Common support
-obj-y := irq.o id.o io.o sram-fn.o memory.o prcm.o clock.o mux.o devices.o \
-        serial.o gpmc.o
-
-obj-$(CONFIG_OMAP_MPU_TIMER)           += timer-gp.o
+obj-y := irq.o id.o io.o sram-fn.o memory.o control.o prcm.o clock.o mux.o \
+               devices.o serial.o gpmc.o timer-gp.o
 
 # Power Management
-obj-$(CONFIG_PM) += pm.o pm-domain.o sleep.o
+obj-$(CONFIG_PM) += pm.o sleep.o
+
+# Clock framework
+obj-$(CONFIG_ARCH_OMAP2)               += clock24xx.o
+obj-$(CONFIG_ARCH_OMAP3)               += clock34xx.o
 
 # Specific board support
 obj-$(CONFIG_MACH_OMAP_GENERIC)                += board-generic.o
index 64235dee561445b9ae5776912b974771d3589944..1c12d7c6c7fc82cc4734d625b4c6bdc0c3cfbe23 100644 (file)
@@ -33,7 +33,6 @@
 #include <asm/arch/board.h>
 #include <asm/arch/common.h>
 #include <asm/arch/gpmc.h>
-#include "prcm-regs.h"
 
 #include <asm/io.h>
 
@@ -125,15 +124,18 @@ static inline void __init sdp2430_init_smc91x(void)
        int eth_cs;
        unsigned long cs_mem_base;
        unsigned int rate;
-       struct clk *l3ck;
+       struct clk *gpmc_fck;
 
        eth_cs = SDP2430_SMC91X_CS;
 
-       l3ck = clk_get(NULL, "core_l3_ck");
-       if (IS_ERR(l3ck))
-               rate = 100000000;
-       else
-               rate = clk_get_rate(l3ck);
+       gpmc_fck = clk_get(NULL, "gpmc_fck");   /* Always on ENABLE_ON_INIT */
+       if (IS_ERR(gpmc_fck)) {
+               WARN_ON(1);
+               return;
+       }
+
+       clk_enable(gpmc_fck);
+       rate = clk_get_rate(gpmc_fck);
 
        /* Make sure CS1 timings are correct, for 2430 always muxed */
        gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG1, 0x00011200);
@@ -160,7 +162,7 @@ static inline void __init sdp2430_init_smc91x(void)
 
        if (gpmc_cs_request(eth_cs, SZ_16M, &cs_mem_base) < 0) {
                printk(KERN_ERR "Failed to request GPMC mem for smc91x\n");
-               return;
+               goto out;
        }
 
        sdp2430_smc91x_resources[0].start = cs_mem_base + 0x300;
@@ -171,10 +173,13 @@ static inline void __init sdp2430_init_smc91x(void)
                printk(KERN_ERR "Failed to request GPIO%d for smc91x IRQ\n",
                        OMAP24XX_ETHR_GPIO_IRQ);
                gpmc_cs_free(eth_cs);
-               return;
+               goto out;
        }
        omap_set_gpio_direction(OMAP24XX_ETHR_GPIO_IRQ, 1);
 
+out:
+       clk_disable(gpmc_fck);
+       clk_put(gpmc_fck);
 }
 
 static void __init omap_2430sdp_init_irq(void)
index 7846551f05752cb7f25c16346a9d1eb69890cb6f..a1e1e6765b5be9d79b3f194c7e1c55a04a4a99bd 100644 (file)
@@ -26,6 +26,8 @@
 #include <linux/interrupt.h>
 #include <linux/delay.h>
 #include <linux/leds.h>
+#include <linux/err.h>
+#include <linux/clk.h>
 
 #include <asm/hardware.h>
 #include <asm/mach-types.h>
@@ -39,7 +41,7 @@
 #include <asm/arch/board.h>
 #include <asm/arch/common.h>
 #include <asm/arch/gpmc.h>
-#include "prcm-regs.h"
+#include <asm/arch/control.h>
 
 /* LED & Switch macros */
 #define LED0_GPIO13            13
@@ -187,17 +189,47 @@ static inline void __init apollon_init_smc91x(void)
 {
        unsigned long base;
 
+       unsigned int rate;
+       struct clk *gpmc_fck;
+       int eth_cs;
+
+       gpmc_fck = clk_get(NULL, "gpmc_fck");   /* Always on ENABLE_ON_INIT */
+       if (IS_ERR(gpmc_fck)) {
+               WARN_ON(1);
+               return;
+       }
+
+       clk_enable(gpmc_fck);
+       rate = clk_get_rate(gpmc_fck);
+
+       eth_cs = APOLLON_ETH_CS;
+
        /* Make sure CS1 timings are correct */
-       GPMC_CONFIG1_1 = 0x00011203;
-       GPMC_CONFIG2_1 = 0x001f1f01;
-       GPMC_CONFIG3_1 = 0x00080803;
-       GPMC_CONFIG4_1 = 0x1c091c09;
-       GPMC_CONFIG5_1 = 0x041f1f1f;
-       GPMC_CONFIG6_1 = 0x000004c4;
+       gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG1, 0x00011200);
+
+       if (rate >= 160000000) {
+               gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG2, 0x001f1f01);
+               gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG3, 0x00080803);
+               gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG4, 0x1c0b1c0a);
+               gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG5, 0x041f1F1F);
+               gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG6, 0x000004C4);
+       } else if (rate >= 130000000) {
+               gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG2, 0x001f1f00);
+               gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG3, 0x00080802);
+               gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG4, 0x1C091C09);
+               gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG5, 0x041f1F1F);
+               gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG6, 0x000004C4);
+       } else {/* rate = 100000000 */
+               gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG2, 0x001f1f00);
+               gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG3, 0x00080802);
+               gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG4, 0x1C091C09);
+               gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG5, 0x031A1F1F);
+               gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG6, 0x000003C2);
+       }
 
        if (gpmc_cs_request(APOLLON_ETH_CS, SZ_16M, &base) < 0) {
                printk(KERN_ERR "Failed to request GPMC CS for smc91x\n");
-               return;
+               goto out;
        }
        apollon_smc91x_resources[0].start = base + 0x300;
        apollon_smc91x_resources[0].end   = base + 0x30f;
@@ -208,9 +240,13 @@ static inline void __init apollon_init_smc91x(void)
                printk(KERN_ERR "Failed to request GPIO%d for smc91x IRQ\n",
                        APOLLON_ETHR_GPIO_IRQ);
                gpmc_cs_free(APOLLON_ETH_CS);
-               return;
+               goto out;
        }
        omap_set_gpio_direction(APOLLON_ETHR_GPIO_IRQ, 1);
+
+out:
+       clk_disable(gpmc_fck);
+       clk_put(gpmc_fck);
 }
 
 static void __init omap_apollon_init_irq(void)
@@ -330,6 +366,8 @@ static void __init apollon_usb_init(void)
 
 static void __init omap_apollon_init(void)
 {
+       u32 v;
+
        apollon_led_init();
        apollon_sw_init();
        apollon_flash_init();
@@ -339,7 +377,9 @@ static void __init omap_apollon_init(void)
        omap_cfg_reg(W19_24XX_SYS_NIRQ);
 
        /* Use Interal loop-back in MMC/SDIO Module Input Clock selection */
-       CONTROL_DEVCONF |= (1 << 24);
+       v = omap_ctrl_readl(OMAP2_CONTROL_DEVCONF0);
+       v |= (1 << 24);
+       omap_ctrl_writel(v, OMAP2_CONTROL_DEVCONF0);
 
        /*
         * Make sure the serial ports are muxed on at this point.
index f125f432cc3ea27cc6254388c67e910677baca0a..d1915f99a5fa9c09a96a900b78c27fe8ea3f4385 100644 (file)
@@ -19,6 +19,8 @@
 #include <linux/delay.h>
 #include <linux/workqueue.h>
 #include <linux/input.h>
+#include <linux/err.h>
+#include <linux/clk.h>
 
 #include <asm/hardware.h>
 #include <asm/mach-types.h>
@@ -26,6 +28,7 @@
 #include <asm/mach/map.h>
 #include <asm/mach/flash.h>
 
+#include <asm/arch/control.h>
 #include <asm/arch/gpio.h>
 #include <asm/arch/gpioexpander.h>
 #include <asm/arch/mux.h>
 #include <asm/arch/keypad.h>
 #include <asm/arch/menelaus.h>
 #include <asm/arch/dma.h>
-#include "prcm-regs.h"
+#include <asm/arch/gpmc.h>
 
 #include <asm/io.h>
 
+#define H4_FLASH_CS    0
+#define H4_SMC91X_CS   1
+
 static unsigned int row_gpios[6] = { 88, 89, 124, 11, 6, 96 };
 static unsigned int col_gpios[7] = { 90, 91, 100, 36, 12, 97, 98 };
 
@@ -116,8 +122,6 @@ static struct flash_platform_data h4_flash_data = {
 };
 
 static struct resource h4_flash_resource = {
-       .start          = H4_CS0_BASE,
-       .end            = H4_CS0_BASE + SZ_64M - 1,
        .flags          = IORESOURCE_MEM,
 };
 
@@ -253,21 +257,107 @@ static struct platform_device *h4_devices[] __initdata = {
        &h4_lcd_device,
 };
 
+/* 2420 Sysboot setup (2430 is different) */
+static u32 get_sysboot_value(void)
+{
+       return (omap_ctrl_readl(OMAP24XX_CONTROL_STATUS) &
+               (OMAP2_SYSBOOT_5_MASK | OMAP2_SYSBOOT_4_MASK |
+                OMAP2_SYSBOOT_3_MASK | OMAP2_SYSBOOT_2_MASK |
+                OMAP2_SYSBOOT_1_MASK | OMAP2_SYSBOOT_0_MASK));
+}
+
+/* H4-2420's always used muxed mode, H4-2422's always use non-muxed
+ *
+ * Note: OMAP-GIT doesn't correctly do is_cpu_omap2422 and is_cpu_omap2423
+ *  correctly.  The macro needs to look at production_id not just hawkeye.
+ */
+static u32 is_gpmc_muxed(void)
+{
+       u32 mux;
+       mux = get_sysboot_value();
+       if ((mux & 0xF) == 0xd)
+               return 1;       /* NAND config (could be either) */
+       if (mux & 0x2)          /* if mux'ed */
+               return 1;
+       else
+               return 0;
+}
+
 static inline void __init h4_init_debug(void)
 {
+       int eth_cs;
+       unsigned long cs_mem_base;
+       unsigned int muxed, rate;
+       struct clk *gpmc_fck;
+
+       eth_cs  = H4_SMC91X_CS;
+
+       gpmc_fck = clk_get(NULL, "gpmc_fck");   /* Always on ENABLE_ON_INIT */
+       if (IS_ERR(gpmc_fck)) {
+               WARN_ON(1);
+               return;
+       }
+
+       clk_enable(gpmc_fck);
+       rate = clk_get_rate(gpmc_fck);
+       clk_disable(gpmc_fck);
+       clk_put(gpmc_fck);
+
+       if (is_gpmc_muxed())
+               muxed = 0x200;
+       else
+               muxed = 0;
+
        /* Make sure CS1 timings are correct */
-       GPMC_CONFIG1_1 = 0x00011200;
-       GPMC_CONFIG2_1 = 0x001f1f01;
-       GPMC_CONFIG3_1 = 0x00080803;
-       GPMC_CONFIG4_1 = 0x1c091c09;
-       GPMC_CONFIG5_1 = 0x041f1f1f;
-       GPMC_CONFIG6_1 = 0x000004c4;
-       GPMC_CONFIG7_1 = 0x00000f40 | (0x08000000 >> 24);
+       gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG1,
+                         0x00011000 | muxed);
+
+       if (rate >= 160000000) {
+               gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG2, 0x001f1f01);
+               gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG3, 0x00080803);
+               gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG4, 0x1c0b1c0a);
+               gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG5, 0x041f1F1F);
+               gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG6, 0x000004C4);
+       } else if (rate >= 130000000) {
+               gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG2, 0x001f1f00);
+               gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG3, 0x00080802);
+               gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG4, 0x1C091C09);
+               gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG5, 0x041f1F1F);
+               gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG6, 0x000004C4);
+       } else {/* rate = 100000000 */
+               gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG2, 0x001f1f00);
+               gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG3, 0x00080802);
+               gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG4, 0x1C091C09);
+               gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG5, 0x031A1F1F);
+               gpmc_cs_write_reg(eth_cs, GPMC_CS_CONFIG6, 0x000003C2);
+       }
+
+       if (gpmc_cs_request(eth_cs, SZ_16M, &cs_mem_base) < 0) {
+               printk(KERN_ERR "Failed to request GPMC mem for smc91x\n");
+               goto out;
+       }
+
        udelay(100);
 
        omap_cfg_reg(M15_24XX_GPIO92);
        if (debug_card_init(cs_mem_base, OMAP24XX_ETHR_GPIO_IRQ) < 0)
                gpmc_cs_free(eth_cs);
+
+out:
+       clk_disable(gpmc_fck);
+       clk_put(gpmc_fck);
+}
+
+static void __init h4_init_flash(void)
+{
+       unsigned long base;
+
+       if (gpmc_cs_request(H4_FLASH_CS, SZ_64M, &base) < 0) {
+               printk("Can't request GPMC CS for flash\n");
+               return;
+       }
+       h4_flash_resource.start = base;
+       h4_flash_resource.end   = base + SZ_64M - 1;
 }
 
 static void __init omap_h4_init_irq(void)
@@ -275,6 +365,7 @@ static void __init omap_h4_init_irq(void)
        omap2_init_common_hw();
        omap_init_irq();
        omap_gpio_init();
+       h4_init_flash();
 }
 
 static struct omap_uart_config h4_uart_config __initdata = {
index e6e85b7b097b0e926f977034aea98515da2321fb..b57ffb5a22a521d44aa91bdf368f7433f9ca3591 100644 (file)
@@ -1,20 +1,19 @@
 /*
  *  linux/arch/arm/mach-omap2/clock.c
  *
- *  Copyright (C) 2005 Texas Instruments Inc.
- *  Richard Woodruff <r-woodruff2@ti.com>
- *  Created for OMAP2.
- *
- *  Cleaned up and modified to use omap shared clock framework by
- *  Tony Lindgren <tony@atomide.com>
+ *  Copyright (C) 2005-2008 Texas Instruments, Inc.
+ *  Copyright (C) 2004-2008 Nokia Corporation
  *
- *  Based on omap1 clock.c, Copyright (C) 2004 - 2005 Nokia corporation
- *  Written by Tuukka Tikkanen <tuukka.tikkanen@elektrobit.com>
+ *  Contacts:
+ *  Richard Woodruff <r-woodruff2@ti.com>
+ *  Paul Walmsley
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
  */
+#undef DEBUG
+
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/device.h>
 #include <linux/errno.h>
 #include <linux/delay.h>
 #include <linux/clk.h>
+#include <asm/bitops.h>
 
 #include <asm/io.h>
 
 #include <asm/arch/clock.h>
 #include <asm/arch/sram.h>
+#include <asm/arch/cpu.h>
 #include <asm/div64.h>
 
-#include "prcm-regs.h"
 #include "memory.h"
+#include "sdrc.h"
 #include "clock.h"
+#include "prm.h"
+#include "prm-regbits-24xx.h"
+#include "cm.h"
+#include "cm-regbits-24xx.h"
+#include "cm-regbits-34xx.h"
 
-#undef DEBUG
-
-//#define DOWN_VARIABLE_DPLL 1                 /* Experimental */
+#define MAX_CLOCK_ENABLE_WAIT          100000
 
-static struct prcm_config *curr_prcm_set;
-static u32 curr_perf_level = PRCM_FULL_SPEED;
-static struct clk *vclk;
-static struct clk *sclk;
+u8 cpu_mask;
 
 /*-------------------------------------------------------------------------
  * Omap2 specific clock functions
  *-------------------------------------------------------------------------*/
 
-/* Recalculate SYST_CLK */
-static void omap2_sys_clk_recalc(struct clk * clk)
+/**
+ * omap2_init_clksel_parent - set a clksel clk's parent field from the hardware
+ * @clk: OMAP clock struct ptr to use
+ *
+ * Given a pointer to a source-selectable struct clk, read the hardware
+ * register and determine what its parent is currently set to.  Update the
+ * clk->parent field with the appropriate clk ptr.
+ */
+void omap2_init_clksel_parent(struct clk *clk)
 {
-       u32 div = PRCM_CLKSRC_CTRL;
-       div &= (1 << 7) | (1 << 6);     /* Test if ext clk divided by 1 or 2 */
-       div >>= clk->rate_offset;
-       clk->rate = (clk->parent->rate / div);
-       propagate_rate(clk);
+       const struct clksel *clks;
+       const struct clksel_rate *clkr;
+       u32 r, found = 0;
+
+       if (!clk->clksel)
+               return;
+
+       r = __raw_readl(clk->clksel_reg) & clk->clksel_mask;
+       r >>= __ffs(clk->clksel_mask);
+
+       for (clks = clk->clksel; clks->parent && !found; clks++) {
+               for (clkr = clks->rates; clkr->div && !found; clkr++) {
+                       if ((clkr->flags & cpu_mask) && (clkr->val == r)) {
+                               if (clk->parent != clks->parent) {
+                                       pr_debug("clock: inited %s parent "
+                                                "to %s (was %s)\n",
+                                                clk->name, clks->parent->name,
+                                                ((clk->parent) ?
+                                                 clk->parent->name : "NULL"));
+                                       clk->parent = clks->parent;
+                               };
+                               found = 1;
+                       }
+               }
+       }
+
+       if (!found)
+               printk(KERN_ERR "clock: init parent: could not find "
+                      "regval %0x for clock %s\n", r,  clk->name);
+
+       return;
 }
 
-static u32 omap2_get_dpll_rate(struct clk * tclk)
+/* Returns the DPLL rate */
+u32 omap2_get_dpll_rate(struct clk *clk)
 {
        long long dpll_clk;
-       int dpll_mult, dpll_div, amult;
+       u32 dpll_mult, dpll_div, dpll;
+       const struct dpll_data *dd;
+
+       dd = clk->dpll_data;
+       /* REVISIT: What do we return on error? */
+       if (!dd)
+               return 0;
+
+       dpll = __raw_readl(dd->mult_div1_reg);
+       dpll_mult = dpll & dd->mult_mask;
+       dpll_mult >>= __ffs(dd->mult_mask);
+       dpll_div = dpll & dd->div1_mask;
+       dpll_div >>= __ffs(dd->div1_mask);
 
-       dpll_mult = (CM_CLKSEL1_PLL >> 12) & 0x03ff;    /* 10 bits */
-       dpll_div = (CM_CLKSEL1_PLL >> 8) & 0x0f;        /* 4 bits */
-       dpll_clk = (long long)tclk->parent->rate * dpll_mult;
+       dpll_clk = (long long)clk->parent->rate * dpll_mult;
        do_div(dpll_clk, dpll_div + 1);
-       amult = CM_CLKSEL2_PLL & 0x3;
-       dpll_clk *= amult;
 
        return dpll_clk;
 }
 
-static void omap2_followparent_recalc(struct clk *clk)
-{
-       followparent_recalc(clk);
-}
-
-static void omap2_propagate_rate(struct clk * clk)
+/*
+ * Used for clocks that have the same value as the parent clock,
+ * divided by some factor
+ */
+void omap2_fixed_divisor_recalc(struct clk *clk)
 {
-       if (!(clk->flags & RATE_FIXED))
-               clk->rate = clk->parent->rate;
+       WARN_ON(!clk->fixed_div);
 
-       propagate_rate(clk);
-}
+       clk->rate = clk->parent->rate / clk->fixed_div;
 
-static void omap2_set_osc_ck(int enable)
-{
-       if (enable)
-               PRCM_CLKSRC_CTRL &= ~(0x3 << 3);
-       else
-               PRCM_CLKSRC_CTRL |= 0x3 << 3;
+       if (clk->flags & RATE_PROPAGATES)
+               propagate_rate(clk);
 }
 
-/* Enable an APLL if off */
-static void omap2_clk_fixed_enable(struct clk *clk)
+/**
+ * omap2_wait_clock_ready - wait for clock to enable
+ * @reg: physical address of clock IDLEST register
+ * @mask: value to mask against to determine if the clock is active
+ * @name: name of the clock (for printk)
+ *
+ * Returns 1 if the clock enabled in time, or 0 if it failed to enable
+ * in roughly MAX_CLOCK_ENABLE_WAIT microseconds.
+ */
+int omap2_wait_clock_ready(void __iomem *reg, u32 mask, const char *name)
 {
-       u32 cval, i=0;
+       int i = 0;
+       int ena = 0;
 
-       if (clk->enable_bit == 0xff)                    /* Parent will do it */
-               return;
+       /*
+        * 24xx uses 0 to indicate not ready, and 1 to indicate ready.
+        * 34xx reverses this, just to keep us on our toes
+        */
+       if (cpu_mask & (RATE_IN_242X | RATE_IN_243X)) {
+               ena = mask;
+       } else if (cpu_mask & RATE_IN_343X) {
+               ena = 0;
+       }
 
-       cval = CM_CLKEN_PLL;
+       /* Wait for lock */
+       while (((__raw_readl(reg) & mask) != ena) &&
+              (i++ < MAX_CLOCK_ENABLE_WAIT)) {
+               udelay(1);
+       }
 
-       if ((cval & (0x3 << clk->enable_bit)) == (0x3 << clk->enable_bit))
-               return;
+       if (i < MAX_CLOCK_ENABLE_WAIT)
+               pr_debug("Clock %s stable after %d loops\n", name, i);
+       else
+               printk(KERN_ERR "Clock %s didn't enable in %d tries\n",
+                      name, MAX_CLOCK_ENABLE_WAIT);
 
-       cval &= ~(0x3 << clk->enable_bit);
-       cval |= (0x3 << clk->enable_bit);
-       CM_CLKEN_PLL = cval;
 
-       if (clk == &apll96_ck)
-               cval = (1 << 8);
-       else if (clk == &apll54_ck)
-               cval = (1 << 6);
+       return (i < MAX_CLOCK_ENABLE_WAIT) ? 1 : 0;
+};
 
-       while (!(CM_IDLEST_CKGEN & cval)) {             /* Wait for lock */
-               ++i;
-               udelay(1);
-               if (i == 100000) {
-                       printk(KERN_ERR "Clock %s didn't lock\n", clk->name);
-                       break;
-               }
-       }
-}
 
+/*
+ * Note: We don't need special code here for INVERT_ENABLE
+ * for the time being since INVERT_ENABLE only applies to clocks enabled by
+ * CM_CLKEN_PLL
+ */
 static void omap2_clk_wait_ready(struct clk *clk)
 {
-       unsigned long reg, other_reg, st_reg;
+       void __iomem *reg, *other_reg, *st_reg;
        u32 bit;
-       int i;
-
-       reg = (unsigned long) clk->enable_reg;
-       if (reg == (unsigned long) &CM_FCLKEN1_CORE ||
-           reg == (unsigned long) &CM_FCLKEN2_CORE)
-               other_reg = (reg & ~0xf0) | 0x10;
-       else if (reg == (unsigned long) &CM_ICLKEN1_CORE ||
-                reg == (unsigned long) &CM_ICLKEN2_CORE)
-               other_reg = (reg & ~0xf0) | 0x00;
+
+       /*
+        * REVISIT: This code is pretty ugly.  It would be nice to generalize
+        * it and pull it into struct clk itself somehow.
+        */
+       reg = clk->enable_reg;
+       if ((((u32)reg & 0xff) >= CM_FCLKEN1) &&
+           (((u32)reg & 0xff) <= OMAP24XX_CM_FCLKEN2))
+               other_reg = (void __iomem *)(((u32)reg & ~0xf0) | 0x10); /* CM_ICLKEN* */
+       else if ((((u32)reg & 0xff) >= CM_ICLKEN1) &&
+                (((u32)reg & 0xff) <= OMAP24XX_CM_ICLKEN4))
+               other_reg = (void __iomem *)(((u32)reg & ~0xf0) | 0x00); /* CM_FCLKEN* */
        else
                return;
 
+       /* REVISIT: What are the appropriate exclusions for 34XX? */
        /* No check for DSS or cam clocks */
-       if ((reg & 0x0f) == 0) {
-               if (clk->enable_bit <= 1 || clk->enable_bit == 31)
+       if (cpu_is_omap24xx() && ((u32)reg & 0x0f) == 0) { /* CM_{F,I}CLKEN1 */
+               if (clk->enable_bit == OMAP24XX_EN_DSS2_SHIFT ||
+                   clk->enable_bit == OMAP24XX_EN_DSS1_SHIFT ||
+                   clk->enable_bit == OMAP24XX_EN_CAM_SHIFT)
                        return;
        }
 
+       /* REVISIT: What are the appropriate exclusions for 34XX? */
+       /* OMAP3: ignore DSS-mod clocks */
+       if (cpu_is_omap34xx() &&
+           (((u32)reg & ~0xff) == (u32)OMAP_CM_REGADDR(OMAP3430_DSS_MOD, 0)))
+               return;
+
        /* Check if both functional and interface clocks
         * are running. */
        bit = 1 << clk->enable_bit;
        if (!(__raw_readl(other_reg) & bit))
                return;
-       st_reg = (other_reg & ~0xf0) | 0x20;
-       i = 0;
-       while (!(__raw_readl(st_reg) & bit)) {
-               i++;
-               if (i == 100000) {
-                       printk(KERN_ERR "Timeout enabling clock %s\n", clk->name);
-                       break;
-               }
-       }
-       if (i)
-               pr_debug("Clock %s stable after %d loops\n", clk->name, i);
+       st_reg = (void __iomem *)(((u32)other_reg & ~0xf0) | 0x20); /* CM_IDLEST* */
+
+       omap2_wait_clock_ready(st_reg, bit, clk->name);
 }
 
 /* Enables clock without considering parent dependencies or use count
  * REVISIT: Maybe change this to use clk->enable like on omap1?
  */
-static int _omap2_clk_enable(struct clk * clk)
+int _omap2_clk_enable(struct clk *clk)
 {
        u32 regval32;
 
-       if (clk->flags & ALWAYS_ENABLED)
+       if (clk->flags & (ALWAYS_ENABLED | PARENT_CONTROLS_CLOCK))
                return 0;
 
-       if (unlikely(clk == &osc_ck)) {
-               omap2_set_osc_ck(1);
-               return 0;
-       }
+       if (clk->enable)
+               return clk->enable(clk);
 
        if (unlikely(clk->enable_reg == 0)) {
                printk(KERN_ERR "clock.c: Enable for %s without enable code\n",
                       clk->name);
-               return 0;
-       }
-
-       if (clk->enable_reg == (void __iomem *)&CM_CLKEN_PLL) {
-               omap2_clk_fixed_enable(clk);
-               return 0;
+               return 0; /* REVISIT: -EINVAL */
        }
 
        regval32 = __raw_readl(clk->enable_reg);
-       regval32 |= (1 << clk->enable_bit);
+       if (clk->flags & INVERT_ENABLE)
+               regval32 &= ~(1 << clk->enable_bit);
+       else
+               regval32 |= (1 << clk->enable_bit);
        __raw_writel(regval32, clk->enable_reg);
        wmb();
 
@@ -200,44 +250,48 @@ static int _omap2_clk_enable(struct clk * clk)
        return 0;
 }
 
-/* Stop APLL */
-static void omap2_clk_fixed_disable(struct clk *clk)
-{
-       u32 cval;
-
-       if(clk->enable_bit == 0xff)             /* let parent off do it */
-               return;
-
-       cval = CM_CLKEN_PLL;
-       cval &= ~(0x3 << clk->enable_bit);
-       CM_CLKEN_PLL = cval;
-}
-
 /* Disables clock without considering parent dependencies or use count */
-static void _omap2_clk_disable(struct clk *clk)
+void _omap2_clk_disable(struct clk *clk)
 {
        u32 regval32;
 
-       if (unlikely(clk == &osc_ck)) {
-               omap2_set_osc_ck(0);
+       if (clk->flags & (ALWAYS_ENABLED | PARENT_CONTROLS_CLOCK))
                return;
-       }
 
-       if (clk->enable_reg == 0)
+       if (clk->disable) {
+               clk->disable(clk);
                return;
+       }
 
-       if (clk->enable_reg == (void __iomem *)&CM_CLKEN_PLL) {
-               omap2_clk_fixed_disable(clk);
+       if (clk->enable_reg == 0) {
+               /*
+                * 'Independent' here refers to a clock which is not
+                * controlled by its parent.
+                */
+               printk(KERN_ERR "clock: clk_disable called on independent "
+                      "clock %s which has no enable_reg\n", clk->name);
                return;
        }
 
        regval32 = __raw_readl(clk->enable_reg);
-       regval32 &= ~(1 << clk->enable_bit);
+       if (clk->flags & INVERT_ENABLE)
+               regval32 |= (1 << clk->enable_bit);
+       else
+               regval32 &= ~(1 << clk->enable_bit);
        __raw_writel(regval32, clk->enable_reg);
        wmb();
 }
 
-static int omap2_clk_enable(struct clk *clk)
+void omap2_clk_disable(struct clk *clk)
+{
+       if (clk->usecount > 0 && !(--clk->usecount)) {
+               _omap2_clk_disable(clk);
+               if (likely((u32)clk->parent))
+                       omap2_clk_disable(clk->parent);
+       }
+}
+
+int omap2_clk_enable(struct clk *clk)
 {
        int ret = 0;
 
@@ -261,519 +315,314 @@ static int omap2_clk_enable(struct clk *clk)
        return ret;
 }
 
-static void omap2_clk_disable(struct clk *clk)
-{
-       if (clk->usecount > 0 && !(--clk->usecount)) {
-               _omap2_clk_disable(clk);
-               if (likely((u32)clk->parent))
-                       omap2_clk_disable(clk->parent);
-       }
-}
-
-/*
- * Uses the current prcm set to tell if a rate is valid.
- * You can go slower, but not faster within a given rate set.
- */
-static u32 omap2_dpll_round_rate(unsigned long target_rate)
-{
-       u32 high, low;
-
-       if ((CM_CLKSEL2_PLL & 0x3) == 1) {      /* DPLL clockout */
-               high = curr_prcm_set->dpll_speed * 2;
-               low = curr_prcm_set->dpll_speed;
-       } else {                                /* DPLL clockout x 2 */
-               high = curr_prcm_set->dpll_speed;
-               low = curr_prcm_set->dpll_speed / 2;
-       }
-
-#ifdef DOWN_VARIABLE_DPLL
-       if (target_rate > high)
-               return high;
-       else
-               return target_rate;
-#else
-       if (target_rate > low)
-               return high;
-       else
-               return low;
-#endif
-
-}
-
 /*
  * Used for clocks that are part of CLKSEL_xyz governed clocks.
  * REVISIT: Maybe change to use clk->enable() functions like on omap1?
  */
-static void omap2_clksel_recalc(struct clk * clk)
+void omap2_clksel_recalc(struct clk *clk)
 {
-       u32 fixed = 0, div = 0;
+       u32 div = 0;
 
-       if (clk == &dpll_ck) {
-               clk->rate = omap2_get_dpll_rate(clk);
-               fixed = 1;
-               div = 0;
-       }
+       pr_debug("clock: recalc'ing clksel clk %s\n", clk->name);
 
-       if (clk == &iva1_mpu_int_ifck) {
-               div = 2;
-               fixed = 1;
-       }
-
-       if ((clk == &dss1_fck) && ((CM_CLKSEL1_CORE & (0x1f << 8)) == 0)) {
-               clk->rate = sys_ck.rate;
+       div = omap2_clksel_get_divisor(clk);
+       if (div == 0)
                return;
-       }
 
-       if (!fixed) {
-               div = omap2_clksel_get_divisor(clk);
-               if (div == 0)
-                       return;
-       }
+       if (unlikely(clk->rate == clk->parent->rate / div))
+               return;
+       clk->rate = clk->parent->rate / div;
 
-       if (div != 0) {
-               if (unlikely(clk->rate == clk->parent->rate / div))
-                       return;
-               clk->rate = clk->parent->rate / div;
-       }
+       pr_debug("clock: new clock rate is %ld (div %d)\n", clk->rate, div);
 
        if (unlikely(clk->flags & RATE_PROPAGATES))
                propagate_rate(clk);
 }
 
-/*
- * Finds best divider value in an array based on the source and target
- * rates. The divider array must be sorted with smallest divider first.
+/**
+ * omap2_get_clksel_by_parent - return clksel struct for a given clk & parent
+ * @clk: OMAP struct clk ptr to inspect
+ * @src_clk: OMAP struct clk ptr of the parent clk to search for
+ *
+ * Scan the struct clksel array associated with the clock to find
+ * the element associated with the supplied parent clock address.
+ * Returns a pointer to the struct clksel on success or NULL on error.
  */
-static inline u32 omap2_divider_from_table(u32 size, u32 *div_array,
-                                          u32 src_rate, u32 tgt_rate)
+const struct clksel *omap2_get_clksel_by_parent(struct clk *clk,
+                                               struct clk *src_clk)
 {
-       int i, test_rate;
+       const struct clksel *clks;
 
-       if (div_array == NULL)
-               return ~1;
+       if (!clk->clksel)
+               return NULL;
 
-       for (i=0; i < size; i++) {
-               test_rate = src_rate / *div_array;
-               if (test_rate <= tgt_rate)
-                       return *div_array;
-               ++div_array;
+       for (clks = clk->clksel; clks->parent; clks++) {
+               if (clks->parent == src_clk)
+                       break; /* Found the requested parent */
        }
 
-       return ~0;      /* No acceptable divider */
+       if (!clks->parent) {
+               printk(KERN_ERR "clock: Could not find parent clock %s in "
+                      "clksel array of clock %s\n", src_clk->name,
+                      clk->name);
+               return NULL;
+       }
+
+       return clks;
 }
 
-/*
- * Find divisor for the given clock and target rate.
+/**
+ * omap2_clksel_round_rate_div - find divisor for the given clock and rate
+ * @clk: OMAP struct clk to use
+ * @target_rate: desired clock rate
+ * @new_div: ptr to where we should store the divisor
  *
+ * Finds 'best' divider value in an array based on the source and target
+ * rates.  The divider array must be sorted with smallest divider first.
  * Note that this will not work for clocks which are part of CONFIG_PARTICIPANT,
  * they are only settable as part of virtual_prcm set.
+ *
+ * Returns the rounded clock rate or returns 0xffffffff on error.
  */
-static u32 omap2_clksel_round_rate(struct clk *tclk, u32 target_rate,
-       u32 *new_div)
+u32 omap2_clksel_round_rate_div(struct clk *clk, unsigned long target_rate,
+                               u32 *new_div)
 {
-       u32 gfx_div[] = {2, 3, 4};
-       u32 sysclkout_div[] = {1, 2, 4, 8, 16};
-       u32 dss1_div[] = {1, 2, 3, 4, 5, 6, 8, 9, 12, 16};
-       u32 vylnq_div[] = {1, 2, 3, 4, 6, 8, 9, 12, 16, 18};
-       u32 best_div = ~0, asize = 0;
-       u32 *div_array = NULL;
-
-       switch (tclk->flags & SRC_RATE_SEL_MASK) {
-       case CM_GFX_SEL1:
-               asize = 3;
-               div_array = gfx_div;
-               break;
-       case CM_PLL_SEL1:
-               return omap2_dpll_round_rate(target_rate);
-       case CM_SYSCLKOUT_SEL1:
-               asize = 5;
-               div_array = sysclkout_div;
-               break;
-       case CM_CORE_SEL1:
-               if(tclk == &dss1_fck){
-                       if(tclk->parent == &core_ck){
-                               asize = 10;
-                               div_array = dss1_div;
-                       } else {
-                               *new_div = 0; /* fixed clk */
-                               return(tclk->parent->rate);
-                       }
-               } else if((tclk == &vlynq_fck) && cpu_is_omap2420()){
-                       if(tclk->parent == &core_ck){
-                               asize = 10;
-                               div_array = vylnq_div;
-                       } else {
-                               *new_div = 0; /* fixed clk */
-                               return(tclk->parent->rate);
-                       }
-               }
-               break;
+       unsigned long test_rate;
+       const struct clksel *clks;
+       const struct clksel_rate *clkr;
+       u32 last_div = 0;
+
+       printk(KERN_INFO "clock: clksel_round_rate_div: %s target_rate %ld\n",
+              clk->name, target_rate);
+
+       *new_div = 1;
+
+       clks = omap2_get_clksel_by_parent(clk, clk->parent);
+       if (clks == NULL)
+               return ~0;
+
+       for (clkr = clks->rates; clkr->div; clkr++) {
+               if (!(clkr->flags & cpu_mask))
+                   continue;
+
+               /* Sanity check */
+               if (clkr->div <= last_div)
+                       printk(KERN_ERR "clock: clksel_rate table not sorted "
+                              "for clock %s", clk->name);
+
+               last_div = clkr->div;
+
+               test_rate = clk->parent->rate / clkr->div;
+
+               if (test_rate <= target_rate)
+                       break; /* found it */
        }
 
-       best_div = omap2_divider_from_table(asize, div_array,
-        tclk->parent->rate, target_rate);
-       if (best_div == ~0){
-               *new_div = 1;
-               return best_div; /* signal error */
+       if (!clkr->div) {
+               printk(KERN_ERR "clock: Could not find divisor for target "
+                      "rate %ld for clock %s parent %s\n", target_rate,
+                      clk->name, clk->parent->name);
+               return ~0;
        }
 
-       *new_div = best_div;
-       return (tclk->parent->rate / best_div);
+       *new_div = clkr->div;
+
+       printk(KERN_INFO "clock: new_div = %d, new_rate = %ld\n", *new_div,
+              (clk->parent->rate / clkr->div));
+
+       return (clk->parent->rate / clkr->div);
 }
 
-/* Given a clock and a rate apply a clock specific rounding function */
-static long omap2_clk_round_rate(struct clk *clk, unsigned long rate)
+/**
+ * omap2_clksel_round_rate - find rounded rate for the given clock and rate
+ * @clk: OMAP struct clk to use
+ * @target_rate: desired clock rate
+ *
+ * Compatibility wrapper for OMAP clock framework
+ * Finds best target rate based on the source clock and possible dividers.
+ * rates. The divider array must be sorted with smallest divider first.
+ * Note that this will not work for clocks which are part of CONFIG_PARTICIPANT,
+ * they are only settable as part of virtual_prcm set.
+ *
+ * Returns the rounded clock rate or returns 0xffffffff on error.
+ */
+long omap2_clksel_round_rate(struct clk *clk, unsigned long target_rate)
 {
-       u32 new_div = 0;
-       int valid_rate;
+       u32 new_div;
 
-       if (clk->flags & RATE_FIXED)
-               return clk->rate;
+       return omap2_clksel_round_rate_div(clk, target_rate, &new_div);
+}
 
-       if (clk->flags & RATE_CKCTL) {
-               valid_rate = omap2_clksel_round_rate(clk, rate, &new_div);
-               return valid_rate;
-       }
 
+/* Given a clock and a rate apply a clock specific rounding function */
+long omap2_clk_round_rate(struct clk *clk, unsigned long rate)
+{
        if (clk->round_rate != 0)
                return clk->round_rate(clk, rate);
 
+       if (clk->flags & RATE_FIXED)
+               printk(KERN_ERR "clock: generic omap2_clk_round_rate called "
+                      "on fixed-rate clock %s\n", clk->name);
+
        return clk->rate;
 }
 
-/*
- * Check the DLL lock state, and return tue if running in unlock mode.
- * This is needed to compensate for the shifted DLL value in unlock mode.
+/**
+ * omap2_clksel_to_divisor() - turn clksel field value into integer divider
+ * @clk: OMAP struct clk to use
+ * @field_val: register field value to find
+ *
+ * Given a struct clk of a rate-selectable clksel clock, and a register field
+ * value to search for, find the corresponding clock divisor.  The register
+ * field value should be pre-masked and shifted down so the LSB is at bit 0
+ * before calling.  Returns 0 on error
  */
-static u32 omap2_dll_force_needed(void)
+u32 omap2_clksel_to_divisor(struct clk *clk, u32 field_val)
 {
-       u32 dll_state = SDRC_DLLA_CTRL;         /* dlla and dllb are a set */
+       const struct clksel *clks;
+       const struct clksel_rate *clkr;
 
-       if ((dll_state & (1 << 2)) == (1 << 2))
-               return 1;
-       else
+       clks = omap2_get_clksel_by_parent(clk, clk->parent);
+       if (clks == NULL)
                return 0;
-}
 
-static u32 omap2_reprogram_sdrc(u32 level, u32 force)
-{
-       u32 slow_dll_ctrl, fast_dll_ctrl, m_type;
-       u32 prev = curr_perf_level, flags;
-
-       if ((curr_perf_level == level) && !force)
-               return prev;
-
-       m_type = omap2_memory_get_type();
-       slow_dll_ctrl = omap2_memory_get_slow_dll_ctrl();
-       fast_dll_ctrl = omap2_memory_get_fast_dll_ctrl();
-
-       if (level == PRCM_HALF_SPEED) {
-               local_irq_save(flags);
-               PRCM_VOLTSETUP = 0xffff;
-               omap2_sram_reprogram_sdrc(PRCM_HALF_SPEED,
-                                         slow_dll_ctrl, m_type);
-               curr_perf_level = PRCM_HALF_SPEED;
-               local_irq_restore(flags);
+       for (clkr = clks->rates; clkr->div; clkr++) {
+               if ((clkr->flags & cpu_mask) && (clkr->val == field_val))
+                       break;
        }
-       if (level == PRCM_FULL_SPEED) {
-               local_irq_save(flags);
-               PRCM_VOLTSETUP = 0xffff;
-               omap2_sram_reprogram_sdrc(PRCM_FULL_SPEED,
-                                         fast_dll_ctrl, m_type);
-               curr_perf_level = PRCM_FULL_SPEED;
-               local_irq_restore(flags);
+
+       if (!clkr->div) {
+               printk(KERN_ERR "clock: Could not find fieldval %d for "
+                      "clock %s parent %s\n", field_val, clk->name,
+                      clk->parent->name);
+               return 0;
        }
 
-       return prev;
+       return clkr->div;
 }
 
-static int omap2_reprogram_dpll(struct clk * clk, unsigned long rate)
+/**
+ * omap2_divisor_to_clksel() - turn clksel integer divisor into a field value
+ * @clk: OMAP struct clk to use
+ * @div: integer divisor to search for
+ *
+ * Given a struct clk of a rate-selectable clksel clock, and a clock divisor,
+ * find the corresponding register field value.  The return register value is
+ * the value before left-shifting.  Returns 0xffffffff on error
+ */
+u32 omap2_divisor_to_clksel(struct clk *clk, u32 div)
 {
-       u32 flags, cur_rate, low, mult, div, valid_rate, done_rate;
-       u32 bypass = 0;
-       struct prcm_config tmpset;
-       int ret = -EINVAL;
+       const struct clksel *clks;
+       const struct clksel_rate *clkr;
 
-       local_irq_save(flags);
-       cur_rate = omap2_get_dpll_rate(&dpll_ck);
-       mult = CM_CLKSEL2_PLL & 0x3;
-
-       if ((rate == (cur_rate / 2)) && (mult == 2)) {
-               omap2_reprogram_sdrc(PRCM_HALF_SPEED, 1);
-       } else if ((rate == (cur_rate * 2)) && (mult == 1)) {
-               omap2_reprogram_sdrc(PRCM_FULL_SPEED, 1);
-       } else if (rate != cur_rate) {
-               valid_rate = omap2_dpll_round_rate(rate);
-               if (valid_rate != rate)
-                       goto dpll_exit;
-
-               if ((CM_CLKSEL2_PLL & 0x3) == 1)
-                       low = curr_prcm_set->dpll_speed;
-               else
-                       low = curr_prcm_set->dpll_speed / 2;
-
-               tmpset.cm_clksel1_pll = CM_CLKSEL1_PLL;
-               tmpset.cm_clksel1_pll &= ~(0x3FFF << 8);
-               div = ((curr_prcm_set->xtal_speed / 1000000) - 1);
-               tmpset.cm_clksel2_pll = CM_CLKSEL2_PLL;
-               tmpset.cm_clksel2_pll &= ~0x3;
-               if (rate > low) {
-                       tmpset.cm_clksel2_pll |= 0x2;
-                       mult = ((rate / 2) / 1000000);
-                       done_rate = PRCM_FULL_SPEED;
-               } else {
-                       tmpset.cm_clksel2_pll |= 0x1;
-                       mult = (rate / 1000000);
-                       done_rate = PRCM_HALF_SPEED;
-               }
-               tmpset.cm_clksel1_pll |= ((div << 8) | (mult << 12));
-
-               /* Worst case */
-               tmpset.base_sdrc_rfr = V24XX_SDRC_RFR_CTRL_BYPASS;
-
-               if (rate == curr_prcm_set->xtal_speed)  /* If asking for 1-1 */
-                       bypass = 1;
+       /* should never happen */
+       WARN_ON(div == 0);
 
-               omap2_reprogram_sdrc(PRCM_FULL_SPEED, 1); /* For init_mem */
-
-               /* Force dll lock mode */
-               omap2_set_prcm(tmpset.cm_clksel1_pll, tmpset.base_sdrc_rfr,
-                              bypass);
+       clks = omap2_get_clksel_by_parent(clk, clk->parent);
+       if (clks == NULL)
+               return 0;
 
-               /* Errata: ret dll entry state */
-               omap2_init_memory_params(omap2_dll_force_needed());
-               omap2_reprogram_sdrc(done_rate, 0);
+       for (clkr = clks->rates; clkr->div; clkr++) {
+               if ((clkr->flags & cpu_mask) && (clkr->div == div))
+                       break;
        }
-       omap2_clksel_recalc(&dpll_ck);
-       ret = 0;
 
-dpll_exit:
-       local_irq_restore(flags);
-       return(ret);
-}
+       if (!clkr->div) {
+               printk(KERN_ERR "clock: Could not find divisor %d for "
+                      "clock %s parent %s\n", div, clk->name,
+                      clk->parent->name);
+               return 0;
+       }
 
-/* Just return the MPU speed */
-static void omap2_mpu_recalc(struct clk * clk)
-{
-       clk->rate = curr_prcm_set->mpu_speed;
+       return clkr->val;
 }
 
-/*
- * Look for a rate equal or less than the target rate given a configuration set.
+/**
+ * omap2_get_clksel - find clksel register addr & field mask for a clk
+ * @clk: struct clk to use
+ * @field_mask: ptr to u32 to store the register field mask
  *
- * What's not entirely clear is "which" field represents the key field.
- * Some might argue L3-DDR, others ARM, others IVA. This code is simple and
- * just uses the ARM rates.
+ * Returns the address of the clksel register upon success or NULL on error.
  */
-static long omap2_round_to_table_rate(struct clk * clk, unsigned long rate)
+void __iomem *omap2_get_clksel(struct clk *clk, u32 *field_mask)
 {
-       struct prcm_config * ptr;
-       long highest_rate;
-
-       if (clk != &virt_prcm_set)
-               return -EINVAL;
-
-       highest_rate = -EINVAL;
-
-       for (ptr = rate_table; ptr->mpu_speed; ptr++) {
-               if (ptr->xtal_speed != sys_ck.rate)
-                       continue;
+       if (unlikely((clk->clksel_reg == 0) || (clk->clksel_mask == 0)))
+               return NULL;
 
-               highest_rate = ptr->mpu_speed;
+       *field_mask = clk->clksel_mask;
 
-               /* Can check only after xtal frequency check */
-               if (ptr->mpu_speed <= rate)
-                       break;
-       }
-       return highest_rate;
+       return clk->clksel_reg;
 }
 
-/*
- * omap2_convert_field_to_div() - turn field value into integer divider
+/**
+ * omap2_clksel_get_divisor - get current divider applied to parent clock.
+ * @clk: OMAP struct clk to use.
+ *
+ * Returns the integer divisor upon success or 0 on error.
  */
-static u32 omap2_clksel_to_divisor(u32 div_sel, u32 field_val)
+u32 omap2_clksel_get_divisor(struct clk *clk)
 {
-       u32 i;
-       u32 clkout_array[] = {1, 2, 4, 8, 16};
+       u32 field_mask, field_val;
+       void __iomem *div_addr;
 
-       if ((div_sel & SRC_RATE_SEL_MASK) == CM_SYSCLKOUT_SEL1) {
-               for (i = 0; i < 5; i++) {
-                       if (field_val == i)
-                               return clkout_array[i];
-               }
-               return ~0;
-       } else
-               return field_val;
+       div_addr = omap2_get_clksel(clk, &field_mask);
+       if (div_addr == 0)
+               return 0;
+
+       field_val = __raw_readl(div_addr) & field_mask;
+       field_val >>= __ffs(field_mask);
+
+       return omap2_clksel_to_divisor(clk, field_val);
 }
 
-/*
- * Returns the CLKSEL divider register value
- * REVISIT: This should be cleaned up to work nicely with void __iomem *
- */
-static u32 omap2_get_clksel(u32 *div_sel, u32 *field_mask,
-                           struct clk *clk)
+int omap2_clksel_set_rate(struct clk *clk, unsigned long rate)
 {
-       int ret = ~0;
-       u32 reg_val, div_off;
-       u32 div_addr = 0;
-       u32 mask = ~0;
-
-       div_off = clk->rate_offset;
-
-       switch ((*div_sel & SRC_RATE_SEL_MASK)) {
-       case CM_MPU_SEL1:
-               div_addr = (u32)&CM_CLKSEL_MPU;
-               mask = 0x1f;
-               break;
-       case CM_DSP_SEL1:
-               div_addr = (u32)&CM_CLKSEL_DSP;
-               if (cpu_is_omap2420()) {
-                       if ((div_off == 0) || (div_off == 8))
-                               mask = 0x1f;
-                       else if (div_off == 5)
-                               mask = 0x3;
-               } else if (cpu_is_omap2430()) {
-                       if (div_off == 0)
-                               mask = 0x1f;
-                       else if (div_off == 5)
-                               mask = 0x3;
-               }
-               break;
-       case CM_GFX_SEL1:
-               div_addr = (u32)&CM_CLKSEL_GFX;
-               if (div_off == 0)
-                       mask = 0x7;
-               break;
-       case CM_MODEM_SEL1:
-               div_addr = (u32)&CM_CLKSEL_MDM;
-               if (div_off == 0)
-                       mask = 0xf;
-               break;
-       case CM_SYSCLKOUT_SEL1:
-               div_addr = (u32)&PRCM_CLKOUT_CTRL;
-               if ((div_off == 3) || (div_off == 11))
-                       mask= 0x3;
-               break;
-       case CM_CORE_SEL1:
-               div_addr = (u32)&CM_CLKSEL1_CORE;
-               switch (div_off) {
-               case 0:                                 /* l3 */
-               case 8:                                 /* dss1 */
-               case 15:                                /* vylnc-2420 */
-               case 20:                                /* ssi */
-                       mask = 0x1f; break;
-               case 5:                                 /* l4 */
-                       mask = 0x3; break;
-               case 13:                                /* dss2 */
-                       mask = 0x1; break;
-               case 25:                                /* usb */
-                       mask = 0x7; break;
-               }
-       }
+       u32 field_mask, field_val, reg_val, validrate, new_div = 0;
+       void __iomem *div_addr;
 
-       *field_mask = mask;
+       validrate = omap2_clksel_round_rate_div(clk, rate, &new_div);
+       if (validrate != rate)
+               return -EINVAL;
 
-       if (unlikely(mask == ~0))
-               div_addr = 0;
+       div_addr = omap2_get_clksel(clk, &field_mask);
+       if (div_addr == 0)
+               return -EINVAL;
 
-       *div_sel = div_addr;
+       field_val = omap2_divisor_to_clksel(clk, new_div);
+       if (field_val == ~0)
+               return -EINVAL;
 
-       if (unlikely(div_addr == 0))
-               return ret;
+       reg_val = __raw_readl(div_addr);
+       reg_val &= ~field_mask;
+       reg_val |= (field_val << __ffs(field_mask));
+       __raw_writel(reg_val, div_addr);
+       wmb();
 
-       /* Isolate field */
-       reg_val = __raw_readl((void __iomem *)div_addr) & (mask << div_off);
+       clk->rate = clk->parent->rate / new_div;
 
-       /* Normalize back to divider value */
-       reg_val >>= div_off;
+       if (clk->flags & DELAYED_APP && cpu_is_omap24xx()) {
+               __raw_writel(OMAP24XX_VALID_CONFIG, OMAP24XX_PRCM_CLKCFG_CTRL);
+               wmb();
+       }
 
-       return reg_val;
+       return 0;
 }
 
-/*
- * Return divider to be applied to parent clock.
- * Return 0 on error.
- */
-static u32 omap2_clksel_get_divisor(struct clk *clk)
-{
-       int ret = 0;
-       u32 div, div_sel, div_off, field_mask, field_val;
-
-       /* isolate control register */
-       div_sel = (SRC_RATE_SEL_MASK & clk->flags);
-
-       div_off = clk->rate_offset;
-       field_val = omap2_get_clksel(&div_sel, &field_mask, clk);
-       if (div_sel == 0)
-               return ret;
-
-       div_sel = (SRC_RATE_SEL_MASK & clk->flags);
-       div = omap2_clksel_to_divisor(div_sel, field_val);
-
-       return div;
-}
 
 /* Set the clock rate for a clock source */
-static int omap2_clk_set_rate(struct clk *clk, unsigned long rate)
-
+int omap2_clk_set_rate(struct clk *clk, unsigned long rate)
 {
        int ret = -EINVAL;
-       void __iomem * reg;
-       u32 div_sel, div_off, field_mask, field_val, reg_val, validrate;
-       u32 new_div = 0;
-
-       if (!(clk->flags & CONFIG_PARTICIPANT) && (clk->flags & RATE_CKCTL)) {
-               if (clk == &dpll_ck)
-                       return omap2_reprogram_dpll(clk, rate);
-
-               /* Isolate control register */
-               div_sel = (SRC_RATE_SEL_MASK & clk->flags);
-               div_off = clk->rate_offset;
-
-               validrate = omap2_clksel_round_rate(clk, rate, &new_div);
-               if (validrate != rate)
-                       return(ret);
 
-               field_val = omap2_get_clksel(&div_sel, &field_mask, clk);
-               if (div_sel == 0)
-                       return ret;
-
-               if (clk->flags & CM_SYSCLKOUT_SEL1) {
-                       switch (new_div) {
-                       case 16:
-                               field_val = 4;
-                               break;
-                       case 8:
-                               field_val = 3;
-                               break;
-                       case 4:
-                               field_val = 2;
-                               break;
-                       case 2:
-                               field_val = 1;
-                               break;
-                       case 1:
-                               field_val = 0;
-                               break;
-                       }
-               } else
-                       field_val = new_div;
+       pr_debug("clock: set_rate for clock %s to rate %ld\n", clk->name, rate);
 
-               reg = (void __iomem *)div_sel;
-
-               reg_val = __raw_readl(reg);
-               reg_val &= ~(field_mask << div_off);
-               reg_val |= (field_val << div_off);
-               __raw_writel(reg_val, reg);
-               wmb();
-               clk->rate = clk->parent->rate / field_val;
+       /* CONFIG_PARTICIPANT clocks are changed only in sets via the
+          rate table mechanism, driven by mpu_speed  */
+       if (clk->flags & CONFIG_PARTICIPANT)
+               return -EINVAL;
 
-               if (clk->flags & DELAYED_APP) {
-                       __raw_writel(0x1, (void __iomem *)&PRCM_CLKCFG_CTRL);
-                       wmb();
-               }
-               ret = 0;
-       } else if (clk->set_rate != 0)
+       /* dpll_ck, core_ck, virt_prcm_set; plus all clksel clocks */
+       if (clk->set_rate != 0)
                ret = clk->set_rate(clk, rate);
 
        if (unlikely(ret == 0 && (clk->flags & RATE_PROPAGATES)))
@@ -782,242 +631,92 @@ static int omap2_clk_set_rate(struct clk *clk, unsigned long rate)
        return ret;
 }
 
-/* Converts encoded control register address into a full address */
-static u32 omap2_get_src_field(u32 *type_to_addr, u32 reg_offset,
-                              struct clk *src_clk, u32 *field_mask)
-{
-       u32 val = ~0, src_reg_addr = 0, mask = 0;
-
-       /* Find target control register.*/
-       switch ((*type_to_addr & SRC_RATE_SEL_MASK)) {
-       case CM_CORE_SEL1:
-               src_reg_addr = (u32)&CM_CLKSEL1_CORE;
-               if (reg_offset == 13) {                 /* DSS2_fclk */
-                       mask = 0x1;
-                       if (src_clk == &sys_ck)
-                               val = 0;
-                       if (src_clk == &func_48m_ck)
-                               val = 1;
-               } else if (reg_offset == 8) {           /* DSS1_fclk */
-                       mask = 0x1f;
-                       if (src_clk == &sys_ck)
-                               val = 0;
-                       else if (src_clk == &core_ck)   /* divided clock */
-                               val = 0x10;             /* rate needs fixing */
-               } else if ((reg_offset == 15) && cpu_is_omap2420()){ /*vlnyq*/
-                       mask = 0x1F;
-                       if(src_clk == &func_96m_ck)
-                               val = 0;
-                       else if (src_clk == &core_ck)
-                               val = 0x10;
-               }
-               break;
-       case CM_CORE_SEL2:
-               src_reg_addr = (u32)&CM_CLKSEL2_CORE;
-               mask = 0x3;
-               if (src_clk == &func_32k_ck)
-                       val = 0x0;
-               if (src_clk == &sys_ck)
-                       val = 0x1;
-               if (src_clk == &alt_ck)
-                       val = 0x2;
-               break;
-       case CM_WKUP_SEL1:
-               src_reg_addr = (u32)&CM_CLKSEL_WKUP;
-               mask = 0x3;
-               if (src_clk == &func_32k_ck)
-                       val = 0x0;
-               if (src_clk == &sys_ck)
-                       val = 0x1;
-               if (src_clk == &alt_ck)
-                       val = 0x2;
-               break;
-       case CM_PLL_SEL1:
-               src_reg_addr = (u32)&CM_CLKSEL1_PLL;
-               mask = 0x1;
-               if (reg_offset == 0x3) {
-                       if (src_clk == &apll96_ck)
-                               val = 0;
-                       if (src_clk == &alt_ck)
-                               val = 1;
-               }
-               else if (reg_offset == 0x5) {
-                       if (src_clk == &apll54_ck)
-                               val = 0;
-                       if (src_clk == &alt_ck)
-                               val = 1;
-               }
-               break;
-       case CM_PLL_SEL2:
-               src_reg_addr = (u32)&CM_CLKSEL2_PLL;
-               mask = 0x3;
-               if (src_clk == &func_32k_ck)
-                       val = 0x0;
-               if (src_clk == &dpll_ck)
-                       val = 0x2;
-               break;
-       case CM_SYSCLKOUT_SEL1:
-               src_reg_addr = (u32)&PRCM_CLKOUT_CTRL;
-               mask = 0x3;
-               if (src_clk == &dpll_ck)
-                       val = 0;
-               if (src_clk == &sys_ck)
-                       val = 1;
-               if (src_clk == &func_96m_ck)
-                       val = 2;
-               if (src_clk == &func_54m_ck)
-                       val = 3;
-               break;
-       }
-
-       if (val == ~0)                  /* Catch errors in offset */
-               *type_to_addr = 0;
-       else
-               *type_to_addr = src_reg_addr;
-       *field_mask = mask;
-
-       return val;
-}
-
-static int omap2_clk_set_parent(struct clk *clk, struct clk *new_parent)
+/*
+ * Converts encoded control register address into a full address
+ * On error, *src_addr will be returned as 0.
+ */
+static u32 omap2_clksel_get_src_field(void __iomem **src_addr,
+                                     struct clk *src_clk, u32 *field_mask,
+                                     struct clk *clk, u32 *parent_div)
 {
-       void __iomem * reg;
-       u32 src_sel, src_off, field_val, field_mask, reg_val, rate;
-       int ret = -EINVAL;
-
-       if (unlikely(clk->flags & CONFIG_PARTICIPANT))
-               return ret;
-
-       if (clk->flags & SRC_SEL_MASK) {        /* On-chip SEL collection */
-               src_sel = (SRC_RATE_SEL_MASK & clk->flags);
-               src_off = clk->src_offset;
-
-               if (src_sel == 0)
-                       goto set_parent_error;
-
-               field_val = omap2_get_src_field(&src_sel, src_off, new_parent,
-                                               &field_mask);
-
-               reg = (void __iomem *)src_sel;
-
-               if (clk->usecount > 0)
-                       _omap2_clk_disable(clk);
-
-               /* Set new source value (previous dividers if any in effect) */
-               reg_val = __raw_readl(reg) & ~(field_mask << src_off);
-               reg_val |= (field_val << src_off);
-               __raw_writel(reg_val, reg);
-               wmb();
+       const struct clksel *clks;
+       const struct clksel_rate *clkr;
 
-               if (clk->flags & DELAYED_APP) {
-                       __raw_writel(0x1, (void __iomem *)&PRCM_CLKCFG_CTRL);
-                       wmb();
-               }
-               if (clk->usecount > 0)
-                       _omap2_clk_enable(clk);
-
-               clk->parent = new_parent;
+       *parent_div = 0;
+       *src_addr = 0;
 
-               /* SRC_RATE_SEL_MASK clocks follow their parents rates.*/
-               if ((new_parent == &core_ck) && (clk == &dss1_fck))
-                       clk->rate = new_parent->rate / 0x10;
-               else
-                       clk->rate = new_parent->rate;
+       clks = omap2_get_clksel_by_parent(clk, src_clk);
+       if (clks == NULL)
+               return 0;
 
-               if (unlikely(clk->flags & RATE_PROPAGATES))
-                       propagate_rate(clk);
+       for (clkr = clks->rates; clkr->div; clkr++) {
+               if (clkr->flags & (cpu_mask | DEFAULT_RATE))
+                       break; /* Found the default rate for this platform */
+       }
 
+       if (!clkr->div) {
+               printk(KERN_ERR "clock: Could not find default rate for "
+                      "clock %s parent %s\n", clk->name,
+                      src_clk->parent->name);
                return 0;
-       } else {
-               clk->parent = new_parent;
-               rate = new_parent->rate;
-               omap2_clk_set_rate(clk, rate);
-               ret = 0;
        }
 
- set_parent_error:
-       return ret;
+       /* Should never happen.  Add a clksel mask to the struct clk. */
+       WARN_ON(clk->clksel_mask == 0);
+
+       *field_mask = clk->clksel_mask;
+       *src_addr = clk->clksel_reg;
+       *parent_div = clkr->div;
+
+       return clkr->val;
 }
 
-/* Sets basic clocks based on the specified rate */
-static int omap2_select_table_rate(struct clk * clk, unsigned long rate)
+int omap2_clk_set_parent(struct clk *clk, struct clk *new_parent)
 {
-       u32 flags, cur_rate, done_rate, bypass = 0;
-       u8 cpu_mask = 0;
-       struct prcm_config *prcm;
-       unsigned long found_speed = 0;
+       void __iomem *src_addr;
+       u32 field_val, field_mask, reg_val, parent_div;
 
-       if (clk != &virt_prcm_set)
+       if (unlikely(clk->flags & CONFIG_PARTICIPANT))
                return -EINVAL;
 
-       /* FIXME: Change cpu_is_omap2420() to cpu_is_omap242x() */
-       if (cpu_is_omap2420())
-               cpu_mask = RATE_IN_242X;
-       else if (cpu_is_omap2430())
-               cpu_mask = RATE_IN_243X;
-
-       for (prcm = rate_table; prcm->mpu_speed; prcm++) {
-               if (!(prcm->flags & cpu_mask))
-                       continue;
-
-               if (prcm->xtal_speed != sys_ck.rate)
-                       continue;
-
-               if (prcm->mpu_speed <= rate) {
-                       found_speed = prcm->mpu_speed;
-                       break;
-               }
-       }
-
-       if (!found_speed) {
-               printk(KERN_INFO "Could not set MPU rate to %luMHz\n",
-        rate / 1000000);
+       if (!clk->clksel)
                return -EINVAL;
-       }
-
-       curr_prcm_set = prcm;
-       cur_rate = omap2_get_dpll_rate(&dpll_ck);
-
-       if (prcm->dpll_speed == cur_rate / 2) {
-               omap2_reprogram_sdrc(PRCM_HALF_SPEED, 1);
-       } else if (prcm->dpll_speed == cur_rate * 2) {
-               omap2_reprogram_sdrc(PRCM_FULL_SPEED, 1);
-       } else if (prcm->dpll_speed != cur_rate) {
-               local_irq_save(flags);
 
-               if (prcm->dpll_speed == prcm->xtal_speed)
-                       bypass = 1;
+       field_val = omap2_clksel_get_src_field(&src_addr, new_parent,
+                                              &field_mask, clk, &parent_div);
+       if (src_addr == 0)
+               return -EINVAL;
 
-               if ((prcm->cm_clksel2_pll & 0x3) == 2)
-                       done_rate = PRCM_FULL_SPEED;
-               else
-                       done_rate = PRCM_HALF_SPEED;
+       if (clk->usecount > 0)
+               _omap2_clk_disable(clk);
 
-               /* MPU divider */
-               CM_CLKSEL_MPU = prcm->cm_clksel_mpu;
+       /* Set new source value (previous dividers if any in effect) */
+       reg_val = __raw_readl(src_addr) & ~field_mask;
+       reg_val |= (field_val << __ffs(field_mask));
+       __raw_writel(reg_val, src_addr);
+       wmb();
 
-               /* dsp + iva1 div(2420), iva2.1(2430) */
-               CM_CLKSEL_DSP = prcm->cm_clksel_dsp;
+       if (clk->flags & DELAYED_APP && cpu_is_omap24xx()) {
+               __raw_writel(OMAP24XX_VALID_CONFIG, OMAP24XX_PRCM_CLKCFG_CTRL);
+               wmb();
+       }
 
-               CM_CLKSEL_GFX = prcm->cm_clksel_gfx;
+       if (clk->usecount > 0)
+               _omap2_clk_enable(clk);
 
-               /* Major subsystem dividers */
-               CM_CLKSEL1_CORE = prcm->cm_clksel1_core;
-               if (cpu_is_omap2430())
-                       CM_CLKSEL_MDM = prcm->cm_clksel_mdm;
+       clk->parent = new_parent;
 
-               /* x2 to enter init_mem */
-               omap2_reprogram_sdrc(PRCM_FULL_SPEED, 1);
+       /* CLKSEL clocks follow their parents' rates, divided by a divisor */
+       clk->rate = new_parent->rate;
 
-               omap2_set_prcm(prcm->cm_clksel1_pll, prcm->base_sdrc_rfr,
-                              bypass);
+       if (parent_div > 0)
+               clk->rate /= parent_div;
 
-               omap2_init_memory_params(omap2_dll_force_needed());
-               omap2_reprogram_sdrc(done_rate, 0);
+       pr_debug("clock: set parent of %s to %s (new rate %ld)\n",
+                clk->name, clk->parent->name, clk->rate);
 
-               local_irq_restore(flags);
-       }
-       omap2_clksel_recalc(&dpll_ck);
+       if (unlikely(clk->flags & RATE_PROPAGATES))
+               propagate_rate(clk);
 
        return 0;
 }
@@ -1027,150 +726,17 @@ static int omap2_select_table_rate(struct clk * clk, unsigned long rate)
  *-------------------------------------------------------------------------*/
 
 #ifdef CONFIG_OMAP_RESET_CLOCKS
-static void __init omap2_clk_disable_unused(struct clk *clk)
+void omap2_clk_disable_unused(struct clk *clk)
 {
-       u32 regval32;
+       u32 regval32, v;
+
+       v = (clk->flags & INVERT_ENABLE) ? (1 << clk->enable_bit) : 0;
 
        regval32 = __raw_readl(clk->enable_reg);
-       if ((regval32 & (1 << clk->enable_bit)) == 0)
+       if ((regval32 & (1 << clk->enable_bit)) == v)
                return;
 
        printk(KERN_INFO "Disabling unused clock \"%s\"\n", clk->name);
        _omap2_clk_disable(clk);
 }
-#else
-#define omap2_clk_disable_unused       NULL
 #endif
-
-static struct clk_functions omap2_clk_functions = {
-       .clk_enable             = omap2_clk_enable,
-       .clk_disable            = omap2_clk_disable,
-       .clk_round_rate         = omap2_clk_round_rate,
-       .clk_set_rate           = omap2_clk_set_rate,
-       .clk_set_parent         = omap2_clk_set_parent,
-       .clk_disable_unused     = omap2_clk_disable_unused,
-};
-
-static void __init omap2_get_crystal_rate(struct clk *osc, struct clk *sys)
-{
-       u32 div, aplls, sclk = 13000000;
-
-       aplls = CM_CLKSEL1_PLL;
-       aplls &= ((1 << 23) | (1 << 24) | (1 << 25));
-       aplls >>= 23;                   /* Isolate field, 0,2,3 */
-
-       if (aplls == 0)
-               sclk = 19200000;
-       else if (aplls == 2)
-               sclk = 13000000;
-       else if (aplls == 3)
-               sclk = 12000000;
-
-       div = PRCM_CLKSRC_CTRL;
-       div &= ((1 << 7) | (1 << 6));
-       div >>= sys->rate_offset;
-
-       osc->rate = sclk * div;
-       sys->rate = sclk;
-}
-
-/*
- * Set clocks for bypass mode for reboot to work.
- */
-void omap2_clk_prepare_for_reboot(void)
-{
-       u32 rate;
-
-       if (vclk == NULL || sclk == NULL)
-               return;
-
-       rate = clk_get_rate(sclk);
-       clk_set_rate(vclk, rate);
-}
-
-/*
- * Switch the MPU rate if specified on cmdline.
- * We cannot do this early until cmdline is parsed.
- */
-static int __init omap2_clk_arch_init(void)
-{
-       if (!mpurate)
-               return -EINVAL;
-
-       if (omap2_select_table_rate(&virt_prcm_set, mpurate))
-               printk(KERN_ERR "Could not find matching MPU rate\n");
-
-       propagate_rate(&osc_ck);                /* update main root fast */
-       propagate_rate(&func_32k_ck);           /* update main root slow */
-
-       printk(KERN_INFO "Switched to new clocking rate (Crystal/DPLL/MPU): "
-              "%ld.%01ld/%ld/%ld MHz\n",
-              (sys_ck.rate / 1000000), (sys_ck.rate / 100000) % 10,
-              (dpll_ck.rate / 1000000), (mpu_ck.rate / 1000000)) ;
-
-       return 0;
-}
-arch_initcall(omap2_clk_arch_init);
-
-int __init omap2_clk_init(void)
-{
-       struct prcm_config *prcm;
-       struct clk ** clkp;
-       u32 clkrate;
-
-       clk_init(&omap2_clk_functions);
-       omap2_get_crystal_rate(&osc_ck, &sys_ck);
-
-       for (clkp = onchip_clks; clkp < onchip_clks + ARRAY_SIZE(onchip_clks);
-            clkp++) {
-
-               if ((*clkp)->flags & CLOCK_IN_OMAP242X && cpu_is_omap2420()) {
-                       clk_register(*clkp);
-                       continue;
-               }
-
-               if ((*clkp)->flags & CLOCK_IN_OMAP243X && cpu_is_omap2430()) {
-                       clk_register(*clkp);
-                       continue;
-               }
-       }
-
-       /* Check the MPU rate set by bootloader */
-       clkrate = omap2_get_dpll_rate(&dpll_ck);
-       for (prcm = rate_table; prcm->mpu_speed; prcm++) {
-               if (prcm->xtal_speed != sys_ck.rate)
-                       continue;
-               if (prcm->dpll_speed <= clkrate)
-                        break;
-       }
-       curr_prcm_set = prcm;
-
-       propagate_rate(&osc_ck);                /* update main root fast */
-       propagate_rate(&func_32k_ck);           /* update main root slow */
-
-       printk(KERN_INFO "Clocking rate (Crystal/DPLL/MPU): "
-              "%ld.%01ld/%ld/%ld MHz\n",
-              (sys_ck.rate / 1000000), (sys_ck.rate / 100000) % 10,
-              (dpll_ck.rate / 1000000), (mpu_ck.rate / 1000000)) ;
-
-       /*
-        * Only enable those clocks we will need, let the drivers
-        * enable other clocks as necessary
-        */
-       clk_enable(&sync_32k_ick);
-       clk_enable(&omapctrl_ick);
-
-       /* Force the APLLs always active. The clocks are idled
-        * automatically by hardware. */
-       clk_enable(&apll96_ck);
-       clk_enable(&apll54_ck);
-
-       if (cpu_is_omap2430())
-               clk_enable(&sdrc_ick);
-
-       /* Avoid sleeping sleeping during omap2_clk_prepare_for_reboot() */
-       vclk = clk_get(NULL, "virt_prcm_set");
-       sclk = clk_get(NULL, "sys_ck");
-
-       return 0;
-}
index 4f791866b910900bdd1b40058929e6acd408976f..d5980a9e09a4626bbc6877f765be56059b56c1d8 100644 (file)
@@ -1,13 +1,12 @@
 /*
- *  linux/arch/arm/mach-omap24xx/clock.h
+ *  linux/arch/arm/mach-omap2/clock.h
  *
- *  Copyright (C) 2005 Texas Instruments Inc.
- *  Richard Woodruff <r-woodruff2@ti.com>
- *  Created for OMAP2.
+ *  Copyright (C) 2005-2008 Texas Instruments, Inc.
+ *  Copyright (C) 2004-2008 Nokia Corporation
  *
- *  Copyright (C) 2004 Nokia corporation
- *  Written by Tuukka Tikkanen <tuukka.tikkanen@elektrobit.com>
- *  Based on clocks.h by Tony Lindgren, Gordon McNutt and RidgeRun, Inc
+ *  Contacts:
+ *  Richard Woodruff <r-woodruff2@ti.com>
+ *  Paul Walmsley
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
 #ifndef __ARCH_ARM_MACH_OMAP2_CLOCK_H
 #define __ARCH_ARM_MACH_OMAP2_CLOCK_H
 
-static void omap2_sys_clk_recalc(struct clk * clk);
-static void omap2_clksel_recalc(struct clk * clk);
-static void omap2_followparent_recalc(struct clk * clk);
-static void omap2_propagate_rate(struct clk * clk);
-static void omap2_mpu_recalc(struct clk * clk);
-static int omap2_select_table_rate(struct clk * clk, unsigned long rate);
-static long omap2_round_to_table_rate(struct clk * clk, unsigned long rate);
-static void omap2_clk_disable(struct clk *clk);
-static void omap2_sys_clk_recalc(struct clk * clk);
-static u32 omap2_clksel_to_divisor(u32 div_sel, u32 field_val);
-static u32 omap2_clksel_get_divisor(struct clk *clk);
-
-
-#define RATE_IN_242X   (1 << 0)
-#define RATE_IN_243X   (1 << 1)
-
-/* Key dividers which make up a PRCM set. Ratio's for a PRCM are mandated.
- * xtal_speed, dpll_speed, mpu_speed, CM_CLKSEL_MPU,CM_CLKSEL_DSP
- * CM_CLKSEL_GFX, CM_CLKSEL1_CORE, CM_CLKSEL1_PLL CM_CLKSEL2_PLL, CM_CLKSEL_MDM
- */
-struct prcm_config {
-       unsigned long xtal_speed;       /* crystal rate */
-       unsigned long dpll_speed;       /* dpll: out*xtal*M/(N-1)table_recalc */
-       unsigned long mpu_speed;        /* speed of MPU */
-       unsigned long cm_clksel_mpu;    /* mpu divider */
-       unsigned long cm_clksel_dsp;    /* dsp+iva1 div(2420), iva2.1(2430) */
-       unsigned long cm_clksel_gfx;    /* gfx dividers */
-       unsigned long cm_clksel1_core;  /* major subsystem dividers */
-       unsigned long cm_clksel1_pll;   /* m,n */
-       unsigned long cm_clksel2_pll;   /* dpllx1 or x2 out */
-       unsigned long cm_clksel_mdm;    /* modem dividers 2430 only */
-       unsigned long base_sdrc_rfr;    /* base refresh timing for a set */
-       unsigned char flags;
-};
-
-/* Mask for clksel which support parent settign in set_rate */
-#define SRC_SEL_MASK (CM_CORE_SEL1 | CM_CORE_SEL2 | CM_WKUP_SEL1 | \
-                       CM_PLL_SEL1 | CM_PLL_SEL2 | CM_SYSCLKOUT_SEL1)
-
-/* Mask for clksel regs which support rate operations */
-#define SRC_RATE_SEL_MASK (CM_MPU_SEL1 | CM_DSP_SEL1 | CM_GFX_SEL1 | \
-                       CM_MODEM_SEL1 | CM_CORE_SEL1 | CM_CORE_SEL2 | \
-                       CM_WKUP_SEL1 | CM_PLL_SEL1 | CM_PLL_SEL2 | \
-                       CM_SYSCLKOUT_SEL1)
-
-/*
- * The OMAP2 processor can be run at several discrete 'PRCM configurations'.
- * These configurations are characterized by voltage and speed for clocks.
- * The device is only validated for certain combinations. One way to express
- * these combinations is via the 'ratio's' which the clocks operate with
- * respect to each other. These ratio sets are for a given voltage/DPLL
- * setting. All configurations can be described by a DPLL setting and a ratio
- * There are 3 ratio sets for the 2430 and X ratio sets for 2420.
- *
- * 2430 differs from 2420 in that there are no more phase synchronizers used.
- * They both have a slightly different clock domain setup. 2420(iva1,dsp) vs
- * 2430 (iva2.1, NOdsp, mdm)
- */
-
-/* Core fields for cm_clksel, not ratio governed */
-#define RX_CLKSEL_DSS1                 (0x10 << 8)
-#define RX_CLKSEL_DSS2                 (0x0 << 13)
-#define RX_CLKSEL_SSI                  (0x5 << 20)
-
-/*-------------------------------------------------------------------------
- * Voltage/DPLL ratios
- *-------------------------------------------------------------------------*/
-
-/* 2430 Ratio's, 2430-Ratio Config 1 */
-#define R1_CLKSEL_L3                   (4 << 0)
-#define R1_CLKSEL_L4                   (2 << 5)
-#define R1_CLKSEL_USB                  (4 << 25)
-#define R1_CM_CLKSEL1_CORE_VAL         R1_CLKSEL_USB | RX_CLKSEL_SSI | \
-                                       RX_CLKSEL_DSS2 | RX_CLKSEL_DSS1 | \
-                                       R1_CLKSEL_L4 | R1_CLKSEL_L3
-#define R1_CLKSEL_MPU                  (2 << 0)
-#define R1_CM_CLKSEL_MPU_VAL           R1_CLKSEL_MPU
-#define R1_CLKSEL_DSP                  (2 << 0)
-#define R1_CLKSEL_DSP_IF               (2 << 5)
-#define R1_CM_CLKSEL_DSP_VAL           R1_CLKSEL_DSP | R1_CLKSEL_DSP_IF
-#define R1_CLKSEL_GFX                  (2 << 0)
-#define R1_CM_CLKSEL_GFX_VAL           R1_CLKSEL_GFX
-#define R1_CLKSEL_MDM                  (4 << 0)
-#define R1_CM_CLKSEL_MDM_VAL           R1_CLKSEL_MDM
-
-/* 2430-Ratio Config 2 */
-#define R2_CLKSEL_L3                   (6 << 0)
-#define R2_CLKSEL_L4                   (2 << 5)
-#define R2_CLKSEL_USB                  (2 << 25)
-#define R2_CM_CLKSEL1_CORE_VAL         R2_CLKSEL_USB | RX_CLKSEL_SSI | \
-                                       RX_CLKSEL_DSS2 | RX_CLKSEL_DSS1 | \
-                                       R2_CLKSEL_L4 | R2_CLKSEL_L3
-#define R2_CLKSEL_MPU                  (2 << 0)
-#define R2_CM_CLKSEL_MPU_VAL           R2_CLKSEL_MPU
-#define R2_CLKSEL_DSP                  (2 << 0)
-#define R2_CLKSEL_DSP_IF               (3 << 5)
-#define R2_CM_CLKSEL_DSP_VAL           R2_CLKSEL_DSP | R2_CLKSEL_DSP_IF
-#define R2_CLKSEL_GFX                  (2 << 0)
-#define R2_CM_CLKSEL_GFX_VAL           R2_CLKSEL_GFX
-#define R2_CLKSEL_MDM                  (6 << 0)
-#define R2_CM_CLKSEL_MDM_VAL           R2_CLKSEL_MDM
-
-/* 2430-Ratio Bootm (BYPASS) */
-#define RB_CLKSEL_L3                   (1 << 0)
-#define RB_CLKSEL_L4                   (1 << 5)
-#define RB_CLKSEL_USB                  (1 << 25)
-#define RB_CM_CLKSEL1_CORE_VAL         RB_CLKSEL_USB | RX_CLKSEL_SSI | \
-                                       RX_CLKSEL_DSS2 | RX_CLKSEL_DSS1 | \
-                                       RB_CLKSEL_L4 | RB_CLKSEL_L3
-#define RB_CLKSEL_MPU                  (1 << 0)
-#define RB_CM_CLKSEL_MPU_VAL           RB_CLKSEL_MPU
-#define RB_CLKSEL_DSP                  (1 << 0)
-#define RB_CLKSEL_DSP_IF               (1 << 5)
-#define RB_CM_CLKSEL_DSP_VAL           RB_CLKSEL_DSP | RB_CLKSEL_DSP_IF
-#define RB_CLKSEL_GFX                  (1 << 0)
-#define RB_CM_CLKSEL_GFX_VAL           RB_CLKSEL_GFX
-#define RB_CLKSEL_MDM                  (1 << 0)
-#define RB_CM_CLKSEL_MDM_VAL           RB_CLKSEL_MDM
-
-/* 2420 Ratio Equivalents */
-#define RXX_CLKSEL_VLYNQ               (0x12 << 15)
-#define RXX_CLKSEL_SSI                 (0x8 << 20)
-
-/* 2420-PRCM III 532MHz core */
-#define RIII_CLKSEL_L3                 (4 << 0)        /* 133MHz */
-#define RIII_CLKSEL_L4                 (2 << 5)        /* 66.5MHz */
-#define RIII_CLKSEL_USB                        (4 << 25)       /* 33.25MHz */
-#define RIII_CM_CLKSEL1_CORE_VAL       RIII_CLKSEL_USB | RXX_CLKSEL_SSI | \
-                                       RXX_CLKSEL_VLYNQ | RX_CLKSEL_DSS2 | \
-                                       RX_CLKSEL_DSS1 | RIII_CLKSEL_L4 | \
-                                       RIII_CLKSEL_L3
-#define RIII_CLKSEL_MPU                        (2 << 0)        /* 266MHz */
-#define RIII_CM_CLKSEL_MPU_VAL         RIII_CLKSEL_MPU
-#define RIII_CLKSEL_DSP                        (3 << 0)        /* c5x - 177.3MHz */
-#define RIII_CLKSEL_DSP_IF             (2 << 5)        /* c5x - 88.67MHz */
-#define RIII_SYNC_DSP                  (1 << 7)        /* Enable sync */
-#define RIII_CLKSEL_IVA                        (6 << 8)        /* iva1 - 88.67MHz */
-#define RIII_SYNC_IVA                  (1 << 13)       /* Enable sync */
-#define RIII_CM_CLKSEL_DSP_VAL         RIII_SYNC_IVA | RIII_CLKSEL_IVA | \
-                                       RIII_SYNC_DSP | RIII_CLKSEL_DSP_IF | \
-                                       RIII_CLKSEL_DSP
-#define RIII_CLKSEL_GFX                        (2 << 0)        /* 66.5MHz */
-#define RIII_CM_CLKSEL_GFX_VAL         RIII_CLKSEL_GFX
-
-/* 2420-PRCM II 600MHz core */
-#define RII_CLKSEL_L3                  (6 << 0)        /* 100MHz */
-#define RII_CLKSEL_L4                  (2 << 5)        /* 50MHz */
-#define RII_CLKSEL_USB                 (2 << 25)       /* 50MHz */
-#define RII_CM_CLKSEL1_CORE_VAL                RII_CLKSEL_USB | \
-                                       RXX_CLKSEL_SSI | RXX_CLKSEL_VLYNQ | \
-                                       RX_CLKSEL_DSS2 | RX_CLKSEL_DSS1 | \
-                                       RII_CLKSEL_L4 | RII_CLKSEL_L3
-#define RII_CLKSEL_MPU                 (2 << 0)        /* 300MHz */
-#define RII_CM_CLKSEL_MPU_VAL          RII_CLKSEL_MPU
-#define RII_CLKSEL_DSP                 (3 << 0)        /* c5x - 200MHz */
-#define RII_CLKSEL_DSP_IF              (2 << 5)        /* c5x - 100MHz */
-#define RII_SYNC_DSP                   (0 << 7)        /* Bypass sync */
-#define RII_CLKSEL_IVA                 (6 << 8)        /* iva1 - 200MHz */
-#define RII_SYNC_IVA                   (0 << 13)       /* Bypass sync */
-#define RII_CM_CLKSEL_DSP_VAL          RII_SYNC_IVA | RII_CLKSEL_IVA | \
-                                       RII_SYNC_DSP | RII_CLKSEL_DSP_IF | \
-                                       RII_CLKSEL_DSP
-#define RII_CLKSEL_GFX                 (2 << 0)        /* 50MHz */
-#define RII_CM_CLKSEL_GFX_VAL          RII_CLKSEL_GFX
-
-/* 2420-PRCM VII (boot) */
-#define RVII_CLKSEL_L3                 (1 << 0)
-#define RVII_CLKSEL_L4                 (1 << 5)
-#define RVII_CLKSEL_DSS1               (1 << 8)
-#define RVII_CLKSEL_DSS2               (0 << 13)
-#define RVII_CLKSEL_VLYNQ              (1 << 15)
-#define RVII_CLKSEL_SSI                        (1 << 20)
-#define RVII_CLKSEL_USB                        (1 << 25)
-
-#define RVII_CM_CLKSEL1_CORE_VAL       RVII_CLKSEL_USB | RVII_CLKSEL_SSI | \
-                                       RVII_CLKSEL_VLYNQ | RVII_CLKSEL_DSS2 | \
-                                       RVII_CLKSEL_DSS1 | RVII_CLKSEL_L4 | RVII_CLKSEL_L3
-
-#define RVII_CLKSEL_MPU                        (1 << 0) /* all divide by 1 */
-#define RVII_CM_CLKSEL_MPU_VAL         RVII_CLKSEL_MPU
+#include <asm/arch/clock.h>
 
-#define RVII_CLKSEL_DSP                        (1 << 0)
-#define RVII_CLKSEL_DSP_IF             (1 << 5)
-#define RVII_SYNC_DSP                  (0 << 7)
-#define RVII_CLKSEL_IVA                        (1 << 8)
-#define RVII_SYNC_IVA                  (0 << 13)
-#define RVII_CM_CLKSEL_DSP_VAL         RVII_SYNC_IVA | RVII_CLKSEL_IVA | RVII_SYNC_DSP | \
-                                       RVII_CLKSEL_DSP_IF | RVII_CLKSEL_DSP
-
-#define RVII_CLKSEL_GFX                        (1 << 0)
-#define RVII_CM_CLKSEL_GFX_VAL         RVII_CLKSEL_GFX
-
-/*-------------------------------------------------------------------------
- * 2430 Target modes: Along with each configuration the CPU has several
- * modes which goes along with them. Modes mainly are the addition of
- * describe DPLL combinations to go along with a ratio.
- *-------------------------------------------------------------------------*/
-
-/* Hardware governed */
-#define MX_48M_SRC                     (0 << 3)
-#define MX_54M_SRC                     (0 << 5)
-#define MX_APLLS_CLIKIN_12             (3 << 23)
-#define MX_APLLS_CLIKIN_13             (2 << 23)
-#define MX_APLLS_CLIKIN_19_2           (0 << 23)
-
-/*
- * 2430 - standalone, 2*ref*M/(n+1), M/N is for exactness not relock speed
- * #2  (ratio1) baseport-target
- * #5a (ratio1) baseport-target, target DPLL = 266*2 = 532MHz
- */
-#define M5A_DPLL_MULT_12               (133 << 12)
-#define M5A_DPLL_DIV_12                        (5 << 8)
-#define M5A_CM_CLKSEL1_PLL_12_VAL      MX_48M_SRC | MX_54M_SRC | \
-                                       M5A_DPLL_DIV_12 | M5A_DPLL_MULT_12 | \
-                                       MX_APLLS_CLIKIN_12
-#define M5A_DPLL_MULT_13               (266 << 12)
-#define M5A_DPLL_DIV_13                        (12 << 8)
-#define M5A_CM_CLKSEL1_PLL_13_VAL      MX_48M_SRC | MX_54M_SRC | \
-                                       M5A_DPLL_DIV_13 | M5A_DPLL_MULT_13 | \
-                                       MX_APLLS_CLIKIN_13
-#define M5A_DPLL_MULT_19               (180 << 12)
-#define M5A_DPLL_DIV_19                        (12 << 8)
-#define M5A_CM_CLKSEL1_PLL_19_VAL      MX_48M_SRC | MX_54M_SRC | \
-                                       M5A_DPLL_DIV_19 | M5A_DPLL_MULT_19 | \
-                                       MX_APLLS_CLIKIN_19_2
-/* #5b (ratio1) target DPLL = 200*2 = 400MHz */
-#define M5B_DPLL_MULT_12               (50 << 12)
-#define M5B_DPLL_DIV_12                        (2 << 8)
-#define M5B_CM_CLKSEL1_PLL_12_VAL      MX_48M_SRC | MX_54M_SRC | \
-                                       M5B_DPLL_DIV_12 | M5B_DPLL_MULT_12 | \
-                                       MX_APLLS_CLIKIN_12
-#define M5B_DPLL_MULT_13               (200 << 12)
-#define M5B_DPLL_DIV_13                        (12 << 8)
-
-#define M5B_CM_CLKSEL1_PLL_13_VAL      MX_48M_SRC | MX_54M_SRC | \
-                                       M5B_DPLL_DIV_13 | M5B_DPLL_MULT_13 | \
-                                       MX_APLLS_CLIKIN_13
-#define M5B_DPLL_MULT_19               (125 << 12)
-#define M5B_DPLL_DIV_19                        (31 << 8)
-#define M5B_CM_CLKSEL1_PLL_19_VAL      MX_48M_SRC | MX_54M_SRC | \
-                                       M5B_DPLL_DIV_19 | M5B_DPLL_MULT_19 | \
-                                       MX_APLLS_CLIKIN_19_2
-/*
- * #4  (ratio2)
- * #3  (ratio2) baseport-target, target DPLL = 330*2 = 660MHz
- */
-#define M3_DPLL_MULT_12                        (55 << 12)
-#define M3_DPLL_DIV_12                 (1 << 8)
-#define M3_CM_CLKSEL1_PLL_12_VAL       MX_48M_SRC | MX_54M_SRC | \
-                                       M3_DPLL_DIV_12 | M3_DPLL_MULT_12 | \
-                                       MX_APLLS_CLIKIN_12
-#define M3_DPLL_MULT_13                        (330 << 12)
-#define M3_DPLL_DIV_13                 (12 << 8)
-#define M3_CM_CLKSEL1_PLL_13_VAL       MX_48M_SRC | MX_54M_SRC | \
-                                       M3_DPLL_DIV_13 | M3_DPLL_MULT_13 | \
-                                       MX_APLLS_CLIKIN_13
-#define M3_DPLL_MULT_19                        (275 << 12)
-#define M3_DPLL_DIV_19                 (15 << 8)
-#define M3_CM_CLKSEL1_PLL_19_VAL       MX_48M_SRC | MX_54M_SRC | \
-                                       M3_DPLL_DIV_19 | M3_DPLL_MULT_19 | \
-                                       MX_APLLS_CLIKIN_19_2
-/* boot (boot) */
-#define MB_DPLL_MULT                   (1 << 12)
-#define MB_DPLL_DIV                    (0 << 8)
-#define MB_CM_CLKSEL1_PLL_12_VAL       MX_48M_SRC | MX_54M_SRC | MB_DPLL_DIV |\
-                                       MB_DPLL_MULT | MX_APLLS_CLIKIN_12
-
-#define MB_CM_CLKSEL1_PLL_13_VAL       MX_48M_SRC | MX_54M_SRC | MB_DPLL_DIV |\
-                                       MB_DPLL_MULT | MX_APLLS_CLIKIN_13
-
-#define MB_CM_CLKSEL1_PLL_19_VAL       MX_48M_SRC | MX_54M_SRC | MB_DPLL_DIV |\
-                                       MB_DPLL_MULT | MX_APLLS_CLIKIN_19
-
-/*
- * 2430 - chassis (sedna)
- * 165 (ratio1) same as above #2
- * 150 (ratio1)
- * 133 (ratio2) same as above #4
- * 110 (ratio2) same as above #3
- * 104 (ratio2)
- * boot (boot)
- */
-
-/*
- * 2420 Equivalent - mode registers
- * PRCM II , target DPLL = 2*300MHz = 600MHz
- */
-#define MII_DPLL_MULT_12               (50 << 12)
-#define MII_DPLL_DIV_12                        (1 << 8)
-#define MII_CM_CLKSEL1_PLL_12_VAL      MX_48M_SRC | MX_54M_SRC | \
-                                       MII_DPLL_DIV_12 | MII_DPLL_MULT_12 | \
-                                       MX_APLLS_CLIKIN_12
-#define MII_DPLL_MULT_13               (300 << 12)
-#define MII_DPLL_DIV_13                        (12 << 8)
-#define MII_CM_CLKSEL1_PLL_13_VAL      MX_48M_SRC | MX_54M_SRC | \
-                                       MII_DPLL_DIV_13 | MII_DPLL_MULT_13 | \
-                                       MX_APLLS_CLIKIN_13
-
-/* PRCM III target DPLL = 2*266 = 532MHz*/
-#define MIII_DPLL_MULT_12              (133 << 12)
-#define MIII_DPLL_DIV_12               (5 << 8)
-#define MIII_CM_CLKSEL1_PLL_12_VAL     MX_48M_SRC | MX_54M_SRC | \
-                                       MIII_DPLL_DIV_12 | MIII_DPLL_MULT_12 | \
-                                       MX_APLLS_CLIKIN_12
-#define MIII_DPLL_MULT_13              (266 << 12)
-#define MIII_DPLL_DIV_13               (12 << 8)
-#define MIII_CM_CLKSEL1_PLL_13_VAL     MX_48M_SRC | MX_54M_SRC | \
-                                       MIII_DPLL_DIV_13 | MIII_DPLL_MULT_13 | \
-                                       MX_APLLS_CLIKIN_13
-
-/* PRCM VII (boot bypass) */
-#define MVII_CM_CLKSEL1_PLL_12_VAL     MB_CM_CLKSEL1_PLL_12_VAL
-#define MVII_CM_CLKSEL1_PLL_13_VAL     MB_CM_CLKSEL1_PLL_13_VAL
-
-/* High and low operation value */
-#define MX_CLKSEL2_PLL_2x_VAL          (2 << 0)
-#define MX_CLKSEL2_PLL_1x_VAL          (1 << 0)
-
-/*
- * These represent optimal values for common parts, it won't work for all.
- * As long as you scale down, most parameters are still work, they just
- * become sub-optimal. The RFR value goes in the opposite direction. If you
- * don't adjust it down as your clock period increases the refresh interval
- * will not be met. Setting all parameters for complete worst case may work,
- * but may cut memory performance by 2x. Due to errata the DLLs need to be
- * unlocked and their value needs run time calibration.        A dynamic call is
- * need for that as no single right value exists acorss production samples.
- *
- * Only the FULL speed values are given. Current code is such that rate
- * changes must be made at DPLLoutx2. The actual value adjustment for low
- * frequency operation will be handled by omap_set_performance()
- *
- * By having the boot loader boot up in the fastest L4 speed available likely
- * will result in something which you can switch between.
- */
-#define V24XX_SDRC_RFR_CTRL_133MHz     (0x0003de00 | 1)
-#define V24XX_SDRC_RFR_CTRL_100MHz     (0x0002da01 | 1)
-#define V24XX_SDRC_RFR_CTRL_110MHz     (0x0002da01 | 1) /* Need to calc */
-#define V24XX_SDRC_RFR_CTRL_BYPASS     (0x00005000 | 1) /* Need to calc */
-
-/* MPU speed defines */
-#define S12M   12000000
-#define S13M   13000000
-#define S19M   19200000
-#define S26M   26000000
-#define S100M  100000000
-#define S133M  133000000
-#define S150M  150000000
-#define S165M  165000000
-#define S200M  200000000
-#define S266M  266000000
-#define S300M  300000000
-#define S330M  330000000
-#define S400M  400000000
-#define S532M  532000000
-#define S600M  600000000
-#define S660M  660000000
-
-/*-------------------------------------------------------------------------
- * Key dividers which make up a PRCM set. Ratio's for a PRCM are mandated.
- * xtal_speed, dpll_speed, mpu_speed, CM_CLKSEL_MPU,
- * CM_CLKSEL_DSP, CM_CLKSEL_GFX, CM_CLKSEL1_CORE, CM_CLKSEL1_PLL,
- * CM_CLKSEL2_PLL, CM_CLKSEL_MDM
- *
- * Filling in table based on H4 boards and 2430-SDPs variants available.
- * There are quite a few more rates combinations which could be defined.
- *
- * When multiple values are defined the start up will try and choose the
- * fastest one. If a 'fast' value is defined, then automatically, the /2
- * one should be included as it can be used.   Generally having more that
- * one fast set does not make sense, as static timings need to be changed
- * to change the set.   The exception is the bypass setting which is
- * availble for low power bypass.
- *
- * Note: This table needs to be sorted, fastest to slowest.
- *-------------------------------------------------------------------------*/
-static struct prcm_config rate_table[] = {
-       /* PRCM II - FAST */
-       {S12M, S600M, S300M, RII_CM_CLKSEL_MPU_VAL,             /* 300MHz ARM */
-               RII_CM_CLKSEL_DSP_VAL, RII_CM_CLKSEL_GFX_VAL,
-               RII_CM_CLKSEL1_CORE_VAL, MII_CM_CLKSEL1_PLL_12_VAL,
-               MX_CLKSEL2_PLL_2x_VAL, 0, V24XX_SDRC_RFR_CTRL_100MHz,
-               RATE_IN_242X},
-
-       {S13M, S600M, S300M, RII_CM_CLKSEL_MPU_VAL,             /* 300MHz ARM */
-               RII_CM_CLKSEL_DSP_VAL, RII_CM_CLKSEL_GFX_VAL,
-               RII_CM_CLKSEL1_CORE_VAL, MII_CM_CLKSEL1_PLL_13_VAL,
-               MX_CLKSEL2_PLL_2x_VAL, 0, V24XX_SDRC_RFR_CTRL_100MHz,
-               RATE_IN_242X},
-
-       /* PRCM III - FAST */
-       {S12M, S532M, S266M, RIII_CM_CLKSEL_MPU_VAL,            /* 266MHz ARM */
-               RIII_CM_CLKSEL_DSP_VAL, RIII_CM_CLKSEL_GFX_VAL,
-               RIII_CM_CLKSEL1_CORE_VAL, MIII_CM_CLKSEL1_PLL_12_VAL,
-               MX_CLKSEL2_PLL_2x_VAL, 0, V24XX_SDRC_RFR_CTRL_133MHz,
-               RATE_IN_242X},
-
-       {S13M, S532M, S266M, RIII_CM_CLKSEL_MPU_VAL,            /* 266MHz ARM */
-               RIII_CM_CLKSEL_DSP_VAL, RIII_CM_CLKSEL_GFX_VAL,
-               RIII_CM_CLKSEL1_CORE_VAL, MIII_CM_CLKSEL1_PLL_13_VAL,
-               MX_CLKSEL2_PLL_2x_VAL, 0, V24XX_SDRC_RFR_CTRL_133MHz,
-               RATE_IN_242X},
-
-       /* PRCM II - SLOW */
-       {S12M, S300M, S150M, RII_CM_CLKSEL_MPU_VAL,             /* 150MHz ARM */
-               RII_CM_CLKSEL_DSP_VAL, RII_CM_CLKSEL_GFX_VAL,
-               RII_CM_CLKSEL1_CORE_VAL, MII_CM_CLKSEL1_PLL_12_VAL,
-               MX_CLKSEL2_PLL_2x_VAL, 0, V24XX_SDRC_RFR_CTRL_100MHz,
-               RATE_IN_242X},
-
-       {S13M, S300M, S150M, RII_CM_CLKSEL_MPU_VAL,             /* 150MHz ARM */
-               RII_CM_CLKSEL_DSP_VAL, RII_CM_CLKSEL_GFX_VAL,
-               RII_CM_CLKSEL1_CORE_VAL, MII_CM_CLKSEL1_PLL_13_VAL,
-               MX_CLKSEL2_PLL_2x_VAL, 0, V24XX_SDRC_RFR_CTRL_100MHz,
-               RATE_IN_242X},
-
-       /* PRCM III - SLOW */
-       {S12M, S266M, S133M, RIII_CM_CLKSEL_MPU_VAL,            /* 133MHz ARM */
-               RIII_CM_CLKSEL_DSP_VAL, RIII_CM_CLKSEL_GFX_VAL,
-               RIII_CM_CLKSEL1_CORE_VAL, MIII_CM_CLKSEL1_PLL_12_VAL,
-               MX_CLKSEL2_PLL_2x_VAL, 0, V24XX_SDRC_RFR_CTRL_133MHz,
-               RATE_IN_242X},
-
-       {S13M, S266M, S133M, RIII_CM_CLKSEL_MPU_VAL,            /* 133MHz ARM */
-               RIII_CM_CLKSEL_DSP_VAL, RIII_CM_CLKSEL_GFX_VAL,
-               RIII_CM_CLKSEL1_CORE_VAL, MIII_CM_CLKSEL1_PLL_13_VAL,
-               MX_CLKSEL2_PLL_2x_VAL, 0, V24XX_SDRC_RFR_CTRL_133MHz,
-               RATE_IN_242X},
-
-       /* PRCM-VII (boot-bypass) */
-       {S12M, S12M, S12M, RVII_CM_CLKSEL_MPU_VAL,              /* 12MHz ARM*/
-               RVII_CM_CLKSEL_DSP_VAL, RVII_CM_CLKSEL_GFX_VAL,
-               RVII_CM_CLKSEL1_CORE_VAL, MVII_CM_CLKSEL1_PLL_12_VAL,
-               MX_CLKSEL2_PLL_2x_VAL, 0, V24XX_SDRC_RFR_CTRL_BYPASS,
-               RATE_IN_242X},
-
-       /* PRCM-VII (boot-bypass) */
-       {S13M, S13M, S13M, RVII_CM_CLKSEL_MPU_VAL,              /* 13MHz ARM */
-               RVII_CM_CLKSEL_DSP_VAL, RVII_CM_CLKSEL_GFX_VAL,
-               RVII_CM_CLKSEL1_CORE_VAL, MVII_CM_CLKSEL1_PLL_13_VAL,
-               MX_CLKSEL2_PLL_2x_VAL, 0, V24XX_SDRC_RFR_CTRL_BYPASS,
-               RATE_IN_242X},
-
-       /* PRCM #3 - ratio2 (ES2) - FAST */
-       {S13M, S660M, S330M, R2_CM_CLKSEL_MPU_VAL,              /* 330MHz ARM */
-               R2_CM_CLKSEL_DSP_VAL, R2_CM_CLKSEL_GFX_VAL,
-               R2_CM_CLKSEL1_CORE_VAL, M3_CM_CLKSEL1_PLL_13_VAL,
-               MX_CLKSEL2_PLL_2x_VAL, R2_CM_CLKSEL_MDM_VAL,
-               V24XX_SDRC_RFR_CTRL_110MHz,
-               RATE_IN_243X},
-
-       /* PRCM #5a - ratio1 - FAST */
-       {S13M, S532M, S266M, R1_CM_CLKSEL_MPU_VAL,              /* 266MHz ARM */
-               R1_CM_CLKSEL_DSP_VAL, R1_CM_CLKSEL_GFX_VAL,
-               R1_CM_CLKSEL1_CORE_VAL, M5A_CM_CLKSEL1_PLL_13_VAL,
-               MX_CLKSEL2_PLL_2x_VAL, R1_CM_CLKSEL_MDM_VAL,
-               V24XX_SDRC_RFR_CTRL_133MHz,
-               RATE_IN_243X},
-
-       /* PRCM #5b - ratio1 - FAST */
-       {S13M, S400M, S200M, R1_CM_CLKSEL_MPU_VAL,              /* 200MHz ARM */
-               R1_CM_CLKSEL_DSP_VAL, R1_CM_CLKSEL_GFX_VAL,
-               R1_CM_CLKSEL1_CORE_VAL, M5B_CM_CLKSEL1_PLL_13_VAL,
-               MX_CLKSEL2_PLL_2x_VAL, R1_CM_CLKSEL_MDM_VAL,
-               V24XX_SDRC_RFR_CTRL_100MHz,
-               RATE_IN_243X},
-
-       /* PRCM #3 - ratio2 (ES2) - SLOW */
-       {S13M, S330M, S165M, R2_CM_CLKSEL_MPU_VAL,              /* 165MHz ARM */
-               R2_CM_CLKSEL_DSP_VAL, R2_CM_CLKSEL_GFX_VAL,
-               R2_CM_CLKSEL1_CORE_VAL, M3_CM_CLKSEL1_PLL_13_VAL,
-               MX_CLKSEL2_PLL_1x_VAL, R2_CM_CLKSEL_MDM_VAL,
-               V24XX_SDRC_RFR_CTRL_110MHz,
-               RATE_IN_243X},
-
-       /* PRCM #5a - ratio1 - SLOW */
-       {S13M, S266M, S133M, R1_CM_CLKSEL_MPU_VAL,              /* 133MHz ARM */
-               R1_CM_CLKSEL_DSP_VAL, R1_CM_CLKSEL_GFX_VAL,
-               R1_CM_CLKSEL1_CORE_VAL, M5A_CM_CLKSEL1_PLL_13_VAL,
-               MX_CLKSEL2_PLL_1x_VAL, R1_CM_CLKSEL_MDM_VAL,
-               V24XX_SDRC_RFR_CTRL_133MHz,
-               RATE_IN_243X},
-
-       /* PRCM #5b - ratio1 - SLOW*/
-       {S13M, S200M, S100M, R1_CM_CLKSEL_MPU_VAL,              /* 100MHz ARM */
-               R1_CM_CLKSEL_DSP_VAL, R1_CM_CLKSEL_GFX_VAL,
-               R1_CM_CLKSEL1_CORE_VAL, M5B_CM_CLKSEL1_PLL_13_VAL,
-               MX_CLKSEL2_PLL_1x_VAL, R1_CM_CLKSEL_MDM_VAL,
-               V24XX_SDRC_RFR_CTRL_100MHz,
-               RATE_IN_243X},
-
-       /* PRCM-boot/bypass */
-       {S13M, S13M, S13M, RB_CM_CLKSEL_MPU_VAL,                /* 13Mhz */
-               RB_CM_CLKSEL_DSP_VAL, RB_CM_CLKSEL_GFX_VAL,
-               RB_CM_CLKSEL1_CORE_VAL, MB_CM_CLKSEL1_PLL_13_VAL,
-               MX_CLKSEL2_PLL_2x_VAL, RB_CM_CLKSEL_MDM_VAL,
-               V24XX_SDRC_RFR_CTRL_BYPASS,
-               RATE_IN_243X},
-
-       /* PRCM-boot/bypass */
-       {S12M, S12M, S12M, RB_CM_CLKSEL_MPU_VAL,                /* 12Mhz */
-               RB_CM_CLKSEL_DSP_VAL, RB_CM_CLKSEL_GFX_VAL,
-               RB_CM_CLKSEL1_CORE_VAL, MB_CM_CLKSEL1_PLL_12_VAL,
-               MX_CLKSEL2_PLL_2x_VAL, RB_CM_CLKSEL_MDM_VAL,
-               V24XX_SDRC_RFR_CTRL_BYPASS,
-               RATE_IN_243X},
-
-       { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
-};
-
-/*-------------------------------------------------------------------------
- * 24xx clock tree.
- *
- * NOTE:In many cases here we are assigning a 'default' parent.        In many
- *     cases the parent is selectable. The get/set parent calls will also
- *     switch sources.
- *
- *     Many some clocks say always_enabled, but they can be auto idled for
- *     power savings. They will always be available upon clock request.
- *
- *     Several sources are given initial rates which may be wrong, this will
- *     be fixed up in the init func.
- *
- *     Things are broadly separated below by clock domains. It is
- *     noteworthy that most periferals have dependencies on multiple clock
- *     domains. Many get their interface clocks from the L4 domain, but get
- *     functional clocks from fixed sources or other core domain derived
- *     clocks.
- *-------------------------------------------------------------------------*/
-
-/* Base external input clocks */
-static struct clk func_32k_ck = {
-       .name           = "func_32k_ck",
-       .rate           = 32000,
-       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
-                               RATE_FIXED | ALWAYS_ENABLED,
-};
-
-/* Typical 12/13MHz in standalone mode, will be 26Mhz in chassis mode */
-static struct clk osc_ck = {           /* (*12, *13, 19.2, *26, 38.4)MHz */
-       .name           = "osc_ck",
-       .rate           = 26000000,             /* fixed up in clock init */
-       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
-                               RATE_FIXED | RATE_PROPAGATES,
-};
-
-/* With out modem likely 12MHz, with modem likely 13MHz */
-static struct clk sys_ck = {           /* (*12, *13, 19.2, 26, 38.4)MHz */
-       .name           = "sys_ck",             /* ~ ref_clk also */
-       .parent         = &osc_ck,
-       .rate           = 13000000,
-       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
-                               RATE_FIXED | ALWAYS_ENABLED | RATE_PROPAGATES,
-       .rate_offset    = 6, /* sysclkdiv 1 or 2, already handled or no boot */
-       .recalc         = &omap2_sys_clk_recalc,
-};
-
-static struct clk alt_ck = {           /* Typical 54M or 48M, may not exist */
-       .name           = "alt_ck",
-       .rate           = 54000000,
-       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
-                               RATE_FIXED | ALWAYS_ENABLED | RATE_PROPAGATES,
-       .recalc         = &omap2_propagate_rate,
-};
-
-/*
- * Analog domain root source clocks
- */
-
-/* dpll_ck, is broken out in to special cases through clksel */
-static struct clk dpll_ck = {
-       .name           = "dpll_ck",
-       .parent         = &sys_ck,              /* Can be func_32k also */
-       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
-                               RATE_PROPAGATES | RATE_CKCTL | CM_PLL_SEL1,
-       .recalc         = &omap2_clksel_recalc,
-};
-
-static struct clk apll96_ck = {
-       .name           = "apll96_ck",
-       .parent         = &sys_ck,
-       .rate           = 96000000,
-       .flags          = CLOCK_IN_OMAP242X |CLOCK_IN_OMAP243X |
-                               RATE_FIXED | RATE_PROPAGATES,
-       .enable_reg     = (void __iomem *)&CM_CLKEN_PLL,
-       .enable_bit     = 0x2,
-       .recalc         = &omap2_propagate_rate,
-};
-
-static struct clk apll54_ck = {
-       .name           = "apll54_ck",
-       .parent         = &sys_ck,
-       .rate           = 54000000,
-       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
-                               RATE_FIXED | RATE_PROPAGATES,
-       .enable_reg     = (void __iomem *)&CM_CLKEN_PLL,
-       .enable_bit     = 0x6,
-       .recalc         = &omap2_propagate_rate,
-};
+int omap2_clk_enable(struct clk *clk);
+void omap2_clk_disable(struct clk *clk);
+long omap2_clk_round_rate(struct clk *clk, unsigned long rate);
+int omap2_clk_set_rate(struct clk *clk, unsigned long rate);
+int omap2_clk_set_parent(struct clk *clk, struct clk *new_parent);
 
-/*
- * PRCM digital base sources
- */
-static struct clk func_54m_ck = {
-       .name           = "func_54m_ck",
-       .parent         = &apll54_ck,   /* can also be alt_clk */
-       .rate           = 54000000,
-       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
-                               RATE_FIXED | CM_PLL_SEL1 | RATE_PROPAGATES,
-       .src_offset     = 5,
-       .enable_reg     = (void __iomem *)&CM_CLKEN_PLL,
-       .enable_bit     = 0xff,
-       .recalc         = &omap2_propagate_rate,
-};
-
-static struct clk core_ck = {
-       .name           = "core_ck",
-       .parent         = &dpll_ck,             /* can also be 32k */
-       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
-                               ALWAYS_ENABLED | RATE_PROPAGATES,
-       .recalc         = &omap2_propagate_rate,
-};
-
-static struct clk sleep_ck = {         /* sys_clk or 32k */
-       .name           = "sleep_ck",
-       .parent         = &func_32k_ck,
-       .rate           = 32000,
-       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
-       .recalc         = &omap2_propagate_rate,
-};
-
-static struct clk func_96m_ck = {
-       .name           = "func_96m_ck",
-       .parent         = &apll96_ck,
-       .rate           = 96000000,
-       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
-                               RATE_FIXED | RATE_PROPAGATES,
-       .enable_reg     = (void __iomem *)&CM_CLKEN_PLL,
-       .enable_bit     = 0xff,
-       .recalc         = &omap2_propagate_rate,
-};
-
-static struct clk func_48m_ck = {
-       .name           = "func_48m_ck",
-       .parent         = &apll96_ck,    /* 96M or Alt */
-       .rate           = 48000000,
-       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
-                               RATE_FIXED | CM_PLL_SEL1 | RATE_PROPAGATES,
-       .src_offset     = 3,
-       .enable_reg     = (void __iomem *)&CM_CLKEN_PLL,
-       .enable_bit     = 0xff,
-       .recalc         = &omap2_propagate_rate,
-};
-
-static struct clk func_12m_ck = {
-       .name           = "func_12m_ck",
-       .parent         = &func_48m_ck,
-       .rate           = 12000000,
-       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
-                               RATE_FIXED | RATE_PROPAGATES,
-       .recalc         = &omap2_propagate_rate,
-       .enable_reg     = (void __iomem *)&CM_CLKEN_PLL,
-       .enable_bit     = 0xff,
-};
-
-/* Secure timer, only available in secure mode */
-static struct clk wdt1_osc_ck = {
-       .name           = "ck_wdt1_osc",
-       .parent         = &osc_ck,
-       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
-       .recalc         = &omap2_followparent_recalc,
-};
-
-static struct clk sys_clkout = {
-       .name           = "sys_clkout",
-       .parent         = &func_54m_ck,
-       .rate           = 54000000,
-       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
-                               CM_SYSCLKOUT_SEL1 | RATE_CKCTL,
-       .src_offset     = 0,
-       .enable_reg     = (void __iomem *)&PRCM_CLKOUT_CTRL,
-       .enable_bit     = 7,
-       .rate_offset    = 3,
-       .recalc         = &omap2_clksel_recalc,
-};
-
-/* In 2430, new in 2420 ES2 */
-static struct clk sys_clkout2 = {
-       .name           = "sys_clkout2",
-       .parent         = &func_54m_ck,
-       .rate           = 54000000,
-       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
-                               CM_SYSCLKOUT_SEL1 | RATE_CKCTL,
-       .src_offset     = 8,
-       .enable_reg     = (void __iomem *)&PRCM_CLKOUT_CTRL,
-       .enable_bit     = 15,
-       .rate_offset    = 11,
-       .recalc         = &omap2_clksel_recalc,
-};
-
-static struct clk emul_ck = {
-       .name           = "emul_ck",
-       .parent         = &func_54m_ck,
-       .flags          = CLOCK_IN_OMAP242X,
-       .enable_reg     = (void __iomem *)&PRCM_CLKEMUL_CTRL,
-       .enable_bit     = 0,
-       .recalc         = &omap2_propagate_rate,
-
-};
-
-/*
- * MPU clock domain
- *     Clocks:
- *             MPU_FCLK, MPU_ICLK
- *             INT_M_FCLK, INT_M_I_CLK
- *
- * - Individual clocks are hardware managed.
- * - Base divider comes from: CM_CLKSEL_MPU
- *
- */
-static struct clk mpu_ck = {   /* Control cpu */
-       .name           = "mpu_ck",
-       .parent         = &core_ck,
-       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | RATE_CKCTL |
-                               ALWAYS_ENABLED | CM_MPU_SEL1 | DELAYED_APP |
-                               CONFIG_PARTICIPANT | RATE_PROPAGATES,
-       .rate_offset    = 0,    /* bits 0-4 */
-       .recalc         = &omap2_clksel_recalc,
-};
-
-/*
- * DSP (2430-IVA2.1) (2420-UMA+IVA1) clock domain
- * Clocks:
- *     2430: IVA2.1_FCLK, IVA2.1_ICLK
- *     2420: UMA_FCLK, UMA_ICLK, IVA_MPU, IVA_COP
- */
-static struct clk iva2_1_fck = {
-       .name           = "iva2_1_fck",
-       .parent         = &core_ck,
-       .flags          = CLOCK_IN_OMAP243X | RATE_CKCTL | CM_DSP_SEL1 |
-                               DELAYED_APP | RATE_PROPAGATES |
-                               CONFIG_PARTICIPANT,
-       .rate_offset    = 0,
-       .enable_reg     = (void __iomem *)&CM_FCLKEN_DSP,
-       .enable_bit     = 0,
-       .recalc         = &omap2_clksel_recalc,
-};
-
-static struct clk iva2_1_ick = {
-       .name           = "iva2_1_ick",
-       .parent         = &iva2_1_fck,
-       .flags          = CLOCK_IN_OMAP243X | RATE_CKCTL | CM_DSP_SEL1 |
-                               DELAYED_APP | CONFIG_PARTICIPANT,
-       .rate_offset    = 5,
-       .recalc         = &omap2_clksel_recalc,
-};
-
-/*
- * Won't be too specific here. The core clock comes into this block
- * it is divided then tee'ed. One branch goes directly to xyz enable
- * controls. The other branch gets further divided by 2 then possibly
- * routed into a synchronizer and out of clocks abc.
- */
-static struct clk dsp_fck = {
-       .name           = "dsp_fck",
-       .parent         = &core_ck,
-       .flags          = CLOCK_IN_OMAP242X | RATE_CKCTL | CM_DSP_SEL1 |
-                       DELAYED_APP | CONFIG_PARTICIPANT | RATE_PROPAGATES,
-       .rate_offset    = 0,
-       .enable_reg     = (void __iomem *)&CM_FCLKEN_DSP,
-       .enable_bit     = 0,
-       .recalc         = &omap2_clksel_recalc,
-};
-
-static struct clk dsp_ick = {
-       .name           = "dsp_ick",     /* apparently ipi and isp */
-       .parent         = &dsp_fck,
-       .flags          = CLOCK_IN_OMAP242X | RATE_CKCTL | CM_DSP_SEL1 |
-                               DELAYED_APP | CONFIG_PARTICIPANT,
-       .rate_offset = 5,
-       .enable_reg     = (void __iomem *)&CM_ICLKEN_DSP,
-       .enable_bit     = 1,            /* for ipi */
-       .recalc         = &omap2_clksel_recalc,
-};
-
-static struct clk iva1_ifck = {
-       .name           = "iva1_ifck",
-       .parent         = &core_ck,
-       .flags          = CLOCK_IN_OMAP242X | CM_DSP_SEL1 | RATE_CKCTL |
-                       CONFIG_PARTICIPANT | RATE_PROPAGATES | DELAYED_APP,
-       .rate_offset= 8,
-       .enable_reg     = (void __iomem *)&CM_FCLKEN_DSP,
-       .enable_bit     = 10,
-       .recalc         = &omap2_clksel_recalc,
-};
-
-/* IVA1 mpu/int/i/f clocks are /2 of parent */
-static struct clk iva1_mpu_int_ifck = {
-       .name           = "iva1_mpu_int_ifck",
-       .parent         = &iva1_ifck,
-       .flags          = CLOCK_IN_OMAP242X | RATE_CKCTL | CM_DSP_SEL1,
-       .enable_reg     = (void __iomem *)&CM_FCLKEN_DSP,
-       .enable_bit     = 8,
-       .recalc         = &omap2_clksel_recalc,
-};
-
-/*
- * L3 clock domain
- * L3 clocks are used for both interface and functional clocks to
- * multiple entities. Some of these clocks are completely managed
- * by hardware, and some others allow software control. Hardware
- * managed ones general are based on directly CLK_REQ signals and
- * various auto idle settings. The functional spec sets many of these
- * as 'tie-high' for their enables.
- *
- * I-CLOCKS:
- *     L3-Interconnect, SMS, GPMC, SDRC, OCM_RAM, OCM_ROM, SDMA
- *     CAM, HS-USB.
- * F-CLOCK
- *     SSI.
- *
- * GPMC memories and SDRC have timing and clock sensitive registers which
- * may very well need notification when the clock changes. Currently for low
- * operating points, these are taken care of in sleep.S.
- */
-static struct clk core_l3_ck = {       /* Used for ick and fck, interconnect */
-       .name           = "core_l3_ck",
-       .parent         = &core_ck,
-       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
-                               RATE_CKCTL | ALWAYS_ENABLED | CM_CORE_SEL1 |
-                               DELAYED_APP | CONFIG_PARTICIPANT |
-                               RATE_PROPAGATES,
-       .rate_offset    = 0,
-       .recalc         = &omap2_clksel_recalc,
-};
-
-static struct clk usb_l4_ick = {       /* FS-USB interface clock */
-       .name           = "usb_l4_ick",
-       .parent         = &core_l3_ck,
-       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
-                               RATE_CKCTL | CM_CORE_SEL1 | DELAYED_APP |
-                               CONFIG_PARTICIPANT,
-       .enable_reg     = (void __iomem *)&CM_ICLKEN2_CORE,
-       .enable_bit     = 0,
-       .rate_offset = 25,
-       .recalc         = &omap2_clksel_recalc,
-};
-
-/*
- * SSI is in L3 management domain, its direct parent is core not l3,
- * many core power domain entities are grouped into the L3 clock
- * domain.
- * SSI_SSR_FCLK, SSI_SST_FCLK, SSI_L4_CLIK
- *
- * ssr = core/1/2/3/4/5, sst = 1/2 ssr.
- */
-static struct clk ssi_ssr_sst_fck = {
-       .name           = "ssi_fck",
-       .parent         = &core_ck,
-       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
-                               RATE_CKCTL | CM_CORE_SEL1 | DELAYED_APP,
-       .enable_reg     = (void __iomem *)&CM_FCLKEN2_CORE,     /* bit 1 */
-       .enable_bit     = 1,
-       .rate_offset = 20,
-       .recalc         = &omap2_clksel_recalc,
-};
-
-/*
- * GFX clock domain
- *     Clocks:
- * GFX_FCLK, GFX_ICLK
- * GFX_CG1(2d), GFX_CG2(3d)
- *
- * GFX_FCLK runs from L3, and is divided by (1,2,3,4)
- * The 2d and 3d clocks run at a hardware determined
- * divided value of fclk.
- *
- */
-static struct clk gfx_3d_fck = {
-       .name           = "gfx_3d_fck",
-       .parent         = &core_l3_ck,
-       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
-                               RATE_CKCTL | CM_GFX_SEL1,
-       .enable_reg     = (void __iomem *)&CM_FCLKEN_GFX,
-       .enable_bit     = 2,
-       .rate_offset= 0,
-       .recalc         = &omap2_clksel_recalc,
-};
-
-static struct clk gfx_2d_fck = {
-       .name           = "gfx_2d_fck",
-       .parent         = &core_l3_ck,
-       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
-                               RATE_CKCTL | CM_GFX_SEL1,
-       .enable_reg     = (void __iomem *)&CM_FCLKEN_GFX,
-       .enable_bit     = 1,
-       .rate_offset= 0,
-       .recalc         = &omap2_clksel_recalc,
-};
-
-static struct clk gfx_ick = {
-       .name           = "gfx_ick",            /* From l3 */
-       .parent         = &core_l3_ck,
-       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
-                               RATE_CKCTL,
-       .enable_reg     = (void __iomem *)&CM_ICLKEN_GFX,       /* bit 0 */
-       .enable_bit     = 0,
-       .recalc         = &omap2_followparent_recalc,
-};
-
-/*
- * Modem clock domain (2430)
- *     CLOCKS:
- *             MDM_OSC_CLK
- *             MDM_ICLK
- */
-static struct clk mdm_ick = {          /* used both as a ick and fck */
-       .name           = "mdm_ick",
-       .parent         = &core_ck,
-       .flags          = CLOCK_IN_OMAP243X | RATE_CKCTL | CM_MODEM_SEL1 |
-                               DELAYED_APP | CONFIG_PARTICIPANT,
-       .rate_offset    = 0,
-       .enable_reg     = (void __iomem *)&CM_ICLKEN_MDM,
-       .enable_bit     = 0,
-       .recalc         = &omap2_clksel_recalc,
-};
-
-static struct clk mdm_osc_ck = {
-       .name           = "mdm_osc_ck",
-       .rate           = 26000000,
-       .parent         = &osc_ck,
-       .flags          = CLOCK_IN_OMAP243X | RATE_FIXED,
-       .enable_reg     = (void __iomem *)&CM_FCLKEN_MDM,
-       .enable_bit     = 1,
-       .recalc         = &omap2_followparent_recalc,
-};
-
-/*
- * L4 clock management domain
- *
- * This domain contains lots of interface clocks from the L4 interface, some
- * functional clocks.  Fixed APLL functional source clocks are managed in
- * this domain.
- */
-static struct clk l4_ck = {            /* used both as an ick and fck */
-       .name           = "l4_ck",
-       .parent         = &core_l3_ck,
-       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
-                               RATE_CKCTL | ALWAYS_ENABLED | CM_CORE_SEL1 |
-                               DELAYED_APP | RATE_PROPAGATES,
-       .rate_offset    = 5,
-       .recalc         = &omap2_clksel_recalc,
-};
-
-static struct clk ssi_l4_ick = {
-       .name           = "ssi_l4_ick",
-       .parent         = &l4_ck,
-       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | RATE_CKCTL,
-       .enable_reg     = (void __iomem *)&CM_ICLKEN2_CORE,     /* bit 1 */
-       .enable_bit     = 1,
-       .recalc         = &omap2_followparent_recalc,
-};
-
-/*
- * DSS clock domain
- * CLOCKs:
- * DSS_L4_ICLK, DSS_L3_ICLK,
- * DSS_CLK1, DSS_CLK2, DSS_54MHz_CLK
- *
- * DSS is both initiator and target.
- */
-static struct clk dss_ick = {          /* Enables both L3,L4 ICLK's */
-       .name           = "dss_ick",
-       .parent         = &l4_ck,       /* really both l3 and l4 */
-       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | RATE_CKCTL,
-       .enable_reg     = (void __iomem *)&CM_ICLKEN1_CORE,
-       .enable_bit     = 0,
-       .recalc         = &omap2_followparent_recalc,
-};
-
-static struct clk dss1_fck = {
-       .name           = "dss1_fck",
-       .parent         = &core_ck,             /* Core or sys */
-       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
-                               RATE_CKCTL | CM_CORE_SEL1 | DELAYED_APP,
-       .enable_reg     = (void __iomem *)&CM_FCLKEN1_CORE,
-       .enable_bit     = 0,
-       .rate_offset    = 8,
-       .src_offset     = 8,
-       .recalc         = &omap2_clksel_recalc,
-};
-
-static struct clk dss2_fck = {         /* Alt clk used in power management */
-       .name           = "dss2_fck",
-       .parent         = &sys_ck,              /* fixed at sys_ck or 48MHz */
-       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
-                               RATE_CKCTL | CM_CORE_SEL1 | RATE_FIXED |
-                               DELAYED_APP,
-       .enable_reg     = (void __iomem *)&CM_FCLKEN1_CORE,
-       .enable_bit     = 1,
-       .src_offset     = 13,
-       .recalc         = &omap2_followparent_recalc,
-};
-
-static struct clk dss_54m_fck = {      /* Alt clk used in power management */
-       .name           = "dss_54m_fck",        /* 54m tv clk */
-       .parent         = &func_54m_ck,
-       .rate           = 54000000,
-       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
-                               RATE_FIXED | RATE_PROPAGATES,
-       .enable_reg     = (void __iomem *)&CM_FCLKEN1_CORE,
-       .enable_bit     = 2,
-       .recalc         = &omap2_propagate_rate,
-};
-
-/*
- * CORE power domain ICLK & FCLK defines.
- * Many of the these can have more than one possible parent. Entries
- * here will likely have an L4 interface parent, and may have multiple
- * functional clock parents.
- */
-static struct clk gpt1_ick = {
-       .name           = "gpt1_ick",
-       .parent         = &l4_ck,
-       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
-       .enable_reg     = (void __iomem *)&CM_ICLKEN_WKUP,      /* Bit0 */
-       .enable_bit     = 0,
-       .recalc         = &omap2_followparent_recalc,
-};
-
-static struct clk gpt1_fck = {
-       .name           = "gpt1_fck",
-       .parent         = &func_32k_ck,
-       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
-                               CM_WKUP_SEL1,
-       .enable_reg     = (void __iomem *)&CM_FCLKEN_WKUP,      /* Bit0 */
-       .enable_bit     = 0,
-       .src_offset     = 0,
-       .recalc         = &omap2_followparent_recalc,
-};
-
-static struct clk gpt2_ick = {
-       .name           = "gpt2_ick",
-       .parent         = &l4_ck,
-       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
-       .enable_reg     = (void __iomem *)&CM_ICLKEN1_CORE,     /* Bit4 */
-       .enable_bit     = 4,
-       .recalc         = &omap2_followparent_recalc,
-};
-
-static struct clk gpt2_fck = {
-       .name           = "gpt2_fck",
-       .parent         = &func_32k_ck,
-       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
-                               CM_CORE_SEL2,
-       .enable_reg     = (void __iomem *)&CM_FCLKEN1_CORE,
-       .enable_bit     = 4,
-       .src_offset     = 2,
-       .recalc         = &omap2_followparent_recalc,
-};
-
-static struct clk gpt3_ick = {
-       .name           = "gpt3_ick",
-       .parent         = &l4_ck,
-       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
-       .enable_reg     = (void __iomem *)&CM_ICLKEN1_CORE,     /* Bit5 */
-       .enable_bit     = 5,
-       .recalc         = &omap2_followparent_recalc,
-};
-
-static struct clk gpt3_fck = {
-       .name           = "gpt3_fck",
-       .parent         = &func_32k_ck,
-       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
-                               CM_CORE_SEL2,
-       .enable_reg     = (void __iomem *)&CM_FCLKEN1_CORE,
-       .enable_bit     = 5,
-       .src_offset     = 4,
-       .recalc         = &omap2_followparent_recalc,
-};
-
-static struct clk gpt4_ick = {
-       .name           = "gpt4_ick",
-       .parent         = &l4_ck,
-       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
-       .enable_reg     = (void __iomem *)&CM_ICLKEN1_CORE,     /* Bit6 */
-       .enable_bit     = 6,
-       .recalc         = &omap2_followparent_recalc,
-};
-
-static struct clk gpt4_fck = {
-       .name           = "gpt4_fck",
-       .parent         = &func_32k_ck,
-       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
-                               CM_CORE_SEL2,
-       .enable_reg     = (void __iomem *)&CM_FCLKEN1_CORE,
-       .enable_bit     = 6,
-       .src_offset     = 6,
-       .recalc         = &omap2_followparent_recalc,
-};
-
-static struct clk gpt5_ick = {
-       .name           = "gpt5_ick",
-       .parent         = &l4_ck,
-       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
-       .enable_reg     = (void __iomem *)&CM_ICLKEN1_CORE,      /* Bit7 */
-       .enable_bit     = 7,
-       .recalc         = &omap2_followparent_recalc,
-};
-
-static struct clk gpt5_fck = {
-       .name           = "gpt5_fck",
-       .parent         = &func_32k_ck,
-       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
-                               CM_CORE_SEL2,
-       .enable_reg     = (void __iomem *)&CM_FCLKEN1_CORE,
-       .enable_bit     = 7,
-       .src_offset     = 8,
-       .recalc         = &omap2_followparent_recalc,
-};
-
-static struct clk gpt6_ick = {
-       .name           = "gpt6_ick",
-       .parent         = &l4_ck,
-       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
-       .enable_bit     = 8,
-       .enable_reg     = (void __iomem *)&CM_ICLKEN1_CORE,      /* bit8 */
-       .recalc         = &omap2_followparent_recalc,
-};
-
-static struct clk gpt6_fck = {
-       .name           = "gpt6_fck",
-       .parent         = &func_32k_ck,
-       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
-                               CM_CORE_SEL2,
-       .enable_reg     = (void __iomem *)&CM_FCLKEN1_CORE,
-       .enable_bit     = 8,
-       .src_offset     = 10,
-       .recalc         = &omap2_followparent_recalc,
-};
-
-static struct clk gpt7_ick = {
-       .name           = "gpt7_ick",
-       .parent         = &l4_ck,
-       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
-       .enable_reg     = (void __iomem *)&CM_ICLKEN1_CORE,      /* bit9 */
-       .enable_bit     = 9,
-       .recalc         = &omap2_followparent_recalc,
-};
-
-static struct clk gpt7_fck = {
-       .name           = "gpt7_fck",
-       .parent         = &func_32k_ck,
-       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
-                               CM_CORE_SEL2,
-       .enable_reg     = (void __iomem *)&CM_FCLKEN1_CORE,
-       .enable_bit     = 9,
-       .src_offset     = 12,
-       .recalc         = &omap2_followparent_recalc,
-};
-
-static struct clk gpt8_ick = {
-       .name           = "gpt8_ick",
-       .parent         = &l4_ck,
-       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
-       .enable_reg     = (void __iomem *)&CM_ICLKEN1_CORE,      /* bit10 */
-       .enable_bit     = 10,
-       .recalc         = &omap2_followparent_recalc,
-};
-
-static struct clk gpt8_fck = {
-       .name           = "gpt8_fck",
-       .parent         = &func_32k_ck,
-       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
-                               CM_CORE_SEL2,
-       .enable_reg     = (void __iomem *)&CM_FCLKEN1_CORE,
-       .enable_bit     = 10,
-       .src_offset     = 14,
-       .recalc         = &omap2_followparent_recalc,
-};
-
-static struct clk gpt9_ick = {
-       .name           = "gpt9_ick",
-       .parent         = &l4_ck,
-       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
-       .enable_reg     = (void __iomem *)&CM_ICLKEN1_CORE,
-       .enable_bit     = 11,
-       .recalc         = &omap2_followparent_recalc,
-};
-
-static struct clk gpt9_fck = {
-       .name           = "gpt9_fck",
-       .parent         = &func_32k_ck,
-       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
-                                       CM_CORE_SEL2,
-       .enable_reg     = (void __iomem *)&CM_FCLKEN1_CORE,
-       .enable_bit     = 11,
-       .src_offset     = 16,
-       .recalc         = &omap2_followparent_recalc,
-};
-
-static struct clk gpt10_ick = {
-       .name           = "gpt10_ick",
-       .parent         = &l4_ck,
-       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
-       .enable_reg     = (void __iomem *)&CM_ICLKEN1_CORE,
-       .enable_bit     = 12,
-       .recalc         = &omap2_followparent_recalc,
-};
-
-static struct clk gpt10_fck = {
-       .name           = "gpt10_fck",
-       .parent         = &func_32k_ck,
-       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
-                                       CM_CORE_SEL2,
-       .enable_reg     = (void __iomem *)&CM_FCLKEN1_CORE,
-       .enable_bit     = 12,
-       .src_offset     = 18,
-       .recalc         = &omap2_followparent_recalc,
-};
-
-static struct clk gpt11_ick = {
-       .name           = "gpt11_ick",
-       .parent         = &l4_ck,
-       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
-       .enable_reg     = (void __iomem *)&CM_ICLKEN1_CORE,
-       .enable_bit     = 13,
-       .recalc         = &omap2_followparent_recalc,
-};
-
-static struct clk gpt11_fck = {
-       .name           = "gpt11_fck",
-       .parent         = &func_32k_ck,
-       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
-                                       CM_CORE_SEL2,
-       .enable_reg     = (void __iomem *)&CM_FCLKEN1_CORE,
-       .enable_bit     = 13,
-       .src_offset     = 20,
-       .recalc         = &omap2_followparent_recalc,
-};
-
-static struct clk gpt12_ick = {
-       .name           = "gpt12_ick",
-       .parent         = &l4_ck,
-       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
-       .enable_reg     = (void __iomem *)&CM_ICLKEN1_CORE,      /* bit14 */
-       .enable_bit     = 14,
-       .recalc         = &omap2_followparent_recalc,
-};
-
-static struct clk gpt12_fck = {
-       .name           = "gpt12_fck",
-       .parent         = &func_32k_ck,
-       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
-                                       CM_CORE_SEL2,
-       .enable_reg     = (void __iomem *)&CM_FCLKEN1_CORE,
-       .enable_bit     = 14,
-       .src_offset     = 22,
-       .recalc         = &omap2_followparent_recalc,
-};
-
-static struct clk mcbsp1_ick = {
-       .name           = "mcbsp1_ick",
-       .parent         = &l4_ck,
-       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
-       .enable_bit     = 15,
-       .enable_reg     = (void __iomem *)&CM_ICLKEN1_CORE,      /* bit16 */
-       .recalc         = &omap2_followparent_recalc,
-};
-
-static struct clk mcbsp1_fck = {
-       .name           = "mcbsp1_fck",
-       .parent         = &func_96m_ck,
-       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
-       .enable_bit     = 15,
-       .enable_reg     = (void __iomem *)&CM_FCLKEN1_CORE,
-       .recalc         = &omap2_followparent_recalc,
-};
-
-static struct clk mcbsp2_ick = {
-       .name           = "mcbsp2_ick",
-       .parent         = &l4_ck,
-       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
-       .enable_bit     = 16,
-       .enable_reg     = (void __iomem *)&CM_ICLKEN1_CORE,
-       .recalc         = &omap2_followparent_recalc,
-};
-
-static struct clk mcbsp2_fck = {
-       .name           = "mcbsp2_fck",
-       .parent         = &func_96m_ck,
-       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
-       .enable_bit     = 16,
-       .enable_reg     = (void __iomem *)&CM_FCLKEN1_CORE,
-       .recalc         = &omap2_followparent_recalc,
-};
-
-static struct clk mcbsp3_ick = {
-       .name           = "mcbsp3_ick",
-       .parent         = &l4_ck,
-       .flags          = CLOCK_IN_OMAP243X,
-       .enable_reg     = (void __iomem *)&CM_ICLKEN2_CORE,
-       .enable_bit     = 3,
-       .recalc         = &omap2_followparent_recalc,
-};
-
-static struct clk mcbsp3_fck = {
-       .name           = "mcbsp3_fck",
-       .parent         = &func_96m_ck,
-       .flags          = CLOCK_IN_OMAP243X,
-       .enable_reg     = (void __iomem *)&CM_FCLKEN2_CORE,
-       .enable_bit     = 3,
-       .recalc         = &omap2_followparent_recalc,
-};
-
-static struct clk mcbsp4_ick = {
-       .name           = "mcbsp4_ick",
-       .parent         = &l4_ck,
-       .flags          = CLOCK_IN_OMAP243X,
-       .enable_reg     = (void __iomem *)&CM_ICLKEN2_CORE,
-       .enable_bit     = 4,
-       .recalc         = &omap2_followparent_recalc,
-};
-
-static struct clk mcbsp4_fck = {
-       .name           = "mcbsp4_fck",
-       .parent         = &func_96m_ck,
-       .flags          = CLOCK_IN_OMAP243X,
-       .enable_reg     = (void __iomem *)&CM_FCLKEN2_CORE,
-       .enable_bit     = 4,
-       .recalc         = &omap2_followparent_recalc,
-};
-
-static struct clk mcbsp5_ick = {
-       .name           = "mcbsp5_ick",
-       .parent         = &l4_ck,
-       .flags          = CLOCK_IN_OMAP243X,
-       .enable_reg     = (void __iomem *)&CM_ICLKEN2_CORE,
-       .enable_bit     = 5,
-       .recalc         = &omap2_followparent_recalc,
-};
-
-static struct clk mcbsp5_fck = {
-       .name           = "mcbsp5_fck",
-       .parent         = &func_96m_ck,
-       .flags          = CLOCK_IN_OMAP243X,
-       .enable_reg     = (void __iomem *)&CM_FCLKEN2_CORE,
-       .enable_bit     = 5,
-       .recalc         = &omap2_followparent_recalc,
-};
-
-static struct clk mcspi1_ick = {
-       .name           = "mcspi_ick",
-       .id             = 1,
-       .parent         = &l4_ck,
-       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
-       .enable_reg     = (void __iomem *)&CM_ICLKEN1_CORE,
-       .enable_bit     = 17,
-       .recalc         = &omap2_followparent_recalc,
-};
-
-static struct clk mcspi1_fck = {
-       .name           = "mcspi_fck",
-       .id             = 1,
-       .parent         = &func_48m_ck,
-       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
-       .enable_reg     = (void __iomem *)&CM_FCLKEN1_CORE,
-       .enable_bit     = 17,
-       .recalc         = &omap2_followparent_recalc,
-};
-
-static struct clk mcspi2_ick = {
-       .name           = "mcspi_ick",
-       .id             = 2,
-       .parent         = &l4_ck,
-       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
-       .enable_reg     = (void __iomem *)&CM_ICLKEN1_CORE,
-       .enable_bit     = 18,
-       .recalc         = &omap2_followparent_recalc,
-};
-
-static struct clk mcspi2_fck = {
-       .name           = "mcspi_fck",
-       .id             = 2,
-       .parent         = &func_48m_ck,
-       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
-       .enable_reg     = (void __iomem *)&CM_FCLKEN1_CORE,
-       .enable_bit     = 18,
-       .recalc         = &omap2_followparent_recalc,
-};
-
-static struct clk mcspi3_ick = {
-       .name           = "mcspi_ick",
-       .id             = 3,
-       .parent         = &l4_ck,
-       .flags          = CLOCK_IN_OMAP243X,
-       .enable_reg     = (void __iomem *)&CM_ICLKEN2_CORE,
-       .enable_bit     = 9,
-       .recalc         = &omap2_followparent_recalc,
-};
-
-static struct clk mcspi3_fck = {
-       .name           = "mcspi_fck",
-       .id             = 3,
-       .parent         = &func_48m_ck,
-       .flags          = CLOCK_IN_OMAP243X,
-       .enable_reg     = (void __iomem *)&CM_FCLKEN2_CORE,
-       .enable_bit     = 9,
-       .recalc         = &omap2_followparent_recalc,
-};
-
-static struct clk uart1_ick = {
-       .name           = "uart1_ick",
-       .parent         = &l4_ck,
-       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
-       .enable_reg     = (void __iomem *)&CM_ICLKEN1_CORE,
-       .enable_bit     = 21,
-       .recalc         = &omap2_followparent_recalc,
-};
-
-static struct clk uart1_fck = {
-       .name           = "uart1_fck",
-       .parent         = &func_48m_ck,
-       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
-       .enable_reg     = (void __iomem *)&CM_FCLKEN1_CORE,
-       .enable_bit     = 21,
-       .recalc         = &omap2_followparent_recalc,
-};
-
-static struct clk uart2_ick = {
-       .name           = "uart2_ick",
-       .parent         = &l4_ck,
-       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
-       .enable_reg     = (void __iomem *)&CM_ICLKEN1_CORE,
-       .enable_bit     = 22,
-       .recalc         = &omap2_followparent_recalc,
-};
-
-static struct clk uart2_fck = {
-       .name           = "uart2_fck",
-       .parent         = &func_48m_ck,
-       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
-       .enable_reg     = (void __iomem *)&CM_FCLKEN1_CORE,
-       .enable_bit     = 22,
-       .recalc         = &omap2_followparent_recalc,
-};
-
-static struct clk uart3_ick = {
-       .name           = "uart3_ick",
-       .parent         = &l4_ck,
-       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
-       .enable_reg     = (void __iomem *)&CM_ICLKEN2_CORE,
-       .enable_bit     = 2,
-       .recalc         = &omap2_followparent_recalc,
-};
-
-static struct clk uart3_fck = {
-       .name           = "uart3_fck",
-       .parent         = &func_48m_ck,
-       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
-       .enable_reg     = (void __iomem *)&CM_FCLKEN2_CORE,
-       .enable_bit     = 2,
-       .recalc         = &omap2_followparent_recalc,
-};
-
-static struct clk gpios_ick = {
-       .name           = "gpios_ick",
-       .parent         = &l4_ck,
-       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
-       .enable_reg     = (void __iomem *)&CM_ICLKEN_WKUP,
-       .enable_bit     = 2,
-       .recalc         = &omap2_followparent_recalc,
-};
-
-static struct clk gpios_fck = {
-       .name           = "gpios_fck",
-       .parent         = &func_32k_ck,
-       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
-       .enable_reg     = (void __iomem *)&CM_FCLKEN_WKUP,
-       .enable_bit     = 2,
-       .recalc         = &omap2_followparent_recalc,
-};
-
-static struct clk mpu_wdt_ick = {
-       .name           = "mpu_wdt_ick",
-       .parent         = &l4_ck,
-       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
-       .enable_reg     = (void __iomem *)&CM_ICLKEN_WKUP,
-       .enable_bit     = 3,
-       .recalc         = &omap2_followparent_recalc,
-};
-
-static struct clk mpu_wdt_fck = {
-       .name           = "mpu_wdt_fck",
-       .parent         = &func_32k_ck,
-       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
-       .enable_reg     = (void __iomem *)&CM_FCLKEN_WKUP,
-       .enable_bit     = 3,
-       .recalc         = &omap2_followparent_recalc,
-};
-
-static struct clk sync_32k_ick = {
-       .name           = "sync_32k_ick",
-       .parent         = &l4_ck,
-       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
-       .enable_reg     = (void __iomem *)&CM_ICLKEN_WKUP,
-       .enable_bit     = 1,
-       .recalc         = &omap2_followparent_recalc,
-};
-static struct clk wdt1_ick = {
-       .name           = "wdt1_ick",
-       .parent         = &l4_ck,
-       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
-       .enable_reg     = (void __iomem *)&CM_ICLKEN_WKUP,
-       .enable_bit     = 4,
-       .recalc         = &omap2_followparent_recalc,
-};
-static struct clk omapctrl_ick = {
-       .name           = "omapctrl_ick",
-       .parent         = &l4_ck,
-       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
-       .enable_reg     = (void __iomem *)&CM_ICLKEN_WKUP,
-       .enable_bit     = 5,
-       .recalc         = &omap2_followparent_recalc,
-};
-static struct clk icr_ick = {
-       .name           = "icr_ick",
-       .parent         = &l4_ck,
-       .flags          = CLOCK_IN_OMAP243X,
-       .enable_reg     = (void __iomem *)&CM_ICLKEN_WKUP,
-       .enable_bit     = 6,
-       .recalc         = &omap2_followparent_recalc,
-};
-
-static struct clk cam_ick = {
-       .name           = "cam_ick",
-       .parent         = &l4_ck,
-       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
-       .enable_reg     = (void __iomem *)&CM_ICLKEN1_CORE,
-       .enable_bit     = 31,
-       .recalc         = &omap2_followparent_recalc,
-};
-
-static struct clk cam_fck = {
-       .name           = "cam_fck",
-       .parent         = &func_96m_ck,
-       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
-       .enable_reg     = (void __iomem *)&CM_FCLKEN1_CORE,
-       .enable_bit     = 31,
-       .recalc         = &omap2_followparent_recalc,
-};
-
-static struct clk mailboxes_ick = {
-       .name           = "mailboxes_ick",
-       .parent         = &l4_ck,
-       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
-       .enable_reg     = (void __iomem *)&CM_ICLKEN1_CORE,
-       .enable_bit     = 30,
-       .recalc         = &omap2_followparent_recalc,
-};
-
-static struct clk wdt4_ick = {
-       .name           = "wdt4_ick",
-       .parent         = &l4_ck,
-       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
-       .enable_reg     = (void __iomem *)&CM_ICLKEN1_CORE,
-       .enable_bit     = 29,
-       .recalc         = &omap2_followparent_recalc,
-};
-
-static struct clk wdt4_fck = {
-       .name           = "wdt4_fck",
-       .parent         = &func_32k_ck,
-       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
-       .enable_reg     = (void __iomem *)&CM_FCLKEN1_CORE,
-       .enable_bit     = 29,
-       .recalc         = &omap2_followparent_recalc,
-};
-
-static struct clk wdt3_ick = {
-       .name           = "wdt3_ick",
-       .parent         = &l4_ck,
-       .flags          = CLOCK_IN_OMAP242X,
-       .enable_reg     = (void __iomem *)&CM_ICLKEN1_CORE,
-       .enable_bit     = 28,
-       .recalc         = &omap2_followparent_recalc,
-};
-
-static struct clk wdt3_fck = {
-       .name           = "wdt3_fck",
-       .parent         = &func_32k_ck,
-       .flags          = CLOCK_IN_OMAP242X,
-       .enable_reg     = (void __iomem *)&CM_FCLKEN1_CORE,
-       .enable_bit     = 28,
-       .recalc         = &omap2_followparent_recalc,
-};
-
-static struct clk mspro_ick = {
-       .name           = "mspro_ick",
-       .parent         = &l4_ck,
-       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
-       .enable_reg     = (void __iomem *)&CM_ICLKEN1_CORE,
-       .enable_bit     = 27,
-       .recalc         = &omap2_followparent_recalc,
-};
-
-static struct clk mspro_fck = {
-       .name           = "mspro_fck",
-       .parent         = &func_96m_ck,
-       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
-       .enable_reg     = (void __iomem *)&CM_FCLKEN1_CORE,
-       .enable_bit     = 27,
-       .recalc         = &omap2_followparent_recalc,
-};
-
-static struct clk mmc_ick = {
-       .name           = "mmc_ick",
-       .parent         = &l4_ck,
-       .flags          = CLOCK_IN_OMAP242X,
-       .enable_reg     = (void __iomem *)&CM_ICLKEN1_CORE,
-       .enable_bit     = 26,
-       .recalc         = &omap2_followparent_recalc,
-};
-
-static struct clk mmc_fck = {
-       .name           = "mmc_fck",
-       .parent         = &func_96m_ck,
-       .flags          = CLOCK_IN_OMAP242X,
-       .enable_reg     = (void __iomem *)&CM_FCLKEN1_CORE,
-       .enable_bit     = 26,
-       .recalc         = &omap2_followparent_recalc,
-};
-
-static struct clk fac_ick = {
-       .name           = "fac_ick",
-       .parent         = &l4_ck,
-       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
-       .enable_reg     = (void __iomem *)&CM_ICLKEN1_CORE,
-       .enable_bit     = 25,
-       .recalc         = &omap2_followparent_recalc,
-};
-
-static struct clk fac_fck = {
-       .name           = "fac_fck",
-       .parent         = &func_12m_ck,
-       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
-       .enable_reg     = (void __iomem *)&CM_FCLKEN1_CORE,
-       .enable_bit     = 25,
-       .recalc         = &omap2_followparent_recalc,
-};
-
-static struct clk eac_ick = {
-       .name           = "eac_ick",
-       .parent         = &l4_ck,
-       .flags          = CLOCK_IN_OMAP242X,
-       .enable_reg     = (void __iomem *)&CM_ICLKEN1_CORE,
-       .enable_bit     = 24,
-       .recalc         = &omap2_followparent_recalc,
-};
-
-static struct clk eac_fck = {
-       .name           = "eac_fck",
-       .parent         = &func_96m_ck,
-       .flags          = CLOCK_IN_OMAP242X,
-       .enable_reg     = (void __iomem *)&CM_FCLKEN1_CORE,
-       .enable_bit     = 24,
-       .recalc         = &omap2_followparent_recalc,
-};
-
-static struct clk hdq_ick = {
-       .name           = "hdq_ick",
-       .parent         = &l4_ck,
-       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
-       .enable_reg     = (void __iomem *)&CM_ICLKEN1_CORE,
-       .enable_bit     = 23,
-       .recalc         = &omap2_followparent_recalc,
-};
-
-static struct clk hdq_fck = {
-       .name           = "hdq_fck",
-       .parent         = &func_12m_ck,
-       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
-       .enable_reg     = (void __iomem *)&CM_FCLKEN1_CORE,
-       .enable_bit     = 23,
-       .recalc         = &omap2_followparent_recalc,
-};
-
-static struct clk i2c2_ick = {
-       .name           = "i2c_ick",
-       .id             = 2,
-       .parent         = &l4_ck,
-       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
-       .enable_reg     = (void __iomem *)&CM_ICLKEN1_CORE,
-       .enable_bit     = 20,
-       .recalc         = &omap2_followparent_recalc,
-};
-
-static struct clk i2c2_fck = {
-       .name           = "i2c_fck",
-       .id             = 2,
-       .parent         = &func_12m_ck,
-       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
-       .enable_reg     = (void __iomem *)&CM_FCLKEN1_CORE,
-       .enable_bit     = 20,
-       .recalc         = &omap2_followparent_recalc,
-};
-
-static struct clk i2chs2_fck = {
-       .name           = "i2chs2_fck",
-       .parent         = &func_96m_ck,
-       .flags          = CLOCK_IN_OMAP243X,
-       .enable_reg     = (void __iomem *)&CM_FCLKEN2_CORE,
-       .enable_bit     = 20,
-       .recalc         = &omap2_followparent_recalc,
-};
-
-static struct clk i2c1_ick = {
-       .name           = "i2c_ick",
-       .id             = 1,
-       .parent         = &l4_ck,
-       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
-       .enable_reg     = (void __iomem *)&CM_ICLKEN1_CORE,
-       .enable_bit     = 19,
-       .recalc         = &omap2_followparent_recalc,
-};
-
-static struct clk i2c1_fck = {
-       .name           = "i2c_fck",
-       .id             = 1,
-       .parent         = &func_12m_ck,
-       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
-       .enable_reg     = (void __iomem *)&CM_FCLKEN1_CORE,
-       .enable_bit     = 19,
-       .recalc         = &omap2_followparent_recalc,
-};
-
-static struct clk i2chs1_fck = {
-       .name           = "i2chs1_fck",
-       .parent         = &func_96m_ck,
-       .flags          = CLOCK_IN_OMAP243X,
-       .enable_reg     = (void __iomem *)&CM_FCLKEN2_CORE,
-       .enable_bit     = 19,
-       .recalc         = &omap2_followparent_recalc,
-};
-
-static struct clk vlynq_ick = {
-       .name           = "vlynq_ick",
-       .parent         = &core_l3_ck,
-       .flags          = CLOCK_IN_OMAP242X,
-       .enable_reg     = (void __iomem *)&CM_ICLKEN1_CORE,
-       .enable_bit     = 3,
-       .recalc         = &omap2_followparent_recalc,
-};
-
-static struct clk vlynq_fck = {
-       .name           = "vlynq_fck",
-       .parent         = &func_96m_ck,
-       .flags          = CLOCK_IN_OMAP242X  | RATE_CKCTL | CM_CORE_SEL1 | DELAYED_APP,
-       .enable_reg     = (void __iomem *)&CM_FCLKEN1_CORE,
-       .enable_bit     = 3,
-       .src_offset     = 15,
-       .recalc         = &omap2_followparent_recalc,
-};
-
-static struct clk sdrc_ick = {
-       .name           = "sdrc_ick",
-       .parent         = &l4_ck,
-       .flags          = CLOCK_IN_OMAP243X,
-       .enable_reg     = (void __iomem *)&CM_ICLKEN3_CORE,
-       .enable_bit     = 2,
-       .recalc         = &omap2_followparent_recalc,
-};
-
-static struct clk des_ick = {
-       .name           = "des_ick",
-       .parent         = &l4_ck,
-       .flags          = CLOCK_IN_OMAP243X | CLOCK_IN_OMAP242X,
-       .enable_reg     = (void __iomem *)&CM_ICLKEN4_CORE,
-       .enable_bit     = 0,
-       .recalc         = &omap2_followparent_recalc,
-};
-
-static struct clk sha_ick = {
-       .name           = "sha_ick",
-       .parent         = &l4_ck,
-       .flags          = CLOCK_IN_OMAP243X | CLOCK_IN_OMAP242X,
-       .enable_reg     = (void __iomem *)&CM_ICLKEN4_CORE,
-       .enable_bit     = 1,
-       .recalc         = &omap2_followparent_recalc,
-};
-
-static struct clk rng_ick = {
-       .name           = "rng_ick",
-       .parent         = &l4_ck,
-       .flags          = CLOCK_IN_OMAP243X | CLOCK_IN_OMAP242X,
-       .enable_reg     = (void __iomem *)&CM_ICLKEN4_CORE,
-       .enable_bit     = 2,
-       .recalc         = &omap2_followparent_recalc,
-};
-
-static struct clk aes_ick = {
-       .name           = "aes_ick",
-       .parent         = &l4_ck,
-       .flags          = CLOCK_IN_OMAP243X | CLOCK_IN_OMAP242X,
-       .enable_reg     = (void __iomem *)&CM_ICLKEN4_CORE,
-       .enable_bit     = 3,
-       .recalc         = &omap2_followparent_recalc,
-};
-
-static struct clk pka_ick = {
-       .name           = "pka_ick",
-       .parent         = &l4_ck,
-       .flags          = CLOCK_IN_OMAP243X | CLOCK_IN_OMAP242X,
-       .enable_reg     = (void __iomem *)&CM_ICLKEN4_CORE,
-       .enable_bit     = 4,
-       .recalc         = &omap2_followparent_recalc,
-};
-
-static struct clk usb_fck = {
-       .name           = "usb_fck",
-       .parent         = &func_48m_ck,
-       .flags          = CLOCK_IN_OMAP243X | CLOCK_IN_OMAP242X,
-       .enable_reg     = (void __iomem *)&CM_FCLKEN2_CORE,
-       .enable_bit     = 0,
-       .recalc         = &omap2_followparent_recalc,
-};
-
-static struct clk usbhs_ick = {
-       .name           = "usbhs_ick",
-       .parent         = &core_l3_ck,
-       .flags          = CLOCK_IN_OMAP243X,
-       .enable_reg     = (void __iomem *)&CM_ICLKEN2_CORE,
-       .enable_bit     = 6,
-       .recalc         = &omap2_followparent_recalc,
-};
-
-static struct clk mmchs1_ick = {
-       .name           = "mmchs1_ick",
-       .parent         = &l4_ck,
-       .flags          = CLOCK_IN_OMAP243X,
-       .enable_reg     = (void __iomem *)&CM_ICLKEN2_CORE,
-       .enable_bit     = 7,
-       .recalc         = &omap2_followparent_recalc,
-};
-
-static struct clk mmchs1_fck = {
-       .name           = "mmchs1_fck",
-       .parent         = &func_96m_ck,
-       .flags          = CLOCK_IN_OMAP243X,
-       .enable_reg     = (void __iomem *)&CM_FCLKEN2_CORE,
-       .enable_bit     = 7,
-       .recalc         = &omap2_followparent_recalc,
-};
-
-static struct clk mmchs2_ick = {
-       .name           = "mmchs2_ick",
-       .parent         = &l4_ck,
-       .flags          = CLOCK_IN_OMAP243X,
-       .enable_reg     = (void __iomem *)&CM_ICLKEN2_CORE,
-       .enable_bit     = 8,
-       .recalc         = &omap2_followparent_recalc,
-};
-
-static struct clk mmchs2_fck = {
-       .name           = "mmchs2_fck",
-       .parent         = &func_96m_ck,
-       .flags          = CLOCK_IN_OMAP243X,
-       .enable_reg     = (void __iomem *)&CM_FCLKEN2_CORE,
-       .enable_bit     = 8,
-       .recalc         = &omap2_followparent_recalc,
-};
+#ifdef CONFIG_OMAP_RESET_CLOCKS
+void omap2_clk_disable_unused(struct clk *clk);
+#else
+#define omap2_clk_disable_unused       NULL
+#endif
 
-static struct clk gpio5_ick = {
-       .name           = "gpio5_ick",
-       .parent         = &l4_ck,
-       .flags          = CLOCK_IN_OMAP243X,
-       .enable_reg     = (void __iomem *)&CM_ICLKEN2_CORE,
-       .enable_bit     = 10,
-       .recalc         = &omap2_followparent_recalc,
-};
+void omap2_clksel_recalc(struct clk *clk);
+void omap2_init_clksel_parent(struct clk *clk);
+u32 omap2_clksel_get_divisor(struct clk *clk);
+u32 omap2_clksel_round_rate_div(struct clk *clk, unsigned long target_rate,
+                               u32 *new_div);
+u32 omap2_clksel_to_divisor(struct clk *clk, u32 field_val);
+u32 omap2_divisor_to_clksel(struct clk *clk, u32 div);
+void omap2_fixed_divisor_recalc(struct clk *clk);
+long omap2_clksel_round_rate(struct clk *clk, unsigned long target_rate);
+int omap2_clksel_set_rate(struct clk *clk, unsigned long rate);
+u32 omap2_get_dpll_rate(struct clk *clk);
+int omap2_wait_clock_ready(void __iomem *reg, u32 cval, const char *name);
 
-static struct clk gpio5_fck = {
-       .name           = "gpio5_fck",
-       .parent         = &func_32k_ck,
-       .flags          = CLOCK_IN_OMAP243X,
-       .enable_reg     = (void __iomem *)&CM_FCLKEN2_CORE,
-       .enable_bit     = 10,
-       .recalc         = &omap2_followparent_recalc,
-};
+extern u8 cpu_mask;
 
-static struct clk mdm_intc_ick = {
-       .name           = "mdm_intc_ick",
-       .parent         = &l4_ck,
-       .flags          = CLOCK_IN_OMAP243X,
-       .enable_reg     = (void __iomem *)&CM_ICLKEN2_CORE,
-       .enable_bit     = 11,
-       .recalc         = &omap2_followparent_recalc,
+/* clksel_rate data common to 24xx/343x */
+static const struct clksel_rate gpt_32k_rates[] = {
+        { .div = 1, .val = 0, .flags = RATE_IN_24XX | RATE_IN_343X | DEFAULT_RATE },
+        { .div = 0 }
 };
 
-static struct clk mmchsdb1_fck = {
-       .name           = "mmchsdb1_fck",
-       .parent         = &func_32k_ck,
-       .flags          = CLOCK_IN_OMAP243X,
-       .enable_reg     = (void __iomem *)&CM_FCLKEN2_CORE,
-       .enable_bit     = 16,
-       .recalc         = &omap2_followparent_recalc,
+static const struct clksel_rate gpt_sys_rates[] = {
+        { .div = 1, .val = 1, .flags = RATE_IN_24XX | RATE_IN_343X | DEFAULT_RATE },
+        { .div = 0 }
 };
 
-static struct clk mmchsdb2_fck = {
-       .name           = "mmchsdb2_fck",
-       .parent         = &func_32k_ck,
-       .flags          = CLOCK_IN_OMAP243X,
-       .enable_reg     = (void __iomem *)&CM_FCLKEN2_CORE,
-       .enable_bit     = 17,
-       .recalc         = &omap2_followparent_recalc,
+static const struct clksel_rate gfx_l3_rates[] = {
+       { .div = 1, .val = 1, .flags = RATE_IN_24XX | RATE_IN_343X },
+       { .div = 2, .val = 2, .flags = RATE_IN_24XX | RATE_IN_343X | DEFAULT_RATE },
+       { .div = 3, .val = 3, .flags = RATE_IN_243X | RATE_IN_343X },
+       { .div = 4, .val = 4, .flags = RATE_IN_243X | RATE_IN_343X },
+       { .div = 0 }
 };
 
-/*
- * This clock is a composite clock which does entire set changes then
- * forces a rebalance. It keys on the MPU speed, but it really could
- * be any key speed part of a set in the rate table.
- *
- * to really change a set, you need memory table sets which get changed
- * in sram, pre-notifiers & post notifiers, changing the top set, without
- * having low level display recalc's won't work... this is why dpm notifiers
- * work, isr's off, walk a list of clocks already _off_ and not messing with
- * the bus.
- *
- * This clock should have no parent. It embodies the entire upper level
- * active set. A parent will mess up some of the init also.
- */
-static struct clk virt_prcm_set = {
-       .name           = "virt_prcm_set",
-       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
-                               VIRTUAL_CLOCK | ALWAYS_ENABLED | DELAYED_APP,
-       .parent         = &mpu_ck,      /* Indexed by mpu speed, no parent */
-       .recalc         = &omap2_mpu_recalc,    /* sets are keyed on mpu rate */
-       .set_rate       = &omap2_select_table_rate,
-       .round_rate     = &omap2_round_to_table_rate,
-};
-
-static struct clk *onchip_clks[] = {
-       /* external root sources */
-       &func_32k_ck,
-       &osc_ck,
-       &sys_ck,
-       &alt_ck,
-       /* internal analog sources */
-       &dpll_ck,
-       &apll96_ck,
-       &apll54_ck,
-       /* internal prcm root sources */
-       &func_54m_ck,
-       &core_ck,
-       &sleep_ck,
-       &func_96m_ck,
-       &func_48m_ck,
-       &func_12m_ck,
-       &wdt1_osc_ck,
-       &sys_clkout,
-       &sys_clkout2,
-       &emul_ck,
-       /* mpu domain clocks */
-       &mpu_ck,
-       /* dsp domain clocks */
-       &iva2_1_fck,            /* 2430 */
-       &iva2_1_ick,
-       &dsp_ick,               /* 2420 */
-       &dsp_fck,
-       &iva1_ifck,
-       &iva1_mpu_int_ifck,
-       /* GFX domain clocks */
-       &gfx_3d_fck,
-       &gfx_2d_fck,
-       &gfx_ick,
-       /* Modem domain clocks */
-       &mdm_ick,
-       &mdm_osc_ck,
-       /* DSS domain clocks */
-       &dss_ick,
-       &dss1_fck,
-       &dss2_fck,
-       &dss_54m_fck,
-       /* L3 domain clocks */
-       &core_l3_ck,
-       &ssi_ssr_sst_fck,
-       &usb_l4_ick,
-       /* L4 domain clocks */
-       &l4_ck,                 /* used as both core_l4 and wu_l4 */
-       &ssi_l4_ick,
-       /* virtual meta-group clock */
-       &virt_prcm_set,
-       /* general l4 interface ck, multi-parent functional clk */
-       &gpt1_ick,
-       &gpt1_fck,
-       &gpt2_ick,
-       &gpt2_fck,
-       &gpt3_ick,
-       &gpt3_fck,
-       &gpt4_ick,
-       &gpt4_fck,
-       &gpt5_ick,
-       &gpt5_fck,
-       &gpt6_ick,
-       &gpt6_fck,
-       &gpt7_ick,
-       &gpt7_fck,
-       &gpt8_ick,
-       &gpt8_fck,
-       &gpt9_ick,
-       &gpt9_fck,
-       &gpt10_ick,
-       &gpt10_fck,
-       &gpt11_ick,
-       &gpt11_fck,
-       &gpt12_ick,
-       &gpt12_fck,
-       &mcbsp1_ick,
-       &mcbsp1_fck,
-       &mcbsp2_ick,
-       &mcbsp2_fck,
-       &mcbsp3_ick,
-       &mcbsp3_fck,
-       &mcbsp4_ick,
-       &mcbsp4_fck,
-       &mcbsp5_ick,
-       &mcbsp5_fck,
-       &mcspi1_ick,
-       &mcspi1_fck,
-       &mcspi2_ick,
-       &mcspi2_fck,
-       &mcspi3_ick,
-       &mcspi3_fck,
-       &uart1_ick,
-       &uart1_fck,
-       &uart2_ick,
-       &uart2_fck,
-       &uart3_ick,
-       &uart3_fck,
-       &gpios_ick,
-       &gpios_fck,
-       &mpu_wdt_ick,
-       &mpu_wdt_fck,
-       &sync_32k_ick,
-       &wdt1_ick,
-       &omapctrl_ick,
-       &icr_ick,
-       &cam_fck,
-       &cam_ick,
-       &mailboxes_ick,
-       &wdt4_ick,
-       &wdt4_fck,
-       &wdt3_ick,
-       &wdt3_fck,
-       &mspro_ick,
-       &mspro_fck,
-       &mmc_ick,
-       &mmc_fck,
-       &fac_ick,
-       &fac_fck,
-       &eac_ick,
-       &eac_fck,
-       &hdq_ick,
-       &hdq_fck,
-       &i2c1_ick,
-       &i2c1_fck,
-       &i2chs1_fck,
-       &i2c2_ick,
-       &i2c2_fck,
-       &i2chs2_fck,
-       &vlynq_ick,
-       &vlynq_fck,
-       &sdrc_ick,
-       &des_ick,
-       &sha_ick,
-       &rng_ick,
-       &aes_ick,
-       &pka_ick,
-       &usb_fck,
-       &usbhs_ick,
-       &mmchs1_ick,
-       &mmchs1_fck,
-       &mmchs2_ick,
-       &mmchs2_fck,
-       &gpio5_ick,
-       &gpio5_fck,
-       &mdm_intc_ick,
-       &mmchsdb1_fck,
-       &mmchsdb2_fck,
-};
 
 #endif
diff --git a/arch/arm/mach-omap2/clock24xx.c b/arch/arm/mach-omap2/clock24xx.c
new file mode 100644 (file)
index 0000000..ece32d8
--- /dev/null
@@ -0,0 +1,539 @@
+/*
+ *  linux/arch/arm/mach-omap2/clock.c
+ *
+ *  Copyright (C) 2005-2008 Texas Instruments, Inc.
+ *  Copyright (C) 2004-2008 Nokia Corporation
+ *
+ *  Contacts:
+ *  Richard Woodruff <r-woodruff2@ti.com>
+ *  Paul Walmsley
+ *
+ *  Based on earlier work by Tuukka Tikkanen, Tony Lindgren,
+ *  Gordon McNutt and RidgeRun, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+#undef DEBUG
+
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/device.h>
+#include <linux/list.h>
+#include <linux/errno.h>
+#include <linux/delay.h>
+#include <linux/clk.h>
+
+#include <linux/io.h>
+#include <linux/cpufreq.h>
+
+#include <asm/arch/clock.h>
+#include <asm/arch/sram.h>
+#include <asm/div64.h>
+#include <asm/bitops.h>
+
+#include "memory.h"
+#include "clock.h"
+#include "clock24xx.h"
+#include "prm.h"
+#include "prm-regbits-24xx.h"
+#include "cm.h"
+#include "cm-regbits-24xx.h"
+
+/* CM_CLKEN_PLL.EN_{54,96}M_PLL options (24XX) */
+#define EN_APLL_STOPPED                        0
+#define EN_APLL_LOCKED                 3
+
+/* CM_CLKSEL1_PLL.APLLS_CLKIN options (24XX) */
+#define APLLS_CLKIN_19_2MHZ            0
+#define APLLS_CLKIN_13MHZ              2
+#define APLLS_CLKIN_12MHZ              3
+
+/* #define DOWN_VARIABLE_DPLL 1 */             /* Experimental */
+
+static struct prcm_config *curr_prcm_set;
+static struct clk *vclk;
+static struct clk *sclk;
+
+/*-------------------------------------------------------------------------
+ * Omap24xx specific clock functions
+ *-------------------------------------------------------------------------*/
+
+/* This actually returns the rate of core_ck, not dpll_ck. */
+static u32 omap2_get_dpll_rate_24xx(struct clk *tclk)
+{
+       long long dpll_clk;
+       u8 amult;
+
+       dpll_clk = omap2_get_dpll_rate(tclk);
+
+       amult = cm_read_mod_reg(PLL_MOD, CM_CLKSEL2);
+       amult &= OMAP24XX_CORE_CLK_SRC_MASK;
+       dpll_clk *= amult;
+
+       return dpll_clk;
+}
+
+static int omap2_enable_osc_ck(struct clk *clk)
+{
+       u32 pcc;
+
+       pcc = __raw_readl(OMAP24XX_PRCM_CLKSRC_CTRL);
+
+       __raw_writel(pcc & ~OMAP_AUTOEXTCLKMODE_MASK,
+                     OMAP24XX_PRCM_CLKSRC_CTRL);
+
+       return 0;
+}
+
+static void omap2_disable_osc_ck(struct clk *clk)
+{
+       u32 pcc;
+
+       pcc = __raw_readl(OMAP24XX_PRCM_CLKSRC_CTRL);
+
+       __raw_writel(pcc | OMAP_AUTOEXTCLKMODE_MASK,
+                     OMAP24XX_PRCM_CLKSRC_CTRL);
+}
+
+#ifdef OLD_CK
+/* Recalculate SYST_CLK */
+static void omap2_sys_clk_recalc(struct clk * clk)
+{
+       u32 div = PRCM_CLKSRC_CTRL;
+       div &= (1 << 7) | (1 << 6);     /* Test if ext clk divided by 1 or 2 */
+       div >>= clk->rate_offset;
+       clk->rate = (clk->parent->rate / div);
+       propagate_rate(clk);
+}
+#endif /* OLD_CK */
+
+/* Enable an APLL if off */
+static int omap2_clk_fixed_enable(struct clk *clk)
+{
+       u32 cval, apll_mask;
+
+       apll_mask = EN_APLL_LOCKED << clk->enable_bit;
+
+       cval = cm_read_mod_reg(PLL_MOD, CM_CLKEN);
+
+       if ((cval & apll_mask) == apll_mask)
+               return 0;   /* apll already enabled */
+
+       cval &= ~apll_mask;
+       cval |= apll_mask;
+       cm_write_mod_reg(cval, PLL_MOD, CM_CLKEN);
+
+       if (clk == &apll96_ck)
+               cval = OMAP24XX_ST_96M_APLL;
+       else if (clk == &apll54_ck)
+               cval = OMAP24XX_ST_54M_APLL;
+
+       omap2_wait_clock_ready(OMAP_CM_REGADDR(PLL_MOD, CM_IDLEST), cval,
+                           clk->name);
+
+       /*
+        * REVISIT: Should we return an error code if omap2_wait_clock_ready()
+        * fails?
+        */
+       return 0;
+}
+
+/* Stop APLL */
+static void omap2_clk_fixed_disable(struct clk *clk)
+{
+       u32 cval;
+
+       cval = cm_read_mod_reg(PLL_MOD, CM_CLKEN);
+       cval &= ~(EN_APLL_LOCKED << clk->enable_bit);
+       cm_write_mod_reg(cval, PLL_MOD, CM_CLKEN);
+}
+
+/*
+ * Uses the current prcm set to tell if a rate is valid.
+ * You can go slower, but not faster within a given rate set.
+ */
+static u32 omap2_dpll_round_rate(unsigned long target_rate)
+{
+       u32 high, low, core_clk_src;
+
+       core_clk_src = cm_read_mod_reg(PLL_MOD, CM_CLKSEL2);
+       core_clk_src &= OMAP24XX_CORE_CLK_SRC_MASK;
+
+       if (core_clk_src == CORE_CLK_SRC_DPLL) {        /* DPLL clockout */
+               high = curr_prcm_set->dpll_speed * 2;
+               low = curr_prcm_set->dpll_speed;
+       } else {                                /* DPLL clockout x 2 */
+               high = curr_prcm_set->dpll_speed;
+               low = curr_prcm_set->dpll_speed / 2;
+       }
+
+#ifdef DOWN_VARIABLE_DPLL
+       if (target_rate > high)
+               return high;
+       else
+               return target_rate;
+#else
+       if (target_rate > low)
+               return high;
+       else
+               return low;
+#endif
+
+}
+
+static void omap2_dpll_recalc(struct clk *clk)
+{
+       clk->rate = omap2_get_dpll_rate_24xx(clk);
+
+       propagate_rate(clk);
+}
+
+static int omap2_reprogram_dpll(struct clk *clk, unsigned long rate)
+{
+       u32 cur_rate, low, mult, div, valid_rate, done_rate;
+       u32 bypass = 0;
+       struct prcm_config tmpset;
+       const struct dpll_data *dd;
+       unsigned long flags;
+       int ret = -EINVAL;
+
+       local_irq_save(flags);
+       cur_rate = omap2_get_dpll_rate_24xx(&dpll_ck);
+       mult = cm_read_mod_reg(PLL_MOD, CM_CLKSEL2);
+       mult &= OMAP24XX_CORE_CLK_SRC_MASK;
+
+       if ((rate == (cur_rate / 2)) && (mult == 2)) {
+               omap2_reprogram_sdrc(CORE_CLK_SRC_DPLL, 1);
+       } else if ((rate == (cur_rate * 2)) && (mult == 1)) {
+               omap2_reprogram_sdrc(CORE_CLK_SRC_DPLL_X2, 1);
+       } else if (rate != cur_rate) {
+               valid_rate = omap2_dpll_round_rate(rate);
+               if (valid_rate != rate)
+                       goto dpll_exit;
+
+               if (mult == 1)
+                       low = curr_prcm_set->dpll_speed;
+               else
+                       low = curr_prcm_set->dpll_speed / 2;
+
+               dd = clk->dpll_data;
+               if (!dd)
+                       goto dpll_exit;
+
+               tmpset.cm_clksel1_pll = __raw_readl(dd->mult_div1_reg);
+               tmpset.cm_clksel1_pll &= ~(dd->mult_mask |
+                                          dd->div1_mask);
+               div = ((curr_prcm_set->xtal_speed / 1000000) - 1);
+               tmpset.cm_clksel2_pll = cm_read_mod_reg(PLL_MOD, CM_CLKSEL2);
+               tmpset.cm_clksel2_pll &= ~OMAP24XX_CORE_CLK_SRC_MASK;
+               if (rate > low) {
+                       tmpset.cm_clksel2_pll |= CORE_CLK_SRC_DPLL_X2;
+                       mult = ((rate / 2) / 1000000);
+                       done_rate = CORE_CLK_SRC_DPLL_X2;
+               } else {
+                       tmpset.cm_clksel2_pll |= CORE_CLK_SRC_DPLL;
+                       mult = (rate / 1000000);
+                       done_rate = CORE_CLK_SRC_DPLL;
+               }
+               tmpset.cm_clksel1_pll |= (div << __ffs(dd->mult_mask));
+               tmpset.cm_clksel1_pll |= (mult << __ffs(dd->div1_mask));
+
+               /* Worst case */
+               tmpset.base_sdrc_rfr = SDRC_RFR_CTRL_BYPASS;
+
+               if (rate == curr_prcm_set->xtal_speed)  /* If asking for 1-1 */
+                       bypass = 1;
+
+               omap2_reprogram_sdrc(CORE_CLK_SRC_DPLL_X2, 1); /* For init_mem */
+
+               /* Force dll lock mode */
+               omap2_set_prcm(tmpset.cm_clksel1_pll, tmpset.base_sdrc_rfr,
+                              bypass);
+
+               /* Errata: ret dll entry state */
+               omap2_init_memory_params(omap2_dll_force_needed());
+               omap2_reprogram_sdrc(done_rate, 0);
+       }
+       omap2_dpll_recalc(&dpll_ck);
+       ret = 0;
+
+dpll_exit:
+       local_irq_restore(flags);
+       return(ret);
+}
+
+/**
+ * omap2_table_mpu_recalc - just return the MPU speed
+ * @clk: virt_prcm_set struct clk
+ *
+ * Set virt_prcm_set's rate to the mpu_speed field of the current PRCM set.
+ */
+static void omap2_table_mpu_recalc(struct clk *clk)
+{
+       clk->rate = curr_prcm_set->mpu_speed;
+}
+
+/*
+ * Look for a rate equal or less than the target rate given a configuration set.
+ *
+ * What's not entirely clear is "which" field represents the key field.
+ * Some might argue L3-DDR, others ARM, others IVA. This code is simple and
+ * just uses the ARM rates.
+ */
+static long omap2_round_to_table_rate(struct clk *clk, unsigned long rate)
+{
+       struct prcm_config *ptr;
+       long highest_rate;
+
+       if (clk != &virt_prcm_set)
+               return -EINVAL;
+
+       highest_rate = -EINVAL;
+
+       for (ptr = rate_table; ptr->mpu_speed; ptr++) {
+               if (!(ptr->flags & cpu_mask))
+                       continue;
+               if (ptr->xtal_speed != sys_ck.rate)
+                       continue;
+
+               highest_rate = ptr->mpu_speed;
+
+               /* Can check only after xtal frequency check */
+               if (ptr->mpu_speed <= rate)
+                       break;
+       }
+       return highest_rate;
+}
+
+/* Sets basic clocks based on the specified rate */
+static int omap2_select_table_rate(struct clk *clk, unsigned long rate)
+{
+       u32 cur_rate, done_rate, bypass = 0, tmp;
+       struct prcm_config *prcm;
+       unsigned long found_speed = 0;
+       unsigned long flags;
+
+       if (clk != &virt_prcm_set)
+               return -EINVAL;
+
+       for (prcm = rate_table; prcm->mpu_speed; prcm++) {
+               if (!(prcm->flags & cpu_mask))
+                       continue;
+
+               if (prcm->xtal_speed != sys_ck.rate)
+                       continue;
+
+               if (prcm->mpu_speed <= rate) {
+                       found_speed = prcm->mpu_speed;
+                       break;
+               }
+       }
+
+       if (!found_speed) {
+               printk(KERN_INFO "Could not set MPU rate to %luMHz\n",
+                      rate / 1000000);
+               return -EINVAL;
+       }
+
+       curr_prcm_set = prcm;
+       cur_rate = omap2_get_dpll_rate_24xx(&dpll_ck);
+
+       if (prcm->dpll_speed == cur_rate / 2) {
+               omap2_reprogram_sdrc(CORE_CLK_SRC_DPLL, 1);
+       } else if (prcm->dpll_speed == cur_rate * 2) {
+               omap2_reprogram_sdrc(CORE_CLK_SRC_DPLL_X2, 1);
+       } else if (prcm->dpll_speed != cur_rate) {
+               local_irq_save(flags);
+
+               if (prcm->dpll_speed == prcm->xtal_speed)
+                       bypass = 1;
+
+               if ((prcm->cm_clksel2_pll & OMAP24XX_CORE_CLK_SRC_MASK) ==
+                   CORE_CLK_SRC_DPLL_X2)
+                       done_rate = CORE_CLK_SRC_DPLL_X2;
+               else
+                       done_rate = CORE_CLK_SRC_DPLL;
+
+               /* MPU divider */
+               cm_write_mod_reg(prcm->cm_clksel_mpu, MPU_MOD, CM_CLKSEL);
+
+               /* dsp + iva1 div(2420), iva2.1(2430) */
+               cm_write_mod_reg(prcm->cm_clksel_dsp,
+                                OMAP24XX_DSP_MOD, CM_CLKSEL);
+
+               cm_write_mod_reg(prcm->cm_clksel_gfx, GFX_MOD, CM_CLKSEL);
+
+               /* Major subsystem dividers */
+               tmp = cm_read_mod_reg(CORE_MOD, CM_CLKSEL1) & OMAP24XX_CLKSEL_DSS2_MASK;
+               cm_write_mod_reg(prcm->cm_clksel1_core | tmp, CORE_MOD, CM_CLKSEL1);
+               if (cpu_is_omap2430())
+                       cm_write_mod_reg(prcm->cm_clksel_mdm,
+                                        OMAP2430_MDM_MOD, CM_CLKSEL);
+
+               /* x2 to enter init_mem */
+               omap2_reprogram_sdrc(CORE_CLK_SRC_DPLL_X2, 1);
+
+               omap2_set_prcm(prcm->cm_clksel1_pll, prcm->base_sdrc_rfr,
+                              bypass);
+
+               omap2_init_memory_params(omap2_dll_force_needed());
+               omap2_reprogram_sdrc(done_rate, 0);
+
+               local_irq_restore(flags);
+       }
+       omap2_dpll_recalc(&dpll_ck);
+
+       return 0;
+}
+
+static struct clk_functions omap2_clk_functions = {
+       .clk_enable             = omap2_clk_enable,
+       .clk_disable            = omap2_clk_disable,
+       .clk_round_rate         = omap2_clk_round_rate,
+       .clk_set_rate           = omap2_clk_set_rate,
+       .clk_set_parent         = omap2_clk_set_parent,
+       .clk_disable_unused     = omap2_clk_disable_unused,
+};
+
+static u32 omap2_get_apll_clkin(void)
+{
+       u32 aplls, sclk = 0;
+
+       aplls = cm_read_mod_reg(PLL_MOD, CM_CLKSEL1);
+       aplls &= OMAP24XX_APLLS_CLKIN_MASK;
+       aplls >>= OMAP24XX_APLLS_CLKIN_SHIFT;
+
+       if (aplls == APLLS_CLKIN_19_2MHZ)
+               sclk = 19200000;
+       else if (aplls == APLLS_CLKIN_13MHZ)
+               sclk = 13000000;
+       else if (aplls == APLLS_CLKIN_12MHZ)
+               sclk = 12000000;
+
+       return sclk;
+}
+
+static u32 omap2_get_sysclkdiv(void)
+{
+       u32 div;
+
+       div = __raw_readl(OMAP24XX_PRCM_CLKSRC_CTRL);
+       div &= OMAP_SYSCLKDIV_MASK;
+       div >>= OMAP_SYSCLKDIV_SHIFT;
+
+       return div;
+}
+
+static void omap2_osc_clk_recalc(struct clk *clk)
+{
+       clk->rate = omap2_get_apll_clkin() * omap2_get_sysclkdiv();
+       propagate_rate(clk);
+}
+
+static void omap2_sys_clk_recalc(struct clk *clk)
+{
+       clk->rate = clk->parent->rate / omap2_get_sysclkdiv();
+       propagate_rate(clk);
+}
+
+/*
+ * Set clocks for bypass mode for reboot to work.
+ */
+void omap2_clk_prepare_for_reboot(void)
+{
+       u32 rate;
+
+       if (vclk == NULL || sclk == NULL)
+               return;
+
+       rate = clk_get_rate(sclk);
+       clk_set_rate(vclk, rate);
+}
+
+/*
+ * Switch the MPU rate if specified on cmdline.
+ * We cannot do this early until cmdline is parsed.
+ */
+static int __init omap2_clk_arch_init(void)
+{
+       if (!mpurate)
+               return -EINVAL;
+
+       if (omap2_select_table_rate(&virt_prcm_set, mpurate))
+               printk(KERN_ERR "Could not find matching MPU rate\n");
+
+       recalculate_root_clocks();
+
+       printk(KERN_INFO "Switched to new clocking rate (Crystal/DPLL/MPU): "
+              "%ld.%01ld/%ld/%ld MHz\n",
+              (sys_ck.rate / 1000000), (sys_ck.rate / 100000) % 10,
+              (dpll_ck.rate / 1000000), (mpu_ck.rate / 1000000)) ;
+
+       return 0;
+}
+arch_initcall(omap2_clk_arch_init);
+
+int __init omap2_clk_init(void)
+{
+       struct prcm_config *prcm;
+       struct clk **clkp;
+       u32 clkrate;
+
+       if (cpu_is_omap242x())
+               cpu_mask = RATE_IN_242X;
+       else if (cpu_is_omap2430())
+               cpu_mask = RATE_IN_243X;
+
+       clk_init(&omap2_clk_functions);
+
+       omap2_osc_clk_recalc(&osc_ck);
+       omap2_sys_clk_recalc(&sys_ck);
+
+       for (clkp = onchip_24xx_clks;
+            clkp < onchip_24xx_clks + ARRAY_SIZE(onchip_24xx_clks);
+            clkp++) {
+
+               if ((*clkp)->flags & CLOCK_IN_OMAP242X && cpu_is_omap2420()) {
+                       clk_register(*clkp);
+                       continue;
+               }
+
+               if ((*clkp)->flags & CLOCK_IN_OMAP243X && cpu_is_omap2430()) {
+                       clk_register(*clkp);
+                       continue;
+               }
+       }
+
+       /* Check the MPU rate set by bootloader */
+       clkrate = omap2_get_dpll_rate_24xx(&dpll_ck);
+       for (prcm = rate_table; prcm->mpu_speed; prcm++) {
+               if (!(prcm->flags & cpu_mask))
+                       continue;
+               if (prcm->xtal_speed != sys_ck.rate)
+                       continue;
+               if (prcm->dpll_speed <= clkrate)
+                        break;
+       }
+       curr_prcm_set = prcm;
+
+       recalculate_root_clocks();
+
+       printk(KERN_INFO "Clocking rate (Crystal/DPLL/MPU): "
+              "%ld.%01ld/%ld/%ld MHz\n",
+              (sys_ck.rate / 1000000), (sys_ck.rate / 100000) % 10,
+              (dpll_ck.rate / 1000000), (mpu_ck.rate / 1000000)) ;
+
+       /*
+        * Only enable those clocks we will need, let the drivers
+        * enable other clocks as necessary
+        */
+       clk_enable_init_clocks();
+
+       /* Avoid sleeping sleeping during omap2_clk_prepare_for_reboot() */
+       vclk = clk_get(NULL, "virt_prcm_set");
+       sclk = clk_get(NULL, "sys_ck");
+
+       return 0;
+}
diff --git a/arch/arm/mach-omap2/clock24xx.h b/arch/arm/mach-omap2/clock24xx.h
new file mode 100644 (file)
index 0000000..88081ed
--- /dev/null
@@ -0,0 +1,2643 @@
+/*
+ *  linux/arch/arm/mach-omap2/clock24xx.h
+ *
+ *  Copyright (C) 2005-2008 Texas Instruments, Inc.
+ *  Copyright (C) 2004-2008 Nokia Corporation
+ *
+ *  Contacts:
+ *  Richard Woodruff <r-woodruff2@ti.com>
+ *  Paul Walmsley
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#ifndef __ARCH_ARM_MACH_OMAP2_CLOCK24XX_H
+#define __ARCH_ARM_MACH_OMAP2_CLOCK24XX_H
+
+#include "clock.h"
+
+#include "prm.h"
+#include "cm.h"
+#include "prm-regbits-24xx.h"
+#include "cm-regbits-24xx.h"
+#include "sdrc.h"
+
+static void omap2_table_mpu_recalc(struct clk *clk);
+static int omap2_select_table_rate(struct clk *clk, unsigned long rate);
+static long omap2_round_to_table_rate(struct clk *clk, unsigned long rate);
+static void omap2_sys_clk_recalc(struct clk *clk);
+static void omap2_osc_clk_recalc(struct clk *clk);
+static void omap2_sys_clk_recalc(struct clk *clk);
+static void omap2_dpll_recalc(struct clk *clk);
+static int omap2_clk_fixed_enable(struct clk *clk);
+static void omap2_clk_fixed_disable(struct clk *clk);
+static int omap2_enable_osc_ck(struct clk *clk);
+static void omap2_disable_osc_ck(struct clk *clk);
+static int omap2_reprogram_dpll(struct clk *clk, unsigned long rate);
+
+/* Key dividers which make up a PRCM set. Ratio's for a PRCM are mandated.
+ * xtal_speed, dpll_speed, mpu_speed, CM_CLKSEL_MPU,CM_CLKSEL_DSP
+ * CM_CLKSEL_GFX, CM_CLKSEL1_CORE, CM_CLKSEL1_PLL CM_CLKSEL2_PLL, CM_CLKSEL_MDM
+ */
+struct prcm_config {
+       unsigned long xtal_speed;       /* crystal rate */
+       unsigned long dpll_speed;       /* dpll: out*xtal*M/(N-1)table_recalc */
+       unsigned long mpu_speed;        /* speed of MPU */
+       unsigned long cm_clksel_mpu;    /* mpu divider */
+       unsigned long cm_clksel_dsp;    /* dsp+iva1 div(2420), iva2.1(2430) */
+       unsigned long cm_clksel_gfx;    /* gfx dividers */
+       unsigned long cm_clksel1_core;  /* major subsystem dividers */
+       unsigned long cm_clksel1_pll;   /* m,n */
+       unsigned long cm_clksel2_pll;   /* dpllx1 or x2 out */
+       unsigned long cm_clksel_mdm;    /* modem dividers 2430 only */
+       unsigned long base_sdrc_rfr;    /* base refresh timing for a set */
+       unsigned char flags;
+};
+
+/*
+ * The OMAP2 processor can be run at several discrete 'PRCM configurations'.
+ * These configurations are characterized by voltage and speed for clocks.
+ * The device is only validated for certain combinations. One way to express
+ * these combinations is via the 'ratio's' which the clocks operate with
+ * respect to each other. These ratio sets are for a given voltage/DPLL
+ * setting. All configurations can be described by a DPLL setting and a ratio
+ * There are 3 ratio sets for the 2430 and X ratio sets for 2420.
+ *
+ * 2430 differs from 2420 in that there are no more phase synchronizers used.
+ * They both have a slightly different clock domain setup. 2420(iva1,dsp) vs
+ * 2430 (iva2.1, NOdsp, mdm)
+ */
+
+/* Core fields for cm_clksel, not ratio governed */
+#define RX_CLKSEL_DSS1                 (0x10 << 8)
+#define RX_CLKSEL_DSS2                 (0x0 << 13)
+#define RX_CLKSEL_SSI                  (0x5 << 20)
+
+/*-------------------------------------------------------------------------
+ * Voltage/DPLL ratios
+ *-------------------------------------------------------------------------*/
+
+/* 2430 Ratio's, 2430-Ratio Config 1 */
+#define R1_CLKSEL_L3                   (4 << 0)
+#define R1_CLKSEL_L4                   (2 << 5)
+#define R1_CLKSEL_USB                  (4 << 25)
+#define R1_CM_CLKSEL1_CORE_VAL         R1_CLKSEL_USB | RX_CLKSEL_SSI | \
+                                       RX_CLKSEL_DSS2 | RX_CLKSEL_DSS1 | \
+                                       R1_CLKSEL_L4 | R1_CLKSEL_L3
+#define R1_CLKSEL_MPU                  (2 << 0)
+#define R1_CM_CLKSEL_MPU_VAL           R1_CLKSEL_MPU
+#define R1_CLKSEL_DSP                  (2 << 0)
+#define R1_CLKSEL_DSP_IF               (2 << 5)
+#define R1_CM_CLKSEL_DSP_VAL           R1_CLKSEL_DSP | R1_CLKSEL_DSP_IF
+#define R1_CLKSEL_GFX                  (2 << 0)
+#define R1_CM_CLKSEL_GFX_VAL           R1_CLKSEL_GFX
+#define R1_CLKSEL_MDM                  (4 << 0)
+#define R1_CM_CLKSEL_MDM_VAL           R1_CLKSEL_MDM
+
+/* 2430-Ratio Config 2 */
+#define R2_CLKSEL_L3                   (6 << 0)
+#define R2_CLKSEL_L4                   (2 << 5)
+#define R2_CLKSEL_USB                  (2 << 25)
+#define R2_CM_CLKSEL1_CORE_VAL         R2_CLKSEL_USB | RX_CLKSEL_SSI | \
+                                       RX_CLKSEL_DSS2 | RX_CLKSEL_DSS1 | \
+                                       R2_CLKSEL_L4 | R2_CLKSEL_L3
+#define R2_CLKSEL_MPU                  (2 << 0)
+#define R2_CM_CLKSEL_MPU_VAL           R2_CLKSEL_MPU
+#define R2_CLKSEL_DSP                  (2 << 0)
+#define R2_CLKSEL_DSP_IF               (3 << 5)
+#define R2_CM_CLKSEL_DSP_VAL           R2_CLKSEL_DSP | R2_CLKSEL_DSP_IF
+#define R2_CLKSEL_GFX                  (2 << 0)
+#define R2_CM_CLKSEL_GFX_VAL           R2_CLKSEL_GFX
+#define R2_CLKSEL_MDM                  (6 << 0)
+#define R2_CM_CLKSEL_MDM_VAL           R2_CLKSEL_MDM
+
+/* 2430-Ratio Bootm (BYPASS) */
+#define RB_CLKSEL_L3                   (1 << 0)
+#define RB_CLKSEL_L4                   (1 << 5)
+#define RB_CLKSEL_USB                  (1 << 25)
+#define RB_CM_CLKSEL1_CORE_VAL         RB_CLKSEL_USB | RX_CLKSEL_SSI | \
+                                       RX_CLKSEL_DSS2 | RX_CLKSEL_DSS1 | \
+                                       RB_CLKSEL_L4 | RB_CLKSEL_L3
+#define RB_CLKSEL_MPU                  (1 << 0)
+#define RB_CM_CLKSEL_MPU_VAL           RB_CLKSEL_MPU
+#define RB_CLKSEL_DSP                  (1 << 0)
+#define RB_CLKSEL_DSP_IF               (1 << 5)
+#define RB_CM_CLKSEL_DSP_VAL           RB_CLKSEL_DSP | RB_CLKSEL_DSP_IF
+#define RB_CLKSEL_GFX                  (1 << 0)
+#define RB_CM_CLKSEL_GFX_VAL           RB_CLKSEL_GFX
+#define RB_CLKSEL_MDM                  (1 << 0)
+#define RB_CM_CLKSEL_MDM_VAL           RB_CLKSEL_MDM
+
+/* 2420 Ratio Equivalents */
+#define RXX_CLKSEL_VLYNQ               (0x12 << 15)
+#define RXX_CLKSEL_SSI                 (0x8 << 20)
+
+/* 2420-PRCM III 532MHz core */
+#define RIII_CLKSEL_L3                 (4 << 0)        /* 133MHz */
+#define RIII_CLKSEL_L4                 (2 << 5)        /* 66.5MHz */
+#define RIII_CLKSEL_USB                        (4 << 25)       /* 33.25MHz */
+#define RIII_CM_CLKSEL1_CORE_VAL       RIII_CLKSEL_USB | RXX_CLKSEL_SSI | \
+                                       RXX_CLKSEL_VLYNQ | RX_CLKSEL_DSS2 | \
+                                       RX_CLKSEL_DSS1 | RIII_CLKSEL_L4 | \
+                                       RIII_CLKSEL_L3
+#define RIII_CLKSEL_MPU                        (2 << 0)        /* 266MHz */
+#define RIII_CM_CLKSEL_MPU_VAL         RIII_CLKSEL_MPU
+#define RIII_CLKSEL_DSP                        (3 << 0)        /* c5x - 177.3MHz */
+#define RIII_CLKSEL_DSP_IF             (2 << 5)        /* c5x - 88.67MHz */
+#define RIII_SYNC_DSP                  (1 << 7)        /* Enable sync */
+#define RIII_CLKSEL_IVA                        (6 << 8)        /* iva1 - 88.67MHz */
+#define RIII_SYNC_IVA                  (1 << 13)       /* Enable sync */
+#define RIII_CM_CLKSEL_DSP_VAL         RIII_SYNC_IVA | RIII_CLKSEL_IVA | \
+                                       RIII_SYNC_DSP | RIII_CLKSEL_DSP_IF | \
+                                       RIII_CLKSEL_DSP
+#define RIII_CLKSEL_GFX                        (2 << 0)        /* 66.5MHz */
+#define RIII_CM_CLKSEL_GFX_VAL         RIII_CLKSEL_GFX
+
+/* 2420-PRCM II 600MHz core */
+#define RII_CLKSEL_L3                  (6 << 0)        /* 100MHz */
+#define RII_CLKSEL_L4                  (2 << 5)        /* 50MHz */
+#define RII_CLKSEL_USB                 (2 << 25)       /* 50MHz */
+#define RII_CM_CLKSEL1_CORE_VAL                RII_CLKSEL_USB | \
+                                       RXX_CLKSEL_SSI | RXX_CLKSEL_VLYNQ | \
+                                       RX_CLKSEL_DSS2 | RX_CLKSEL_DSS1 | \
+                                       RII_CLKSEL_L4 | RII_CLKSEL_L3
+#define RII_CLKSEL_MPU                 (2 << 0)        /* 300MHz */
+#define RII_CM_CLKSEL_MPU_VAL          RII_CLKSEL_MPU
+#define RII_CLKSEL_DSP                 (3 << 0)        /* c5x - 200MHz */
+#define RII_CLKSEL_DSP_IF              (2 << 5)        /* c5x - 100MHz */
+#define RII_SYNC_DSP                   (0 << 7)        /* Bypass sync */
+#define RII_CLKSEL_IVA                 (3 << 8)        /* iva1 - 200MHz */
+#define RII_SYNC_IVA                   (0 << 13)       /* Bypass sync */
+#define RII_CM_CLKSEL_DSP_VAL          RII_SYNC_IVA | RII_CLKSEL_IVA | \
+                                       RII_SYNC_DSP | RII_CLKSEL_DSP_IF | \
+                                       RII_CLKSEL_DSP
+#define RII_CLKSEL_GFX                 (2 << 0)        /* 50MHz */
+#define RII_CM_CLKSEL_GFX_VAL          RII_CLKSEL_GFX
+
+/* 2420-PRCM I 660MHz core */
+#define RI_CLKSEL_L3                   (4 << 0)        /* 165MHz */
+#define RI_CLKSEL_L4                   (2 << 5)        /* 82.5MHz */
+#define RI_CLKSEL_USB                  (4 << 25)       /* 41.25MHz */
+#define RI_CM_CLKSEL1_CORE_VAL         RI_CLKSEL_USB | \
+                                       RXX_CLKSEL_SSI | RXX_CLKSEL_VLYNQ | \
+                                       RX_CLKSEL_DSS2 | RX_CLKSEL_DSS1 | \
+                                       RI_CLKSEL_L4 | RI_CLKSEL_L3
+#define RI_CLKSEL_MPU                  (2 << 0)        /* 330MHz */
+#define RI_CM_CLKSEL_MPU_VAL           RI_CLKSEL_MPU
+#define RI_CLKSEL_DSP                  (3 << 0)        /* c5x - 220MHz */
+#define RI_CLKSEL_DSP_IF               (2 << 5)        /* c5x - 110MHz */
+#define RI_SYNC_DSP                    (1 << 7)        /* Activate sync */
+#define RI_CLKSEL_IVA                  (4 << 8)        /* iva1 - 165MHz */
+#define RI_SYNC_IVA                    (0 << 13)       /* Bypass sync */
+#define RI_CM_CLKSEL_DSP_VAL           RI_SYNC_IVA | RI_CLKSEL_IVA | \
+                                       RI_SYNC_DSP | RI_CLKSEL_DSP_IF | \
+                                       RI_CLKSEL_DSP
+#define RI_CLKSEL_GFX                  (1 << 0)        /* 165MHz */
+#define RI_CM_CLKSEL_GFX_VAL           RI_CLKSEL_GFX
+
+/* 2420-PRCM VII (boot) */
+#define RVII_CLKSEL_L3                 (1 << 0)
+#define RVII_CLKSEL_L4                 (1 << 5)
+#define RVII_CLKSEL_DSS1               (1 << 8)
+#define RVII_CLKSEL_DSS2               (0 << 13)
+#define RVII_CLKSEL_VLYNQ              (1 << 15)
+#define RVII_CLKSEL_SSI                        (1 << 20)
+#define RVII_CLKSEL_USB                        (1 << 25)
+
+#define RVII_CM_CLKSEL1_CORE_VAL       RVII_CLKSEL_USB | RVII_CLKSEL_SSI | \
+                                       RVII_CLKSEL_VLYNQ | RVII_CLKSEL_DSS2 | \
+                                       RVII_CLKSEL_DSS1 | RVII_CLKSEL_L4 | RVII_CLKSEL_L3
+
+#define RVII_CLKSEL_MPU                        (1 << 0) /* all divide by 1 */
+#define RVII_CM_CLKSEL_MPU_VAL         RVII_CLKSEL_MPU
+
+#define RVII_CLKSEL_DSP                        (1 << 0)
+#define RVII_CLKSEL_DSP_IF             (1 << 5)
+#define RVII_SYNC_DSP                  (0 << 7)
+#define RVII_CLKSEL_IVA                        (1 << 8)
+#define RVII_SYNC_IVA                  (0 << 13)
+#define RVII_CM_CLKSEL_DSP_VAL         RVII_SYNC_IVA | RVII_CLKSEL_IVA | RVII_SYNC_DSP | \
+                                       RVII_CLKSEL_DSP_IF | RVII_CLKSEL_DSP
+
+#define RVII_CLKSEL_GFX                        (1 << 0)
+#define RVII_CM_CLKSEL_GFX_VAL         RVII_CLKSEL_GFX
+
+/*-------------------------------------------------------------------------
+ * 2430 Target modes: Along with each configuration the CPU has several
+ * modes which goes along with them. Modes mainly are the addition of
+ * describe DPLL combinations to go along with a ratio.
+ *-------------------------------------------------------------------------*/
+
+/* Hardware governed */
+#define MX_48M_SRC                     (0 << 3)
+#define MX_54M_SRC                     (0 << 5)
+#define MX_APLLS_CLIKIN_12             (3 << 23)
+#define MX_APLLS_CLIKIN_13             (2 << 23)
+#define MX_APLLS_CLIKIN_19_2           (0 << 23)
+
+/*
+ * 2430 - standalone, 2*ref*M/(n+1), M/N is for exactness not relock speed
+ * #5a (ratio1) baseport-target, target DPLL = 266*2 = 532MHz
+ */
+#define M5A_DPLL_MULT_12               (133 << 12)
+#define M5A_DPLL_DIV_12                        (5 << 8)
+#define M5A_CM_CLKSEL1_PLL_12_VAL      MX_48M_SRC | MX_54M_SRC | \
+                                       M5A_DPLL_DIV_12 | M5A_DPLL_MULT_12 | \
+                                       MX_APLLS_CLIKIN_12
+#define M5A_DPLL_MULT_13               (61 << 12)
+#define M5A_DPLL_DIV_13                        (2 << 8)
+#define M5A_CM_CLKSEL1_PLL_13_VAL      MX_48M_SRC | MX_54M_SRC | \
+                                       M5A_DPLL_DIV_13 | M5A_DPLL_MULT_13 | \
+                                       MX_APLLS_CLIKIN_13
+#define M5A_DPLL_MULT_19               (55 << 12)
+#define M5A_DPLL_DIV_19                        (3 << 8)
+#define M5A_CM_CLKSEL1_PLL_19_VAL      MX_48M_SRC | MX_54M_SRC | \
+                                       M5A_DPLL_DIV_19 | M5A_DPLL_MULT_19 | \
+                                       MX_APLLS_CLIKIN_19_2
+/* #5b (ratio1) target DPLL = 200*2 = 400MHz */
+#define M5B_DPLL_MULT_12               (50 << 12)
+#define M5B_DPLL_DIV_12                        (2 << 8)
+#define M5B_CM_CLKSEL1_PLL_12_VAL      MX_48M_SRC | MX_54M_SRC | \
+                                       M5B_DPLL_DIV_12 | M5B_DPLL_MULT_12 | \
+                                       MX_APLLS_CLIKIN_12
+#define M5B_DPLL_MULT_13               (200 << 12)
+#define M5B_DPLL_DIV_13                        (12 << 8)
+
+#define M5B_CM_CLKSEL1_PLL_13_VAL      MX_48M_SRC | MX_54M_SRC | \
+                                       M5B_DPLL_DIV_13 | M5B_DPLL_MULT_13 | \
+                                       MX_APLLS_CLIKIN_13
+#define M5B_DPLL_MULT_19               (125 << 12)
+#define M5B_DPLL_DIV_19                        (31 << 8)
+#define M5B_CM_CLKSEL1_PLL_19_VAL      MX_48M_SRC | MX_54M_SRC | \
+                                       M5B_DPLL_DIV_19 | M5B_DPLL_MULT_19 | \
+                                       MX_APLLS_CLIKIN_19_2
+/*
+ * #4  (ratio2), DPLL = 399*2 = 798MHz, L3=133MHz
+ */
+#define M4_DPLL_MULT_12                        (133 << 12)
+#define M4_DPLL_DIV_12                 (3 << 8)
+#define M4_CM_CLKSEL1_PLL_12_VAL       MX_48M_SRC | MX_54M_SRC | \
+                                       M4_DPLL_DIV_12 | M4_DPLL_MULT_12 | \
+                                       MX_APLLS_CLIKIN_12
+
+#define M4_DPLL_MULT_13                        (399 << 12)
+#define M4_DPLL_DIV_13                 (12 << 8)
+#define M4_CM_CLKSEL1_PLL_13_VAL       MX_48M_SRC | MX_54M_SRC | \
+                                       M4_DPLL_DIV_13 | M4_DPLL_MULT_13 | \
+                                       MX_APLLS_CLIKIN_13
+
+#define M4_DPLL_MULT_19                        (145 << 12)
+#define M4_DPLL_DIV_19                 (6 << 8)
+#define M4_CM_CLKSEL1_PLL_19_VAL       MX_48M_SRC | MX_54M_SRC | \
+                                       M4_DPLL_DIV_19 | M4_DPLL_MULT_19 | \
+                                       MX_APLLS_CLIKIN_19_2
+
+/*
+ * #3  (ratio2) baseport-target, target DPLL = 330*2 = 660MHz
+ */
+#define M3_DPLL_MULT_12                        (55 << 12)
+#define M3_DPLL_DIV_12                 (1 << 8)
+#define M3_CM_CLKSEL1_PLL_12_VAL       MX_48M_SRC | MX_54M_SRC | \
+                                       M3_DPLL_DIV_12 | M3_DPLL_MULT_12 | \
+                                       MX_APLLS_CLIKIN_12
+#define M3_DPLL_MULT_13                        (76 << 12)
+#define M3_DPLL_DIV_13                 (2 << 8)
+#define M3_CM_CLKSEL1_PLL_13_VAL       MX_48M_SRC | MX_54M_SRC | \
+                                       M3_DPLL_DIV_13 | M3_DPLL_MULT_13 | \
+                                       MX_APLLS_CLIKIN_13
+#define M3_DPLL_MULT_19                        (17 << 12)
+#define M3_DPLL_DIV_19                 (0 << 8)
+#define M3_CM_CLKSEL1_PLL_19_VAL       MX_48M_SRC | MX_54M_SRC | \
+                                       M3_DPLL_DIV_19 | M3_DPLL_MULT_19 | \
+                                       MX_APLLS_CLIKIN_19_2
+
+/*
+ * #2   (ratio1) DPLL = 330*2 = 660MHz, L3=165MHz
+ */
+#define M2_DPLL_MULT_12                        (55 << 12)
+#define M2_DPLL_DIV_12                 (1 << 8)
+#define M2_CM_CLKSEL1_PLL_12_VAL       MX_48M_SRC | MX_54M_SRC | \
+                                       M2_DPLL_DIV_12 | M2_DPLL_MULT_12 | \
+                                       MX_APLLS_CLIKIN_12
+
+/* Speed changes - Used 658.7MHz instead of 660MHz for LP-Refresh M=76 N=2,
+ * relock time issue */
+/* Core frequency changed from 330/165 to 329/164 MHz*/
+#define M2_DPLL_MULT_13                        (76 << 12)
+#define M2_DPLL_DIV_13                 (2 << 8)
+#define M2_CM_CLKSEL1_PLL_13_VAL       MX_48M_SRC | MX_54M_SRC | \
+                                       M2_DPLL_DIV_13 | M2_DPLL_MULT_13 | \
+                                       MX_APLLS_CLIKIN_13
+
+#define M2_DPLL_MULT_19                        (17 << 12)
+#define M2_DPLL_DIV_19                 (0 << 8)
+#define M2_CM_CLKSEL1_PLL_19_VAL       MX_48M_SRC | MX_54M_SRC | \
+                                       M2_DPLL_DIV_19 | M2_DPLL_MULT_19 | \
+                                       MX_APLLS_CLIKIN_19_2
+
+/* boot (boot) */
+#define MB_DPLL_MULT                   (1 << 12)
+#define MB_DPLL_DIV                    (0 << 8)
+#define MB_CM_CLKSEL1_PLL_12_VAL       MX_48M_SRC | MX_54M_SRC | MB_DPLL_DIV |\
+                                       MB_DPLL_MULT | MX_APLLS_CLIKIN_12
+
+#define MB_CM_CLKSEL1_PLL_13_VAL       MX_48M_SRC | MX_54M_SRC | MB_DPLL_DIV |\
+                                       MB_DPLL_MULT | MX_APLLS_CLIKIN_13
+
+#define MB_CM_CLKSEL1_PLL_19_VAL       MX_48M_SRC | MX_54M_SRC | MB_DPLL_DIV |\
+                                       MB_DPLL_MULT | MX_APLLS_CLIKIN_19
+
+/*
+ * 2430 - chassis (sedna)
+ * 165 (ratio1) same as above #2
+ * 150 (ratio1)
+ * 133 (ratio2) same as above #4
+ * 110 (ratio2) same as above #3
+ * 104 (ratio2)
+ * boot (boot)
+ */
+
+/* PRCM I target DPLL = 2*330MHz = 660MHz */
+#define MI_DPLL_MULT_12                        (55 << 12)
+#define MI_DPLL_DIV_12                 (1 << 8)
+#define MI_CM_CLKSEL1_PLL_12_VAL       MX_48M_SRC | MX_54M_SRC | \
+                                       MI_DPLL_DIV_12 | MI_DPLL_MULT_12 | \
+                                       MX_APLLS_CLIKIN_12
+
+/*
+ * 2420 Equivalent - mode registers
+ * PRCM II , target DPLL = 2*300MHz = 600MHz
+ */
+#define MII_DPLL_MULT_12               (50 << 12)
+#define MII_DPLL_DIV_12                        (1 << 8)
+#define MII_CM_CLKSEL1_PLL_12_VAL      MX_48M_SRC | MX_54M_SRC | \
+                                       MII_DPLL_DIV_12 | MII_DPLL_MULT_12 | \
+                                       MX_APLLS_CLIKIN_12
+#define MII_DPLL_MULT_13               (300 << 12)
+#define MII_DPLL_DIV_13                        (12 << 8)
+#define MII_CM_CLKSEL1_PLL_13_VAL      MX_48M_SRC | MX_54M_SRC | \
+                                       MII_DPLL_DIV_13 | MII_DPLL_MULT_13 | \
+                                       MX_APLLS_CLIKIN_13
+
+/* PRCM III target DPLL = 2*266 = 532MHz*/
+#define MIII_DPLL_MULT_12              (133 << 12)
+#define MIII_DPLL_DIV_12               (5 << 8)
+#define MIII_CM_CLKSEL1_PLL_12_VAL     MX_48M_SRC | MX_54M_SRC | \
+                                       MIII_DPLL_DIV_12 | MIII_DPLL_MULT_12 | \
+                                       MX_APLLS_CLIKIN_12
+#define MIII_DPLL_MULT_13              (266 << 12)
+#define MIII_DPLL_DIV_13               (12 << 8)
+#define MIII_CM_CLKSEL1_PLL_13_VAL     MX_48M_SRC | MX_54M_SRC | \
+                                       MIII_DPLL_DIV_13 | MIII_DPLL_MULT_13 | \
+                                       MX_APLLS_CLIKIN_13
+
+/* PRCM VII (boot bypass) */
+#define MVII_CM_CLKSEL1_PLL_12_VAL     MB_CM_CLKSEL1_PLL_12_VAL
+#define MVII_CM_CLKSEL1_PLL_13_VAL     MB_CM_CLKSEL1_PLL_13_VAL
+
+/* High and low operation value */
+#define MX_CLKSEL2_PLL_2x_VAL          (2 << 0)
+#define MX_CLKSEL2_PLL_1x_VAL          (1 << 0)
+
+/* MPU speed defines */
+#define S12M   12000000
+#define S13M   13000000
+#define S19M   19200000
+#define S26M   26000000
+#define S100M  100000000
+#define S133M  133000000
+#define S150M  150000000
+#define S164M  164000000
+#define S165M  165000000
+#define S199M  199000000
+#define S200M  200000000
+#define S266M  266000000
+#define S300M  300000000
+#define S329M  329000000
+#define S330M  330000000
+#define S399M  399000000
+#define S400M  400000000
+#define S532M  532000000
+#define S600M  600000000
+#define S658M  658000000
+#define S660M  660000000
+#define S798M  798000000
+
+/*-------------------------------------------------------------------------
+ * Key dividers which make up a PRCM set. Ratio's for a PRCM are mandated.
+ * xtal_speed, dpll_speed, mpu_speed, CM_CLKSEL_MPU,
+ * CM_CLKSEL_DSP, CM_CLKSEL_GFX, CM_CLKSEL1_CORE, CM_CLKSEL1_PLL,
+ * CM_CLKSEL2_PLL, CM_CLKSEL_MDM
+ *
+ * Filling in table based on H4 boards and 2430-SDPs variants available.
+ * There are quite a few more rates combinations which could be defined.
+ *
+ * When multiple values are defined the start up will try and choose the
+ * fastest one. If a 'fast' value is defined, then automatically, the /2
+ * one should be included as it can be used.   Generally having more that
+ * one fast set does not make sense, as static timings need to be changed
+ * to change the set.   The exception is the bypass setting which is
+ * availble for low power bypass.
+ *
+ * Note: This table needs to be sorted, fastest to slowest.
+ *-------------------------------------------------------------------------*/
+static struct prcm_config rate_table[] = {
+       /* PRCM I - FAST */
+       {S12M, S660M, S330M, RI_CM_CLKSEL_MPU_VAL,              /* 330MHz ARM */
+               RI_CM_CLKSEL_DSP_VAL, RI_CM_CLKSEL_GFX_VAL,
+               RI_CM_CLKSEL1_CORE_VAL, MI_CM_CLKSEL1_PLL_12_VAL,
+               MX_CLKSEL2_PLL_2x_VAL, 0, SDRC_RFR_CTRL_165MHz,
+               RATE_IN_242X},
+
+       /* PRCM II - FAST */
+       {S12M, S600M, S300M, RII_CM_CLKSEL_MPU_VAL,             /* 300MHz ARM */
+               RII_CM_CLKSEL_DSP_VAL, RII_CM_CLKSEL_GFX_VAL,
+               RII_CM_CLKSEL1_CORE_VAL, MII_CM_CLKSEL1_PLL_12_VAL,
+               MX_CLKSEL2_PLL_2x_VAL, 0, SDRC_RFR_CTRL_100MHz,
+               RATE_IN_242X},
+
+       {S13M, S600M, S300M, RII_CM_CLKSEL_MPU_VAL,             /* 300MHz ARM */
+               RII_CM_CLKSEL_DSP_VAL, RII_CM_CLKSEL_GFX_VAL,
+               RII_CM_CLKSEL1_CORE_VAL, MII_CM_CLKSEL1_PLL_13_VAL,
+               MX_CLKSEL2_PLL_2x_VAL, 0, SDRC_RFR_CTRL_100MHz,
+               RATE_IN_242X},
+
+       /* PRCM III - FAST */
+       {S12M, S532M, S266M, RIII_CM_CLKSEL_MPU_VAL,            /* 266MHz ARM */
+               RIII_CM_CLKSEL_DSP_VAL, RIII_CM_CLKSEL_GFX_VAL,
+               RIII_CM_CLKSEL1_CORE_VAL, MIII_CM_CLKSEL1_PLL_12_VAL,
+               MX_CLKSEL2_PLL_2x_VAL, 0, SDRC_RFR_CTRL_133MHz,
+               RATE_IN_242X},
+
+       {S13M, S532M, S266M, RIII_CM_CLKSEL_MPU_VAL,            /* 266MHz ARM */
+               RIII_CM_CLKSEL_DSP_VAL, RIII_CM_CLKSEL_GFX_VAL,
+               RIII_CM_CLKSEL1_CORE_VAL, MIII_CM_CLKSEL1_PLL_13_VAL,
+               MX_CLKSEL2_PLL_2x_VAL, 0, SDRC_RFR_CTRL_133MHz,
+               RATE_IN_242X},
+
+       /* PRCM II - SLOW */
+       {S12M, S300M, S150M, RII_CM_CLKSEL_MPU_VAL,             /* 150MHz ARM */
+               RII_CM_CLKSEL_DSP_VAL, RII_CM_CLKSEL_GFX_VAL,
+               RII_CM_CLKSEL1_CORE_VAL, MII_CM_CLKSEL1_PLL_12_VAL,
+               MX_CLKSEL2_PLL_2x_VAL, 0, SDRC_RFR_CTRL_100MHz,
+               RATE_IN_242X},
+
+       {S13M, S300M, S150M, RII_CM_CLKSEL_MPU_VAL,             /* 150MHz ARM */
+               RII_CM_CLKSEL_DSP_VAL, RII_CM_CLKSEL_GFX_VAL,
+               RII_CM_CLKSEL1_CORE_VAL, MII_CM_CLKSEL1_PLL_13_VAL,
+               MX_CLKSEL2_PLL_2x_VAL, 0, SDRC_RFR_CTRL_100MHz,
+               RATE_IN_242X},
+
+       /* PRCM III - SLOW */
+       {S12M, S266M, S133M, RIII_CM_CLKSEL_MPU_VAL,            /* 133MHz ARM */
+               RIII_CM_CLKSEL_DSP_VAL, RIII_CM_CLKSEL_GFX_VAL,
+               RIII_CM_CLKSEL1_CORE_VAL, MIII_CM_CLKSEL1_PLL_12_VAL,
+               MX_CLKSEL2_PLL_2x_VAL, 0, SDRC_RFR_CTRL_133MHz,
+               RATE_IN_242X},
+
+       {S13M, S266M, S133M, RIII_CM_CLKSEL_MPU_VAL,            /* 133MHz ARM */
+               RIII_CM_CLKSEL_DSP_VAL, RIII_CM_CLKSEL_GFX_VAL,
+               RIII_CM_CLKSEL1_CORE_VAL, MIII_CM_CLKSEL1_PLL_13_VAL,
+               MX_CLKSEL2_PLL_2x_VAL, 0, SDRC_RFR_CTRL_133MHz,
+               RATE_IN_242X},
+
+       /* PRCM-VII (boot-bypass) */
+       {S12M, S12M, S12M, RVII_CM_CLKSEL_MPU_VAL,              /* 12MHz ARM*/
+               RVII_CM_CLKSEL_DSP_VAL, RVII_CM_CLKSEL_GFX_VAL,
+               RVII_CM_CLKSEL1_CORE_VAL, MVII_CM_CLKSEL1_PLL_12_VAL,
+               MX_CLKSEL2_PLL_2x_VAL, 0, SDRC_RFR_CTRL_BYPASS,
+               RATE_IN_242X},
+
+       /* PRCM-VII (boot-bypass) */
+       {S13M, S13M, S13M, RVII_CM_CLKSEL_MPU_VAL,              /* 13MHz ARM */
+               RVII_CM_CLKSEL_DSP_VAL, RVII_CM_CLKSEL_GFX_VAL,
+               RVII_CM_CLKSEL1_CORE_VAL, MVII_CM_CLKSEL1_PLL_13_VAL,
+               MX_CLKSEL2_PLL_2x_VAL, 0, SDRC_RFR_CTRL_BYPASS,
+               RATE_IN_242X},
+
+       /* PRCM #4 - ratio2 (ES2.1) - FAST */
+       {S13M, S798M, S399M, R2_CM_CLKSEL_MPU_VAL,              /* 399MHz ARM */
+               R2_CM_CLKSEL_DSP_VAL, R2_CM_CLKSEL_GFX_VAL,
+               R2_CM_CLKSEL1_CORE_VAL, M4_CM_CLKSEL1_PLL_13_VAL,
+               MX_CLKSEL2_PLL_2x_VAL, R2_CM_CLKSEL_MDM_VAL,
+               SDRC_RFR_CTRL_133MHz,
+               RATE_IN_243X},
+
+       /* PRCM #2 - ratio1 (ES2) - FAST */
+       {S13M, S658M, S329M, R1_CM_CLKSEL_MPU_VAL,              /* 330MHz ARM */
+               R1_CM_CLKSEL_DSP_VAL, R1_CM_CLKSEL_GFX_VAL,
+               R1_CM_CLKSEL1_CORE_VAL, M2_CM_CLKSEL1_PLL_13_VAL,
+               MX_CLKSEL2_PLL_2x_VAL, R1_CM_CLKSEL_MDM_VAL,
+               SDRC_RFR_CTRL_165MHz,
+               RATE_IN_243X},
+
+       /* PRCM #5a - ratio1 - FAST */
+       {S13M, S532M, S266M, R1_CM_CLKSEL_MPU_VAL,              /* 266MHz ARM */
+               R1_CM_CLKSEL_DSP_VAL, R1_CM_CLKSEL_GFX_VAL,
+               R1_CM_CLKSEL1_CORE_VAL, M5A_CM_CLKSEL1_PLL_13_VAL,
+               MX_CLKSEL2_PLL_2x_VAL, R1_CM_CLKSEL_MDM_VAL,
+               SDRC_RFR_CTRL_133MHz,
+               RATE_IN_243X},
+
+       /* PRCM #5b - ratio1 - FAST */
+       {S13M, S400M, S200M, R1_CM_CLKSEL_MPU_VAL,              /* 200MHz ARM */
+               R1_CM_CLKSEL_DSP_VAL, R1_CM_CLKSEL_GFX_VAL,
+               R1_CM_CLKSEL1_CORE_VAL, M5B_CM_CLKSEL1_PLL_13_VAL,
+               MX_CLKSEL2_PLL_2x_VAL, R1_CM_CLKSEL_MDM_VAL,
+               SDRC_RFR_CTRL_100MHz,
+               RATE_IN_243X},
+
+       /* PRCM #4 - ratio1 (ES2.1) - SLOW */
+       {S13M, S399M, S199M, R2_CM_CLKSEL_MPU_VAL,              /* 200MHz ARM */
+               R2_CM_CLKSEL_DSP_VAL, R2_CM_CLKSEL_GFX_VAL,
+               R2_CM_CLKSEL1_CORE_VAL, M4_CM_CLKSEL1_PLL_13_VAL,
+               MX_CLKSEL2_PLL_1x_VAL, R2_CM_CLKSEL_MDM_VAL,
+               SDRC_RFR_CTRL_133MHz,
+               RATE_IN_243X},
+
+       /* PRCM #2 - ratio1 (ES2) - SLOW */
+       {S13M, S329M, S164M, R1_CM_CLKSEL_MPU_VAL,              /* 165MHz ARM */
+               R1_CM_CLKSEL_DSP_VAL, R1_CM_CLKSEL_GFX_VAL,
+               R1_CM_CLKSEL1_CORE_VAL, M2_CM_CLKSEL1_PLL_13_VAL,
+               MX_CLKSEL2_PLL_1x_VAL, R1_CM_CLKSEL_MDM_VAL,
+               SDRC_RFR_CTRL_165MHz,
+               RATE_IN_243X},
+
+       /* PRCM #5a - ratio1 - SLOW */
+       {S13M, S266M, S133M, R1_CM_CLKSEL_MPU_VAL,              /* 133MHz ARM */
+               R1_CM_CLKSEL_DSP_VAL, R1_CM_CLKSEL_GFX_VAL,
+               R1_CM_CLKSEL1_CORE_VAL, M5A_CM_CLKSEL1_PLL_13_VAL,
+               MX_CLKSEL2_PLL_1x_VAL, R1_CM_CLKSEL_MDM_VAL,
+               SDRC_RFR_CTRL_133MHz,
+               RATE_IN_243X},
+
+       /* PRCM #5b - ratio1 - SLOW*/
+       {S13M, S200M, S100M, R1_CM_CLKSEL_MPU_VAL,              /* 100MHz ARM */
+               R1_CM_CLKSEL_DSP_VAL, R1_CM_CLKSEL_GFX_VAL,
+               R1_CM_CLKSEL1_CORE_VAL, M5B_CM_CLKSEL1_PLL_13_VAL,
+               MX_CLKSEL2_PLL_1x_VAL, R1_CM_CLKSEL_MDM_VAL,
+               SDRC_RFR_CTRL_100MHz,
+               RATE_IN_243X},
+
+       /* PRCM-boot/bypass */
+       {S13M, S13M, S13M, RB_CM_CLKSEL_MPU_VAL,                /* 13Mhz */
+               RB_CM_CLKSEL_DSP_VAL, RB_CM_CLKSEL_GFX_VAL,
+               RB_CM_CLKSEL1_CORE_VAL, MB_CM_CLKSEL1_PLL_13_VAL,
+               MX_CLKSEL2_PLL_2x_VAL, RB_CM_CLKSEL_MDM_VAL,
+               SDRC_RFR_CTRL_BYPASS,
+               RATE_IN_243X},
+
+       /* PRCM-boot/bypass */
+       {S12M, S12M, S12M, RB_CM_CLKSEL_MPU_VAL,                /* 12Mhz */
+               RB_CM_CLKSEL_DSP_VAL, RB_CM_CLKSEL_GFX_VAL,
+               RB_CM_CLKSEL1_CORE_VAL, MB_CM_CLKSEL1_PLL_12_VAL,
+               MX_CLKSEL2_PLL_2x_VAL, RB_CM_CLKSEL_MDM_VAL,
+               SDRC_RFR_CTRL_BYPASS,
+               RATE_IN_243X},
+
+       { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
+};
+
+/*-------------------------------------------------------------------------
+ * 24xx clock tree.
+ *
+ * NOTE:In many cases here we are assigning a 'default' parent.        In many
+ *     cases the parent is selectable. The get/set parent calls will also
+ *     switch sources.
+ *
+ *     Many some clocks say always_enabled, but they can be auto idled for
+ *     power savings. They will always be available upon clock request.
+ *
+ *     Several sources are given initial rates which may be wrong, this will
+ *     be fixed up in the init func.
+ *
+ *     Things are broadly separated below by clock domains. It is
+ *     noteworthy that most periferals have dependencies on multiple clock
+ *     domains. Many get their interface clocks from the L4 domain, but get
+ *     functional clocks from fixed sources or other core domain derived
+ *     clocks.
+ *-------------------------------------------------------------------------*/
+
+/* Base external input clocks */
+static struct clk func_32k_ck = {
+       .name           = "func_32k_ck",
+       .rate           = 32000,
+       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
+                               RATE_FIXED | ALWAYS_ENABLED | RATE_PROPAGATES,
+       .recalc         = &propagate_rate,
+};
+
+/* Typical 12/13MHz in standalone mode, will be 26Mhz in chassis mode */
+static struct clk osc_ck = {           /* (*12, *13, 19.2, *26, 38.4)MHz */
+       .name           = "osc_ck",
+       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
+                               RATE_PROPAGATES,
+       .enable         = &omap2_enable_osc_ck,
+       .disable        = &omap2_disable_osc_ck,
+       .recalc         = &omap2_osc_clk_recalc,
+};
+
+/* With out modem likely 12MHz, with modem likely 13MHz */
+static struct clk sys_ck = {           /* (*12, *13, 19.2, 26, 38.4)MHz */
+       .name           = "sys_ck",             /* ~ ref_clk also */
+       .parent         = &osc_ck,
+       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
+                               ALWAYS_ENABLED | RATE_PROPAGATES,
+       .recalc         = &omap2_sys_clk_recalc,
+};
+
+static struct clk alt_ck = {           /* Typical 54M or 48M, may not exist */
+       .name           = "alt_ck",
+       .rate           = 54000000,
+       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
+                               RATE_FIXED | ALWAYS_ENABLED | RATE_PROPAGATES,
+       .recalc         = &propagate_rate,
+};
+
+/*
+ * Analog domain root source clocks
+ */
+
+/* dpll_ck, is broken out in to special cases through clksel */
+/* REVISIT: Rate changes on dpll_ck trigger a full set change. ...
+ * deal with this
+ */
+
+static const struct dpll_data dpll_dd = {
+       .mult_div1_reg          = OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1),
+       .mult_mask              = OMAP24XX_DPLL_MULT_MASK,
+       .div1_mask              = OMAP24XX_DPLL_DIV_MASK,
+};
+
+static struct clk dpll_ck = {
+       .name           = "dpll_ck",
+       .parent         = &sys_ck,              /* Can be func_32k also */
+       .dpll_data      = &dpll_dd,
+       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
+                               RATE_PROPAGATES | ALWAYS_ENABLED,
+       .recalc         = &omap2_dpll_recalc,
+       .set_rate       = &omap2_reprogram_dpll,
+};
+
+static struct clk apll96_ck = {
+       .name           = "apll96_ck",
+       .parent         = &sys_ck,
+       .rate           = 96000000,
+       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
+                               RATE_FIXED | RATE_PROPAGATES | ENABLE_ON_INIT,
+       .enable_reg     = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN),
+       .enable_bit     = OMAP24XX_EN_96M_PLL_SHIFT,
+       .enable         = &omap2_clk_fixed_enable,
+       .disable        = &omap2_clk_fixed_disable,
+       .recalc         = &propagate_rate,
+};
+
+static struct clk apll54_ck = {
+       .name           = "apll54_ck",
+       .parent         = &sys_ck,
+       .rate           = 54000000,
+       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
+                               RATE_FIXED | RATE_PROPAGATES | ENABLE_ON_INIT,
+       .enable_reg     = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN),
+       .enable_bit     = OMAP24XX_EN_54M_PLL_SHIFT,
+       .enable         = &omap2_clk_fixed_enable,
+       .disable        = &omap2_clk_fixed_disable,
+       .recalc         = &propagate_rate,
+};
+
+/*
+ * PRCM digital base sources
+ */
+
+/* func_54m_ck */
+
+static const struct clksel_rate func_54m_apll54_rates[] = {
+       { .div = 1, .val = 0, .flags = RATE_IN_24XX | DEFAULT_RATE },
+       { .div = 0 },
+};
+
+static const struct clksel_rate func_54m_alt_rates[] = {
+       { .div = 1, .val = 1, .flags = RATE_IN_24XX | DEFAULT_RATE },
+       { .div = 0 },
+};
+
+static const struct clksel func_54m_clksel[] = {
+       { .parent = &apll54_ck, .rates = func_54m_apll54_rates, },
+       { .parent = &alt_ck,    .rates = func_54m_alt_rates, },
+       { .parent = NULL },
+};
+
+static struct clk func_54m_ck = {
+       .name           = "func_54m_ck",
+       .parent         = &apll54_ck,   /* can also be alt_clk */
+       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
+                               RATE_PROPAGATES | PARENT_CONTROLS_CLOCK,
+       .init           = &omap2_init_clksel_parent,
+       .clksel_reg     = OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1),
+       .clksel_mask    = OMAP24XX_54M_SOURCE,
+       .clksel         = func_54m_clksel,
+       .recalc         = &omap2_clksel_recalc,
+};
+
+static struct clk core_ck = {
+       .name           = "core_ck",
+       .parent         = &dpll_ck,             /* can also be 32k */
+       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
+                               ALWAYS_ENABLED | RATE_PROPAGATES,
+       .recalc         = &followparent_recalc,
+};
+
+/* func_96m_ck */
+static const struct clksel_rate func_96m_apll96_rates[] = {
+       { .div = 1, .val = 0, .flags = RATE_IN_24XX | DEFAULT_RATE },
+       { .div = 0 },
+};
+
+static const struct clksel_rate func_96m_alt_rates[] = {
+       { .div = 1, .val = 1, .flags = RATE_IN_243X | DEFAULT_RATE },
+       { .div = 0 },
+};
+
+static const struct clksel func_96m_clksel[] = {
+       { .parent = &apll96_ck, .rates = func_96m_apll96_rates },
+       { .parent = &alt_ck,    .rates = func_96m_alt_rates },
+       { .parent = NULL }
+};
+
+/* The parent of this clock is not selectable on 2420. */
+static struct clk func_96m_ck = {
+       .name           = "func_96m_ck",
+       .parent         = &apll96_ck,
+       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
+                               RATE_PROPAGATES | PARENT_CONTROLS_CLOCK,
+       .init           = &omap2_init_clksel_parent,
+       .clksel_reg     = OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1),
+       .clksel_mask    = OMAP2430_96M_SOURCE,
+       .clksel         = func_96m_clksel,
+       .recalc         = &omap2_clksel_recalc,
+       .round_rate     = &omap2_clksel_round_rate,
+       .set_rate       = &omap2_clksel_set_rate
+};
+
+/* func_48m_ck */
+
+static const struct clksel_rate func_48m_apll96_rates[] = {
+       { .div = 2, .val = 0, .flags = RATE_IN_24XX | DEFAULT_RATE },
+       { .div = 0 },
+};
+
+static const struct clksel_rate func_48m_alt_rates[] = {
+       { .div = 1, .val = 1, .flags = RATE_IN_24XX | DEFAULT_RATE },
+       { .div = 0 },
+};
+
+static const struct clksel func_48m_clksel[] = {
+       { .parent = &apll96_ck, .rates = func_48m_apll96_rates },
+       { .parent = &alt_ck, .rates = func_48m_alt_rates },
+       { .parent = NULL }
+};
+
+static struct clk func_48m_ck = {
+       .name           = "func_48m_ck",
+       .parent         = &apll96_ck,    /* 96M or Alt */
+       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
+                               RATE_PROPAGATES | PARENT_CONTROLS_CLOCK,
+       .init           = &omap2_init_clksel_parent,
+       .clksel_reg     = OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1),
+       .clksel_mask    = OMAP24XX_48M_SOURCE,
+       .clksel         = func_48m_clksel,
+       .recalc         = &omap2_clksel_recalc,
+       .round_rate     = &omap2_clksel_round_rate,
+       .set_rate       = &omap2_clksel_set_rate
+};
+
+static struct clk func_12m_ck = {
+       .name           = "func_12m_ck",
+       .parent         = &func_48m_ck,
+       .fixed_div      = 4,
+       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
+                               RATE_PROPAGATES | PARENT_CONTROLS_CLOCK,
+       .recalc         = &omap2_fixed_divisor_recalc,
+};
+
+/* Secure timer, only available in secure mode */
+static struct clk wdt1_osc_ck = {
+       .name           = "ck_wdt1_osc",
+       .parent         = &osc_ck,
+       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
+       .recalc         = &followparent_recalc,
+};
+
+/*
+ * The common_clkout* clksel_rate structs are common to
+ * sys_clkout, sys_clkout_src, sys_clkout2, and sys_clkout2_src.
+ * sys_clkout2_* are 2420-only, so the
+ * clksel_rate flags fields are inaccurate for those clocks. This is
+ * harmless since access to those clocks are gated by the struct clk
+ * flags fields, which mark them as 2420-only.
+ */
+static const struct clksel_rate common_clkout_src_core_rates[] = {
+       { .div = 1, .val = 0, .flags = RATE_IN_24XX | DEFAULT_RATE },
+       { .div = 0 }
+};
+
+static const struct clksel_rate common_clkout_src_sys_rates[] = {
+       { .div = 1, .val = 1, .flags = RATE_IN_24XX | DEFAULT_RATE },
+       { .div = 0 }
+};
+
+static const struct clksel_rate common_clkout_src_96m_rates[] = {
+       { .div = 1, .val = 2, .flags = RATE_IN_24XX | DEFAULT_RATE },
+       { .div = 0 }
+};
+
+static const struct clksel_rate common_clkout_src_54m_rates[] = {
+       { .div = 1, .val = 3, .flags = RATE_IN_24XX | DEFAULT_RATE },
+       { .div = 0 }
+};
+
+static const struct clksel common_clkout_src_clksel[] = {
+       { .parent = &core_ck,     .rates = common_clkout_src_core_rates },
+       { .parent = &sys_ck,      .rates = common_clkout_src_sys_rates },
+       { .parent = &func_96m_ck, .rates = common_clkout_src_96m_rates },
+       { .parent = &func_54m_ck, .rates = common_clkout_src_54m_rates },
+       { .parent = NULL }
+};
+
+static struct clk sys_clkout_src = {
+       .name           = "sys_clkout_src",
+       .parent         = &func_54m_ck,
+       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
+                               RATE_PROPAGATES,
+       .enable_reg     = OMAP24XX_PRCM_CLKOUT_CTRL,
+       .enable_bit     = OMAP24XX_CLKOUT_EN_SHIFT,
+       .init           = &omap2_init_clksel_parent,
+       .clksel_reg     = OMAP24XX_PRCM_CLKOUT_CTRL,
+       .clksel_mask    = OMAP24XX_CLKOUT_SOURCE_MASK,
+       .clksel         = common_clkout_src_clksel,
+       .recalc         = &omap2_clksel_recalc,
+       .round_rate     = &omap2_clksel_round_rate,
+       .set_rate       = &omap2_clksel_set_rate
+};
+
+static const struct clksel_rate common_clkout_rates[] = {
+       { .div = 1, .val = 0, .flags = RATE_IN_24XX | DEFAULT_RATE },
+       { .div = 2, .val = 1, .flags = RATE_IN_24XX },
+       { .div = 4, .val = 2, .flags = RATE_IN_24XX },
+       { .div = 8, .val = 3, .flags = RATE_IN_24XX },
+       { .div = 16, .val = 4, .flags = RATE_IN_24XX },
+       { .div = 0 },
+};
+
+static const struct clksel sys_clkout_clksel[] = {
+       { .parent = &sys_clkout_src, .rates = common_clkout_rates },
+       { .parent = NULL }
+};
+
+static struct clk sys_clkout = {
+       .name           = "sys_clkout",
+       .parent         = &sys_clkout_src,
+       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
+                               PARENT_CONTROLS_CLOCK,
+       .clksel_reg     = OMAP24XX_PRCM_CLKOUT_CTRL,
+       .clksel_mask    = OMAP24XX_CLKOUT_DIV_MASK,
+       .clksel         = sys_clkout_clksel,
+       .recalc         = &omap2_clksel_recalc,
+       .round_rate     = &omap2_clksel_round_rate,
+       .set_rate       = &omap2_clksel_set_rate
+};
+
+/* In 2430, new in 2420 ES2 */
+static struct clk sys_clkout2_src = {
+       .name           = "sys_clkout2_src",
+       .parent         = &func_54m_ck,
+       .flags          = CLOCK_IN_OMAP242X | RATE_PROPAGATES,
+       .enable_reg     = OMAP24XX_PRCM_CLKOUT_CTRL,
+       .enable_bit     = OMAP2420_CLKOUT2_EN_SHIFT,
+       .init           = &omap2_init_clksel_parent,
+       .clksel_reg     = OMAP24XX_PRCM_CLKOUT_CTRL,
+       .clksel_mask    = OMAP2420_CLKOUT2_SOURCE_MASK,
+       .clksel         = common_clkout_src_clksel,
+       .recalc         = &omap2_clksel_recalc,
+       .round_rate     = &omap2_clksel_round_rate,
+       .set_rate       = &omap2_clksel_set_rate
+};
+
+static const struct clksel sys_clkout2_clksel[] = {
+       { .parent = &sys_clkout2_src, .rates = common_clkout_rates },
+       { .parent = NULL }
+};
+
+/* In 2430, new in 2420 ES2 */
+static struct clk sys_clkout2 = {
+       .name           = "sys_clkout2",
+       .parent         = &sys_clkout2_src,
+       .flags          = CLOCK_IN_OMAP242X | PARENT_CONTROLS_CLOCK,
+       .clksel_reg     = OMAP24XX_PRCM_CLKOUT_CTRL,
+       .clksel_mask    = OMAP2420_CLKOUT2_DIV_MASK,
+       .clksel         = sys_clkout2_clksel,
+       .recalc         = &omap2_clksel_recalc,
+       .round_rate     = &omap2_clksel_round_rate,
+       .set_rate       = &omap2_clksel_set_rate
+};
+
+static struct clk emul_ck = {
+       .name           = "emul_ck",
+       .parent         = &func_54m_ck,
+       .flags          = CLOCK_IN_OMAP242X,
+       .enable_reg     = OMAP24XX_PRCM_CLKEMUL_CTRL,
+       .enable_bit     = OMAP24XX_EMULATION_EN_SHIFT,
+       .recalc         = &followparent_recalc,
+
+};
+
+/*
+ * MPU clock domain
+ *     Clocks:
+ *             MPU_FCLK, MPU_ICLK
+ *             INT_M_FCLK, INT_M_I_CLK
+ *
+ * - Individual clocks are hardware managed.
+ * - Base divider comes from: CM_CLKSEL_MPU
+ *
+ */
+static const struct clksel_rate mpu_core_rates[] = {
+       { .div = 1, .val = 1, .flags = RATE_IN_24XX | DEFAULT_RATE },
+       { .div = 2, .val = 2, .flags = RATE_IN_24XX },
+       { .div = 4, .val = 4, .flags = RATE_IN_242X },
+       { .div = 6, .val = 6, .flags = RATE_IN_242X },
+       { .div = 8, .val = 8, .flags = RATE_IN_242X },
+       { .div = 0 },
+};
+
+static const struct clksel mpu_clksel[] = {
+       { .parent = &core_ck, .rates = mpu_core_rates },
+       { .parent = NULL }
+};
+
+static struct clk mpu_ck = {   /* Control cpu */
+       .name           = "mpu_ck",
+       .parent         = &core_ck,
+       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
+                               ALWAYS_ENABLED | DELAYED_APP |
+                               CONFIG_PARTICIPANT | RATE_PROPAGATES,
+       .init           = &omap2_init_clksel_parent,
+       .clksel_reg     = OMAP_CM_REGADDR(MPU_MOD, CM_CLKSEL),
+       .clksel_mask    = OMAP24XX_CLKSEL_MPU_MASK,
+       .clksel         = mpu_clksel,
+       .recalc         = &omap2_clksel_recalc,
+       .round_rate     = &omap2_clksel_round_rate,
+       .set_rate       = &omap2_clksel_set_rate
+};
+
+/*
+ * DSP (2430-IVA2.1) (2420-UMA+IVA1) clock domain
+ * Clocks:
+ *     2430: IVA2.1_FCLK (really just DSP_FCLK), IVA2.1_ICLK
+ *     2420: UMA_FCLK, UMA_ICLK, IVA_MPU, IVA_COP
+ *
+ * Won't be too specific here. The core clock comes into this block
+ * it is divided then tee'ed. One branch goes directly to xyz enable
+ * controls. The other branch gets further divided by 2 then possibly
+ * routed into a synchronizer and out of clocks abc.
+ */
+static const struct clksel_rate dsp_fck_core_rates[] = {
+       { .div = 1, .val = 1, .flags = RATE_IN_24XX | DEFAULT_RATE },
+       { .div = 2, .val = 2, .flags = RATE_IN_24XX },
+       { .div = 3, .val = 3, .flags = RATE_IN_24XX },
+       { .div = 4, .val = 4, .flags = RATE_IN_24XX },
+       { .div = 6, .val = 6, .flags = RATE_IN_242X },
+       { .div = 8, .val = 8, .flags = RATE_IN_242X },
+       { .div = 12, .val = 12, .flags = RATE_IN_242X },
+       { .div = 0 },
+};
+
+static const struct clksel dsp_fck_clksel[] = {
+       { .parent = &core_ck, .rates = dsp_fck_core_rates },
+       { .parent = NULL }
+};
+
+static struct clk dsp_fck = {
+       .name           = "dsp_fck",
+       .parent         = &core_ck,
+       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | DELAYED_APP |
+                               CONFIG_PARTICIPANT | RATE_PROPAGATES,
+       .enable_reg     = OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_FCLKEN),
+       .enable_bit     = OMAP24XX_CM_FCLKEN_DSP_EN_DSP_SHIFT,
+       .clksel_reg     = OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_CLKSEL),
+       .clksel_mask    = OMAP24XX_CLKSEL_DSP_MASK,
+       .clksel         = dsp_fck_clksel,
+       .recalc         = &omap2_clksel_recalc,
+       .round_rate     = &omap2_clksel_round_rate,
+       .set_rate       = &omap2_clksel_set_rate
+};
+
+/* DSP interface clock */
+static const struct clksel_rate dsp_irate_ick_rates[] = {
+       { .div = 1, .val = 1, .flags = RATE_IN_24XX | DEFAULT_RATE },
+       { .div = 2, .val = 2, .flags = RATE_IN_24XX },
+       { .div = 3, .val = 3, .flags = RATE_IN_243X },
+       { .div = 0 },
+};
+
+static const struct clksel dsp_irate_ick_clksel[] = {
+       { .parent = &dsp_fck, .rates = dsp_irate_ick_rates },
+       { .parent = NULL }
+};
+
+/*
+ * This clock does not exist as such in the TRM, but is added to
+ * separate source selection from  XXX
+ */
+static struct clk dsp_irate_ick = {
+       .name           = "dsp_irate_ick",
+       .parent         = &dsp_fck,
+       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | DELAYED_APP |
+                               CONFIG_PARTICIPANT | PARENT_CONTROLS_CLOCK,
+       .clksel_reg     = OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_CLKSEL),
+       .clksel_mask    = OMAP24XX_CLKSEL_DSP_IF_MASK,
+       .clksel         = dsp_irate_ick_clksel,
+       .recalc         = &omap2_clksel_recalc,
+       .round_rate     = &omap2_clksel_round_rate,
+       .set_rate             = &omap2_clksel_set_rate
+};
+
+/* 2420 only */
+static struct clk dsp_ick = {
+       .name           = "dsp_ick",     /* apparently ipi and isp */
+       .parent         = &dsp_irate_ick,
+       .flags          = CLOCK_IN_OMAP242X | DELAYED_APP | CONFIG_PARTICIPANT,
+       .enable_reg     = OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_ICLKEN),
+       .enable_bit     = OMAP2420_EN_DSP_IPI_SHIFT,          /* for ipi */
+};
+
+/* 2430 only - EN_DSP controls both dsp fclk and iclk on 2430 */
+static struct clk iva2_1_ick = {
+       .name           = "iva2_1_ick",
+       .parent         = &dsp_irate_ick,
+       .flags          = CLOCK_IN_OMAP243X | DELAYED_APP | CONFIG_PARTICIPANT,
+       .enable_reg     = OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_FCLKEN),
+       .enable_bit     = OMAP24XX_CM_FCLKEN_DSP_EN_DSP_SHIFT,
+};
+
+static struct clk iva1_ifck = {
+       .name           = "iva1_ifck",
+       .parent         = &core_ck,
+       .flags          = CLOCK_IN_OMAP242X | CONFIG_PARTICIPANT |
+                               RATE_PROPAGATES | DELAYED_APP,
+       .enable_reg     = OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_FCLKEN),
+       .enable_bit     = OMAP2420_EN_IVA_COP_SHIFT,
+       .clksel_reg     = OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_CLKSEL),
+       .clksel_mask    = OMAP2420_CLKSEL_IVA_MASK,
+       .clksel         = dsp_fck_clksel,
+       .recalc         = &omap2_clksel_recalc,
+       .round_rate     = &omap2_clksel_round_rate,
+       .set_rate       = &omap2_clksel_set_rate
+};
+
+/* IVA1 mpu/int/i/f clocks are /2 of parent */
+static struct clk iva1_mpu_int_ifck = {
+       .name           = "iva1_mpu_int_ifck",
+       .parent         = &iva1_ifck,
+       .flags          = CLOCK_IN_OMAP242X,
+       .enable_reg     = OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_FCLKEN),
+       .enable_bit     = OMAP2420_EN_IVA_MPU_SHIFT,
+       .fixed_div      = 2,
+       .recalc         = &omap2_fixed_divisor_recalc,
+};
+
+/*
+ * L3 clock domain
+ * L3 clocks are used for both interface and functional clocks to
+ * multiple entities. Some of these clocks are completely managed
+ * by hardware, and some others allow software control. Hardware
+ * managed ones general are based on directly CLK_REQ signals and
+ * various auto idle settings. The functional spec sets many of these
+ * as 'tie-high' for their enables.
+ *
+ * I-CLOCKS:
+ *     L3-Interconnect, SMS, GPMC, SDRC, OCM_RAM, OCM_ROM, SDMA
+ *     CAM, HS-USB.
+ * F-CLOCK
+ *     SSI.
+ *
+ * GPMC memories and SDRC have timing and clock sensitive registers which
+ * may very well need notification when the clock changes. Currently for low
+ * operating points, these are taken care of in sleep.S.
+ */
+static const struct clksel_rate core_l3_core_rates[] = {
+       { .div = 1, .val = 1, .flags = RATE_IN_24XX },
+       { .div = 2, .val = 2, .flags = RATE_IN_242X },
+       { .div = 4, .val = 4, .flags = RATE_IN_24XX | DEFAULT_RATE },
+       { .div = 6, .val = 6, .flags = RATE_IN_24XX },
+       { .div = 8, .val = 8, .flags = RATE_IN_242X },
+       { .div = 12, .val = 12, .flags = RATE_IN_242X },
+       { .div = 16, .val = 16, .flags = RATE_IN_242X },
+       { .div = 0 }
+};
+
+static const struct clksel core_l3_clksel[] = {
+       { .parent = &core_ck, .rates = core_l3_core_rates },
+       { .parent = NULL }
+};
+
+static struct clk core_l3_ck = {       /* Used for ick and fck, interconnect */
+       .name           = "core_l3_ck",
+       .parent         = &core_ck,
+       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
+                               ALWAYS_ENABLED | DELAYED_APP |
+                               CONFIG_PARTICIPANT | RATE_PROPAGATES,
+       .clksel_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL1),
+       .clksel_mask    = OMAP24XX_CLKSEL_L3_MASK,
+       .clksel         = core_l3_clksel,
+       .recalc         = &omap2_clksel_recalc,
+       .round_rate     = &omap2_clksel_round_rate,
+       .set_rate       = &omap2_clksel_set_rate
+};
+
+/* usb_l4_ick */
+static const struct clksel_rate usb_l4_ick_core_l3_rates[] = {
+       { .div = 1, .val = 1, .flags = RATE_IN_24XX },
+       { .div = 2, .val = 2, .flags = RATE_IN_24XX | DEFAULT_RATE },
+       { .div = 4, .val = 4, .flags = RATE_IN_24XX },
+       { .div = 0 }
+};
+
+static const struct clksel usb_l4_ick_clksel[] = {
+       { .parent = &core_l3_ck, .rates = usb_l4_ick_core_l3_rates },
+       { .parent = NULL },
+};
+
+static struct clk usb_l4_ick = {       /* FS-USB interface clock */
+       .name           = "usb_l4_ick",
+       .parent         = &core_l3_ck,
+       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
+                               DELAYED_APP | CONFIG_PARTICIPANT,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
+       .enable_bit     = OMAP24XX_EN_USB_SHIFT,
+       .clksel_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL1),
+       .clksel_mask    = OMAP24XX_CLKSEL_USB_MASK,
+       .clksel         = usb_l4_ick_clksel,
+       .recalc         = &omap2_clksel_recalc,
+       .round_rate     = &omap2_clksel_round_rate,
+       .set_rate       = &omap2_clksel_set_rate
+};
+
+/*
+ * SSI is in L3 management domain, its direct parent is core not l3,
+ * many core power domain entities are grouped into the L3 clock
+ * domain.
+ * SSI_SSR_FCLK, SSI_SST_FCLK, SSI_L4_CLIK
+ *
+ * ssr = core/1/2/3/4/5, sst = 1/2 ssr.
+ */
+static const struct clksel_rate ssi_ssr_sst_fck_core_rates[] = {
+       { .div = 1, .val = 1, .flags = RATE_IN_24XX },
+       { .div = 2, .val = 2, .flags = RATE_IN_24XX | DEFAULT_RATE },
+       { .div = 3, .val = 3, .flags = RATE_IN_24XX },
+       { .div = 4, .val = 4, .flags = RATE_IN_24XX },
+       { .div = 5, .val = 5, .flags = RATE_IN_243X },
+       { .div = 6, .val = 6, .flags = RATE_IN_242X },
+       { .div = 8, .val = 8, .flags = RATE_IN_242X },
+       { .div = 0 }
+};
+
+static const struct clksel ssi_ssr_sst_fck_clksel[] = {
+       { .parent = &core_ck, .rates = ssi_ssr_sst_fck_core_rates },
+       { .parent = NULL }
+};
+
+static struct clk ssi_ssr_sst_fck = {
+       .name           = "ssi_fck",
+       .parent         = &core_ck,
+       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
+                               DELAYED_APP,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
+       .enable_bit     = OMAP24XX_EN_SSI_SHIFT,
+       .clksel_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL1),
+       .clksel_mask    = OMAP24XX_CLKSEL_SSI_MASK,
+       .clksel         = ssi_ssr_sst_fck_clksel,
+       .recalc         = &omap2_clksel_recalc,
+       .round_rate     = &omap2_clksel_round_rate,
+       .set_rate       = &omap2_clksel_set_rate
+};
+
+/*
+ * GFX clock domain
+ *     Clocks:
+ * GFX_FCLK, GFX_ICLK
+ * GFX_CG1(2d), GFX_CG2(3d)
+ *
+ * GFX_FCLK runs from L3, and is divided by (1,2,3,4)
+ * The 2d and 3d clocks run at a hardware determined
+ * divided value of fclk.
+ *
+ */
+/* XXX REVISIT: GFX clock is part of CONFIG_PARTICIPANT, no? doublecheck. */
+
+/* This clksel struct is shared between gfx_3d_fck and gfx_2d_fck */
+static const struct clksel gfx_fck_clksel[] = {
+       { .parent = &core_l3_ck, .rates = gfx_l3_rates },
+       { .parent = NULL },
+};
+
+static struct clk gfx_3d_fck = {
+       .name           = "gfx_3d_fck",
+       .parent         = &core_l3_ck,
+       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
+       .enable_reg     = OMAP_CM_REGADDR(GFX_MOD, CM_FCLKEN),
+       .enable_bit     = OMAP24XX_EN_3D_SHIFT,
+       .clksel_reg     = OMAP_CM_REGADDR(GFX_MOD, CM_CLKSEL),
+       .clksel_mask    = OMAP_CLKSEL_GFX_MASK,
+       .clksel         = gfx_fck_clksel,
+       .recalc         = &omap2_clksel_recalc,
+       .round_rate     = &omap2_clksel_round_rate,
+       .set_rate       = &omap2_clksel_set_rate
+};
+
+static struct clk gfx_2d_fck = {
+       .name           = "gfx_2d_fck",
+       .parent         = &core_l3_ck,
+       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
+       .enable_reg     = OMAP_CM_REGADDR(GFX_MOD, CM_FCLKEN),
+       .enable_bit     = OMAP24XX_EN_2D_SHIFT,
+       .clksel_reg     = OMAP_CM_REGADDR(GFX_MOD, CM_CLKSEL),
+       .clksel_mask    = OMAP_CLKSEL_GFX_MASK,
+       .clksel         = gfx_fck_clksel,
+       .recalc         = &omap2_clksel_recalc,
+       .round_rate     = &omap2_clksel_round_rate,
+       .set_rate       = &omap2_clksel_set_rate
+};
+
+static struct clk gfx_ick = {
+       .name           = "gfx_ick",            /* From l3 */
+       .parent         = &core_l3_ck,
+       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
+       .enable_reg     = OMAP_CM_REGADDR(GFX_MOD, CM_ICLKEN),
+       .enable_bit     = OMAP_EN_GFX_SHIFT,
+       .recalc         = &followparent_recalc,
+};
+
+/*
+ * Modem clock domain (2430)
+ *     CLOCKS:
+ *             MDM_OSC_CLK
+ *             MDM_ICLK
+ * These clocks are usable in chassis mode only.
+ */
+static const struct clksel_rate mdm_ick_core_rates[] = {
+       { .div = 1, .val = 1, .flags = RATE_IN_243X },
+       { .div = 4, .val = 4, .flags = RATE_IN_243X | DEFAULT_RATE },
+       { .div = 6, .val = 6, .flags = RATE_IN_243X },
+       { .div = 9, .val = 9, .flags = RATE_IN_243X },
+       { .div = 0 }
+};
+
+static const struct clksel mdm_ick_clksel[] = {
+       { .parent = &core_ck, .rates = mdm_ick_core_rates },
+       { .parent = NULL }
+};
+
+static struct clk mdm_ick = {          /* used both as a ick and fck */
+       .name           = "mdm_ick",
+       .parent         = &core_ck,
+       .flags          = CLOCK_IN_OMAP243X | DELAYED_APP | CONFIG_PARTICIPANT,
+       .enable_reg     = OMAP_CM_REGADDR(OMAP2430_MDM_MOD, CM_ICLKEN),
+       .enable_bit     = OMAP2430_CM_ICLKEN_MDM_EN_MDM_SHIFT,
+       .clksel_reg     = OMAP_CM_REGADDR(OMAP2430_MDM_MOD, CM_CLKSEL),
+       .clksel_mask    = OMAP2430_CLKSEL_MDM_MASK,
+       .clksel         = mdm_ick_clksel,
+       .recalc         = &omap2_clksel_recalc,
+       .round_rate     = &omap2_clksel_round_rate,
+       .set_rate       = &omap2_clksel_set_rate
+};
+
+static struct clk mdm_osc_ck = {
+       .name           = "mdm_osc_ck",
+       .parent         = &osc_ck,
+       .flags          = CLOCK_IN_OMAP243X,
+       .enable_reg     = OMAP_CM_REGADDR(OMAP2430_MDM_MOD, CM_FCLKEN),
+       .enable_bit     = OMAP2430_EN_OSC_SHIFT,
+       .recalc         = &followparent_recalc,
+};
+
+/*
+ * L4 clock management domain
+ *
+ * This domain contains lots of interface clocks from the L4 interface, some
+ * functional clocks.  Fixed APLL functional source clocks are managed in
+ * this domain.
+ */
+static const struct clksel_rate l4_core_l3_rates[] = {
+       { .div = 1, .val = 1, .flags = RATE_IN_24XX | DEFAULT_RATE },
+       { .div = 2, .val = 2, .flags = RATE_IN_24XX },
+       { .div = 0 }
+};
+
+static const struct clksel l4_clksel[] = {
+       { .parent = &core_l3_ck, .rates = l4_core_l3_rates },
+       { .parent = NULL }
+};
+
+static struct clk l4_ck = {            /* used both as an ick and fck */
+       .name           = "l4_ck",
+       .parent         = &core_l3_ck,
+       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
+                               ALWAYS_ENABLED | DELAYED_APP | RATE_PROPAGATES,
+       .clksel_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL1),
+       .clksel_mask    = OMAP24XX_CLKSEL_L4_MASK,
+       .clksel         = l4_clksel,
+       .recalc         = &omap2_clksel_recalc,
+       .round_rate     = &omap2_clksel_round_rate,
+       .set_rate       = &omap2_clksel_set_rate
+};
+
+static struct clk ssi_l4_ick = {
+       .name           = "ssi_l4_ick",
+       .parent         = &l4_ck,
+       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
+       .enable_bit     = OMAP24XX_EN_SSI_SHIFT,
+       .recalc         = &followparent_recalc,
+};
+
+/*
+ * DSS clock domain
+ * CLOCKs:
+ * DSS_L4_ICLK, DSS_L3_ICLK,
+ * DSS_CLK1, DSS_CLK2, DSS_54MHz_CLK
+ *
+ * DSS is both initiator and target.
+ */
+/* XXX Add RATE_NOT_VALIDATED */
+
+static const struct clksel_rate dss1_fck_sys_rates[] = {
+       { .div = 1, .val = 0, .flags = RATE_IN_24XX | DEFAULT_RATE },
+       { .div = 0 }
+};
+
+static const struct clksel_rate dss1_fck_core_rates[] = {
+       { .div = 1, .val = 1, .flags = RATE_IN_24XX },
+       { .div = 2, .val = 2, .flags = RATE_IN_24XX },
+       { .div = 3, .val = 3, .flags = RATE_IN_24XX },
+       { .div = 4, .val = 4, .flags = RATE_IN_24XX },
+       { .div = 5, .val = 5, .flags = RATE_IN_24XX },
+       { .div = 6, .val = 6, .flags = RATE_IN_24XX },
+       { .div = 8, .val = 8, .flags = RATE_IN_24XX },
+       { .div = 9, .val = 9, .flags = RATE_IN_24XX },
+       { .div = 12, .val = 12, .flags = RATE_IN_24XX },
+       { .div = 16, .val = 16, .flags = RATE_IN_24XX | DEFAULT_RATE },
+       { .div = 0 }
+};
+
+static const struct clksel dss1_fck_clksel[] = {
+       { .parent = &sys_ck,  .rates = dss1_fck_sys_rates },
+       { .parent = &core_ck, .rates = dss1_fck_core_rates },
+       { .parent = NULL },
+};
+
+static struct clk dss_ick = {          /* Enables both L3,L4 ICLK's */
+       .name           = "dss_ick",
+       .parent         = &l4_ck,       /* really both l3 and l4 */
+       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
+       .enable_bit     = OMAP24XX_EN_DSS1_SHIFT,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk dss1_fck = {
+       .name           = "dss1_fck",
+       .parent         = &core_ck,             /* Core or sys */
+       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
+                               DELAYED_APP,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
+       .enable_bit     = OMAP24XX_EN_DSS1_SHIFT,
+       .init           = &omap2_init_clksel_parent,
+       .clksel_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL1),
+       .clksel_mask    = OMAP24XX_CLKSEL_DSS1_MASK,
+       .clksel         = dss1_fck_clksel,
+       .recalc         = &omap2_clksel_recalc,
+       .round_rate     = &omap2_clksel_round_rate,
+       .set_rate       = &omap2_clksel_set_rate
+};
+
+static const struct clksel_rate dss2_fck_sys_rates[] = {
+       { .div = 1, .val = 0, .flags = RATE_IN_24XX | DEFAULT_RATE },
+       { .div = 0 }
+};
+
+static const struct clksel_rate dss2_fck_48m_rates[] = {
+       { .div = 1, .val = 1, .flags = RATE_IN_24XX | DEFAULT_RATE },
+       { .div = 0 }
+};
+
+static const struct clksel dss2_fck_clksel[] = {
+       { .parent = &sys_ck,      .rates = dss2_fck_sys_rates },
+       { .parent = &func_48m_ck, .rates = dss2_fck_48m_rates },
+       { .parent = NULL }
+};
+
+static struct clk dss2_fck = {         /* Alt clk used in power management */
+       .name           = "dss2_fck",
+       .parent         = &sys_ck,              /* fixed at sys_ck or 48MHz */
+       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
+                               DELAYED_APP,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
+       .enable_bit     = OMAP24XX_EN_DSS2_SHIFT,
+       .init           = &omap2_init_clksel_parent,
+       .clksel_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL1),
+       .clksel_mask    = OMAP24XX_CLKSEL_DSS2_MASK,
+       .clksel         = dss2_fck_clksel,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk dss_54m_fck = {      /* Alt clk used in power management */
+       .name           = "dss_54m_fck",        /* 54m tv clk */
+       .parent         = &func_54m_ck,
+       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
+       .enable_bit     = OMAP24XX_EN_TV_SHIFT,
+       .recalc         = &followparent_recalc,
+};
+
+/*
+ * CORE power domain ICLK & FCLK defines.
+ * Many of the these can have more than one possible parent. Entries
+ * here will likely have an L4 interface parent, and may have multiple
+ * functional clock parents.
+ */
+static const struct clksel_rate gpt_alt_rates[] = {
+       { .div = 1, .val = 2, .flags = RATE_IN_24XX | DEFAULT_RATE },
+       { .div = 0 }
+};
+
+static const struct clksel omap24xx_gpt_clksel[] = {
+       { .parent = &func_32k_ck, .rates = gpt_32k_rates },
+       { .parent = &sys_ck,      .rates = gpt_sys_rates },
+       { .parent = &alt_ck,      .rates = gpt_alt_rates },
+       { .parent = NULL },
+};
+
+static struct clk gpt1_ick = {
+       .name           = "gpt1_ick",
+       .parent         = &l4_ck,
+       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
+       .enable_reg     = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
+       .enable_bit     = OMAP24XX_EN_GPT1_SHIFT,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk gpt1_fck = {
+       .name           = "gpt1_fck",
+       .parent         = &func_32k_ck,
+       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
+       .enable_reg     = OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN),
+       .enable_bit     = OMAP24XX_EN_GPT1_SHIFT,
+       .init           = &omap2_init_clksel_parent,
+       .clksel_reg     = OMAP_CM_REGADDR(WKUP_MOD, CM_CLKSEL1),
+       .clksel_mask    = OMAP24XX_CLKSEL_GPT1_MASK,
+       .clksel         = omap24xx_gpt_clksel,
+       .recalc         = &omap2_clksel_recalc,
+       .round_rate     = &omap2_clksel_round_rate,
+       .set_rate       = &omap2_clksel_set_rate
+};
+
+static struct clk gpt2_ick = {
+       .name           = "gpt2_ick",
+       .parent         = &l4_ck,
+       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
+       .enable_bit     = OMAP24XX_EN_GPT2_SHIFT,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk gpt2_fck = {
+       .name           = "gpt2_fck",
+       .parent         = &func_32k_ck,
+       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
+       .enable_bit     = OMAP24XX_EN_GPT2_SHIFT,
+       .init           = &omap2_init_clksel_parent,
+       .clksel_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
+       .clksel_mask    = OMAP24XX_CLKSEL_GPT2_MASK,
+       .clksel         = omap24xx_gpt_clksel,
+       .recalc         = &omap2_clksel_recalc,
+};
+
+static struct clk gpt3_ick = {
+       .name           = "gpt3_ick",
+       .parent         = &l4_ck,
+       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
+       .enable_bit     = OMAP24XX_EN_GPT3_SHIFT,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk gpt3_fck = {
+       .name           = "gpt3_fck",
+       .parent         = &func_32k_ck,
+       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
+       .enable_bit     = OMAP24XX_EN_GPT3_SHIFT,
+       .init           = &omap2_init_clksel_parent,
+       .clksel_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
+       .clksel_mask    = OMAP24XX_CLKSEL_GPT3_MASK,
+       .clksel         = omap24xx_gpt_clksel,
+       .recalc         = &omap2_clksel_recalc,
+};
+
+static struct clk gpt4_ick = {
+       .name           = "gpt4_ick",
+       .parent         = &l4_ck,
+       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
+       .enable_bit     = OMAP24XX_EN_GPT4_SHIFT,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk gpt4_fck = {
+       .name           = "gpt4_fck",
+       .parent         = &func_32k_ck,
+       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
+       .enable_bit     = OMAP24XX_EN_GPT4_SHIFT,
+       .init           = &omap2_init_clksel_parent,
+       .clksel_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
+       .clksel_mask    = OMAP24XX_CLKSEL_GPT4_MASK,
+       .clksel         = omap24xx_gpt_clksel,
+       .recalc         = &omap2_clksel_recalc,
+};
+
+static struct clk gpt5_ick = {
+       .name           = "gpt5_ick",
+       .parent         = &l4_ck,
+       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
+       .enable_bit     = OMAP24XX_EN_GPT5_SHIFT,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk gpt5_fck = {
+       .name           = "gpt5_fck",
+       .parent         = &func_32k_ck,
+       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
+       .enable_bit     = OMAP24XX_EN_GPT5_SHIFT,
+       .init           = &omap2_init_clksel_parent,
+       .clksel_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
+       .clksel_mask    = OMAP24XX_CLKSEL_GPT5_MASK,
+       .clksel         = omap24xx_gpt_clksel,
+       .recalc         = &omap2_clksel_recalc,
+};
+
+static struct clk gpt6_ick = {
+       .name           = "gpt6_ick",
+       .parent         = &l4_ck,
+       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
+       .enable_bit     = OMAP24XX_EN_GPT6_SHIFT,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk gpt6_fck = {
+       .name           = "gpt6_fck",
+       .parent         = &func_32k_ck,
+       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
+       .enable_bit     = OMAP24XX_EN_GPT6_SHIFT,
+       .init           = &omap2_init_clksel_parent,
+       .clksel_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
+       .clksel_mask    = OMAP24XX_CLKSEL_GPT6_MASK,
+       .clksel         = omap24xx_gpt_clksel,
+       .recalc         = &omap2_clksel_recalc,
+};
+
+static struct clk gpt7_ick = {
+       .name           = "gpt7_ick",
+       .parent         = &l4_ck,
+       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
+       .enable_bit     = OMAP24XX_EN_GPT7_SHIFT,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk gpt7_fck = {
+       .name           = "gpt7_fck",
+       .parent         = &func_32k_ck,
+       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
+       .enable_bit     = OMAP24XX_EN_GPT7_SHIFT,
+       .init           = &omap2_init_clksel_parent,
+       .clksel_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
+       .clksel_mask    = OMAP24XX_CLKSEL_GPT7_MASK,
+       .clksel         = omap24xx_gpt_clksel,
+       .recalc         = &omap2_clksel_recalc,
+};
+
+static struct clk gpt8_ick = {
+       .name           = "gpt8_ick",
+       .parent         = &l4_ck,
+       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
+       .enable_bit     = OMAP24XX_EN_GPT8_SHIFT,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk gpt8_fck = {
+       .name           = "gpt8_fck",
+       .parent         = &func_32k_ck,
+       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
+       .enable_bit     = OMAP24XX_EN_GPT8_SHIFT,
+       .init           = &omap2_init_clksel_parent,
+       .clksel_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
+       .clksel_mask    = OMAP24XX_CLKSEL_GPT8_MASK,
+       .clksel         = omap24xx_gpt_clksel,
+       .recalc         = &omap2_clksel_recalc,
+};
+
+static struct clk gpt9_ick = {
+       .name           = "gpt9_ick",
+       .parent         = &l4_ck,
+       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
+       .enable_bit     = OMAP24XX_EN_GPT9_SHIFT,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk gpt9_fck = {
+       .name           = "gpt9_fck",
+       .parent         = &func_32k_ck,
+       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
+       .enable_bit     = OMAP24XX_EN_GPT9_SHIFT,
+       .init           = &omap2_init_clksel_parent,
+       .clksel_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
+       .clksel_mask    = OMAP24XX_CLKSEL_GPT9_MASK,
+       .clksel         = omap24xx_gpt_clksel,
+       .recalc         = &omap2_clksel_recalc,
+};
+
+static struct clk gpt10_ick = {
+       .name           = "gpt10_ick",
+       .parent         = &l4_ck,
+       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
+       .enable_bit     = OMAP24XX_EN_GPT10_SHIFT,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk gpt10_fck = {
+       .name           = "gpt10_fck",
+       .parent         = &func_32k_ck,
+       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
+       .enable_bit     = OMAP24XX_EN_GPT10_SHIFT,
+       .init           = &omap2_init_clksel_parent,
+       .clksel_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
+       .clksel_mask    = OMAP24XX_CLKSEL_GPT10_MASK,
+       .clksel         = omap24xx_gpt_clksel,
+       .recalc         = &omap2_clksel_recalc,
+};
+
+static struct clk gpt11_ick = {
+       .name           = "gpt11_ick",
+       .parent         = &l4_ck,
+       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
+       .enable_bit     = OMAP24XX_EN_GPT11_SHIFT,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk gpt11_fck = {
+       .name           = "gpt11_fck",
+       .parent         = &func_32k_ck,
+       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
+       .enable_bit     = OMAP24XX_EN_GPT11_SHIFT,
+       .init           = &omap2_init_clksel_parent,
+       .clksel_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
+       .clksel_mask    = OMAP24XX_CLKSEL_GPT11_MASK,
+       .clksel         = omap24xx_gpt_clksel,
+       .recalc         = &omap2_clksel_recalc,
+};
+
+static struct clk gpt12_ick = {
+       .name           = "gpt12_ick",
+       .parent         = &l4_ck,
+       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
+       .enable_bit     = OMAP24XX_EN_GPT12_SHIFT,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk gpt12_fck = {
+       .name           = "gpt12_fck",
+       .parent         = &func_32k_ck,
+       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
+       .enable_bit     = OMAP24XX_EN_GPT12_SHIFT,
+       .init           = &omap2_init_clksel_parent,
+       .clksel_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
+       .clksel_mask    = OMAP24XX_CLKSEL_GPT12_MASK,
+       .clksel         = omap24xx_gpt_clksel,
+       .recalc         = &omap2_clksel_recalc,
+};
+
+static struct clk mcbsp1_ick = {
+       .name           = "mcbsp1_ick",
+       .parent         = &l4_ck,
+       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
+       .enable_bit     = OMAP24XX_EN_MCBSP1_SHIFT,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk mcbsp1_fck = {
+       .name           = "mcbsp1_fck",
+       .parent         = &func_96m_ck,
+       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
+       .enable_bit     = OMAP24XX_EN_MCBSP1_SHIFT,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk mcbsp2_ick = {
+       .name           = "mcbsp2_ick",
+       .parent         = &l4_ck,
+       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
+       .enable_bit     = OMAP24XX_EN_MCBSP2_SHIFT,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk mcbsp2_fck = {
+       .name           = "mcbsp2_fck",
+       .parent         = &func_96m_ck,
+       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
+       .enable_bit     = OMAP24XX_EN_MCBSP2_SHIFT,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk mcbsp3_ick = {
+       .name           = "mcbsp3_ick",
+       .parent         = &l4_ck,
+       .flags          = CLOCK_IN_OMAP243X,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
+       .enable_bit     = OMAP2430_EN_MCBSP3_SHIFT,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk mcbsp3_fck = {
+       .name           = "mcbsp3_fck",
+       .parent         = &func_96m_ck,
+       .flags          = CLOCK_IN_OMAP243X,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
+       .enable_bit     = OMAP2430_EN_MCBSP3_SHIFT,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk mcbsp4_ick = {
+       .name           = "mcbsp4_ick",
+       .parent         = &l4_ck,
+       .flags          = CLOCK_IN_OMAP243X,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
+       .enable_bit     = OMAP2430_EN_MCBSP4_SHIFT,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk mcbsp4_fck = {
+       .name           = "mcbsp4_fck",
+       .parent         = &func_96m_ck,
+       .flags          = CLOCK_IN_OMAP243X,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
+       .enable_bit     = OMAP2430_EN_MCBSP4_SHIFT,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk mcbsp5_ick = {
+       .name           = "mcbsp5_ick",
+       .parent         = &l4_ck,
+       .flags          = CLOCK_IN_OMAP243X,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
+       .enable_bit     = OMAP2430_EN_MCBSP5_SHIFT,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk mcbsp5_fck = {
+       .name           = "mcbsp5_fck",
+       .parent         = &func_96m_ck,
+       .flags          = CLOCK_IN_OMAP243X,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
+       .enable_bit     = OMAP2430_EN_MCBSP5_SHIFT,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk mcspi1_ick = {
+       .name           = "mcspi_ick",
+       .id             = 1,
+       .parent         = &l4_ck,
+       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
+       .enable_bit     = OMAP24XX_EN_MCSPI1_SHIFT,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk mcspi1_fck = {
+       .name           = "mcspi_fck",
+       .id             = 1,
+       .parent         = &func_48m_ck,
+       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
+       .enable_bit     = OMAP24XX_EN_MCSPI1_SHIFT,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk mcspi2_ick = {
+       .name           = "mcspi_ick",
+       .id             = 2,
+       .parent         = &l4_ck,
+       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
+       .enable_bit     = OMAP24XX_EN_MCSPI2_SHIFT,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk mcspi2_fck = {
+       .name           = "mcspi_fck",
+       .id             = 2,
+       .parent         = &func_48m_ck,
+       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
+       .enable_bit     = OMAP24XX_EN_MCSPI2_SHIFT,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk mcspi3_ick = {
+       .name           = "mcspi_ick",
+       .id             = 3,
+       .parent         = &l4_ck,
+       .flags          = CLOCK_IN_OMAP243X,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
+       .enable_bit     = OMAP2430_EN_MCSPI3_SHIFT,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk mcspi3_fck = {
+       .name           = "mcspi_fck",
+       .id             = 3,
+       .parent         = &func_48m_ck,
+       .flags          = CLOCK_IN_OMAP243X,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
+       .enable_bit     = OMAP2430_EN_MCSPI3_SHIFT,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk uart1_ick = {
+       .name           = "uart1_ick",
+       .parent         = &l4_ck,
+       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
+       .enable_bit     = OMAP24XX_EN_UART1_SHIFT,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk uart1_fck = {
+       .name           = "uart1_fck",
+       .parent         = &func_48m_ck,
+       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
+       .enable_bit     = OMAP24XX_EN_UART1_SHIFT,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk uart2_ick = {
+       .name           = "uart2_ick",
+       .parent         = &l4_ck,
+       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
+       .enable_bit     = OMAP24XX_EN_UART2_SHIFT,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk uart2_fck = {
+       .name           = "uart2_fck",
+       .parent         = &func_48m_ck,
+       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
+       .enable_bit     = OMAP24XX_EN_UART2_SHIFT,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk uart3_ick = {
+       .name           = "uart3_ick",
+       .parent         = &l4_ck,
+       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
+       .enable_bit     = OMAP24XX_EN_UART3_SHIFT,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk uart3_fck = {
+       .name           = "uart3_fck",
+       .parent         = &func_48m_ck,
+       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
+       .enable_bit     = OMAP24XX_EN_UART3_SHIFT,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk gpios_ick = {
+       .name           = "gpios_ick",
+       .parent         = &l4_ck,
+       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
+       .enable_reg     = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
+       .enable_bit     = OMAP24XX_EN_GPIOS_SHIFT,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk gpios_fck = {
+       .name           = "gpios_fck",
+       .parent         = &func_32k_ck,
+       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
+       .enable_reg     = OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN),
+       .enable_bit     = OMAP24XX_EN_GPIOS_SHIFT,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk mpu_wdt_ick = {
+       .name           = "mpu_wdt_ick",
+       .parent         = &l4_ck,
+       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
+       .enable_reg     = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
+       .enable_bit     = OMAP24XX_EN_MPU_WDT_SHIFT,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk mpu_wdt_fck = {
+       .name           = "mpu_wdt_fck",
+       .parent         = &func_32k_ck,
+       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
+       .enable_reg     = OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN),
+       .enable_bit     = OMAP24XX_EN_MPU_WDT_SHIFT,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk sync_32k_ick = {
+       .name           = "sync_32k_ick",
+       .parent         = &l4_ck,
+       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | ENABLE_ON_INIT,
+       .enable_reg     = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
+       .enable_bit     = OMAP24XX_EN_32KSYNC_SHIFT,
+       .recalc         = &followparent_recalc,
+};
+static struct clk wdt1_ick = {
+       .name           = "wdt1_ick",
+       .parent         = &l4_ck,
+       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
+       .enable_reg     = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
+       .enable_bit     = OMAP24XX_EN_WDT1_SHIFT,
+       .recalc         = &followparent_recalc,
+};
+static struct clk omapctrl_ick = {
+       .name           = "omapctrl_ick",
+       .parent         = &l4_ck,
+       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | ENABLE_ON_INIT,
+       .enable_reg     = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
+       .enable_bit     = OMAP24XX_EN_OMAPCTRL_SHIFT,
+       .recalc         = &followparent_recalc,
+};
+static struct clk icr_ick = {
+       .name           = "icr_ick",
+       .parent         = &l4_ck,
+       .flags          = CLOCK_IN_OMAP243X,
+       .enable_reg     = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
+       .enable_bit     = OMAP2430_EN_ICR_SHIFT,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk cam_ick = {
+       .name           = "cam_ick",
+       .parent         = &l4_ck,
+       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
+       .enable_bit     = OMAP24XX_EN_CAM_SHIFT,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk cam_fck = {
+       .name           = "cam_fck",
+       .parent         = &func_96m_ck,
+       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
+       .enable_bit     = OMAP24XX_EN_CAM_SHIFT,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk mailboxes_ick = {
+       .name           = "mailboxes_ick",
+       .parent         = &l4_ck,
+       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
+       .enable_bit     = OMAP24XX_EN_MAILBOXES_SHIFT,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk wdt4_ick = {
+       .name           = "wdt4_ick",
+       .parent         = &l4_ck,
+       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
+       .enable_bit     = OMAP24XX_EN_WDT4_SHIFT,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk wdt4_fck = {
+       .name           = "wdt4_fck",
+       .parent         = &func_32k_ck,
+       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
+       .enable_bit     = OMAP24XX_EN_WDT4_SHIFT,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk wdt3_ick = {
+       .name           = "wdt3_ick",
+       .parent         = &l4_ck,
+       .flags          = CLOCK_IN_OMAP242X,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
+       .enable_bit     = OMAP2420_EN_WDT3_SHIFT,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk wdt3_fck = {
+       .name           = "wdt3_fck",
+       .parent         = &func_32k_ck,
+       .flags          = CLOCK_IN_OMAP242X,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
+       .enable_bit     = OMAP2420_EN_WDT3_SHIFT,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk mspro_ick = {
+       .name           = "mspro_ick",
+       .parent         = &l4_ck,
+       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
+       .enable_bit     = OMAP24XX_EN_MSPRO_SHIFT,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk mspro_fck = {
+       .name           = "mspro_fck",
+       .parent         = &func_96m_ck,
+       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
+       .enable_bit     = OMAP24XX_EN_MSPRO_SHIFT,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk mmc_ick = {
+       .name           = "mmc_ick",
+       .parent         = &l4_ck,
+       .flags          = CLOCK_IN_OMAP242X,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
+       .enable_bit     = OMAP2420_EN_MMC_SHIFT,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk mmc_fck = {
+       .name           = "mmc_fck",
+       .parent         = &func_96m_ck,
+       .flags          = CLOCK_IN_OMAP242X,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
+       .enable_bit     = OMAP2420_EN_MMC_SHIFT,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk fac_ick = {
+       .name           = "fac_ick",
+       .parent         = &l4_ck,
+       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
+       .enable_bit     = OMAP24XX_EN_FAC_SHIFT,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk fac_fck = {
+       .name           = "fac_fck",
+       .parent         = &func_12m_ck,
+       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
+       .enable_bit     = OMAP24XX_EN_FAC_SHIFT,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk eac_ick = {
+       .name           = "eac_ick",
+       .parent         = &l4_ck,
+       .flags          = CLOCK_IN_OMAP242X,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
+       .enable_bit     = OMAP2420_EN_EAC_SHIFT,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk eac_fck = {
+       .name           = "eac_fck",
+       .parent         = &func_96m_ck,
+       .flags          = CLOCK_IN_OMAP242X,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
+       .enable_bit     = OMAP2420_EN_EAC_SHIFT,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk hdq_ick = {
+       .name           = "hdq_ick",
+       .parent         = &l4_ck,
+       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
+       .enable_bit     = OMAP24XX_EN_HDQ_SHIFT,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk hdq_fck = {
+       .name           = "hdq_fck",
+       .parent         = &func_12m_ck,
+       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
+       .enable_bit     = OMAP24XX_EN_HDQ_SHIFT,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk i2c2_ick = {
+       .name           = "i2c_ick",
+       .id             = 2,
+       .parent         = &l4_ck,
+       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
+       .enable_bit     = OMAP2420_EN_I2C2_SHIFT,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk i2c2_fck = {
+       .name           = "i2c_fck",
+       .id             = 2,
+       .parent         = &func_12m_ck,
+       .flags          = CLOCK_IN_OMAP242X,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
+       .enable_bit     = OMAP2420_EN_I2C2_SHIFT,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk i2chs2_fck = {
+       .name           = "i2chs_fck",
+       .id             = 2,
+       .parent         = &func_96m_ck,
+       .flags          = CLOCK_IN_OMAP243X,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
+       .enable_bit     = OMAP2430_EN_I2CHS2_SHIFT,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk i2c1_ick = {
+       .name           = "i2c_ick",
+       .id             = 1,
+       .parent         = &l4_ck,
+       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
+       .enable_bit     = OMAP2420_EN_I2C1_SHIFT,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk i2c1_fck = {
+       .name           = "i2c_fck",
+       .id             = 1,
+       .parent         = &func_12m_ck,
+       .flags          = CLOCK_IN_OMAP242X,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
+       .enable_bit     = OMAP2420_EN_I2C1_SHIFT,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk i2chs1_fck = {
+       .name           = "i2chs_fck",
+       .id             = 1,
+       .parent         = &func_96m_ck,
+       .flags          = CLOCK_IN_OMAP243X,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
+       .enable_bit     = OMAP2430_EN_I2CHS1_SHIFT,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk gpmc_fck = {
+       .name           = "gpmc_fck",
+       .parent         = &core_l3_ck,
+       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | ENABLE_ON_INIT,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk sdma_fck = {
+       .name           = "sdma_fck",
+       .parent         = &core_l3_ck,
+       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk sdma_ick = {
+       .name           = "sdma_ick",
+       .parent         = &l4_ck,
+       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk vlynq_ick = {
+       .name           = "vlynq_ick",
+       .parent         = &core_l3_ck,
+       .flags          = CLOCK_IN_OMAP242X,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
+       .enable_bit     = OMAP2420_EN_VLYNQ_SHIFT,
+       .recalc         = &followparent_recalc,
+};
+
+static const struct clksel_rate vlynq_fck_96m_rates[] = {
+       { .div = 1, .val = 0, .flags = RATE_IN_242X | DEFAULT_RATE },
+       { .div = 0 }
+};
+
+static const struct clksel_rate vlynq_fck_core_rates[] = {
+       { .div = 1, .val = 1, .flags = RATE_IN_242X },
+       { .div = 2, .val = 2, .flags = RATE_IN_242X },
+       { .div = 3, .val = 3, .flags = RATE_IN_242X },
+       { .div = 4, .val = 4, .flags = RATE_IN_242X },
+       { .div = 6, .val = 6, .flags = RATE_IN_242X },
+       { .div = 8, .val = 8, .flags = RATE_IN_242X },
+       { .div = 9, .val = 9, .flags = RATE_IN_242X },
+       { .div = 12, .val = 12, .flags = RATE_IN_242X },
+       { .div = 16, .val = 16, .flags = RATE_IN_242X | DEFAULT_RATE },
+       { .div = 18, .val = 18, .flags = RATE_IN_242X },
+       { .div = 0 }
+};
+
+static const struct clksel vlynq_fck_clksel[] = {
+       { .parent = &func_96m_ck, .rates = vlynq_fck_96m_rates },
+       { .parent = &core_ck,     .rates = vlynq_fck_core_rates },
+       { .parent = NULL }
+};
+
+static struct clk vlynq_fck = {
+       .name           = "vlynq_fck",
+       .parent         = &func_96m_ck,
+       .flags          = CLOCK_IN_OMAP242X | DELAYED_APP,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
+       .enable_bit     = OMAP2420_EN_VLYNQ_SHIFT,
+       .init           = &omap2_init_clksel_parent,
+       .clksel_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL1),
+       .clksel_mask    = OMAP2420_CLKSEL_VLYNQ_MASK,
+       .clksel         = vlynq_fck_clksel,
+       .recalc         = &omap2_clksel_recalc,
+       .round_rate     = &omap2_clksel_round_rate,
+       .set_rate       = &omap2_clksel_set_rate
+};
+
+static struct clk sdrc_ick = {
+       .name           = "sdrc_ick",
+       .parent         = &l4_ck,
+       .flags          = CLOCK_IN_OMAP243X | ENABLE_ON_INIT,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN3),
+       .enable_bit     = OMAP2430_EN_SDRC_SHIFT,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk des_ick = {
+       .name           = "des_ick",
+       .parent         = &l4_ck,
+       .flags          = CLOCK_IN_OMAP243X | CLOCK_IN_OMAP242X,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4),
+       .enable_bit     = OMAP24XX_EN_DES_SHIFT,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk sha_ick = {
+       .name           = "sha_ick",
+       .parent         = &l4_ck,
+       .flags          = CLOCK_IN_OMAP243X | CLOCK_IN_OMAP242X,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4),
+       .enable_bit     = OMAP24XX_EN_SHA_SHIFT,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk rng_ick = {
+       .name           = "rng_ick",
+       .parent         = &l4_ck,
+       .flags          = CLOCK_IN_OMAP243X | CLOCK_IN_OMAP242X,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4),
+       .enable_bit     = OMAP24XX_EN_RNG_SHIFT,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk aes_ick = {
+       .name           = "aes_ick",
+       .parent         = &l4_ck,
+       .flags          = CLOCK_IN_OMAP243X | CLOCK_IN_OMAP242X,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4),
+       .enable_bit     = OMAP24XX_EN_AES_SHIFT,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk pka_ick = {
+       .name           = "pka_ick",
+       .parent         = &l4_ck,
+       .flags          = CLOCK_IN_OMAP243X | CLOCK_IN_OMAP242X,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4),
+       .enable_bit     = OMAP24XX_EN_PKA_SHIFT,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk usb_fck = {
+       .name           = "usb_fck",
+       .parent         = &func_48m_ck,
+       .flags          = CLOCK_IN_OMAP243X | CLOCK_IN_OMAP242X,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
+       .enable_bit     = OMAP24XX_EN_USB_SHIFT,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk usbhs_ick = {
+       .name           = "usbhs_ick",
+       .parent         = &core_l3_ck,
+       .flags          = CLOCK_IN_OMAP243X,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
+       .enable_bit     = OMAP2430_EN_USBHS_SHIFT,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk mmchs1_ick = {
+       .name           = "mmchs_ick",
+       .id             = 1,
+       .parent         = &l4_ck,
+       .flags          = CLOCK_IN_OMAP243X,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
+       .enable_bit     = OMAP2430_EN_MMCHS1_SHIFT,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk mmchs1_fck = {
+       .name           = "mmchs_fck",
+       .id             = 1,
+       .parent         = &func_96m_ck,
+       .flags          = CLOCK_IN_OMAP243X,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
+       .enable_bit     = OMAP2430_EN_MMCHS1_SHIFT,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk mmchs2_ick = {
+       .name           = "mmchs_ick",
+       .id             = 2,
+       .parent         = &l4_ck,
+       .flags          = CLOCK_IN_OMAP243X,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
+       .enable_bit     = OMAP2430_EN_MMCHS2_SHIFT,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk mmchs2_fck = {
+       .name           = "mmchs_fck",
+       .id             = 2,
+       .parent         = &func_96m_ck,
+       .flags          = CLOCK_IN_OMAP243X,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
+       .enable_bit     = OMAP2430_EN_MMCHS2_SHIFT,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk gpio5_ick = {
+       .name           = "gpio5_ick",
+       .parent         = &l4_ck,
+       .flags          = CLOCK_IN_OMAP243X,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
+       .enable_bit     = OMAP2430_EN_GPIO5_SHIFT,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk gpio5_fck = {
+       .name           = "gpio5_fck",
+       .parent         = &func_32k_ck,
+       .flags          = CLOCK_IN_OMAP243X,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
+       .enable_bit     = OMAP2430_EN_GPIO5_SHIFT,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk mdm_intc_ick = {
+       .name           = "mdm_intc_ick",
+       .parent         = &l4_ck,
+       .flags          = CLOCK_IN_OMAP243X,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
+       .enable_bit     = OMAP2430_EN_MDM_INTC_SHIFT,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk mmchsdb1_fck = {
+       .name           = "mmchsdb_fck",
+       .id             = 1,
+       .parent         = &func_32k_ck,
+       .flags          = CLOCK_IN_OMAP243X,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
+       .enable_bit     = OMAP2430_EN_MMCHSDB1_SHIFT,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk mmchsdb2_fck = {
+       .name           = "mmchsdb_fck",
+       .id             = 2,
+       .parent         = &func_32k_ck,
+       .flags          = CLOCK_IN_OMAP243X,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
+       .enable_bit     = OMAP2430_EN_MMCHSDB2_SHIFT,
+       .recalc         = &followparent_recalc,
+};
+
+/*
+ * This clock is a composite clock which does entire set changes then
+ * forces a rebalance. It keys on the MPU speed, but it really could
+ * be any key speed part of a set in the rate table.
+ *
+ * to really change a set, you need memory table sets which get changed
+ * in sram, pre-notifiers & post notifiers, changing the top set, without
+ * having low level display recalc's won't work... this is why dpm notifiers
+ * work, isr's off, walk a list of clocks already _off_ and not messing with
+ * the bus.
+ *
+ * This clock should have no parent. It embodies the entire upper level
+ * active set. A parent will mess up some of the init also.
+ */
+static struct clk virt_prcm_set = {
+       .name           = "virt_prcm_set",
+       .flags          = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
+                               VIRTUAL_CLOCK | ALWAYS_ENABLED | DELAYED_APP,
+       .parent         = &mpu_ck,      /* Indexed by mpu speed, no parent */
+       .recalc         = &omap2_table_mpu_recalc,      /* sets are keyed on mpu rate */
+       .set_rate       = &omap2_select_table_rate,
+       .round_rate     = &omap2_round_to_table_rate,
+};
+
+static struct clk *onchip_24xx_clks[] __initdata = {
+       /* external root sources */
+       &func_32k_ck,
+       &osc_ck,
+       &sys_ck,
+       &alt_ck,
+       /* internal analog sources */
+       &dpll_ck,
+       &apll96_ck,
+       &apll54_ck,
+       /* internal prcm root sources */
+       &func_54m_ck,
+       &core_ck,
+       &func_96m_ck,
+       &func_48m_ck,
+       &func_12m_ck,
+       &wdt1_osc_ck,
+       &sys_clkout_src,
+       &sys_clkout,
+       &sys_clkout2_src,
+       &sys_clkout2,
+       &emul_ck,
+       /* mpu domain clocks */
+       &mpu_ck,
+       /* dsp domain clocks */
+       &dsp_fck,
+       &dsp_irate_ick,
+       &dsp_ick,               /* 242x */
+       &iva2_1_ick,            /* 243x */
+       &iva1_ifck,             /* 242x */
+       &iva1_mpu_int_ifck,     /* 242x */
+       /* GFX domain clocks */
+       &gfx_3d_fck,
+       &gfx_2d_fck,
+       &gfx_ick,
+       /* Modem domain clocks */
+       &mdm_ick,
+       &mdm_osc_ck,
+       /* DSS domain clocks */
+       &dss_ick,
+       &dss1_fck,
+       &dss2_fck,
+       &dss_54m_fck,
+       /* L3 domain clocks */
+       &core_l3_ck,
+       &ssi_ssr_sst_fck,
+       &usb_l4_ick,
+       /* L4 domain clocks */
+       &l4_ck,                 /* used as both core_l4 and wu_l4 */
+       &ssi_l4_ick,
+       /* virtual meta-group clock */
+       &virt_prcm_set,
+       /* general l4 interface ck, multi-parent functional clk */
+       &gpt1_ick,
+       &gpt1_fck,
+       &gpt2_ick,
+       &gpt2_fck,
+       &gpt3_ick,
+       &gpt3_fck,
+       &gpt4_ick,
+       &gpt4_fck,
+       &gpt5_ick,
+       &gpt5_fck,
+       &gpt6_ick,
+       &gpt6_fck,
+       &gpt7_ick,
+       &gpt7_fck,
+       &gpt8_ick,
+       &gpt8_fck,
+       &gpt9_ick,
+       &gpt9_fck,
+       &gpt10_ick,
+       &gpt10_fck,
+       &gpt11_ick,
+       &gpt11_fck,
+       &gpt12_ick,
+       &gpt12_fck,
+       &mcbsp1_ick,
+       &mcbsp1_fck,
+       &mcbsp2_ick,
+       &mcbsp2_fck,
+       &mcbsp3_ick,
+       &mcbsp3_fck,
+       &mcbsp4_ick,
+       &mcbsp4_fck,
+       &mcbsp5_ick,
+       &mcbsp5_fck,
+       &mcspi1_ick,
+       &mcspi1_fck,
+       &mcspi2_ick,
+       &mcspi2_fck,
+       &mcspi3_ick,
+       &mcspi3_fck,
+       &uart1_ick,
+       &uart1_fck,
+       &uart2_ick,
+       &uart2_fck,
+       &uart3_ick,
+       &uart3_fck,
+       &gpios_ick,
+       &gpios_fck,
+       &mpu_wdt_ick,
+       &mpu_wdt_fck,
+       &sync_32k_ick,
+       &wdt1_ick,
+       &omapctrl_ick,
+       &icr_ick,
+       &cam_fck,
+       &cam_ick,
+       &mailboxes_ick,
+       &wdt4_ick,
+       &wdt4_fck,
+       &wdt3_ick,
+       &wdt3_fck,
+       &mspro_ick,
+       &mspro_fck,
+       &mmc_ick,
+       &mmc_fck,
+       &fac_ick,
+       &fac_fck,
+       &eac_ick,
+       &eac_fck,
+       &hdq_ick,
+       &hdq_fck,
+       &i2c1_ick,
+       &i2c1_fck,
+       &i2chs1_fck,
+       &i2c2_ick,
+       &i2c2_fck,
+       &i2chs2_fck,
+       &gpmc_fck,
+       &sdma_fck,
+       &sdma_ick,
+       &vlynq_ick,
+       &vlynq_fck,
+       &sdrc_ick,
+       &des_ick,
+       &sha_ick,
+       &rng_ick,
+       &aes_ick,
+       &pka_ick,
+       &usb_fck,
+       &usbhs_ick,
+       &mmchs1_ick,
+       &mmchs1_fck,
+       &mmchs2_ick,
+       &mmchs2_fck,
+       &gpio5_ick,
+       &gpio5_fck,
+       &mdm_intc_ick,
+       &mmchsdb1_fck,
+       &mmchsdb2_fck,
+};
+
+#endif
+
diff --git a/arch/arm/mach-omap2/clock34xx.c b/arch/arm/mach-omap2/clock34xx.c
new file mode 100644 (file)
index 0000000..b42bdd6
--- /dev/null
@@ -0,0 +1,235 @@
+/*
+ * OMAP3-specific clock framework functions
+ *
+ * Copyright (C) 2007 Texas Instruments, Inc.
+ * Copyright (C) 2007 Nokia Corporation
+ *
+ * Written by Paul Walmsley
+ *
+ * Parts of this code are based on code written by
+ * Richard Woodruff, Tony Lindgren, Tuukka Tikkanen, Karthik Dasu
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+#undef DEBUG
+
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/device.h>
+#include <linux/list.h>
+#include <linux/errno.h>
+#include <linux/delay.h>
+#include <linux/clk.h>
+#include <linux/io.h>
+
+#include <asm/arch/clock.h>
+#include <asm/arch/sram.h>
+#include <asm/div64.h>
+#include <asm/bitops.h>
+
+#include "memory.h"
+#include "clock.h"
+#include "clock34xx.h"
+#include "prm.h"
+#include "prm-regbits-34xx.h"
+#include "cm.h"
+#include "cm-regbits-34xx.h"
+
+/* CM_CLKEN_PLL*.EN* bit values */
+#define DPLL_LOCKED            0x7
+
+/**
+ * omap3_dpll_recalc - recalculate DPLL rate
+ * @clk: DPLL struct clk
+ *
+ * Recalculate and propagate the DPLL rate.
+ */
+static void omap3_dpll_recalc(struct clk *clk)
+{
+       clk->rate = omap2_get_dpll_rate(clk);
+
+       propagate_rate(clk);
+}
+
+/**
+ * omap3_clkoutx2_recalc - recalculate DPLL X2 output virtual clock rate
+ * @clk: DPLL output struct clk
+ *
+ * Using parent clock DPLL data, look up DPLL state.  If locked, set our
+ * rate to the dpll_clk * 2; otherwise, just use dpll_clk.
+ */
+static void omap3_clkoutx2_recalc(struct clk *clk)
+{
+       const struct dpll_data *dd;
+       u32 v;
+       struct clk *pclk;
+
+       /* Walk up the parents of clk, looking for a DPLL */
+       pclk = clk->parent;
+       while (pclk && !pclk->dpll_data)
+               pclk = pclk->parent;
+
+       /* clk does not have a DPLL as a parent? */
+       WARN_ON(!pclk);
+
+       dd = pclk->dpll_data;
+
+       WARN_ON(!dd->control_reg || !dd->enable_mask);
+
+       v = __raw_readl(dd->control_reg) & dd->enable_mask;
+       v >>= __ffs(dd->enable_mask);
+       if (v != DPLL_LOCKED)
+               clk->rate = clk->parent->rate;
+       else
+               clk->rate = clk->parent->rate * 2;
+
+       if (clk->flags & RATE_PROPAGATES)
+               propagate_rate(clk);
+}
+
+/*
+ * As it is structured now, this will prevent an OMAP2/3 multiboot
+ * kernel from compiling.  This will need further attention.
+ */
+#if defined(CONFIG_ARCH_OMAP3)
+
+static struct clk_functions omap2_clk_functions = {
+       .clk_enable             = omap2_clk_enable,
+       .clk_disable            = omap2_clk_disable,
+       .clk_round_rate         = omap2_clk_round_rate,
+       .clk_set_rate           = omap2_clk_set_rate,
+       .clk_set_parent         = omap2_clk_set_parent,
+       .clk_disable_unused     = omap2_clk_disable_unused,
+};
+
+/*
+ * Set clocks for bypass mode for reboot to work.
+ */
+void omap2_clk_prepare_for_reboot(void)
+{
+       /* REVISIT: Not ready for 343x */
+#if 0
+       u32 rate;
+
+       if (vclk == NULL || sclk == NULL)
+               return;
+
+       rate = clk_get_rate(sclk);
+       clk_set_rate(vclk, rate);
+#endif
+}
+
+/* REVISIT: Move this init stuff out into clock.c */
+
+/*
+ * Switch the MPU rate if specified on cmdline.
+ * We cannot do this early until cmdline is parsed.
+ */
+static int __init omap2_clk_arch_init(void)
+{
+       if (!mpurate)
+               return -EINVAL;
+
+       /* REVISIT: not yet ready for 343x */
+#if 0
+       if (omap2_select_table_rate(&virt_prcm_set, mpurate))
+               printk(KERN_ERR "Could not find matching MPU rate\n");
+#endif
+
+       recalculate_root_clocks();
+
+       printk(KERN_INFO "Switched to new clocking rate (Crystal/DPLL3/MPU): "
+              "%ld.%01ld/%ld/%ld MHz\n",
+              (osc_sys_ck.rate / 1000000), (osc_sys_ck.rate / 100000) % 10,
+              (core_ck.rate / 1000000), (dpll1_fck.rate / 1000000)) ;
+
+       return 0;
+}
+arch_initcall(omap2_clk_arch_init);
+
+int __init omap2_clk_init(void)
+{
+       /* struct prcm_config *prcm; */
+       struct clk **clkp;
+       /* u32 clkrate; */
+       u32 cpu_clkflg;
+
+       /* REVISIT: Ultimately this will be used for multiboot */
+#if 0
+       if (cpu_is_omap242x()) {
+               cpu_mask = RATE_IN_242X;
+               cpu_clkflg = CLOCK_IN_OMAP242X;
+               clkp = onchip_24xx_clks;
+       } else if (cpu_is_omap2430()) {
+               cpu_mask = RATE_IN_243X;
+               cpu_clkflg = CLOCK_IN_OMAP243X;
+               clkp = onchip_24xx_clks;
+       }
+#endif
+       if (cpu_is_omap34xx()) {
+               cpu_mask = RATE_IN_343X;
+               cpu_clkflg = CLOCK_IN_OMAP343X;
+               clkp = onchip_34xx_clks;
+
+               /*
+                * Update this if there are further clock changes between ES2
+                * and production parts
+                */
+               if (is_sil_rev_equal_to(OMAP3430_REV_ES1_0)) {
+                       /* No 3430ES1-only rates exist, so no RATE_IN_3430ES1 */
+                       cpu_clkflg |= CLOCK_IN_OMAP3430ES1;
+               } else {
+                       cpu_mask |= RATE_IN_3430ES2;
+                       cpu_clkflg |= CLOCK_IN_OMAP3430ES2;
+               }
+       }
+
+       clk_init(&omap2_clk_functions);
+
+       for (clkp = onchip_34xx_clks;
+            clkp < onchip_34xx_clks + ARRAY_SIZE(onchip_34xx_clks);
+            clkp++) {
+               if ((*clkp)->flags & cpu_clkflg)
+                       clk_register(*clkp);
+       }
+
+       /* REVISIT: Not yet ready for OMAP3 */
+#if 0
+       /* Check the MPU rate set by bootloader */
+       clkrate = omap2_get_dpll_rate_24xx(&dpll_ck);
+       for (prcm = rate_table; prcm->mpu_speed; prcm++) {
+               if (!(prcm->flags & cpu_mask))
+                       continue;
+               if (prcm->xtal_speed != sys_ck.rate)
+                       continue;
+               if (prcm->dpll_speed <= clkrate)
+                        break;
+       }
+       curr_prcm_set = prcm;
+#endif
+
+       recalculate_root_clocks();
+
+       printk(KERN_INFO "Clocking rate (Crystal/DPLL/ARM core): "
+              "%ld.%01ld/%ld/%ld MHz\n",
+              (osc_sys_ck.rate / 1000000), (osc_sys_ck.rate / 100000) % 10,
+              (core_ck.rate / 1000000), (arm_fck.rate / 1000000));
+
+       /*
+        * Only enable those clocks we will need, let the drivers
+        * enable other clocks as necessary
+        */
+       clk_enable_init_clocks();
+
+       /* Avoid sleeping during omap2_clk_prepare_for_reboot() */
+       /* REVISIT: not yet ready for 343x */
+#if 0
+       vclk = clk_get(NULL, "virt_prcm_set");
+       sclk = clk_get(NULL, "sys_ck");
+#endif
+       return 0;
+}
+
+#endif
diff --git a/arch/arm/mach-omap2/clock34xx.h b/arch/arm/mach-omap2/clock34xx.h
new file mode 100644 (file)
index 0000000..cf4644a
--- /dev/null
@@ -0,0 +1,3009 @@
+/*
+ * OMAP3 clock framework
+ *
+ * Virtual clocks are introduced as a convenient tools.
+ * They are sources for other clocks and not supposed
+ * to be requested from drivers directly.
+ *
+ * Copyright (C) 2007-2008 Texas Instruments, Inc.
+ * Copyright (C) 2007-2008 Nokia Corporation
+ *
+ * Written by Paul Walmsley
+ */
+
+#ifndef __ARCH_ARM_MACH_OMAP2_CLOCK34XX_H
+#define __ARCH_ARM_MACH_OMAP2_CLOCK34XX_H
+
+#include <asm/arch/control.h>
+
+#include "clock.h"
+#include "cm.h"
+#include "cm-regbits-34xx.h"
+#include "prm.h"
+#include "prm-regbits-34xx.h"
+
+static void omap3_dpll_recalc(struct clk *clk);
+static void omap3_clkoutx2_recalc(struct clk *clk);
+
+/*
+ * DPLL1 supplies clock to the MPU.
+ * DPLL2 supplies clock to the IVA2.
+ * DPLL3 supplies CORE domain clocks.
+ * DPLL4 supplies peripheral clocks.
+ * DPLL5 supplies other peripheral clocks (USBHOST, USIM).
+ */
+
+/* PRM CLOCKS */
+
+/* According to timer32k.c, this is a 32768Hz clock, not a 32000Hz clock. */
+static struct clk omap_32k_fck = {
+       .name           = "omap_32k_fck",
+       .rate           = 32768,
+       .flags          = CLOCK_IN_OMAP343X | RATE_FIXED | RATE_PROPAGATES |
+                               ALWAYS_ENABLED,
+       .recalc         = &propagate_rate,
+};
+
+static struct clk secure_32k_fck = {
+       .name           = "secure_32k_fck",
+       .rate           = 32768,
+       .flags          = CLOCK_IN_OMAP343X | RATE_FIXED | RATE_PROPAGATES |
+                               ALWAYS_ENABLED,
+       .recalc         = &propagate_rate,
+};
+
+/* Virtual source clocks for osc_sys_ck */
+static struct clk virt_12m_ck = {
+       .name           = "virt_12m_ck",
+       .rate           = 12000000,
+       .flags          = CLOCK_IN_OMAP343X | RATE_FIXED | RATE_PROPAGATES |
+                               ALWAYS_ENABLED,
+       .recalc         = &propagate_rate,
+};
+
+static struct clk virt_13m_ck = {
+       .name           = "virt_13m_ck",
+       .rate           = 13000000,
+       .flags          = CLOCK_IN_OMAP343X | RATE_FIXED | RATE_PROPAGATES |
+                               ALWAYS_ENABLED,
+       .recalc         = &propagate_rate,
+};
+
+static struct clk virt_16_8m_ck = {
+       .name           = "virt_16_8m_ck",
+       .rate           = 16800000,
+       .flags          = CLOCK_IN_OMAP3430ES2 | RATE_FIXED | RATE_PROPAGATES |
+                               ALWAYS_ENABLED,
+       .recalc         = &propagate_rate,
+};
+
+static struct clk virt_19_2m_ck = {
+       .name           = "virt_19_2m_ck",
+       .rate           = 19200000,
+       .flags          = CLOCK_IN_OMAP343X | RATE_FIXED | RATE_PROPAGATES |
+                               ALWAYS_ENABLED,
+       .recalc         = &propagate_rate,
+};
+
+static struct clk virt_26m_ck = {
+       .name           = "virt_26m_ck",
+       .rate           = 26000000,
+       .flags          = CLOCK_IN_OMAP343X | RATE_FIXED | RATE_PROPAGATES |
+                               ALWAYS_ENABLED,
+       .recalc         = &propagate_rate,
+};
+
+static struct clk virt_38_4m_ck = {
+       .name           = "virt_38_4m_ck",
+       .rate           = 38400000,
+       .flags          = CLOCK_IN_OMAP343X | RATE_FIXED | RATE_PROPAGATES |
+                               ALWAYS_ENABLED,
+       .recalc         = &propagate_rate,
+};
+
+static const struct clksel_rate osc_sys_12m_rates[] = {
+       { .div = 1, .val = 0, .flags = RATE_IN_343X | DEFAULT_RATE },
+       { .div = 0 }
+};
+
+static const struct clksel_rate osc_sys_13m_rates[] = {
+       { .div = 1, .val = 1, .flags = RATE_IN_343X | DEFAULT_RATE },
+       { .div = 0 }
+};
+
+static const struct clksel_rate osc_sys_16_8m_rates[] = {
+       { .div = 1, .val = 5, .flags = RATE_IN_3430ES2 | DEFAULT_RATE },
+       { .div = 0 }
+};
+
+static const struct clksel_rate osc_sys_19_2m_rates[] = {
+       { .div = 1, .val = 2, .flags = RATE_IN_343X | DEFAULT_RATE },
+       { .div = 0 }
+};
+
+static const struct clksel_rate osc_sys_26m_rates[] = {
+       { .div = 1, .val = 3, .flags = RATE_IN_343X | DEFAULT_RATE },
+       { .div = 0 }
+};
+
+static const struct clksel_rate osc_sys_38_4m_rates[] = {
+       { .div = 1, .val = 4, .flags = RATE_IN_343X | DEFAULT_RATE },
+       { .div = 0 }
+};
+
+static const struct clksel osc_sys_clksel[] = {
+       { .parent = &virt_12m_ck,   .rates = osc_sys_12m_rates },
+       { .parent = &virt_13m_ck,   .rates = osc_sys_13m_rates },
+       { .parent = &virt_16_8m_ck, .rates = osc_sys_16_8m_rates },
+       { .parent = &virt_19_2m_ck, .rates = osc_sys_19_2m_rates },
+       { .parent = &virt_26m_ck,   .rates = osc_sys_26m_rates },
+       { .parent = &virt_38_4m_ck, .rates = osc_sys_38_4m_rates },
+       { .parent = NULL },
+};
+
+/* Oscillator clock */
+/* 12, 13, 16.8, 19.2, 26, or 38.4 MHz */
+static struct clk osc_sys_ck = {
+       .name           = "osc_sys_ck",
+       .init           = &omap2_init_clksel_parent,
+       .clksel_reg     = OMAP3430_PRM_CLKSEL,
+       .clksel_mask    = OMAP3430_SYS_CLKIN_SEL_MASK,
+       .clksel         = osc_sys_clksel,
+       /* REVISIT: deal with autoextclkmode? */
+       .flags          = CLOCK_IN_OMAP343X | RATE_FIXED | RATE_PROPAGATES |
+                               ALWAYS_ENABLED,
+       .recalc         = &omap2_clksel_recalc,
+};
+
+static const struct clksel_rate div2_rates[] = {
+       { .div = 1, .val = 1, .flags = RATE_IN_343X | DEFAULT_RATE },
+       { .div = 2, .val = 2, .flags = RATE_IN_343X },
+       { .div = 0 }
+};
+
+static const struct clksel sys_clksel[] = {
+       { .parent = &osc_sys_ck, .rates = div2_rates },
+       { .parent = NULL }
+};
+
+/* Latency: this clock is only enabled after PRM_CLKSETUP.SETUP_TIME */
+/* Feeds DPLLs - divided first by PRM_CLKSRC_CTRL.SYSCLKDIV? */
+static struct clk sys_ck = {
+       .name           = "sys_ck",
+       .parent         = &osc_sys_ck,
+       .init           = &omap2_init_clksel_parent,
+       .clksel_reg     = OMAP3430_PRM_CLKSRC_CTRL,
+       .clksel_mask    = OMAP_SYSCLKDIV_MASK,
+       .clksel         = sys_clksel,
+       .flags          = CLOCK_IN_OMAP343X | RATE_PROPAGATES | ALWAYS_ENABLED,
+       .recalc         = &omap2_clksel_recalc,
+};
+
+static struct clk sys_altclk = {
+       .name           = "sys_altclk",
+       .flags          = CLOCK_IN_OMAP343X | RATE_PROPAGATES | ALWAYS_ENABLED,
+       .recalc         = &propagate_rate,
+};
+
+/* Optional external clock input for some McBSPs */
+static struct clk mcbsp_clks = {
+       .name           = "mcbsp_clks",
+       .flags          = CLOCK_IN_OMAP343X | RATE_PROPAGATES | ALWAYS_ENABLED,
+       .recalc         = &propagate_rate,
+};
+
+/* PRM EXTERNAL CLOCK OUTPUT */
+
+static struct clk sys_clkout1 = {
+       .name           = "sys_clkout1",
+       .parent         = &osc_sys_ck,
+       .enable_reg     = OMAP3430_PRM_CLKOUT_CTRL,
+       .enable_bit     = OMAP3430_CLKOUT_EN_SHIFT,
+       .flags          = CLOCK_IN_OMAP343X,
+       .recalc         = &followparent_recalc,
+};
+
+/* DPLLS */
+
+/* CM CLOCKS */
+
+static const struct clksel_rate dpll_bypass_rates[] = {
+       { .div = 1, .val = 0, .flags = RATE_IN_343X | DEFAULT_RATE },
+       { .div = 0 }
+};
+
+static const struct clksel_rate dpll_locked_rates[] = {
+       { .div = 1, .val = 1, .flags = RATE_IN_343X | DEFAULT_RATE },
+       { .div = 0 }
+};
+
+static const struct clksel_rate div16_dpll_rates[] = {
+       { .div = 1, .val = 1, .flags = RATE_IN_343X | DEFAULT_RATE },
+       { .div = 2, .val = 2, .flags = RATE_IN_343X },
+       { .div = 3, .val = 3, .flags = RATE_IN_343X },
+       { .div = 4, .val = 4, .flags = RATE_IN_343X },
+       { .div = 5, .val = 5, .flags = RATE_IN_343X },
+       { .div = 6, .val = 6, .flags = RATE_IN_343X },
+       { .div = 7, .val = 7, .flags = RATE_IN_343X },
+       { .div = 8, .val = 8, .flags = RATE_IN_343X },
+       { .div = 9, .val = 9, .flags = RATE_IN_343X },
+       { .div = 10, .val = 10, .flags = RATE_IN_343X },
+       { .div = 11, .val = 11, .flags = RATE_IN_343X },
+       { .div = 12, .val = 12, .flags = RATE_IN_343X },
+       { .div = 13, .val = 13, .flags = RATE_IN_343X },
+       { .div = 14, .val = 14, .flags = RATE_IN_343X },
+       { .div = 15, .val = 15, .flags = RATE_IN_343X },
+       { .div = 16, .val = 16, .flags = RATE_IN_343X },
+       { .div = 0 }
+};
+
+/* DPLL1 */
+/* MPU clock source */
+/* Type: DPLL */
+static const struct dpll_data dpll1_dd = {
+       .mult_div1_reg  = OMAP_CM_REGADDR(MPU_MOD, OMAP3430_CM_CLKSEL1_PLL),
+       .mult_mask      = OMAP3430_MPU_DPLL_MULT_MASK,
+       .div1_mask      = OMAP3430_MPU_DPLL_DIV_MASK,
+       .control_reg    = OMAP_CM_REGADDR(MPU_MOD, OMAP3430_CM_CLKEN_PLL),
+       .enable_mask    = OMAP3430_EN_MPU_DPLL_MASK,
+       .auto_recal_bit = OMAP3430_EN_MPU_DPLL_DRIFTGUARD_SHIFT,
+       .recal_en_bit   = OMAP3430_MPU_DPLL_RECAL_EN_SHIFT,
+       .recal_st_bit   = OMAP3430_MPU_DPLL_ST_SHIFT,
+};
+
+static struct clk dpll1_ck = {
+       .name           = "dpll1_ck",
+       .parent         = &sys_ck,
+       .dpll_data      = &dpll1_dd,
+       .flags          = CLOCK_IN_OMAP343X | RATE_PROPAGATES | ALWAYS_ENABLED,
+       .recalc         = &omap3_dpll_recalc,
+};
+
+/*
+ * This virtual clock provides the CLKOUTX2 output from the DPLL if the
+ * DPLL isn't bypassed.
+ */
+static struct clk dpll1_x2_ck = {
+       .name           = "dpll1_x2_ck",
+       .parent         = &dpll1_ck,
+       .flags          = CLOCK_IN_OMAP343X | RATE_PROPAGATES |
+                               PARENT_CONTROLS_CLOCK,
+       .recalc         = &omap3_clkoutx2_recalc,
+};
+
+/* On DPLL1, unlike other DPLLs, the divider is downstream from CLKOUTX2 */
+static const struct clksel div16_dpll1_x2m2_clksel[] = {
+       { .parent = &dpll1_x2_ck, .rates = div16_dpll_rates },
+       { .parent = NULL }
+};
+
+/*
+ * Does not exist in the TRM - needed to separate the M2 divider from
+ * bypass selection in mpu_ck
+ */
+static struct clk dpll1_x2m2_ck = {
+       .name           = "dpll1_x2m2_ck",
+       .parent         = &dpll1_x2_ck,
+       .init           = &omap2_init_clksel_parent,
+       .clksel_reg     = OMAP_CM_REGADDR(MPU_MOD, OMAP3430_CM_CLKSEL2_PLL),
+       .clksel_mask    = OMAP3430_MPU_DPLL_CLKOUT_DIV_MASK,
+       .clksel         = div16_dpll1_x2m2_clksel,
+       .flags          = CLOCK_IN_OMAP343X | RATE_PROPAGATES |
+                               PARENT_CONTROLS_CLOCK,
+       .recalc         = &omap2_clksel_recalc,
+};
+
+/* DPLL2 */
+/* IVA2 clock source */
+/* Type: DPLL */
+
+static const struct dpll_data dpll2_dd = {
+       .mult_div1_reg  = OMAP_CM_REGADDR(OMAP3430_IVA2_MOD, OMAP3430_CM_CLKSEL1_PLL),
+       .mult_mask      = OMAP3430_IVA2_DPLL_MULT_MASK,
+       .div1_mask      = OMAP3430_IVA2_DPLL_DIV_MASK,
+       .control_reg    = OMAP_CM_REGADDR(OMAP3430_IVA2_MOD, OMAP3430_CM_CLKEN_PLL),
+       .enable_mask    = OMAP3430_EN_IVA2_DPLL_MASK,
+       .auto_recal_bit = OMAP3430_EN_IVA2_DPLL_DRIFTGUARD_SHIFT,
+       .recal_en_bit   = OMAP3430_PRM_IRQENABLE_MPU_IVA2_DPLL_RECAL_EN_SHIFT,
+       .recal_st_bit   = OMAP3430_PRM_IRQSTATUS_MPU_IVA2_DPLL_ST_SHIFT,
+};
+
+static struct clk dpll2_ck = {
+       .name           = "dpll2_ck",
+       .parent         = &sys_ck,
+       .dpll_data      = &dpll2_dd,
+       .flags          = CLOCK_IN_OMAP343X | RATE_PROPAGATES | ALWAYS_ENABLED,
+       .recalc         = &omap3_dpll_recalc,
+};
+
+static const struct clksel div16_dpll2_m2x2_clksel[] = {
+       { .parent = &dpll2_ck, .rates = div16_dpll_rates },
+       { .parent = NULL }
+};
+
+/*
+ * The TRM is conflicted on whether IVA2 clock comes from DPLL2 CLKOUT
+ * or CLKOUTX2. CLKOUT seems most plausible.
+ */
+static struct clk dpll2_m2_ck = {
+       .name           = "dpll2_m2_ck",
+       .parent         = &dpll2_ck,
+       .init           = &omap2_init_clksel_parent,
+       .clksel_reg     = OMAP_CM_REGADDR(OMAP3430_IVA2_MOD,
+                                         OMAP3430_CM_CLKSEL2_PLL),
+       .clksel_mask    = OMAP3430_IVA2_DPLL_CLKOUT_DIV_MASK,
+       .clksel         = div16_dpll2_m2x2_clksel,
+       .flags          = CLOCK_IN_OMAP343X | RATE_PROPAGATES |
+                               PARENT_CONTROLS_CLOCK,
+       .recalc         = &omap2_clksel_recalc,
+};
+
+/* DPLL3 */
+/* Source clock for all interfaces and for some device fclks */
+/* Type: DPLL */
+static const struct dpll_data dpll3_dd = {
+       .mult_div1_reg  = OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1),
+       .mult_mask      = OMAP3430_CORE_DPLL_MULT_MASK,
+       .div1_mask      = OMAP3430_CORE_DPLL_DIV_MASK,
+       .control_reg    = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN),
+       .enable_mask    = OMAP3430_EN_CORE_DPLL_MASK,
+       .auto_recal_bit = OMAP3430_EN_CORE_DPLL_DRIFTGUARD_SHIFT,
+       .recal_en_bit   = OMAP3430_CORE_DPLL_RECAL_EN_SHIFT,
+       .recal_st_bit   = OMAP3430_CORE_DPLL_ST_SHIFT,
+};
+
+static struct clk dpll3_ck = {
+       .name           = "dpll3_ck",
+       .parent         = &sys_ck,
+       .dpll_data      = &dpll3_dd,
+       .flags          = CLOCK_IN_OMAP343X | RATE_PROPAGATES | ALWAYS_ENABLED,
+       .recalc         = &omap3_dpll_recalc,
+};
+
+/*
+ * This virtual clock provides the CLKOUTX2 output from the DPLL if the
+ * DPLL isn't bypassed
+ */
+static struct clk dpll3_x2_ck = {
+       .name           = "dpll3_x2_ck",
+       .parent         = &dpll3_ck,
+       .flags          = CLOCK_IN_OMAP343X | RATE_PROPAGATES |
+                               PARENT_CONTROLS_CLOCK,
+       .recalc         = &omap3_clkoutx2_recalc,
+};
+
+static const struct clksel_rate div31_dpll3_rates[] = {
+       { .div = 1, .val = 1, .flags = RATE_IN_343X | DEFAULT_RATE },
+       { .div = 2, .val = 2, .flags = RATE_IN_343X },
+       { .div = 3, .val = 3, .flags = RATE_IN_3430ES2 },
+       { .div = 4, .val = 4, .flags = RATE_IN_3430ES2 },
+       { .div = 5, .val = 5, .flags = RATE_IN_3430ES2 },
+       { .div = 6, .val = 6, .flags = RATE_IN_3430ES2 },
+       { .div = 7, .val = 7, .flags = RATE_IN_3430ES2 },
+       { .div = 8, .val = 8, .flags = RATE_IN_3430ES2 },
+       { .div = 9, .val = 9, .flags = RATE_IN_3430ES2 },
+       { .div = 10, .val = 10, .flags = RATE_IN_3430ES2 },
+       { .div = 11, .val = 11, .flags = RATE_IN_3430ES2 },
+       { .div = 12, .val = 12, .flags = RATE_IN_3430ES2 },
+       { .div = 13, .val = 13, .flags = RATE_IN_3430ES2 },
+       { .div = 14, .val = 14, .flags = RATE_IN_3430ES2 },
+       { .div = 15, .val = 15, .flags = RATE_IN_3430ES2 },
+       { .div = 16, .val = 16, .flags = RATE_IN_3430ES2 },
+       { .div = 17, .val = 17, .flags = RATE_IN_3430ES2 },
+       { .div = 18, .val = 18, .flags = RATE_IN_3430ES2 },
+       { .div = 19, .val = 19, .flags = RATE_IN_3430ES2 },
+       { .div = 20, .val = 20, .flags = RATE_IN_3430ES2 },
+       { .div = 21, .val = 21, .flags = RATE_IN_3430ES2 },
+       { .div = 22, .val = 22, .flags = RATE_IN_3430ES2 },
+       { .div = 23, .val = 23, .flags = RATE_IN_3430ES2 },
+       { .div = 24, .val = 24, .flags = RATE_IN_3430ES2 },
+       { .div = 25, .val = 25, .flags = RATE_IN_3430ES2 },
+       { .div = 26, .val = 26, .flags = RATE_IN_3430ES2 },
+       { .div = 27, .val = 27, .flags = RATE_IN_3430ES2 },
+       { .div = 28, .val = 28, .flags = RATE_IN_3430ES2 },
+       { .div = 29, .val = 29, .flags = RATE_IN_3430ES2 },
+       { .div = 30, .val = 30, .flags = RATE_IN_3430ES2 },
+       { .div = 31, .val = 31, .flags = RATE_IN_3430ES2 },
+       { .div = 0 },
+};
+
+static const struct clksel div31_dpll3m2_clksel[] = {
+       { .parent = &dpll3_ck, .rates = div31_dpll3_rates },
+       { .parent = NULL }
+};
+
+/*
+ * DPLL3 output M2
+ * REVISIT: This DPLL output divider must be changed in SRAM, so until
+ * that code is ready, this should remain a 'read-only' clksel clock.
+ */
+static struct clk dpll3_m2_ck = {
+       .name           = "dpll3_m2_ck",
+       .parent         = &dpll3_ck,
+       .init           = &omap2_init_clksel_parent,
+       .clksel_reg     = OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1),
+       .clksel_mask    = OMAP3430_CORE_DPLL_CLKOUT_DIV_MASK,
+       .clksel         = div31_dpll3m2_clksel,
+       .flags          = CLOCK_IN_OMAP343X | RATE_PROPAGATES |
+                               PARENT_CONTROLS_CLOCK,
+       .recalc         = &omap2_clksel_recalc,
+};
+
+static const struct clksel core_ck_clksel[] = {
+       { .parent = &sys_ck,      .rates = dpll_bypass_rates },
+       { .parent = &dpll3_m2_ck, .rates = dpll_locked_rates },
+       { .parent = NULL }
+};
+
+static struct clk core_ck = {
+       .name           = "core_ck",
+       .init           = &omap2_init_clksel_parent,
+       .clksel_reg     = OMAP_CM_REGADDR(PLL_MOD, CM_IDLEST),
+       .clksel_mask    = OMAP3430_ST_CORE_CLK,
+       .clksel         = core_ck_clksel,
+       .flags          = CLOCK_IN_OMAP343X | RATE_PROPAGATES |
+                               PARENT_CONTROLS_CLOCK,
+       .recalc         = &omap2_clksel_recalc,
+};
+
+static const struct clksel dpll3_m2x2_ck_clksel[] = {
+       { .parent = &sys_ck,      .rates = dpll_bypass_rates },
+       { .parent = &dpll3_x2_ck, .rates = dpll_locked_rates },
+       { .parent = NULL }
+};
+
+static struct clk dpll3_m2x2_ck = {
+       .name           = "dpll3_m2x2_ck",
+       .init           = &omap2_init_clksel_parent,
+       .clksel_reg     = OMAP_CM_REGADDR(PLL_MOD, CM_IDLEST),
+       .clksel_mask    = OMAP3430_ST_CORE_CLK,
+       .clksel         = dpll3_m2x2_ck_clksel,
+       .flags          = CLOCK_IN_OMAP343X | RATE_PROPAGATES |
+                               PARENT_CONTROLS_CLOCK,
+       .recalc         = &omap2_clksel_recalc,
+};
+
+/* The PWRDN bit is apparently only available on 3430ES2 and above */
+static const struct clksel div16_dpll3_clksel[] = {
+       { .parent = &dpll3_ck, .rates = div16_dpll_rates },
+       { .parent = NULL }
+};
+
+/* This virtual clock is the source for dpll3_m3x2_ck */
+static struct clk dpll3_m3_ck = {
+       .name           = "dpll3_m3_ck",
+       .parent         = &dpll3_ck,
+       .init           = &omap2_init_clksel_parent,
+       .clksel_reg     = OMAP_CM_REGADDR(OMAP3430_EMU_MOD, CM_CLKSEL1),
+       .clksel_mask    = OMAP3430_DIV_DPLL3_MASK,
+       .clksel         = div16_dpll3_clksel,
+       .flags          = CLOCK_IN_OMAP343X | RATE_PROPAGATES |
+                               PARENT_CONTROLS_CLOCK,
+       .recalc         = &omap2_clksel_recalc,
+};
+
+/* The PWRDN bit is apparently only available on 3430ES2 and above */
+static struct clk dpll3_m3x2_ck = {
+       .name           = "dpll3_m3x2_ck",
+       .parent         = &dpll3_m3_ck,
+       .enable_reg     = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN),
+       .enable_bit     = OMAP3430_PWRDN_EMU_CORE_SHIFT,
+       .flags          = CLOCK_IN_OMAP343X | RATE_PROPAGATES | INVERT_ENABLE,
+       .recalc         = &omap3_clkoutx2_recalc,
+};
+
+static const struct clksel emu_core_alwon_ck_clksel[] = {
+       { .parent = &sys_ck,        .rates = dpll_bypass_rates },
+       { .parent = &dpll3_m3x2_ck, .rates = dpll_locked_rates },
+       { .parent = NULL }
+};
+
+static struct clk emu_core_alwon_ck = {
+       .name           = "emu_core_alwon_ck",
+       .parent         = &dpll3_m3x2_ck,
+       .init           = &omap2_init_clksel_parent,
+       .clksel_reg     = OMAP_CM_REGADDR(PLL_MOD, CM_IDLEST),
+       .clksel_mask    = OMAP3430_ST_CORE_CLK,
+       .clksel         = emu_core_alwon_ck_clksel,
+       .flags          = CLOCK_IN_OMAP343X | RATE_PROPAGATES |
+                               PARENT_CONTROLS_CLOCK,
+       .recalc         = &omap2_clksel_recalc,
+};
+
+/* DPLL4 */
+/* Supplies 96MHz, 54Mhz TV DAC, DSS fclk, CAM sensor clock, emul trace clk */
+/* Type: DPLL */
+static const struct dpll_data dpll4_dd = {
+       .mult_div1_reg  = OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL2),
+       .mult_mask      = OMAP3430_PERIPH_DPLL_MULT_MASK,
+       .div1_mask      = OMAP3430_PERIPH_DPLL_DIV_MASK,
+       .control_reg    = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN),
+       .enable_mask    = OMAP3430_EN_PERIPH_DPLL_MASK,
+       .auto_recal_bit = OMAP3430_EN_PERIPH_DPLL_DRIFTGUARD_SHIFT,
+       .recal_en_bit   = OMAP3430_PERIPH_DPLL_RECAL_EN_SHIFT,
+       .recal_st_bit   = OMAP3430_PERIPH_DPLL_ST_SHIFT,
+};
+
+static struct clk dpll4_ck = {
+       .name           = "dpll4_ck",
+       .parent         = &sys_ck,
+       .dpll_data      = &dpll4_dd,
+       .flags          = CLOCK_IN_OMAP343X | RATE_PROPAGATES | ALWAYS_ENABLED,
+       .recalc         = &omap3_dpll_recalc,
+};
+
+/*
+ * This virtual clock provides the CLKOUTX2 output from the DPLL if the
+ * DPLL isn't bypassed --
+ * XXX does this serve any downstream clocks?
+ */
+static struct clk dpll4_x2_ck = {
+       .name           = "dpll4_x2_ck",
+       .parent         = &dpll4_ck,
+       .flags          = CLOCK_IN_OMAP343X | RATE_PROPAGATES |
+                               PARENT_CONTROLS_CLOCK,
+       .recalc         = &omap3_clkoutx2_recalc,
+};
+
+static const struct clksel div16_dpll4_clksel[] = {
+       { .parent = &dpll4_ck, .rates = div16_dpll_rates },
+       { .parent = NULL }
+};
+
+/* This virtual clock is the source for dpll4_m2x2_ck */
+static struct clk dpll4_m2_ck = {
+       .name           = "dpll4_m2_ck",
+       .parent         = &dpll4_ck,
+       .init           = &omap2_init_clksel_parent,
+       .clksel_reg     = OMAP_CM_REGADDR(PLL_MOD, OMAP3430_CM_CLKSEL3),
+       .clksel_mask    = OMAP3430_DIV_96M_MASK,
+       .clksel         = div16_dpll4_clksel,
+       .flags          = CLOCK_IN_OMAP343X | RATE_PROPAGATES |
+                               PARENT_CONTROLS_CLOCK,
+       .recalc         = &omap2_clksel_recalc,
+};
+
+/* The PWRDN bit is apparently only available on 3430ES2 and above */
+static struct clk dpll4_m2x2_ck = {
+       .name           = "dpll4_m2x2_ck",
+       .parent         = &dpll4_m2_ck,
+       .enable_reg     = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN),
+       .enable_bit     = OMAP3430_PWRDN_96M_SHIFT,
+       .flags          = CLOCK_IN_OMAP343X | RATE_PROPAGATES | INVERT_ENABLE,
+       .recalc         = &omap3_clkoutx2_recalc,
+};
+
+static const struct clksel omap_96m_alwon_fck_clksel[] = {
+       { .parent = &sys_ck,        .rates = dpll_bypass_rates },
+       { .parent = &dpll4_m2x2_ck, .rates = dpll_locked_rates },
+       { .parent = NULL }
+};
+
+static struct clk omap_96m_alwon_fck = {
+       .name           = "omap_96m_alwon_fck",
+       .parent         = &dpll4_m2x2_ck,
+       .init           = &omap2_init_clksel_parent,
+       .clksel_reg     = OMAP_CM_REGADDR(PLL_MOD, CM_IDLEST),
+       .clksel_mask    = OMAP3430_ST_PERIPH_CLK,
+       .clksel         = omap_96m_alwon_fck_clksel,
+       .flags          = CLOCK_IN_OMAP343X | RATE_PROPAGATES |
+                                PARENT_CONTROLS_CLOCK,
+       .recalc         = &omap2_clksel_recalc,
+};
+
+static struct clk omap_96m_fck = {
+       .name           = "omap_96m_fck",
+       .parent         = &omap_96m_alwon_fck,
+       .flags          = CLOCK_IN_OMAP343X | RATE_PROPAGATES |
+                               PARENT_CONTROLS_CLOCK,
+       .recalc         = &followparent_recalc,
+};
+
+static const struct clksel cm_96m_fck_clksel[] = {
+       { .parent = &sys_ck,        .rates = dpll_bypass_rates },
+       { .parent = &dpll4_m2x2_ck, .rates = dpll_locked_rates },
+       { .parent = NULL }
+};
+
+static struct clk cm_96m_fck = {
+       .name           = "cm_96m_fck",
+       .parent         = &dpll4_m2x2_ck,
+       .init           = &omap2_init_clksel_parent,
+       .clksel_reg     = OMAP_CM_REGADDR(PLL_MOD, CM_IDLEST),
+       .clksel_mask    = OMAP3430_ST_PERIPH_CLK,
+       .clksel         = cm_96m_fck_clksel,
+       .flags          = CLOCK_IN_OMAP343X | RATE_PROPAGATES |
+                               PARENT_CONTROLS_CLOCK,
+       .recalc         = &omap2_clksel_recalc,
+};
+
+/* This virtual clock is the source for dpll4_m3x2_ck */
+static struct clk dpll4_m3_ck = {
+       .name           = "dpll4_m3_ck",
+       .parent         = &dpll4_ck,
+       .init           = &omap2_init_clksel_parent,
+       .clksel_reg     = OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_CLKSEL),
+       .clksel_mask    = OMAP3430_CLKSEL_TV_MASK,
+       .clksel         = div16_dpll4_clksel,
+       .flags          = CLOCK_IN_OMAP343X | RATE_PROPAGATES |
+                               PARENT_CONTROLS_CLOCK,
+       .recalc         = &omap2_clksel_recalc,
+};
+
+/* The PWRDN bit is apparently only available on 3430ES2 and above */
+static struct clk dpll4_m3x2_ck = {
+       .name           = "dpll4_m3x2_ck",
+       .parent         = &dpll4_m3_ck,
+       .init           = &omap2_init_clksel_parent,
+       .enable_reg     = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN),
+       .enable_bit     = OMAP3430_PWRDN_TV_SHIFT,
+       .flags          = CLOCK_IN_OMAP343X | RATE_PROPAGATES | INVERT_ENABLE,
+       .recalc         = &omap3_clkoutx2_recalc,
+};
+
+static const struct clksel virt_omap_54m_fck_clksel[] = {
+       { .parent = &sys_ck,        .rates = dpll_bypass_rates },
+       { .parent = &dpll4_m3x2_ck, .rates = dpll_locked_rates },
+       { .parent = NULL }
+};
+
+static struct clk virt_omap_54m_fck = {
+       .name           = "virt_omap_54m_fck",
+       .parent         = &dpll4_m3x2_ck,
+       .init           = &omap2_init_clksel_parent,
+       .clksel_reg     = OMAP_CM_REGADDR(PLL_MOD, CM_IDLEST),
+       .clksel_mask    = OMAP3430_ST_PERIPH_CLK,
+       .clksel         = virt_omap_54m_fck_clksel,
+       .flags          = CLOCK_IN_OMAP343X | RATE_PROPAGATES |
+                               PARENT_CONTROLS_CLOCK,
+       .recalc         = &omap2_clksel_recalc,
+};
+
+static const struct clksel_rate omap_54m_d4m3x2_rates[] = {
+       { .div = 1, .val = 0, .flags = RATE_IN_343X | DEFAULT_RATE },
+       { .div = 0 }
+};
+
+static const struct clksel_rate omap_54m_alt_rates[] = {
+       { .div = 1, .val = 1, .flags = RATE_IN_343X | DEFAULT_RATE },
+       { .div = 0 }
+};
+
+static const struct clksel omap_54m_clksel[] = {
+       { .parent = &virt_omap_54m_fck, .rates = omap_54m_d4m3x2_rates },
+       { .parent = &sys_altclk,    .rates = omap_54m_alt_rates },
+       { .parent = NULL }
+};
+
+static struct clk omap_54m_fck = {
+       .name           = "omap_54m_fck",
+       .init           = &omap2_init_clksel_parent,
+       .clksel_reg     = OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1),
+       .clksel_mask    = OMAP3430_SOURCE_54M,
+       .clksel         = omap_54m_clksel,
+       .flags          = CLOCK_IN_OMAP343X | RATE_PROPAGATES |
+                               PARENT_CONTROLS_CLOCK,
+       .recalc         = &omap2_clksel_recalc,
+};
+
+static const struct clksel_rate omap_48m_96md2_rates[] = {
+       { .div = 2, .val = 0, .flags = RATE_IN_343X | DEFAULT_RATE },
+       { .div = 0 }
+};
+
+static const struct clksel_rate omap_48m_alt_rates[] = {
+       { .div = 1, .val = 1, .flags = RATE_IN_343X | DEFAULT_RATE },
+       { .div = 0 }
+};
+
+static const struct clksel omap_48m_clksel[] = {
+       { .parent = &cm_96m_fck, .rates = omap_48m_96md2_rates },
+       { .parent = &sys_altclk, .rates = omap_48m_alt_rates },
+       { .parent = NULL }
+};
+
+static struct clk omap_48m_fck = {
+       .name           = "omap_48m_fck",
+       .init           = &omap2_init_clksel_parent,
+       .clksel_reg     = OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1),
+       .clksel_mask    = OMAP3430_SOURCE_48M,
+       .clksel         = omap_48m_clksel,
+       .flags          = CLOCK_IN_OMAP343X | RATE_PROPAGATES |
+                               PARENT_CONTROLS_CLOCK,
+       .recalc         = &omap2_clksel_recalc,
+};
+
+static struct clk omap_12m_fck = {
+       .name           = "omap_12m_fck",
+       .parent         = &omap_48m_fck,
+       .fixed_div      = 4,
+       .flags          = CLOCK_IN_OMAP343X | RATE_PROPAGATES |
+                               PARENT_CONTROLS_CLOCK,
+       .recalc         = &omap2_fixed_divisor_recalc,
+};
+
+/* This virstual clock is the source for dpll4_m4x2_ck */
+static struct clk dpll4_m4_ck = {
+       .name           = "dpll4_m4_ck",
+       .parent         = &dpll4_ck,
+       .init           = &omap2_init_clksel_parent,
+       .clksel_reg     = OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_CLKSEL),
+       .clksel_mask    = OMAP3430_CLKSEL_DSS1_MASK,
+       .clksel         = div16_dpll4_clksel,
+       .flags          = CLOCK_IN_OMAP343X | RATE_PROPAGATES |
+                               PARENT_CONTROLS_CLOCK,
+       .recalc         = &omap2_clksel_recalc,
+};
+
+/* The PWRDN bit is apparently only available on 3430ES2 and above */
+static struct clk dpll4_m4x2_ck = {
+       .name           = "dpll4_m4x2_ck",
+       .parent         = &dpll4_m4_ck,
+       .enable_reg     = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN),
+       .enable_bit     = OMAP3430_PWRDN_CAM_SHIFT,
+       .flags          = CLOCK_IN_OMAP343X | RATE_PROPAGATES | INVERT_ENABLE,
+       .recalc         = &omap3_clkoutx2_recalc,
+};
+
+/* This virtual clock is the source for dpll4_m5x2_ck */
+static struct clk dpll4_m5_ck = {
+       .name           = "dpll4_m5_ck",
+       .parent         = &dpll4_ck,
+       .init           = &omap2_init_clksel_parent,
+       .clksel_reg     = OMAP_CM_REGADDR(OMAP3430_CAM_MOD, CM_CLKSEL),
+       .clksel_mask    = OMAP3430_CLKSEL_CAM_MASK,
+       .clksel         = div16_dpll4_clksel,
+       .flags          = CLOCK_IN_OMAP343X | RATE_PROPAGATES |
+                               PARENT_CONTROLS_CLOCK,
+       .recalc         = &omap2_clksel_recalc,
+};
+
+/* The PWRDN bit is apparently only available on 3430ES2 and above */
+static struct clk dpll4_m5x2_ck = {
+       .name           = "dpll4_m5x2_ck",
+       .parent         = &dpll4_m5_ck,
+       .enable_reg     = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN),
+       .enable_bit     = OMAP3430_PWRDN_CAM_SHIFT,
+       .flags          = CLOCK_IN_OMAP343X | RATE_PROPAGATES | INVERT_ENABLE,
+       .recalc         = &omap3_clkoutx2_recalc,
+};
+
+/* This virtual clock is the source for dpll4_m6x2_ck */
+static struct clk dpll4_m6_ck = {
+       .name           = "dpll4_m6_ck",
+       .parent         = &dpll4_ck,
+       .init           = &omap2_init_clksel_parent,
+       .clksel_reg     = OMAP_CM_REGADDR(OMAP3430_EMU_MOD, CM_CLKSEL1),
+       .clksel_mask    = OMAP3430_DIV_DPLL4_MASK,
+       .clksel         = div16_dpll4_clksel,
+       .flags          = CLOCK_IN_OMAP343X | RATE_PROPAGATES |
+                               PARENT_CONTROLS_CLOCK,
+       .recalc         = &omap2_clksel_recalc,
+};
+
+/* The PWRDN bit is apparently only available on 3430ES2 and above */
+static struct clk dpll4_m6x2_ck = {
+       .name           = "dpll4_m6x2_ck",
+       .parent         = &dpll4_m6_ck,
+       .init           = &omap2_init_clksel_parent,
+       .enable_reg     = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN),
+       .enable_bit     = OMAP3430_PWRDN_EMU_PERIPH_SHIFT,
+       .flags          = CLOCK_IN_OMAP343X | RATE_PROPAGATES | INVERT_ENABLE,
+       .recalc         = &omap3_clkoutx2_recalc,
+};
+
+static struct clk emu_per_alwon_ck = {
+       .name           = "emu_per_alwon_ck",
+       .parent         = &dpll4_m6x2_ck,
+       .flags          = CLOCK_IN_OMAP343X | RATE_PROPAGATES |
+                               PARENT_CONTROLS_CLOCK,
+       .recalc         = &followparent_recalc,
+};
+
+/* DPLL5 */
+/* Supplies 120MHz clock, USIM source clock */
+/* Type: DPLL */
+/* 3430ES2 only */
+static const struct dpll_data dpll5_dd = {
+       .mult_div1_reg  = OMAP_CM_REGADDR(PLL_MOD, OMAP3430ES2_CM_CLKSEL4),
+       .mult_mask      = OMAP3430ES2_PERIPH2_DPLL_MULT_MASK,
+       .div1_mask      = OMAP3430ES2_PERIPH2_DPLL_DIV_MASK,
+       .control_reg    = OMAP_CM_REGADDR(PLL_MOD, OMAP3430ES2_CM_CLKEN2),
+       .enable_mask    = OMAP3430ES2_EN_PERIPH2_DPLL_MASK,
+       .auto_recal_bit = OMAP3430ES2_EN_PERIPH2_DPLL_DRIFTGUARD_SHIFT,
+       .recal_en_bit   = OMAP3430ES2_SND_PERIPH_DPLL_RECAL_EN_SHIFT,
+       .recal_st_bit   = OMAP3430ES2_SND_PERIPH_DPLL_ST_SHIFT,
+};
+
+static struct clk dpll5_ck = {
+       .name           = "dpll5_ck",
+       .parent         = &sys_ck,
+       .dpll_data      = &dpll5_dd,
+       .flags          = CLOCK_IN_OMAP3430ES2 | RATE_PROPAGATES |
+                               ALWAYS_ENABLED,
+       .recalc         = &omap3_dpll_recalc,
+};
+
+static const struct clksel div16_dpll5_clksel[] = {
+       { .parent = &dpll5_ck, .rates = div16_dpll_rates },
+       { .parent = NULL }
+};
+
+static struct clk dpll5_m2_ck = {
+       .name           = "dpll5_m2_ck",
+       .parent         = &dpll5_ck,
+       .init           = &omap2_init_clksel_parent,
+       .clksel_reg     = OMAP_CM_REGADDR(PLL_MOD, OMAP3430ES2_CM_CLKSEL5),
+       .clksel_mask    = OMAP3430ES2_DIV_120M_MASK,
+       .clksel         = div16_dpll5_clksel,
+       .flags          = CLOCK_IN_OMAP3430ES2 | RATE_PROPAGATES,
+       .recalc         = &omap2_clksel_recalc,
+};
+
+static const struct clksel omap_120m_fck_clksel[] = {
+       { .parent = &sys_ck,      .rates = dpll_bypass_rates },
+       { .parent = &dpll5_m2_ck, .rates = dpll_locked_rates },
+       { .parent = NULL }
+};
+
+static struct clk omap_120m_fck = {
+       .name           = "omap_120m_fck",
+       .parent         = &dpll5_m2_ck,
+       .init           = &omap2_init_clksel_parent,
+       .clksel_reg     = OMAP_CM_REGADDR(PLL_MOD, CM_IDLEST2),
+       .clksel_mask    = OMAP3430ES2_ST_PERIPH2_CLK_MASK,
+       .clksel         = omap_120m_fck_clksel,
+       .flags          = CLOCK_IN_OMAP3430ES2 | RATE_PROPAGATES |
+                               PARENT_CONTROLS_CLOCK,
+       .recalc         = &omap2_clksel_recalc,
+};
+
+/* CM EXTERNAL CLOCK OUTPUTS */
+
+static const struct clksel_rate clkout2_src_core_rates[] = {
+       { .div = 1, .val = 0, .flags = RATE_IN_343X | DEFAULT_RATE },
+       { .div = 0 }
+};
+
+static const struct clksel_rate clkout2_src_sys_rates[] = {
+       { .div = 1, .val = 1, .flags = RATE_IN_343X | DEFAULT_RATE },
+       { .div = 0 }
+};
+
+static const struct clksel_rate clkout2_src_96m_rates[] = {
+       { .div = 1, .val = 2, .flags = RATE_IN_343X | DEFAULT_RATE },
+       { .div = 0 }
+};
+
+static const struct clksel_rate clkout2_src_54m_rates[] = {
+       { .div = 1, .val = 3, .flags = RATE_IN_343X | DEFAULT_RATE },
+       { .div = 0 }
+};
+
+static const struct clksel clkout2_src_clksel[] = {
+       { .parent = &core_ck,             .rates = clkout2_src_core_rates },
+       { .parent = &sys_ck,              .rates = clkout2_src_sys_rates },
+       { .parent = &omap_96m_alwon_fck,  .rates = clkout2_src_96m_rates },
+       { .parent = &omap_54m_fck,        .rates = clkout2_src_54m_rates },
+       { .parent = NULL }
+};
+
+static struct clk clkout2_src_ck = {
+       .name           = "clkout2_src_ck",
+       .init           = &omap2_init_clksel_parent,
+       .enable_reg     = OMAP3430_CM_CLKOUT_CTRL,
+       .enable_bit     = OMAP3430_CLKOUT2_EN_SHIFT,
+       .clksel_reg     = OMAP3430_CM_CLKOUT_CTRL,
+       .clksel_mask    = OMAP3430_CLKOUT2SOURCE_MASK,
+       .clksel         = clkout2_src_clksel,
+       .flags          = CLOCK_IN_OMAP343X | RATE_PROPAGATES,
+       .recalc         = &omap2_clksel_recalc,
+};
+
+static const struct clksel_rate sys_clkout2_rates[] = {
+       { .div = 1, .val = 0, .flags = RATE_IN_343X | DEFAULT_RATE },
+       { .div = 2, .val = 1, .flags = RATE_IN_343X },
+       { .div = 4, .val = 2, .flags = RATE_IN_343X },
+       { .div = 8, .val = 3, .flags = RATE_IN_343X },
+       { .div = 16, .val = 4, .flags = RATE_IN_343X },
+       { .div = 0 },
+};
+
+static const struct clksel sys_clkout2_clksel[] = {
+       { .parent = &clkout2_src_ck, .rates = sys_clkout2_rates },
+       { .parent = NULL },
+};
+
+static struct clk sys_clkout2 = {
+       .name           = "sys_clkout2",
+       .init           = &omap2_init_clksel_parent,
+       .clksel_reg     = OMAP3430_CM_CLKOUT_CTRL,
+       .clksel_mask    = OMAP3430_CLKOUT2_DIV_MASK,
+       .clksel         = sys_clkout2_clksel,
+       .flags          = CLOCK_IN_OMAP343X | PARENT_CONTROLS_CLOCK,
+       .recalc         = &omap2_clksel_recalc,
+};
+
+/* CM OUTPUT CLOCKS */
+
+static struct clk corex2_fck = {
+       .name           = "corex2_fck",
+       .parent         = &dpll3_m2x2_ck,
+       .flags          = CLOCK_IN_OMAP343X | RATE_PROPAGATES |
+                               PARENT_CONTROLS_CLOCK,
+       .recalc         = &followparent_recalc,
+};
+
+/* DPLL power domain clock controls */
+
+static const struct clksel div2_core_clksel[] = {
+       { .parent = &core_ck, .rates = div2_rates },
+       { .parent = NULL }
+};
+
+/*
+ * REVISIT: Are these in DPLL power domain or CM power domain? docs
+ * may be inconsistent here?
+ */
+static struct clk dpll1_fck = {
+       .name           = "dpll1_fck",
+       .parent         = &core_ck,
+       .init           = &omap2_init_clksel_parent,
+       .clksel_reg     = OMAP_CM_REGADDR(MPU_MOD, OMAP3430_CM_CLKSEL1_PLL),
+       .clksel_mask    = OMAP3430_MPU_CLK_SRC_MASK,
+       .clksel         = div2_core_clksel,
+       .flags          = CLOCK_IN_OMAP343X | RATE_PROPAGATES |
+                               PARENT_CONTROLS_CLOCK,
+       .recalc         = &omap2_clksel_recalc,
+};
+
+/*
+ * MPU clksel:
+ * If DPLL1 is locked, mpu_ck derives from DPLL1; otherwise, mpu_ck
+ * derives from the high-frequency bypass clock originating from DPLL3,
+ * called 'dpll1_fck'
+ */
+static const struct clksel mpu_clksel[] = {
+       { .parent = &dpll1_fck,     .rates = dpll_bypass_rates },
+       { .parent = &dpll1_x2m2_ck, .rates = dpll_locked_rates },
+       { .parent = NULL }
+};
+
+static struct clk mpu_ck = {
+       .name           = "mpu_ck",
+       .parent         = &dpll1_x2m2_ck,
+       .init           = &omap2_init_clksel_parent,
+       .clksel_reg     = OMAP_CM_REGADDR(MPU_MOD, OMAP3430_CM_IDLEST_PLL),
+       .clksel_mask    = OMAP3430_ST_MPU_CLK_MASK,
+       .clksel         = mpu_clksel,
+       .flags          = CLOCK_IN_OMAP343X | RATE_PROPAGATES |
+                               PARENT_CONTROLS_CLOCK,
+       .recalc         = &omap2_clksel_recalc,
+};
+
+/* arm_fck is divided by two when DPLL1 locked; otherwise, passthrough mpu_ck */
+static const struct clksel_rate arm_fck_rates[] = {
+       { .div = 1, .val = 0, .flags = RATE_IN_343X | DEFAULT_RATE },
+       { .div = 2, .val = 1, .flags = RATE_IN_343X },
+       { .div = 0 },
+};
+
+static const struct clksel arm_fck_clksel[] = {
+       { .parent = &mpu_ck, .rates = arm_fck_rates },
+       { .parent = NULL }
+};
+
+static struct clk arm_fck = {
+       .name           = "arm_fck",
+       .parent         = &mpu_ck,
+       .init           = &omap2_init_clksel_parent,
+       .clksel_reg     = OMAP_CM_REGADDR(MPU_MOD, OMAP3430_CM_IDLEST_PLL),
+       .clksel_mask    = OMAP3430_ST_MPU_CLK_MASK,
+       .clksel         = arm_fck_clksel,
+       .flags          = CLOCK_IN_OMAP343X | RATE_PROPAGATES |
+                               PARENT_CONTROLS_CLOCK,
+       .recalc         = &omap2_clksel_recalc,
+};
+
+/*
+ * REVISIT: This clock is never specifically defined in the 3430 TRM,
+ * although it is referenced - so this is a guess
+ */
+static struct clk emu_mpu_alwon_ck = {
+       .name           = "emu_mpu_alwon_ck",
+       .parent         = &mpu_ck,
+       .flags          = CLOCK_IN_OMAP343X | RATE_PROPAGATES |
+                               PARENT_CONTROLS_CLOCK,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk dpll2_fck = {
+       .name           = "dpll2_fck",
+       .parent         = &core_ck,
+       .init           = &omap2_init_clksel_parent,
+       .clksel_reg     = OMAP_CM_REGADDR(OMAP3430_IVA2_MOD, OMAP3430_CM_CLKSEL1_PLL),
+       .clksel_mask    = OMAP3430_IVA2_CLK_SRC_MASK,
+       .clksel         = div2_core_clksel,
+       .flags          = CLOCK_IN_OMAP343X | RATE_PROPAGATES |
+                               PARENT_CONTROLS_CLOCK,
+       .recalc         = &omap2_clksel_recalc,
+};
+
+/*
+ * IVA2 clksel:
+ * If DPLL2 is locked, iva2_ck derives from DPLL2; otherwise, iva2_ck
+ * derives from the high-frequency bypass clock originating from DPLL3,
+ * called 'dpll2_fck'
+ */
+
+static const struct clksel iva2_clksel[] = {
+       { .parent = &dpll2_fck,   .rates = dpll_bypass_rates },
+       { .parent = &dpll2_m2_ck, .rates = dpll_locked_rates },
+       { .parent = NULL }
+};
+
+static struct clk iva2_ck = {
+       .name           = "iva2_ck",
+       .parent         = &dpll2_m2_ck,
+       .init           = &omap2_init_clksel_parent,
+       .clksel_reg     = OMAP_CM_REGADDR(OMAP3430_IVA2_MOD,
+                                         OMAP3430_CM_IDLEST_PLL),
+       .clksel_mask    = OMAP3430_ST_IVA2_CLK_MASK,
+       .clksel         = iva2_clksel,
+       .flags          = CLOCK_IN_OMAP343X | RATE_PROPAGATES |
+                               PARENT_CONTROLS_CLOCK,
+       .recalc         = &omap2_clksel_recalc,
+};
+
+/* Common interface clocks */
+
+static struct clk l3_ick = {
+       .name           = "l3_ick",
+       .parent         = &core_ck,
+       .init           = &omap2_init_clksel_parent,
+       .clksel_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL),
+       .clksel_mask    = OMAP3430_CLKSEL_L3_MASK,
+       .clksel         = div2_core_clksel,
+       .flags          = CLOCK_IN_OMAP343X | RATE_PROPAGATES |
+                               PARENT_CONTROLS_CLOCK,
+       .recalc         = &omap2_clksel_recalc,
+};
+
+static const struct clksel div2_l3_clksel[] = {
+       { .parent = &l3_ick, .rates = div2_rates },
+       { .parent = NULL }
+};
+
+static struct clk l4_ick = {
+       .name           = "l4_ick",
+       .parent         = &l3_ick,
+       .init           = &omap2_init_clksel_parent,
+       .clksel_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL),
+       .clksel_mask    = OMAP3430_CLKSEL_L4_MASK,
+       .clksel         = div2_l3_clksel,
+       .flags          = CLOCK_IN_OMAP343X | RATE_PROPAGATES |
+                               PARENT_CONTROLS_CLOCK,
+       .recalc         = &omap2_clksel_recalc,
+
+};
+
+static const struct clksel div2_l4_clksel[] = {
+       { .parent = &l4_ick, .rates = div2_rates },
+       { .parent = NULL }
+};
+
+static struct clk rm_ick = {
+       .name           = "rm_ick",
+       .parent         = &l4_ick,
+       .init           = &omap2_init_clksel_parent,
+       .clksel_reg     = OMAP_CM_REGADDR(WKUP_MOD, CM_CLKSEL),
+       .clksel_mask    = OMAP3430_CLKSEL_RM_MASK,
+       .clksel         = div2_l4_clksel,
+       .flags          = CLOCK_IN_OMAP343X | PARENT_CONTROLS_CLOCK,
+       .recalc         = &omap2_clksel_recalc,
+};
+
+/* GFX power domain */
+
+/* GFX clocks are in 3430ES1 only. 3430ES2 and later uses the SGX instead */
+
+static const struct clksel gfx_l3_clksel[] = {
+       { .parent = &l3_ick, .rates = gfx_l3_rates },
+       { .parent = NULL }
+};
+
+static struct clk gfx_l3_fck = {
+       .name           = "gfx_l3_fck",
+       .parent         = &l3_ick,
+       .init           = &omap2_init_clksel_parent,
+       .enable_reg     = OMAP_CM_REGADDR(GFX_MOD, CM_ICLKEN),
+       .enable_bit     = OMAP_EN_GFX_SHIFT,
+       .clksel_reg     = OMAP_CM_REGADDR(GFX_MOD, CM_CLKSEL),
+       .clksel_mask    = OMAP_CLKSEL_GFX_MASK,
+       .clksel         = gfx_l3_clksel,
+       .flags          = CLOCK_IN_OMAP3430ES1 | RATE_PROPAGATES,
+       .recalc         = &omap2_clksel_recalc,
+};
+
+static struct clk gfx_l3_ick = {
+       .name           = "gfx_l3_ick",
+       .parent         = &l3_ick,
+       .enable_reg     = OMAP_CM_REGADDR(GFX_MOD, CM_ICLKEN),
+       .enable_bit     = OMAP_EN_GFX_SHIFT,
+       .flags          = CLOCK_IN_OMAP3430ES1,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk gfx_cg1_ck = {
+       .name           = "gfx_cg1_ck",
+       .parent         = &gfx_l3_fck, /* REVISIT: correct? */
+       .enable_reg     = OMAP_CM_REGADDR(GFX_MOD, CM_FCLKEN),
+       .enable_bit     = OMAP3430ES1_EN_2D_SHIFT,
+       .flags          = CLOCK_IN_OMAP3430ES1,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk gfx_cg2_ck = {
+       .name           = "gfx_cg2_ck",
+       .parent         = &gfx_l3_fck, /* REVISIT: correct? */
+       .enable_reg     = OMAP_CM_REGADDR(GFX_MOD, CM_FCLKEN),
+       .enable_bit     = OMAP3430ES1_EN_3D_SHIFT,
+       .flags          = CLOCK_IN_OMAP3430ES1,
+       .recalc         = &followparent_recalc,
+};
+
+/* SGX power domain - 3430ES2 only */
+
+static const struct clksel_rate sgx_core_rates[] = {
+       { .div = 3, .val = 0, .flags = RATE_IN_343X | DEFAULT_RATE },
+       { .div = 4, .val = 1, .flags = RATE_IN_343X },
+       { .div = 6, .val = 2, .flags = RATE_IN_343X },
+       { .div = 0 },
+};
+
+static const struct clksel_rate sgx_96m_rates[] = {
+       { .div = 1,  .val = 3, .flags = RATE_IN_343X | DEFAULT_RATE },
+       { .div = 0 },
+};
+
+static const struct clksel sgx_clksel[] = {
+       { .parent = &core_ck,    .rates = sgx_core_rates },
+       { .parent = &cm_96m_fck, .rates = sgx_96m_rates },
+       { .parent = NULL },
+};
+
+static struct clk sgx_fck = {
+       .name           = "sgx_fck",
+       .init           = &omap2_init_clksel_parent,
+       .enable_reg     = OMAP_CM_REGADDR(OMAP3430ES2_SGX_MOD, CM_FCLKEN),
+       .enable_bit     = OMAP3430ES2_EN_SGX_SHIFT,
+       .clksel_reg     = OMAP_CM_REGADDR(OMAP3430ES2_SGX_MOD, CM_CLKSEL),
+       .clksel_mask    = OMAP3430ES2_CLKSEL_SGX_MASK,
+       .clksel         = sgx_clksel,
+       .flags          = CLOCK_IN_OMAP3430ES2,
+       .recalc         = &omap2_clksel_recalc,
+};
+
+static struct clk sgx_ick = {
+       .name           = "sgx_ick",
+       .parent         = &l3_ick,
+       .enable_reg     = OMAP_CM_REGADDR(OMAP3430ES2_SGX_MOD, CM_ICLKEN),
+       .enable_bit     = OMAP3430ES2_EN_SGX_SHIFT,
+       .flags          = CLOCK_IN_OMAP3430ES2,
+       .recalc         = &followparent_recalc,
+};
+
+/* CORE power domain */
+
+static struct clk d2d_26m_fck = {
+       .name           = "d2d_26m_fck",
+       .parent         = &sys_ck,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
+       .enable_bit     = OMAP3430ES1_EN_D2D_SHIFT,
+       .flags          = CLOCK_IN_OMAP3430ES1,
+       .recalc         = &followparent_recalc,
+};
+
+static const struct clksel omap343x_gpt_clksel[] = {
+       { .parent = &omap_32k_fck, .rates = gpt_32k_rates },
+       { .parent = &sys_ck,       .rates = gpt_sys_rates },
+       { .parent = NULL}
+};
+
+static struct clk gpt10_fck = {
+       .name           = "gpt10_fck",
+       .parent         = &sys_ck,
+       .init           = &omap2_init_clksel_parent,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
+       .enable_bit     = OMAP3430_EN_GPT10_SHIFT,
+       .clksel_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL),
+       .clksel_mask    = OMAP3430_CLKSEL_GPT10_MASK,
+       .clksel         = omap343x_gpt_clksel,
+       .flags          = CLOCK_IN_OMAP343X,
+       .recalc         = &omap2_clksel_recalc,
+};
+
+static struct clk gpt11_fck = {
+       .name           = "gpt11_fck",
+       .parent         = &sys_ck,
+       .init           = &omap2_init_clksel_parent,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
+       .enable_bit     = OMAP3430_EN_GPT11_SHIFT,
+       .clksel_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL),
+       .clksel_mask    = OMAP3430_CLKSEL_GPT11_MASK,
+       .clksel         = omap343x_gpt_clksel,
+       .flags          = CLOCK_IN_OMAP343X,
+       .recalc         = &omap2_clksel_recalc,
+};
+
+static struct clk cpefuse_fck = {
+       .name           = "cpefuse_fck",
+       .parent         = &sys_ck,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, OMAP3430ES2_CM_FCLKEN3),
+       .enable_bit     = OMAP3430ES2_EN_CPEFUSE_SHIFT,
+       .flags          = CLOCK_IN_OMAP3430ES2,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk ts_fck = {
+       .name           = "ts_fck",
+       .parent         = &omap_32k_fck,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, OMAP3430ES2_CM_FCLKEN3),
+       .enable_bit     = OMAP3430ES2_EN_TS_SHIFT,
+       .flags          = CLOCK_IN_OMAP3430ES2,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk usbtll_fck = {
+       .name           = "usbtll_fck",
+       .parent         = &omap_120m_fck,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, OMAP3430ES2_CM_FCLKEN3),
+       .enable_bit     = OMAP3430ES2_EN_USBTLL_SHIFT,
+       .flags          = CLOCK_IN_OMAP3430ES2,
+       .recalc         = &followparent_recalc,
+};
+
+/* CORE 96M FCLK-derived clocks */
+
+static struct clk core_96m_fck = {
+       .name           = "core_96m_fck",
+       .parent         = &omap_96m_fck,
+       .flags          = CLOCK_IN_OMAP343X | RATE_PROPAGATES |
+                               PARENT_CONTROLS_CLOCK,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk mmchs3_fck = {
+       .name           = "mmchs_fck",
+       .id             = 3,
+       .parent         = &core_96m_fck,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
+       .enable_bit     = OMAP3430ES2_EN_MMC3_SHIFT,
+       .flags          = CLOCK_IN_OMAP3430ES2,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk mmchs2_fck = {
+       .name           = "mmchs_fck",
+       .id             = 2,
+       .parent         = &core_96m_fck,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
+       .enable_bit     = OMAP3430_EN_MMC2_SHIFT,
+       .flags          = CLOCK_IN_OMAP343X,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk mspro_fck = {
+       .name           = "mspro_fck",
+       .parent         = &core_96m_fck,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
+       .enable_bit     = OMAP3430_EN_MSPRO_SHIFT,
+       .flags          = CLOCK_IN_OMAP343X,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk mmchs1_fck = {
+       .name           = "mmchs_fck",
+       .id             = 1,
+       .parent         = &core_96m_fck,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
+       .enable_bit     = OMAP3430_EN_MMC1_SHIFT,
+       .flags          = CLOCK_IN_OMAP343X,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk i2c3_fck = {
+       .name           = "i2c_fck",
+       .id             = 3,
+       .parent         = &core_96m_fck,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
+       .enable_bit     = OMAP3430_EN_I2C3_SHIFT,
+       .flags          = CLOCK_IN_OMAP343X,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk i2c2_fck = {
+       .name           = "i2c_fck",
+       .id             = 2,
+       .parent         = &core_96m_fck,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
+       .enable_bit     = OMAP3430_EN_I2C2_SHIFT,
+       .flags          = CLOCK_IN_OMAP343X,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk i2c1_fck = {
+       .name           = "i2c_fck",
+       .id             = 1,
+       .parent         = &core_96m_fck,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
+       .enable_bit     = OMAP3430_EN_I2C1_SHIFT,
+       .flags          = CLOCK_IN_OMAP343X,
+       .recalc         = &followparent_recalc,
+};
+
+/*
+ * MCBSP 1 & 5 get their 96MHz clock from core_96m_fck;
+ * MCBSP 2, 3, 4 get their 96MHz clock from per_96m_fck.
+ */
+static const struct clksel_rate common_mcbsp_96m_rates[] = {
+       { .div = 1, .val = 0, .flags = RATE_IN_343X | DEFAULT_RATE },
+       { .div = 0 }
+};
+
+static const struct clksel_rate common_mcbsp_mcbsp_rates[] = {
+       { .div = 1, .val = 1, .flags = RATE_IN_343X | DEFAULT_RATE },
+       { .div = 0 }
+};
+
+static const struct clksel mcbsp_15_clksel[] = {
+       { .parent = &core_96m_fck, .rates = common_mcbsp_96m_rates },
+       { .parent = &mcbsp_clks,   .rates = common_mcbsp_mcbsp_rates },
+       { .parent = NULL }
+};
+
+static struct clk mcbsp5_fck = {
+       .name           = "mcbsp5_fck",
+       .init           = &omap2_init_clksel_parent,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
+       .enable_bit     = OMAP3430_EN_MCBSP5_SHIFT,
+       .clksel_reg     = OMAP343X_CTRL_REGADDR(OMAP343X_CONTROL_DEVCONF1),
+       .clksel_mask    = OMAP2_MCBSP5_CLKS_MASK,
+       .clksel         = mcbsp_15_clksel,
+       .flags          = CLOCK_IN_OMAP343X,
+       .recalc         = &omap2_clksel_recalc,
+};
+
+static struct clk mcbsp1_fck = {
+       .name           = "mcbsp1_fck",
+       .init           = &omap2_init_clksel_parent,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
+       .enable_bit     = OMAP3430_EN_MCBSP1_SHIFT,
+       .clksel_reg     = OMAP343X_CTRL_REGADDR(OMAP2_CONTROL_DEVCONF0),
+       .clksel_mask    = OMAP2_MCBSP1_CLKS_MASK,
+       .clksel         = mcbsp_15_clksel,
+       .flags          = CLOCK_IN_OMAP343X,
+       .recalc         = &omap2_clksel_recalc,
+};
+
+/* CORE_48M_FCK-derived clocks */
+
+static struct clk core_48m_fck = {
+       .name           = "core_48m_fck",
+       .parent         = &omap_48m_fck,
+       .flags          = CLOCK_IN_OMAP343X | RATE_PROPAGATES |
+                               PARENT_CONTROLS_CLOCK,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk mcspi4_fck = {
+       .name           = "mcspi_fck",
+       .id             = 4,
+       .parent         = &core_48m_fck,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
+       .enable_bit     = OMAP3430_EN_MCSPI4_SHIFT,
+       .flags          = CLOCK_IN_OMAP343X,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk mcspi3_fck = {
+       .name           = "mcspi_fck",
+       .id             = 3,
+       .parent         = &core_48m_fck,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
+       .enable_bit     = OMAP3430_EN_MCSPI3_SHIFT,
+       .flags          = CLOCK_IN_OMAP343X,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk mcspi2_fck = {
+       .name           = "mcspi_fck",
+       .id             = 2,
+       .parent         = &core_48m_fck,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
+       .enable_bit     = OMAP3430_EN_MCSPI2_SHIFT,
+       .flags          = CLOCK_IN_OMAP343X,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk mcspi1_fck = {
+       .name           = "mcspi_fck",
+       .id             = 1,
+       .parent         = &core_48m_fck,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
+       .enable_bit     = OMAP3430_EN_MCSPI1_SHIFT,
+       .flags          = CLOCK_IN_OMAP343X,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk uart2_fck = {
+       .name           = "uart2_fck",
+       .parent         = &core_48m_fck,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
+       .enable_bit     = OMAP3430_EN_UART2_SHIFT,
+       .flags          = CLOCK_IN_OMAP343X,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk uart1_fck = {
+       .name           = "uart1_fck",
+       .parent         = &core_48m_fck,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
+       .enable_bit     = OMAP3430_EN_UART1_SHIFT,
+       .flags          = CLOCK_IN_OMAP343X,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk fshostusb_fck = {
+       .name           = "fshostusb_fck",
+       .parent         = &core_48m_fck,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
+       .enable_bit     = OMAP3430ES1_EN_FSHOSTUSB_SHIFT,
+       .flags          = CLOCK_IN_OMAP3430ES1,
+       .recalc         = &followparent_recalc,
+};
+
+/* CORE_12M_FCK based clocks */
+
+static struct clk core_12m_fck = {
+       .name           = "core_12m_fck",
+       .parent         = &omap_12m_fck,
+       .flags          = CLOCK_IN_OMAP343X | RATE_PROPAGATES |
+                               PARENT_CONTROLS_CLOCK,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk hdq_fck = {
+       .name           = "hdq_fck",
+       .parent         = &core_12m_fck,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
+       .enable_bit     = OMAP3430_EN_HDQ_SHIFT,
+       .flags          = CLOCK_IN_OMAP343X,
+       .recalc         = &followparent_recalc,
+};
+
+/* DPLL3-derived clock */
+
+static const struct clksel_rate ssi_ssr_corex2_rates[] = {
+       { .div = 1, .val = 1, .flags = RATE_IN_343X | DEFAULT_RATE },
+       { .div = 2, .val = 2, .flags = RATE_IN_343X },
+       { .div = 3, .val = 3, .flags = RATE_IN_343X },
+       { .div = 4, .val = 4, .flags = RATE_IN_343X },
+       { .div = 6, .val = 6, .flags = RATE_IN_343X },
+       { .div = 8, .val = 8, .flags = RATE_IN_343X },
+       { .div = 0 }
+};
+
+static const struct clksel ssi_ssr_clksel[] = {
+       { .parent = &corex2_fck, .rates = ssi_ssr_corex2_rates },
+       { .parent = NULL }
+};
+
+static struct clk ssi_ssr_fck = {
+       .name           = "ssi_ssr_fck",
+       .init           = &omap2_init_clksel_parent,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
+       .enable_bit     = OMAP3430_EN_SSI_SHIFT,
+       .clksel_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL),
+       .clksel_mask    = OMAP3430_CLKSEL_SSI_MASK,
+       .clksel         = ssi_ssr_clksel,
+       .flags          = CLOCK_IN_OMAP343X | RATE_PROPAGATES,
+       .recalc         = &omap2_clksel_recalc,
+};
+
+static struct clk ssi_sst_fck = {
+       .name           = "ssi_sst_fck",
+       .parent         = &ssi_ssr_fck,
+       .fixed_div      = 2,
+       .flags          = CLOCK_IN_OMAP343X | PARENT_CONTROLS_CLOCK,
+       .recalc         = &omap2_fixed_divisor_recalc,
+};
+
+
+
+/* CORE_L3_ICK based clocks */
+
+static struct clk core_l3_ick = {
+       .name           = "core_l3_ick",
+       .parent         = &l3_ick,
+       .flags          = CLOCK_IN_OMAP343X | RATE_PROPAGATES |
+                               PARENT_CONTROLS_CLOCK,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk hsotgusb_ick = {
+       .name           = "hsotgusb_ick",
+       .parent         = &core_l3_ick,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
+       .enable_bit     = OMAP3430_EN_HSOTGUSB_SHIFT,
+       .flags          = CLOCK_IN_OMAP343X,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk sdrc_ick = {
+       .name           = "sdrc_ick",
+       .parent         = &core_l3_ick,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
+       .enable_bit     = OMAP3430_EN_SDRC_SHIFT,
+       .flags          = CLOCK_IN_OMAP343X | ENABLE_ON_INIT,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk gpmc_fck = {
+       .name           = "gpmc_fck",
+       .parent         = &core_l3_ick,
+       .flags          = CLOCK_IN_OMAP343X | PARENT_CONTROLS_CLOCK |
+                               ENABLE_ON_INIT,
+       .recalc         = &followparent_recalc,
+};
+
+/* SECURITY_L3_ICK based clocks */
+
+static struct clk security_l3_ick = {
+       .name           = "security_l3_ick",
+       .parent         = &l3_ick,
+       .flags          = CLOCK_IN_OMAP343X | RATE_PROPAGATES |
+                               PARENT_CONTROLS_CLOCK,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk pka_ick = {
+       .name           = "pka_ick",
+       .parent         = &security_l3_ick,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
+       .enable_bit     = OMAP3430_EN_PKA_SHIFT,
+       .flags          = CLOCK_IN_OMAP343X,
+       .recalc         = &followparent_recalc,
+};
+
+/* CORE_L4_ICK based clocks */
+
+static struct clk core_l4_ick = {
+       .name           = "core_l4_ick",
+       .parent         = &l4_ick,
+       .flags          = CLOCK_IN_OMAP343X | RATE_PROPAGATES |
+                               PARENT_CONTROLS_CLOCK,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk usbtll_ick = {
+       .name           = "usbtll_ick",
+       .parent         = &core_l4_ick,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN3),
+       .enable_bit     = OMAP3430ES2_EN_USBTLL_SHIFT,
+       .flags          = CLOCK_IN_OMAP3430ES2,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk mmchs3_ick = {
+       .name           = "mmchs_ick",
+       .id             = 3,
+       .parent         = &core_l4_ick,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
+       .enable_bit     = OMAP3430ES2_EN_MMC3_SHIFT,
+       .flags          = CLOCK_IN_OMAP3430ES2,
+       .recalc         = &followparent_recalc,
+};
+
+/* Intersystem Communication Registers - chassis mode only */
+static struct clk icr_ick = {
+       .name           = "icr_ick",
+       .parent         = &core_l4_ick,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
+       .enable_bit     = OMAP3430_EN_ICR_SHIFT,
+       .flags          = CLOCK_IN_OMAP343X,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk aes2_ick = {
+       .name           = "aes2_ick",
+       .parent         = &core_l4_ick,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
+       .enable_bit     = OMAP3430_EN_AES2_SHIFT,
+       .flags          = CLOCK_IN_OMAP343X,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk sha12_ick = {
+       .name           = "sha12_ick",
+       .parent         = &core_l4_ick,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
+       .enable_bit     = OMAP3430_EN_SHA12_SHIFT,
+       .flags          = CLOCK_IN_OMAP343X,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk des2_ick = {
+       .name           = "des2_ick",
+       .parent         = &core_l4_ick,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
+       .enable_bit     = OMAP3430_EN_DES2_SHIFT,
+       .flags          = CLOCK_IN_OMAP343X,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk mmchs2_ick = {
+       .name           = "mmchs_ick",
+       .id             = 2,
+       .parent         = &core_l4_ick,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
+       .enable_bit     = OMAP3430_EN_MMC2_SHIFT,
+       .flags          = CLOCK_IN_OMAP343X,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk mmchs1_ick = {
+       .name           = "mmchs_ick",
+       .id             = 1,
+       .parent         = &core_l4_ick,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
+       .enable_bit     = OMAP3430_EN_MMC1_SHIFT,
+       .flags          = CLOCK_IN_OMAP343X,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk mspro_ick = {
+       .name           = "mspro_ick",
+       .parent         = &core_l4_ick,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
+       .enable_bit     = OMAP3430_EN_MSPRO_SHIFT,
+       .flags          = CLOCK_IN_OMAP343X,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk hdq_ick = {
+       .name           = "hdq_ick",
+       .parent         = &core_l4_ick,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
+       .enable_bit     = OMAP3430_EN_HDQ_SHIFT,
+       .flags          = CLOCK_IN_OMAP343X,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk mcspi4_ick = {
+       .name           = "mcspi_ick",
+       .id             = 4,
+       .parent         = &core_l4_ick,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
+       .enable_bit     = OMAP3430_EN_MCSPI4_SHIFT,
+       .flags          = CLOCK_IN_OMAP343X,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk mcspi3_ick = {
+       .name           = "mcspi_ick",
+       .id             = 3,
+       .parent         = &core_l4_ick,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
+       .enable_bit     = OMAP3430_EN_MCSPI3_SHIFT,
+       .flags          = CLOCK_IN_OMAP343X,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk mcspi2_ick = {
+       .name           = "mcspi_ick",
+       .id             = 2,
+       .parent         = &core_l4_ick,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
+       .enable_bit     = OMAP3430_EN_MCSPI2_SHIFT,
+       .flags          = CLOCK_IN_OMAP343X,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk mcspi1_ick = {
+       .name           = "mcspi_ick",
+       .id             = 1,
+       .parent         = &core_l4_ick,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
+       .enable_bit     = OMAP3430_EN_MCSPI1_SHIFT,
+       .flags          = CLOCK_IN_OMAP343X,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk i2c3_ick = {
+       .name           = "i2c_ick",
+       .id             = 3,
+       .parent         = &core_l4_ick,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
+       .enable_bit     = OMAP3430_EN_I2C3_SHIFT,
+       .flags          = CLOCK_IN_OMAP343X,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk i2c2_ick = {
+       .name           = "i2c_ick",
+       .id             = 2,
+       .parent         = &core_l4_ick,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
+       .enable_bit     = OMAP3430_EN_I2C2_SHIFT,
+       .flags          = CLOCK_IN_OMAP343X,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk i2c1_ick = {
+       .name           = "i2c_ick",
+       .id             = 1,
+       .parent         = &core_l4_ick,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
+       .enable_bit     = OMAP3430_EN_I2C1_SHIFT,
+       .flags          = CLOCK_IN_OMAP343X,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk uart2_ick = {
+       .name           = "uart2_ick",
+       .parent         = &core_l4_ick,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
+       .enable_bit     = OMAP3430_EN_UART2_SHIFT,
+       .flags          = CLOCK_IN_OMAP343X,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk uart1_ick = {
+       .name           = "uart1_ick",
+       .parent         = &core_l4_ick,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
+       .enable_bit     = OMAP3430_EN_UART1_SHIFT,
+       .flags          = CLOCK_IN_OMAP343X,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk gpt11_ick = {
+       .name           = "gpt11_ick",
+       .parent         = &core_l4_ick,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
+       .enable_bit     = OMAP3430_EN_GPT11_SHIFT,
+       .flags          = CLOCK_IN_OMAP343X,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk gpt10_ick = {
+       .name           = "gpt10_ick",
+       .parent         = &core_l4_ick,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
+       .enable_bit     = OMAP3430_EN_GPT10_SHIFT,
+       .flags          = CLOCK_IN_OMAP343X,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk mcbsp5_ick = {
+       .name           = "mcbsp5_ick",
+       .parent         = &core_l4_ick,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
+       .enable_bit     = OMAP3430_EN_MCBSP5_SHIFT,
+       .flags          = CLOCK_IN_OMAP343X,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk mcbsp1_ick = {
+       .name           = "mcbsp1_ick",
+       .parent         = &core_l4_ick,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
+       .enable_bit     = OMAP3430_EN_MCBSP1_SHIFT,
+       .flags          = CLOCK_IN_OMAP343X,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk fac_ick = {
+       .name           = "fac_ick",
+       .parent         = &core_l4_ick,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
+       .enable_bit     = OMAP3430ES1_EN_FAC_SHIFT,
+       .flags          = CLOCK_IN_OMAP3430ES1,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk mailboxes_ick = {
+       .name           = "mailboxes_ick",
+       .parent         = &core_l4_ick,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
+       .enable_bit     = OMAP3430_EN_MAILBOXES_SHIFT,
+       .flags          = CLOCK_IN_OMAP343X,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk omapctrl_ick = {
+       .name           = "omapctrl_ick",
+       .parent         = &core_l4_ick,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
+       .enable_bit     = OMAP3430_EN_OMAPCTRL_SHIFT,
+       .flags          = CLOCK_IN_OMAP343X | ENABLE_ON_INIT,
+       .recalc         = &followparent_recalc,
+};
+
+/* SSI_L4_ICK based clocks */
+
+static struct clk ssi_l4_ick = {
+       .name           = "ssi_l4_ick",
+       .parent         = &l4_ick,
+       .flags          = CLOCK_IN_OMAP343X | RATE_PROPAGATES,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk ssi_ick = {
+       .name           = "ssi_ick",
+       .parent         = &ssi_l4_ick,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
+       .enable_bit     = OMAP3430_EN_SSI_SHIFT,
+       .flags          = CLOCK_IN_OMAP343X,
+       .recalc         = &followparent_recalc,
+};
+
+/* REVISIT: Technically the TRM claims that this is CORE_CLK based,
+ * but l4_ick makes more sense to me */
+
+static const struct clksel usb_l4_clksel[] = {
+       { .parent = &l4_ick, .rates = div2_rates },
+       { .parent = NULL },
+};
+
+static struct clk usb_l4_ick = {
+       .name           = "usb_l4_ick",
+       .parent         = &l4_ick,
+       .init           = &omap2_init_clksel_parent,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
+       .enable_bit     = OMAP3430ES1_EN_FSHOSTUSB_SHIFT,
+       .clksel_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL),
+       .clksel_mask    = OMAP3430ES1_CLKSEL_FSHOSTUSB_MASK,
+       .clksel         = usb_l4_clksel,
+       .flags          = CLOCK_IN_OMAP3430ES1,
+       .recalc         = &omap2_clksel_recalc,
+};
+
+/* XXX MDM_INTC_ICK, SAD2D_ICK ?? */
+
+/* SECURITY_L4_ICK2 based clocks */
+
+static struct clk security_l4_ick2 = {
+       .name           = "security_l4_ick2",
+       .parent         = &l4_ick,
+       .flags          = CLOCK_IN_OMAP343X | RATE_PROPAGATES |
+                               PARENT_CONTROLS_CLOCK,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk aes1_ick = {
+       .name           = "aes1_ick",
+       .parent         = &security_l4_ick2,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
+       .enable_bit     = OMAP3430_EN_AES1_SHIFT,
+       .flags          = CLOCK_IN_OMAP343X,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk rng_ick = {
+       .name           = "rng_ick",
+       .parent         = &security_l4_ick2,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
+       .enable_bit     = OMAP3430_EN_RNG_SHIFT,
+       .flags          = CLOCK_IN_OMAP343X,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk sha11_ick = {
+       .name           = "sha11_ick",
+       .parent         = &security_l4_ick2,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
+       .enable_bit     = OMAP3430_EN_SHA11_SHIFT,
+       .flags          = CLOCK_IN_OMAP343X,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk des1_ick = {
+       .name           = "des1_ick",
+       .parent         = &security_l4_ick2,
+       .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
+       .enable_bit     = OMAP3430_EN_DES1_SHIFT,
+       .flags          = CLOCK_IN_OMAP343X,
+       .recalc         = &followparent_recalc,
+};
+
+/* DSS */
+static const struct clksel dss1_alwon_fck_clksel[] = {
+       { .parent = &sys_ck,        .rates = dpll_bypass_rates },
+       { .parent = &dpll4_m4x2_ck, .rates = dpll_locked_rates },
+       { .parent = NULL }
+};
+
+static struct clk dss1_alwon_fck = {
+       .name           = "dss1_alwon_fck",
+       .parent         = &dpll4_m4x2_ck,
+       .init           = &omap2_init_clksel_parent,
+       .enable_reg     = OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_FCLKEN),
+       .enable_bit     = OMAP3430_EN_DSS1_SHIFT,
+       .clksel_reg     = OMAP_CM_REGADDR(PLL_MOD, CM_IDLEST),
+       .clksel_mask    = OMAP3430_ST_PERIPH_CLK,
+       .clksel         = dss1_alwon_fck_clksel,
+       .flags          = CLOCK_IN_OMAP343X,
+       .recalc         = &omap2_clksel_recalc,
+};
+
+static struct clk dss_tv_fck = {
+       .name           = "dss_tv_fck",
+       .parent         = &omap_54m_fck,
+       .enable_reg     = OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_FCLKEN),
+       .enable_bit     = OMAP3430_EN_TV_SHIFT,
+       .flags          = CLOCK_IN_OMAP343X,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk dss_96m_fck = {
+       .name           = "dss_96m_fck",
+       .parent         = &omap_96m_fck,
+       .enable_reg     = OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_FCLKEN),
+       .enable_bit     = OMAP3430_EN_TV_SHIFT,
+       .flags          = CLOCK_IN_OMAP343X,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk dss2_alwon_fck = {
+       .name           = "dss2_alwon_fck",
+       .parent         = &sys_ck,
+       .enable_reg     = OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_FCLKEN),
+       .enable_bit     = OMAP3430_EN_DSS2_SHIFT,
+       .flags          = CLOCK_IN_OMAP343X,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk dss_ick = {
+       /* Handles both L3 and L4 clocks */
+       .name           = "dss_ick",
+       .parent         = &l4_ick,
+       .enable_reg     = OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_ICLKEN),
+       .enable_bit     = OMAP3430_CM_ICLKEN_DSS_EN_DSS_SHIFT,
+       .flags          = CLOCK_IN_OMAP343X,
+       .recalc         = &followparent_recalc,
+};
+
+/* CAM */
+
+static const struct clksel cam_mclk_clksel[] = {
+       { .parent = &sys_ck,        .rates = dpll_bypass_rates },
+       { .parent = &dpll4_m5x2_ck, .rates = dpll_locked_rates },
+       { .parent = NULL }
+};
+
+static struct clk cam_mclk = {
+       .name           = "cam_mclk",
+       .parent         = &dpll4_m5x2_ck,
+       .init           = &omap2_init_clksel_parent,
+       .clksel_reg     = OMAP_CM_REGADDR(PLL_MOD, CM_IDLEST),
+       .clksel_mask    = OMAP3430_ST_PERIPH_CLK,
+       .clksel         = cam_mclk_clksel,
+       .enable_reg     = OMAP_CM_REGADDR(OMAP3430_CAM_MOD, CM_FCLKEN),
+       .enable_bit     = OMAP3430_EN_CAM_SHIFT,
+       .flags          = CLOCK_IN_OMAP343X,
+       .recalc         = &omap2_clksel_recalc,
+};
+
+static struct clk cam_l3_ick = {
+       .name           = "cam_l3_ick",
+       .parent         = &l3_ick,
+       .enable_reg     = OMAP_CM_REGADDR(OMAP3430_CAM_MOD, CM_ICLKEN),
+       .enable_bit     = OMAP3430_EN_CAM_SHIFT,
+       .flags          = CLOCK_IN_OMAP343X,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk cam_l4_ick = {
+       .name           = "cam_l4_ick",
+       .parent         = &l4_ick,
+       .enable_reg     = OMAP_CM_REGADDR(OMAP3430_CAM_MOD, CM_ICLKEN),
+       .enable_bit     = OMAP3430_EN_CAM_SHIFT,
+       .flags          = CLOCK_IN_OMAP343X,
+       .recalc         = &followparent_recalc,
+};
+
+/* USBHOST - 3430ES2 only */
+
+static struct clk usbhost_120m_fck = {
+       .name           = "usbhost_120m_fck",
+       .parent         = &omap_120m_fck,
+       .enable_reg     = OMAP_CM_REGADDR(OMAP3430ES2_USBHOST_MOD, CM_FCLKEN),
+       .enable_bit     = OMAP3430ES2_EN_USBHOST2_SHIFT,
+       .flags          = CLOCK_IN_OMAP3430ES2,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk usbhost_48m_fck = {
+       .name           = "usbhost_48m_fck",
+       .parent         = &omap_48m_fck,
+       .enable_reg     = OMAP_CM_REGADDR(OMAP3430ES2_USBHOST_MOD, CM_FCLKEN),
+       .enable_bit     = OMAP3430ES2_EN_USBHOST1_SHIFT,
+       .flags          = CLOCK_IN_OMAP3430ES2,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk usbhost_l3_ick = {
+       .name           = "usbhost_l3_ick",
+       .parent         = &l3_ick,
+       .enable_reg     = OMAP_CM_REGADDR(OMAP3430ES2_USBHOST_MOD, CM_ICLKEN),
+       .enable_bit     = OMAP3430ES2_EN_USBHOST_SHIFT,
+       .flags          = CLOCK_IN_OMAP3430ES2,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk usbhost_l4_ick = {
+       .name           = "usbhost_l4_ick",
+       .parent         = &l4_ick,
+       .enable_reg     = OMAP_CM_REGADDR(OMAP3430ES2_USBHOST_MOD, CM_ICLKEN),
+       .enable_bit     = OMAP3430ES2_EN_USBHOST_SHIFT,
+       .flags          = CLOCK_IN_OMAP3430ES2,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk usbhost_sar_fck = {
+       .name           = "usbhost_sar_fck",
+       .parent         = &osc_sys_ck,
+       .enable_reg     = OMAP_PRM_REGADDR(OMAP3430ES2_USBHOST_MOD, PM_PWSTCTRL),
+       .enable_bit     = OMAP3430ES2_SAVEANDRESTORE_SHIFT,
+       .flags          = CLOCK_IN_OMAP3430ES2,
+       .recalc         = &followparent_recalc,
+};
+
+/* WKUP */
+
+static const struct clksel_rate usim_96m_rates[] = {
+       { .div = 2,  .val = 3, .flags = RATE_IN_343X | DEFAULT_RATE },
+       { .div = 4,  .val = 4, .flags = RATE_IN_343X },
+       { .div = 8,  .val = 5, .flags = RATE_IN_343X },
+       { .div = 10, .val = 6, .flags = RATE_IN_343X },
+       { .div = 0 },
+};
+
+static const struct clksel_rate usim_120m_rates[] = {
+       { .div = 4,  .val = 7,  .flags = RATE_IN_343X | DEFAULT_RATE },
+       { .div = 8,  .val = 8,  .flags = RATE_IN_343X },
+       { .div = 16, .val = 9,  .flags = RATE_IN_343X },
+       { .div = 20, .val = 10, .flags = RATE_IN_343X },
+       { .div = 0 },
+};
+
+static const struct clksel usim_clksel[] = {
+       { .parent = &omap_96m_fck,      .rates = usim_96m_rates },
+       { .parent = &omap_120m_fck,     .rates = usim_120m_rates },
+       { .parent = &sys_ck,            .rates = div2_rates },
+       { .parent = NULL },
+};
+
+/* 3430ES2 only */
+static struct clk usim_fck = {
+       .name           = "usim_fck",
+       .init           = &omap2_init_clksel_parent,
+       .enable_reg     = OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN),
+       .enable_bit     = OMAP3430ES2_EN_USIMOCP_SHIFT,
+       .clksel_reg     = OMAP_CM_REGADDR(WKUP_MOD, CM_CLKSEL),
+       .clksel_mask    = OMAP3430ES2_CLKSEL_USIMOCP_MASK,
+       .clksel         = usim_clksel,
+       .flags          = CLOCK_IN_OMAP3430ES2,
+       .recalc         = &omap2_clksel_recalc,
+};
+
+static struct clk gpt1_fck = {
+       .name           = "gpt1_fck",
+       .init           = &omap2_init_clksel_parent,
+       .enable_reg     = OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN),
+       .enable_bit     = OMAP3430_EN_GPT1_SHIFT,
+       .clksel_reg     = OMAP_CM_REGADDR(WKUP_MOD, CM_CLKSEL),
+       .clksel_mask    = OMAP3430_CLKSEL_GPT1_MASK,
+       .clksel         = omap343x_gpt_clksel,
+       .flags          = CLOCK_IN_OMAP343X,
+       .recalc         = &omap2_clksel_recalc,
+};
+
+static struct clk wkup_32k_fck = {
+       .name           = "wkup_32k_fck",
+       .parent         = &omap_32k_fck,
+       .flags          = CLOCK_IN_OMAP343X | RATE_PROPAGATES | ALWAYS_ENABLED,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk gpio1_fck = {
+       .name           = "gpio1_fck",
+       .parent         = &wkup_32k_fck,
+       .enable_reg     = OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN),
+       .enable_bit     = OMAP3430_EN_GPIO1_SHIFT,
+       .flags          = CLOCK_IN_OMAP343X,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk wdt2_fck = {
+       .name           = "wdt2_fck",
+       .parent         = &wkup_32k_fck,
+       .enable_reg     = OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN),
+       .enable_bit     = OMAP3430_EN_WDT2_SHIFT,
+       .flags          = CLOCK_IN_OMAP343X,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk wkup_l4_ick = {
+       .name           = "wkup_l4_ick",
+       .parent         = &sys_ck,
+       .flags          = CLOCK_IN_OMAP343X | RATE_PROPAGATES | ALWAYS_ENABLED,
+       .recalc         = &followparent_recalc,
+};
+
+/* 3430ES2 only */
+/* Never specifically named in the TRM, so we have to infer a likely name */
+static struct clk usim_ick = {
+       .name           = "usim_ick",
+       .parent         = &wkup_l4_ick,
+       .enable_reg     = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
+       .enable_bit     = OMAP3430ES2_EN_USIMOCP_SHIFT,
+       .flags          = CLOCK_IN_OMAP3430ES2,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk wdt2_ick = {
+       .name           = "wdt2_ick",
+       .parent         = &wkup_l4_ick,
+       .enable_reg     = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
+       .enable_bit     = OMAP3430_EN_WDT2_SHIFT,
+       .flags          = CLOCK_IN_OMAP343X,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk wdt1_ick = {
+       .name           = "wdt1_ick",
+       .parent         = &wkup_l4_ick,
+       .enable_reg     = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
+       .enable_bit     = OMAP3430_EN_WDT1_SHIFT,
+       .flags          = CLOCK_IN_OMAP343X,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk gpio1_ick = {
+       .name           = "gpio1_ick",
+       .parent         = &wkup_l4_ick,
+       .enable_reg     = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
+       .enable_bit     = OMAP3430_EN_GPIO1_SHIFT,
+       .flags          = CLOCK_IN_OMAP343X,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk omap_32ksync_ick = {
+       .name           = "omap_32ksync_ick",
+       .parent         = &wkup_l4_ick,
+       .enable_reg     = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
+       .enable_bit     = OMAP3430_EN_32KSYNC_SHIFT,
+       .flags          = CLOCK_IN_OMAP343X,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk gpt12_ick = {
+       .name           = "gpt12_ick",
+       .parent         = &wkup_l4_ick,
+       .enable_reg     = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
+       .enable_bit     = OMAP3430_EN_GPT12_SHIFT,
+       .flags          = CLOCK_IN_OMAP343X,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk gpt1_ick = {
+       .name           = "gpt1_ick",
+       .parent         = &wkup_l4_ick,
+       .enable_reg     = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
+       .enable_bit     = OMAP3430_EN_GPT1_SHIFT,
+       .flags          = CLOCK_IN_OMAP343X,
+       .recalc         = &followparent_recalc,
+};
+
+
+
+/* PER clock domain */
+
+static struct clk per_96m_fck = {
+       .name           = "per_96m_fck",
+       .parent         = &omap_96m_alwon_fck,
+       .flags          = CLOCK_IN_OMAP343X | RATE_PROPAGATES |
+                               PARENT_CONTROLS_CLOCK,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk per_48m_fck = {
+       .name           = "per_48m_fck",
+       .parent         = &omap_48m_fck,
+       .flags          = CLOCK_IN_OMAP343X | RATE_PROPAGATES |
+                               PARENT_CONTROLS_CLOCK,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk uart3_fck = {
+       .name           = "uart3_fck",
+       .parent         = &per_48m_fck,
+       .enable_reg     = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
+       .enable_bit     = OMAP3430_EN_UART3_SHIFT,
+       .flags          = CLOCK_IN_OMAP343X,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk gpt2_fck = {
+       .name           = "gpt2_fck",
+       .init           = &omap2_init_clksel_parent,
+       .enable_reg     = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
+       .enable_bit     = OMAP3430_EN_GPT2_SHIFT,
+       .clksel_reg     = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_CLKSEL),
+       .clksel_mask    = OMAP3430_CLKSEL_GPT2_MASK,
+       .clksel         = omap343x_gpt_clksel,
+       .flags          = CLOCK_IN_OMAP343X,
+       .recalc         = &omap2_clksel_recalc,
+};
+
+static struct clk gpt3_fck = {
+       .name           = "gpt3_fck",
+       .init           = &omap2_init_clksel_parent,
+       .enable_reg     = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
+       .enable_bit     = OMAP3430_EN_GPT3_SHIFT,
+       .clksel_reg     = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_CLKSEL),
+       .clksel_mask    = OMAP3430_CLKSEL_GPT3_MASK,
+       .clksel         = omap343x_gpt_clksel,
+       .flags          = CLOCK_IN_OMAP343X,
+       .recalc         = &omap2_clksel_recalc,
+};
+
+static struct clk gpt4_fck = {
+       .name           = "gpt4_fck",
+       .init           = &omap2_init_clksel_parent,
+       .enable_reg     = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
+       .enable_bit     = OMAP3430_EN_GPT4_SHIFT,
+       .clksel_reg     = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_CLKSEL),
+       .clksel_mask    = OMAP3430_CLKSEL_GPT4_MASK,
+       .clksel         = omap343x_gpt_clksel,
+       .flags          = CLOCK_IN_OMAP343X,
+       .recalc         = &omap2_clksel_recalc,
+};
+
+static struct clk gpt5_fck = {
+       .name           = "gpt5_fck",
+       .init           = &omap2_init_clksel_parent,
+       .enable_reg     = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
+       .enable_bit     = OMAP3430_EN_GPT5_SHIFT,
+       .clksel_reg     = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_CLKSEL),
+       .clksel_mask    = OMAP3430_CLKSEL_GPT5_MASK,
+       .clksel         = omap343x_gpt_clksel,
+       .flags          = CLOCK_IN_OMAP343X,
+       .recalc         = &omap2_clksel_recalc,
+};
+
+static struct clk gpt6_fck = {
+       .name           = "gpt6_fck",
+       .init           = &omap2_init_clksel_parent,
+       .enable_reg     = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
+       .enable_bit     = OMAP3430_EN_GPT6_SHIFT,
+       .clksel_reg     = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_CLKSEL),
+       .clksel_mask    = OMAP3430_CLKSEL_GPT6_MASK,
+       .clksel         = omap343x_gpt_clksel,
+       .flags          = CLOCK_IN_OMAP343X,
+       .recalc         = &omap2_clksel_recalc,
+};
+
+static struct clk gpt7_fck = {
+       .name           = "gpt7_fck",
+       .init           = &omap2_init_clksel_parent,
+       .enable_reg     = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
+       .enable_bit     = OMAP3430_EN_GPT7_SHIFT,
+       .clksel_reg     = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_CLKSEL),
+       .clksel_mask    = OMAP3430_CLKSEL_GPT7_MASK,
+       .clksel         = omap343x_gpt_clksel,
+       .flags          = CLOCK_IN_OMAP343X,
+       .recalc         = &omap2_clksel_recalc,
+};
+
+static struct clk gpt8_fck = {
+       .name           = "gpt8_fck",
+       .init           = &omap2_init_clksel_parent,
+       .enable_reg     = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
+       .enable_bit     = OMAP3430_EN_GPT8_SHIFT,
+       .clksel_reg     = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_CLKSEL),
+       .clksel_mask    = OMAP3430_CLKSEL_GPT8_MASK,
+       .clksel         = omap343x_gpt_clksel,
+       .flags          = CLOCK_IN_OMAP343X,
+       .recalc         = &omap2_clksel_recalc,
+};
+
+static struct clk gpt9_fck = {
+       .name           = "gpt9_fck",
+       .init           = &omap2_init_clksel_parent,
+       .enable_reg     = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
+       .enable_bit     = OMAP3430_EN_GPT9_SHIFT,
+       .clksel_reg     = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_CLKSEL),
+       .clksel_mask    = OMAP3430_CLKSEL_GPT9_MASK,
+       .clksel         = omap343x_gpt_clksel,
+       .flags          = CLOCK_IN_OMAP343X,
+       .recalc         = &omap2_clksel_recalc,
+};
+
+static struct clk per_32k_alwon_fck = {
+       .name           = "per_32k_alwon_fck",
+       .parent         = &omap_32k_fck,
+       .flags          = CLOCK_IN_OMAP343X | RATE_PROPAGATES | ALWAYS_ENABLED,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk gpio6_fck = {
+       .name           = "gpio6_fck",
+       .parent         = &per_32k_alwon_fck,
+       .enable_reg     = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
+       .enable_bit     = OMAP3430_EN_GPT6_SHIFT,
+       .flags          = CLOCK_IN_OMAP343X,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk gpio5_fck = {
+       .name           = "gpio5_fck",
+       .parent         = &per_32k_alwon_fck,
+       .enable_reg     = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
+       .enable_bit     = OMAP3430_EN_GPT5_SHIFT,
+       .flags          = CLOCK_IN_OMAP343X,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk gpio4_fck = {
+       .name           = "gpio4_fck",
+       .parent         = &per_32k_alwon_fck,
+       .enable_reg     = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
+       .enable_bit     = OMAP3430_EN_GPT4_SHIFT,
+       .flags          = CLOCK_IN_OMAP343X,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk gpio3_fck = {
+       .name           = "gpio3_fck",
+       .parent         = &per_32k_alwon_fck,
+       .enable_reg     = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
+       .enable_bit     = OMAP3430_EN_GPT3_SHIFT,
+       .flags          = CLOCK_IN_OMAP343X,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk gpio2_fck = {
+       .name           = "gpio2_fck",
+       .parent         = &per_32k_alwon_fck,
+       .enable_reg     = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
+       .enable_bit     = OMAP3430_EN_GPT2_SHIFT,
+       .flags          = CLOCK_IN_OMAP343X,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk wdt3_fck = {
+       .name           = "wdt3_fck",
+       .parent         = &per_32k_alwon_fck,
+       .enable_reg     = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
+       .enable_bit     = OMAP3430_EN_WDT3_SHIFT,
+       .flags          = CLOCK_IN_OMAP343X,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk per_l4_ick = {
+       .name           = "per_l4_ick",
+       .parent         = &l4_ick,
+       .flags          = CLOCK_IN_OMAP343X | RATE_PROPAGATES |
+                               PARENT_CONTROLS_CLOCK,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk gpio6_ick = {
+       .name           = "gpio6_ick",
+       .parent         = &per_l4_ick,
+       .enable_reg     = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
+       .enable_bit     = OMAP3430_EN_GPIO6_SHIFT,
+       .flags          = CLOCK_IN_OMAP343X,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk gpio5_ick = {
+       .name           = "gpio5_ick",
+       .parent         = &per_l4_ick,
+       .enable_reg     = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
+       .enable_bit     = OMAP3430_EN_GPIO5_SHIFT,
+       .flags          = CLOCK_IN_OMAP343X,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk gpio4_ick = {
+       .name           = "gpio4_ick",
+       .parent         = &per_l4_ick,
+       .enable_reg     = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
+       .enable_bit     = OMAP3430_EN_GPIO4_SHIFT,
+       .flags          = CLOCK_IN_OMAP343X,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk gpio3_ick = {
+       .name           = "gpio3_ick",
+       .parent         = &per_l4_ick,
+       .enable_reg     = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
+       .enable_bit     = OMAP3430_EN_GPIO3_SHIFT,
+       .flags          = CLOCK_IN_OMAP343X,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk gpio2_ick = {
+       .name           = "gpio2_ick",
+       .parent         = &per_l4_ick,
+       .enable_reg     = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
+       .enable_bit     = OMAP3430_EN_GPIO2_SHIFT,
+       .flags          = CLOCK_IN_OMAP343X,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk wdt3_ick = {
+       .name           = "wdt3_ick",
+       .parent         = &per_l4_ick,
+       .enable_reg     = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
+       .enable_bit     = OMAP3430_EN_WDT3_SHIFT,
+       .flags          = CLOCK_IN_OMAP343X,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk uart3_ick = {
+       .name           = "uart3_ick",
+       .parent         = &per_l4_ick,
+       .enable_reg     = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
+       .enable_bit     = OMAP3430_EN_UART3_SHIFT,
+       .flags          = CLOCK_IN_OMAP343X,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk gpt9_ick = {
+       .name           = "gpt9_ick",
+       .parent         = &per_l4_ick,
+       .enable_reg     = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
+       .enable_bit     = OMAP3430_EN_GPT9_SHIFT,
+       .flags          = CLOCK_IN_OMAP343X,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk gpt8_ick = {
+       .name           = "gpt8_ick",
+       .parent         = &per_l4_ick,
+       .enable_reg     = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
+       .enable_bit     = OMAP3430_EN_GPT8_SHIFT,
+       .flags          = CLOCK_IN_OMAP343X,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk gpt7_ick = {
+       .name           = "gpt7_ick",
+       .parent         = &per_l4_ick,
+       .enable_reg     = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
+       .enable_bit     = OMAP3430_EN_GPT7_SHIFT,
+       .flags          = CLOCK_IN_OMAP343X,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk gpt6_ick = {
+       .name           = "gpt6_ick",
+       .parent         = &per_l4_ick,
+       .enable_reg     = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
+       .enable_bit     = OMAP3430_EN_GPT6_SHIFT,
+       .flags          = CLOCK_IN_OMAP343X,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk gpt5_ick = {
+       .name           = "gpt5_ick",
+       .parent         = &per_l4_ick,
+       .enable_reg     = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
+       .enable_bit     = OMAP3430_EN_GPT5_SHIFT,
+       .flags          = CLOCK_IN_OMAP343X,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk gpt4_ick = {
+       .name           = "gpt4_ick",
+       .parent         = &per_l4_ick,
+       .enable_reg     = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
+       .enable_bit     = OMAP3430_EN_GPT4_SHIFT,
+       .flags          = CLOCK_IN_OMAP343X,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk gpt3_ick = {
+       .name           = "gpt3_ick",
+       .parent         = &per_l4_ick,
+       .enable_reg     = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
+       .enable_bit     = OMAP3430_EN_GPT3_SHIFT,
+       .flags          = CLOCK_IN_OMAP343X,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk gpt2_ick = {
+       .name           = "gpt2_ick",
+       .parent         = &per_l4_ick,
+       .enable_reg     = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
+       .enable_bit     = OMAP3430_EN_GPT2_SHIFT,
+       .flags          = CLOCK_IN_OMAP343X,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk mcbsp2_ick = {
+       .name           = "mcbsp2_ick",
+       .parent         = &per_l4_ick,
+       .enable_reg     = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
+       .enable_bit     = OMAP3430_EN_MCBSP2_SHIFT,
+       .flags          = CLOCK_IN_OMAP343X,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk mcbsp3_ick = {
+       .name           = "mcbsp3_ick",
+       .parent         = &per_l4_ick,
+       .enable_reg     = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
+       .enable_bit     = OMAP3430_EN_MCBSP3_SHIFT,
+       .flags          = CLOCK_IN_OMAP343X,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk mcbsp4_ick = {
+       .name           = "mcbsp4_ick",
+       .parent         = &per_l4_ick,
+       .enable_reg     = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
+       .enable_bit     = OMAP3430_EN_MCBSP4_SHIFT,
+       .flags          = CLOCK_IN_OMAP343X,
+       .recalc         = &followparent_recalc,
+};
+
+static const struct clksel mcbsp_234_clksel[] = {
+       { .parent = &per_96m_fck, .rates = common_mcbsp_96m_rates },
+       { .parent = &mcbsp_clks,   .rates = common_mcbsp_mcbsp_rates },
+       { .parent = NULL }
+};
+
+static struct clk mcbsp2_fck = {
+       .name           = "mcbsp2_fck",
+       .init           = &omap2_init_clksel_parent,
+       .enable_reg     = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
+       .enable_bit     = OMAP3430_EN_MCBSP2_SHIFT,
+       .clksel_reg     = OMAP343X_CTRL_REGADDR(OMAP2_CONTROL_DEVCONF0),
+       .clksel_mask    = OMAP2_MCBSP2_CLKS_MASK,
+       .clksel         = mcbsp_234_clksel,
+       .flags          = CLOCK_IN_OMAP343X,
+       .recalc         = &omap2_clksel_recalc,
+};
+
+static struct clk mcbsp3_fck = {
+       .name           = "mcbsp3_fck",
+       .init           = &omap2_init_clksel_parent,
+       .enable_reg     = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
+       .enable_bit     = OMAP3430_EN_MCBSP3_SHIFT,
+       .clksel_reg     = OMAP343X_CTRL_REGADDR(OMAP343X_CONTROL_DEVCONF1),
+       .clksel_mask    = OMAP2_MCBSP3_CLKS_MASK,
+       .clksel         = mcbsp_234_clksel,
+       .flags          = CLOCK_IN_OMAP343X,
+       .recalc         = &omap2_clksel_recalc,
+};
+
+static struct clk mcbsp4_fck = {
+       .name           = "mcbsp4_fck",
+       .init           = &omap2_init_clksel_parent,
+       .enable_reg     = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
+       .enable_bit     = OMAP3430_EN_MCBSP4_SHIFT,
+       .clksel_reg     = OMAP343X_CTRL_REGADDR(OMAP343X_CONTROL_DEVCONF1),
+       .clksel_mask    = OMAP2_MCBSP4_CLKS_MASK,
+       .clksel         = mcbsp_234_clksel,
+       .flags          = CLOCK_IN_OMAP343X,
+       .recalc         = &omap2_clksel_recalc,
+};
+
+/* EMU clocks */
+
+/* More information: ARM Cortex-A8 Technical Reference Manual, sect 10.1 */
+
+static const struct clksel_rate emu_src_sys_rates[] = {
+       { .div = 1, .val = 0, .flags = RATE_IN_343X | DEFAULT_RATE },
+       { .div = 0 },
+};
+
+static const struct clksel_rate emu_src_core_rates[] = {
+       { .div = 1, .val = 1, .flags = RATE_IN_343X | DEFAULT_RATE },
+       { .div = 0 },
+};
+
+static const struct clksel_rate emu_src_per_rates[] = {
+       { .div = 1, .val = 2, .flags = RATE_IN_343X | DEFAULT_RATE },
+       { .div = 0 },
+};
+
+static const struct clksel_rate emu_src_mpu_rates[] = {
+       { .div = 1, .val = 3, .flags = RATE_IN_343X | DEFAULT_RATE },
+       { .div = 0 },
+};
+
+static const struct clksel emu_src_clksel[] = {
+       { .parent = &sys_ck,            .rates = emu_src_sys_rates },
+       { .parent = &emu_core_alwon_ck, .rates = emu_src_core_rates },
+       { .parent = &emu_per_alwon_ck,  .rates = emu_src_per_rates },
+       { .parent = &emu_mpu_alwon_ck,  .rates = emu_src_mpu_rates },
+       { .parent = NULL },
+};
+
+/*
+ * Like the clkout_src clocks, emu_src_clk is a virtual clock, existing only
+ * to switch the source of some of the EMU clocks.
+ * XXX Are there CLKEN bits for these EMU clks?
+ */
+static struct clk emu_src_ck = {
+       .name           = "emu_src_ck",
+       .init           = &omap2_init_clksel_parent,
+       .clksel_reg     = OMAP_CM_REGADDR(OMAP3430_EMU_MOD, CM_CLKSEL1),
+       .clksel_mask    = OMAP3430_MUX_CTRL_MASK,
+       .clksel         = emu_src_clksel,
+       .flags          = CLOCK_IN_OMAP343X | RATE_PROPAGATES | ALWAYS_ENABLED,
+       .recalc         = &omap2_clksel_recalc,
+};
+
+static const struct clksel_rate pclk_emu_rates[] = {
+       { .div = 2, .val = 2, .flags = RATE_IN_343X | DEFAULT_RATE },
+       { .div = 3, .val = 3, .flags = RATE_IN_343X },
+       { .div = 4, .val = 4, .flags = RATE_IN_343X },
+       { .div = 6, .val = 6, .flags = RATE_IN_343X },
+       { .div = 0 },
+};
+
+static const struct clksel pclk_emu_clksel[] = {
+       { .parent = &emu_src_ck, .rates = pclk_emu_rates },
+       { .parent = NULL },
+};
+
+static struct clk pclk_fck = {
+       .name           = "pclk_fck",
+       .init           = &omap2_init_clksel_parent,
+       .clksel_reg     = OMAP_CM_REGADDR(OMAP3430_EMU_MOD, CM_CLKSEL1),
+       .clksel_mask    = OMAP3430_CLKSEL_PCLK_MASK,
+       .clksel         = pclk_emu_clksel,
+       .flags          = CLOCK_IN_OMAP343X | RATE_PROPAGATES | ALWAYS_ENABLED,
+       .recalc         = &omap2_clksel_recalc,
+};
+
+static const struct clksel_rate pclkx2_emu_rates[] = {
+       { .div = 1, .val = 1, .flags = RATE_IN_343X | DEFAULT_RATE },
+       { .div = 2, .val = 2, .flags = RATE_IN_343X },
+       { .div = 3, .val = 3, .flags = RATE_IN_343X },
+       { .div = 0 },
+};
+
+static const struct clksel pclkx2_emu_clksel[] = {
+       { .parent = &emu_src_ck, .rates = pclkx2_emu_rates },
+       { .parent = NULL },
+};
+
+static struct clk pclkx2_fck = {
+       .name           = "pclkx2_fck",
+       .init           = &omap2_init_clksel_parent,
+       .clksel_reg     = OMAP_CM_REGADDR(OMAP3430_EMU_MOD, CM_CLKSEL1),
+       .clksel_mask    = OMAP3430_CLKSEL_PCLKX2_MASK,
+       .clksel         = pclkx2_emu_clksel,
+       .flags          = CLOCK_IN_OMAP343X | RATE_PROPAGATES | ALWAYS_ENABLED,
+       .recalc         = &omap2_clksel_recalc,
+};
+
+static const struct clksel atclk_emu_clksel[] = {
+       { .parent = &emu_src_ck, .rates = div2_rates },
+       { .parent = NULL },
+};
+
+static struct clk atclk_fck = {
+       .name           = "atclk_fck",
+       .init           = &omap2_init_clksel_parent,
+       .clksel_reg     = OMAP_CM_REGADDR(OMAP3430_EMU_MOD, CM_CLKSEL1),
+       .clksel_mask    = OMAP3430_CLKSEL_ATCLK_MASK,
+       .clksel         = atclk_emu_clksel,
+       .flags          = CLOCK_IN_OMAP343X | RATE_PROPAGATES | ALWAYS_ENABLED,
+       .recalc         = &omap2_clksel_recalc,
+};
+
+static struct clk traceclk_src_fck = {
+       .name           = "traceclk_src_fck",
+       .init           = &omap2_init_clksel_parent,
+       .clksel_reg     = OMAP_CM_REGADDR(OMAP3430_EMU_MOD, CM_CLKSEL1),
+       .clksel_mask    = OMAP3430_TRACE_MUX_CTRL_MASK,
+       .clksel         = emu_src_clksel,
+       .flags          = CLOCK_IN_OMAP343X | RATE_PROPAGATES | ALWAYS_ENABLED,
+       .recalc         = &omap2_clksel_recalc,
+};
+
+static const struct clksel_rate traceclk_rates[] = {
+       { .div = 1, .val = 1, .flags = RATE_IN_343X | DEFAULT_RATE },
+       { .div = 2, .val = 2, .flags = RATE_IN_343X },
+       { .div = 4, .val = 4, .flags = RATE_IN_343X },
+       { .div = 0 },
+};
+
+static const struct clksel traceclk_clksel[] = {
+       { .parent = &traceclk_src_fck, .rates = traceclk_rates },
+       { .parent = NULL },
+};
+
+static struct clk traceclk_fck = {
+       .name           = "traceclk_fck",
+       .init           = &omap2_init_clksel_parent,
+       .clksel_reg     = OMAP_CM_REGADDR(OMAP3430_EMU_MOD, CM_CLKSEL1),
+       .clksel_mask    = OMAP3430_CLKSEL_TRACECLK_MASK,
+       .clksel         = traceclk_clksel,
+       .flags          = CLOCK_IN_OMAP343X | ALWAYS_ENABLED,
+       .recalc         = &omap2_clksel_recalc,
+};
+
+/* SR clocks */
+
+/* SmartReflex fclk (VDD1) */
+static struct clk sr1_fck = {
+       .name           = "sr1_fck",
+       .parent         = &sys_ck,
+       .enable_reg     = OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN),
+       .enable_bit     = OMAP3430_EN_SR1_SHIFT,
+       .flags          = CLOCK_IN_OMAP343X | RATE_PROPAGATES,
+       .recalc         = &followparent_recalc,
+};
+
+/* SmartReflex fclk (VDD2) */
+static struct clk sr2_fck = {
+       .name           = "sr2_fck",
+       .parent         = &sys_ck,
+       .enable_reg     = OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN),
+       .enable_bit     = OMAP3430_EN_SR2_SHIFT,
+       .flags          = CLOCK_IN_OMAP343X | RATE_PROPAGATES,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk sr_l4_ick = {
+       .name           = "sr_l4_ick",
+       .parent         = &l4_ick,
+       .flags          = CLOCK_IN_OMAP343X,
+       .recalc         = &followparent_recalc,
+};
+
+/* SECURE_32K_FCK clocks */
+
+static struct clk gpt12_fck = {
+       .name           = "gpt12_fck",
+       .parent         = &secure_32k_fck,
+       .flags          = CLOCK_IN_OMAP343X | ALWAYS_ENABLED,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk wdt1_fck = {
+       .name           = "wdt1_fck",
+       .parent         = &secure_32k_fck,
+       .flags          = CLOCK_IN_OMAP343X | ALWAYS_ENABLED,
+       .recalc         = &followparent_recalc,
+};
+
+static struct clk *onchip_34xx_clks[] __initdata = {
+       &omap_32k_fck,
+       &virt_12m_ck,
+       &virt_13m_ck,
+       &virt_16_8m_ck,
+       &virt_19_2m_ck,
+       &virt_26m_ck,
+       &virt_38_4m_ck,
+       &osc_sys_ck,
+       &sys_ck,
+       &sys_altclk,
+       &mcbsp_clks,
+       &sys_clkout1,
+       &dpll1_ck,
+       &dpll1_x2_ck,
+       &dpll1_x2m2_ck,
+       &dpll2_ck,
+       &dpll2_m2_ck,
+       &dpll3_ck,
+       &core_ck,
+       &dpll3_x2_ck,
+       &dpll3_m2_ck,
+       &dpll3_m2x2_ck,
+       &dpll3_m3_ck,
+       &dpll3_m3x2_ck,
+       &emu_core_alwon_ck,
+       &dpll4_ck,
+       &dpll4_x2_ck,
+       &omap_96m_alwon_fck,
+       &omap_96m_fck,
+       &cm_96m_fck,
+       &virt_omap_54m_fck,
+       &omap_54m_fck,
+       &omap_48m_fck,
+       &omap_12m_fck,
+       &dpll4_m2_ck,
+       &dpll4_m2x2_ck,
+       &dpll4_m3_ck,
+       &dpll4_m3x2_ck,
+       &dpll4_m4_ck,
+       &dpll4_m4x2_ck,
+       &dpll4_m5_ck,
+       &dpll4_m5x2_ck,
+       &dpll4_m6_ck,
+       &dpll4_m6x2_ck,
+       &emu_per_alwon_ck,
+       &dpll5_ck,
+       &dpll5_m2_ck,
+       &omap_120m_fck,
+       &clkout2_src_ck,
+       &sys_clkout2,
+       &corex2_fck,
+       &dpll1_fck,
+       &mpu_ck,
+       &arm_fck,
+       &emu_mpu_alwon_ck,
+       &dpll2_fck,
+       &iva2_ck,
+       &l3_ick,
+       &l4_ick,
+       &rm_ick,
+       &gfx_l3_fck,
+       &gfx_l3_ick,
+       &gfx_cg1_ck,
+       &gfx_cg2_ck,
+       &sgx_fck,
+       &sgx_ick,
+       &d2d_26m_fck,
+       &gpt10_fck,
+       &gpt11_fck,
+       &cpefuse_fck,
+       &ts_fck,
+       &usbtll_fck,
+       &core_96m_fck,
+       &mmchs3_fck,
+       &mmchs2_fck,
+       &mspro_fck,
+       &mmchs1_fck,
+       &i2c3_fck,
+       &i2c2_fck,
+       &i2c1_fck,
+       &mcbsp5_fck,
+       &mcbsp1_fck,
+       &core_48m_fck,
+       &mcspi4_fck,
+       &mcspi3_fck,
+       &mcspi2_fck,
+       &mcspi1_fck,
+       &uart2_fck,
+       &uart1_fck,
+       &fshostusb_fck,
+       &core_12m_fck,
+       &hdq_fck,
+       &ssi_ssr_fck,
+       &ssi_sst_fck,
+       &core_l3_ick,
+       &hsotgusb_ick,
+       &sdrc_ick,
+       &gpmc_fck,
+       &security_l3_ick,
+       &pka_ick,
+       &core_l4_ick,
+       &usbtll_ick,
+       &mmchs3_ick,
+       &icr_ick,
+       &aes2_ick,
+       &sha12_ick,
+       &des2_ick,
+       &mmchs2_ick,
+       &mmchs1_ick,
+       &mspro_ick,
+       &hdq_ick,
+       &mcspi4_ick,
+       &mcspi3_ick,
+       &mcspi2_ick,
+       &mcspi1_ick,
+       &i2c3_ick,
+       &i2c2_ick,
+       &i2c1_ick,
+       &uart2_ick,
+       &uart1_ick,
+       &gpt11_ick,
+       &gpt10_ick,
+       &mcbsp5_ick,
+       &mcbsp1_ick,
+       &fac_ick,
+       &mailboxes_ick,
+       &omapctrl_ick,
+       &ssi_l4_ick,
+       &ssi_ick,
+       &usb_l4_ick,
+       &security_l4_ick2,
+       &aes1_ick,
+       &rng_ick,
+       &sha11_ick,
+       &des1_ick,
+       &dss1_alwon_fck,
+       &dss_tv_fck,
+       &dss_96m_fck,
+       &dss2_alwon_fck,
+       &dss_ick,
+       &cam_mclk,
+       &cam_l3_ick,
+       &cam_l4_ick,
+       &usbhost_120m_fck,
+       &usbhost_48m_fck,
+       &usbhost_l3_ick,
+       &usbhost_l4_ick,
+       &usbhost_sar_fck,
+       &usim_fck,
+       &gpt1_fck,
+       &wkup_32k_fck,
+       &gpio1_fck,
+       &wdt2_fck,
+       &wkup_l4_ick,
+       &usim_ick,
+       &wdt2_ick,
+       &wdt1_ick,
+       &gpio1_ick,
+       &omap_32ksync_ick,
+       &gpt12_ick,
+       &gpt1_ick,
+       &per_96m_fck,
+       &per_48m_fck,
+       &uart3_fck,
+       &gpt2_fck,
+       &gpt3_fck,
+       &gpt4_fck,
+       &gpt5_fck,
+       &gpt6_fck,
+       &gpt7_fck,
+       &gpt8_fck,
+       &gpt9_fck,
+       &per_32k_alwon_fck,
+       &gpio6_fck,
+       &gpio5_fck,
+       &gpio4_fck,
+       &gpio3_fck,
+       &gpio2_fck,
+       &wdt3_fck,
+       &per_l4_ick,
+       &gpio6_ick,
+       &gpio5_ick,
+       &gpio4_ick,
+       &gpio3_ick,
+       &gpio2_ick,
+       &wdt3_ick,
+       &uart3_ick,
+       &gpt9_ick,
+       &gpt8_ick,
+       &gpt7_ick,
+       &gpt6_ick,
+       &gpt5_ick,
+       &gpt4_ick,
+       &gpt3_ick,
+       &gpt2_ick,
+       &mcbsp2_ick,
+       &mcbsp3_ick,
+       &mcbsp4_ick,
+       &mcbsp2_fck,
+       &mcbsp3_fck,
+       &mcbsp4_fck,
+       &emu_src_ck,
+       &pclk_fck,
+       &pclkx2_fck,
+       &atclk_fck,
+       &traceclk_src_fck,
+       &traceclk_fck,
+       &sr1_fck,
+       &sr2_fck,
+       &sr_l4_ick,
+       &secure_32k_fck,
+       &gpt12_fck,
+       &wdt1_fck,
+};
+
+#endif
diff --git a/arch/arm/mach-omap2/cm-regbits-24xx.h b/arch/arm/mach-omap2/cm-regbits-24xx.h
new file mode 100644 (file)
index 0000000..20ac381
--- /dev/null
@@ -0,0 +1,401 @@
+#ifndef __ARCH_ARM_MACH_OMAP2_CM_REGBITS_24XX_H
+#define __ARCH_ARM_MACH_OMAP2_CM_REGBITS_24XX_H
+
+/*
+ * OMAP24XX Clock Management register bits
+ *
+ * Copyright (C) 2007 Texas Instruments, Inc.
+ * Copyright (C) 2007 Nokia Corporation
+ *
+ * Written by Paul Walmsley
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include "cm.h"
+
+/* Bits shared between registers */
+
+/* CM_FCLKEN1_CORE and CM_ICLKEN1_CORE shared bits */
+#define OMAP24XX_EN_CAM_SHIFT                          31
+#define OMAP24XX_EN_CAM                                        (1 << 31)
+#define OMAP24XX_EN_WDT4_SHIFT                         29
+#define OMAP24XX_EN_WDT4                               (1 << 29)
+#define OMAP2420_EN_WDT3_SHIFT                         28
+#define OMAP2420_EN_WDT3                               (1 << 28)
+#define OMAP24XX_EN_MSPRO_SHIFT                                27
+#define OMAP24XX_EN_MSPRO                              (1 << 27)
+#define OMAP24XX_EN_FAC_SHIFT                          25
+#define OMAP24XX_EN_FAC                                        (1 << 25)
+#define OMAP2420_EN_EAC_SHIFT                          24
+#define OMAP2420_EN_EAC                                        (1 << 24)
+#define OMAP24XX_EN_HDQ_SHIFT                          23
+#define OMAP24XX_EN_HDQ                                        (1 << 23)
+#define OMAP2420_EN_I2C2_SHIFT                         20
+#define OMAP2420_EN_I2C2                               (1 << 20)
+#define OMAP2420_EN_I2C1_SHIFT                         19
+#define OMAP2420_EN_I2C1                               (1 << 19)
+
+/* CM_FCLKEN2_CORE and CM_ICLKEN2_CORE shared bits */
+#define OMAP2430_EN_MCBSP5_SHIFT                       5
+#define OMAP2430_EN_MCBSP5                             (1 << 5)
+#define OMAP2430_EN_MCBSP4_SHIFT                       4
+#define OMAP2430_EN_MCBSP4                             (1 << 4)
+#define OMAP2430_EN_MCBSP3_SHIFT                       3
+#define OMAP2430_EN_MCBSP3                             (1 << 3)
+#define OMAP24XX_EN_SSI_SHIFT                          1
+#define OMAP24XX_EN_SSI                                        (1 << 1)
+
+/* CM_FCLKEN_WKUP and CM_ICLKEN_WKUP shared bits */
+#define OMAP24XX_EN_MPU_WDT_SHIFT                      3
+#define OMAP24XX_EN_MPU_WDT                            (1 << 3)
+
+/* Bits specific to each register */
+
+/* CM_IDLEST_MPU */
+/* 2430 only */
+#define OMAP2430_ST_MPU                                        (1 << 0)
+
+/* CM_CLKSEL_MPU */
+#define OMAP24XX_CLKSEL_MPU_SHIFT                      0
+#define OMAP24XX_CLKSEL_MPU_MASK                       (0x1f << 0)
+
+/* CM_CLKSTCTRL_MPU */
+#define OMAP24XX_AUTOSTATE_MPU                         (1 << 0)
+
+/* CM_FCLKEN1_CORE specific bits*/
+#define OMAP24XX_EN_TV_SHIFT                           2
+#define OMAP24XX_EN_TV                                 (1 << 2)
+#define OMAP24XX_EN_DSS2_SHIFT                         1
+#define OMAP24XX_EN_DSS2                               (1 << 1)
+#define OMAP24XX_EN_DSS1_SHIFT                         0
+#define OMAP24XX_EN_DSS1                               (1 << 0)
+
+/* CM_FCLKEN2_CORE specific bits */
+#define OMAP2430_EN_I2CHS2_SHIFT                       20
+#define OMAP2430_EN_I2CHS2                             (1 << 20)
+#define OMAP2430_EN_I2CHS1_SHIFT                       19
+#define OMAP2430_EN_I2CHS1                             (1 << 19)
+#define OMAP2430_EN_MMCHSDB2_SHIFT                     17
+#define OMAP2430_EN_MMCHSDB2                           (1 << 17)
+#define OMAP2430_EN_MMCHSDB1_SHIFT                     16
+#define OMAP2430_EN_MMCHSDB1                           (1 << 16)
+
+/* CM_ICLKEN1_CORE specific bits */
+#define OMAP24XX_EN_MAILBOXES_SHIFT                    30
+#define OMAP24XX_EN_MAILBOXES                          (1 << 30)
+#define OMAP24XX_EN_DSS_SHIFT                          0
+#define OMAP24XX_EN_DSS                                        (1 << 0)
+
+/* CM_ICLKEN2_CORE specific bits */
+
+/* CM_ICLKEN3_CORE */
+/* 2430 only */
+#define OMAP2430_EN_SDRC_SHIFT                         2
+#define OMAP2430_EN_SDRC                               (1 << 2)
+
+/* CM_ICLKEN4_CORE */
+#define OMAP24XX_EN_PKA_SHIFT                          4
+#define OMAP24XX_EN_PKA                                        (1 << 4)
+#define OMAP24XX_EN_AES_SHIFT                          3
+#define OMAP24XX_EN_AES                                        (1 << 3)
+#define OMAP24XX_EN_RNG_SHIFT                          2
+#define OMAP24XX_EN_RNG                                        (1 << 2)
+#define OMAP24XX_EN_SHA_SHIFT                          1
+#define OMAP24XX_EN_SHA                                        (1 << 1)
+#define OMAP24XX_EN_DES_SHIFT                          0
+#define OMAP24XX_EN_DES                                        (1 << 0)
+
+/* CM_IDLEST1_CORE specific bits */
+#define OMAP24XX_ST_MAILBOXES                          (1 << 30)
+#define OMAP24XX_ST_WDT4                               (1 << 29)
+#define OMAP2420_ST_WDT3                               (1 << 28)
+#define OMAP24XX_ST_MSPRO                              (1 << 27)
+#define OMAP24XX_ST_FAC                                        (1 << 25)
+#define OMAP2420_ST_EAC                                        (1 << 24)
+#define OMAP24XX_ST_HDQ                                        (1 << 23)
+#define OMAP24XX_ST_I2C2                               (1 << 20)
+#define OMAP24XX_ST_I2C1                               (1 << 19)
+#define OMAP24XX_ST_MCBSP2                             (1 << 16)
+#define OMAP24XX_ST_MCBSP1                             (1 << 15)
+#define OMAP24XX_ST_DSS                                        (1 << 0)
+
+/* CM_IDLEST2_CORE */
+#define OMAP2430_ST_MCBSP5                             (1 << 5)
+#define OMAP2430_ST_MCBSP4                             (1 << 4)
+#define OMAP2430_ST_MCBSP3                             (1 << 3)
+#define OMAP24XX_ST_SSI                                        (1 << 1)
+
+/* CM_IDLEST3_CORE */
+/* 2430 only */
+#define OMAP2430_ST_SDRC                               (1 << 2)
+
+/* CM_IDLEST4_CORE */
+#define OMAP24XX_ST_PKA                                        (1 << 4)
+#define OMAP24XX_ST_AES                                        (1 << 3)
+#define OMAP24XX_ST_RNG                                        (1 << 2)
+#define OMAP24XX_ST_SHA                                        (1 << 1)
+#define OMAP24XX_ST_DES                                        (1 << 0)
+
+/* CM_AUTOIDLE1_CORE */
+#define OMAP24XX_AUTO_CAM                              (1 << 31)
+#define OMAP24XX_AUTO_MAILBOXES                                (1 << 30)
+#define OMAP24XX_AUTO_WDT4                             (1 << 29)
+#define OMAP2420_AUTO_WDT3                             (1 << 28)
+#define OMAP24XX_AUTO_MSPRO                            (1 << 27)
+#define OMAP2420_AUTO_MMC                              (1 << 26)
+#define OMAP24XX_AUTO_FAC                              (1 << 25)
+#define OMAP2420_AUTO_EAC                              (1 << 24)
+#define OMAP24XX_AUTO_HDQ                              (1 << 23)
+#define OMAP24XX_AUTO_UART2                            (1 << 22)
+#define OMAP24XX_AUTO_UART1                            (1 << 21)
+#define OMAP24XX_AUTO_I2C2                             (1 << 20)
+#define OMAP24XX_AUTO_I2C1                             (1 << 19)
+#define OMAP24XX_AUTO_MCSPI2                           (1 << 18)
+#define OMAP24XX_AUTO_MCSPI1                           (1 << 17)
+#define OMAP24XX_AUTO_MCBSP2                           (1 << 16)
+#define OMAP24XX_AUTO_MCBSP1                           (1 << 15)
+#define OMAP24XX_AUTO_GPT12                            (1 << 14)
+#define OMAP24XX_AUTO_GPT11                            (1 << 13)
+#define OMAP24XX_AUTO_GPT10                            (1 << 12)
+#define OMAP24XX_AUTO_GPT9                             (1 << 11)
+#define OMAP24XX_AUTO_GPT8                             (1 << 10)
+#define OMAP24XX_AUTO_GPT7                             (1 << 9)
+#define OMAP24XX_AUTO_GPT6                             (1 << 8)
+#define OMAP24XX_AUTO_GPT5                             (1 << 7)
+#define OMAP24XX_AUTO_GPT4                             (1 << 6)
+#define OMAP24XX_AUTO_GPT3                             (1 << 5)
+#define OMAP24XX_AUTO_GPT2                             (1 << 4)
+#define OMAP2420_AUTO_VLYNQ                            (1 << 3)
+#define OMAP24XX_AUTO_DSS                              (1 << 0)
+
+/* CM_AUTOIDLE2_CORE */
+#define OMAP2430_AUTO_MDM_INTC                         (1 << 11)
+#define OMAP2430_AUTO_GPIO5                            (1 << 10)
+#define OMAP2430_AUTO_MCSPI3                           (1 << 9)
+#define OMAP2430_AUTO_MMCHS2                           (1 << 8)
+#define OMAP2430_AUTO_MMCHS1                           (1 << 7)
+#define OMAP2430_AUTO_USBHS                            (1 << 6)
+#define OMAP2430_AUTO_MCBSP5                           (1 << 5)
+#define OMAP2430_AUTO_MCBSP4                           (1 << 4)
+#define OMAP2430_AUTO_MCBSP3                           (1 << 3)
+#define OMAP24XX_AUTO_UART3                            (1 << 2)
+#define OMAP24XX_AUTO_SSI                              (1 << 1)
+#define OMAP24XX_AUTO_USB                              (1 << 0)
+
+/* CM_AUTOIDLE3_CORE */
+#define OMAP24XX_AUTO_SDRC                             (1 << 2)
+#define OMAP24XX_AUTO_GPMC                             (1 << 1)
+#define OMAP24XX_AUTO_SDMA                             (1 << 0)
+
+/* CM_AUTOIDLE4_CORE */
+#define OMAP24XX_AUTO_PKA                              (1 << 4)
+#define OMAP24XX_AUTO_AES                              (1 << 3)
+#define OMAP24XX_AUTO_RNG                              (1 << 2)
+#define OMAP24XX_AUTO_SHA                              (1 << 1)
+#define OMAP24XX_AUTO_DES                              (1 << 0)
+
+/* CM_CLKSEL1_CORE */
+#define OMAP24XX_CLKSEL_USB_SHIFT                      25
+#define OMAP24XX_CLKSEL_USB_MASK                       (0x7 << 25)
+#define OMAP24XX_CLKSEL_SSI_SHIFT                      20
+#define OMAP24XX_CLKSEL_SSI_MASK                       (0x1f << 20)
+#define OMAP2420_CLKSEL_VLYNQ_SHIFT                    15
+#define OMAP2420_CLKSEL_VLYNQ_MASK                     (0x1f << 15)
+#define OMAP24XX_CLKSEL_DSS2_SHIFT                     13
+#define OMAP24XX_CLKSEL_DSS2_MASK                      (0x1 << 13)
+#define OMAP24XX_CLKSEL_DSS1_SHIFT                     8
+#define OMAP24XX_CLKSEL_DSS1_MASK                      (0x1f << 8)
+#define OMAP24XX_CLKSEL_L4_SHIFT                       5
+#define OMAP24XX_CLKSEL_L4_MASK                                (0x3 << 5)
+#define OMAP24XX_CLKSEL_L3_SHIFT                       0
+#define OMAP24XX_CLKSEL_L3_MASK                                (0x1f << 0)
+
+/* CM_CLKSEL2_CORE */
+#define OMAP24XX_CLKSEL_GPT12_SHIFT                    22
+#define OMAP24XX_CLKSEL_GPT12_MASK                     (0x3 << 22)
+#define OMAP24XX_CLKSEL_GPT11_SHIFT                    20
+#define OMAP24XX_CLKSEL_GPT11_MASK                     (0x3 << 20)
+#define OMAP24XX_CLKSEL_GPT10_SHIFT                    18
+#define OMAP24XX_CLKSEL_GPT10_MASK                     (0x3 << 18)
+#define OMAP24XX_CLKSEL_GPT9_SHIFT                     16
+#define OMAP24XX_CLKSEL_GPT9_MASK                      (0x3 << 16)
+#define OMAP24XX_CLKSEL_GPT8_SHIFT                     14
+#define OMAP24XX_CLKSEL_GPT8_MASK                      (0x3 << 14)
+#define OMAP24XX_CLKSEL_GPT7_SHIFT                     12
+#define OMAP24XX_CLKSEL_GPT7_MASK                      (0x3 << 12)
+#define OMAP24XX_CLKSEL_GPT6_SHIFT                     10
+#define OMAP24XX_CLKSEL_GPT6_MASK                      (0x3 << 10)
+#define OMAP24XX_CLKSEL_GPT5_SHIFT                     8
+#define OMAP24XX_CLKSEL_GPT5_MASK                      (0x3 << 8)
+#define OMAP24XX_CLKSEL_GPT4_SHIFT                     6
+#define OMAP24XX_CLKSEL_GPT4_MASK                      (0x3 << 6)
+#define OMAP24XX_CLKSEL_GPT3_SHIFT                     4
+#define OMAP24XX_CLKSEL_GPT3_MASK                      (0x3 << 4)
+#define OMAP24XX_CLKSEL_GPT2_SHIFT                     2
+#define OMAP24XX_CLKSEL_GPT2_MASK                      (0x3 << 2)
+
+/* CM_CLKSTCTRL_CORE */
+#define OMAP24XX_AUTOSTATE_DSS                         (1 << 2)
+#define OMAP24XX_AUTOSTATE_L4                          (1 << 1)
+#define OMAP24XX_AUTOSTATE_L3                          (1 << 0)
+
+/* CM_FCLKEN_GFX */
+#define OMAP24XX_EN_3D_SHIFT                           2
+#define OMAP24XX_EN_3D                                 (1 << 2)
+#define OMAP24XX_EN_2D_SHIFT                           1
+#define OMAP24XX_EN_2D                                 (1 << 1)
+
+/* CM_ICLKEN_GFX specific bits */
+
+/* CM_IDLEST_GFX specific bits */
+
+/* CM_CLKSEL_GFX specific bits */
+
+/* CM_CLKSTCTRL_GFX */
+#define OMAP24XX_AUTOSTATE_GFX                         (1 << 0)
+
+/* CM_FCLKEN_WKUP specific bits */
+
+/* CM_ICLKEN_WKUP specific bits */
+#define OMAP2430_EN_ICR_SHIFT                          6
+#define OMAP2430_EN_ICR                                        (1 << 6)
+#define OMAP24XX_EN_OMAPCTRL_SHIFT                     5
+#define OMAP24XX_EN_OMAPCTRL                           (1 << 5)
+#define OMAP24XX_EN_WDT1_SHIFT                         4
+#define OMAP24XX_EN_WDT1                               (1 << 4)
+#define OMAP24XX_EN_32KSYNC_SHIFT                      1
+#define OMAP24XX_EN_32KSYNC                            (1 << 1)
+
+/* CM_IDLEST_WKUP specific bits */
+#define OMAP2430_ST_ICR                                        (1 << 6)
+#define OMAP24XX_ST_OMAPCTRL                           (1 << 5)
+#define OMAP24XX_ST_WDT1                               (1 << 4)
+#define OMAP24XX_ST_MPU_WDT                            (1 << 3)
+#define OMAP24XX_ST_32KSYNC                            (1 << 1)
+
+/* CM_AUTOIDLE_WKUP */
+#define OMAP24XX_AUTO_OMAPCTRL                         (1 << 5)
+#define OMAP24XX_AUTO_WDT1                             (1 << 4)
+#define OMAP24XX_AUTO_MPU_WDT                          (1 << 3)
+#define OMAP24XX_AUTO_GPIOS                            (1 << 2)
+#define OMAP24XX_AUTO_32KSYNC                          (1 << 1)
+#define OMAP24XX_AUTO_GPT1                             (1 << 0)
+
+/* CM_CLKSEL_WKUP */
+#define OMAP24XX_CLKSEL_GPT1_SHIFT                     0
+#define OMAP24XX_CLKSEL_GPT1_MASK                      (0x3 << 0)
+
+/* CM_CLKEN_PLL */
+#define OMAP24XX_EN_54M_PLL_SHIFT                      6
+#define OMAP24XX_EN_54M_PLL_MASK                       (0x3 << 6)
+#define OMAP24XX_EN_96M_PLL_SHIFT                      2
+#define OMAP24XX_EN_96M_PLL_MASK                       (0x3 << 2)
+#define OMAP24XX_EN_DPLL_SHIFT                         0
+#define OMAP24XX_EN_DPLL_MASK                          (0x3 << 0)
+
+/* CM_IDLEST_CKGEN */
+#define OMAP24XX_ST_54M_APLL                           (1 << 9)
+#define OMAP24XX_ST_96M_APLL                           (1 << 8)
+#define OMAP24XX_ST_54M_CLK                            (1 << 6)
+#define OMAP24XX_ST_12M_CLK                            (1 << 5)
+#define OMAP24XX_ST_48M_CLK                            (1 << 4)
+#define OMAP24XX_ST_96M_CLK                            (1 << 2)
+#define OMAP24XX_ST_CORE_CLK_SHIFT                     0
+#define OMAP24XX_ST_CORE_CLK_MASK                      (0x3 << 0)
+
+/* CM_AUTOIDLE_PLL */
+#define OMAP24XX_AUTO_54M_SHIFT                                6
+#define OMAP24XX_AUTO_54M_MASK                         (0x3 << 6)
+#define OMAP24XX_AUTO_96M_SHIFT                                2
+#define OMAP24XX_AUTO_96M_MASK                         (0x3 << 2)
+#define OMAP24XX_AUTO_DPLL_SHIFT                       0
+#define OMAP24XX_AUTO_DPLL_MASK                                (0x3 << 0)
+
+/* CM_CLKSEL1_PLL */
+#define OMAP2430_MAXDPLLFASTLOCK_SHIFT                 28
+#define OMAP2430_MAXDPLLFASTLOCK_MASK                  (0x7 << 28)
+#define OMAP24XX_APLLS_CLKIN_SHIFT                     23
+#define OMAP24XX_APLLS_CLKIN_MASK                      (0x7 << 23)
+#define OMAP24XX_DPLL_MULT_SHIFT                       12
+#define OMAP24XX_DPLL_MULT_MASK                                (0x3ff << 12)
+#define OMAP24XX_DPLL_DIV_SHIFT                                8
+#define OMAP24XX_DPLL_DIV_MASK                         (0xf << 8)
+#define OMAP24XX_54M_SOURCE_SHIFT                      5
+#define OMAP24XX_54M_SOURCE                            (1 << 5)
+#define OMAP2430_96M_SOURCE_SHIFT                      4
+#define OMAP2430_96M_SOURCE                            (1 << 4)
+#define OMAP24XX_48M_SOURCE_SHIFT                      3
+#define OMAP24XX_48M_SOURCE                            (1 << 3)
+#define OMAP2430_ALTCLK_SOURCE_SHIFT                   0
+#define OMAP2430_ALTCLK_SOURCE_MASK                    (0x7 << 0)
+
+/* CM_CLKSEL2_PLL */
+#define OMAP24XX_CORE_CLK_SRC_SHIFT                    0
+#define OMAP24XX_CORE_CLK_SRC_MASK                     (0x3 << 0)
+
+/* CM_FCLKEN_DSP */
+#define OMAP2420_EN_IVA_COP_SHIFT                      10
+#define OMAP2420_EN_IVA_COP                            (1 << 10)
+#define OMAP2420_EN_IVA_MPU_SHIFT                      8
+#define OMAP2420_EN_IVA_MPU                            (1 << 8)
+#define OMAP24XX_CM_FCLKEN_DSP_EN_DSP_SHIFT            0
+#define OMAP24XX_CM_FCLKEN_DSP_EN_DSP                  (1 << 0)
+
+/* CM_ICLKEN_DSP */
+#define OMAP2420_EN_DSP_IPI_SHIFT                      1
+#define OMAP2420_EN_DSP_IPI                            (1 << 1)
+
+/* CM_IDLEST_DSP */
+#define OMAP2420_ST_IVA                                        (1 << 8)
+#define OMAP2420_ST_IPI                                        (1 << 1)
+#define OMAP24XX_ST_DSP                                        (1 << 0)
+
+/* CM_AUTOIDLE_DSP */
+#define OMAP2420_AUTO_DSP_IPI                          (1 << 1)
+
+/* CM_CLKSEL_DSP */
+#define OMAP2420_SYNC_IVA                              (1 << 13)
+#define OMAP2420_CLKSEL_IVA_SHIFT                      8
+#define OMAP2420_CLKSEL_IVA_MASK                       (0x1f << 8)
+#define OMAP24XX_SYNC_DSP                              (1 << 7)
+#define OMAP24XX_CLKSEL_DSP_IF_SHIFT                   5
+#define OMAP24XX_CLKSEL_DSP_IF_MASK                    (0x3 << 5)
+#define OMAP24XX_CLKSEL_DSP_SHIFT                      0
+#define OMAP24XX_CLKSEL_DSP_MASK                       (0x1f << 0)
+
+/* CM_CLKSTCTRL_DSP */
+#define OMAP2420_AUTOSTATE_IVA                         (1 << 8)
+#define OMAP24XX_AUTOSTATE_DSP                         (1 << 0)
+
+/* CM_FCLKEN_MDM */
+/* 2430 only */
+#define OMAP2430_EN_OSC_SHIFT                          1
+#define OMAP2430_EN_OSC                                        (1 << 1)
+
+/* CM_ICLKEN_MDM */
+/* 2430 only */
+#define OMAP2430_CM_ICLKEN_MDM_EN_MDM_SHIFT            0
+#define OMAP2430_CM_ICLKEN_MDM_EN_MDM                  (1 << 0)
+
+/* CM_IDLEST_MDM specific bits */
+/* 2430 only */
+
+/* CM_AUTOIDLE_MDM */
+/* 2430 only */
+#define OMAP2430_AUTO_OSC                              (1 << 1)
+#define OMAP2430_AUTO_MDM                              (1 << 0)
+
+/* CM_CLKSEL_MDM */
+/* 2430 only */
+#define OMAP2430_SYNC_MDM                              (1 << 4)
+#define OMAP2430_CLKSEL_MDM_SHIFT                      0
+#define OMAP2430_CLKSEL_MDM_MASK                       (0xf << 0)
+
+/* CM_CLKSTCTRL_MDM */
+/* 2430 only */
+#define OMAP2430_AUTOSTATE_MDM                         (1 << 0)
+
+#endif
diff --git a/arch/arm/mach-omap2/cm-regbits-34xx.h b/arch/arm/mach-omap2/cm-regbits-34xx.h
new file mode 100644 (file)
index 0000000..9249129
--- /dev/null
@@ -0,0 +1,673 @@
+#ifndef __ARCH_ARM_MACH_OMAP2_CM_REGBITS_34XX_H
+#define __ARCH_ARM_MACH_OMAP2_CM_REGBITS_34XX_H
+
+/*
+ * OMAP3430 Clock Management register bits
+ *
+ * Copyright (C) 2007-2008 Texas Instruments, Inc.
+ * Copyright (C) 2007-2008 Nokia Corporation
+ *
+ * Written by Paul Walmsley
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include "cm.h"
+
+/* Bits shared between registers */
+
+/* CM_FCLKEN1_CORE and CM_ICLKEN1_CORE shared bits */
+#define OMAP3430ES2_EN_MMC3_MASK                       (1 << 30)
+#define OMAP3430ES2_EN_MMC3_SHIFT                      30
+#define OMAP3430_EN_MSPRO                              (1 << 23)
+#define OMAP3430_EN_MSPRO_SHIFT                                23
+#define OMAP3430_EN_HDQ                                        (1 << 22)
+#define OMAP3430_EN_HDQ_SHIFT                          22
+#define OMAP3430ES1_EN_FSHOSTUSB                       (1 << 5)
+#define OMAP3430ES1_EN_FSHOSTUSB_SHIFT                 5
+#define OMAP3430ES1_EN_D2D                             (1 << 3)
+#define OMAP3430ES1_EN_D2D_SHIFT                       3
+#define OMAP3430_EN_SSI                                        (1 << 0)
+#define OMAP3430_EN_SSI_SHIFT                          0
+
+/* CM_FCLKEN3_CORE and CM_ICLKEN3_CORE shared bits */
+#define OMAP3430ES2_EN_USBTLL_SHIFT                    2
+#define OMAP3430ES2_EN_USBTLL_MASK                     (1 << 2)
+
+/* CM_FCLKEN_WKUP and CM_ICLKEN_WKUP shared bits */
+#define OMAP3430_EN_WDT2                               (1 << 5)
+#define OMAP3430_EN_WDT2_SHIFT                         5
+
+/* CM_ICLKEN_CAM, CM_FCLKEN_CAM shared bits */
+#define OMAP3430_EN_CAM                                        (1 << 0)
+#define OMAP3430_EN_CAM_SHIFT                          0
+
+/* CM_FCLKEN_PER, CM_ICLKEN_PER shared bits */
+#define OMAP3430_EN_WDT3                               (1 << 12)
+#define OMAP3430_EN_WDT3_SHIFT                         12
+
+/* CM_CLKSEL2_EMU, CM_CLKSEL3_EMU shared bits */
+#define OMAP3430_OVERRIDE_ENABLE                       (1 << 19)
+
+
+/* Bits specific to each register */
+
+/* CM_FCLKEN_IVA2 */
+#define OMAP3430_CM_FCLKEN_IVA2_EN_IVA2                        (1 << 0)
+
+/* CM_CLKEN_PLL_IVA2 */
+#define OMAP3430_IVA2_DPLL_RAMPTIME_SHIFT              8
+#define OMAP3430_IVA2_DPLL_RAMPTIME_MASK               (0x3 << 8)
+#define OMAP3430_IVA2_DPLL_FREQSEL_SHIFT               4
+#define OMAP3430_IVA2_DPLL_FREQSEL_MASK                        (0xf << 4)
+#define OMAP3430_EN_IVA2_DPLL_DRIFTGUARD_SHIFT         3
+#define OMAP3430_EN_IVA2_DPLL_DRIFTGUARD_MASK          (1 << 3)
+#define OMAP3430_EN_IVA2_DPLL_SHIFT                    0
+#define OMAP3430_EN_IVA2_DPLL_MASK                     (0x7 << 0)
+
+/* CM_IDLEST_IVA2 */
+#define OMAP3430_ST_IVA2                               (1 << 0)
+
+/* CM_IDLEST_PLL_IVA2 */
+#define OMAP3430_ST_IVA2_CLK                           (1 << 0)
+
+/* CM_AUTOIDLE_PLL_IVA2 */
+#define OMAP3430_AUTO_IVA2_DPLL_SHIFT                  0
+#define OMAP3430_AUTO_IVA2_DPLL_MASK                   (0x7 << 0)
+
+/* CM_CLKSEL1_PLL_IVA2 */
+#define OMAP3430_IVA2_CLK_SRC_SHIFT                    19
+#define OMAP3430_IVA2_CLK_SRC_MASK                     (0x3 << 19)
+#define OMAP3430_IVA2_DPLL_MULT_SHIFT                  8
+#define OMAP3430_IVA2_DPLL_MULT_MASK                   (0x7ff << 8)
+#define OMAP3430_IVA2_DPLL_DIV_SHIFT                   0
+#define OMAP3430_IVA2_DPLL_DIV_MASK                    (0x7f << 0)
+
+/* CM_CLKSEL2_PLL_IVA2 */
+#define OMAP3430_IVA2_DPLL_CLKOUT_DIV_SHIFT            0
+#define OMAP3430_IVA2_DPLL_CLKOUT_DIV_MASK             (0x1f << 0)
+
+/* CM_CLKSTCTRL_IVA2 */
+#define OMAP3430_CLKTRCTRL_IVA2_SHIFT                  0
+#define OMAP3430_CLKTRCTRL_IVA2_MASK                   (0x3 << 0)
+
+/* CM_CLKSTST_IVA2 */
+#define OMAP3430_CLKACTIVITY_IVA2                      (1 << 0)
+
+/* CM_REVISION specific bits */
+
+/* CM_SYSCONFIG specific bits */
+
+/* CM_CLKEN_PLL_MPU */
+#define OMAP3430_MPU_DPLL_RAMPTIME_SHIFT               8
+#define OMAP3430_MPU_DPLL_RAMPTIME_MASK                        (0x3 << 8)
+#define OMAP3430_MPU_DPLL_FREQSEL_SHIFT                        4
+#define OMAP3430_MPU_DPLL_FREQSEL_MASK                 (0xf << 4)
+#define OMAP3430_EN_MPU_DPLL_DRIFTGUARD_SHIFT          3
+#define OMAP3430_EN_MPU_DPLL_DRIFTGUARD_MASK           (1 << 3)
+#define OMAP3430_EN_MPU_DPLL_SHIFT                     0
+#define OMAP3430_EN_MPU_DPLL_MASK                      (0x7 << 0)
+
+/* CM_IDLEST_MPU */
+#define OMAP3430_ST_MPU                                        (1 << 0)
+
+/* CM_IDLEST_PLL_MPU */
+#define OMAP3430_ST_MPU_CLK                            (1 << 0)
+#define OMAP3430_ST_IVA2_CLK_MASK                      (1 << 0)
+
+/* CM_IDLEST_PLL_MPU */
+#define OMAP3430_ST_MPU_CLK_MASK                       (1 << 0)
+
+/* CM_AUTOIDLE_PLL_MPU */
+#define OMAP3430_AUTO_MPU_DPLL_SHIFT                   0
+#define OMAP3430_AUTO_MPU_DPLL_MASK                    (0x7 << 0)
+
+/* CM_CLKSEL1_PLL_MPU */
+#define OMAP3430_MPU_CLK_SRC_SHIFT                     19
+#define OMAP3430_MPU_CLK_SRC_MASK                      (0x3 << 19)
+#define OMAP3430_MPU_DPLL_MULT_SHIFT                   8
+#define OMAP3430_MPU_DPLL_MULT_MASK                    (0x7ff << 8)
+#define OMAP3430_MPU_DPLL_DIV_SHIFT                    0
+#define OMAP3430_MPU_DPLL_DIV_MASK                     (0x7f << 0)
+
+/* CM_CLKSEL2_PLL_MPU */
+#define OMAP3430_MPU_DPLL_CLKOUT_DIV_SHIFT             0
+#define OMAP3430_MPU_DPLL_CLKOUT_DIV_MASK              (0x1f << 0)
+
+/* CM_CLKSTCTRL_MPU */
+#define OMAP3430_CLKTRCTRL_MPU_SHIFT                   0
+#define OMAP3430_CLKTRCTRL_MPU_MASK                    (0x3 << 0)
+
+/* CM_CLKSTST_MPU */
+#define OMAP3430_CLKACTIVITY_MPU                       (1 << 0)
+
+/* CM_FCLKEN1_CORE specific bits */
+
+/* CM_ICLKEN1_CORE specific bits */
+#define OMAP3430_EN_ICR                                        (1 << 29)
+#define OMAP3430_EN_ICR_SHIFT                          29
+#define OMAP3430_EN_AES2                               (1 << 28)
+#define OMAP3430_EN_AES2_SHIFT                         28
+#define OMAP3430_EN_SHA12                              (1 << 27)
+#define OMAP3430_EN_SHA12_SHIFT                                27
+#define OMAP3430_EN_DES2                               (1 << 26)
+#define OMAP3430_EN_DES2_SHIFT                         26
+#define OMAP3430ES1_EN_FAC                             (1 << 8)
+#define OMAP3430ES1_EN_FAC_SHIFT                       8
+#define OMAP3430_EN_MAILBOXES                          (1 << 7)
+#define OMAP3430_EN_MAILBOXES_SHIFT                    7
+#define OMAP3430_EN_OMAPCTRL                           (1 << 6)
+#define OMAP3430_EN_OMAPCTRL_SHIFT                     6
+#define OMAP3430_EN_SDRC                               (1 << 1)
+#define OMAP3430_EN_SDRC_SHIFT                         1
+
+/* CM_ICLKEN2_CORE */
+#define OMAP3430_EN_PKA                                        (1 << 4)
+#define OMAP3430_EN_PKA_SHIFT                          4
+#define OMAP3430_EN_AES1                               (1 << 3)
+#define OMAP3430_EN_AES1_SHIFT                         3
+#define OMAP3430_EN_RNG                                        (1 << 2)
+#define OMAP3430_EN_RNG_SHIFT                          2
+#define OMAP3430_EN_SHA11                              (1 << 1)
+#define OMAP3430_EN_SHA11_SHIFT                                1
+#define OMAP3430_EN_DES1                               (1 << 0)
+#define OMAP3430_EN_DES1_SHIFT                         0
+
+/* CM_FCLKEN3_CORE specific bits */
+#define OMAP3430ES2_EN_TS_SHIFT                                1
+#define OMAP3430ES2_EN_TS_MASK                         (1 << 1)
+#define OMAP3430ES2_EN_CPEFUSE_SHIFT                   0
+#define OMAP3430ES2_EN_CPEFUSE_MASK                    (1 << 0)
+
+/* CM_IDLEST1_CORE specific bits */
+#define OMAP3430_ST_ICR                                        (1 << 29)
+#define OMAP3430_ST_AES2                               (1 << 28)
+#define OMAP3430_ST_SHA12                              (1 << 27)
+#define OMAP3430_ST_DES2                               (1 << 26)
+#define OMAP3430_ST_MSPRO                              (1 << 23)
+#define OMAP3430_ST_HDQ                                        (1 << 22)
+#define OMAP3430ES1_ST_FAC                             (1 << 8)
+#define OMAP3430ES1_ST_MAILBOXES                       (1 << 7)
+#define OMAP3430_ST_OMAPCTRL                           (1 << 6)
+#define OMAP3430_ST_SDMA                               (1 << 2)
+#define OMAP3430_ST_SDRC                               (1 << 1)
+#define OMAP3430_ST_SSI                                        (1 << 0)
+
+/* CM_IDLEST2_CORE */
+#define OMAP3430_ST_PKA                                        (1 << 4)
+#define OMAP3430_ST_AES1                               (1 << 3)
+#define OMAP3430_ST_RNG                                        (1 << 2)
+#define OMAP3430_ST_SHA11                              (1 << 1)
+#define OMAP3430_ST_DES1                               (1 << 0)
+
+/* CM_IDLEST3_CORE */
+#define OMAP3430ES2_ST_USBTLL_SHIFT                    2
+#define OMAP3430ES2_ST_USBTLL_MASK                     (1 << 2)
+
+/* CM_AUTOIDLE1_CORE */
+#define OMAP3430_AUTO_AES2                             (1 << 28)
+#define OMAP3430_AUTO_AES2_SHIFT                       28
+#define OMAP3430_AUTO_SHA12                            (1 << 27)
+#define OMAP3430_AUTO_SHA12_SHIFT                      27
+#define OMAP3430_AUTO_DES2                             (1 << 26)
+#define OMAP3430_AUTO_DES2_SHIFT                       26
+#define OMAP3430_AUTO_MMC2                             (1 << 25)
+#define OMAP3430_AUTO_MMC2_SHIFT                       25
+#define OMAP3430_AUTO_MMC1                             (1 << 24)
+#define OMAP3430_AUTO_MMC1_SHIFT                       24
+#define OMAP3430_AUTO_MSPRO                            (1 << 23)
+#define OMAP3430_AUTO_MSPRO_SHIFT                      23
+#define OMAP3430_AUTO_HDQ                              (1 << 22)
+#define OMAP3430_AUTO_HDQ_SHIFT                                22
+#define OMAP3430_AUTO_MCSPI4                           (1 << 21)
+#define OMAP3430_AUTO_MCSPI4_SHIFT                     21
+#define OMAP3430_AUTO_MCSPI3                           (1 << 20)
+#define OMAP3430_AUTO_MCSPI3_SHIFT                     20
+#define OMAP3430_AUTO_MCSPI2                           (1 << 19)
+#define OMAP3430_AUTO_MCSPI2_SHIFT                     19
+#define OMAP3430_AUTO_MCSPI1                           (1 << 18)
+#define OMAP3430_AUTO_MCSPI1_SHIFT                     18
+#define OMAP3430_AUTO_I2C3                             (1 << 17)
+#define OMAP3430_AUTO_I2C3_SHIFT                       17
+#define OMAP3430_AUTO_I2C2                             (1 << 16)
+#define OMAP3430_AUTO_I2C2_SHIFT                       16
+#define OMAP3430_AUTO_I2C1                             (1 << 15)
+#define OMAP3430_AUTO_I2C1_SHIFT                       15
+#define OMAP3430_AUTO_UART2                            (1 << 14)
+#define OMAP3430_AUTO_UART2_SHIFT                      14
+#define OMAP3430_AUTO_UART1                            (1 << 13)
+#define OMAP3430_AUTO_UART1_SHIFT                      13
+#define OMAP3430_AUTO_GPT11                            (1 << 12)
+#define OMAP3430_AUTO_GPT11_SHIFT                      12
+#define OMAP3430_AUTO_GPT10                            (1 << 11)
+#define OMAP3430_AUTO_GPT10_SHIFT                      11
+#define OMAP3430_AUTO_MCBSP5                           (1 << 10)
+#define OMAP3430_AUTO_MCBSP5_SHIFT                     10
+#define OMAP3430_AUTO_MCBSP1                           (1 << 9)
+#define OMAP3430_AUTO_MCBSP1_SHIFT                     9
+#define OMAP3430ES1_AUTO_FAC                           (1 << 8)
+#define OMAP3430ES1_AUTO_FAC_SHIFT                     8
+#define OMAP3430_AUTO_MAILBOXES                                (1 << 7)
+#define OMAP3430_AUTO_MAILBOXES_SHIFT                  7
+#define OMAP3430_AUTO_OMAPCTRL                         (1 << 6)
+#define OMAP3430_AUTO_OMAPCTRL_SHIFT                   6
+#define OMAP3430ES1_AUTO_FSHOSTUSB                     (1 << 5)
+#define OMAP3430ES1_AUTO_FSHOSTUSB_SHIFT               5
+#define OMAP3430_AUTO_HSOTGUSB                         (1 << 4)
+#define OMAP3430_AUTO_HSOTGUSB_SHIFT                   4
+#define OMAP3430ES1_AUTO_D2D                           (1 << 3)
+#define OMAP3430ES1_AUTO_D2D_SHIFT                     3
+#define OMAP3430_AUTO_SSI                              (1 << 0)
+#define OMAP3430_AUTO_SSI_SHIFT                                0
+
+/* CM_AUTOIDLE2_CORE */
+#define OMAP3430_AUTO_PKA                              (1 << 4)
+#define OMAP3430_AUTO_PKA_SHIFT                                4
+#define OMAP3430_AUTO_AES1                             (1 << 3)
+#define OMAP3430_AUTO_AES1_SHIFT                       3
+#define OMAP3430_AUTO_RNG                              (1 << 2)
+#define OMAP3430_AUTO_RNG_SHIFT                                2
+#define OMAP3430_AUTO_SHA11                            (1 << 1)
+#define OMAP3430_AUTO_SHA11_SHIFT                      1
+#define OMAP3430_AUTO_DES1                             (1 << 0)
+#define OMAP3430_AUTO_DES1_SHIFT                       0
+
+/* CM_AUTOIDLE3_CORE */
+#define OMAP3430ES2_AUTO_USBTLL_SHIFT                  2
+#define OMAP3430ES2_AUTO_USBTLL_MASK                   (1 << 2)
+
+/* CM_CLKSEL_CORE */
+#define OMAP3430_CLKSEL_SSI_SHIFT                      8
+#define OMAP3430_CLKSEL_SSI_MASK                       (0xf << 8)
+#define OMAP3430_CLKSEL_GPT11_MASK                     (1 << 7)
+#define OMAP3430_CLKSEL_GPT11_SHIFT                    7
+#define OMAP3430_CLKSEL_GPT10_MASK                     (1 << 6)
+#define OMAP3430_CLKSEL_GPT10_SHIFT                    6
+#define OMAP3430ES1_CLKSEL_FSHOSTUSB_SHIFT             4
+#define OMAP3430ES1_CLKSEL_FSHOSTUSB_MASK              (0x3 << 4)
+#define OMAP3430_CLKSEL_L4_SHIFT                       2
+#define OMAP3430_CLKSEL_L4_MASK                                (0x3 << 2)
+#define OMAP3430_CLKSEL_L3_SHIFT                       0
+#define OMAP3430_CLKSEL_L3_MASK                                (0x3 << 0)
+
+/* CM_CLKSTCTRL_CORE */
+#define OMAP3430ES1_CLKTRCTRL_D2D_SHIFT                        4
+#define OMAP3430ES1_CLKTRCTRL_D2D_MASK                 (0x3 << 4)
+#define OMAP3430_CLKTRCTRL_L4_SHIFT                    2
+#define OMAP3430_CLKTRCTRL_L4_MASK                     (0x3 << 2)
+#define OMAP3430_CLKTRCTRL_L3_SHIFT                    0
+#define OMAP3430_CLKTRCTRL_L3_MASK                     (0x3 << 0)
+
+/* CM_CLKSTST_CORE */
+#define OMAP3430ES1_CLKACTIVITY_D2D                    (1 << 2)
+#define OMAP3430_CLKACTIVITY_L4                                (1 << 1)
+#define OMAP3430_CLKACTIVITY_L3                                (1 << 0)
+
+/* CM_FCLKEN_GFX */
+#define OMAP3430ES1_EN_3D                              (1 << 2)
+#define OMAP3430ES1_EN_3D_SHIFT                                2
+#define OMAP3430ES1_EN_2D                              (1 << 1)
+#define OMAP3430ES1_EN_2D_SHIFT                                1
+
+/* CM_ICLKEN_GFX specific bits */
+
+/* CM_IDLEST_GFX specific bits */
+
+/* CM_CLKSEL_GFX specific bits */
+
+/* CM_SLEEPDEP_GFX specific bits */
+
+/* CM_CLKSTCTRL_GFX */
+#define OMAP3430ES1_CLKTRCTRL_GFX_SHIFT                        0
+#define OMAP3430ES1_CLKTRCTRL_GFX_MASK                 (0x3 << 0)
+
+/* CM_CLKSTST_GFX */
+#define OMAP3430ES1_CLKACTIVITY_GFX                    (1 << 0)
+
+/* CM_FCLKEN_SGX */
+#define OMAP3430ES2_EN_SGX_SHIFT                       1
+#define OMAP3430ES2_EN_SGX_MASK                                (1 << 1)
+
+/* CM_CLKSEL_SGX */
+#define OMAP3430ES2_CLKSEL_SGX_SHIFT                   0
+#define OMAP3430ES2_CLKSEL_SGX_MASK                    (0x7 << 0)
+
+/* CM_FCLKEN_WKUP specific bits */
+#define OMAP3430ES2_EN_USIMOCP_SHIFT                   9
+
+/* CM_ICLKEN_WKUP specific bits */
+#define OMAP3430_EN_WDT1                               (1 << 4)
+#define OMAP3430_EN_WDT1_SHIFT                         4
+#define OMAP3430_EN_32KSYNC                            (1 << 2)
+#define OMAP3430_EN_32KSYNC_SHIFT                      2
+
+/* CM_IDLEST_WKUP specific bits */
+#define OMAP3430_ST_WDT2                               (1 << 5)
+#define OMAP3430_ST_WDT1                               (1 << 4)
+#define OMAP3430_ST_32KSYNC                            (1 << 2)
+
+/* CM_AUTOIDLE_WKUP */
+#define OMAP3430_AUTO_WDT2                             (1 << 5)
+#define OMAP3430_AUTO_WDT2_SHIFT                       5
+#define OMAP3430_AUTO_WDT1                             (1 << 4)
+#define OMAP3430_AUTO_WDT1_SHIFT                       4
+#define OMAP3430_AUTO_GPIO1                            (1 << 3)
+#define OMAP3430_AUTO_GPIO1_SHIFT                      3
+#define OMAP3430_AUTO_32KSYNC                          (1 << 2)
+#define OMAP3430_AUTO_32KSYNC_SHIFT                    2
+#define OMAP3430_AUTO_GPT12                            (1 << 1)
+#define OMAP3430_AUTO_GPT12_SHIFT                      1
+#define OMAP3430_AUTO_GPT1                             (1 << 0)
+#define OMAP3430_AUTO_GPT1_SHIFT                       0
+
+/* CM_CLKSEL_WKUP */
+#define OMAP3430ES2_CLKSEL_USIMOCP_MASK                        (0xf << 3)
+#define OMAP3430_CLKSEL_RM_SHIFT                       1
+#define OMAP3430_CLKSEL_RM_MASK                                (0x3 << 1)
+#define OMAP3430_CLKSEL_GPT1_SHIFT                     0
+#define OMAP3430_CLKSEL_GPT1_MASK                      (1 << 0)
+
+/* CM_CLKEN_PLL */
+#define OMAP3430_PWRDN_EMU_PERIPH_SHIFT                        31
+#define OMAP3430_PWRDN_CAM_SHIFT                       30
+#define OMAP3430_PWRDN_DSS1_SHIFT                      29
+#define OMAP3430_PWRDN_TV_SHIFT                                28
+#define OMAP3430_PWRDN_96M_SHIFT                       27
+#define OMAP3430_PERIPH_DPLL_RAMPTIME_SHIFT            24
+#define OMAP3430_PERIPH_DPLL_RAMPTIME_MASK             (0x3 << 24)
+#define OMAP3430_PERIPH_DPLL_FREQSEL_SHIFT             20
+#define OMAP3430_PERIPH_DPLL_FREQSEL_MASK              (0xf << 20)
+#define OMAP3430_EN_PERIPH_DPLL_DRIFTGUARD_SHIFT       19
+#define OMAP3430_EN_PERIPH_DPLL_DRIFTGUARD_MASK                (1 << 19)
+#define OMAP3430_EN_PERIPH_DPLL_SHIFT                  16
+#define OMAP3430_EN_PERIPH_DPLL_MASK                   (0x7 << 16)
+#define OMAP3430_PWRDN_EMU_CORE_SHIFT                  12
+#define OMAP3430_CORE_DPLL_RAMPTIME_SHIFT              8
+#define OMAP3430_CORE_DPLL_RAMPTIME_MASK               (0x3 << 8)
+#define OMAP3430_CORE_DPLL_FREQSEL_SHIFT               4
+#define OMAP3430_CORE_DPLL_FREQSEL_MASK                        (0xf << 4)
+#define OMAP3430_EN_CORE_DPLL_DRIFTGUARD_SHIFT         3
+#define OMAP3430_EN_CORE_DPLL_DRIFTGUARD_MASK          (1 << 3)
+#define OMAP3430_EN_CORE_DPLL_SHIFT                    0
+#define OMAP3430_EN_CORE_DPLL_MASK                     (0x7 << 0)
+
+/* CM_CLKEN2_PLL */
+#define OMAP3430ES2_EN_PERIPH2_DPLL_LPMODE_SHIFT               10
+#define OMAP3430ES2_PERIPH2_DPLL_RAMPTIME_MASK         (0x3 << 8)
+#define OMAP3430ES2_PERIPH2_DPLL_FREQSEL_SHIFT         4
+#define OMAP3430ES2_PERIPH2_DPLL_FREQSEL_MASK          (0xf << 4)
+#define OMAP3430ES2_EN_PERIPH2_DPLL_DRIFTGUARD_SHIFT   3
+#define OMAP3430ES2_EN_PERIPH2_DPLL_SHIFT              0
+#define OMAP3430ES2_EN_PERIPH2_DPLL_MASK               (0x7 << 0)
+
+/* CM_IDLEST_CKGEN */
+#define OMAP3430_ST_54M_CLK                            (1 << 5)
+#define OMAP3430_ST_12M_CLK                            (1 << 4)
+#define OMAP3430_ST_48M_CLK                            (1 << 3)
+#define OMAP3430_ST_96M_CLK                            (1 << 2)
+#define OMAP3430_ST_PERIPH_CLK                         (1 << 1)
+#define OMAP3430_ST_CORE_CLK                           (1 << 0)
+
+/* CM_IDLEST2_CKGEN */
+#define OMAP3430ES2_ST_120M_CLK_SHIFT                  1
+#define OMAP3430ES2_ST_120M_CLK_MASK                   (1 << 1)
+#define OMAP3430ES2_ST_PERIPH2_CLK_SHIFT               0
+#define OMAP3430ES2_ST_PERIPH2_CLK_MASK                        (1 << 0)
+
+/* CM_AUTOIDLE_PLL */
+#define OMAP3430_AUTO_PERIPH_DPLL_SHIFT                        3
+#define OMAP3430_AUTO_PERIPH_DPLL_MASK                 (0x7 << 3)
+#define OMAP3430_AUTO_CORE_DPLL_SHIFT                  0
+#define OMAP3430_AUTO_CORE_DPLL_MASK                   (0x7 << 0)
+
+/* CM_CLKSEL1_PLL */
+/* Note that OMAP3430_CORE_DPLL_CLKOUT_DIV_MASK was (0x3 << 27) on 3430ES1 */
+#define OMAP3430_CORE_DPLL_CLKOUT_DIV_SHIFT            27
+#define OMAP3430_CORE_DPLL_CLKOUT_DIV_MASK             (0x1f << 27)
+#define OMAP3430_CORE_DPLL_MULT_SHIFT                  16
+#define OMAP3430_CORE_DPLL_MULT_MASK                   (0x7ff << 16)
+#define OMAP3430_CORE_DPLL_DIV_SHIFT                   8
+#define OMAP3430_CORE_DPLL_DIV_MASK                    (0x7f << 8)
+#define OMAP3430_SOURCE_54M                            (1 << 5)
+#define OMAP3430_SOURCE_48M                            (1 << 3)
+
+/* CM_CLKSEL2_PLL */
+#define OMAP3430_PERIPH_DPLL_MULT_SHIFT                        8
+#define OMAP3430_PERIPH_DPLL_MULT_MASK                 (0x7ff << 8)
+#define OMAP3430_PERIPH_DPLL_DIV_SHIFT                 0
+#define OMAP3430_PERIPH_DPLL_DIV_MASK                  (0x7f << 0)
+
+/* CM_CLKSEL3_PLL */
+#define OMAP3430_DIV_96M_SHIFT                         0
+#define OMAP3430_DIV_96M_MASK                          (0x1f << 0)
+
+/* CM_CLKSEL4_PLL */
+#define OMAP3430ES2_PERIPH2_DPLL_MULT_SHIFT            8
+#define OMAP3430ES2_PERIPH2_DPLL_MULT_MASK             (0x7ff << 8)
+#define OMAP3430ES2_PERIPH2_DPLL_DIV_SHIFT             0
+#define OMAP3430ES2_PERIPH2_DPLL_DIV_MASK              (0x7f << 0)
+
+/* CM_CLKSEL5_PLL */
+#define OMAP3430ES2_DIV_120M_SHIFT                     0
+#define OMAP3430ES2_DIV_120M_MASK                      (0x1f << 0)
+
+/* CM_CLKOUT_CTRL */
+#define OMAP3430_CLKOUT2_EN_SHIFT                      7
+#define OMAP3430_CLKOUT2_EN                            (1 << 7)
+#define OMAP3430_CLKOUT2_DIV_SHIFT                     3
+#define OMAP3430_CLKOUT2_DIV_MASK                      (0x7 << 3)
+#define OMAP3430_CLKOUT2SOURCE_SHIFT                   0
+#define OMAP3430_CLKOUT2SOURCE_MASK                    (0x3 << 0)
+
+/* CM_FCLKEN_DSS */
+#define OMAP3430_EN_TV                                 (1 << 2)
+#define OMAP3430_EN_TV_SHIFT                           2
+#define OMAP3430_EN_DSS2                               (1 << 1)
+#define OMAP3430_EN_DSS2_SHIFT                         1
+#define OMAP3430_EN_DSS1                               (1 << 0)
+#define OMAP3430_EN_DSS1_SHIFT                         0
+
+/* CM_ICLKEN_DSS */
+#define OMAP3430_CM_ICLKEN_DSS_EN_DSS                  (1 << 0)
+#define OMAP3430_CM_ICLKEN_DSS_EN_DSS_SHIFT            0
+
+/* CM_IDLEST_DSS */
+#define OMAP3430_ST_DSS                                        (1 << 0)
+
+/* CM_AUTOIDLE_DSS */
+#define OMAP3430_AUTO_DSS                              (1 << 0)
+#define OMAP3430_AUTO_DSS_SHIFT                                0
+
+/* CM_CLKSEL_DSS */
+#define OMAP3430_CLKSEL_TV_SHIFT                       8
+#define OMAP3430_CLKSEL_TV_MASK                                (0x1f << 8)
+#define OMAP3430_CLKSEL_DSS1_SHIFT                     0
+#define OMAP3430_CLKSEL_DSS1_MASK                      (0x1f << 0)
+
+/* CM_SLEEPDEP_DSS specific bits */
+
+/* CM_CLKSTCTRL_DSS */
+#define OMAP3430_CLKTRCTRL_DSS_SHIFT                   0
+#define OMAP3430_CLKTRCTRL_DSS_MASK                    (0x3 << 0)
+
+/* CM_CLKSTST_DSS */
+#define OMAP3430_CLKACTIVITY_DSS                       (1 << 0)
+
+/* CM_FCLKEN_CAM specific bits */
+
+/* CM_ICLKEN_CAM specific bits */
+
+/* CM_IDLEST_CAM */
+#define OMAP3430_ST_CAM                                        (1 << 0)
+
+/* CM_AUTOIDLE_CAM */
+#define OMAP3430_AUTO_CAM                              (1 << 0)
+#define OMAP3430_AUTO_CAM_SHIFT                                0
+
+/* CM_CLKSEL_CAM */
+#define OMAP3430_CLKSEL_CAM_SHIFT                      0
+#define OMAP3430_CLKSEL_CAM_MASK                       (0x1f << 0)
+
+/* CM_SLEEPDEP_CAM specific bits */
+
+/* CM_CLKSTCTRL_CAM */
+#define OMAP3430_CLKTRCTRL_CAM_SHIFT                   0
+#define OMAP3430_CLKTRCTRL_CAM_MASK                    (0x3 << 0)
+
+/* CM_CLKSTST_CAM */
+#define OMAP3430_CLKACTIVITY_CAM                       (1 << 0)
+
+/* CM_FCLKEN_PER specific bits */
+
+/* CM_ICLKEN_PER specific bits */
+
+/* CM_IDLEST_PER */
+#define OMAP3430_ST_WDT3                               (1 << 12)
+#define OMAP3430_ST_MCBSP4                             (1 << 2)
+#define OMAP3430_ST_MCBSP3                             (1 << 1)
+#define OMAP3430_ST_MCBSP2                             (1 << 0)
+
+/* CM_AUTOIDLE_PER */
+#define OMAP3430_AUTO_GPIO6                            (1 << 17)
+#define OMAP3430_AUTO_GPIO6_SHIFT                      17
+#define OMAP3430_AUTO_GPIO5                            (1 << 16)
+#define OMAP3430_AUTO_GPIO5_SHIFT                      16
+#define OMAP3430_AUTO_GPIO4                            (1 << 15)
+#define OMAP3430_AUTO_GPIO4_SHIFT                      15
+#define OMAP3430_AUTO_GPIO3                            (1 << 14)
+#define OMAP3430_AUTO_GPIO3_SHIFT                      14
+#define OMAP3430_AUTO_GPIO2                            (1 << 13)
+#define OMAP3430_AUTO_GPIO2_SHIFT                      13
+#define OMAP3430_AUTO_WDT3                             (1 << 12)
+#define OMAP3430_AUTO_WDT3_SHIFT                       12
+#define OMAP3430_AUTO_UART3                            (1 << 11)
+#define OMAP3430_AUTO_UART3_SHIFT                      11
+#define OMAP3430_AUTO_GPT9                             (1 << 10)
+#define OMAP3430_AUTO_GPT9_SHIFT                       10
+#define OMAP3430_AUTO_GPT8                             (1 << 9)
+#define OMAP3430_AUTO_GPT8_SHIFT                       9
+#define OMAP3430_AUTO_GPT7                             (1 << 8)
+#define OMAP3430_AUTO_GPT7_SHIFT                       8
+#define OMAP3430_AUTO_GPT6                             (1 << 7)
+#define OMAP3430_AUTO_GPT6_SHIFT                       7
+#define OMAP3430_AUTO_GPT5                             (1 << 6)
+#define OMAP3430_AUTO_GPT5_SHIFT                       6
+#define OMAP3430_AUTO_GPT4                             (1 << 5)
+#define OMAP3430_AUTO_GPT4_SHIFT                       5
+#define OMAP3430_AUTO_GPT3                             (1 << 4)
+#define OMAP3430_AUTO_GPT3_SHIFT                       4
+#define OMAP3430_AUTO_GPT2                             (1 << 3)
+#define OMAP3430_AUTO_GPT2_SHIFT                       3
+#define OMAP3430_AUTO_MCBSP4                           (1 << 2)
+#define OMAP3430_AUTO_MCBSP4_SHIFT                     2
+#define OMAP3430_AUTO_MCBSP3                           (1 << 1)
+#define OMAP3430_AUTO_MCBSP3_SHIFT                     1
+#define OMAP3430_AUTO_MCBSP2                           (1 << 0)
+#define OMAP3430_AUTO_MCBSP2_SHIFT                     0
+
+/* CM_CLKSEL_PER */
+#define OMAP3430_CLKSEL_GPT9_MASK                      (1 << 7)
+#define OMAP3430_CLKSEL_GPT9_SHIFT                     7
+#define OMAP3430_CLKSEL_GPT8_MASK                      (1 << 6)
+#define OMAP3430_CLKSEL_GPT8_SHIFT                     6
+#define OMAP3430_CLKSEL_GPT7_MASK                      (1 << 5)
+#define OMAP3430_CLKSEL_GPT7_SHIFT                     5
+#define OMAP3430_CLKSEL_GPT6_MASK                      (1 << 4)
+#define OMAP3430_CLKSEL_GPT6_SHIFT                     4
+#define OMAP3430_CLKSEL_GPT5_MASK                      (1 << 3)
+#define OMAP3430_CLKSEL_GPT5_SHIFT                     3
+#define OMAP3430_CLKSEL_GPT4_MASK                      (1 << 2)
+#define OMAP3430_CLKSEL_GPT4_SHIFT                     2
+#define OMAP3430_CLKSEL_GPT3_MASK                      (1 << 1)
+#define OMAP3430_CLKSEL_GPT3_SHIFT                     1
+#define OMAP3430_CLKSEL_GPT2_MASK                      (1 << 0)
+#define OMAP3430_CLKSEL_GPT2_SHIFT                     0
+
+/* CM_SLEEPDEP_PER specific bits */
+#define OMAP3430_CM_SLEEPDEP_PER_EN_IVA2               (1 << 2)
+
+/* CM_CLKSTCTRL_PER */
+#define OMAP3430_CLKTRCTRL_PER_SHIFT                   0
+#define OMAP3430_CLKTRCTRL_PER_MASK                    (0x3 << 0)
+
+/* CM_CLKSTST_PER */
+#define OMAP3430_CLKACTIVITY_PER                       (1 << 0)
+
+/* CM_CLKSEL1_EMU */
+#define OMAP3430_DIV_DPLL4_SHIFT                       24
+#define OMAP3430_DIV_DPLL4_MASK                                (0x1f << 24)
+#define OMAP3430_DIV_DPLL3_SHIFT                       16
+#define OMAP3430_DIV_DPLL3_MASK                                (0x1f << 16)
+#define OMAP3430_CLKSEL_TRACECLK_SHIFT                 11
+#define OMAP3430_CLKSEL_TRACECLK_MASK                  (0x7 << 11)
+#define OMAP3430_CLKSEL_PCLK_SHIFT                     8
+#define OMAP3430_CLKSEL_PCLK_MASK                      (0x7 << 8)
+#define OMAP3430_CLKSEL_PCLKX2_SHIFT                   6
+#define OMAP3430_CLKSEL_PCLKX2_MASK                    (0x3 << 6)
+#define OMAP3430_CLKSEL_ATCLK_SHIFT                    4
+#define OMAP3430_CLKSEL_ATCLK_MASK                     (0x3 << 4)
+#define OMAP3430_TRACE_MUX_CTRL_SHIFT                  2
+#define OMAP3430_TRACE_MUX_CTRL_MASK                   (0x3 << 2)
+#define OMAP3430_MUX_CTRL_SHIFT                                0
+#define OMAP3430_MUX_CTRL_MASK                         (0x3 << 0)
+
+/* CM_CLKSTCTRL_EMU */
+#define OMAP3430_CLKTRCTRL_EMU_SHIFT                   0
+#define OMAP3430_CLKTRCTRL_EMU_MASK                    (0x3 << 0)
+
+/* CM_CLKSTST_EMU */
+#define OMAP3430_CLKACTIVITY_EMU                       (1 << 0)
+
+/* CM_CLKSEL2_EMU specific bits */
+#define OMAP3430_CORE_DPLL_EMU_MULT_SHIFT              8
+#define OMAP3430_CORE_DPLL_EMU_MULT_MASK               (0x7ff << 8)
+#define OMAP3430_CORE_DPLL_EMU_DIV_SHIFT               0
+#define OMAP3430_CORE_DPLL_EMU_DIV_MASK                        (0x7f << 0)
+
+/* CM_CLKSEL3_EMU specific bits */
+#define OMAP3430_PERIPH_DPLL_EMU_MULT_SHIFT            8
+#define OMAP3430_PERIPH_DPLL_EMU_MULT_MASK             (0x7ff << 8)
+#define OMAP3430_PERIPH_DPLL_EMU_DIV_SHIFT             0
+#define OMAP3430_PERIPH_DPLL_EMU_DIV_MASK              (0x7f << 0)
+
+/* CM_POLCTRL */
+#define OMAP3430_CLKOUT2_POL                           (1 << 0)
+
+/* CM_IDLEST_NEON */
+#define OMAP3430_ST_NEON                               (1 << 0)
+
+/* CM_CLKSTCTRL_NEON */
+#define OMAP3430_CLKTRCTRL_NEON_SHIFT                  0
+#define OMAP3430_CLKTRCTRL_NEON_MASK                   (0x3 << 0)
+
+/* CM_FCLKEN_USBHOST */
+#define OMAP3430ES2_EN_USBHOST2_SHIFT                  1
+#define OMAP3430ES2_EN_USBHOST2_MASK                   (1 << 1)
+#define OMAP3430ES2_EN_USBHOST1_SHIFT                  0
+#define OMAP3430ES2_EN_USBHOST1_MASK                   (1 << 0)
+
+/* CM_ICLKEN_USBHOST */
+#define OMAP3430ES2_EN_USBHOST_SHIFT                   0
+#define OMAP3430ES2_EN_USBHOST_MASK                    (1 << 0)
+
+/* CM_IDLEST_USBHOST */
+
+/* CM_AUTOIDLE_USBHOST */
+#define OMAP3430ES2_AUTO_USBHOST_SHIFT                 0
+#define OMAP3430ES2_AUTO_USBHOST_MASK                  (1 << 0)
+
+/* CM_SLEEPDEP_USBHOST */
+#define OMAP3430ES2_EN_MPU_SHIFT                       1
+#define OMAP3430ES2_EN_MPU_MASK                                (1 << 1)
+#define OMAP3430ES2_EN_IVA2_SHIFT                      2
+#define OMAP3430ES2_EN_IVA2_MASK                       (1 << 2)
+
+/* CM_CLKSTCTRL_USBHOST */
+#define OMAP3430ES2_CLKTRCTRL_USBHOST_SHIFT            0
+#define OMAP3430ES2_CLKTRCTRL_USBHOST_MASK             (3 << 0)
+
+
+
+#endif
diff --git a/arch/arm/mach-omap2/cm.h b/arch/arm/mach-omap2/cm.h
new file mode 100644 (file)
index 0000000..8489f30
--- /dev/null
@@ -0,0 +1,124 @@
+#ifndef __ARCH_ASM_MACH_OMAP2_CM_H
+#define __ARCH_ASM_MACH_OMAP2_CM_H
+
+/*
+ * OMAP2/3 Clock Management (CM) register definitions
+ *
+ * Copyright (C) 2007-2008 Texas Instruments, Inc.
+ * Copyright (C) 2007-2008 Nokia Corporation
+ *
+ * Written by Paul Walmsley
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include "prcm-common.h"
+
+#ifndef __ASSEMBLER__
+#define OMAP_CM_REGADDR(module, reg)                                   \
+       (void __iomem *)IO_ADDRESS(OMAP2_CM_BASE + (module) + (reg))
+#else
+#define OMAP2420_CM_REGADDR(module, reg)                               \
+                       IO_ADDRESS(OMAP2420_CM_BASE + (module) + (reg))
+#define OMAP2430_CM_REGADDR(module, reg)                               \
+                       IO_ADDRESS(OMAP2430_CM_BASE + (module) + (reg))
+#define OMAP34XX_CM_REGADDR(module, reg)                               \
+                       IO_ADDRESS(OMAP3430_CM_BASE + (module) + (reg))
+#endif
+
+/*
+ * Architecture-specific global CM registers
+ * Use cm_{read,write}_reg() with these registers.
+ * These registers appear once per CM module.
+ */
+
+#define OMAP3430_CM_REVISION           OMAP_CM_REGADDR(OCP_MOD, 0x0000)
+#define OMAP3430_CM_SYSCONFIG          OMAP_CM_REGADDR(OCP_MOD, 0x0010)
+#define OMAP3430_CM_POLCTRL            OMAP_CM_REGADDR(OCP_MOD, 0x009c)
+
+#define OMAP3430_CM_CLKOUT_CTRL                OMAP_CM_REGADDR(OMAP3430_CCR_MOD, 0x0070)
+
+/*
+ * Module specific CM registers from CM_BASE + domain offset
+ * Use cm_{read,write}_mod_reg() with these registers.
+ * These register offsets generally appear in more than one PRCM submodule.
+ */
+
+/* Common between 24xx and 34xx */
+
+#define CM_FCLKEN                                      0x0000
+#define CM_FCLKEN1                                     CM_FCLKEN
+#define CM_CLKEN                                       CM_FCLKEN
+#define CM_ICLKEN                                      0x0010
+#define CM_ICLKEN1                                     CM_ICLKEN
+#define CM_ICLKEN2                                     0x0014
+#define CM_ICLKEN3                                     0x0018
+#define CM_IDLEST                                      0x0020
+#define CM_IDLEST1                                     CM_IDLEST
+#define CM_IDLEST2                                     0x0024
+#define CM_AUTOIDLE                                    0x0030
+#define CM_AUTOIDLE1                                   CM_AUTOIDLE
+#define CM_AUTOIDLE2                                   0x0034
+#define CM_AUTOIDLE3                                   0x0038
+#define CM_CLKSEL                                      0x0040
+#define CM_CLKSEL1                                     CM_CLKSEL
+#define CM_CLKSEL2                                     0x0044
+#define CM_CLKSTCTRL                                   0x0048
+
+
+/* Architecture-specific registers */
+
+#define OMAP24XX_CM_FCLKEN2                            0x0004
+#define OMAP24XX_CM_ICLKEN4                            0x001c
+#define OMAP24XX_CM_AUTOIDLE4                          0x003c
+
+#define OMAP2430_CM_IDLEST3                            0x0028
+
+#define OMAP3430_CM_CLKEN_PLL                          0x0004
+#define OMAP3430ES2_CM_CLKEN2                          0x0004
+#define OMAP3430ES2_CM_FCLKEN3                         0x0008
+#define OMAP3430_CM_IDLEST_PLL                         CM_IDLEST2
+#define OMAP3430_CM_AUTOIDLE_PLL                       CM_AUTOIDLE2
+#define OMAP3430_CM_CLKSEL1                            CM_CLKSEL
+#define OMAP3430_CM_CLKSEL1_PLL                                CM_CLKSEL
+#define OMAP3430_CM_CLKSEL2_PLL                                CM_CLKSEL2
+#define OMAP3430_CM_SLEEPDEP                           CM_CLKSEL2
+#define OMAP3430_CM_CLKSEL3                            CM_CLKSTCTRL
+#define OMAP3430_CM_CLKSTST                            0x004c
+#define OMAP3430ES2_CM_CLKSEL4                         0x004c
+#define OMAP3430ES2_CM_CLKSEL5                         0x0050
+#define OMAP3430_CM_CLKSEL2_EMU                                0x0050
+#define OMAP3430_CM_CLKSEL3_EMU                                0x0054
+
+
+/* Clock management domain register get/set */
+
+#ifndef __ASSEMBLER__
+static inline void cm_write_mod_reg(u32 val, s16 module, s16 idx)
+{
+       __raw_writel(val, OMAP_CM_REGADDR(module, idx));
+}
+
+static inline u32 cm_read_mod_reg(s16 module, s16 idx)
+{
+       return __raw_readl(OMAP_CM_REGADDR(module, idx));
+}
+#endif
+
+/* CM register bits shared between 24XX and 3430 */
+
+/* CM_CLKSEL_GFX */
+#define OMAP_CLKSEL_GFX_SHIFT                          0
+#define OMAP_CLKSEL_GFX_MASK                           (0x7 << 0)
+
+/* CM_ICLKEN_GFX */
+#define OMAP_EN_GFX_SHIFT                              0
+#define OMAP_EN_GFX                                    (1 << 0)
+
+/* CM_IDLEST_GFX */
+#define OMAP_ST_GFX                                    (1 << 0)
+
+
+#endif
diff --git a/arch/arm/mach-omap2/control.c b/arch/arm/mach-omap2/control.c
new file mode 100644 (file)
index 0000000..a5d86a4
--- /dev/null
@@ -0,0 +1,74 @@
+/*
+ * OMAP2/3 System Control Module register access
+ *
+ * Copyright (C) 2007 Texas Instruments, Inc.
+ * Copyright (C) 2007 Nokia Corporation
+ *
+ * Written by Paul Walmsley
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+#undef DEBUG
+
+#include <linux/kernel.h>
+
+#include <asm/io.h>
+
+#include <asm/arch/control.h>
+
+static u32 omap2_ctrl_base;
+
+#define OMAP_CTRL_REGADDR(reg) (void __iomem *)IO_ADDRESS(omap2_ctrl_base \
+                                                               + (reg))
+
+void omap_ctrl_base_set(u32 base)
+{
+       omap2_ctrl_base = base;
+}
+
+u32 omap_ctrl_base_get(void)
+{
+       return omap2_ctrl_base;
+}
+
+u8 omap_ctrl_readb(u16 offset)
+{
+       return __raw_readb(OMAP_CTRL_REGADDR(offset));
+}
+
+u16 omap_ctrl_readw(u16 offset)
+{
+       return __raw_readw(OMAP_CTRL_REGADDR(offset));
+}
+
+u32 omap_ctrl_readl(u16 offset)
+{
+       return __raw_readl(OMAP_CTRL_REGADDR(offset));
+}
+
+void omap_ctrl_writeb(u8 val, u16 offset)
+{
+       pr_debug("omap_ctrl_writeb: writing 0x%0x to 0x%0x\n", val,
+                (u32)OMAP_CTRL_REGADDR(offset));
+
+       __raw_writeb(val, OMAP_CTRL_REGADDR(offset));
+}
+
+void omap_ctrl_writew(u16 val, u16 offset)
+{
+       pr_debug("omap_ctrl_writew: writing 0x%0x to 0x%0x\n", val,
+                (u32)OMAP_CTRL_REGADDR(offset));
+
+       __raw_writew(val, OMAP_CTRL_REGADDR(offset));
+}
+
+void omap_ctrl_writel(u32 val, u16 offset)
+{
+       pr_debug("omap_ctrl_writel: writing 0x%0x to 0x%0x\n", val,
+                (u32)OMAP_CTRL_REGADDR(offset));
+
+       __raw_writel(val, OMAP_CTRL_REGADDR(offset));
+}
+
index 5a4cc2076a7d4cf23c13d97e61f8bb5306b0b2e7..02cede295e89795b02e77f9167c70f375c06fd48 100644 (file)
@@ -69,7 +69,7 @@ static void __iomem *gpmc_base =
 static void __iomem *gpmc_cs_base =
        (void __iomem *) IO_ADDRESS(GPMC_BASE) + GPMC_CS0;
 
-static struct clk *gpmc_l3_clk;
+static struct clk *gpmc_fck;
 
 static void gpmc_write_reg(int idx, u32 val)
 {
@@ -94,11 +94,10 @@ u32 gpmc_cs_read_reg(int cs, int idx)
        return __raw_readl(gpmc_cs_base + (cs * GPMC_CS_SIZE) + idx);
 }
 
-/* TODO: Add support for gpmc_fck to clock framework and use it */
 unsigned long gpmc_get_fclk_period(void)
 {
        /* In picoseconds */
-       return 1000000000 / ((clk_get_rate(gpmc_l3_clk)) / 1000);
+       return 1000000000 / ((clk_get_rate(gpmc_fck)) / 1000);
 }
 
 unsigned int gpmc_ns_to_ticks(unsigned int time_ns)
@@ -398,8 +397,11 @@ void __init gpmc_init(void)
 {
        u32 l;
 
-       gpmc_l3_clk = clk_get(NULL, "core_l3_ck");
-       BUG_ON(IS_ERR(gpmc_l3_clk));
+       gpmc_fck = clk_get(NULL, "gpmc_fck"); /* Always on ENABLE_ON_INIT */
+       if (IS_ERR(gpmc_fck))
+               WARN_ON(1);
+       else
+               clk_enable(gpmc_fck);
 
        l = gpmc_read_reg(GPMC_REVISION);
        printk(KERN_INFO "GPMC revision %d.%d\n", (l >> 4) & 0x0f, l & 0x0f);
index 3e5d8cd4ea4f9ed6fb08737e03661d4af6899291..12479081881aed261f9fb44826ca5bbf6eb32f6b 100644 (file)
 #include <asm/arch/clock.h>
 #include <asm/arch/sram.h>
 
-#include "prcm-regs.h"
+#include "prm.h"
+
 #include "memory.h"
+#include "sdrc.h"
 
+unsigned long omap2_sdrc_base;
+unsigned long omap2_sms_base;
 
 static struct memory_timings mem_timings;
+static u32 curr_perf_level = CORE_CLK_SRC_DPLL_X2;
 
 u32 omap2_memory_get_slow_dll_ctrl(void)
 {
@@ -48,12 +53,60 @@ u32 omap2_memory_get_type(void)
        return mem_timings.m_type;
 }
 
+/*
+ * Check the DLL lock state, and return tue if running in unlock mode.
+ * This is needed to compensate for the shifted DLL value in unlock mode.
+ */
+u32 omap2_dll_force_needed(void)
+{
+       /* dlla and dllb are a set */
+       u32 dll_state = sdrc_read_reg(SDRC_DLLA_CTRL);
+
+       if ((dll_state & (1 << 2)) == (1 << 2))
+               return 1;
+       else
+               return 0;
+}
+
+/*
+ * 'level' is the value to store to CM_CLKSEL2_PLL.CORE_CLK_SRC.
+ * Practical values are CORE_CLK_SRC_DPLL (for CORE_CLK = DPLL_CLK) or
+ * CORE_CLK_SRC_DPLL_X2 (for CORE_CLK = * DPLL_CLK * 2)
+ */
+u32 omap2_reprogram_sdrc(u32 level, u32 force)
+{
+       u32 dll_ctrl, m_type;
+       u32 prev = curr_perf_level;
+       unsigned long flags;
+
+       if ((curr_perf_level == level) && !force)
+               return prev;
+
+       if (level == CORE_CLK_SRC_DPLL) {
+               dll_ctrl = omap2_memory_get_slow_dll_ctrl();
+       } else if (level == CORE_CLK_SRC_DPLL_X2) {
+               dll_ctrl = omap2_memory_get_fast_dll_ctrl();
+       } else {
+               return prev;
+       }
+
+       m_type = omap2_memory_get_type();
+
+       local_irq_save(flags);
+       __raw_writel(0xffff, OMAP24XX_PRCM_VOLTSETUP);
+       omap2_sram_reprogram_sdrc(level, dll_ctrl, m_type);
+       curr_perf_level = level;
+       local_irq_restore(flags);
+
+       return prev;
+}
+
 void omap2_init_memory_params(u32 force_lock_to_unlock_mode)
 {
        unsigned long dll_cnt;
        u32 fast_dll = 0;
 
-       mem_timings.m_type = !((SDRC_MR_0 & 0x3) == 0x1); /* DDR = 1, SDR = 0 */
+       mem_timings.m_type = !((sdrc_read_reg(SDRC_MR_0) & 0x3) == 0x1); /* DDR = 1, SDR = 0 */
 
        /* 2422 es2.05 and beyond has a single SIP DDR instead of 2 like others.
         * In the case of 2422, its ok to use CS1 instead of CS0.
@@ -73,11 +126,11 @@ void omap2_init_memory_params(u32 force_lock_to_unlock_mode)
                mem_timings.dll_mode = M_LOCK;
 
        if (mem_timings.base_cs == 0) {
-               fast_dll = SDRC_DLLA_CTRL;
-               dll_cnt = SDRC_DLLA_STATUS & 0xff00;
+               fast_dll = sdrc_read_reg(SDRC_DLLA_CTRL);
+               dll_cnt = sdrc_read_reg(SDRC_DLLA_STATUS) & 0xff00;
        } else {
-               fast_dll = SDRC_DLLB_CTRL;
-               dll_cnt = SDRC_DLLB_STATUS & 0xff00;
+               fast_dll = sdrc_read_reg(SDRC_DLLB_CTRL);
+               dll_cnt = sdrc_read_reg(SDRC_DLLB_STATUS) & 0xff00;
        }
        if (force_lock_to_unlock_mode) {
                fast_dll &= ~0xff00;
@@ -106,14 +159,13 @@ void __init omap2_init_memory(void)
 {
        u32 l;
 
-       l = SMS_SYSCONFIG;
+       l = sms_read_reg(SMS_SYSCONFIG);
        l &= ~(0x3 << 3);
        l |= (0x2 << 3);
-       SMS_SYSCONFIG = l;
+       sms_write_reg(l, SMS_SYSCONFIG);
 
-       l = SDRC_SYSCONFIG;
+       l = sdrc_read_reg(SDRC_SYSCONFIG);
        l &= ~(0x3 << 3);
        l |= (0x2 << 3);
-       SDRC_SYSCONFIG = l;
-
+       sdrc_write_reg(l, SDRC_SYSCONFIG);
 }
index d212eea83a051b05e020e8a92d60350a32a457e8..9a280b50a89306e977771e55dc3c0793d58980f2 100644 (file)
@@ -32,3 +32,5 @@ extern void omap2_init_memory_params(u32 force_lock_to_unlock_mode);
 extern u32 omap2_memory_get_slow_dll_ctrl(void);
 extern u32 omap2_memory_get_fast_dll_ctrl(void);
 extern u32 omap2_memory_get_type(void);
+u32 omap2_dll_force_needed(void);
+u32 omap2_reprogram_sdrc(u32 level, u32 force);
index 05750975d7463ebde347f3f08c14d56651e0bf25..930770012a75a89dccb9408a25c05e597726ff3d 100644 (file)
@@ -1,11 +1,12 @@
 /*
  * linux/arch/arm/mach-omap2/mux.c
  *
- * OMAP1 pin multiplexing configurations
+ * OMAP2 pin multiplexing configurations
  *
- * Copyright (C) 2003 - 2005 Nokia Corporation
+ * Copyright (C) 2004 - 2008 Texas Instruments Inc.
+ * Copyright (C) 2003 - 2008 Nokia Corporation
  *
- * Written by Tony Lindgren <tony.lindgren@nokia.com>
+ * Written by Tony Lindgren
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
 #include <asm/io.h>
 #include <linux/spinlock.h>
 
+#include <asm/arch/control.h>
 #include <asm/arch/mux.h>
 
 #ifdef CONFIG_OMAP_MUX
 
+static struct omap_mux_cfg arch_mux_cfg;
+
 /* NOTE: See mux.h for the enumeration */
 
-struct pin_config __initdata_or_module omap24xx_pins[] = {
+#ifdef CONFIG_ARCH_OMAP24XX
+static struct pin_config __initdata_or_module omap24xx_pins[] = {
 /*
  *     description                     mux     mux     pull    pull    debug
  *                                     offset  mode    ena     type
@@ -77,7 +82,12 @@ MUX_CFG_24XX("AA12_242X_GPIO17",     0x0e9,  3,      0,      0,      1)
 MUX_CFG_24XX("AA8_242X_GPIO58",                0x0ea,  3,      0,      0,      1)
 MUX_CFG_24XX("Y20_24XX_GPIO60",                0x12c,  3,      0,      0,      1)
 MUX_CFG_24XX("W4__24XX_GPIO74",                0x0f2,  3,      0,      0,      1)
+MUX_CFG_24XX("N15_24XX_GPIO85",                0x103,  3,      0,      0,      1)
 MUX_CFG_24XX("M15_24XX_GPIO92",                0x10a,  3,      0,      0,      1)
+MUX_CFG_24XX("P20_24XX_GPIO93",                0x10b,  3,      0,      0,      1)
+MUX_CFG_24XX("P18_24XX_GPIO95",                0x10d,  3,      0,      0,      1)
+MUX_CFG_24XX("M18_24XX_GPIO96",                0x10e,  3,      0,      0,      1)
+MUX_CFG_24XX("L14_24XX_GPIO97",                0x10f,  3,      0,      0,      1)
 MUX_CFG_24XX("J15_24XX_GPIO99",                0x113,  3,      1,      1,      1)
 MUX_CFG_24XX("V14_24XX_GPIO117",       0x128,  3,      1,      0,      1)
 MUX_CFG_24XX("P14_24XX_GPIO125",       0x140,  3,      1,      1,      1)
@@ -102,9 +112,6 @@ MUX_CFG_24XX("G4_242X_DMAREQ3",             0x073,  2,      0,      0,      1)
 MUX_CFG_24XX("D3_242X_DMAREQ4",                0x072,  2,      0,      0,      1)
 MUX_CFG_24XX("E3_242X_DMAREQ5",                0x071,  2,      0,      0,      1)
 
-/* TSC IRQ */
-MUX_CFG_24XX("P20_24XX_TSC_IRQ",       0x108,  0,      0,      0,      1)
-
 /* UART3 */
 MUX_CFG_24XX("K15_24XX_UART3_TX",      0x118,  0,      0,      0,      1)
 MUX_CFG_24XX("K14_24XX_UART3_RX",      0x119,  0,      0,      0,      1)
@@ -167,12 +174,108 @@ MUX_CFG_24XX("B3__24XX_KBR5",            0x30,   3,      1,      1,      1)
 MUX_CFG_24XX("AA4_24XX_KBC2",          0xe7,   3,      0,      0,      1)
 MUX_CFG_24XX("B13_24XX_KBC6",          0x110,  3,      0,      0,      1)
 
+/* 2430 USB */
+MUX_CFG_24XX("AD9_2430_USB0_PUEN",     0x133,  4,      0,      0,      1)
+MUX_CFG_24XX("Y11_2430_USB0_VP",       0x134,  4,      0,      0,      1)
+MUX_CFG_24XX("AD7_2430_USB0_VM",       0x135,  4,      0,      0,      1)
+MUX_CFG_24XX("AE7_2430_USB0_RCV",      0x136,  4,      0,      0,      1)
+MUX_CFG_24XX("AD4_2430_USB0_TXEN",     0x137,  4,      0,      0,      1)
+MUX_CFG_24XX("AF9_2430_USB0_SE0",      0x138,  4,      0,      0,      1)
+MUX_CFG_24XX("AE6_2430_USB0_DAT",      0x139,  4,      0,      0,      1)
+MUX_CFG_24XX("AD24_2430_USB1_SE0",     0x107,  2,      0,      0,      1)
+MUX_CFG_24XX("AB24_2430_USB1_RCV",     0x108,  2,      0,      0,      1)
+MUX_CFG_24XX("Y25_2430_USB1_TXEN",     0x109,  2,      0,      0,      1)
+MUX_CFG_24XX("AA26_2430_USB1_DAT",     0x10A,  2,      0,      0,      1)
+
+/* 2430 HS-USB */
+MUX_CFG_24XX("AD9_2430_USB0HS_DATA3",  0x133,  0,      0,      0,      1)
+MUX_CFG_24XX("Y11_2430_USB0HS_DATA4",  0x134,  0,      0,      0,      1)
+MUX_CFG_24XX("AD7_2430_USB0HS_DATA5",  0x135,  0,      0,      0,      1)
+MUX_CFG_24XX("AE7_2430_USB0HS_DATA6",  0x136,  0,      0,      0,      1)
+MUX_CFG_24XX("AD4_2430_USB0HS_DATA2",  0x137,  0,      0,      0,      1)
+MUX_CFG_24XX("AF9_2430_USB0HS_DATA0",  0x138,  0,      0,      0,      1)
+MUX_CFG_24XX("AE6_2430_USB0HS_DATA1",  0x139,  0,      0,      0,      1)
+MUX_CFG_24XX("AE8_2430_USB0HS_CLK",    0x13A,  0,      0,      0,      1)
+MUX_CFG_24XX("AD8_2430_USB0HS_DIR",    0x13B,  0,      0,      0,      1)
+MUX_CFG_24XX("AE5_2430_USB0HS_STP",    0x13c,  0,      1,      1,      1)
+MUX_CFG_24XX("AE9_2430_USB0HS_NXT",    0x13D,  0,      0,      0,      1)
+MUX_CFG_24XX("AC7_2430_USB0HS_DATA7",  0x13E,  0,      0,      0,      1)
+
+/* 2430 McBSP */
+MUX_CFG_24XX("AC10_2430_MCBSP2_FSX",   0x012E, 1,      0,      0,      1)
+MUX_CFG_24XX("AD16_2430_MCBSP2_CLX",   0x012F, 1,      0,      0,      1)
+MUX_CFG_24XX("AE13_2430_MCBSP2_DX",    0x0130, 1,      0,      0,      1)
+MUX_CFG_24XX("AD13_2430_MCBSP2_DR",    0x0131, 1,      0,      0,      1)
+MUX_CFG_24XX("AC10_2430_MCBSP2_FSX_OFF",0x012E,        0,      0,      0,      1)
+MUX_CFG_24XX("AD16_2430_MCBSP2_CLX_OFF",0x012F,        0,      0,      0,      1)
+MUX_CFG_24XX("AE13_2430_MCBSP2_DX_OFF",        0x0130, 0,      0,      0,      1)
+MUX_CFG_24XX("AD13_2430_MCBSP2_DR_OFF",        0x0131, 0,      0,      0,      1)
 };
 
-int __init omap2_mux_init(void)
+#define OMAP24XX_PINS_SZ       ARRAY_SIZE(omap24xx_pins)
+
+#else
+#define omap24xx_pins          NULL
+#define OMAP24XX_PINS_SZ       0
+#endif /* CONFIG_ARCH_OMAP24XX */
+
+#define OMAP24XX_PULL_ENA      (1 << 3)
+#define OMAP24XX_PULL_UP       (1 << 4)
+
+#if defined(CONFIG_OMAP_MUX_DEBUG) || defined(CONFIG_OMAP_MUX_WARNINGS)
+void __init_or_module omap2_cfg_debug(const struct pin_config *cfg, u8 reg)
 {
-       omap_mux_register(omap24xx_pins, ARRAY_SIZE(omap24xx_pins));
+       u16 orig;
+       u8 warn = 0, debug = 0;
+
+       orig = omap_ctrl_readb(cfg->mux_reg);
+
+#ifdef CONFIG_OMAP_MUX_DEBUG
+       debug = cfg->debug;
+#endif
+       warn = (orig != reg);
+       if (debug || warn)
+               printk(KERN_WARNING
+                       "MUX: setup %s (0x%08x): 0x%02x -> 0x%02x\n",
+                       cfg->name, omap_ctrl_base_get() + cfg->mux_reg,
+                       orig, reg);
+}
+#else
+#define omap2_cfg_debug(x, y)  do {} while (0)
+#endif
+
+#ifdef CONFIG_ARCH_OMAP24XX
+int __init_or_module omap24xx_cfg_reg(const struct pin_config *cfg)
+{
+       static DEFINE_SPINLOCK(mux_spin_lock);
+       unsigned long flags;
+       u8 reg = 0;
+
+       spin_lock_irqsave(&mux_spin_lock, flags);
+       reg |= cfg->mask & 0x7;
+       if (cfg->pull_val)
+               reg |= OMAP24XX_PULL_ENA;
+       if (cfg->pu_pd_val)
+               reg |= OMAP24XX_PULL_UP;
+       omap2_cfg_debug(cfg, reg);
+       omap_ctrl_writeb(reg, cfg->mux_reg);
+       spin_unlock_irqrestore(&mux_spin_lock, flags);
+
        return 0;
 }
+#else
+#define omap24xx_cfg_reg       0
+#endif
+
+int __init omap2_mux_init(void)
+{
+       if (cpu_is_omap24xx()) {
+               arch_mux_cfg.pins       = omap24xx_pins;
+               arch_mux_cfg.size       = OMAP24XX_PINS_SZ;
+               arch_mux_cfg.cfg_reg    = omap24xx_cfg_reg;
+       }
+
+       return omap_mux_register(&arch_mux_cfg);
+}
 
 #endif
diff --git a/arch/arm/mach-omap2/pm-domain.c b/arch/arm/mach-omap2/pm-domain.c
deleted file mode 100644 (file)
index 2494091..0000000
+++ /dev/null
@@ -1,299 +0,0 @@
-/*
- * linux/arch/arm/mach-omap2/pm-domain.c
- *
- * Power domain functions for OMAP2
- *
- * Copyright (C) 2006 Nokia Corporation
- * Tony Lindgren <tony@atomide.com>
- *
- * Some code based on earlier OMAP2 sample PM code
- * Copyright (C) 2005 Texas Instruments, Inc.
- * Richard Woodruff <r-woodruff2@ti.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-
-#include <linux/module.h>
-#include <linux/init.h>
-#include <linux/clk.h>
-
-#include <asm/io.h>
-
-#include "prcm-regs.h"
-
-/* Power domain offsets */
-#define PM_MPU_OFFSET                  0x100
-#define PM_CORE_OFFSET                 0x200
-#define PM_GFX_OFFSET                  0x300
-#define PM_WKUP_OFFSET                 0x400           /* Autoidle only */
-#define PM_PLL_OFFSET                  0x500           /* Autoidle only */
-#define PM_DSP_OFFSET                  0x800
-#define PM_MDM_OFFSET                  0xc00
-
-/* Power domain wake-up dependency control register */
-#define PM_WKDEP_OFFSET                        0xc8
-#define                EN_MDM                  (1 << 5)
-#define                EN_WKUP                 (1 << 4)
-#define                EN_GFX                  (1 << 3)
-#define                EN_DSP                  (1 << 2)
-#define                EN_MPU                  (1 << 1)
-#define                EN_CORE                 (1 << 0)
-
-/* Core power domain state transition control register */
-#define PM_PWSTCTRL_OFFSET             0xe0
-#define                FORCESTATE              (1 << 18)       /* Only for DSP & GFX */
-#define                MEM4RETSTATE            (1 << 6)
-#define                MEM3RETSTATE            (1 << 5)
-#define                MEM2RETSTATE            (1 << 4)
-#define                MEM1RETSTATE            (1 << 3)
-#define                LOGICRETSTATE           (1 << 2)        /* Logic is retained */
-#define                POWERSTATE_OFF          0x3
-#define                POWERSTATE_RETENTION    0x1
-#define                POWERSTATE_ON           0x0
-
-/* Power domain state register */
-#define PM_PWSTST_OFFSET               0xe4
-
-/* Hardware supervised state transition control register */
-#define CM_CLKSTCTRL_OFFSET            0x48
-#define                AUTOSTAT_MPU            (1 << 0)        /* MPU */
-#define                AUTOSTAT_DSS            (1 << 2)        /* Core */
-#define                AUTOSTAT_L4             (1 << 1)        /* Core */
-#define                AUTOSTAT_L3             (1 << 0)        /* Core */
-#define                AUTOSTAT_GFX            (1 << 0)        /* GFX */
-#define                AUTOSTAT_IVA            (1 << 8)        /* 2420 IVA in DSP domain */
-#define                AUTOSTAT_DSP            (1 << 0)        /* DSP */
-#define                AUTOSTAT_MDM            (1 << 0)        /* MDM */
-
-/* Automatic control of interface clock idling */
-#define CM_AUTOIDLE1_OFFSET            0x30
-#define CM_AUTOIDLE2_OFFSET            0x34            /* Core only */
-#define CM_AUTOIDLE3_OFFSET            0x38            /* Core only */
-#define CM_AUTOIDLE4_OFFSET            0x3c            /* Core only */
-#define                AUTO_54M(x)             (((x) & 0x3) << 6)
-#define                AUTO_96M(x)             (((x) & 0x3) << 2)
-#define                AUTO_DPLL(x)            (((x) & 0x3) << 0)
-#define                AUTO_STOPPED            0x3
-#define                AUTO_BYPASS_FAST        0x2             /* DPLL only */
-#define                AUTO_BYPASS_LOW_POWER   0x1             /* DPLL only */
-#define                AUTO_DISABLED           0x0
-
-/* Voltage control PRCM_VOLTCTRL bits */
-#define                AUTO_EXTVOLT            (1 << 15)
-#define                FORCE_EXTVOLT           (1 << 14)
-#define                SETOFF_LEVEL(x)         (((x) & 0x3) << 12)
-#define                MEMRETCTRL              (1 << 8)
-#define                SETRET_LEVEL(x)         (((x) & 0x3) << 6)
-#define                VOLT_LEVEL(x)           (((x) & 0x3) << 0)
-
-#define OMAP24XX_PRCM_VBASE    IO_ADDRESS(OMAP24XX_PRCM_BASE)
-#define prcm_readl(r)          __raw_readl(OMAP24XX_PRCM_VBASE + (r))
-#define prcm_writel(v, r)      __raw_writel((v), OMAP24XX_PRCM_VBASE + (r))
-
-static u32 pmdomain_get_wakeup_dependencies(int domain_offset)
-{
-       return prcm_readl(domain_offset + PM_WKDEP_OFFSET);
-}
-
-static void pmdomain_set_wakeup_dependencies(u32 state, int domain_offset)
-{
-       prcm_writel(state, domain_offset + PM_WKDEP_OFFSET);
-}
-
-static u32 pmdomain_get_powerstate(int domain_offset)
-{
-       return prcm_readl(domain_offset + PM_PWSTCTRL_OFFSET);
-}
-
-static void pmdomain_set_powerstate(u32 state, int domain_offset)
-{
-       prcm_writel(state, domain_offset + PM_PWSTCTRL_OFFSET);
-}
-
-static u32 pmdomain_get_clock_autocontrol(int domain_offset)
-{
-       return prcm_readl(domain_offset + CM_CLKSTCTRL_OFFSET);
-}
-
-static void pmdomain_set_clock_autocontrol(u32 state, int domain_offset)
-{
-       prcm_writel(state, domain_offset + CM_CLKSTCTRL_OFFSET);
-}
-
-static u32 pmdomain_get_clock_autoidle1(int domain_offset)
-{
-       return prcm_readl(domain_offset + CM_AUTOIDLE1_OFFSET);
-}
-
-/* Core domain only */
-static u32 pmdomain_get_clock_autoidle2(int domain_offset)
-{
-       return prcm_readl(domain_offset + CM_AUTOIDLE2_OFFSET);
-}
-
-/* Core domain only */
-static u32 pmdomain_get_clock_autoidle3(int domain_offset)
-{
-       return prcm_readl(domain_offset + CM_AUTOIDLE3_OFFSET);
-}
-
-/* Core domain only */
-static u32 pmdomain_get_clock_autoidle4(int domain_offset)
-{
-       return prcm_readl(domain_offset + CM_AUTOIDLE4_OFFSET);
-}
-
-static void pmdomain_set_clock_autoidle1(u32 state, int domain_offset)
-{
-       prcm_writel(state, CM_AUTOIDLE1_OFFSET + domain_offset);
-}
-
-/* Core domain only */
-static void pmdomain_set_clock_autoidle2(u32 state, int domain_offset)
-{
-       prcm_writel(state, CM_AUTOIDLE2_OFFSET + domain_offset);
-}
-
-/* Core domain only */
-static void pmdomain_set_clock_autoidle3(u32 state, int domain_offset)
-{
-       prcm_writel(state, CM_AUTOIDLE3_OFFSET + domain_offset);
-}
-
-/* Core domain only */
-static void pmdomain_set_clock_autoidle4(u32 state, int domain_offset)
-{
-       prcm_writel(state, CM_AUTOIDLE4_OFFSET + domain_offset);
-}
-
-/*
- * Configures power management domains to idle clocks automatically.
- */
-void pmdomain_set_autoidle(void)
-{
-       u32 val;
-
-       /* Set PLL auto stop for 54M, 96M & DPLL */
-       pmdomain_set_clock_autoidle1(AUTO_54M(AUTO_STOPPED) |
-                                    AUTO_96M(AUTO_STOPPED) |
-                                    AUTO_DPLL(AUTO_STOPPED), PM_PLL_OFFSET);
-
-       /* External clock input control
-        * REVISIT: Should this be in clock framework?
-        */
-       PRCM_CLKSRC_CTRL |= (0x3 << 3);
-
-       /* Configure number of 32KHz clock cycles for sys_clk */
-       PRCM_CLKSSETUP = 0x00ff;
-
-       /* Configure automatic voltage transition */
-       PRCM_VOLTSETUP = 0;
-       val = PRCM_VOLTCTRL;
-       val &= ~(SETOFF_LEVEL(0x3) | VOLT_LEVEL(0x3));
-       val |= SETOFF_LEVEL(1) | VOLT_LEVEL(1) | AUTO_EXTVOLT;
-       PRCM_VOLTCTRL = val;
-
-       /* Disable emulation tools functional clock */
-       PRCM_CLKEMUL_CTRL = 0x0;
-
-       /* Set core memory retention state */
-       val = pmdomain_get_powerstate(PM_CORE_OFFSET);
-       if (cpu_is_omap2420()) {
-               val &= ~(0x7 << 3);
-               val |= (MEM3RETSTATE | MEM2RETSTATE | MEM1RETSTATE);
-       } else {
-               val &= ~(0xf << 3);
-               val |= (MEM4RETSTATE | MEM3RETSTATE | MEM2RETSTATE |
-                       MEM1RETSTATE);
-       }
-       pmdomain_set_powerstate(val, PM_CORE_OFFSET);
-
-       /* OCP interface smart idle. REVISIT: Enable autoidle bit0 ? */
-       val = SMS_SYSCONFIG;
-       val &= ~(0x3 << 3);
-       val |= (0x2 << 3) | (1 << 0);
-       SMS_SYSCONFIG |= val;
-
-       val = SDRC_SYSCONFIG;
-       val &= ~(0x3 << 3);
-       val |= (0x2 << 3);
-       SDRC_SYSCONFIG = val;
-
-       /* Configure L3 interface for smart idle.
-        * REVISIT: Enable autoidle bit0 ?
-        */
-       val = GPMC_SYSCONFIG;
-       val &= ~(0x3 << 3);
-       val |= (0x2 << 3) | (1 << 0);
-       GPMC_SYSCONFIG = val;
-
-       pmdomain_set_powerstate(LOGICRETSTATE | POWERSTATE_RETENTION,
-                               PM_MPU_OFFSET);
-       pmdomain_set_powerstate(POWERSTATE_RETENTION, PM_CORE_OFFSET);
-       if (!cpu_is_omap2420())
-               pmdomain_set_powerstate(POWERSTATE_RETENTION, PM_MDM_OFFSET);
-
-       /* Assume suspend function has saved the state for DSP and GFX */
-       pmdomain_set_powerstate(FORCESTATE | POWERSTATE_OFF, PM_DSP_OFFSET);
-       pmdomain_set_powerstate(FORCESTATE | POWERSTATE_OFF, PM_GFX_OFFSET);
-
-#if 0
-       /* REVISIT: Internal USB needs special handling */
-       force_standby_usb();
-       if (cpu_is_omap2430())
-               force_hsmmc();
-       sdram_self_refresh_on_idle_req(1);
-#endif
-
-       /* Enable clock auto control for all domains.
-        * Note that CORE domain includes also DSS, L4 & L3.
-        */
-       pmdomain_set_clock_autocontrol(AUTOSTAT_MPU, PM_MPU_OFFSET);
-       pmdomain_set_clock_autocontrol(AUTOSTAT_GFX, PM_GFX_OFFSET);
-       pmdomain_set_clock_autocontrol(AUTOSTAT_DSS | AUTOSTAT_L4 | AUTOSTAT_L3,
-                                      PM_CORE_OFFSET);
-       if (cpu_is_omap2420())
-               pmdomain_set_clock_autocontrol(AUTOSTAT_IVA | AUTOSTAT_DSP,
-                                              PM_DSP_OFFSET);
-       else {
-               pmdomain_set_clock_autocontrol(AUTOSTAT_DSP, PM_DSP_OFFSET);
-               pmdomain_set_clock_autocontrol(AUTOSTAT_MDM, PM_MDM_OFFSET);
-       }
-
-       /* Enable clock autoidle for all domains */
-       pmdomain_set_clock_autoidle1(0x2, PM_DSP_OFFSET);
-       if (cpu_is_omap2420()) {
-               pmdomain_set_clock_autoidle1(0xfffffff9, PM_CORE_OFFSET);
-               pmdomain_set_clock_autoidle2(0x7, PM_CORE_OFFSET);
-               pmdomain_set_clock_autoidle1(0x3f, PM_WKUP_OFFSET);
-       } else {
-               pmdomain_set_clock_autoidle1(0xeafffff1, PM_CORE_OFFSET);
-               pmdomain_set_clock_autoidle2(0xfff, PM_CORE_OFFSET);
-               pmdomain_set_clock_autoidle1(0x7f, PM_WKUP_OFFSET);
-               pmdomain_set_clock_autoidle1(0x3, PM_MDM_OFFSET);
-       }
-       pmdomain_set_clock_autoidle3(0x7, PM_CORE_OFFSET);
-       pmdomain_set_clock_autoidle4(0x1f, PM_CORE_OFFSET);
-}
-
-/*
- * Initializes power domains by removing wake-up dependencies and powering
- * down DSP and GFX. Gets called from PM init. Note that DSP and IVA code
- * must re-enable DSP and GFX when used.
- */
-void __init pmdomain_init(void)
-{
-       /* Remove all domain wakeup dependencies */
-       pmdomain_set_wakeup_dependencies(EN_WKUP | EN_CORE, PM_MPU_OFFSET);
-       pmdomain_set_wakeup_dependencies(0, PM_DSP_OFFSET);
-       pmdomain_set_wakeup_dependencies(0, PM_GFX_OFFSET);
-       pmdomain_set_wakeup_dependencies(EN_WKUP | EN_MPU, PM_CORE_OFFSET);
-       if (cpu_is_omap2430())
-               pmdomain_set_wakeup_dependencies(0, PM_MDM_OFFSET);
-
-       /* Power down DSP and GFX */
-       pmdomain_set_powerstate(POWERSTATE_OFF | FORCESTATE, PM_DSP_OFFSET);
-       pmdomain_set_powerstate(POWERSTATE_OFF | FORCESTATE, PM_GFX_OFFSET);
-}
index baf7d82b458b968b61b1127e646cb17150812c0c..aad781dcf1b1b4f5cf18e3d0d8c3b034c5394f98 100644 (file)
@@ -23,6 +23,7 @@
 #include <linux/sysfs.h>
 #include <linux/module.h>
 #include <linux/delay.h>
+#include <linux/clk.h>
 
 #include <asm/io.h>
 #include <asm/irq.h>
@@ -36,8 +37,6 @@
 #include <asm/arch/sram.h>
 #include <asm/arch/pm.h>
 
-#include "prcm-regs.h"
-
 static struct clk *vclk;
 static void (*omap2_sram_idle)(void);
 static void (*omap2_sram_suspend)(int dllctrl, int cpu_rev);
@@ -78,251 +77,8 @@ static int omap2_pm_prepare(void)
        return 0;
 }
 
-#define INT0_WAKE_MASK (OMAP_IRQ_BIT(INT_24XX_GPIO_BANK1) |    \
-                       OMAP_IRQ_BIT(INT_24XX_GPIO_BANK2) |     \
-                       OMAP_IRQ_BIT(INT_24XX_GPIO_BANK3))
-
-#define INT1_WAKE_MASK (OMAP_IRQ_BIT(INT_24XX_GPIO_BANK4))
-
-#define INT2_WAKE_MASK (OMAP_IRQ_BIT(INT_24XX_UART1_IRQ) |     \
-                       OMAP_IRQ_BIT(INT_24XX_UART2_IRQ) |      \
-                       OMAP_IRQ_BIT(INT_24XX_UART3_IRQ))
-
-#define preg(reg)      printk("%s\t(0x%p):\t0x%08x\n", #reg, &reg, reg);
-
-static void omap2_pm_debug(char * desc)
-{
-       printk("%s:\n", desc);
-
-       preg(CM_CLKSTCTRL_MPU);
-       preg(CM_CLKSTCTRL_CORE);
-       preg(CM_CLKSTCTRL_GFX);
-       preg(CM_CLKSTCTRL_DSP);
-       preg(CM_CLKSTCTRL_MDM);
-
-       preg(PM_PWSTCTRL_MPU);
-       preg(PM_PWSTCTRL_CORE);
-       preg(PM_PWSTCTRL_GFX);
-       preg(PM_PWSTCTRL_DSP);
-       preg(PM_PWSTCTRL_MDM);
-
-       preg(PM_PWSTST_MPU);
-       preg(PM_PWSTST_CORE);
-       preg(PM_PWSTST_GFX);
-       preg(PM_PWSTST_DSP);
-       preg(PM_PWSTST_MDM);
-
-       preg(CM_AUTOIDLE1_CORE);
-       preg(CM_AUTOIDLE2_CORE);
-       preg(CM_AUTOIDLE3_CORE);
-       preg(CM_AUTOIDLE4_CORE);
-       preg(CM_AUTOIDLE_WKUP);
-       preg(CM_AUTOIDLE_PLL);
-       preg(CM_AUTOIDLE_DSP);
-       preg(CM_AUTOIDLE_MDM);
-
-       preg(CM_ICLKEN1_CORE);
-       preg(CM_ICLKEN2_CORE);
-       preg(CM_ICLKEN3_CORE);
-       preg(CM_ICLKEN4_CORE);
-       preg(CM_ICLKEN_GFX);
-       preg(CM_ICLKEN_WKUP);
-       preg(CM_ICLKEN_DSP);
-       preg(CM_ICLKEN_MDM);
-
-       preg(CM_IDLEST1_CORE);
-       preg(CM_IDLEST2_CORE);
-       preg(CM_IDLEST3_CORE);
-       preg(CM_IDLEST4_CORE);
-       preg(CM_IDLEST_GFX);
-       preg(CM_IDLEST_WKUP);
-       preg(CM_IDLEST_CKGEN);
-       preg(CM_IDLEST_DSP);
-       preg(CM_IDLEST_MDM);
-
-       preg(RM_RSTST_MPU);
-       preg(RM_RSTST_GFX);
-       preg(RM_RSTST_WKUP);
-       preg(RM_RSTST_DSP);
-       preg(RM_RSTST_MDM);
-
-       preg(PM_WKDEP_MPU);
-       preg(PM_WKDEP_CORE);
-       preg(PM_WKDEP_GFX);
-       preg(PM_WKDEP_DSP);
-       preg(PM_WKDEP_MDM);
-
-       preg(CM_FCLKEN_WKUP);
-       preg(CM_ICLKEN_WKUP);
-       preg(CM_IDLEST_WKUP);
-       preg(CM_AUTOIDLE_WKUP);
-       preg(CM_CLKSEL_WKUP);
-
-       preg(PM_WKEN_WKUP);
-       preg(PM_WKST_WKUP);
-}
-
-static inline void omap2_pm_save_registers(void)
-{
-       /* Save interrupt registers */
-       OMAP24XX_SAVE(INTC_MIR0);
-       OMAP24XX_SAVE(INTC_MIR1);
-       OMAP24XX_SAVE(INTC_MIR2);
-
-       /* Save power control registers */
-       OMAP24XX_SAVE(CM_CLKSTCTRL_MPU);
-       OMAP24XX_SAVE(CM_CLKSTCTRL_CORE);
-       OMAP24XX_SAVE(CM_CLKSTCTRL_GFX);
-       OMAP24XX_SAVE(CM_CLKSTCTRL_DSP);
-       OMAP24XX_SAVE(CM_CLKSTCTRL_MDM);
-
-       /* Save power state registers */
-       OMAP24XX_SAVE(PM_PWSTCTRL_MPU);
-       OMAP24XX_SAVE(PM_PWSTCTRL_CORE);
-       OMAP24XX_SAVE(PM_PWSTCTRL_GFX);
-       OMAP24XX_SAVE(PM_PWSTCTRL_DSP);
-       OMAP24XX_SAVE(PM_PWSTCTRL_MDM);
-
-       /* Save autoidle registers */
-       OMAP24XX_SAVE(CM_AUTOIDLE1_CORE);
-       OMAP24XX_SAVE(CM_AUTOIDLE2_CORE);
-       OMAP24XX_SAVE(CM_AUTOIDLE3_CORE);
-       OMAP24XX_SAVE(CM_AUTOIDLE4_CORE);
-       OMAP24XX_SAVE(CM_AUTOIDLE_WKUP);
-       OMAP24XX_SAVE(CM_AUTOIDLE_PLL);
-       OMAP24XX_SAVE(CM_AUTOIDLE_DSP);
-       OMAP24XX_SAVE(CM_AUTOIDLE_MDM);
-
-       /* Save idle state registers */
-       OMAP24XX_SAVE(CM_IDLEST1_CORE);
-       OMAP24XX_SAVE(CM_IDLEST2_CORE);
-       OMAP24XX_SAVE(CM_IDLEST3_CORE);
-       OMAP24XX_SAVE(CM_IDLEST4_CORE);
-       OMAP24XX_SAVE(CM_IDLEST_GFX);
-       OMAP24XX_SAVE(CM_IDLEST_WKUP);
-       OMAP24XX_SAVE(CM_IDLEST_CKGEN);
-       OMAP24XX_SAVE(CM_IDLEST_DSP);
-       OMAP24XX_SAVE(CM_IDLEST_MDM);
-
-       /* Save clock registers */
-       OMAP24XX_SAVE(CM_FCLKEN1_CORE);
-       OMAP24XX_SAVE(CM_FCLKEN2_CORE);
-       OMAP24XX_SAVE(CM_ICLKEN1_CORE);
-       OMAP24XX_SAVE(CM_ICLKEN2_CORE);
-       OMAP24XX_SAVE(CM_ICLKEN3_CORE);
-       OMAP24XX_SAVE(CM_ICLKEN4_CORE);
-}
-
-static inline void omap2_pm_restore_registers(void)
-{
-       /* Restore clock state registers */
-       OMAP24XX_RESTORE(CM_CLKSTCTRL_MPU);
-       OMAP24XX_RESTORE(CM_CLKSTCTRL_CORE);
-       OMAP24XX_RESTORE(CM_CLKSTCTRL_GFX);
-       OMAP24XX_RESTORE(CM_CLKSTCTRL_DSP);
-       OMAP24XX_RESTORE(CM_CLKSTCTRL_MDM);
-
-       /* Restore power state registers */
-       OMAP24XX_RESTORE(PM_PWSTCTRL_MPU);
-       OMAP24XX_RESTORE(PM_PWSTCTRL_CORE);
-       OMAP24XX_RESTORE(PM_PWSTCTRL_GFX);
-       OMAP24XX_RESTORE(PM_PWSTCTRL_DSP);
-       OMAP24XX_RESTORE(PM_PWSTCTRL_MDM);
-
-       /* Restore idle state registers */
-       OMAP24XX_RESTORE(CM_IDLEST1_CORE);
-       OMAP24XX_RESTORE(CM_IDLEST2_CORE);
-       OMAP24XX_RESTORE(CM_IDLEST3_CORE);
-       OMAP24XX_RESTORE(CM_IDLEST4_CORE);
-       OMAP24XX_RESTORE(CM_IDLEST_GFX);
-       OMAP24XX_RESTORE(CM_IDLEST_WKUP);
-       OMAP24XX_RESTORE(CM_IDLEST_CKGEN);
-       OMAP24XX_RESTORE(CM_IDLEST_DSP);
-       OMAP24XX_RESTORE(CM_IDLEST_MDM);
-
-       /* Restore autoidle registers */
-       OMAP24XX_RESTORE(CM_AUTOIDLE1_CORE);
-       OMAP24XX_RESTORE(CM_AUTOIDLE2_CORE);
-       OMAP24XX_RESTORE(CM_AUTOIDLE3_CORE);
-       OMAP24XX_RESTORE(CM_AUTOIDLE4_CORE);
-       OMAP24XX_RESTORE(CM_AUTOIDLE_WKUP);
-       OMAP24XX_RESTORE(CM_AUTOIDLE_PLL);
-       OMAP24XX_RESTORE(CM_AUTOIDLE_DSP);
-       OMAP24XX_RESTORE(CM_AUTOIDLE_MDM);
-
-       /* Restore clock registers */
-       OMAP24XX_RESTORE(CM_FCLKEN1_CORE);
-       OMAP24XX_RESTORE(CM_FCLKEN2_CORE);
-       OMAP24XX_RESTORE(CM_ICLKEN1_CORE);
-       OMAP24XX_RESTORE(CM_ICLKEN2_CORE);
-       OMAP24XX_RESTORE(CM_ICLKEN3_CORE);
-       OMAP24XX_RESTORE(CM_ICLKEN4_CORE);
-
-       /* REVISIT: Clear interrupts here */
-
-       /* Restore interrupt registers */
-       OMAP24XX_RESTORE(INTC_MIR0);
-       OMAP24XX_RESTORE(INTC_MIR1);
-       OMAP24XX_RESTORE(INTC_MIR2);
-}
-
 static int omap2_pm_suspend(void)
 {
-       int processor_type = 0;
-
-       /* REVISIT: 0x21 or 0x26? */
-       if (cpu_is_omap2420())
-               processor_type = 0x21;
-
-       if (!processor_type)
-               return -ENOTSUPP;
-
-       local_irq_disable();
-       local_fiq_disable();
-
-       omap2_pm_save_registers();
-
-       /* Disable interrupts except for the wake events */
-       INTC_MIR_SET0 = 0xffffffff & ~INT0_WAKE_MASK;
-       INTC_MIR_SET1 = 0xffffffff & ~INT1_WAKE_MASK;
-       INTC_MIR_SET2 = 0xffffffff & ~INT2_WAKE_MASK;
-
-       pmdomain_set_autoidle();
-
-       /* Clear old wake-up events */
-       PM_WKST1_CORE = 0;
-       PM_WKST2_CORE = 0;
-       PM_WKST_WKUP = 0;
-
-       /* Enable wake-up events */
-       PM_WKEN1_CORE = (1 << 22) | (1 << 21);  /* UART1 & 2 */
-       PM_WKEN2_CORE = (1 << 2);               /* UART3 */
-       PM_WKEN_WKUP = (1 << 2) | (1 << 0);     /* GPIO & GPT1 */
-
-       /* Disable clocks except for CM_ICLKEN2_CORE. It gets disabled
-        * in the SRAM suspend code */
-       CM_FCLKEN1_CORE = 0;
-       CM_FCLKEN2_CORE = 0;
-       CM_ICLKEN1_CORE = 0;
-       CM_ICLKEN3_CORE = 0;
-       CM_ICLKEN4_CORE = 0;
-
-       omap2_pm_debug("Status before suspend");
-
-       /* Must wait for serial buffers to clear */
-       mdelay(200);
-
-       /* Jump to SRAM suspend code
-        * REVISIT: When is this SDRC_DLLB_CTRL?
-        */
-       omap2_sram_suspend(SDRC_DLLA_CTRL, processor_type);
-
-       /* Back from sleep */
-       omap2_pm_restore_registers();
-
-       local_fiq_enable();
-       local_irq_enable();
-
        return 0;
 }
 
@@ -357,30 +113,6 @@ static struct platform_suspend_ops omap_pm_ops = {
 
 int __init omap2_pm_init(void)
 {
-       printk("Power Management for TI OMAP.\n");
-
-       vclk = clk_get(NULL, "virt_prcm_set");
-       if (IS_ERR(vclk)) {
-               printk(KERN_ERR "Could not get PM vclk\n");
-               return -ENODEV;
-       }
-
-       /*
-        * We copy the assembler sleep/wakeup routines to SRAM.
-        * These routines need to be in SRAM as that's the only
-        * memory the MPU can see when it wakes up.
-        */
-       omap2_sram_idle = omap_sram_push(omap24xx_idle_loop_suspend,
-                                        omap24xx_idle_loop_suspend_sz);
-
-       omap2_sram_suspend = omap_sram_push(omap24xx_cpu_suspend,
-                                           omap24xx_cpu_suspend_sz);
-
-       suspend_set_ops(&omap_pm_ops);
-       pm_idle = omap2_pm_idle;
-
-       pmdomain_init();
-
        return 0;
 }
 
diff --git a/arch/arm/mach-omap2/prcm-common.h b/arch/arm/mach-omap2/prcm-common.h
new file mode 100644 (file)
index 0000000..cacb340
--- /dev/null
@@ -0,0 +1,317 @@
+#ifndef __ARCH_ASM_MACH_OMAP2_PRCM_COMMON_H
+#define __ARCH_ASM_MACH_OMAP2_PRCM_COMMON_H
+
+/*
+ * OMAP2/3 PRCM base and module definitions
+ *
+ * Copyright (C) 2007-2008 Texas Instruments, Inc.
+ * Copyright (C) 2007-2008 Nokia Corporation
+ *
+ * Written by Paul Walmsley
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+
+/* Module offsets from both CM_BASE & PRM_BASE */
+
+/*
+ * Offsets that are the same on 24xx and 34xx
+ *
+ * Technically, in terms of the TRM, OCP_MOD is 34xx only; PLL_MOD is
+ * CCR_MOD on 3430; and GFX_MOD only exists < 3430ES2.
+ */
+#define OCP_MOD                                                0x000
+#define MPU_MOD                                                0x100
+#define CORE_MOD                                       0x200
+#define GFX_MOD                                                0x300
+#define WKUP_MOD                                       0x400
+#define PLL_MOD                                                0x500
+
+
+/* Chip-specific module offsets */
+#define OMAP24XX_DSP_MOD                               0x800
+
+#define OMAP2430_MDM_MOD                               0xc00
+
+/* IVA2 module is < base on 3430 */
+#define OMAP3430_IVA2_MOD                              -0x800
+#define OMAP3430ES2_SGX_MOD                            GFX_MOD
+#define OMAP3430_CCR_MOD                               PLL_MOD
+#define OMAP3430_DSS_MOD                               0x600
+#define OMAP3430_CAM_MOD                               0x700
+#define OMAP3430_PER_MOD                               0x800
+#define OMAP3430_EMU_MOD                               0x900
+#define OMAP3430_GR_MOD                                        0xa00
+#define OMAP3430_NEON_MOD                              0xb00
+#define OMAP3430ES2_USBHOST_MOD                                0xc00
+
+
+/* 24XX register bits shared between CM & PRM registers */
+
+/* CM_FCLKEN1_CORE, CM_ICLKEN1_CORE, PM_WKEN1_CORE shared bits */
+#define OMAP2420_EN_MMC_SHIFT                          26
+#define OMAP2420_EN_MMC                                        (1 << 26)
+#define OMAP24XX_EN_UART2_SHIFT                                22
+#define OMAP24XX_EN_UART2                              (1 << 22)
+#define OMAP24XX_EN_UART1_SHIFT                                21
+#define OMAP24XX_EN_UART1                              (1 << 21)
+#define OMAP24XX_EN_MCSPI2_SHIFT                       18
+#define OMAP24XX_EN_MCSPI2                             (1 << 18)
+#define OMAP24XX_EN_MCSPI1_SHIFT                       17
+#define OMAP24XX_EN_MCSPI1                             (1 << 17)
+#define OMAP24XX_EN_MCBSP2_SHIFT                       16
+#define OMAP24XX_EN_MCBSP2                             (1 << 16)
+#define OMAP24XX_EN_MCBSP1_SHIFT                       15
+#define OMAP24XX_EN_MCBSP1                             (1 << 15)
+#define OMAP24XX_EN_GPT12_SHIFT                                14
+#define OMAP24XX_EN_GPT12                              (1 << 14)
+#define OMAP24XX_EN_GPT11_SHIFT                                13
+#define OMAP24XX_EN_GPT11                              (1 << 13)
+#define OMAP24XX_EN_GPT10_SHIFT                                12
+#define OMAP24XX_EN_GPT10                              (1 << 12)
+#define OMAP24XX_EN_GPT9_SHIFT                         11
+#define OMAP24XX_EN_GPT9                               (1 << 11)
+#define OMAP24XX_EN_GPT8_SHIFT                         10
+#define OMAP24XX_EN_GPT8                               (1 << 10)
+#define OMAP24XX_EN_GPT7_SHIFT                         9
+#define OMAP24XX_EN_GPT7                               (1 << 9)
+#define OMAP24XX_EN_GPT6_SHIFT                         8
+#define OMAP24XX_EN_GPT6                               (1 << 8)
+#define OMAP24XX_EN_GPT5_SHIFT                         7
+#define OMAP24XX_EN_GPT5                               (1 << 7)
+#define OMAP24XX_EN_GPT4_SHIFT                         6
+#define OMAP24XX_EN_GPT4                               (1 << 6)
+#define OMAP24XX_EN_GPT3_SHIFT                         5
+#define OMAP24XX_EN_GPT3                               (1 << 5)
+#define OMAP24XX_EN_GPT2_SHIFT                         4
+#define OMAP24XX_EN_GPT2                               (1 << 4)
+#define OMAP2420_EN_VLYNQ_SHIFT                                3
+#define OMAP2420_EN_VLYNQ                              (1 << 3)
+
+/* CM_FCLKEN2_CORE, CM_ICLKEN2_CORE, PM_WKEN2_CORE shared bits */
+#define OMAP2430_EN_GPIO5_SHIFT                                10
+#define OMAP2430_EN_GPIO5                              (1 << 10)
+#define OMAP2430_EN_MCSPI3_SHIFT                       9
+#define OMAP2430_EN_MCSPI3                             (1 << 9)
+#define OMAP2430_EN_MMCHS2_SHIFT                       8
+#define OMAP2430_EN_MMCHS2                             (1 << 8)
+#define OMAP2430_EN_MMCHS1_SHIFT                       7
+#define OMAP2430_EN_MMCHS1                             (1 << 7)
+#define OMAP24XX_EN_UART3_SHIFT                                2
+#define OMAP24XX_EN_UART3                              (1 << 2)
+#define OMAP24XX_EN_USB_SHIFT                          0
+#define OMAP24XX_EN_USB                                        (1 << 0)
+
+/* CM_ICLKEN2_CORE, PM_WKEN2_CORE shared bits */
+#define OMAP2430_EN_MDM_INTC_SHIFT                     11
+#define OMAP2430_EN_MDM_INTC                           (1 << 11)
+#define OMAP2430_EN_USBHS_SHIFT                                6
+#define OMAP2430_EN_USBHS                              (1 << 6)
+
+/* CM_IDLEST1_CORE, PM_WKST1_CORE shared bits */
+#define OMAP2420_ST_MMC                                        (1 << 26)
+#define OMAP24XX_ST_UART2                              (1 << 22)
+#define OMAP24XX_ST_UART1                              (1 << 21)
+#define OMAP24XX_ST_MCSPI2                             (1 << 18)
+#define OMAP24XX_ST_MCSPI1                             (1 << 17)
+#define OMAP24XX_ST_GPT12                              (1 << 14)
+#define OMAP24XX_ST_GPT11                              (1 << 13)
+#define OMAP24XX_ST_GPT10                              (1 << 12)
+#define OMAP24XX_ST_GPT9                               (1 << 11)
+#define OMAP24XX_ST_GPT8                               (1 << 10)
+#define OMAP24XX_ST_GPT7                               (1 << 9)
+#define OMAP24XX_ST_GPT6                               (1 << 8)
+#define OMAP24XX_ST_GPT5                               (1 << 7)
+#define OMAP24XX_ST_GPT4                               (1 << 6)
+#define OMAP24XX_ST_GPT3                               (1 << 5)
+#define OMAP24XX_ST_GPT2                               (1 << 4)
+#define OMAP2420_ST_VLYNQ                              (1 << 3)
+
+/* CM_IDLEST2_CORE, PM_WKST2_CORE shared bits */
+#define OMAP2430_ST_MDM_INTC                           (1 << 11)
+#define OMAP2430_ST_GPIO5                              (1 << 10)
+#define OMAP2430_ST_MCSPI3                             (1 << 9)
+#define OMAP2430_ST_MMCHS2                             (1 << 8)
+#define OMAP2430_ST_MMCHS1                             (1 << 7)
+#define OMAP2430_ST_USBHS                              (1 << 6)
+#define OMAP24XX_ST_UART3                              (1 << 2)
+#define OMAP24XX_ST_USB                                        (1 << 0)
+
+/* CM_FCLKEN_WKUP, CM_ICLKEN_WKUP, PM_WKEN_WKUP shared bits */
+#define OMAP24XX_EN_GPIOS_SHIFT                                2
+#define OMAP24XX_EN_GPIOS                              (1 << 2)
+#define OMAP24XX_EN_GPT1_SHIFT                         0
+#define OMAP24XX_EN_GPT1                               (1 << 0)
+
+/* PM_WKST_WKUP, CM_IDLEST_WKUP shared bits */
+#define OMAP24XX_ST_GPIOS                              (1 << 2)
+#define OMAP24XX_ST_GPT1                               (1 << 0)
+
+/* CM_IDLEST_MDM and PM_WKST_MDM shared bits */
+#define OMAP2430_ST_MDM                                        (1 << 0)
+
+
+/* 3430 register bits shared between CM & PRM registers */
+
+/* CM_REVISION, PRM_REVISION shared bits */
+#define OMAP3430_REV_SHIFT                             0
+#define OMAP3430_REV_MASK                              (0xff << 0)
+
+/* CM_SYSCONFIG, PRM_SYSCONFIG shared bits */
+#define OMAP3430_AUTOIDLE                              (1 << 0)
+
+/* CM_FCLKEN1_CORE, CM_ICLKEN1_CORE, PM_WKEN1_CORE shared bits */
+#define OMAP3430_EN_MMC2                               (1 << 25)
+#define OMAP3430_EN_MMC2_SHIFT                         25
+#define OMAP3430_EN_MMC1                               (1 << 24)
+#define OMAP3430_EN_MMC1_SHIFT                         24
+#define OMAP3430_EN_MCSPI4                             (1 << 21)
+#define OMAP3430_EN_MCSPI4_SHIFT                       21
+#define OMAP3430_EN_MCSPI3                             (1 << 20)
+#define OMAP3430_EN_MCSPI3_SHIFT                       20
+#define OMAP3430_EN_MCSPI2                             (1 << 19)
+#define OMAP3430_EN_MCSPI2_SHIFT                       19
+#define OMAP3430_EN_MCSPI1                             (1 << 18)
+#define OMAP3430_EN_MCSPI1_SHIFT                       18
+#define OMAP3430_EN_I2C3                               (1 << 17)
+#define OMAP3430_EN_I2C3_SHIFT                         17
+#define OMAP3430_EN_I2C2                               (1 << 16)
+#define OMAP3430_EN_I2C2_SHIFT                         16
+#define OMAP3430_EN_I2C1                               (1 << 15)
+#define OMAP3430_EN_I2C1_SHIFT                         15
+#define OMAP3430_EN_UART2                              (1 << 14)
+#define OMAP3430_EN_UART2_SHIFT                                14
+#define OMAP3430_EN_UART1                              (1 << 13)
+#define OMAP3430_EN_UART1_SHIFT                                13
+#define OMAP3430_EN_GPT11                              (1 << 12)
+#define OMAP3430_EN_GPT11_SHIFT                                12
+#define OMAP3430_EN_GPT10                              (1 << 11)
+#define OMAP3430_EN_GPT10_SHIFT                                11
+#define OMAP3430_EN_MCBSP5                             (1 << 10)
+#define OMAP3430_EN_MCBSP5_SHIFT                       10
+#define OMAP3430_EN_MCBSP1                             (1 << 9)
+#define OMAP3430_EN_MCBSP1_SHIFT                       9
+#define OMAP3430_EN_FSHOSTUSB                          (1 << 5)
+#define OMAP3430_EN_FSHOSTUSB_SHIFT                    5
+#define OMAP3430_EN_D2D                                        (1 << 3)
+#define OMAP3430_EN_D2D_SHIFT                          3
+
+/* CM_ICLKEN1_CORE, PM_WKEN1_CORE shared bits */
+#define OMAP3430_EN_HSOTGUSB                           (1 << 4)
+#define OMAP3430_EN_HSOTGUSB_SHIFT                             4
+
+/* PM_WKST1_CORE, CM_IDLEST1_CORE shared bits */
+#define OMAP3430_ST_MMC2                               (1 << 25)
+#define OMAP3430_ST_MMC1                               (1 << 24)
+#define OMAP3430_ST_MCSPI4                             (1 << 21)
+#define OMAP3430_ST_MCSPI3                             (1 << 20)
+#define OMAP3430_ST_MCSPI2                             (1 << 19)
+#define OMAP3430_ST_MCSPI1                             (1 << 18)
+#define OMAP3430_ST_I2C3                               (1 << 17)
+#define OMAP3430_ST_I2C2                               (1 << 16)
+#define OMAP3430_ST_I2C1                               (1 << 15)
+#define OMAP3430_ST_UART2                              (1 << 14)
+#define OMAP3430_ST_UART1                              (1 << 13)
+#define OMAP3430_ST_GPT11                              (1 << 12)
+#define OMAP3430_ST_GPT10                              (1 << 11)
+#define OMAP3430_ST_MCBSP5                             (1 << 10)
+#define OMAP3430_ST_MCBSP1                             (1 << 9)
+#define OMAP3430_ST_FSHOSTUSB                          (1 << 5)
+#define OMAP3430_ST_HSOTGUSB                           (1 << 4)
+#define OMAP3430_ST_D2D                                        (1 << 3)
+
+/* CM_FCLKEN_WKUP, CM_ICLKEN_WKUP, PM_WKEN_WKUP shared bits */
+#define OMAP3430_EN_GPIO1                              (1 << 3)
+#define OMAP3430_EN_GPIO1_SHIFT                                3
+#define OMAP3430_EN_GPT1                               (1 << 0)
+#define OMAP3430_EN_GPT1_SHIFT                         0
+
+/* CM_FCLKEN_WKUP, PM_WKEN_WKUP shared bits */
+#define OMAP3430_EN_SR2                                        (1 << 7)
+#define OMAP3430_EN_SR2_SHIFT                          7
+#define OMAP3430_EN_SR1                                        (1 << 6)
+#define OMAP3430_EN_SR1_SHIFT                          6
+
+/* CM_ICLKEN_WKUP, PM_WKEN_WKUP shared bits */
+#define OMAP3430_EN_GPT12                              (1 << 1)
+#define OMAP3430_EN_GPT12_SHIFT                                1
+
+/* CM_IDLEST_WKUP, PM_WKST_WKUP shared bits */
+#define OMAP3430_ST_SR2                                        (1 << 7)
+#define OMAP3430_ST_SR1                                        (1 << 6)
+#define OMAP3430_ST_GPIO1                              (1 << 3)
+#define OMAP3430_ST_GPT12                              (1 << 1)
+#define OMAP3430_ST_GPT1                               (1 << 0)
+
+/*
+ * CM_SLEEPDEP_GFX, CM_SLEEPDEP_DSS, CM_SLEEPDEP_CAM,
+ * CM_SLEEPDEP_PER, PM_WKDEP_IVA2, PM_WKDEP_GFX,
+ * PM_WKDEP_DSS, PM_WKDEP_CAM, PM_WKDEP_PER, PM_WKDEP_NEON shared bits
+ */
+#define OMAP3430_EN_MPU                                        (1 << 1)
+#define OMAP3430_EN_MPU_SHIFT                          1
+
+/* CM_FCLKEN_PER, CM_ICLKEN_PER, PM_WKEN_PER shared bits */
+#define OMAP3430_EN_GPIO6                              (1 << 17)
+#define OMAP3430_EN_GPIO6_SHIFT                                17
+#define OMAP3430_EN_GPIO5                              (1 << 16)
+#define OMAP3430_EN_GPIO5_SHIFT                                16
+#define OMAP3430_EN_GPIO4                              (1 << 15)
+#define OMAP3430_EN_GPIO4_SHIFT                                15
+#define OMAP3430_EN_GPIO3                              (1 << 14)
+#define OMAP3430_EN_GPIO3_SHIFT                                14
+#define OMAP3430_EN_GPIO2                              (1 << 13)
+#define OMAP3430_EN_GPIO2_SHIFT                                13
+#define OMAP3430_EN_UART3                              (1 << 11)
+#define OMAP3430_EN_UART3_SHIFT                                11
+#define OMAP3430_EN_GPT9                               (1 << 10)
+#define OMAP3430_EN_GPT9_SHIFT                         10
+#define OMAP3430_EN_GPT8                               (1 << 9)
+#define OMAP3430_EN_GPT8_SHIFT                         9
+#define OMAP3430_EN_GPT7                               (1 << 8)
+#define OMAP3430_EN_GPT7_SHIFT                         8
+#define OMAP3430_EN_GPT6                               (1 << 7)
+#define OMAP3430_EN_GPT6_SHIFT                         7
+#define OMAP3430_EN_GPT5                               (1 << 6)
+#define OMAP3430_EN_GPT5_SHIFT                         6
+#define OMAP3430_EN_GPT4                               (1 << 5)
+#define OMAP3430_EN_GPT4_SHIFT                         5
+#define OMAP3430_EN_GPT3                               (1 << 4)
+#define OMAP3430_EN_GPT3_SHIFT                         4
+#define OMAP3430_EN_GPT2                               (1 << 3)
+#define OMAP3430_EN_GPT2_SHIFT                         3
+
+/* CM_FCLKEN_PER, CM_ICLKEN_PER, PM_WKEN_PER, PM_WKST_PER shared bits */
+/* XXX Possible TI documentation bug: should the PM_WKST_PER EN_* bits
+ * be ST_* bits instead? */
+#define OMAP3430_EN_MCBSP4                             (1 << 2)
+#define OMAP3430_EN_MCBSP4_SHIFT                       2
+#define OMAP3430_EN_MCBSP3                             (1 << 1)
+#define OMAP3430_EN_MCBSP3_SHIFT                       1
+#define OMAP3430_EN_MCBSP2                             (1 << 0)
+#define OMAP3430_EN_MCBSP2_SHIFT                       0
+
+/* CM_IDLEST_PER, PM_WKST_PER shared bits */
+#define OMAP3430_ST_GPIO6                              (1 << 17)
+#define OMAP3430_ST_GPIO5                              (1 << 16)
+#define OMAP3430_ST_GPIO4                              (1 << 15)
+#define OMAP3430_ST_GPIO3                              (1 << 14)
+#define OMAP3430_ST_GPIO2                              (1 << 13)
+#define OMAP3430_ST_UART3                              (1 << 11)
+#define OMAP3430_ST_GPT9                               (1 << 10)
+#define OMAP3430_ST_GPT8                               (1 << 9)
+#define OMAP3430_ST_GPT7                               (1 << 8)
+#define OMAP3430_ST_GPT6                               (1 << 7)
+#define OMAP3430_ST_GPT5                               (1 << 6)
+#define OMAP3430_ST_GPT4                               (1 << 5)
+#define OMAP3430_ST_GPT3                               (1 << 4)
+#define OMAP3430_ST_GPT2                               (1 << 3)
+
+/* CM_SLEEPDEP_PER, PM_WKDEP_IVA2, PM_WKDEP_MPU, PM_WKDEP_PER shared bits */
+#define OMAP3430_EN_CORE                               (1 << 0)
+
+#endif
+
diff --git a/arch/arm/mach-omap2/prcm-regs.h b/arch/arm/mach-omap2/prcm-regs.h
deleted file mode 100644 (file)
index 5e1c4b5..0000000
+++ /dev/null
@@ -1,483 +0,0 @@
-/*
- * linux/arch/arm/mach-omap2/prcm-regs.h
- *
- * OMAP24XX Power Reset and Clock Management (PRCM) registers
- *
- * Copyright (C) 2005 Texas Instruments, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef __ARCH_ARM_MACH_OMAP2_PRCM_H
-#define __ARCH_ARM_MACH_OMAP2_PRCM_H
-
-/* SET_PERFORMANCE_LEVEL PARAMETERS */
-#define PRCM_HALF_SPEED 1
-#define PRCM_FULL_SPEED 2
-
-#ifndef __ASSEMBLER__
-
-#define PRCM_REG32(offset)     __REG32(OMAP24XX_PRCM_BASE + (offset))
-
-#define PRCM_REVISION          PRCM_REG32(0x000)
-#define PRCM_SYSCONFIG         PRCM_REG32(0x010)
-#define PRCM_IRQSTATUS_MPU     PRCM_REG32(0x018)
-#define PRCM_IRQENABLE_MPU     PRCM_REG32(0x01C)
-#define PRCM_VOLTCTRL          PRCM_REG32(0x050)
-#define PRCM_VOLTST            PRCM_REG32(0x054)
-#define PRCM_CLKSRC_CTRL       PRCM_REG32(0x060)
-#define PRCM_CLKOUT_CTRL       PRCM_REG32(0x070)
-#define PRCM_CLKEMUL_CTRL      PRCM_REG32(0x078)
-#define PRCM_CLKCFG_CTRL       PRCM_REG32(0x080)
-#define PRCM_CLKCFG_STATUS     PRCM_REG32(0x084)
-#define PRCM_VOLTSETUP         PRCM_REG32(0x090)
-#define PRCM_CLKSSETUP         PRCM_REG32(0x094)
-#define PRCM_POLCTRL           PRCM_REG32(0x098)
-
-/* GENERAL PURPOSE */
-#define GENERAL_PURPOSE1       PRCM_REG32(0x0B0)
-#define GENERAL_PURPOSE2       PRCM_REG32(0x0B4)
-#define GENERAL_PURPOSE3       PRCM_REG32(0x0B8)
-#define GENERAL_PURPOSE4       PRCM_REG32(0x0BC)
-#define GENERAL_PURPOSE5       PRCM_REG32(0x0C0)
-#define GENERAL_PURPOSE6       PRCM_REG32(0x0C4)
-#define GENERAL_PURPOSE7       PRCM_REG32(0x0C8)
-#define GENERAL_PURPOSE8       PRCM_REG32(0x0CC)
-#define GENERAL_PURPOSE9       PRCM_REG32(0x0D0)
-#define GENERAL_PURPOSE10      PRCM_REG32(0x0D4)
-#define GENERAL_PURPOSE11      PRCM_REG32(0x0D8)
-#define GENERAL_PURPOSE12      PRCM_REG32(0x0DC)
-#define GENERAL_PURPOSE13      PRCM_REG32(0x0E0)
-#define GENERAL_PURPOSE14      PRCM_REG32(0x0E4)
-#define GENERAL_PURPOSE15      PRCM_REG32(0x0E8)
-#define GENERAL_PURPOSE16      PRCM_REG32(0x0EC)
-#define GENERAL_PURPOSE17      PRCM_REG32(0x0F0)
-#define GENERAL_PURPOSE18      PRCM_REG32(0x0F4)
-#define GENERAL_PURPOSE19      PRCM_REG32(0x0F8)
-#define GENERAL_PURPOSE20      PRCM_REG32(0x0FC)
-
-/* MPU */
-#define CM_CLKSEL_MPU          PRCM_REG32(0x140)
-#define CM_CLKSTCTRL_MPU       PRCM_REG32(0x148)
-#define RM_RSTST_MPU           PRCM_REG32(0x158)
-#define PM_WKDEP_MPU           PRCM_REG32(0x1C8)
-#define PM_EVGENCTRL_MPU       PRCM_REG32(0x1D4)
-#define PM_EVEGENONTIM_MPU     PRCM_REG32(0x1D8)
-#define PM_EVEGENOFFTIM_MPU    PRCM_REG32(0x1DC)
-#define PM_PWSTCTRL_MPU                PRCM_REG32(0x1E0)
-#define PM_PWSTST_MPU          PRCM_REG32(0x1E4)
-
-/* CORE */
-#define CM_FCLKEN1_CORE                PRCM_REG32(0x200)
-#define CM_FCLKEN2_CORE                PRCM_REG32(0x204)
-#define CM_FCLKEN3_CORE                PRCM_REG32(0x208)
-#define CM_ICLKEN1_CORE                PRCM_REG32(0x210)
-#define CM_ICLKEN2_CORE                PRCM_REG32(0x214)
-#define CM_ICLKEN3_CORE                PRCM_REG32(0x218)
-#define CM_ICLKEN4_CORE                PRCM_REG32(0x21C)
-#define CM_IDLEST1_CORE                PRCM_REG32(0x220)
-#define CM_IDLEST2_CORE                PRCM_REG32(0x224)
-#define CM_IDLEST3_CORE                PRCM_REG32(0x228)
-#define CM_IDLEST4_CORE                PRCM_REG32(0x22C)
-#define CM_AUTOIDLE1_CORE      PRCM_REG32(0x230)
-#define CM_AUTOIDLE2_CORE      PRCM_REG32(0x234)
-#define CM_AUTOIDLE3_CORE      PRCM_REG32(0x238)
-#define CM_AUTOIDLE4_CORE      PRCM_REG32(0x23C)
-#define CM_CLKSEL1_CORE                PRCM_REG32(0x240)
-#define CM_CLKSEL2_CORE                PRCM_REG32(0x244)
-#define CM_CLKSTCTRL_CORE      PRCM_REG32(0x248)
-#define PM_WKEN1_CORE          PRCM_REG32(0x2A0)
-#define PM_WKEN2_CORE          PRCM_REG32(0x2A4)
-#define PM_WKST1_CORE          PRCM_REG32(0x2B0)
-#define PM_WKST2_CORE          PRCM_REG32(0x2B4)
-#define PM_WKDEP_CORE          PRCM_REG32(0x2C8)
-#define PM_PWSTCTRL_CORE       PRCM_REG32(0x2E0)
-#define PM_PWSTST_CORE         PRCM_REG32(0x2E4)
-
-/* GFX */
-#define CM_FCLKEN_GFX          PRCM_REG32(0x300)
-#define CM_ICLKEN_GFX          PRCM_REG32(0x310)
-#define CM_IDLEST_GFX          PRCM_REG32(0x320)
-#define CM_CLKSEL_GFX          PRCM_REG32(0x340)
-#define CM_CLKSTCTRL_GFX       PRCM_REG32(0x348)
-#define RM_RSTCTRL_GFX         PRCM_REG32(0x350)
-#define RM_RSTST_GFX           PRCM_REG32(0x358)
-#define PM_WKDEP_GFX           PRCM_REG32(0x3C8)
-#define PM_PWSTCTRL_GFX                PRCM_REG32(0x3E0)
-#define PM_PWSTST_GFX          PRCM_REG32(0x3E4)
-
-/* WAKE-UP */
-#define CM_FCLKEN_WKUP         PRCM_REG32(0x400)
-#define CM_ICLKEN_WKUP         PRCM_REG32(0x410)
-#define CM_IDLEST_WKUP         PRCM_REG32(0x420)
-#define CM_AUTOIDLE_WKUP       PRCM_REG32(0x430)
-#define CM_CLKSEL_WKUP         PRCM_REG32(0x440)
-#define RM_RSTCTRL_WKUP                PRCM_REG32(0x450)
-#define RM_RSTTIME_WKUP                PRCM_REG32(0x454)
-#define RM_RSTST_WKUP          PRCM_REG32(0x458)
-#define PM_WKEN_WKUP           PRCM_REG32(0x4A0)
-#define PM_WKST_WKUP           PRCM_REG32(0x4B0)
-
-/* CLOCKS */
-#define CM_CLKEN_PLL           PRCM_REG32(0x500)
-#define CM_IDLEST_CKGEN                PRCM_REG32(0x520)
-#define CM_AUTOIDLE_PLL                PRCM_REG32(0x530)
-#define CM_CLKSEL1_PLL         PRCM_REG32(0x540)
-#define CM_CLKSEL2_PLL         PRCM_REG32(0x544)
-
-/* DSP */
-#define CM_FCLKEN_DSP          PRCM_REG32(0x800)
-#define CM_ICLKEN_DSP          PRCM_REG32(0x810)
-#define CM_IDLEST_DSP          PRCM_REG32(0x820)
-#define CM_AUTOIDLE_DSP                PRCM_REG32(0x830)
-#define CM_CLKSEL_DSP          PRCM_REG32(0x840)
-#define CM_CLKSTCTRL_DSP       PRCM_REG32(0x848)
-#define RM_RSTCTRL_DSP         PRCM_REG32(0x850)
-#define RM_RSTST_DSP           PRCM_REG32(0x858)
-#define PM_WKEN_DSP            PRCM_REG32(0x8A0)
-#define PM_WKDEP_DSP           PRCM_REG32(0x8C8)
-#define PM_PWSTCTRL_DSP                PRCM_REG32(0x8E0)
-#define PM_PWSTST_DSP          PRCM_REG32(0x8E4)
-#define PRCM_IRQSTATUS_DSP     PRCM_REG32(0x8F0)
-#define PRCM_IRQENABLE_DSP     PRCM_REG32(0x8F4)
-
-/* IVA */
-#define PRCM_IRQSTATUS_IVA     PRCM_REG32(0x8F8)
-#define PRCM_IRQENABLE_IVA     PRCM_REG32(0x8FC)
-
-/* Modem on 2430 */
-#define CM_FCLKEN_MDM          PRCM_REG32(0xC00)
-#define CM_ICLKEN_MDM          PRCM_REG32(0xC10)
-#define CM_IDLEST_MDM          PRCM_REG32(0xC20)
-#define CM_AUTOIDLE_MDM                PRCM_REG32(0xC30)
-#define CM_CLKSEL_MDM          PRCM_REG32(0xC40)
-#define CM_CLKSTCTRL_MDM       PRCM_REG32(0xC48)
-#define RM_RSTCTRL_MDM         PRCM_REG32(0xC50)
-#define RM_RSTST_MDM           PRCM_REG32(0xC58)
-#define PM_WKEN_MDM            PRCM_REG32(0xCA0)
-#define PM_WKST_MDM            PRCM_REG32(0xCB0)
-#define PM_WKDEP_MDM           PRCM_REG32(0xCC8)
-#define PM_PWSTCTRL_MDM                PRCM_REG32(0xCE0)
-#define PM_PWSTST_MDM          PRCM_REG32(0xCE4)
-
-#define OMAP24XX_L4_IO_BASE    0x48000000
-
-#define DISP_BASE              (OMAP24XX_L4_IO_BASE + 0x50000)
-#define DISP_REG32(offset)     __REG32(DISP_BASE + (offset))
-
-#define OMAP24XX_GPMC_BASE     (L3_24XX_BASE + 0xa000)
-#define GPMC_REG32(offset)     __REG32(OMAP24XX_GPMC_BASE + (offset))
-
-/* FIXME: Move these to timer code */
-#define GPT1_BASE              (0x48028000)
-#define GPT1_REG32(offset)     __REG32(GPT1_BASE + (offset))
-
-/* Misc sysconfig */
-#define DISPC_SYSCONFIG                DISP_REG32(0x410)
-#define SPI_BASE               (OMAP24XX_L4_IO_BASE + 0x98000)
-#define MCSPI1_SYSCONFIG       __REG32(SPI_BASE + 0x10)
-#define MCSPI2_SYSCONFIG       __REG32(SPI_BASE + 0x2000 + 0x10)
-#define MCSPI3_SYSCONFIG       __REG32(OMAP24XX_L4_IO_BASE + 0xb8010)
-
-#define CAMERA_MMU_SYSCONFIG   __REG32(DISP_BASE + 0x2C10)
-#define CAMERA_DMA_SYSCONFIG   __REG32(DISP_BASE + 0x282C)
-#define SYSTEM_DMA_SYSCONFIG   __REG32(DISP_BASE + 0x602C)
-#define GPMC_SYSCONFIG         GPMC_REG32(0x010)
-#define MAILBOXES_SYSCONFIG    __REG32(OMAP24XX_L4_IO_BASE + 0x94010)
-#define UART1_SYSCONFIG                __REG32(OMAP24XX_L4_IO_BASE + 0x6A054)
-#define UART2_SYSCONFIG                __REG32(OMAP24XX_L4_IO_BASE + 0x6C054)
-#define UART3_SYSCONFIG                __REG32(OMAP24XX_L4_IO_BASE + 0x6E054)
-#define SDRC_SYSCONFIG         __REG32(OMAP24XX_SDRC_BASE + 0x10)
-#define OMAP24XX_SMS_BASE      (L3_24XX_BASE + 0x8000)
-#define SMS_SYSCONFIG          __REG32(OMAP24XX_SMS_BASE + 0x10)
-#define SSI_SYSCONFIG          __REG32(DISP_BASE + 0x8010)
-
-/* rkw - good cannidates for PM_ to start what nm was trying */
-#define OMAP24XX_GPT2          (OMAP24XX_L4_IO_BASE + 0x2A000)
-#define OMAP24XX_GPT3          (OMAP24XX_L4_IO_BASE + 0x78000)
-#define OMAP24XX_GPT4          (OMAP24XX_L4_IO_BASE + 0x7A000)
-#define OMAP24XX_GPT5          (OMAP24XX_L4_IO_BASE + 0x7C000)
-#define OMAP24XX_GPT6          (OMAP24XX_L4_IO_BASE + 0x7E000)
-#define OMAP24XX_GPT7          (OMAP24XX_L4_IO_BASE + 0x80000)
-#define OMAP24XX_GPT8          (OMAP24XX_L4_IO_BASE + 0x82000)
-#define OMAP24XX_GPT9          (OMAP24XX_L4_IO_BASE + 0x84000)
-#define OMAP24XX_GPT10         (OMAP24XX_L4_IO_BASE + 0x86000)
-#define OMAP24XX_GPT11         (OMAP24XX_L4_IO_BASE + 0x88000)
-#define OMAP24XX_GPT12         (OMAP24XX_L4_IO_BASE + 0x8A000)
-
-/* FIXME: Move these to timer code */
-#define GPTIMER1_SYSCONFIG     GPT1_REG32(0x010)
-#define GPTIMER2_SYSCONFIG     __REG32(OMAP24XX_GPT2 + 0x10)
-#define GPTIMER3_SYSCONFIG     __REG32(OMAP24XX_GPT3 + 0x10)
-#define GPTIMER4_SYSCONFIG     __REG32(OMAP24XX_GPT4 + 0x10)
-#define GPTIMER5_SYSCONFIG     __REG32(OMAP24XX_GPT5 + 0x10)
-#define GPTIMER6_SYSCONFIG     __REG32(OMAP24XX_GPT6 + 0x10)
-#define GPTIMER7_SYSCONFIG     __REG32(OMAP24XX_GPT7 + 0x10)
-#define GPTIMER8_SYSCONFIG     __REG32(OMAP24XX_GPT8 + 0x10)
-#define GPTIMER9_SYSCONFIG     __REG32(OMAP24XX_GPT9 + 0x10)
-#define GPTIMER10_SYSCONFIG    __REG32(OMAP24XX_GPT10 + 0x10)
-#define GPTIMER11_SYSCONFIG    __REG32(OMAP24XX_GPT11 + 0x10)
-#define GPTIMER12_SYSCONFIG    __REG32(OMAP24XX_GPT12 + 0x10)
-
-/* FIXME: Move these to gpio code */
-#define OMAP24XX_GPIO_BASE     0x48018000
-#define GPIOX_BASE(X)          (OMAP24XX_GPIO_BASE + (0x2000 * ((X) - 1)))
-
-#define GPIO1_SYSCONFIG                __REG32((GPIOX_BASE(1) + 0x10))
-#define GPIO2_SYSCONFIG                __REG32((GPIOX_BASE(2) + 0x10))
-#define GPIO3_SYSCONFIG                __REG32((GPIOX_BASE(3) + 0x10))
-#define GPIO4_SYSCONFIG                __REG32((GPIOX_BASE(4) + 0x10))
-
-#if defined(CONFIG_ARCH_OMAP243X)
-#define GPIO5_SYSCONFIG                __REG32((OMAP24XX_GPIO5_BASE + 0x10))
-#endif
-
-/* GP TIMER 1 */
-#define GPTIMER1_TISTAT                GPT1_REG32(0x014)
-#define GPTIMER1_TISR          GPT1_REG32(0x018)
-#define GPTIMER1_TIER          GPT1_REG32(0x01C)
-#define GPTIMER1_TWER          GPT1_REG32(0x020)
-#define GPTIMER1_TCLR          GPT1_REG32(0x024)
-#define GPTIMER1_TCRR          GPT1_REG32(0x028)
-#define GPTIMER1_TLDR          GPT1_REG32(0x02C)
-#define GPTIMER1_TTGR          GPT1_REG32(0x030)
-#define GPTIMER1_TWPS          GPT1_REG32(0x034)
-#define GPTIMER1_TMAR          GPT1_REG32(0x038)
-#define GPTIMER1_TCAR1         GPT1_REG32(0x03C)
-#define GPTIMER1_TSICR         GPT1_REG32(0x040)
-#define GPTIMER1_TCAR2         GPT1_REG32(0x044)
-
-/* rkw -- base fix up please... */
-#define GPTIMER3_TISR          __REG32(OMAP24XX_L4_IO_BASE + 0x78018)
-
-/* SDRC */
-#define SDRC_DLLA_CTRL         __REG32(OMAP24XX_SDRC_BASE + 0x060)
-#define SDRC_DLLA_STATUS       __REG32(OMAP24XX_SDRC_BASE + 0x064)
-#define SDRC_DLLB_CTRL         __REG32(OMAP24XX_SDRC_BASE + 0x068)
-#define SDRC_DLLB_STATUS       __REG32(OMAP24XX_SDRC_BASE + 0x06C)
-#define SDRC_POWER             __REG32(OMAP24XX_SDRC_BASE + 0x070)
-#define SDRC_MR_0              __REG32(OMAP24XX_SDRC_BASE + 0x084)
-
-/* GPIO 1 */
-#define GPIO1_BASE             GPIOX_BASE(1)
-#define GPIO1_REG32(offset)    __REG32(GPIO1_BASE + (offset))
-#define GPIO1_IRQENABLE1       GPIO1_REG32(0x01C)
-#define GPIO1_IRQSTATUS1       GPIO1_REG32(0x018)
-#define GPIO1_IRQENABLE2       GPIO1_REG32(0x02C)
-#define GPIO1_IRQSTATUS2       GPIO1_REG32(0x028)
-#define GPIO1_WAKEUPENABLE     GPIO1_REG32(0x020)
-#define GPIO1_RISINGDETECT     GPIO1_REG32(0x048)
-#define GPIO1_DATAIN           GPIO1_REG32(0x038)
-#define GPIO1_OE               GPIO1_REG32(0x034)
-#define GPIO1_DATAOUT          GPIO1_REG32(0x03C)
-
-/* GPIO2 */
-#define GPIO2_BASE             GPIOX_BASE(2)
-#define GPIO2_REG32(offset)    __REG32(GPIO2_BASE + (offset))
-#define GPIO2_IRQENABLE1       GPIO2_REG32(0x01C)
-#define GPIO2_IRQSTATUS1       GPIO2_REG32(0x018)
-#define GPIO2_IRQENABLE2       GPIO2_REG32(0x02C)
-#define GPIO2_IRQSTATUS2       GPIO2_REG32(0x028)
-#define GPIO2_WAKEUPENABLE     GPIO2_REG32(0x020)
-#define GPIO2_RISINGDETECT     GPIO2_REG32(0x048)
-#define GPIO2_DATAIN           GPIO2_REG32(0x038)
-#define GPIO2_OE               GPIO2_REG32(0x034)
-#define GPIO2_DATAOUT          GPIO2_REG32(0x03C)
-#define GPIO2_DEBOUNCENABLE    GPIO2_REG32(0x050)
-#define GPIO2_DEBOUNCINGTIME   GPIO2_REG32(0x054)
-
-/* GPIO 3 */
-#define GPIO3_BASE             GPIOX_BASE(3)
-#define GPIO3_REG32(offset)    __REG32(GPIO3_BASE + (offset))
-#define GPIO3_IRQENABLE1       GPIO3_REG32(0x01C)
-#define GPIO3_IRQSTATUS1       GPIO3_REG32(0x018)
-#define GPIO3_IRQENABLE2       GPIO3_REG32(0x02C)
-#define GPIO3_IRQSTATUS2       GPIO3_REG32(0x028)
-#define GPIO3_WAKEUPENABLE     GPIO3_REG32(0x020)
-#define GPIO3_RISINGDETECT     GPIO3_REG32(0x048)
-#define GPIO3_FALLINGDETECT    GPIO3_REG32(0x04C)
-#define GPIO3_DATAIN           GPIO3_REG32(0x038)
-#define GPIO3_OE               GPIO3_REG32(0x034)
-#define GPIO3_DATAOUT          GPIO3_REG32(0x03C)
-#define GPIO3_DEBOUNCENABLE    GPIO3_REG32(0x050)
-#define GPIO3_DEBOUNCINGTIME   GPIO3_REG32(0x054)
-#define GPIO3_DEBOUNCENABLE    GPIO3_REG32(0x050)
-#define GPIO3_DEBOUNCINGTIME   GPIO3_REG32(0x054)
-
-/* GPIO 4 */
-#define GPIO4_BASE             GPIOX_BASE(4)
-#define GPIO4_REG32(offset)    __REG32(GPIO4_BASE + (offset))
-#define GPIO4_IRQENABLE1       GPIO4_REG32(0x01C)
-#define GPIO4_IRQSTATUS1       GPIO4_REG32(0x018)
-#define GPIO4_IRQENABLE2       GPIO4_REG32(0x02C)
-#define GPIO4_IRQSTATUS2       GPIO4_REG32(0x028)
-#define GPIO4_WAKEUPENABLE     GPIO4_REG32(0x020)
-#define GPIO4_RISINGDETECT     GPIO4_REG32(0x048)
-#define GPIO4_FALLINGDETECT    GPIO4_REG32(0x04C)
-#define GPIO4_DATAIN           GPIO4_REG32(0x038)
-#define GPIO4_OE               GPIO4_REG32(0x034)
-#define GPIO4_DATAOUT          GPIO4_REG32(0x03C)
-#define GPIO4_DEBOUNCENABLE    GPIO4_REG32(0x050)
-#define GPIO4_DEBOUNCINGTIME   GPIO4_REG32(0x054)
-
-#if defined(CONFIG_ARCH_OMAP243X)
-/* GPIO 5 */
-#define GPIO5_REG32(offset)    __REG32((OMAP24XX_GPIO5_BASE + (offset)))
-#define GPIO5_IRQENABLE1       GPIO5_REG32(0x01C)
-#define GPIO5_IRQSTATUS1       GPIO5_REG32(0x018)
-#define GPIO5_IRQENABLE2       GPIO5_REG32(0x02C)
-#define GPIO5_IRQSTATUS2       GPIO5_REG32(0x028)
-#define GPIO5_WAKEUPENABLE     GPIO5_REG32(0x020)
-#define GPIO5_RISINGDETECT     GPIO5_REG32(0x048)
-#define GPIO5_FALLINGDETECT    GPIO5_REG32(0x04C)
-#define GPIO5_DATAIN           GPIO5_REG32(0x038)
-#define GPIO5_OE               GPIO5_REG32(0x034)
-#define GPIO5_DATAOUT          GPIO5_REG32(0x03C)
-#define GPIO5_DEBOUNCENABLE    GPIO5_REG32(0x050)
-#define GPIO5_DEBOUNCINGTIME   GPIO5_REG32(0x054)
-#endif
-
-/* IO CONFIG */
-#define OMAP24XX_CTRL_BASE             (L4_24XX_BASE)
-#define CONTROL_REG32(offset)          __REG32(OMAP24XX_CTRL_BASE + (offset))
-
-#define CONTROL_PADCONF_SPI1_NCS2      CONTROL_REG32(0x104)
-#define CONTROL_PADCONF_SYS_XTALOUT    CONTROL_REG32(0x134)
-#define CONTROL_PADCONF_UART1_RX       CONTROL_REG32(0x0C8)
-#define CONTROL_PADCONF_MCBSP1_DX      CONTROL_REG32(0x10C)
-#define CONTROL_PADCONF_GPMC_NCS4      CONTROL_REG32(0x090)
-#define CONTROL_PADCONF_DSS_D5         CONTROL_REG32(0x0B8)
-#define CONTROL_PADCONF_DSS_D9         CONTROL_REG32(0x0BC)    /* 2420 */
-#define CONTROL_PADCONF_DSS_D13                CONTROL_REG32(0x0C0)
-#define CONTROL_PADCONF_DSS_VSYNC      CONTROL_REG32(0x0CC)
-#define CONTROL_PADCONF_SYS_NIRQW0     CONTROL_REG32(0x0BC)    /* 2430 */
-#define CONTROL_PADCONF_SSI1_FLAG_TX   CONTROL_REG32(0x108)    /* 2430 */
-
-/* CONTROL */
-#define CONTROL_DEVCONF                CONTROL_REG32(0x274)
-#define CONTROL_DEVCONF1       CONTROL_REG32(0x2E8)
-
-/* INTERRUPT CONTROLLER */
-#define INTC_BASE              ((L4_24XX_BASE) + 0xfe000)
-#define INTC_REG32(offset)     __REG32(INTC_BASE + (offset))
-
-#define INTC1_U_BASE           INTC_REG32(0x000)
-#define INTC_MIR0              INTC_REG32(0x084)
-#define INTC_MIR_SET0          INTC_REG32(0x08C)
-#define INTC_MIR_CLEAR0                INTC_REG32(0x088)
-#define INTC_ISR_CLEAR0                INTC_REG32(0x094)
-#define INTC_MIR1              INTC_REG32(0x0A4)
-#define INTC_MIR_SET1          INTC_REG32(0x0AC)
-#define INTC_MIR_CLEAR1                INTC_REG32(0x0A8)
-#define INTC_ISR_CLEAR1                INTC_REG32(0x0B4)
-#define INTC_MIR2              INTC_REG32(0x0C4)
-#define INTC_MIR_SET2          INTC_REG32(0x0CC)
-#define INTC_MIR_CLEAR2                INTC_REG32(0x0C8)
-#define INTC_ISR_CLEAR2                INTC_REG32(0x0D4)
-#define INTC_SIR_IRQ           INTC_REG32(0x040)
-#define INTC_CONTROL           INTC_REG32(0x048)
-#define INTC_ILR11             INTC_REG32(0x12C)       /* PRCM on MPU PIC */
-#define INTC_ILR30             INTC_REG32(0x178)
-#define INTC_ILR31             INTC_REG32(0x17C)
-#define INTC_ILR32             INTC_REG32(0x180)
-#define INTC_ILR37             INTC_REG32(0x194)       /* GPIO4 on MPU PIC */
-#define INTC_SYSCONFIG         INTC_REG32(0x010)       /* GPT1 on MPU PIC */
-
-/* RAM FIREWALL */
-#define RAMFW_BASE             (0x68005000)
-#define RAMFW_REG32(offset)    __REG32(RAMFW_BASE + (offset))
-
-#define RAMFW_REQINFOPERM0     RAMFW_REG32(0x048)
-#define RAMFW_READPERM0                RAMFW_REG32(0x050)
-#define RAMFW_WRITEPERM0       RAMFW_REG32(0x058)
-
-/* GPMC CS1 FPGA ON USER INTERFACE MODULE */
-//#define DEBUG_BOARD_LED_REGISTER 0x04000014
-
-/* GPMC CS0 */
-#define GPMC_CONFIG1_0         GPMC_REG32(0x060)
-#define GPMC_CONFIG2_0         GPMC_REG32(0x064)
-#define GPMC_CONFIG3_0         GPMC_REG32(0x068)
-#define GPMC_CONFIG4_0         GPMC_REG32(0x06C)
-#define GPMC_CONFIG5_0         GPMC_REG32(0x070)
-#define GPMC_CONFIG6_0         GPMC_REG32(0x074)
-#define GPMC_CONFIG7_0         GPMC_REG32(0x078)
-
-/* GPMC CS1 */
-#define GPMC_CONFIG1_1         GPMC_REG32(0x090)
-#define GPMC_CONFIG2_1         GPMC_REG32(0x094)
-#define GPMC_CONFIG3_1         GPMC_REG32(0x098)
-#define GPMC_CONFIG4_1         GPMC_REG32(0x09C)
-#define GPMC_CONFIG5_1         GPMC_REG32(0x0a0)
-#define GPMC_CONFIG6_1         GPMC_REG32(0x0a4)
-#define GPMC_CONFIG7_1         GPMC_REG32(0x0a8)
-
-/* GPMC CS3 */
-#define GPMC_CONFIG1_3         GPMC_REG32(0x0F0)
-#define GPMC_CONFIG2_3         GPMC_REG32(0x0F4)
-#define GPMC_CONFIG3_3         GPMC_REG32(0x0F8)
-#define GPMC_CONFIG4_3         GPMC_REG32(0x0FC)
-#define GPMC_CONFIG5_3         GPMC_REG32(0x100)
-#define GPMC_CONFIG6_3         GPMC_REG32(0x104)
-#define GPMC_CONFIG7_3         GPMC_REG32(0x108)
-
-/* DSS */
-#define DSS_CONTROL            DISP_REG32(0x040)
-#define DISPC_CONTROL          DISP_REG32(0x440)
-#define DISPC_SYSSTATUS                DISP_REG32(0x414)
-#define DISPC_IRQSTATUS                DISP_REG32(0x418)
-#define DISPC_IRQENABLE                DISP_REG32(0x41C)
-#define DISPC_CONFIG           DISP_REG32(0x444)
-#define DISPC_DEFAULT_COLOR0   DISP_REG32(0x44C)
-#define DISPC_DEFAULT_COLOR1   DISP_REG32(0x450)
-#define DISPC_TRANS_COLOR0     DISP_REG32(0x454)
-#define DISPC_TRANS_COLOR1     DISP_REG32(0x458)
-#define DISPC_LINE_NUMBER      DISP_REG32(0x460)
-#define DISPC_TIMING_H         DISP_REG32(0x464)
-#define DISPC_TIMING_V         DISP_REG32(0x468)
-#define DISPC_POL_FREQ         DISP_REG32(0x46C)
-#define DISPC_DIVISOR          DISP_REG32(0x470)
-#define DISPC_SIZE_DIG         DISP_REG32(0x478)
-#define DISPC_SIZE_LCD         DISP_REG32(0x47C)
-#define DISPC_GFX_BA0          DISP_REG32(0x480)
-#define DISPC_GFX_BA1          DISP_REG32(0x484)
-#define DISPC_GFX_POSITION     DISP_REG32(0x488)
-#define DISPC_GFX_SIZE         DISP_REG32(0x48C)
-#define DISPC_GFX_ATTRIBUTES   DISP_REG32(0x4A0)
-#define DISPC_GFX_FIFO_THRESHOLD       DISP_REG32(0x4A4)
-#define DISPC_GFX_ROW_INC      DISP_REG32(0x4AC)
-#define DISPC_GFX_PIXEL_INC    DISP_REG32(0x4B0)
-#define DISPC_GFX_WINDOW_SKIP  DISP_REG32(0x4B4)
-#define DISPC_GFX_TABLE_BA     DISP_REG32(0x4B8)
-#define DISPC_DATA_CYCLE1      DISP_REG32(0x5D4)
-#define DISPC_DATA_CYCLE2      DISP_REG32(0x5D8)
-#define DISPC_DATA_CYCLE3      DISP_REG32(0x5DC)
-
-/* HSUSB Suspend */
-#define HSUSB_CTRL             __REG8(0x480AC001)
-#define USBOTG_POWER           __REG32(0x480AC000)
-
-/* HS MMC */
-#define MMCHS1_SYSCONFIG       __REG32(0x4809C010)
-#define MMCHS2_SYSCONFIG       __REG32(0x480b4010)
-
-#endif /* __ASSEMBLER__ */
-
-#endif
-
-
-
-
-
index 90f530540c6529138c6a9e6a77d4ec21c7095d72..b12f423b8595ecd7badd89eaeb2ba177a4f01d08 100644 (file)
 #include <linux/init.h>
 #include <linux/clk.h>
 
-#include "prcm-regs.h"
+#include <asm/io.h>
+
+#include "prm.h"
+#include "prm-regbits-24xx.h"
 
 extern void omap2_clk_prepare_for_reboot(void);
 
 u32 omap_prcm_get_reset_sources(void)
 {
-       return RM_RSTST_WKUP & 0x7f;
+       return prm_read_mod_reg(WKUP_MOD, RM_RSTST) & 0x7f;
 }
 EXPORT_SYMBOL(omap_prcm_get_reset_sources);
 
 /* Resets clock rates and reboots the system. Only called from system.h */
 void omap_prcm_arch_reset(char mode)
 {
+       u32 wkup;
        omap2_clk_prepare_for_reboot();
-       RM_RSTCTRL_WKUP |= 2;
+
+       if (cpu_is_omap24xx()) {
+               wkup = prm_read_mod_reg(WKUP_MOD, RM_RSTCTRL) | OMAP_RST_DPLL3;
+               prm_write_mod_reg(wkup, WKUP_MOD, RM_RSTCTRL);
+       }
 }
diff --git a/arch/arm/mach-omap2/prm-regbits-24xx.h b/arch/arm/mach-omap2/prm-regbits-24xx.h
new file mode 100644 (file)
index 0000000..c6d17a3
--- /dev/null
@@ -0,0 +1,279 @@
+#ifndef __ARCH_ARM_MACH_OMAP2_PRM_REGBITS_24XX_H
+#define __ARCH_ARM_MACH_OMAP2_PRM_REGBITS_24XX_H
+
+/*
+ * OMAP24XX Power/Reset Management register bits
+ *
+ * Copyright (C) 2007 Texas Instruments, Inc.
+ * Copyright (C) 2007 Nokia Corporation
+ *
+ * Written by Paul Walmsley
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include "prm.h"
+
+/* Bits shared between registers */
+
+/* PRCM_IRQSTATUS_MPU, PM_IRQSTATUS_DSP, PRCM_IRQSTATUS_IVA shared bits */
+#define OMAP24XX_VOLTTRANS_ST                          (1 << 2)
+#define OMAP24XX_WKUP2_ST                              (1 << 1)
+#define OMAP24XX_WKUP1_ST                              (1 << 0)
+
+/* PRCM_IRQENABLE_MPU, PM_IRQENABLE_DSP, PRCM_IRQENABLE_IVA shared bits */
+#define OMAP24XX_VOLTTRANS_EN                          (1 << 2)
+#define OMAP24XX_WKUP2_EN                              (1 << 1)
+#define OMAP24XX_WKUP1_EN                              (1 << 0)
+
+/* PM_WKDEP_GFX, PM_WKDEP_MPU, PM_WKDEP_DSP, PM_WKDEP_MDM shared bits */
+#define OMAP24XX_EN_MPU                                        (1 << 1)
+#define OMAP24XX_EN_CORE                               (1 << 0)
+
+/*
+ * PM_PWSTCTRL_MPU, PM_PWSTCTRL_GFX, PM_PWSTCTRL_DSP, PM_PWSTCTRL_MDM
+ * shared bits
+ */
+#define OMAP24XX_MEMONSTATE_SHIFT                      10
+#define OMAP24XX_MEMONSTATE_MASK                       (0x3 << 10)
+#define OMAP24XX_MEMRETSTATE                           (1 << 3)
+
+/* PM_PWSTCTRL_GFX, PM_PWSTCTRL_DSP, PM_PWSTCTRL_MDM shared bits */
+#define OMAP24XX_FORCESTATE                            (1 << 18)
+
+/*
+ * PM_PWSTST_CORE, PM_PWSTST_GFX, PM_PWSTST_MPU, PM_PWSTST_DSP,
+ * PM_PWSTST_MDM shared bits
+ */
+#define OMAP24XX_CLKACTIVITY                           (1 << 19)
+
+/* PM_PWSTST_MPU, PM_PWSTST_CORE, PM_PWSTST_DSP shared bits */
+#define OMAP24XX_LASTSTATEENTERED_SHIFT                        4
+#define OMAP24XX_LASTSTATEENTERED_MASK                 (0x3 << 4)
+
+/* PM_PWSTST_MPU and PM_PWSTST_DSP shared bits */
+#define OMAP2430_MEMSTATEST_SHIFT                      10
+#define OMAP2430_MEMSTATEST_MASK                       (0x3 << 10)
+
+/* PM_PWSTST_GFX, PM_PWSTST_DSP, PM_PWSTST_MDM shared bits */
+#define OMAP24XX_POWERSTATEST_SHIFT                    0
+#define OMAP24XX_POWERSTATEST_MASK                     (0x3 << 0)
+
+
+/* Bits specific to each register */
+
+/* PRCM_REVISION */
+#define OMAP24XX_REV_SHIFT                             0
+#define OMAP24XX_REV_MASK                              (0xff << 0)
+
+/* PRCM_SYSCONFIG */
+#define OMAP24XX_AUTOIDLE                              (1 << 0)
+
+/* PRCM_IRQSTATUS_MPU specific bits */
+#define OMAP2430_DPLL_RECAL_ST                         (1 << 6)
+#define OMAP24XX_TRANSITION_ST                         (1 << 5)
+#define OMAP24XX_EVGENOFF_ST                           (1 << 4)
+#define OMAP24XX_EVGENON_ST                            (1 << 3)
+
+/* PRCM_IRQENABLE_MPU specific bits */
+#define OMAP2430_DPLL_RECAL_EN                         (1 << 6)
+#define OMAP24XX_TRANSITION_EN                         (1 << 5)
+#define OMAP24XX_EVGENOFF_EN                           (1 << 4)
+#define OMAP24XX_EVGENON_EN                            (1 << 3)
+
+/* PRCM_VOLTCTRL */
+#define OMAP24XX_AUTO_EXTVOLT                          (1 << 15)
+#define OMAP24XX_FORCE_EXTVOLT                         (1 << 14)
+#define OMAP24XX_SETOFF_LEVEL_SHIFT                    12
+#define OMAP24XX_SETOFF_LEVEL_MASK                     (0x3 << 12)
+#define OMAP24XX_MEMRETCTRL                            (1 << 8)
+#define OMAP24XX_SETRET_LEVEL_SHIFT                    6
+#define OMAP24XX_SETRET_LEVEL_MASK                     (0x3 << 6)
+#define OMAP24XX_VOLT_LEVEL_SHIFT                      0
+#define OMAP24XX_VOLT_LEVEL_MASK                       (0x3 << 0)
+
+/* PRCM_VOLTST */
+#define OMAP24XX_ST_VOLTLEVEL_SHIFT                    0
+#define OMAP24XX_ST_VOLTLEVEL_MASK                     (0x3 << 0)
+
+/* PRCM_CLKSRC_CTRL specific bits */
+
+/* PRCM_CLKOUT_CTRL */
+#define OMAP2420_CLKOUT2_EN_SHIFT                      15
+#define OMAP2420_CLKOUT2_EN                            (1 << 15)
+#define OMAP2420_CLKOUT2_DIV_SHIFT                     11
+#define OMAP2420_CLKOUT2_DIV_MASK                      (0x7 << 11)
+#define OMAP2420_CLKOUT2_SOURCE_SHIFT                  8
+#define OMAP2420_CLKOUT2_SOURCE_MASK                   (0x3 << 8)
+#define OMAP24XX_CLKOUT_EN_SHIFT                       7
+#define OMAP24XX_CLKOUT_EN                             (1 << 7)
+#define OMAP24XX_CLKOUT_DIV_SHIFT                      3
+#define OMAP24XX_CLKOUT_DIV_MASK                       (0x7 << 3)
+#define OMAP24XX_CLKOUT_SOURCE_SHIFT                   0
+#define OMAP24XX_CLKOUT_SOURCE_MASK                    (0x3 << 0)
+
+/* PRCM_CLKEMUL_CTRL */
+#define OMAP24XX_EMULATION_EN_SHIFT                    0
+#define OMAP24XX_EMULATION_EN                          (1 << 0)
+
+/* PRCM_CLKCFG_CTRL */
+#define OMAP24XX_VALID_CONFIG                          (1 << 0)
+
+/* PRCM_CLKCFG_STATUS */
+#define OMAP24XX_CONFIG_STATUS                         (1 << 0)
+
+/* PRCM_VOLTSETUP specific bits */
+
+/* PRCM_CLKSSETUP specific bits */
+
+/* PRCM_POLCTRL */
+#define OMAP2420_CLKOUT2_POL                           (1 << 10)
+#define OMAP24XX_CLKOUT_POL                            (1 << 9)
+#define OMAP24XX_CLKREQ_POL                            (1 << 8)
+#define OMAP2430_USE_POWEROK                           (1 << 2)
+#define OMAP2430_POWEROK_POL                           (1 << 1)
+#define OMAP24XX_EXTVOL_POL                            (1 << 0)
+
+/* RM_RSTST_MPU specific bits */
+/* 2430 calls GLOBALWMPU_RST "GLOBALWARM_RST" instead */
+
+/* PM_WKDEP_MPU specific bits */
+#define OMAP2430_PM_WKDEP_MPU_EN_MDM                   (1 << 5)
+#define OMAP24XX_PM_WKDEP_MPU_EN_DSP                   (1 << 2)
+
+/* PM_EVGENCTRL_MPU specific bits */
+
+/* PM_EVEGENONTIM_MPU specific bits */
+
+/* PM_EVEGENOFFTIM_MPU specific bits */
+
+/* PM_PWSTCTRL_MPU specific bits */
+#define OMAP2430_FORCESTATE                            (1 << 18)
+
+/* PM_PWSTST_MPU specific bits */
+/* INTRANSITION, CLKACTIVITY, POWERSTATE, MEMSTATEST are 2430 only */
+
+/* PM_WKEN1_CORE specific bits */
+
+/* PM_WKEN2_CORE specific bits */
+
+/* PM_WKST1_CORE specific bits*/
+
+/* PM_WKST2_CORE specific bits */
+
+/* PM_WKDEP_CORE specific bits*/
+#define OMAP2430_PM_WKDEP_CORE_EN_MDM                  (1 << 5)
+#define OMAP24XX_PM_WKDEP_CORE_EN_GFX                  (1 << 3)
+#define OMAP24XX_PM_WKDEP_CORE_EN_DSP                  (1 << 2)
+
+/* PM_PWSTCTRL_CORE specific bits */
+#define OMAP24XX_MEMORYCHANGE                          (1 << 20)
+#define OMAP24XX_MEM3ONSTATE_SHIFT                     14
+#define OMAP24XX_MEM3ONSTATE_MASK                      (0x3 << 14)
+#define OMAP24XX_MEM2ONSTATE_SHIFT                     12
+#define OMAP24XX_MEM2ONSTATE_MASK                      (0x3 << 12)
+#define OMAP24XX_MEM1ONSTATE_SHIFT                     10
+#define OMAP24XX_MEM1ONSTATE_MASK                      (0x3 << 10)
+#define OMAP24XX_MEM3RETSTATE                          (1 << 5)
+#define OMAP24XX_MEM2RETSTATE                          (1 << 4)
+#define OMAP24XX_MEM1RETSTATE                          (1 << 3)
+
+/* PM_PWSTST_CORE specific bits */
+#define OMAP24XX_MEM3STATEST_SHIFT                     14
+#define OMAP24XX_MEM3STATEST_MASK                      (0x3 << 14)
+#define OMAP24XX_MEM2STATEST_SHIFT                     12
+#define OMAP24XX_MEM2STATEST_MASK                      (0x3 << 12)
+#define OMAP24XX_MEM1STATEST_SHIFT                     10
+#define OMAP24XX_MEM1STATEST_MASK                      (0x3 << 10)
+
+/* RM_RSTCTRL_GFX */
+#define OMAP24XX_GFX_RST                               (1 << 0)
+
+/* RM_RSTST_GFX specific bits */
+#define OMAP24XX_GFX_SW_RST                            (1 << 4)
+
+/* PM_PWSTCTRL_GFX specific bits */
+
+/* PM_WKDEP_GFX specific bits */
+/* 2430 often calls EN_WAKEUP "EN_WKUP" */
+
+/* RM_RSTCTRL_WKUP specific bits */
+
+/* RM_RSTTIME_WKUP specific bits */
+
+/* RM_RSTST_WKUP specific bits */
+/* 2430 calls EXTWMPU_RST "EXTWARM_RST" and GLOBALWMPU_RST "GLOBALWARM_RST" */
+#define OMAP24XX_EXTWMPU_RST                           (1 << 6)
+#define OMAP24XX_SECU_WD_RST                           (1 << 5)
+#define OMAP24XX_MPU_WD_RST                            (1 << 4)
+#define OMAP24XX_SECU_VIOL_RST                         (1 << 3)
+
+/* PM_WKEN_WKUP specific bits */
+
+/* PM_WKST_WKUP specific bits */
+
+/* RM_RSTCTRL_DSP */
+#define OMAP2420_RST_IVA                               (1 << 8)
+#define OMAP24XX_RST2_DSP                              (1 << 1)
+#define OMAP24XX_RST1_DSP                              (1 << 0)
+
+/* RM_RSTST_DSP specific bits */
+/* 2430 calls GLOBALWMPU_RST "GLOBALWARM_RST" */
+#define OMAP2420_IVA_SW_RST                            (1 << 8)
+#define OMAP24XX_DSP_SW_RST2                           (1 << 5)
+#define OMAP24XX_DSP_SW_RST1                           (1 << 4)
+
+/* PM_WKDEP_DSP specific bits */
+
+/* PM_PWSTCTRL_DSP specific bits */
+/* 2430 only: MEMONSTATE, MEMRETSTATE */
+#define OMAP2420_MEMIONSTATE_SHIFT                     12
+#define OMAP2420_MEMIONSTATE_MASK                      (0x3 << 12)
+#define OMAP2420_MEMIRETSTATE                          (1 << 4)
+
+/* PM_PWSTST_DSP specific bits */
+/* MEMSTATEST is 2430 only */
+#define OMAP2420_MEMISTATEST_SHIFT                     12
+#define OMAP2420_MEMISTATEST_MASK                      (0x3 << 12)
+
+/* PRCM_IRQSTATUS_DSP specific bits */
+
+/* PRCM_IRQENABLE_DSP specific bits */
+
+/* RM_RSTCTRL_MDM */
+/* 2430 only */
+#define OMAP2430_PWRON1_MDM                            (1 << 1)
+#define OMAP2430_RST1_MDM                              (1 << 0)
+
+/* RM_RSTST_MDM specific bits */
+/* 2430 only */
+#define OMAP2430_MDM_SECU_VIOL                         (1 << 6)
+#define OMAP2430_MDM_SW_PWRON1                         (1 << 5)
+#define OMAP2430_MDM_SW_RST1                           (1 << 4)
+
+/* PM_WKEN_MDM */
+/* 2430 only */
+#define OMAP2430_PM_WKEN_MDM_EN_MDM                    (1 << 0)
+
+/* PM_WKST_MDM specific bits */
+/* 2430 only */
+
+/* PM_WKDEP_MDM specific bits */
+/* 2430 only */
+
+/* PM_PWSTCTRL_MDM specific bits */
+/* 2430 only */
+#define OMAP2430_KILLDOMAINWKUP                                (1 << 19)
+
+/* PM_PWSTST_MDM specific bits */
+/* 2430 only */
+
+/* PRCM_IRQSTATUS_IVA */
+/* 2420 only */
+
+/* PRCM_IRQENABLE_IVA */
+/* 2420 only */
+
+#endif
diff --git a/arch/arm/mach-omap2/prm-regbits-34xx.h b/arch/arm/mach-omap2/prm-regbits-34xx.h
new file mode 100644 (file)
index 0000000..b4686bc
--- /dev/null
@@ -0,0 +1,582 @@
+#ifndef __ARCH_ARM_MACH_OMAP2_PRM_REGBITS_34XX_H
+#define __ARCH_ARM_MACH_OMAP2_PRM_REGBITS_34XX_H
+
+/*
+ * OMAP3430 Power/Reset Management register bits
+ *
+ * Copyright (C) 2007-2008 Texas Instruments, Inc.
+ * Copyright (C) 2007-2008 Nokia Corporation
+ *
+ * Written by Paul Walmsley
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include "prm.h"
+
+/* Shared register bits */
+
+/* PRM_VC_CMD_VAL_0, PRM_VC_CMD_VAL_1 shared bits */
+#define OMAP3430_ON_SHIFT                              24
+#define OMAP3430_ON_MASK                               (0xff << 24)
+#define OMAP3430_ONLP_SHIFT                            16
+#define OMAP3430_ONLP_MASK                             (0xff << 16)
+#define OMAP3430_RET_SHIFT                             8
+#define OMAP3430_RET_MASK                              (0xff << 8)
+#define OMAP3430_OFF_SHIFT                             0
+#define OMAP3430_OFF_MASK                              (0xff << 0)
+
+/* PRM_VP1_CONFIG, PRM_VP2_CONFIG shared bits */
+#define OMAP3430_ERROROFFSET_SHIFT                     24
+#define OMAP3430_ERROROFFSET_MASK                      (0xff << 24)
+#define OMAP3430_ERRORGAIN_SHIFT                       16
+#define OMAP3430_ERRORGAIN_MASK                                (0xff << 16)
+#define OMAP3430_INITVOLTAGE_SHIFT                     8
+#define OMAP3430_INITVOLTAGE_MASK                      (0xff << 8)
+#define OMAP3430_TIMEOUTEN                             (1 << 3)
+#define OMAP3430_INITVDD                               (1 << 2)
+#define OMAP3430_FORCEUPDATE                           (1 << 1)
+#define OMAP3430_VPENABLE                              (1 << 0)
+
+/* PRM_VP1_VSTEPMIN, PRM_VP2_VSTEPMIN shared bits */
+#define OMAP3430_SMPSWAITTIMEMIN_SHIFT                 8
+#define OMAP3430_SMPSWAITTIMEMIN_MASK                  (0xffff << 8)
+#define OMAP3430_VSTEPMIN_SHIFT                                0
+#define OMAP3430_VSTEPMIN_MASK                         (0xff << 0)
+
+/* PRM_VP1_VSTEPMAX, PRM_VP2_VSTEPMAX shared bits */
+#define OMAP3430_SMPSWAITTIMEMAX_SHIFT                 8
+#define OMAP3430_SMPSWAITTIMEMAX_MASK                  (0xffff << 8)
+#define OMAP3430_VSTEPMAX_SHIFT                                0
+#define OMAP3430_VSTEPMAX_MASK                         (0xff << 0)
+
+/* PRM_VP1_VLIMITTO, PRM_VP2_VLIMITTO shared bits */
+#define OMAP3430_VDDMAX_SHIFT                          24
+#define OMAP3430_VDDMAX_MASK                           (0xff << 24)
+#define OMAP3430_VDDMIN_SHIFT                          16
+#define OMAP3430_VDDMIN_MASK                           (0xff << 16)
+#define OMAP3430_TIMEOUT_SHIFT                         0
+#define OMAP3430_TIMEOUT_MASK                          (0xffff << 0)
+
+/* PRM_VP1_VOLTAGE, PRM_VP2_VOLTAGE shared bits */
+#define OMAP3430_VPVOLTAGE_SHIFT                       0
+#define OMAP3430_VPVOLTAGE_MASK                                (0xff << 0)
+
+/* PRM_VP1_STATUS, PRM_VP2_STATUS shared bits */
+#define OMAP3430_VPINIDLE                              (1 << 0)
+
+/* PM_WKDEP_IVA2, PM_WKDEP_MPU shared bits */
+#define OMAP3430_EN_PER                                        (1 << 7)
+
+/* PM_PWSTCTRL_IVA2, PM_PWSTCTRL_MPU, PM_PWSTCTRL_CORE shared bits */
+#define OMAP3430_MEMORYCHANGE                          (1 << 3)
+
+/* PM_PWSTST_IVA2, PM_PWSTST_CORE shared bits */
+#define OMAP3430_LOGICSTATEST                          (1 << 2)
+
+/* PM_PREPWSTST_IVA2, PM_PREPWSTST_CORE shared bits */
+#define OMAP3430_LASTLOGICSTATEENTERED                         (1 << 2)
+
+/*
+ * PM_PREPWSTST_IVA2, PM_PREPWSTST_MPU, PM_PREPWSTST_CORE,
+ * PM_PREPWSTST_GFX, PM_PREPWSTST_DSS, PM_PREPWSTST_CAM,
+ * PM_PREPWSTST_PER, PM_PREPWSTST_NEON shared bits
+ */
+#define OMAP3430_LASTPOWERSTATEENTERED_SHIFT                   0
+#define OMAP3430_LASTPOWERSTATEENTERED_MASK                    (0x3 << 0)
+
+/* PRM_IRQSTATUS_IVA2, PRM_IRQSTATUS_MPU shared bits */
+#define OMAP3430_WKUP_ST                               (1 << 0)
+
+/* PRM_IRQENABLE_IVA2, PRM_IRQENABLE_MPU shared bits */
+#define OMAP3430_WKUP_EN                                       (1 << 0)
+
+/* PM_MPUGRPSEL1_CORE, PM_IVA2GRPSEL1_CORE shared bits */
+#define OMAP3430_GRPSEL_MMC2                           (1 << 25)
+#define OMAP3430_GRPSEL_MMC1                           (1 << 24)
+#define OMAP3430_GRPSEL_MCSPI4                         (1 << 21)
+#define OMAP3430_GRPSEL_MCSPI3                         (1 << 20)
+#define OMAP3430_GRPSEL_MCSPI2                         (1 << 19)
+#define OMAP3430_GRPSEL_MCSPI1                         (1 << 18)
+#define OMAP3430_GRPSEL_I2C3                           (1 << 17)
+#define OMAP3430_GRPSEL_I2C2                           (1 << 16)
+#define OMAP3430_GRPSEL_I2C1                           (1 << 15)
+#define OMAP3430_GRPSEL_UART2                          (1 << 14)
+#define OMAP3430_GRPSEL_UART1                          (1 << 13)
+#define OMAP3430_GRPSEL_GPT11                          (1 << 12)
+#define OMAP3430_GRPSEL_GPT10                          (1 << 11)
+#define OMAP3430_GRPSEL_MCBSP5                         (1 << 10)
+#define OMAP3430_GRPSEL_MCBSP1                         (1 << 9)
+#define OMAP3430_GRPSEL_HSOTGUSB                       (1 << 4)
+#define OMAP3430_GRPSEL_D2D                            (1 << 3)
+
+/*
+ * PM_PWSTCTRL_GFX, PM_PWSTCTRL_DSS, PM_PWSTCTRL_CAM,
+ * PM_PWSTCTRL_PER shared bits
+ */
+#define OMAP3430_MEMONSTATE_SHIFT                      16
+#define OMAP3430_MEMONSTATE_MASK                       (0x3 << 16)
+#define OMAP3430_MEMRETSTATE                           (1 << 8)
+
+/* PM_MPUGRPSEL_PER, PM_IVA2GRPSEL_PER shared bits */
+#define OMAP3430_GRPSEL_GPIO6                          (1 << 17)
+#define OMAP3430_GRPSEL_GPIO5                          (1 << 16)
+#define OMAP3430_GRPSEL_GPIO4                          (1 << 15)
+#define OMAP3430_GRPSEL_GPIO3                          (1 << 14)
+#define OMAP3430_GRPSEL_GPIO2                          (1 << 13)
+#define OMAP3430_GRPSEL_UART3                          (1 << 11)
+#define OMAP3430_GRPSEL_GPT9                           (1 << 10)
+#define OMAP3430_GRPSEL_GPT8                           (1 << 9)
+#define OMAP3430_GRPSEL_GPT7                           (1 << 8)
+#define OMAP3430_GRPSEL_GPT6                           (1 << 7)
+#define OMAP3430_GRPSEL_GPT5                           (1 << 6)
+#define OMAP3430_GRPSEL_GPT4                           (1 << 5)
+#define OMAP3430_GRPSEL_GPT3                           (1 << 4)
+#define OMAP3430_GRPSEL_GPT2                           (1 << 3)
+#define OMAP3430_GRPSEL_MCBSP4                         (1 << 2)
+#define OMAP3430_GRPSEL_MCBSP3                         (1 << 1)
+#define OMAP3430_GRPSEL_MCBSP2                         (1 << 0)
+
+/* PM_MPUGRPSEL_WKUP, PM_IVA2GRPSEL_WKUP shared bits */
+#define OMAP3430_GRPSEL_IO                             (1 << 8)
+#define OMAP3430_GRPSEL_SR2                            (1 << 7)
+#define OMAP3430_GRPSEL_SR1                            (1 << 6)
+#define OMAP3430_GRPSEL_GPIO1                          (1 << 3)
+#define OMAP3430_GRPSEL_GPT12                          (1 << 1)
+#define OMAP3430_GRPSEL_GPT1                           (1 << 0)
+
+/* Bits specific to each register */
+
+/* RM_RSTCTRL_IVA2 */
+#define OMAP3430_RST3_IVA2                             (1 << 2)
+#define OMAP3430_RST2_IVA2                             (1 << 1)
+#define OMAP3430_RST1_IVA2                             (1 << 0)
+
+/* RM_RSTST_IVA2 specific bits */
+#define OMAP3430_EMULATION_VSEQ_RST                    (1 << 13)
+#define OMAP3430_EMULATION_VHWA_RST                    (1 << 12)
+#define OMAP3430_EMULATION_IVA2_RST                    (1 << 11)
+#define OMAP3430_IVA2_SW_RST3                          (1 << 10)
+#define OMAP3430_IVA2_SW_RST2                          (1 << 9)
+#define OMAP3430_IVA2_SW_RST1                          (1 << 8)
+
+/* PM_WKDEP_IVA2 specific bits */
+
+/* PM_PWSTCTRL_IVA2 specific bits */
+#define OMAP3430_L2FLATMEMONSTATE_SHIFT                        22
+#define OMAP3430_L2FLATMEMONSTATE_MASK                 (0x3 << 22)
+#define OMAP3430_SHAREDL2CACHEFLATONSTATE_SHIFT                20
+#define OMAP3430_SHAREDL2CACHEFLATONSTATE_MASK         (0x3 << 20)
+#define OMAP3430_L1FLATMEMONSTATE_SHIFT                        18
+#define OMAP3430_L1FLATMEMONSTATE_MASK                 (0x3 << 18)
+#define OMAP3430_SHAREDL1CACHEFLATONSTATE_SHIFT                16
+#define OMAP3430_SHAREDL1CACHEFLATONSTATE_MASK         (0x3 << 16)
+#define OMAP3430_L2FLATMEMRETSTATE                     (1 << 11)
+#define OMAP3430_SHAREDL2CACHEFLATRETSTATE             (1 << 10)
+#define OMAP3430_L1FLATMEMRETSTATE                     (1 << 9)
+#define OMAP3430_SHAREDL1CACHEFLATRETSTATE             (1 << 8)
+
+/* PM_PWSTST_IVA2 specific bits */
+#define OMAP3430_L2FLATMEMSTATEST_SHIFT                        10
+#define OMAP3430_L2FLATMEMSTATEST_MASK                 (0x3 << 10)
+#define OMAP3430_SHAREDL2CACHEFLATSTATEST_SHIFT                8
+#define OMAP3430_SHAREDL2CACHEFLATSTATEST_MASK         (0x3 << 8)
+#define OMAP3430_L1FLATMEMSTATEST_SHIFT                        6
+#define OMAP3430_L1FLATMEMSTATEST_MASK                 (0x3 << 6)
+#define OMAP3430_SHAREDL1CACHEFLATSTATEST_SHIFT                4
+#define OMAP3430_SHAREDL1CACHEFLATSTATEST_MASK         (0x3 << 4)
+
+/* PM_PREPWSTST_IVA2 specific bits */
+#define OMAP3430_LASTL2FLATMEMSTATEENTERED_SHIFT               10
+#define OMAP3430_LASTL2FLATMEMSTATEENTERED_MASK                        (0x3 << 10)
+#define OMAP3430_LASTSHAREDL2CACHEFLATSTATEENTERED_SHIFT       8
+#define OMAP3430_LASTSHAREDL2CACHEFLATSTATEENTERED_MASK                (0x3 << 8)
+#define OMAP3430_LASTL1FLATMEMSTATEENTERED_SHIFT               6
+#define OMAP3430_LASTL1FLATMEMSTATEENTERED_MASK                        (0x3 << 6)
+#define OMAP3430_LASTSHAREDL1CACHEFLATSTATEENTERED_SHIFT       4
+#define OMAP3430_LASTSHAREDL1CACHEFLATSTATEENTERED_MASK                (0x3 << 4)
+
+/* PRM_IRQSTATUS_IVA2 specific bits */
+#define OMAP3430_PRM_IRQSTATUS_IVA2_IVA2_DPLL_ST       (1 << 2)
+#define OMAP3430_FORCEWKUP_ST                          (1 << 1)
+
+/* PRM_IRQENABLE_IVA2 specific bits */
+#define OMAP3430_PRM_IRQENABLE_IVA2_IVA2_DPLL_RECAL_EN         (1 << 2)
+#define OMAP3430_FORCEWKUP_EN                                  (1 << 1)
+
+/* PRM_REVISION specific bits */
+
+/* PRM_SYSCONFIG specific bits */
+
+/* PRM_IRQSTATUS_MPU specific bits */
+#define OMAP3430ES2_SND_PERIPH_DPLL_ST_SHIFT           25
+#define OMAP3430ES2_SND_PERIPH_DPLL_ST                 (1 << 25)
+#define OMAP3430_VC_TIMEOUTERR_ST                      (1 << 24)
+#define OMAP3430_VC_RAERR_ST                           (1 << 23)
+#define OMAP3430_VC_SAERR_ST                           (1 << 22)
+#define OMAP3430_VP2_TRANXDONE_ST                      (1 << 21)
+#define OMAP3430_VP2_EQVALUE_ST                                (1 << 20)
+#define OMAP3430_VP2_NOSMPSACK_ST                      (1 << 19)
+#define OMAP3430_VP2_MAXVDD_ST                         (1 << 18)
+#define OMAP3430_VP2_MINVDD_ST                         (1 << 17)
+#define OMAP3430_VP2_OPPCHANGEDONE_ST                  (1 << 16)
+#define OMAP3430_VP1_TRANXDONE_ST                      (1 << 15)
+#define OMAP3430_VP1_EQVALUE_ST                                (1 << 14)
+#define OMAP3430_VP1_NOSMPSACK_ST                      (1 << 13)
+#define OMAP3430_VP1_MAXVDD_ST                         (1 << 12)
+#define OMAP3430_VP1_MINVDD_ST                         (1 << 11)
+#define OMAP3430_VP1_OPPCHANGEDONE_ST                  (1 << 10)
+#define OMAP3430_IO_ST                                 (1 << 9)
+#define OMAP3430_PRM_IRQSTATUS_MPU_IVA2_DPLL_ST                (1 << 8)
+#define OMAP3430_PRM_IRQSTATUS_MPU_IVA2_DPLL_ST_SHIFT  8
+#define OMAP3430_MPU_DPLL_ST                           (1 << 7)
+#define OMAP3430_MPU_DPLL_ST_SHIFT                     7
+#define OMAP3430_PERIPH_DPLL_ST                                (1 << 6)
+#define OMAP3430_PERIPH_DPLL_ST_SHIFT                  6
+#define OMAP3430_CORE_DPLL_ST                          (1 << 5)
+#define OMAP3430_CORE_DPLL_ST_SHIFT                    5
+#define OMAP3430_TRANSITION_ST                         (1 << 4)
+#define OMAP3430_EVGENOFF_ST                           (1 << 3)
+#define OMAP3430_EVGENON_ST                            (1 << 2)
+#define OMAP3430_FS_USB_WKUP_ST                                (1 << 1)
+
+/* PRM_IRQENABLE_MPU specific bits */
+#define OMAP3430ES2_SND_PERIPH_DPLL_RECAL_EN_SHIFT             25
+#define OMAP3430ES2_SND_PERIPH_DPLL_RECAL_EN                   (1 << 25)
+#define OMAP3430_VC_TIMEOUTERR_EN                              (1 << 24)
+#define OMAP3430_VC_RAERR_EN                                   (1 << 23)
+#define OMAP3430_VC_SAERR_EN                                   (1 << 22)
+#define OMAP3430_VP2_TRANXDONE_EN                              (1 << 21)
+#define OMAP3430_VP2_EQVALUE_EN                                        (1 << 20)
+#define OMAP3430_VP2_NOSMPSACK_EN                              (1 << 19)
+#define OMAP3430_VP2_MAXVDD_EN                                 (1 << 18)
+#define OMAP3430_VP2_MINVDD_EN                                 (1 << 17)
+#define OMAP3430_VP2_OPPCHANGEDONE_EN                          (1 << 16)
+#define OMAP3430_VP1_TRANXDONE_EN                              (1 << 15)
+#define OMAP3430_VP1_EQVALUE_EN                                        (1 << 14)
+#define OMAP3430_VP1_NOSMPSACK_EN                              (1 << 13)
+#define OMAP3430_VP1_MAXVDD_EN                                 (1 << 12)
+#define OMAP3430_VP1_MINVDD_EN                                 (1 << 11)
+#define OMAP3430_VP1_OPPCHANGEDONE_EN                          (1 << 10)
+#define OMAP3430_IO_EN                                         (1 << 9)
+#define OMAP3430_PRM_IRQENABLE_MPU_IVA2_DPLL_RECAL_EN          (1 << 8)
+#define OMAP3430_PRM_IRQENABLE_MPU_IVA2_DPLL_RECAL_EN_SHIFT    8
+#define OMAP3430_MPU_DPLL_RECAL_EN                             (1 << 7)
+#define OMAP3430_MPU_DPLL_RECAL_EN_SHIFT                       7
+#define OMAP3430_PERIPH_DPLL_RECAL_EN                          (1 << 6)
+#define OMAP3430_PERIPH_DPLL_RECAL_EN_SHIFT                    6
+#define OMAP3430_CORE_DPLL_RECAL_EN                            (1 << 5)
+#define OMAP3430_CORE_DPLL_RECAL_EN_SHIFT                      5
+#define OMAP3430_TRANSITION_EN                                 (1 << 4)
+#define OMAP3430_EVGENOFF_EN                                   (1 << 3)
+#define OMAP3430_EVGENON_EN                                    (1 << 2)
+#define OMAP3430_FS_USB_WKUP_EN                                        (1 << 1)
+
+/* RM_RSTST_MPU specific bits */
+#define OMAP3430_EMULATION_MPU_RST                     (1 << 11)
+
+/* PM_WKDEP_MPU specific bits */
+#define OMAP3430_PM_WKDEP_MPU_EN_DSS                   (1 << 5)
+#define OMAP3430_PM_WKDEP_MPU_EN_IVA2                  (1 << 2)
+
+/* PM_EVGENCTRL_MPU */
+#define OMAP3430_OFFLOADMODE_SHIFT                     3
+#define OMAP3430_OFFLOADMODE_MASK                      (0x3 << 3)
+#define OMAP3430_ONLOADMODE_SHIFT                      1
+#define OMAP3430_ONLOADMODE_MASK                       (0x3 << 1)
+#define OMAP3430_ENABLE                                        (1 << 0)
+
+/* PM_EVGENONTIM_MPU */
+#define OMAP3430_ONTIMEVAL_SHIFT                       0
+#define OMAP3430_ONTIMEVAL_MASK                                (0xffffffff << 0)
+
+/* PM_EVGENOFFTIM_MPU */
+#define OMAP3430_OFFTIMEVAL_SHIFT                      0
+#define OMAP3430_OFFTIMEVAL_MASK                       (0xffffffff << 0)
+
+/* PM_PWSTCTRL_MPU specific bits */
+#define OMAP3430_L2CACHEONSTATE_SHIFT                  16
+#define OMAP3430_L2CACHEONSTATE_MASK                   (0x3 << 16)
+#define OMAP3430_L2CACHERETSTATE                       (1 << 8)
+#define OMAP3430_LOGICL1CACHERETSTATE                  (1 << 2)
+
+/* PM_PWSTST_MPU specific bits */
+#define OMAP3430_L2CACHESTATEST_SHIFT                  6
+#define OMAP3430_L2CACHESTATEST_MASK                   (0x3 << 6)
+#define OMAP3430_LOGICL1CACHESTATEST                   (1 << 2)
+
+/* PM_PREPWSTST_MPU specific bits */
+#define OMAP3430_LASTL2CACHESTATEENTERED_SHIFT         6
+#define OMAP3430_LASTL2CACHESTATEENTERED_MASK          (0x3 << 6)
+#define OMAP3430_LASTLOGICL1CACHESTATEENTERED          (1 << 2)
+
+/* RM_RSTCTRL_CORE */
+#define OMAP3430_RM_RSTCTRL_CORE_MODEM_SW_RSTPWRON             (1 << 1)
+#define OMAP3430_RM_RSTCTRL_CORE_MODEM_SW_RST                  (1 << 0)
+
+/* RM_RSTST_CORE specific bits */
+#define OMAP3430_MODEM_SECURITY_VIOL_RST               (1 << 10)
+#define OMAP3430_RM_RSTST_CORE_MODEM_SW_RSTPWRON       (1 << 9)
+#define OMAP3430_RM_RSTST_CORE_MODEM_SW_RST            (1 << 8)
+
+/* PM_WKEN1_CORE specific bits */
+
+/* PM_MPUGRPSEL1_CORE specific bits */
+#define OMAP3430_GRPSEL_FSHOSTUSB                      (1 << 5)
+
+/* PM_IVA2GRPSEL1_CORE specific bits */
+
+/* PM_WKST1_CORE specific bits */
+
+/* PM_PWSTCTRL_CORE specific bits */
+#define OMAP3430_MEM2ONSTATE_SHIFT                     18
+#define OMAP3430_MEM2ONSTATE_MASK                      (0x3 << 18)
+#define OMAP3430_MEM1ONSTATE_SHIFT                     16
+#define OMAP3430_MEM1ONSTATE_MASK                      (0x3 << 16)
+#define OMAP3430_MEM2RETSTATE                          (1 << 9)
+#define OMAP3430_MEM1RETSTATE                          (1 << 8)
+
+/* PM_PWSTST_CORE specific bits */
+#define OMAP3430_MEM2STATEST_SHIFT                     6
+#define OMAP3430_MEM2STATEST_MASK                      (0x3 << 6)
+#define OMAP3430_MEM1STATEST_SHIFT                     4
+#define OMAP3430_MEM1STATEST_MASK                      (0x3 << 4)
+
+/* PM_PREPWSTST_CORE specific bits */
+#define OMAP3430_LASTMEM2STATEENTERED_SHIFT            6
+#define OMAP3430_LASTMEM2STATEENTERED_MASK             (0x3 << 6)
+#define OMAP3430_LASTMEM1STATEENTERED_SHIFT            4
+#define OMAP3430_LASTMEM1STATEENTERED_MASK             (0x3 << 4)
+
+/* RM_RSTST_GFX specific bits */
+
+/* PM_WKDEP_GFX specific bits */
+#define OMAP3430_PM_WKDEP_GFX_EN_IVA2                  (1 << 2)
+
+/* PM_PWSTCTRL_GFX specific bits */
+
+/* PM_PWSTST_GFX specific bits */
+
+/* PM_PREPWSTST_GFX specific bits */
+
+/* PM_WKEN_WKUP specific bits */
+#define OMAP3430_EN_IO                                 (1 << 8)
+
+/* PM_MPUGRPSEL_WKUP specific bits */
+
+/* PM_IVA2GRPSEL_WKUP specific bits */
+
+/* PM_WKST_WKUP specific bits */
+#define OMAP3430_ST_IO                                 (1 << 8)
+
+/* PRM_CLKSEL */
+#define OMAP3430_SYS_CLKIN_SEL_SHIFT                   0
+#define OMAP3430_SYS_CLKIN_SEL_MASK                    (0x7 << 0)
+
+/* PRM_CLKOUT_CTRL */
+#define OMAP3430_CLKOUT_EN                             (1 << 7)
+#define OMAP3430_CLKOUT_EN_SHIFT                       7
+
+/* RM_RSTST_DSS specific bits */
+
+/* PM_WKEN_DSS */
+#define OMAP3430_PM_WKEN_DSS_EN_DSS                    (1 << 0)
+
+/* PM_WKDEP_DSS specific bits */
+#define OMAP3430_PM_WKDEP_DSS_EN_IVA2                  (1 << 2)
+
+/* PM_PWSTCTRL_DSS specific bits */
+
+/* PM_PWSTST_DSS specific bits */
+
+/* PM_PREPWSTST_DSS specific bits */
+
+/* RM_RSTST_CAM specific bits */
+
+/* PM_WKDEP_CAM specific bits */
+#define OMAP3430_PM_WKDEP_CAM_EN_IVA2                  (1 << 2)
+
+/* PM_PWSTCTRL_CAM specific bits */
+
+/* PM_PWSTST_CAM specific bits */
+
+/* PM_PREPWSTST_CAM specific bits */
+
+/* PM_PWSTCTRL_USBHOST specific bits */
+#define OMAP3430ES2_SAVEANDRESTORE_SHIFT               (1 << 4)
+
+/* RM_RSTST_PER specific bits */
+
+/* PM_WKEN_PER specific bits */
+
+/* PM_MPUGRPSEL_PER specific bits */
+
+/* PM_IVA2GRPSEL_PER specific bits */
+
+/* PM_WKST_PER specific bits */
+
+/* PM_WKDEP_PER specific bits */
+#define OMAP3430_PM_WKDEP_PER_EN_IVA2                  (1 << 2)
+
+/* PM_PWSTCTRL_PER specific bits */
+
+/* PM_PWSTST_PER specific bits */
+
+/* PM_PREPWSTST_PER specific bits */
+
+/* RM_RSTST_EMU specific bits */
+
+/* PM_PWSTST_EMU specific bits */
+
+/* PRM_VC_SMPS_SA */
+#define OMAP3430_PRM_VC_SMPS_SA_SA1_SHIFT              16
+#define OMAP3430_PRM_VC_SMPS_SA_SA1_MASK               (0x7f << 16)
+#define OMAP3430_PRM_VC_SMPS_SA_SA0_SHIFT              0
+#define OMAP3430_PRM_VC_SMPS_SA_SA0_MASK               (0x7f << 0)
+
+/* PRM_VC_SMPS_VOL_RA */
+#define OMAP3430_VOLRA1_SHIFT                          16
+#define OMAP3430_VOLRA1_MASK                           (0xff << 16)
+#define OMAP3430_VOLRA0_SHIFT                          0
+#define OMAP3430_VOLRA0_MASK                           (0xff << 0)
+
+/* PRM_VC_SMPS_CMD_RA */
+#define OMAP3430_CMDRA1_SHIFT                          16
+#define OMAP3430_CMDRA1_MASK                           (0xff << 16)
+#define OMAP3430_CMDRA0_SHIFT                          0
+#define OMAP3430_CMDRA0_MASK                           (0xff << 0)
+
+/* PRM_VC_CMD_VAL_0 specific bits */
+
+/* PRM_VC_CMD_VAL_1 specific bits */
+
+/* PRM_VC_CH_CONF */
+#define OMAP3430_CMD1                                  (1 << 20)
+#define OMAP3430_RACEN1                                        (1 << 19)
+#define OMAP3430_RAC1                                  (1 << 18)
+#define OMAP3430_RAV1                                  (1 << 17)
+#define OMAP3430_PRM_VC_CH_CONF_SA1                    (1 << 16)
+#define OMAP3430_CMD0                                  (1 << 4)
+#define OMAP3430_RACEN0                                        (1 << 3)
+#define OMAP3430_RAC0                                  (1 << 2)
+#define OMAP3430_RAV0                                  (1 << 1)
+#define OMAP3430_PRM_VC_CH_CONF_SA0                    (1 << 0)
+
+/* PRM_VC_I2C_CFG */
+#define OMAP3430_HSMASTER                              (1 << 5)
+#define OMAP3430_SREN                                  (1 << 4)
+#define OMAP3430_HSEN                                  (1 << 3)
+#define OMAP3430_MCODE_SHIFT                           0
+#define OMAP3430_MCODE_MASK                            (0x7 << 0)
+
+/* PRM_VC_BYPASS_VAL */
+#define OMAP3430_VALID                                 (1 << 24)
+#define OMAP3430_DATA_SHIFT                            16
+#define OMAP3430_DATA_MASK                             (0xff << 16)
+#define OMAP3430_REGADDR_SHIFT                         8
+#define OMAP3430_REGADDR_MASK                          (0xff << 8)
+#define OMAP3430_SLAVEADDR_SHIFT                       0
+#define OMAP3430_SLAVEADDR_MASK                                (0x7f << 0)
+
+/* PRM_RSTCTRL */
+#define OMAP3430_RST_DPLL3                             (1 << 2)
+#define OMAP3430_RST_GS                                        (1 << 1)
+
+/* PRM_RSTTIME */
+#define OMAP3430_RSTTIME2_SHIFT                                8
+#define OMAP3430_RSTTIME2_MASK                         (0x1f << 8)
+#define OMAP3430_RSTTIME1_SHIFT                                0
+#define OMAP3430_RSTTIME1_MASK                         (0xff << 0)
+
+/* PRM_RSTST */
+#define OMAP3430_ICECRUSHER_RST                                (1 << 10)
+#define OMAP3430_ICEPICK_RST                           (1 << 9)
+#define OMAP3430_VDD2_VOLTAGE_MANAGER_RST              (1 << 8)
+#define OMAP3430_VDD1_VOLTAGE_MANAGER_RST              (1 << 7)
+#define OMAP3430_EXTERNAL_WARM_RST                     (1 << 6)
+#define OMAP3430_SECURE_WD_RST                         (1 << 5)
+#define OMAP3430_MPU_WD_RST                            (1 << 4)
+#define OMAP3430_SECURITY_VIOL_RST                     (1 << 3)
+#define OMAP3430_GLOBAL_SW_RST                         (1 << 1)
+#define OMAP3430_GLOBAL_COLD_RST                       (1 << 0)
+
+/* PRM_VOLTCTRL */
+#define OMAP3430_SEL_VMODE                             (1 << 4)
+#define OMAP3430_SEL_OFF                               (1 << 3)
+#define OMAP3430_AUTO_OFF                              (1 << 2)
+#define OMAP3430_AUTO_RET                              (1 << 1)
+#define OMAP3430_AUTO_SLEEP                            (1 << 0)
+
+/* PRM_SRAM_PCHARGE */
+#define OMAP3430_PCHARGE_TIME_SHIFT                    0
+#define OMAP3430_PCHARGE_TIME_MASK                     (0xff << 0)
+
+/* PRM_CLKSRC_CTRL */
+#define OMAP3430_SYSCLKDIV_SHIFT                       6
+#define OMAP3430_SYSCLKDIV_MASK                                (0x3 << 6)
+#define OMAP3430_AUTOEXTCLKMODE_SHIFT                  3
+#define OMAP3430_AUTOEXTCLKMODE_MASK                   (0x3 << 3)
+#define OMAP3430_SYSCLKSEL_SHIFT                       0
+#define OMAP3430_SYSCLKSEL_MASK                                (0x3 << 0)
+
+/* PRM_VOLTSETUP1 */
+#define OMAP3430_SETUP_TIME2_SHIFT                     16
+#define OMAP3430_SETUP_TIME2_MASK                      (0xffff << 16)
+#define OMAP3430_SETUP_TIME1_SHIFT                     0
+#define OMAP3430_SETUP_TIME1_MASK                      (0xffff << 0)
+
+/* PRM_VOLTOFFSET */
+#define OMAP3430_OFFSET_TIME_SHIFT                     0
+#define OMAP3430_OFFSET_TIME_MASK                      (0xffff << 0)
+
+/* PRM_CLKSETUP */
+#define OMAP3430_SETUP_TIME_SHIFT                      0
+#define OMAP3430_SETUP_TIME_MASK                       (0xffff << 0)
+
+/* PRM_POLCTRL */
+#define OMAP3430_OFFMODE_POL                           (1 << 3)
+#define OMAP3430_CLKOUT_POL                            (1 << 2)
+#define OMAP3430_CLKREQ_POL                            (1 << 1)
+#define OMAP3430_EXTVOL_POL                            (1 << 0)
+
+/* PRM_VOLTSETUP2 */
+#define OMAP3430_OFFMODESETUPTIME_SHIFT                        0
+#define OMAP3430_OFFMODESETUPTIME_MASK                 (0xffff << 0)
+
+/* PRM_VP1_CONFIG specific bits */
+
+/* PRM_VP1_VSTEPMIN specific bits */
+
+/* PRM_VP1_VSTEPMAX specific bits */
+
+/* PRM_VP1_VLIMITTO specific bits */
+
+/* PRM_VP1_VOLTAGE specific bits */
+
+/* PRM_VP1_STATUS specific bits */
+
+/* PRM_VP2_CONFIG specific bits */
+
+/* PRM_VP2_VSTEPMIN specific bits */
+
+/* PRM_VP2_VSTEPMAX specific bits */
+
+/* PRM_VP2_VLIMITTO specific bits */
+
+/* PRM_VP2_VOLTAGE specific bits */
+
+/* PRM_VP2_STATUS specific bits */
+
+/* RM_RSTST_NEON specific bits */
+
+/* PM_WKDEP_NEON specific bits */
+
+/* PM_PWSTCTRL_NEON specific bits */
+
+/* PM_PWSTST_NEON specific bits */
+
+/* PM_PREPWSTST_NEON specific bits */
+
+#endif
diff --git a/arch/arm/mach-omap2/prm.h b/arch/arm/mach-omap2/prm.h
new file mode 100644 (file)
index 0000000..ab7649a
--- /dev/null
@@ -0,0 +1,316 @@
+#ifndef __ARCH_ARM_MACH_OMAP2_PRM_H
+#define __ARCH_ARM_MACH_OMAP2_PRM_H
+
+/*
+ * OMAP2/3 Power/Reset Management (PRM) register definitions
+ *
+ * Copyright (C) 2007 Texas Instruments, Inc.
+ * Copyright (C) 2007 Nokia Corporation
+ *
+ * Written by Paul Walmsley
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include "prcm-common.h"
+
+#ifndef __ASSEMBLER__
+#define OMAP_PRM_REGADDR(module, reg)                                  \
+       (void __iomem *)IO_ADDRESS(OMAP2_PRM_BASE + (module) + (reg))
+#else
+#define OMAP2420_PRM_REGADDR(module, reg)                              \
+                       IO_ADDRESS(OMAP2420_PRM_BASE + (module) + (reg))
+#define OMAP2430_PRM_REGADDR(module, reg)                              \
+                       IO_ADDRESS(OMAP2430_PRM_BASE + (module) + (reg))
+#define OMAP34XX_PRM_REGADDR(module, reg)                              \
+                       IO_ADDRESS(OMAP3430_PRM_BASE + (module) + (reg))
+#endif
+
+/*
+ * Architecture-specific global PRM registers
+ * Use prm_{read,write}_reg() with these registers.
+ *
+ * With a few exceptions, these are the register names beginning with
+ * PRCM_* on 24xx, and PRM_* on 34xx.  (The exceptions are the
+ * IRQSTATUS and IRQENABLE bits.)
+ *
+ */
+
+#define OMAP24XX_PRCM_REVISION         OMAP_PRM_REGADDR(OCP_MOD, 0x0000)
+#define OMAP24XX_PRCM_SYSCONFIG                OMAP_PRM_REGADDR(OCP_MOD, 0x0010)
+
+#define OMAP24XX_PRCM_IRQSTATUS_MPU    OMAP_PRM_REGADDR(OCP_MOD, 0x0018)
+#define OMAP24XX_PRCM_IRQENABLE_MPU    OMAP_PRM_REGADDR(OCP_MOD, 0x001c)
+
+#define OMAP24XX_PRCM_VOLTCTRL         OMAP_PRM_REGADDR(OCP_MOD, 0x0050)
+#define OMAP24XX_PRCM_VOLTST           OMAP_PRM_REGADDR(OCP_MOD, 0x0054)
+#define OMAP24XX_PRCM_CLKSRC_CTRL      OMAP_PRM_REGADDR(OCP_MOD, 0x0060)
+#define OMAP24XX_PRCM_CLKOUT_CTRL      OMAP_PRM_REGADDR(OCP_MOD, 0x0070)
+#define OMAP24XX_PRCM_CLKEMUL_CTRL     OMAP_PRM_REGADDR(OCP_MOD, 0x0078)
+#define OMAP24XX_PRCM_CLKCFG_CTRL      OMAP_PRM_REGADDR(OCP_MOD, 0x0080)
+#define OMAP24XX_PRCM_CLKCFG_STATUS    OMAP_PRM_REGADDR(OCP_MOD, 0x0084)
+#define OMAP24XX_PRCM_VOLTSETUP                OMAP_PRM_REGADDR(OCP_MOD, 0x0090)
+#define OMAP24XX_PRCM_CLKSSETUP                OMAP_PRM_REGADDR(OCP_MOD, 0x0094)
+#define OMAP24XX_PRCM_POLCTRL          OMAP_PRM_REGADDR(OCP_MOD, 0x0098)
+
+#define OMAP3430_PRM_REVISION          OMAP_PRM_REGADDR(OCP_MOD, 0x0004)
+#define OMAP3430_PRM_SYSCONFIG         OMAP_PRM_REGADDR(OCP_MOD, 0x0014)
+
+#define OMAP3430_PRM_IRQSTATUS_MPU     OMAP_PRM_REGADDR(OCP_MOD, 0x0018)
+#define OMAP3430_PRM_IRQENABLE_MPU     OMAP_PRM_REGADDR(OCP_MOD, 0x001c)
+
+
+#define OMAP3430_PRM_VC_SMPS_SA                OMAP_PRM_REGADDR(OMAP3430_GR_MOD, 0x0020)
+#define OMAP3430_PRM_VC_SMPS_VOL_RA    OMAP_PRM_REGADDR(OMAP3430_GR_MOD, 0x0024)
+#define OMAP3430_PRM_VC_SMPS_CMD_RA    OMAP_PRM_REGADDR(OMAP3430_GR_MOD, 0x0028)
+#define OMAP3430_PRM_VC_CMD_VAL_0      OMAP_PRM_REGADDR(OMAP3430_GR_MOD, 0x002c)
+#define OMAP3430_PRM_VC_CMD_VAL_1      OMAP_PRM_REGADDR(OMAP3430_GR_MOD, 0x0030)
+#define OMAP3430_PRM_VC_CH_CONF                OMAP_PRM_REGADDR(OMAP3430_GR_MOD, 0x0034)
+#define OMAP3430_PRM_VC_I2C_CFG                OMAP_PRM_REGADDR(OMAP3430_GR_MOD, 0x0038)
+#define OMAP3430_PRM_VC_BYPASS_VAL     OMAP_PRM_REGADDR(OMAP3430_GR_MOD, 0x003c)
+#define OMAP3430_PRM_RSTCTRL           OMAP_PRM_REGADDR(OMAP3430_GR_MOD, 0x0050)
+#define OMAP3430_PRM_RSTTIME           OMAP_PRM_REGADDR(OMAP3430_GR_MOD, 0x0054)
+#define OMAP3430_PRM_RSTST             OMAP_PRM_REGADDR(OMAP3430_GR_MOD, 0x0058)
+#define OMAP3430_PRM_VOLTCTRL          OMAP_PRM_REGADDR(OMAP3430_GR_MOD, 0x0060)
+#define OMAP3430_PRM_SRAM_PCHARGE      OMAP_PRM_REGADDR(OMAP3430_GR_MOD, 0x0064)
+#define OMAP3430_PRM_CLKSRC_CTRL       OMAP_PRM_REGADDR(OMAP3430_GR_MOD, 0x0070)
+#define OMAP3430_PRM_VOLTSETUP1                OMAP_PRM_REGADDR(OMAP3430_GR_MOD, 0x0090)
+#define OMAP3430_PRM_VOLTOFFSET                OMAP_PRM_REGADDR(OMAP3430_GR_MOD, 0x0094)
+#define OMAP3430_PRM_CLKSETUP          OMAP_PRM_REGADDR(OMAP3430_GR_MOD, 0x0098)
+#define OMAP3430_PRM_POLCTRL           OMAP_PRM_REGADDR(OMAP3430_GR_MOD, 0x009c)
+#define OMAP3430_PRM_VOLTSETUP2                OMAP_PRM_REGADDR(OMAP3430_GR_MOD, 0x00a0)
+#define OMAP3430_PRM_VP1_CONFIG                OMAP_PRM_REGADDR(OMAP3430_GR_MOD, 0x00b0)
+#define OMAP3430_PRM_VP1_VSTEPMIN      OMAP_PRM_REGADDR(OMAP3430_GR_MOD, 0x00b4)
+#define OMAP3430_PRM_VP1_VSTEPMAX      OMAP_PRM_REGADDR(OMAP3430_GR_MOD, 0x00b8)
+#define OMAP3430_PRM_VP1_VLIMITTO      OMAP_PRM_REGADDR(OMAP3430_GR_MOD, 0x00bc)
+#define OMAP3430_PRM_VP1_VOLTAGE       OMAP_PRM_REGADDR(OMAP3430_GR_MOD, 0x00c0)
+#define OMAP3430_PRM_VP1_STATUS                OMAP_PRM_REGADDR(OMAP3430_GR_MOD, 0x00c4)
+#define OMAP3430_PRM_VP2_CONFIG                OMAP_PRM_REGADDR(OMAP3430_GR_MOD, 0x00d0)
+#define OMAP3430_PRM_VP2_VSTEPMIN      OMAP_PRM_REGADDR(OMAP3430_GR_MOD, 0x00d4)
+#define OMAP3430_PRM_VP2_VSTEPMAX      OMAP_PRM_REGADDR(OMAP3430_GR_MOD, 0x00d8)
+#define OMAP3430_PRM_VP2_VLIMITTO      OMAP_PRM_REGADDR(OMAP3430_GR_MOD, 0x00dc)
+#define OMAP3430_PRM_VP2_VOLTAGE       OMAP_PRM_REGADDR(OMAP3430_GR_MOD, 0x00e0)
+#define OMAP3430_PRM_VP2_STATUS                OMAP_PRM_REGADDR(OMAP3430_GR_MOD, 0x00e4)
+
+#define OMAP3430_PRM_CLKSEL            OMAP_PRM_REGADDR(OMAP3430_CCR_MOD, 0x0040)
+#define OMAP3430_PRM_CLKOUT_CTRL       OMAP_PRM_REGADDR(OMAP3430_CCR_MOD, 0x0070)
+
+/*
+ * Module specific PRM registers from PRM_BASE + domain offset
+ *
+ * Use prm_{read,write}_mod_reg() with these registers.
+ *
+ * With a few exceptions, these are the register names beginning with
+ * {PM,RM}_* on both architectures.  (The exceptions are the IRQSTATUS
+ * and IRQENABLE bits.)
+ *
+ */
+
+/* Registers appearing on both 24xx and 34xx */
+
+#define RM_RSTCTRL                                     0x0050
+#define RM_RSTTIME                                     0x0054
+#define RM_RSTST                                       0x0058
+
+#define PM_WKEN                                                0x00a0
+#define PM_WKEN1                                       PM_WKEN
+#define PM_WKST                                                0x00b0
+#define PM_WKST1                                       PM_WKST
+#define PM_WKDEP                                       0x00c8
+#define PM_EVGENCTRL                                   0x00d4
+#define PM_EVGENONTIM                                  0x00d8
+#define PM_EVGENOFFTIM                                 0x00dc
+#define PM_PWSTCTRL                                    0x00e0
+#define PM_PWSTST                                      0x00e4
+
+#define OMAP3430_PM_MPUGRPSEL                          0x00a4
+#define OMAP3430_PM_MPUGRPSEL1                         OMAP3430_PM_MPUGRPSEL
+
+#define OMAP3430_PM_IVAGRPSEL                          0x00a8
+#define OMAP3430_PM_IVAGRPSEL1                         OMAP3430_PM_IVAGRPSEL
+
+#define OMAP3430_PM_PREPWSTST                          0x00e8
+
+#define OMAP3430_PRM_IRQSTATUS_IVA2                    0x00f8
+#define OMAP3430_PRM_IRQENABLE_IVA2                    0x00fc
+
+
+/* Architecture-specific registers */
+
+#define OMAP24XX_PM_WKEN2                              0x00a4
+#define OMAP24XX_PM_WKST2                              0x00b4
+
+#define OMAP24XX_PRCM_IRQSTATUS_DSP                    0x00f0  /* IVA mod */
+#define OMAP24XX_PRCM_IRQENABLE_DSP                    0x00f4  /* IVA mod */
+#define OMAP24XX_PRCM_IRQSTATUS_IVA                    0x00f8
+#define OMAP24XX_PRCM_IRQENABLE_IVA                    0x00fc
+
+#ifndef __ASSEMBLER__
+
+/* Power/reset management domain register get/set */
+
+static inline void prm_write_mod_reg(u32 val, s16 module, s16 idx)
+{
+       __raw_writel(val, OMAP_PRM_REGADDR(module, idx));
+}
+
+static inline u32 prm_read_mod_reg(s16 module, s16 idx)
+{
+       return __raw_readl(OMAP_PRM_REGADDR(module, idx));
+}
+
+#endif
+
+/*
+ * Bits common to specific registers
+ *
+ * The 3430 register and bit names are generally used,
+ * since they tend to make more sense
+ */
+
+/* PM_EVGENONTIM_MPU */
+/* Named PM_EVEGENONTIM_MPU on the 24XX */
+#define OMAP_ONTIMEVAL_SHIFT                           0
+#define OMAP_ONTIMEVAL_MASK                            (0xffffffff << 0)
+
+/* PM_EVGENOFFTIM_MPU */
+/* Named PM_EVEGENOFFTIM_MPU on the 24XX */
+#define OMAP_OFFTIMEVAL_SHIFT                          0
+#define OMAP_OFFTIMEVAL_MASK                           (0xffffffff << 0)
+
+/* PRM_CLKSETUP and PRCM_VOLTSETUP */
+/* Named PRCM_CLKSSETUP on the 24XX */
+#define OMAP_SETUP_TIME_SHIFT                          0
+#define OMAP_SETUP_TIME_MASK                           (0xffff << 0)
+
+/* PRM_CLKSRC_CTRL */
+/* Named PRCM_CLKSRC_CTRL on the 24XX */
+#define OMAP_SYSCLKDIV_SHIFT                           6
+#define OMAP_SYSCLKDIV_MASK                            (0x3 << 6)
+#define OMAP_AUTOEXTCLKMODE_SHIFT                      3
+#define OMAP_AUTOEXTCLKMODE_MASK                       (0x3 << 3)
+#define OMAP_SYSCLKSEL_SHIFT                           0
+#define OMAP_SYSCLKSEL_MASK                            (0x3 << 0)
+
+/* PM_EVGENCTRL_MPU */
+#define OMAP_OFFLOADMODE_SHIFT                         3
+#define OMAP_OFFLOADMODE_MASK                          (0x3 << 3)
+#define OMAP_ONLOADMODE_SHIFT                          1
+#define OMAP_ONLOADMODE_MASK                           (0x3 << 1)
+#define OMAP_ENABLE                                    (1 << 0)
+
+/* PRM_RSTTIME */
+/* Named RM_RSTTIME_WKUP on the 24xx */
+#define OMAP_RSTTIME2_SHIFT                            8
+#define OMAP_RSTTIME2_MASK                             (0x1f << 8)
+#define OMAP_RSTTIME1_SHIFT                            0
+#define OMAP_RSTTIME1_MASK                             (0xff << 0)
+
+
+/* PRM_RSTCTRL */
+/* Named RM_RSTCTRL_WKUP on the 24xx */
+/* 2420 calls RST_DPLL3 'RST_DPLL' */
+#define OMAP_RST_DPLL3                                 (1 << 2)
+#define OMAP_RST_GS                                    (1 << 1)
+
+
+/*
+ * Bits common to module-shared registers
+ *
+ * Not all registers of a particular type support all of these bits -
+ * check TRM if you are unsure
+ */
+
+/*
+ * 24XX: PM_PWSTST_CORE, PM_PWSTST_GFX, PM_PWSTST_MPU, PM_PWSTST_DSP
+ *
+ * 2430: PM_PWSTST_MDM
+ *
+ * 3430: PM_PWSTST_IVA2, PM_PWSTST_MPU, PM_PWSTST_CORE, PM_PWSTST_GFX,
+ *      PM_PWSTST_DSS, PM_PWSTST_CAM, PM_PWSTST_PER, PM_PWSTST_EMU,
+ *      PM_PWSTST_NEON
+ */
+#define OMAP_INTRANSITION                              (1 << 20)
+
+
+/*
+ * 24XX: PM_PWSTST_GFX, PM_PWSTST_DSP
+ *
+ * 2430: PM_PWSTST_MDM
+ *
+ * 3430: PM_PWSTST_IVA2, PM_PWSTST_MPU, PM_PWSTST_CORE, PM_PWSTST_GFX,
+ *      PM_PWSTST_DSS, PM_PWSTST_CAM, PM_PWSTST_PER, PM_PWSTST_EMU,
+ *      PM_PWSTST_NEON
+ */
+#define OMAP_POWERSTATEST_SHIFT                                0
+#define OMAP_POWERSTATEST_MASK                         (0x3 << 0)
+
+/*
+ * 24XX: RM_RSTST_MPU and RM_RSTST_DSP - on 24XX, 'COREDOMAINWKUP_RST' is
+ *      called 'COREWKUP_RST'
+ *
+ * 3430: RM_RSTST_IVA2, RM_RSTST_MPU, RM_RSTST_GFX, RM_RSTST_DSS,
+ *      RM_RSTST_CAM, RM_RSTST_PER, RM_RSTST_NEON
+ */
+#define OMAP_COREDOMAINWKUP_RST                                (1 << 3)
+
+/*
+ * 24XX: RM_RSTST_MPU, RM_RSTST_GFX, RM_RSTST_DSP
+ *
+ * 2430: RM_RSTST_MDM
+ *
+ * 3430: RM_RSTST_CORE, RM_RSTST_EMU
+ */
+#define OMAP_DOMAINWKUP_RST                            (1 << 2)
+
+/*
+ * 24XX: RM_RSTST_MPU, RM_RSTST_WKUP, RM_RSTST_DSP
+ *      On 24XX, 'GLOBALWARM_RST' is called 'GLOBALWMPU_RST'.
+ *
+ * 2430: RM_RSTST_MDM
+ *
+ * 3430: RM_RSTST_CORE, RM_RSTST_EMU
+ */
+#define OMAP_GLOBALWARM_RST                            (1 << 1)
+#define OMAP_GLOBALCOLD_RST                            (1 << 0)
+
+/*
+ * 24XX: PM_WKDEP_GFX, PM_WKDEP_MPU, PM_WKDEP_CORE, PM_WKDEP_DSP
+ *      2420 TRM sometimes uses "EN_WAKEUP" instead of "EN_WKUP"
+ *
+ * 2430: PM_WKDEP_MDM
+ *
+ * 3430: PM_WKDEP_IVA2, PM_WKDEP_GFX, PM_WKDEP_DSS, PM_WKDEP_CAM,
+ *      PM_WKDEP_PER
+ */
+#define OMAP_EN_WKUP                                   (1 << 4)
+
+/*
+ * 24XX: PM_PWSTCTRL_MPU, PM_PWSTCTRL_CORE, PM_PWSTCTRL_GFX,
+ *      PM_PWSTCTRL_DSP
+ *
+ * 2430: PM_PWSTCTRL_MDM
+ *
+ * 3430: PM_PWSTCTRL_IVA2, PM_PWSTCTRL_CORE, PM_PWSTCTRL_GFX,
+ *      PM_PWSTCTRL_DSS, PM_PWSTCTRL_CAM, PM_PWSTCTRL_PER,
+ *      PM_PWSTCTRL_NEON
+ */
+#define OMAP_LOGICRETSTATE                             (1 << 2)
+
+/*
+ * 24XX: PM_PWSTCTRL_MPU, PM_PWSTCTRL_CORE, PM_PWSTCTRL_GFX,
+ *       PM_PWSTCTRL_DSP, PM_PWSTST_MPU
+ *
+ * 2430: PM_PWSTCTRL_MDM shared bits
+ *
+ * 3430: PM_PWSTCTRL_IVA2, PM_PWSTCTRL_MPU, PM_PWSTCTRL_CORE,
+ *      PM_PWSTCTRL_GFX, PM_PWSTCTRL_DSS, PM_PWSTCTRL_CAM, PM_PWSTCTRL_PER,
+ *      PM_PWSTCTRL_NEON shared bits
+ */
+#define OMAP_POWERSTATE_SHIFT                          0
+#define OMAP_POWERSTATE_MASK                           (0x3 << 0)
+
+
+#endif
diff --git a/arch/arm/mach-omap2/sdrc.h b/arch/arm/mach-omap2/sdrc.h
new file mode 100644 (file)
index 0000000..d7f23bc
--- /dev/null
@@ -0,0 +1,58 @@
+#ifndef __ARCH_ARM_MACH_OMAP2_SDRC_H
+#define __ARCH_ARM_MACH_OMAP2_SDRC_H
+
+/*
+ * OMAP2 SDRC register definitions
+ *
+ * Copyright (C) 2007 Texas Instruments, Inc.
+ * Copyright (C) 2007 Nokia Corporation
+ *
+ * Written by Paul Walmsley
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+#undef DEBUG
+
+#include <asm/arch/sdrc.h>
+
+#ifndef __ASSEMBLER__
+extern unsigned long omap2_sdrc_base;
+extern unsigned long omap2_sms_base;
+
+#define OMAP_SDRC_REGADDR(reg)                                         \
+               (void __iomem *)IO_ADDRESS(omap2_sdrc_base + (reg))
+#define OMAP_SMS_REGADDR(reg)                                          \
+               (void __iomem *)IO_ADDRESS(omap2_sms_base + (reg))
+
+/* SDRC global register get/set */
+
+static inline void sdrc_write_reg(u32 val, u16 reg)
+{
+       __raw_writel(val, OMAP_SDRC_REGADDR(reg));
+}
+
+static inline u32 sdrc_read_reg(u16 reg)
+{
+       return __raw_readl(OMAP_SDRC_REGADDR(reg));
+}
+
+/* SMS global register get/set */
+
+static inline void sms_write_reg(u32 val, u16 reg)
+{
+       __raw_writel(val, OMAP_SMS_REGADDR(reg));
+}
+
+static inline u32 sms_read_reg(u16 reg)
+{
+       return __raw_readl(OMAP_SMS_REGADDR(reg));
+}
+#else
+#define OMAP242X_SDRC_REGADDR(reg)     IO_ADDRESS(OMAP2420_SDRC_BASE + (reg))
+#define OMAP243X_SDRC_REGADDR(reg)     IO_ADDRESS(OMAP243X_SDRC_BASE + (reg))
+#define OMAP34XX_SDRC_REGADDR(reg)     IO_ADDRESS(OMAP343X_SDRC_BASE + (reg))
+#endif /* __ASSEMBLER__ */
+
+#endif
index 16247d557853fbb146a4319c1b60442f2a59b744..46ccb9b8b583e166789a50baf25005ed219c57a5 100644 (file)
 #include <asm/arch/io.h>
 #include <asm/arch/pm.h>
 
-#define A_32KSYNC_CR_V         IO_ADDRESS(OMAP_TIMER32K_BASE+0x10)
-#define A_PRCM_VOLTCTRL_V      IO_ADDRESS(OMAP24XX_PRCM_BASE+0x50)
-#define A_PRCM_CLKCFG_CTRL_V   IO_ADDRESS(OMAP24XX_PRCM_BASE+0x80)
-#define A_CM_CLKEN_PLL_V       IO_ADDRESS(OMAP24XX_PRCM_BASE+0x500)
-#define A_CM_IDLEST_CKGEN_V    IO_ADDRESS(OMAP24XX_PRCM_BASE+0x520)
-#define A_CM_CLKSEL1_PLL_V     IO_ADDRESS(OMAP24XX_PRCM_BASE+0x540)
-#define A_CM_CLKSEL2_PLL_V     IO_ADDRESS(OMAP24XX_PRCM_BASE+0x544)
+#include "sdrc.h"
 
-#define A_SDRC_DLLA_CTRL_V     IO_ADDRESS(OMAP24XX_SDRC_BASE+0x60)
-#define        A_SDRC_POWER_V          IO_ADDRESS(OMAP24XX_SDRC_BASE+0x70)
-#define A_SDRC_RFR_CTRL_V      IO_ADDRESS(OMAP24XX_SDRC_BASE+0xA4)
+/* First address of reserved address space?  apparently valid for OMAP2 & 3 */
 #define A_SDRC0_V              (0xC0000000)
-#define A_SDRC_MANUAL_V                IO_ADDRESS(OMAP24XX_SDRC_BASE+0xA8)
 
        .text
 
@@ -126,17 +117,11 @@ loop2:
        ldmfd   sp!, {r0 - r12, pc}     @ restore regs and return
 
 A_SDRC_POWER:
-       .word A_SDRC_POWER_V
+       .word OMAP242X_SDRC_REGADDR(SDRC_POWER)
 A_SDRC0:
        .word A_SDRC0_V
-A_CM_CLKSEL2_PLL_S:
-       .word A_CM_CLKSEL2_PLL_V
-A_CM_CLKEN_PLL:
-       .word A_CM_CLKEN_PLL_V
 A_SDRC_DLLA_CTRL_S:
-       .word A_SDRC_DLLA_CTRL_V
-A_SDRC_MANUAL_S:
-       .word A_SDRC_MANUAL_V
+       .word OMAP242X_SDRC_REGADDR(SDRC_DLLA_CTRL)
 
 ENTRY(omap24xx_cpu_suspend_sz)
        .word   . - omap24xx_cpu_suspend
index b27576690f8df1c3a18e1831af4228b9465dd631..4a9e49140716a59d4622d6795a77fe272c7cc9c2 100644 (file)
 #include <asm/arch/io.h>
 #include <asm/hardware.h>
 
-#include "prcm-regs.h"
+#include "sdrc.h"
+#include "prm.h"
+#include "cm.h"
 
-#define TIMER_32KSYNCT_CR_V    IO_ADDRESS(OMAP24XX_32KSYNCT_BASE + 0x010)
-
-#define CM_CLKSEL2_PLL_V       IO_ADDRESS(OMAP24XX_PRCM_BASE + 0x544)
-#define PRCM_VOLTCTRL_V                IO_ADDRESS(OMAP24XX_PRCM_BASE + 0x050)
-#define PRCM_CLKCFG_CTRL_V     IO_ADDRESS(OMAP24XX_PRCM_BASE + 0x080)
-#define CM_CLKEN_PLL_V         IO_ADDRESS(OMAP24XX_PRCM_BASE + 0x500)
-#define CM_IDLEST_CKGEN_V      IO_ADDRESS(OMAP24XX_PRCM_BASE + 0x520)
-#define CM_CLKSEL1_PLL_V       IO_ADDRESS(OMAP24XX_PRCM_BASE + 0x540)
-
-#define SDRC_DLLA_CTRL_V       IO_ADDRESS(OMAP24XX_SDRC_BASE + 0x060)
-#define SDRC_RFR_CTRL_V                IO_ADDRESS(OMAP24XX_SDRC_BASE + 0x0a4)
+#define TIMER_32KSYNCT_CR_V    IO_ADDRESS(OMAP2420_32KSYNCT_BASE + 0x010)
 
        .text
 
@@ -131,11 +123,11 @@ volt_delay:
 
 /* relative load constants */
 cm_clksel2_pll:
-       .word CM_CLKSEL2_PLL_V
+       .word OMAP2420_CM_REGADDR(PLL_MOD, CM_CLKSEL2)
 sdrc_dlla_ctrl:
-       .word SDRC_DLLA_CTRL_V
+       .word OMAP242X_SDRC_REGADDR(SDRC_DLLA_CTRL)
 prcm_voltctrl:
-       .word PRCM_VOLTCTRL_V
+       .word OMAP2420_PRM_REGADDR(OCP_MOD, 0x50)
 prcm_mask_val:
        .word 0xFFFF3FFC
 timer_32ksynct_cr:
@@ -225,13 +217,13 @@ volt_delay_c:
        mov     pc, lr                  @ back to caller
 
 ddr_cm_clksel2_pll:
-       .word CM_CLKSEL2_PLL_V
+       .word OMAP2420_CM_REGADDR(PLL_MOD, CM_CLKSEL2)
 ddr_sdrc_dlla_ctrl:
-       .word SDRC_DLLA_CTRL_V
+       .word OMAP242X_SDRC_REGADDR(SDRC_DLLA_CTRL)
 ddr_sdrc_rfr_ctrl:
-       .word SDRC_RFR_CTRL_V
+       .word OMAP242X_SDRC_REGADDR(SDRC_RFR_CTRL_0)
 ddr_prcm_voltctrl:
-       .word PRCM_VOLTCTRL_V
+       .word OMAP2420_PRM_REGADDR(OCP_MOD, 0x50)
 ddr_prcm_mask_val:
        .word 0xFFFF3FFC
 ddr_timer_32ksynct:
@@ -316,17 +308,17 @@ wait_dll_lock:
        ldmfd   sp!, {r0-r12, pc}       @ restore regs and return
 
 set_config:
-       .word PRCM_CLKCFG_CTRL_V
+       .word OMAP2420_PRM_REGADDR(OCP_MOD, 0x80)
 pll_ctl:
-       .word CM_CLKEN_PLL_V
+       .word OMAP2420_CM_REGADDR(PLL_MOD, CM_FCLKEN1)
 pll_stat:
-       .word CM_IDLEST_CKGEN_V
+       .word OMAP2420_CM_REGADDR(PLL_MOD, CM_IDLEST1)
 pll_div:
-       .word CM_CLKSEL1_PLL_V
+       .word OMAP2420_CM_REGADDR(PLL_MOD, CM_CLKSEL)
 sdrc_rfr:
-       .word SDRC_RFR_CTRL_V
+       .word OMAP242X_SDRC_REGADDR(SDRC_RFR_CTRL_0)
 dlla_ctrl:
-       .word SDRC_DLLA_CTRL_V
+       .word OMAP242X_SDRC_REGADDR(SDRC_DLLA_CTRL)
 
 ENTRY(sram_set_prcm_sz)
        .word   . - sram_set_prcm
index 3234deedb9465ae628f0832e2a4afba16376ecce..78d05f203fffd43dd320869805a61d7011286609 100644 (file)
@@ -3,6 +3,11 @@
  *
  * OMAP2 GP timer support.
  *
+ * Update to use new clocksource/clockevent layers
+ * Author: Kevin Hilman, MontaVista Software, Inc. <source@mvista.com>
+ * Copyright (C) 2007 MontaVista Software, Inc.
+ *
+ * Original driver:
  * Copyright (C) 2005 Nokia Corporation
  * Author: Paul Mundt <paul.mundt@nokia.com>
  *         Juha Yrjölä <juha.yrjola@nokia.com>
 #include <linux/clk.h>
 #include <linux/delay.h>
 #include <linux/irq.h>
+#include <linux/clocksource.h>
+#include <linux/clockchips.h>
 
 #include <asm/mach/time.h>
 #include <asm/arch/dmtimer.h>
 
 static struct omap_dm_timer *gptimer;
-
-static inline void omap2_gp_timer_start(unsigned long load_val)
-{
-       omap_dm_timer_set_load(gptimer, 1, 0xffffffff - load_val);
-       omap_dm_timer_set_int_enable(gptimer, OMAP_TIMER_INT_OVERFLOW);
-       omap_dm_timer_start(gptimer);
-}
+static struct clock_event_device clockevent_gpt;
 
 static irqreturn_t omap2_gp_timer_interrupt(int irq, void *dev_id)
 {
-       omap_dm_timer_write_status(gptimer, OMAP_TIMER_INT_OVERFLOW);
-       timer_tick();
+       struct omap_dm_timer *gpt = (struct omap_dm_timer *)dev_id;
+       struct clock_event_device *evt = &clockevent_gpt;
+
+       omap_dm_timer_write_status(gpt, OMAP_TIMER_INT_OVERFLOW);
 
+       evt->event_handler(evt);
        return IRQ_HANDLED;
 }
 
@@ -52,20 +56,138 @@ static struct irqaction omap2_gp_timer_irq = {
        .handler        = omap2_gp_timer_interrupt,
 };
 
-static void __init omap2_gp_timer_init(void)
+static int omap2_gp_timer_set_next_event(unsigned long cycles,
+                                        struct clock_event_device *evt)
 {
-       u32 tick_period;
+       omap_dm_timer_set_load(gptimer, 0, 0xffffffff - cycles);
+       omap_dm_timer_start(gptimer);
+
+       return 0;
+}
+
+static void omap2_gp_timer_set_mode(enum clock_event_mode mode,
+                                   struct clock_event_device *evt)
+{
+       u32 period;
+
+       omap_dm_timer_stop(gptimer);
+
+       switch (mode) {
+       case CLOCK_EVT_MODE_PERIODIC:
+               period = clk_get_rate(omap_dm_timer_get_fclk(gptimer)) / HZ;
+               period -= 1;
+
+               omap_dm_timer_set_load(gptimer, 1, 0xffffffff - period);
+               omap_dm_timer_start(gptimer);
+               break;
+       case CLOCK_EVT_MODE_ONESHOT:
+               break;
+       case CLOCK_EVT_MODE_UNUSED:
+       case CLOCK_EVT_MODE_SHUTDOWN:
+       case CLOCK_EVT_MODE_RESUME:
+               break;
+       }
+}
+
+static struct clock_event_device clockevent_gpt = {
+       .name           = "gp timer",
+       .features       = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT,
+       .shift          = 32,
+       .set_next_event = omap2_gp_timer_set_next_event,
+       .set_mode       = omap2_gp_timer_set_mode,
+};
+
+static void __init omap2_gp_clockevent_init(void)
+{
+       u32 tick_rate;
 
-       omap_dm_timer_init();
        gptimer = omap_dm_timer_request_specific(1);
        BUG_ON(gptimer == NULL);
 
+#if defined(CONFIG_OMAP_32K_TIMER)
+       omap_dm_timer_set_source(gptimer, OMAP_TIMER_SRC_32_KHZ);
+#else
        omap_dm_timer_set_source(gptimer, OMAP_TIMER_SRC_SYS_CLK);
-       tick_period = clk_get_rate(omap_dm_timer_get_fclk(gptimer)) / HZ;
-       tick_period -= 1;
+#endif
+       tick_rate = clk_get_rate(omap_dm_timer_get_fclk(gptimer));
 
+       omap2_gp_timer_irq.dev_id = (void *)gptimer;
        setup_irq(omap_dm_timer_get_irq(gptimer), &omap2_gp_timer_irq);
-       omap2_gp_timer_start(tick_period);
+       omap_dm_timer_set_int_enable(gptimer, OMAP_TIMER_INT_OVERFLOW);
+
+       clockevent_gpt.mult = div_sc(tick_rate, NSEC_PER_SEC,
+                                    clockevent_gpt.shift);
+       clockevent_gpt.max_delta_ns =
+               clockevent_delta2ns(0xffffffff, &clockevent_gpt);
+       clockevent_gpt.min_delta_ns =
+               clockevent_delta2ns(1, &clockevent_gpt);
+
+       clockevent_gpt.cpumask = cpumask_of_cpu(0);
+       clockevents_register_device(&clockevent_gpt);
+}
+
+#ifdef CONFIG_OMAP_32K_TIMER
+/* 
+ * When 32k-timer is enabled, don't use GPTimer for clocksource
+ * instead, just leave default clocksource which uses the 32k
+ * sync counter.  See clocksource setup in see plat-omap/common.c. 
+ */
+
+static inline void __init omap2_gp_clocksource_init(void) {}
+#else
+/*
+ * clocksource
+ */
+static struct omap_dm_timer *gpt_clocksource;
+static cycle_t clocksource_read_cycles(void)
+{
+       return (cycle_t)omap_dm_timer_read_counter(gpt_clocksource);
+}
+
+static struct clocksource clocksource_gpt = {
+       .name           = "gp timer",
+       .rating         = 300,
+       .read           = clocksource_read_cycles,
+       .mask           = CLOCKSOURCE_MASK(32),
+       .shift          = 24,
+       .flags          = CLOCK_SOURCE_IS_CONTINUOUS,
+};
+
+/* Setup free-running counter for clocksource */
+static void __init omap2_gp_clocksource_init(void)
+{
+       static struct omap_dm_timer *gpt;
+       u32 tick_rate, tick_period;
+       static char err1[] __initdata = KERN_ERR
+               "%s: failed to request dm-timer\n";
+       static char err2[] __initdata = KERN_ERR
+               "%s: can't register clocksource!\n";
+
+       gpt = omap_dm_timer_request();
+       if (!gpt)
+               printk(err1, clocksource_gpt.name);
+       gpt_clocksource = gpt;
+
+       omap_dm_timer_set_source(gpt, OMAP_TIMER_SRC_SYS_CLK);
+       tick_rate = clk_get_rate(omap_dm_timer_get_fclk(gpt));
+       tick_period = (tick_rate / HZ) - 1;
+
+       omap_dm_timer_set_load(gpt, 1, 0);
+       omap_dm_timer_start(gpt);
+
+       clocksource_gpt.mult =
+               clocksource_khz2mult(tick_rate/1000, clocksource_gpt.shift);
+       if (clocksource_register(&clocksource_gpt))
+               printk(err2, clocksource_gpt.name);
+}
+#endif
+
+static void __init omap2_gp_timer_init(void)
+{
+       omap_dm_timer_init();
+
+       omap2_gp_clockevent_init();
+       omap2_gp_clocksource_init();
 }
 
 struct sys_timer omap_timer = {
diff --git a/arch/arm/mach-orion/addr-map.c b/arch/arm/mach-orion/addr-map.c
deleted file mode 100644 (file)
index 58cc3c0..0000000
+++ /dev/null
@@ -1,490 +0,0 @@
-/*
- * arch/arm/mach-orion/addr-map.c
- *
- * Address map functions for Marvell Orion System On Chip
- *
- * Maintainer: Tzachi Perelstein <tzachi@marvell.com>
- *
- * This file is licensed under  the terms of the GNU General Public
- * License version 2. This program is licensed "as is" without any
- * warranty of any kind, whether express or implied.
- */
-
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <asm/hardware.h>
-#include "common.h"
-
-/*
- * The Orion has fully programable address map. There's a separate address
- * map for each of the device _master_ interfaces, e.g. CPU, PCI, PCIE, USB,
- * Gigabit Ethernet, DMA/XOR engines, etc. Each interface has its own
- * address decode windows that allow it to access any of the Orion resources.
- *
- * CPU address decoding --
- * Linux assumes that it is the boot loader that already setup the access to
- * DDR and internal registers.
- * Setup access to PCI and PCI-E IO/MEM space is issued by core.c.
- * Setup access to various devices located on the device bus interface (e.g.
- * flashes, RTC, etc) should be issued by machine-setup.c according to
- * specific board population (by using orion_setup_cpu_win()).
- *
- * Non-CPU Masters address decoding --
- * Unlike the CPU, we setup the access from Orion's master interfaces to DDR
- * banks only (the typical use case).
- * Setup access for each master to DDR is issued by common.c.
- *
- * Note: although orion_setbits() and orion_clrbits() are not atomic
- * no locking is necessary here since code in this file is only called
- * at boot time when there is no concurrency issues.
- */
-
-/*
- * Generic Address Decode Windows bit settings
- */
-#define TARGET_DDR             0
-#define TARGET_PCI             3
-#define TARGET_PCIE            4
-#define TARGET_DEV_BUS         1
-#define ATTR_DDR_CS(n)         (((n) ==0) ? 0xe :      \
-                               ((n) == 1) ? 0xd :      \
-                               ((n) == 2) ? 0xb :      \
-                               ((n) == 3) ? 0x7 : 0xf)
-#define ATTR_PCIE_MEM          0x59
-#define ATTR_PCIE_IO           0x51
-#define ATTR_PCI_MEM           0x59
-#define ATTR_PCI_IO            0x51
-#define ATTR_DEV_CS0           0x1e
-#define ATTR_DEV_CS1           0x1d
-#define ATTR_DEV_CS2           0x1b
-#define ATTR_DEV_BOOT          0xf
-#define WIN_EN                 1
-
-/*
- * Helpers to get DDR banks info
- */
-#define DDR_BASE_CS(n)         ORION_DDR_REG(0x1500 + ((n) * 8))
-#define DDR_SIZE_CS(n)         ORION_DDR_REG(0x1504 + ((n) * 8))
-#define DDR_MAX_CS             4
-#define DDR_REG_TO_SIZE(reg)   (((reg) | 0xffffff) + 1)
-#define DDR_REG_TO_BASE(reg)   ((reg) & 0xff000000)
-#define DDR_BANK_EN            1
-
-/*
- * CPU Address Decode Windows registers
- */
-#define CPU_WIN_CTRL(n)                ORION_BRIDGE_REG(0x000 | ((n) << 4))
-#define CPU_WIN_BASE(n)                ORION_BRIDGE_REG(0x004 | ((n) << 4))
-#define CPU_WIN_REMAP_LO(n)    ORION_BRIDGE_REG(0x008 | ((n) << 4))
-#define CPU_WIN_REMAP_HI(n)    ORION_BRIDGE_REG(0x00c | ((n) << 4))
-#define CPU_MAX_WIN            8
-
-/*
- * Use this CPU address decode windows allocation
- */
-#define CPU_WIN_PCIE_IO                0
-#define CPU_WIN_PCI_IO         1
-#define CPU_WIN_PCIE_MEM       2
-#define CPU_WIN_PCI_MEM                3
-#define CPU_WIN_DEV_BOOT       4
-#define CPU_WIN_DEV_CS0                5
-#define CPU_WIN_DEV_CS1                6
-#define CPU_WIN_DEV_CS2                7
-
-/*
- * PCIE Address Decode Windows registers
- */
-#define PCIE_BAR_CTRL(n)       ORION_PCIE_REG(0x1804 + ((n - 1) * 4))
-#define PCIE_BAR_LO(n)         ORION_PCIE_REG(0x0010 + ((n) * 8))
-#define PCIE_BAR_HI(n)         ORION_PCIE_REG(0x0014 + ((n) * 8))
-#define PCIE_WIN_CTRL(n)       (((n) < 5) ? \
-                                       ORION_PCIE_REG(0x1820 + ((n) << 4)) : \
-                                       ORION_PCIE_REG(0x1880))
-#define PCIE_WIN_BASE(n)       (((n) < 5) ? \
-                                       ORION_PCIE_REG(0x1824 + ((n) << 4)) : \
-                                       ORION_PCIE_REG(0x1884))
-#define PCIE_WIN_REMAP(n)      (((n) < 5) ? \
-                                       ORION_PCIE_REG(0x182c + ((n) << 4)) : \
-                                       ORION_PCIE_REG(0x188c))
-#define PCIE_DEFWIN_CTRL       ORION_PCIE_REG(0x18b0)
-#define PCIE_EXPROM_WIN_CTRL   ORION_PCIE_REG(0x18c0)
-#define PCIE_EXPROM_WIN_REMP   ORION_PCIE_REG(0x18c4)
-#define PCIE_MAX_BARS          3
-#define PCIE_MAX_WINS          6
-
-/*
- * Use PCIE BAR '1' for all DDR banks
- */
-#define PCIE_DRAM_BAR          1
-
-/*
- * PCI Address Decode Windows registers
- */
-#define PCI_BAR_SIZE_DDR_CS(n) (((n) == 0) ? ORION_PCI_REG(0xc08) : \
-                               ((n) == 1) ? ORION_PCI_REG(0xd08) :  \
-                               ((n) == 2) ? ORION_PCI_REG(0xc0c) :  \
-                               ((n) == 3) ? ORION_PCI_REG(0xd0c) : 0)
-#define PCI_BAR_REMAP_DDR_CS(n)        (((n) ==0) ? ORION_PCI_REG(0xc48) : \
-                               ((n) == 1) ? ORION_PCI_REG(0xd48) :  \
-                               ((n) == 2) ? ORION_PCI_REG(0xc4c) :  \
-                               ((n) == 3) ? ORION_PCI_REG(0xd4c) : 0)
-#define PCI_BAR_ENABLE         ORION_PCI_REG(0xc3c)
-#define PCI_CTRL_BASE_LO(n)    ORION_PCI_REG(0x1e00 | ((n) << 4))
-#define PCI_CTRL_BASE_HI(n)    ORION_PCI_REG(0x1e04 | ((n) << 4))
-#define PCI_CTRL_SIZE(n)       ORION_PCI_REG(0x1e08 | ((n) << 4))
-#define PCI_ADDR_DECODE_CTRL   ORION_PCI_REG(0xd3c)
-
-/*
- * PCI configuration heleprs for BAR settings
- */
-#define PCI_CONF_FUNC_BAR_CS(n)                ((n) >> 1)
-#define PCI_CONF_REG_BAR_LO_CS(n)      (((n) & 1) ? 0x18 : 0x10)
-#define PCI_CONF_REG_BAR_HI_CS(n)      (((n) & 1) ? 0x1c : 0x14)
-
-/*
- * Gigabit Ethernet Address Decode Windows registers
- */
-#define ETH_WIN_BASE(win)      ORION_ETH_REG(0x200 + ((win) * 8))
-#define ETH_WIN_SIZE(win)      ORION_ETH_REG(0x204 + ((win) * 8))
-#define ETH_WIN_REMAP(win)     ORION_ETH_REG(0x280 + ((win) * 4))
-#define ETH_WIN_EN             ORION_ETH_REG(0x290)
-#define ETH_WIN_PROT           ORION_ETH_REG(0x294)
-#define ETH_MAX_WIN            6
-#define ETH_MAX_REMAP_WIN      4
-
-/*
- * USB Address Decode Windows registers
- */
-#define USB_WIN_CTRL(i, w)     ((i == 0) ? ORION_USB0_REG(0x320 + ((w) << 4)) \
-                                       : ORION_USB1_REG(0x320 + ((w) << 4)))
-#define USB_WIN_BASE(i, w)     ((i == 0) ? ORION_USB0_REG(0x324 + ((w) << 4)) \
-                                       : ORION_USB1_REG(0x324 + ((w) << 4)))
-#define USB_MAX_WIN            4
-
-/*
- * SATA Address Decode Windows registers
- */
-#define SATA_WIN_CTRL(win)     ORION_SATA_REG(0x30 + ((win) * 0x10))
-#define SATA_WIN_BASE(win)     ORION_SATA_REG(0x34 + ((win) * 0x10))
-#define SATA_MAX_WIN           4
-
-static int __init orion_cpu_win_can_remap(u32 win)
-{
-       u32 dev, rev;
-
-       orion_pcie_id(&dev, &rev);
-       if ((dev == MV88F5281_DEV_ID && win < 4)
-           || (dev == MV88F5182_DEV_ID && win < 2)
-           || (dev == MV88F5181_DEV_ID && win < 2))
-               return 1;
-
-       return 0;
-}
-
-void __init orion_setup_cpu_win(enum orion_target target, u32 base, u32 size, int remap)
-{
-       u32 win, attr, ctrl;
-
-       switch (target) {
-       case ORION_PCIE_IO:
-               target = TARGET_PCIE;
-               attr = ATTR_PCIE_IO;
-               win = CPU_WIN_PCIE_IO;
-               break;
-       case ORION_PCI_IO:
-               target = TARGET_PCI;
-               attr = ATTR_PCI_IO;
-               win = CPU_WIN_PCI_IO;
-               break;
-       case ORION_PCIE_MEM:
-               target = TARGET_PCIE;
-               attr = ATTR_PCIE_MEM;
-               win = CPU_WIN_PCIE_MEM;
-               break;
-       case ORION_PCI_MEM:
-               target = TARGET_PCI;
-               attr = ATTR_PCI_MEM;
-               win = CPU_WIN_PCI_MEM;
-               break;
-       case ORION_DEV_BOOT:
-               target = TARGET_DEV_BUS;
-               attr = ATTR_DEV_BOOT;
-               win = CPU_WIN_DEV_BOOT;
-               break;
-       case ORION_DEV0:
-               target = TARGET_DEV_BUS;
-               attr = ATTR_DEV_CS0;
-               win = CPU_WIN_DEV_CS0;
-               break;
-       case ORION_DEV1:
-               target = TARGET_DEV_BUS;
-               attr = ATTR_DEV_CS1;
-               win = CPU_WIN_DEV_CS1;
-               break;
-       case ORION_DEV2:
-               target = TARGET_DEV_BUS;
-               attr = ATTR_DEV_CS2;
-               win = CPU_WIN_DEV_CS2;
-               break;
-       case ORION_DDR:
-       case ORION_REGS:
-               /*
-                * Must be mapped by bootloader.
-                */
-       default:
-               target = attr = win = -1;
-               BUG();
-       }
-
-       base &= 0xffff0000;
-       ctrl = (((size - 1) & 0xffff0000) | (attr << 8) |
-               (target << 4) | WIN_EN);
-
-       orion_write(CPU_WIN_BASE(win), base);
-       orion_write(CPU_WIN_CTRL(win), ctrl);
-
-       if (orion_cpu_win_can_remap(win)) {
-               if (remap >= 0) {
-                       orion_write(CPU_WIN_REMAP_LO(win), remap & 0xffff0000);
-                       orion_write(CPU_WIN_REMAP_HI(win), 0);
-               } else {
-                       orion_write(CPU_WIN_REMAP_LO(win), base);
-                       orion_write(CPU_WIN_REMAP_HI(win), 0);
-               }
-       }
-}
-
-void __init orion_setup_cpu_wins(void)
-{
-       int i;
-
-       /*
-        * First, disable and clear windows
-        */
-       for (i = 0; i < CPU_MAX_WIN; i++) {
-               orion_write(CPU_WIN_BASE(i), 0);
-               orion_write(CPU_WIN_CTRL(i), 0);
-               if (orion_cpu_win_can_remap(i)) {
-                       orion_write(CPU_WIN_REMAP_LO(i), 0);
-                       orion_write(CPU_WIN_REMAP_HI(i), 0);
-               }
-       }
-
-       /*
-        * Setup windows for PCI+PCIe IO+MEM space.
-        */
-       orion_setup_cpu_win(ORION_PCIE_IO, ORION_PCIE_IO_PHYS_BASE,
-                               ORION_PCIE_IO_SIZE, ORION_PCIE_IO_BUS_BASE);
-       orion_setup_cpu_win(ORION_PCI_IO, ORION_PCI_IO_PHYS_BASE,
-                               ORION_PCI_IO_SIZE, ORION_PCI_IO_BUS_BASE);
-       orion_setup_cpu_win(ORION_PCIE_MEM, ORION_PCIE_MEM_PHYS_BASE,
-                               ORION_PCIE_MEM_SIZE, -1);
-       orion_setup_cpu_win(ORION_PCI_MEM, ORION_PCI_MEM_PHYS_BASE,
-                               ORION_PCI_MEM_SIZE, -1);
-}
-
-/*
- * Setup PCIE BARs and Address Decode Wins:
- * BAR[0,2] -> disabled, BAR[1] -> covers all DRAM banks
- * WIN[0-3] -> DRAM bank[0-3]
- */
-void __init orion_setup_pcie_wins(void)
-{
-       u32 base, size, i;
-
-       /*
-        * First, disable and clear BARs and windows
-        */
-       for (i = 1; i < PCIE_MAX_BARS; i++) {
-               orion_write(PCIE_BAR_CTRL(i), 0);
-               orion_write(PCIE_BAR_LO(i), 0);
-               orion_write(PCIE_BAR_HI(i), 0);
-       }
-
-       for (i = 0; i < PCIE_MAX_WINS; i++) {
-               orion_write(PCIE_WIN_CTRL(i), 0);
-               orion_write(PCIE_WIN_BASE(i), 0);
-               orion_write(PCIE_WIN_REMAP(i), 0);
-       }
-
-       /*
-        * Setup windows for DDR banks. Count total DDR size on the fly.
-        */
-       base = DDR_REG_TO_BASE(orion_read(DDR_BASE_CS(0)));
-       size = 0;
-       for (i = 0; i < DDR_MAX_CS; i++) {
-               u32 bank_base, bank_size;
-               bank_size = orion_read(DDR_SIZE_CS(i));
-               bank_base = orion_read(DDR_BASE_CS(i));
-               if (bank_size & DDR_BANK_EN) {
-                       bank_size = DDR_REG_TO_SIZE(bank_size);
-                       bank_base = DDR_REG_TO_BASE(bank_base);
-                       orion_write(PCIE_WIN_BASE(i), bank_base & 0xffff0000);
-                       orion_write(PCIE_WIN_REMAP(i), 0);
-                       orion_write(PCIE_WIN_CTRL(i),
-                                       ((bank_size-1) & 0xffff0000) |
-                                       (ATTR_DDR_CS(i) << 8) |
-                                       (TARGET_DDR << 4) |
-                                       (PCIE_DRAM_BAR << 1) | WIN_EN);
-                       size += bank_size;
-               }
-       }
-
-       /*
-        * Setup BAR[1] to all DRAM banks
-        */
-       orion_write(PCIE_BAR_LO(PCIE_DRAM_BAR), base & 0xffff0000);
-       orion_write(PCIE_BAR_HI(PCIE_DRAM_BAR), 0);
-       orion_write(PCIE_BAR_CTRL(PCIE_DRAM_BAR),
-                               ((size - 1) & 0xffff0000) | WIN_EN);
-}
-
-void __init orion_setup_pci_wins(void)
-{
-       u32 base, size, i;
-
-       /*
-        * First, disable windows
-        */
-       orion_write(PCI_BAR_ENABLE, 0xffffffff);
-
-       /*
-        * Setup windows for DDR banks.
-        */
-       for (i = 0; i < DDR_MAX_CS; i++) {
-               base = orion_read(DDR_BASE_CS(i));
-               size = orion_read(DDR_SIZE_CS(i));
-               if (size & DDR_BANK_EN) {
-                       u32 bus, dev, func, reg, val;
-                       size = DDR_REG_TO_SIZE(size);
-                       base = DDR_REG_TO_BASE(base);
-                       bus = orion_pci_local_bus_nr();
-                       dev = orion_pci_local_dev_nr();
-                       func = PCI_CONF_FUNC_BAR_CS(i);
-                       reg = PCI_CONF_REG_BAR_LO_CS(i);
-                       orion_pci_hw_rd_conf(bus, dev, func, reg, 4, &val);
-                       orion_pci_hw_wr_conf(bus, dev, func, reg, 4,
-                                       (base & 0xfffff000) | (val & 0xfff));
-                       reg = PCI_CONF_REG_BAR_HI_CS(i);
-                       orion_pci_hw_wr_conf(bus, dev, func, reg, 4, 0);
-                       orion_write(PCI_BAR_SIZE_DDR_CS(i),
-                                       (size - 1) & 0xfffff000);
-                       orion_write(PCI_BAR_REMAP_DDR_CS(i),
-                                       base & 0xfffff000);
-                       orion_clrbits(PCI_BAR_ENABLE, (1 << i));
-               }
-       }
-
-       /*
-        * Disable automatic update of address remaping when writing to BARs
-        */
-       orion_setbits(PCI_ADDR_DECODE_CTRL, 1);
-}
-
-void __init orion_setup_usb_wins(void)
-{
-       int i;
-       u32 usb_if, dev, rev;
-       u32 max_usb_if = 1;
-
-       orion_pcie_id(&dev, &rev);
-       if (dev == MV88F5182_DEV_ID)
-               max_usb_if = 2;
-
-       for (usb_if = 0; usb_if < max_usb_if; usb_if++) {
-               /*
-                * First, disable and clear windows
-                */
-               for (i = 0; i < USB_MAX_WIN; i++) {
-                       orion_write(USB_WIN_BASE(usb_if, i), 0);
-                       orion_write(USB_WIN_CTRL(usb_if, i), 0);
-               }
-
-               /*
-                * Setup windows for DDR banks.
-                */
-               for (i = 0; i < DDR_MAX_CS; i++) {
-                       u32 base, size;
-                       size = orion_read(DDR_SIZE_CS(i));
-                       base = orion_read(DDR_BASE_CS(i));
-                       if (size & DDR_BANK_EN) {
-                               base = DDR_REG_TO_BASE(base);
-                               size = DDR_REG_TO_SIZE(size);
-                               orion_write(USB_WIN_CTRL(usb_if, i),
-                                               ((size-1) & 0xffff0000) |
-                                               (ATTR_DDR_CS(i) << 8) |
-                                               (TARGET_DDR << 4) | WIN_EN);
-                               orion_write(USB_WIN_BASE(usb_if, i),
-                                               base & 0xffff0000);
-                       }
-               }
-       }
-}
-
-void __init orion_setup_eth_wins(void)
-{
-       int i;
-
-       /*
-        * First, disable and clear windows
-        */
-       for (i = 0; i < ETH_MAX_WIN; i++) {
-               orion_write(ETH_WIN_BASE(i), 0);
-               orion_write(ETH_WIN_SIZE(i), 0);
-               orion_setbits(ETH_WIN_EN, 1 << i);
-               orion_clrbits(ETH_WIN_PROT, 0x3 << (i * 2));
-               if (i < ETH_MAX_REMAP_WIN)
-                       orion_write(ETH_WIN_REMAP(i), 0);
-       }
-
-       /*
-        * Setup windows for DDR banks.
-        */
-       for (i = 0; i < DDR_MAX_CS; i++) {
-               u32 base, size;
-               size = orion_read(DDR_SIZE_CS(i));
-               base = orion_read(DDR_BASE_CS(i));
-               if (size & DDR_BANK_EN) {
-                       base = DDR_REG_TO_BASE(base);
-                       size = DDR_REG_TO_SIZE(size);
-                       orion_write(ETH_WIN_SIZE(i), (size-1) & 0xffff0000);
-                       orion_write(ETH_WIN_BASE(i), (base & 0xffff0000) |
-                                       (ATTR_DDR_CS(i) << 8) |
-                                       TARGET_DDR);
-                       orion_clrbits(ETH_WIN_EN, 1 << i);
-                       orion_setbits(ETH_WIN_PROT, 0x3 << (i * 2));
-               }
-       }
-}
-
-void __init orion_setup_sata_wins(void)
-{
-       int i;
-
-       /*
-        * First, disable and clear windows
-        */
-       for (i = 0; i < SATA_MAX_WIN; i++) {
-               orion_write(SATA_WIN_BASE(i), 0);
-               orion_write(SATA_WIN_CTRL(i), 0);
-       }
-
-       /*
-        * Setup windows for DDR banks.
-        */
-       for (i = 0; i < DDR_MAX_CS; i++) {
-               u32 base, size;
-               size = orion_read(DDR_SIZE_CS(i));
-               base = orion_read(DDR_BASE_CS(i));
-               if (size & DDR_BANK_EN) {
-                       base = DDR_REG_TO_BASE(base);
-                       size = DDR_REG_TO_SIZE(size);
-                       orion_write(SATA_WIN_CTRL(i),
-                                       ((size-1) & 0xffff0000) |
-                                       (ATTR_DDR_CS(i) << 8) |
-                                       (TARGET_DDR << 4) | WIN_EN);
-                       orion_write(SATA_WIN_BASE(i),
-                                       base & 0xffff0000);
-               }
-       }
-}
diff --git a/arch/arm/mach-orion/common.h b/arch/arm/mach-orion/common.h
deleted file mode 100644 (file)
index 501497c..0000000
+++ /dev/null
@@ -1,92 +0,0 @@
-#ifndef __ARCH_ORION_COMMON_H__
-#define __ARCH_ORION_COMMON_H__
-
-/*
- * Basic Orion init functions used early by machine-setup.
- */
-
-void __init orion_map_io(void);
-void __init orion_init_irq(void);
-void __init orion_init(void);
-
-/*
- * Enumerations and functions for Orion windows mapping. Used by Orion core
- * functions to map its interfaces and by the machine-setup to map its on-
- * board devices. Details in /mach-orion/addr-map.c
- */
-
-enum orion_target {
-       ORION_DEV_BOOT = 0,
-       ORION_DEV0,
-       ORION_DEV1,
-       ORION_DEV2,
-       ORION_PCIE_MEM,
-       ORION_PCIE_IO,
-       ORION_PCI_MEM,
-       ORION_PCI_IO,
-       ORION_DDR,
-       ORION_REGS,
-       ORION_MAX_TARGETS
-};
-
-void orion_setup_cpu_win(enum orion_target target, u32 base, u32 size, int remap);
-void orion_setup_cpu_wins(void);
-void orion_setup_eth_wins(void);
-void orion_setup_usb_wins(void);
-void orion_setup_pci_wins(void);
-void orion_setup_pcie_wins(void);
-void orion_setup_sata_wins(void);
-
-/*
- * Shared code used internally by other Orion core functions.
- * (/mach-orion/pci.c)
- */
-
-struct pci_sys_data;
-struct pci_bus;
-
-void orion_pcie_id(u32 *dev, u32 *rev);
-u32 orion_pcie_local_bus_nr(void);
-u32 orion_pci_local_bus_nr(void);
-u32 orion_pci_local_dev_nr(void);
-int orion_pci_sys_setup(int nr, struct pci_sys_data *sys);
-struct pci_bus *orion_pci_sys_scan_bus(int nr, struct pci_sys_data *sys);
-int orion_pci_hw_rd_conf(u32 bus, u32 dev, u32 func, u32 where, u32 size, u32 *val);
-int orion_pci_hw_wr_conf(u32 bus, u32 dev, u32 func, u32 where, u32 size, u32 val);
-
-/*
- * Valid GPIO pins according to MPP setup, used by machine-setup.
- * (/mach-orion/gpio.c).
- */
-
-void __init orion_gpio_set_valid_pins(u32 pins);
-void gpio_display(void);       /* debug */
-
-/*
- * Orion system timer (clocksource + clockevnt, /mach-orion/time.c)
- */
-extern struct sys_timer orion_timer;
-
-/*
- * Pull in Orion Ethernet platform_data, used by machine-setup
- */
-
-struct mv643xx_eth_platform_data;
-
-void __init orion_eth_init(struct mv643xx_eth_platform_data *eth_data);
-
-/*
- * Orion Sata platform_data, used by machine-setup
- */
-
-struct mv_sata_platform_data;
-
-void __init orion_sata_init(struct mv_sata_platform_data *sata_data);
-
-struct machine_desc;
-struct meminfo;
-struct tag;
-extern void __init tag_fixup_mem32(struct machine_desc *, struct tag *,
-                                  char **, struct meminfo *);
-
-#endif /* __ARCH_ORION_COMMON_H__ */
diff --git a/arch/arm/mach-orion/pci.c b/arch/arm/mach-orion/pci.c
deleted file mode 100644 (file)
index b109bb4..0000000
+++ /dev/null
@@ -1,557 +0,0 @@
-/*
- * arch/arm/mach-orion/pci.c
- *
- * PCI and PCIE functions for Marvell Orion System On Chip
- *
- * Maintainer: Tzachi Perelstein <tzachi@marvell.com>
- *
- * This file is licensed under  the terms of the GNU General Public
- * License version 2. This program is licensed "as is" without any
- * warranty of any kind, whether express or implied.
- */
-
-#include <linux/kernel.h>
-#include <linux/pci.h>
-#include <asm/mach/pci.h>
-#include "common.h"
-
-/*****************************************************************************
- * Orion has one PCIE controller and one PCI controller.
- *
- * Note1: The local PCIE bus number is '0'. The local PCI bus number
- * follows the scanned PCIE bridged busses, if any.
- *
- * Note2: It is possible for PCI/PCIE agents to access many subsystem's
- * space, by configuring BARs and Address Decode Windows, e.g. flashes on
- * device bus, Orion registers, etc. However this code only enable the
- * access to DDR banks.
- ****************************************************************************/
-
-
-/*****************************************************************************
- * PCIE controller
- ****************************************************************************/
-#define PCIE_CTRL              ORION_PCIE_REG(0x1a00)
-#define PCIE_STAT              ORION_PCIE_REG(0x1a04)
-#define PCIE_DEV_ID            ORION_PCIE_REG(0x0000)
-#define PCIE_CMD_STAT          ORION_PCIE_REG(0x0004)
-#define PCIE_DEV_REV           ORION_PCIE_REG(0x0008)
-#define PCIE_MASK              ORION_PCIE_REG(0x1910)
-#define PCIE_CONF_ADDR         ORION_PCIE_REG(0x18f8)
-#define PCIE_CONF_DATA         ORION_PCIE_REG(0x18fc)
-
-/*
- * PCIE_STAT bits
- */
-#define PCIE_STAT_LINK_DOWN            1
-#define PCIE_STAT_BUS_OFFS             8
-#define PCIE_STAT_BUS_MASK             (0xff << PCIE_STAT_BUS_OFFS)
-#define PCIE_STAT_DEV_OFFS             20
-#define PCIE_STAT_DEV_MASK             (0x1f << PCIE_STAT_DEV_OFFS)
-
-/*
- * PCIE_CONF_ADDR bits
- */
-#define PCIE_CONF_REG(r)               ((((r) & 0xf00) << 24) | ((r) & 0xfc))
-#define PCIE_CONF_FUNC(f)              (((f) & 0x3) << 8)
-#define PCIE_CONF_DEV(d)               (((d) & 0x1f) << 11)
-#define PCIE_CONF_BUS(b)               (((b) & 0xff) << 16)
-#define PCIE_CONF_ADDR_EN              (1 << 31)
-
-/*
- * PCIE config cycles are done by programming the PCIE_CONF_ADDR register
- * and then reading the PCIE_CONF_DATA register. Need to make sure these
- * transactions are atomic.
- */
-static DEFINE_SPINLOCK(orion_pcie_lock);
-
-void orion_pcie_id(u32 *dev, u32 *rev)
-{
-       *dev = orion_read(PCIE_DEV_ID) >> 16;
-       *rev = orion_read(PCIE_DEV_REV) & 0xff;
-}
-
-u32 orion_pcie_local_bus_nr(void)
-{
-       u32 stat = orion_read(PCIE_STAT);
-       return((stat & PCIE_STAT_BUS_MASK) >> PCIE_STAT_BUS_OFFS);
-}
-
-static u32 orion_pcie_local_dev_nr(void)
-{
-       u32 stat = orion_read(PCIE_STAT);
-       return((stat & PCIE_STAT_DEV_MASK) >> PCIE_STAT_DEV_OFFS);
-}
-
-static u32 orion_pcie_no_link(void)
-{
-       u32 stat = orion_read(PCIE_STAT);
-       return(stat & PCIE_STAT_LINK_DOWN);
-}
-
-static void orion_pcie_set_bus_nr(int nr)
-{
-       orion_clrbits(PCIE_STAT, PCIE_STAT_BUS_MASK);
-       orion_setbits(PCIE_STAT, nr << PCIE_STAT_BUS_OFFS);
-}
-
-static void orion_pcie_master_slave_enable(void)
-{
-       orion_setbits(PCIE_CMD_STAT, PCI_COMMAND_MASTER |
-                                         PCI_COMMAND_IO |
-                                         PCI_COMMAND_MEMORY);
-}
-
-static void orion_pcie_enable_interrupts(void)
-{
-       /*
-        * Enable interrupts lines
-        * INTA[24] INTB[25] INTC[26] INTD[27]
-        */
-       orion_setbits(PCIE_MASK, 0xf<<24);
-}
-
-static int orion_pcie_valid_config(u32 bus, u32 dev)
-{
-       /*
-        * Don't go out when trying to access --
-        * 1. our own device
-        * 2. where there's no device connected (no link)
-        * 3. nonexisting devices on local bus
-        */
-
-       if ((orion_pcie_local_bus_nr() == bus) &&
-          (orion_pcie_local_dev_nr() == dev))
-               return 0;
-
-       if (orion_pcie_no_link())
-               return 0;
-
-       if (bus == orion_pcie_local_bus_nr())
-               if (((orion_pcie_local_dev_nr() == 0) && (dev != 1)) ||
-                  ((orion_pcie_local_dev_nr() != 0) && (dev != 0)))
-               return 0;
-
-       return 1;
-}
-
-static int orion_pcie_rd_conf(struct pci_bus *bus, u32 devfn, int where,
-                                               int size, u32 *val)
-{
-       unsigned long flags;
-       unsigned int dev, rev, pcie_addr;
-
-       if (orion_pcie_valid_config(bus->number, PCI_SLOT(devfn)) == 0) {
-               *val = 0xffffffff;
-               return PCIBIOS_DEVICE_NOT_FOUND;
-       }
-
-       spin_lock_irqsave(&orion_pcie_lock, flags);
-
-       orion_write(PCIE_CONF_ADDR, PCIE_CONF_BUS(bus->number) |
-                       PCIE_CONF_DEV(PCI_SLOT(devfn)) |
-                       PCIE_CONF_FUNC(PCI_FUNC(devfn)) |
-                       PCIE_CONF_REG(where) | PCIE_CONF_ADDR_EN);
-
-       orion_pcie_id(&dev, &rev);
-       if (dev == MV88F5181_DEV_ID || dev == MV88F5182_DEV_ID) {
-               /* extended register space */
-               pcie_addr = ORION_PCIE_WA_VIRT_BASE;
-               pcie_addr |= PCIE_CONF_BUS(bus->number) |
-                       PCIE_CONF_DEV(PCI_SLOT(devfn)) |
-                       PCIE_CONF_FUNC(PCI_FUNC(devfn)) |
-                       PCIE_CONF_REG(where);
-               *val = orion_read(pcie_addr);
-       } else
-               *val = orion_read(PCIE_CONF_DATA);
-
-       if (size == 1)
-               *val = (*val >> (8*(where & 0x3))) & 0xff;
-       else if (size == 2)
-               *val = (*val >> (8*(where & 0x3))) & 0xffff;
-
-       spin_unlock_irqrestore(&orion_pcie_lock, flags);
-
-       return PCIBIOS_SUCCESSFUL;
-}
-
-
-static int orion_pcie_wr_conf(struct pci_bus *bus, u32 devfn, int where,
-                                               int size, u32 val)
-{
-       unsigned long flags;
-       int ret;
-
-       if (orion_pcie_valid_config(bus->number, PCI_SLOT(devfn)) == 0)
-               return PCIBIOS_DEVICE_NOT_FOUND;
-
-       spin_lock_irqsave(&orion_pcie_lock, flags);
-
-       ret = PCIBIOS_SUCCESSFUL;
-
-       orion_write(PCIE_CONF_ADDR, PCIE_CONF_BUS(bus->number) |
-                       PCIE_CONF_DEV(PCI_SLOT(devfn)) |
-                       PCIE_CONF_FUNC(PCI_FUNC(devfn)) |
-                       PCIE_CONF_REG(where) | PCIE_CONF_ADDR_EN);
-
-       if (size == 4) {
-               __raw_writel(val, PCIE_CONF_DATA);
-       } else if (size == 2) {
-               __raw_writew(val, PCIE_CONF_DATA + (where & 0x3));
-       } else if (size == 1) {
-               __raw_writeb(val, PCIE_CONF_DATA + (where & 0x3));
-       } else {
-               ret = PCIBIOS_BAD_REGISTER_NUMBER;
-       }
-
-       spin_unlock_irqrestore(&orion_pcie_lock, flags);
-
-       return ret;
-}
-
-struct pci_ops orion_pcie_ops = {
-       .read = orion_pcie_rd_conf,
-       .write = orion_pcie_wr_conf,
-};
-
-
-static int orion_pcie_setup(struct pci_sys_data *sys)
-{
-       struct resource *res;
-
-       /*
-        * Master + Slave enable
-        */
-       orion_pcie_master_slave_enable();
-
-       /*
-        * Enable interrupts lines A-D
-        */
-       orion_pcie_enable_interrupts();
-
-       /*
-        * Request resource
-        */
-       res = kzalloc(sizeof(struct resource) * 2, GFP_KERNEL);
-       if (!res)
-               panic("orion_pci_setup unable to alloc resources");
-
-       /*
-        * IORESOURCE_IO
-        */
-       res[0].name = "PCI-EX I/O Space";
-       res[0].flags = IORESOURCE_IO;
-       res[0].start = ORION_PCIE_IO_BUS_BASE;
-       res[0].end = res[0].start + ORION_PCIE_IO_SIZE - 1;
-       if (request_resource(&ioport_resource, &res[0]))
-               panic("Request PCIE IO resource failed\n");
-       sys->resource[0] = &res[0];
-
-       /*
-        * IORESOURCE_MEM
-        */
-       res[1].name = "PCI-EX Memory Space";
-       res[1].flags = IORESOURCE_MEM;
-       res[1].start = ORION_PCIE_MEM_PHYS_BASE;
-       res[1].end = res[1].start + ORION_PCIE_MEM_SIZE - 1;
-       if (request_resource(&iomem_resource, &res[1]))
-               panic("Request PCIE Memory resource failed\n");
-       sys->resource[1] = &res[1];
-
-       sys->resource[2] = NULL;
-       sys->io_offset = 0;
-
-       return 1;
-}
-
-/*****************************************************************************
- * PCI controller
- ****************************************************************************/
-#define PCI_MODE               ORION_PCI_REG(0xd00)
-#define PCI_CMD                        ORION_PCI_REG(0xc00)
-#define PCI_P2P_CONF           ORION_PCI_REG(0x1d14)
-#define PCI_CONF_ADDR          ORION_PCI_REG(0xc78)
-#define PCI_CONF_DATA          ORION_PCI_REG(0xc7c)
-
-/*
- * PCI_MODE bits
- */
-#define PCI_MODE_64BIT                 (1 << 2)
-#define PCI_MODE_PCIX                  ((1 << 4) | (1 << 5))
-
-/*
- * PCI_CMD bits
- */
-#define PCI_CMD_HOST_REORDER           (1 << 29)
-
-/*
- * PCI_P2P_CONF bits
- */
-#define PCI_P2P_BUS_OFFS               16
-#define PCI_P2P_BUS_MASK               (0xff << PCI_P2P_BUS_OFFS)
-#define PCI_P2P_DEV_OFFS               24
-#define PCI_P2P_DEV_MASK               (0x1f << PCI_P2P_DEV_OFFS)
-
-/*
- * PCI_CONF_ADDR bits
- */
-#define PCI_CONF_REG(reg)              ((reg) & 0xfc)
-#define PCI_CONF_FUNC(func)            (((func) & 0x3) << 8)
-#define PCI_CONF_DEV(dev)              (((dev) & 0x1f) << 11)
-#define PCI_CONF_BUS(bus)              (((bus) & 0xff) << 16)
-#define PCI_CONF_ADDR_EN               (1 << 31)
-
-/*
- * Internal configuration space
- */
-#define PCI_CONF_FUNC_STAT_CMD         0
-#define PCI_CONF_REG_STAT_CMD          4
-#define PCIX_STAT                      0x64
-#define PCIX_STAT_BUS_OFFS             8
-#define PCIX_STAT_BUS_MASK             (0xff << PCIX_STAT_BUS_OFFS)
-
-/*
- * PCI config cycles are done by programming the PCI_CONF_ADDR register
- * and then reading the PCI_CONF_DATA register. Need to make sure these
- * transactions are atomic.
- */
-static DEFINE_SPINLOCK(orion_pci_lock);
-
-u32 orion_pci_local_bus_nr(void)
-{
-       u32 conf = orion_read(PCI_P2P_CONF);
-       return((conf & PCI_P2P_BUS_MASK) >> PCI_P2P_BUS_OFFS);
-}
-
-u32 orion_pci_local_dev_nr(void)
-{
-       u32 conf = orion_read(PCI_P2P_CONF);
-       return((conf & PCI_P2P_DEV_MASK) >> PCI_P2P_DEV_OFFS);
-}
-
-int orion_pci_hw_rd_conf(u32 bus, u32 dev, u32 func,
-                                       u32 where, u32 size, u32 *val)
-{
-       unsigned long flags;
-       spin_lock_irqsave(&orion_pci_lock, flags);
-
-       orion_write(PCI_CONF_ADDR, PCI_CONF_BUS(bus) |
-                       PCI_CONF_DEV(dev) | PCI_CONF_REG(where) |
-                       PCI_CONF_FUNC(func) | PCI_CONF_ADDR_EN);
-
-       *val = orion_read(PCI_CONF_DATA);
-
-       if (size == 1)
-               *val = (*val >> (8*(where & 0x3))) & 0xff;
-       else if (size == 2)
-               *val = (*val >> (8*(where & 0x3))) & 0xffff;
-
-       spin_unlock_irqrestore(&orion_pci_lock, flags);
-
-       return PCIBIOS_SUCCESSFUL;
-}
-
-int orion_pci_hw_wr_conf(u32 bus, u32 dev, u32 func,
-                                       u32 where, u32 size, u32 val)
-{
-       unsigned long flags;
-       int ret = PCIBIOS_SUCCESSFUL;
-
-       spin_lock_irqsave(&orion_pci_lock, flags);
-
-       orion_write(PCI_CONF_ADDR, PCI_CONF_BUS(bus) |
-                       PCI_CONF_DEV(dev) | PCI_CONF_REG(where) |
-                       PCI_CONF_FUNC(func) | PCI_CONF_ADDR_EN);
-
-       if (size == 4) {
-               __raw_writel(val, PCI_CONF_DATA);
-       } else if (size == 2) {
-               __raw_writew(val, PCI_CONF_DATA + (where & 0x3));
-       } else if (size == 1) {
-               __raw_writeb(val, PCI_CONF_DATA + (where & 0x3));
-       } else {
-               ret = PCIBIOS_BAD_REGISTER_NUMBER;
-       }
-
-       spin_unlock_irqrestore(&orion_pci_lock, flags);
-
-       return ret;
-}
-
-static int orion_pci_rd_conf(struct pci_bus *bus, u32 devfn,
-                               int where, int size, u32 *val)
-{
-       /*
-        * Don't go out for local device
-        */
-       if ((orion_pci_local_bus_nr() == bus->number) &&
-          (orion_pci_local_dev_nr() == PCI_SLOT(devfn))) {
-               *val = 0xffffffff;
-               return PCIBIOS_DEVICE_NOT_FOUND;
-       }
-
-       return orion_pci_hw_rd_conf(bus->number, PCI_SLOT(devfn),
-                                       PCI_FUNC(devfn), where, size, val);
-}
-
-static int orion_pci_wr_conf(struct pci_bus *bus, u32 devfn,
-                               int where, int size, u32 val)
-{
-       /*
-        * Don't go out for local device
-        */
-       if ((orion_pci_local_bus_nr() == bus->number) &&
-          (orion_pci_local_dev_nr() == PCI_SLOT(devfn)))
-               return PCIBIOS_DEVICE_NOT_FOUND;
-
-       return orion_pci_hw_wr_conf(bus->number, PCI_SLOT(devfn),
-                                       PCI_FUNC(devfn), where, size, val);
-}
-
-struct pci_ops orion_pci_ops = {
-       .read = orion_pci_rd_conf,
-       .write = orion_pci_wr_conf,
-};
-
-static void orion_pci_set_bus_nr(int nr)
-{
-       u32 p2p = orion_read(PCI_P2P_CONF);
-
-       if (orion_read(PCI_MODE) & PCI_MODE_PCIX) {
-               /*
-                * PCI-X mode
-                */
-               u32 pcix_status, bus, dev;
-               bus = (p2p & PCI_P2P_BUS_MASK) >> PCI_P2P_BUS_OFFS;
-               dev = (p2p & PCI_P2P_DEV_MASK) >> PCI_P2P_DEV_OFFS;
-               orion_pci_hw_rd_conf(bus, dev, 0, PCIX_STAT, 4, &pcix_status);
-               pcix_status &= ~PCIX_STAT_BUS_MASK;
-               pcix_status |= (nr << PCIX_STAT_BUS_OFFS);
-               orion_pci_hw_wr_conf(bus, dev, 0, PCIX_STAT, 4, pcix_status);
-       } else {
-               /*
-                * PCI Conventional mode
-                */
-               p2p &= ~PCI_P2P_BUS_MASK;
-               p2p |= (nr << PCI_P2P_BUS_OFFS);
-               orion_write(PCI_P2P_CONF, p2p);
-       }
-}
-
-static void orion_pci_master_slave_enable(void)
-{
-       u32 bus_nr, dev_nr, func, reg, val;
-
-       bus_nr = orion_pci_local_bus_nr();
-       dev_nr = orion_pci_local_dev_nr();
-       func = PCI_CONF_FUNC_STAT_CMD;
-       reg = PCI_CONF_REG_STAT_CMD;
-       orion_pci_hw_rd_conf(bus_nr, dev_nr, func, reg, 4, &val);
-       val |= (PCI_COMMAND_IO | PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER);
-       orion_pci_hw_wr_conf(bus_nr, dev_nr, func, reg, 4, val | 0x7);
-}
-
-static int orion_pci_setup(struct pci_sys_data *sys)
-{
-       struct resource *res;
-
-       /*
-        * Master + Slave enable
-        */
-       orion_pci_master_slave_enable();
-
-       /*
-        * Force ordering
-        */
-       orion_setbits(PCI_CMD, PCI_CMD_HOST_REORDER);
-
-       /*
-        * Request resources
-        */
-       res = kzalloc(sizeof(struct resource) * 2, GFP_KERNEL);
-       if (!res)
-               panic("orion_pci_setup unable to alloc resources");
-
-       /*
-        * IORESOURCE_IO
-        */
-       res[0].name = "PCI I/O Space";
-       res[0].flags = IORESOURCE_IO;
-       res[0].start = ORION_PCI_IO_BUS_BASE;
-       res[0].end = res[0].start + ORION_PCI_IO_SIZE - 1;
-       if (request_resource(&ioport_resource, &res[0]))
-               panic("Request PCI IO resource failed\n");
-       sys->resource[0] = &res[0];
-
-       /*
-        * IORESOURCE_MEM
-        */
-       res[1].name = "PCI Memory Space";
-       res[1].flags = IORESOURCE_MEM;
-       res[1].start = ORION_PCI_MEM_PHYS_BASE;
-       res[1].end = res[1].start + ORION_PCI_MEM_SIZE - 1;
-       if (request_resource(&iomem_resource, &res[1]))
-               panic("Request PCI Memory resource failed\n");
-       sys->resource[1] = &res[1];
-
-       sys->resource[2] = NULL;
-       sys->io_offset = 0;
-
-       return 1;
-}
-
-
-/*****************************************************************************
- * General PCIE + PCI
- ****************************************************************************/
-int orion_pci_sys_setup(int nr, struct pci_sys_data *sys)
-{
-       int ret = 0;
-
-       if (nr == 0) {
-               /*
-                * PCIE setup
-                */
-               orion_pcie_set_bus_nr(0);
-               ret = orion_pcie_setup(sys);
-       } else if (nr == 1) {
-               /*
-                * PCI setup
-                */
-               ret = orion_pci_setup(sys);
-       }
-
-       return ret;
-}
-
-struct pci_bus *orion_pci_sys_scan_bus(int nr, struct pci_sys_data *sys)
-{
-       struct pci_ops *ops;
-       struct pci_bus *bus;
-
-
-       if (nr == 0) {
-               u32 pci_bus;
-               /*
-                * PCIE scan
-                */
-               ops = &orion_pcie_ops;
-               bus = pci_scan_bus(sys->busnr, ops, sys);
-               /*
-                * Set local PCI bus number to follow PCIE bridges (if any)
-                */
-               pci_bus = bus->number + bus->subordinate - bus->secondary + 1;
-               orion_pci_set_bus_nr(pci_bus);
-       } else if (nr == 1) {
-               /*
-                * PCI scan
-                */
-               ops = &orion_pci_ops;
-               bus = pci_scan_bus(sys->busnr, ops, sys);
-       } else {
-               BUG();
-               bus = NULL;
-       }
-
-       return bus;
-}
diff --git a/arch/arm/mach-orion/time.c b/arch/arm/mach-orion/time.c
deleted file mode 100644 (file)
index bd4262d..0000000
+++ /dev/null
@@ -1,181 +0,0 @@
-/*
- * arch/arm/mach-orion/time.c
- *
- * Core time functions for Marvell Orion System On Chip
- *
- * Maintainer: Tzachi Perelstein <tzachi@marvell.com>
- *
- * This file is licensed under the terms of the GNU General Public
- * License version 2. This program is licensed "as is" without any
- * warranty of any kind, whether express or implied.
- */
-
-#include <linux/kernel.h>
-#include <linux/clockchips.h>
-#include <linux/interrupt.h>
-#include <linux/irq.h>
-#include <asm/mach/time.h>
-#include <asm/arch/orion.h>
-#include "common.h"
-
-/*
- * Timer0: clock_event_device, Tick.
- * Timer1: clocksource, Free running.
- * WatchDog: Not used.
- *
- * Timers are counting down.
- */
-#define CLOCKEVENT     0
-#define CLOCKSOURCE    1
-
-/*
- * Timers bits
- */
-#define BRIDGE_INT_TIMER(x)    (1 << ((x) + 1))
-#define TIMER_EN(x)            (1 << ((x) * 2))
-#define TIMER_RELOAD_EN(x)     (1 << (((x) * 2) + 1))
-#define BRIDGE_INT_TIMER_WD    (1 << 3)
-#define TIMER_WD_EN            (1 << 4)
-#define TIMER_WD_RELOAD_EN     (1 << 5)
-
-static cycle_t orion_clksrc_read(void)
-{
-       return (0xffffffff - orion_read(TIMER_VAL(CLOCKSOURCE)));
-}
-
-static struct clocksource orion_clksrc = {
-       .name           = "orion_clocksource",
-       .shift          = 20,
-       .rating         = 300,
-       .read           = orion_clksrc_read,
-       .mask           = CLOCKSOURCE_MASK(32),
-       .flags          = CLOCK_SOURCE_IS_CONTINUOUS,
-};
-
-static int
-orion_clkevt_next_event(unsigned long delta, struct clock_event_device *dev)
-{
-       unsigned long flags;
-
-       if (delta == 0)
-               return -ETIME;
-
-       local_irq_save(flags);
-
-       /*
-        * Clear and enable timer interrupt bit
-        */
-       orion_write(BRIDGE_CAUSE, ~BRIDGE_INT_TIMER(CLOCKEVENT));
-       orion_setbits(BRIDGE_MASK, BRIDGE_INT_TIMER(CLOCKEVENT));
-
-       /*
-        * Setup new timer value
-        */
-       orion_write(TIMER_VAL(CLOCKEVENT), delta);
-
-       /*
-        * Disable auto reload and kickoff the timer
-        */
-       orion_clrbits(TIMER_CTRL, TIMER_RELOAD_EN(CLOCKEVENT));
-       orion_setbits(TIMER_CTRL, TIMER_EN(CLOCKEVENT));
-
-       local_irq_restore(flags);
-
-       return 0;
-}
-
-static void
-orion_clkevt_mode(enum clock_event_mode mode, struct clock_event_device *dev)
-{
-       unsigned long flags;
-
-       local_irq_save(flags);
-
-       if (mode == CLOCK_EVT_MODE_PERIODIC) {
-               /*
-                * Setup latch cycles in timer and enable reload interrupt.
-                */
-               orion_write(TIMER_VAL_RELOAD(CLOCKEVENT), LATCH);
-               orion_write(TIMER_VAL(CLOCKEVENT), LATCH);
-               orion_setbits(BRIDGE_MASK, BRIDGE_INT_TIMER(CLOCKEVENT));
-               orion_setbits(TIMER_CTRL, TIMER_RELOAD_EN(CLOCKEVENT) |
-                                         TIMER_EN(CLOCKEVENT));
-       } else {
-               /*
-                * Disable timer and interrupt
-                */
-               orion_clrbits(BRIDGE_MASK, BRIDGE_INT_TIMER(CLOCKEVENT));
-               orion_write(BRIDGE_CAUSE, ~BRIDGE_INT_TIMER(CLOCKEVENT));
-               orion_clrbits(TIMER_CTRL, TIMER_RELOAD_EN(CLOCKEVENT) |
-                                         TIMER_EN(CLOCKEVENT));
-       }
-
-       local_irq_restore(flags);
-}
-
-static struct clock_event_device orion_clkevt = {
-       .name           = "orion_tick",
-       .features       = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT,
-       .shift          = 32,
-       .rating         = 300,
-       .cpumask        = CPU_MASK_CPU0,
-       .set_next_event = orion_clkevt_next_event,
-       .set_mode       = orion_clkevt_mode,
-};
-
-static irqreturn_t orion_timer_interrupt(int irq, void *dev_id)
-{
-       /*
-        * Clear cause bit and do event
-        */
-       orion_write(BRIDGE_CAUSE, ~BRIDGE_INT_TIMER(CLOCKEVENT));
-       orion_clkevt.event_handler(&orion_clkevt);
-       return IRQ_HANDLED;
-}
-
-static struct irqaction orion_timer_irq = {
-       .name           = "orion_tick",
-       .flags          = IRQF_DISABLED | IRQF_TIMER,
-       .handler        = orion_timer_interrupt
-};
-
-static void orion_timer_init(void)
-{
-       /*
-        * Setup clocksource free running timer (no interrupt on reload)
-        */
-       orion_write(TIMER_VAL(CLOCKSOURCE), 0xffffffff);
-       orion_write(TIMER_VAL_RELOAD(CLOCKSOURCE), 0xffffffff);
-       orion_clrbits(BRIDGE_MASK, BRIDGE_INT_TIMER(CLOCKSOURCE));
-       orion_setbits(TIMER_CTRL, TIMER_RELOAD_EN(CLOCKSOURCE) |
-                                 TIMER_EN(CLOCKSOURCE));
-
-       /*
-        * Register clocksource
-        */
-       orion_clksrc.mult =
-               clocksource_hz2mult(CLOCK_TICK_RATE, orion_clksrc.shift);
-
-       clocksource_register(&orion_clksrc);
-
-       /*
-        * Connect and enable tick handler
-        */
-       setup_irq(IRQ_ORION_BRIDGE, &orion_timer_irq);
-
-       /*
-        * Register clockevent
-        */
-       orion_clkevt.mult =
-               div_sc(CLOCK_TICK_RATE, NSEC_PER_SEC, orion_clkevt.shift);
-       orion_clkevt.max_delta_ns =
-               clockevent_delta2ns(0xfffffffe, &orion_clkevt);
-       orion_clkevt.min_delta_ns =
-               clockevent_delta2ns(1, &orion_clkevt);
-
-       clockevents_register_device(&orion_clkevt);
-}
-
-struct sys_timer orion_timer = {
-       .init = orion_timer_init,
-};
similarity index 77%
rename from arch/arm/mach-orion/Kconfig
rename to arch/arm/mach-orion5x/Kconfig
index 1dcbb6ac5a3075b062791cf6a0289dbbf98e4c9d..93debf33615592b6f4e9b6b5bbff94b3d6f6cc2f 100644 (file)
@@ -1,4 +1,4 @@
-if ARCH_ORION
+if ARCH_ORION5X
 
 menu "Orion Implementations"
 
@@ -36,6 +36,14 @@ config MACH_TS209
          Say 'Y' here if you want your kernel to support the
          QNAP TS-109/TS-209 platform.
 
+config MACH_LINKSTATION_PRO
+       bool "Buffalo Linkstation Pro/Live"
+       select I2C_BOARDINFO
+       help
+         Say 'Y' here if you want your kernel to support the
+         Buffalo Linkstation Pro/Live platform. Both v1 and
+         v2 devices are supported.
+
 endmenu
 
 endif
similarity index 68%
rename from arch/arm/mach-orion/Makefile
rename to arch/arm/mach-orion5x/Makefile
index f91d937a73e8729cc5a758deea62fa479b0d8505..9301bf55910b56f9255d020bc9e36489a4786ccd 100644 (file)
@@ -1,6 +1,7 @@
-obj-y                          += common.o addr-map.o pci.o gpio.o irq.o time.o
+obj-y                          += common.o addr-map.o pci.o gpio.o irq.o
 obj-$(CONFIG_MACH_DB88F5281)   += db88f5281-setup.o
 obj-$(CONFIG_MACH_RD88F5182)   += rd88f5182-setup.o
 obj-$(CONFIG_MACH_KUROBOX_PRO) += kurobox_pro-setup.o
+obj-$(CONFIG_MACH_LINKSTATION_PRO) += kurobox_pro-setup.o
 obj-$(CONFIG_MACH_DNS323)      += dns323-setup.o
 obj-$(CONFIG_MACH_TS209)       += ts209-setup.o
diff --git a/arch/arm/mach-orion5x/addr-map.c b/arch/arm/mach-orion5x/addr-map.c
new file mode 100644 (file)
index 0000000..6b17937
--- /dev/null
@@ -0,0 +1,240 @@
+/*
+ * arch/arm/mach-orion5x/addr-map.c
+ *
+ * Address map functions for Marvell Orion 5x SoCs
+ *
+ * Maintainer: Tzachi Perelstein <tzachi@marvell.com>
+ *
+ * This file is licensed under the terms of the GNU General Public
+ * License version 2.  This program is licensed "as is" without any
+ * warranty of any kind, whether express or implied.
+ */
+
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/mbus.h>
+#include <asm/hardware.h>
+#include <asm/io.h>
+#include "common.h"
+
+/*
+ * The Orion has fully programable address map. There's a separate address
+ * map for each of the device _master_ interfaces, e.g. CPU, PCI, PCIE, USB,
+ * Gigabit Ethernet, DMA/XOR engines, etc. Each interface has its own
+ * address decode windows that allow it to access any of the Orion resources.
+ *
+ * CPU address decoding --
+ * Linux assumes that it is the boot loader that already setup the access to
+ * DDR and internal registers.
+ * Setup access to PCI and PCI-E IO/MEM space is issued by this file.
+ * Setup access to various devices located on the device bus interface (e.g.
+ * flashes, RTC, etc) should be issued by machine-setup.c according to
+ * specific board population (by using orion5x_setup_*_win()).
+ *
+ * Non-CPU Masters address decoding --
+ * Unlike the CPU, we setup the access from Orion's master interfaces to DDR
+ * banks only (the typical use case).
+ * Setup access for each master to DDR is issued by common.c.
+ *
+ * Note: although orion_setbits() and orion_clrbits() are not atomic
+ * no locking is necessary here since code in this file is only called
+ * at boot time when there is no concurrency issues.
+ */
+
+/*
+ * Generic Address Decode Windows bit settings
+ */
+#define TARGET_DDR             0
+#define TARGET_DEV_BUS         1
+#define TARGET_PCI             3
+#define TARGET_PCIE            4
+#define ATTR_DDR_CS(n)         (((n) ==0) ? 0xe :      \
+                               ((n) == 1) ? 0xd :      \
+                               ((n) == 2) ? 0xb :      \
+                               ((n) == 3) ? 0x7 : 0xf)
+#define ATTR_PCIE_MEM          0x59
+#define ATTR_PCIE_IO           0x51
+#define ATTR_PCIE_WA           0x79
+#define ATTR_PCI_MEM           0x59
+#define ATTR_PCI_IO            0x51
+#define ATTR_DEV_CS0           0x1e
+#define ATTR_DEV_CS1           0x1d
+#define ATTR_DEV_CS2           0x1b
+#define ATTR_DEV_BOOT          0xf
+#define WIN_EN                 1
+
+/*
+ * Helpers to get DDR bank info
+ */
+#define DDR_BASE_CS(n)         ORION5X_DDR_REG(0x1500 + ((n) * 8))
+#define DDR_SIZE_CS(n)         ORION5X_DDR_REG(0x1504 + ((n) * 8))
+#define DDR_MAX_CS             4
+#define DDR_REG_TO_SIZE(reg)   (((reg) | 0xffffff) + 1)
+#define DDR_REG_TO_BASE(reg)   ((reg) & 0xff000000)
+#define DDR_BANK_EN            1
+
+/*
+ * CPU Address Decode Windows registers
+ */
+#define CPU_WIN_CTRL(n)                ORION5X_BRIDGE_REG(0x000 | ((n) << 4))
+#define CPU_WIN_BASE(n)                ORION5X_BRIDGE_REG(0x004 | ((n) << 4))
+#define CPU_WIN_REMAP_LO(n)    ORION5X_BRIDGE_REG(0x008 | ((n) << 4))
+#define CPU_WIN_REMAP_HI(n)    ORION5X_BRIDGE_REG(0x00c | ((n) << 4))
+
+/*
+ * Gigabit Ethernet Address Decode Windows registers
+ */
+#define ETH_WIN_BASE(win)      ORION5X_ETH_REG(0x200 + ((win) * 8))
+#define ETH_WIN_SIZE(win)      ORION5X_ETH_REG(0x204 + ((win) * 8))
+#define ETH_WIN_REMAP(win)     ORION5X_ETH_REG(0x280 + ((win) * 4))
+#define ETH_WIN_EN             ORION5X_ETH_REG(0x290)
+#define ETH_WIN_PROT           ORION5X_ETH_REG(0x294)
+#define ETH_MAX_WIN            6
+#define ETH_MAX_REMAP_WIN      4
+
+
+struct mbus_dram_target_info orion5x_mbus_dram_info;
+
+static int __init orion5x_cpu_win_can_remap(int win)
+{
+       u32 dev, rev;
+
+       orion5x_pcie_id(&dev, &rev);
+       if ((dev == MV88F5281_DEV_ID && win < 4)
+           || (dev == MV88F5182_DEV_ID && win < 2)
+           || (dev == MV88F5181_DEV_ID && win < 2))
+               return 1;
+
+       return 0;
+}
+
+static void __init setup_cpu_win(int win, u32 base, u32 size,
+                                u8 target, u8 attr, int remap)
+{
+       orion5x_write(CPU_WIN_BASE(win), base & 0xffff0000);
+       orion5x_write(CPU_WIN_CTRL(win),
+               ((size - 1) & 0xffff0000) | (attr << 8) | (target << 4) | 1);
+
+       if (orion5x_cpu_win_can_remap(win)) {
+               if (remap < 0)
+                       remap = base;
+
+               orion5x_write(CPU_WIN_REMAP_LO(win), remap & 0xffff0000);
+               orion5x_write(CPU_WIN_REMAP_HI(win), 0);
+       }
+}
+
+void __init orion5x_setup_cpu_mbus_bridge(void)
+{
+       int i;
+       int cs;
+
+       /*
+        * First, disable and clear windows.
+        */
+       for (i = 0; i < 8; i++) {
+               orion5x_write(CPU_WIN_BASE(i), 0);
+               orion5x_write(CPU_WIN_CTRL(i), 0);
+               if (orion5x_cpu_win_can_remap(i)) {
+                       orion5x_write(CPU_WIN_REMAP_LO(i), 0);
+                       orion5x_write(CPU_WIN_REMAP_HI(i), 0);
+               }
+       }
+
+       /*
+        * Setup windows for PCI+PCIe IO+MEM space.
+        */
+       setup_cpu_win(0, ORION5X_PCIE_IO_PHYS_BASE, ORION5X_PCIE_IO_SIZE,
+               TARGET_PCIE, ATTR_PCIE_IO, ORION5X_PCIE_IO_BUS_BASE);
+       setup_cpu_win(1, ORION5X_PCI_IO_PHYS_BASE, ORION5X_PCI_IO_SIZE,
+               TARGET_PCI, ATTR_PCI_IO, ORION5X_PCI_IO_BUS_BASE);
+       setup_cpu_win(2, ORION5X_PCIE_MEM_PHYS_BASE, ORION5X_PCIE_MEM_SIZE,
+               TARGET_PCIE, ATTR_PCIE_MEM, -1);
+       setup_cpu_win(3, ORION5X_PCI_MEM_PHYS_BASE, ORION5X_PCI_MEM_SIZE,
+               TARGET_PCI, ATTR_PCI_MEM, -1);
+
+       /*
+        * Setup MBUS dram target info.
+        */
+       orion5x_mbus_dram_info.mbus_dram_target_id = TARGET_DDR;
+
+       for (i = 0, cs = 0; i < 4; i++) {
+               u32 base = readl(DDR_BASE_CS(i));
+               u32 size = readl(DDR_SIZE_CS(i));
+
+               /*
+                * Chip select enabled?
+                */
+               if (size & 1) {
+                       struct mbus_dram_window *w;
+
+                       w = &orion5x_mbus_dram_info.cs[cs++];
+                       w->cs_index = i;
+                       w->mbus_attr = 0xf & ~(1 << i);
+                       w->base = base & 0xff000000;
+                       w->size = (size | 0x00ffffff) + 1;
+               }
+       }
+       orion5x_mbus_dram_info.num_cs = cs;
+}
+
+void __init orion5x_setup_dev_boot_win(u32 base, u32 size)
+{
+       setup_cpu_win(4, base, size, TARGET_DEV_BUS, ATTR_DEV_BOOT, -1);
+}
+
+void __init orion5x_setup_dev0_win(u32 base, u32 size)
+{
+       setup_cpu_win(5, base, size, TARGET_DEV_BUS, ATTR_DEV_CS0, -1);
+}
+
+void __init orion5x_setup_dev1_win(u32 base, u32 size)
+{
+       setup_cpu_win(6, base, size, TARGET_DEV_BUS, ATTR_DEV_CS1, -1);
+}
+
+void __init orion5x_setup_dev2_win(u32 base, u32 size)
+{
+       setup_cpu_win(7, base, size, TARGET_DEV_BUS, ATTR_DEV_CS2, -1);
+}
+
+void __init orion5x_setup_pcie_wa_win(u32 base, u32 size)
+{
+       setup_cpu_win(7, base, size, TARGET_PCIE, ATTR_PCIE_WA, -1);
+}
+
+void __init orion5x_setup_eth_wins(void)
+{
+       int i;
+
+       /*
+        * First, disable and clear windows
+        */
+       for (i = 0; i < ETH_MAX_WIN; i++) {
+               orion5x_write(ETH_WIN_BASE(i), 0);
+               orion5x_write(ETH_WIN_SIZE(i), 0);
+               orion5x_setbits(ETH_WIN_EN, 1 << i);
+               orion5x_clrbits(ETH_WIN_PROT, 0x3 << (i * 2));
+               if (i < ETH_MAX_REMAP_WIN)
+                       orion5x_write(ETH_WIN_REMAP(i), 0);
+       }
+
+       /*
+        * Setup windows for DDR banks.
+        */
+       for (i = 0; i < DDR_MAX_CS; i++) {
+               u32 base, size;
+               size = orion5x_read(DDR_SIZE_CS(i));
+               base = orion5x_read(DDR_BASE_CS(i));
+               if (size & DDR_BANK_EN) {
+                       base = DDR_REG_TO_BASE(base);
+                       size = DDR_REG_TO_SIZE(size);
+                       orion5x_write(ETH_WIN_SIZE(i), (size-1) & 0xffff0000);
+                       orion5x_write(ETH_WIN_BASE(i), (base & 0xffff0000) |
+                                       (ATTR_DDR_CS(i) << 8) |
+                                       TARGET_DDR);
+                       orion5x_clrbits(ETH_WIN_EN, 1 << i);
+                       orion5x_setbits(ETH_WIN_PROT, 0x3 << (i * 2));
+               }
+       }
+}
similarity index 52%
rename from arch/arm/mach-orion/common.c
rename to arch/arm/mach-orion5x/common.c
index bbc2b4ec932ca8a407188a3810a3dcbcfd317840..439c7784af02ddfbb1c7afc10755c18f8a81e0eb 100644 (file)
@@ -1,12 +1,12 @@
 /*
- * arch/arm/mach-orion/common.c
+ * arch/arm/mach-orion5x/common.c
  *
- * Core functions for Marvell Orion System On Chip
+ * Core functions for Marvell Orion 5x SoCs
  *
  * Maintainer: Tzachi Perelstein <tzachi@marvell.com>
  *
- * This file is licensed under  the terms of the GNU General Public
- * License version 2. This program is licensed "as is" without any
+ * This file is licensed under the terms of the GNU General Public
+ * License version 2.  This program is licensed "as is" without any
  * warranty of any kind, whether express or implied.
  */
 
 #include <linux/init.h>
 #include <linux/platform_device.h>
 #include <linux/serial_8250.h>
+#include <linux/mbus.h>
 #include <linux/mv643xx_eth.h>
 #include <linux/mv643xx_i2c.h>
+#include <linux/ata_platform.h>
 #include <asm/page.h>
 #include <asm/setup.h>
 #include <asm/timex.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
+#include <asm/mach/time.h>
 #include <asm/arch/hardware.h>
+#include <asm/arch/orion5x.h>
+#include <asm/plat-orion/ehci-orion.h>
+#include <asm/plat-orion/orion_nand.h>
+#include <asm/plat-orion/time.h>
 #include "common.h"
 
 /*****************************************************************************
  * I/O Address Mapping
  ****************************************************************************/
-static struct map_desc orion_io_desc[] __initdata = {
+static struct map_desc orion5x_io_desc[] __initdata = {
        {
-               .virtual        = ORION_REGS_VIRT_BASE,
-               .pfn            = __phys_to_pfn(ORION_REGS_PHYS_BASE),
-               .length         = ORION_REGS_SIZE,
+               .virtual        = ORION5X_REGS_VIRT_BASE,
+               .pfn            = __phys_to_pfn(ORION5X_REGS_PHYS_BASE),
+               .length         = ORION5X_REGS_SIZE,
                .type           = MT_DEVICE
        },
        {
-               .virtual        = ORION_PCIE_IO_VIRT_BASE,
-               .pfn            = __phys_to_pfn(ORION_PCIE_IO_PHYS_BASE),
-               .length         = ORION_PCIE_IO_SIZE,
+               .virtual        = ORION5X_PCIE_IO_VIRT_BASE,
+               .pfn            = __phys_to_pfn(ORION5X_PCIE_IO_PHYS_BASE),
+               .length         = ORION5X_PCIE_IO_SIZE,
                .type           = MT_DEVICE
        },
        {
-               .virtual        = ORION_PCI_IO_VIRT_BASE,
-               .pfn            = __phys_to_pfn(ORION_PCI_IO_PHYS_BASE),
-               .length         = ORION_PCI_IO_SIZE,
+               .virtual        = ORION5X_PCI_IO_VIRT_BASE,
+               .pfn            = __phys_to_pfn(ORION5X_PCI_IO_PHYS_BASE),
+               .length         = ORION5X_PCI_IO_SIZE,
                .type           = MT_DEVICE
        },
        {
-               .virtual        = ORION_PCIE_WA_VIRT_BASE,
-               .pfn            = __phys_to_pfn(ORION_PCIE_WA_PHYS_BASE),
-               .length         = ORION_PCIE_WA_SIZE,
+               .virtual        = ORION5X_PCIE_WA_VIRT_BASE,
+               .pfn            = __phys_to_pfn(ORION5X_PCIE_WA_PHYS_BASE),
+               .length         = ORION5X_PCIE_WA_SIZE,
                .type           = MT_DEVICE
        },
 };
 
-void __init orion_map_io(void)
+void __init orion5x_map_io(void)
 {
-       iotable_init(orion_io_desc, ARRAY_SIZE(orion_io_desc));
+       iotable_init(orion5x_io_desc, ARRAY_SIZE(orion5x_io_desc));
 }
 
 /*****************************************************************************
  * UART
  ****************************************************************************/
 
-static struct resource orion_uart_resources[] = {
+static struct resource orion5x_uart_resources[] = {
        {
                .start          = UART0_PHYS_BASE,
                .end            = UART0_PHYS_BASE + 0xff,
                .flags          = IORESOURCE_MEM,
        },
        {
-               .start          = IRQ_ORION_UART0,
-               .end            = IRQ_ORION_UART0,
+               .start          = IRQ_ORION5X_UART0,
+               .end            = IRQ_ORION5X_UART0,
                .flags          = IORESOURCE_IRQ,
        },
        {
@@ -80,96 +87,102 @@ static struct resource orion_uart_resources[] = {
                .flags          = IORESOURCE_MEM,
        },
        {
-               .start          = IRQ_ORION_UART1,
-               .end            = IRQ_ORION_UART1,
+               .start          = IRQ_ORION5X_UART1,
+               .end            = IRQ_ORION5X_UART1,
                .flags          = IORESOURCE_IRQ,
        },
 };
 
-static struct plat_serial8250_port orion_uart_data[] = {
+static struct plat_serial8250_port orion5x_uart_data[] = {
        {
                .mapbase        = UART0_PHYS_BASE,
                .membase        = (char *)UART0_VIRT_BASE,
-               .irq            = IRQ_ORION_UART0,
+               .irq            = IRQ_ORION5X_UART0,
                .flags          = UPF_SKIP_TEST | UPF_BOOT_AUTOCONF,
                .iotype         = UPIO_MEM,
                .regshift       = 2,
-               .uartclk        = ORION_TCLK,
+               .uartclk        = ORION5X_TCLK,
        },
        {
                .mapbase        = UART1_PHYS_BASE,
                .membase        = (char *)UART1_VIRT_BASE,
-               .irq            = IRQ_ORION_UART1,
+               .irq            = IRQ_ORION5X_UART1,
                .flags          = UPF_SKIP_TEST | UPF_BOOT_AUTOCONF,
                .iotype         = UPIO_MEM,
                .regshift       = 2,
-               .uartclk        = ORION_TCLK,
+               .uartclk        = ORION5X_TCLK,
        },
        { },
 };
 
-static struct platform_device orion_uart = {
+static struct platform_device orion5x_uart = {
        .name                   = "serial8250",
        .id                     = PLAT8250_DEV_PLATFORM,
        .dev                    = {
-               .platform_data  = orion_uart_data,
+               .platform_data  = orion5x_uart_data,
        },
-       .resource               = orion_uart_resources,
-       .num_resources          = ARRAY_SIZE(orion_uart_resources),
+       .resource               = orion5x_uart_resources,
+       .num_resources          = ARRAY_SIZE(orion5x_uart_resources),
 };
 
 /*******************************************************************************
  * USB Controller - 2 interfaces
  ******************************************************************************/
 
-static struct resource orion_ehci0_resources[] = {
+static struct resource orion5x_ehci0_resources[] = {
        {
-               .start  = ORION_USB0_PHYS_BASE,
-               .end    = ORION_USB0_PHYS_BASE + SZ_4K,
+               .start  = ORION5X_USB0_PHYS_BASE,
+               .end    = ORION5X_USB0_PHYS_BASE + SZ_4K,
                .flags  = IORESOURCE_MEM,
        },
        {
-               .start  = IRQ_ORION_USB0_CTRL,
-               .end    = IRQ_ORION_USB0_CTRL,
+               .start  = IRQ_ORION5X_USB0_CTRL,
+               .end    = IRQ_ORION5X_USB0_CTRL,
                .flags  = IORESOURCE_IRQ,
        },
 };
 
-static struct resource orion_ehci1_resources[] = {
+static struct resource orion5x_ehci1_resources[] = {
        {
-               .start  = ORION_USB1_PHYS_BASE,
-               .end    = ORION_USB1_PHYS_BASE + SZ_4K,
+               .start  = ORION5X_USB1_PHYS_BASE,
+               .end    = ORION5X_USB1_PHYS_BASE + SZ_4K,
                .flags  = IORESOURCE_MEM,
        },
        {
-               .start  = IRQ_ORION_USB1_CTRL,
-               .end    = IRQ_ORION_USB1_CTRL,
+               .start  = IRQ_ORION5X_USB1_CTRL,
+               .end    = IRQ_ORION5X_USB1_CTRL,
                .flags  = IORESOURCE_IRQ,
        },
 };
 
+static struct orion_ehci_data orion5x_ehci_data = {
+       .dram           = &orion5x_mbus_dram_info,
+};
+
 static u64 ehci_dmamask = 0xffffffffUL;
 
-static struct platform_device orion_ehci0 = {
+static struct platform_device orion5x_ehci0 = {
        .name           = "orion-ehci",
        .id             = 0,
        .dev            = {
                .dma_mask               = &ehci_dmamask,
                .coherent_dma_mask      = 0xffffffff,
+               .platform_data          = &orion5x_ehci_data,
        },
-       .resource       = orion_ehci0_resources,
-       .num_resources  = ARRAY_SIZE(orion_ehci0_resources),
+       .resource       = orion5x_ehci0_resources,
+       .num_resources  = ARRAY_SIZE(orion5x_ehci0_resources),
 };
 
-static struct platform_device orion_ehci1 = {
+static struct platform_device orion5x_ehci1 = {
        .name           = "orion-ehci",
        .id             = 1,
        .dev            = {
                .dma_mask               = &ehci_dmamask,
                .coherent_dma_mask      = 0xffffffff,
+               .platform_data          = &orion5x_ehci_data,
        },
-       .resource       = orion_ehci1_resources,
-       .num_resources  = ARRAY_SIZE(orion_ehci1_resources),
+       .resource       = orion5x_ehci1_resources,
+       .num_resources  = ARRAY_SIZE(orion5x_ehci1_resources),
 };
 
 /*****************************************************************************
@@ -177,42 +190,42 @@ static struct platform_device orion_ehci1 = {
  * (The Orion and Discovery (MV643xx) families use the same Ethernet driver)
  ****************************************************************************/
 
-static struct resource orion_eth_shared_resources[] = {
+static struct resource orion5x_eth_shared_resources[] = {
        {
-               .start  = ORION_ETH_PHYS_BASE + 0x2000,
-               .end    = ORION_ETH_PHYS_BASE + 0x3fff,
+               .start  = ORION5X_ETH_PHYS_BASE + 0x2000,
+               .end    = ORION5X_ETH_PHYS_BASE + 0x3fff,
                .flags  = IORESOURCE_MEM,
        },
 };
 
-static struct platform_device orion_eth_shared = {
+static struct platform_device orion5x_eth_shared = {
        .name           = MV643XX_ETH_SHARED_NAME,
        .id             = 0,
        .num_resources  = 1,
-       .resource       = orion_eth_shared_resources,
+       .resource       = orion5x_eth_shared_resources,
 };
 
-static struct resource orion_eth_resources[] = {
+static struct resource orion5x_eth_resources[] = {
        {
                .name   = "eth irq",
-               .start  = IRQ_ORION_ETH_SUM,
-               .end    = IRQ_ORION_ETH_SUM,
+               .start  = IRQ_ORION5X_ETH_SUM,
+               .end    = IRQ_ORION5X_ETH_SUM,
                .flags  = IORESOURCE_IRQ,
        }
 };
 
-static struct platform_device orion_eth = {
+static struct platform_device orion5x_eth = {
        .name           = MV643XX_ETH_NAME,
        .id             = 0,
        .num_resources  = 1,
-       .resource       = orion_eth_resources,
+       .resource       = orion5x_eth_resources,
 };
 
-void __init orion_eth_init(struct mv643xx_eth_platform_data *eth_data)
+void __init orion5x_eth_init(struct mv643xx_eth_platform_data *eth_data)
 {
-       orion_eth.dev.platform_data = eth_data;
-       platform_device_register(&orion_eth_shared);
-       platform_device_register(&orion_eth);
+       orion5x_eth.dev.platform_data = eth_data;
+       platform_device_register(&orion5x_eth_shared);
+       platform_device_register(&orion5x_eth);
 }
 
 /*****************************************************************************
@@ -220,13 +233,13 @@ void __init orion_eth_init(struct mv643xx_eth_platform_data *eth_data)
  * (The Orion and Discovery (MV643xx) families share the same I2C controller)
  ****************************************************************************/
 
-static struct mv64xxx_i2c_pdata orion_i2c_pdata = {
+static struct mv64xxx_i2c_pdata orion5x_i2c_pdata = {
        .freq_m         = 8, /* assumes 166 MHz TCLK */
        .freq_n         = 3,
        .timeout        = 1000, /* Default timeout of 1 second */
 };
 
-static struct resource orion_i2c_resources[] = {
+static struct resource orion5x_i2c_resources[] = {
        {
                .name   = "i2c base",
                .start  = I2C_PHYS_BASE,
@@ -235,56 +248,70 @@ static struct resource orion_i2c_resources[] = {
        },
        {
                .name   = "i2c irq",
-               .start  = IRQ_ORION_I2C,
-               .end    = IRQ_ORION_I2C,
+               .start  = IRQ_ORION5X_I2C,
+               .end    = IRQ_ORION5X_I2C,
                .flags  = IORESOURCE_IRQ,
        },
 };
 
-static struct platform_device orion_i2c = {
+static struct platform_device orion5x_i2c = {
        .name           = MV64XXX_I2C_CTLR_NAME,
        .id             = 0,
-       .num_resources  = ARRAY_SIZE(orion_i2c_resources),
-       .resource       = orion_i2c_resources,
+       .num_resources  = ARRAY_SIZE(orion5x_i2c_resources),
+       .resource       = orion5x_i2c_resources,
        .dev            = {
-               .platform_data = &orion_i2c_pdata,
+               .platform_data = &orion5x_i2c_pdata,
        },
 };
 
 /*****************************************************************************
  * Sata port
  ****************************************************************************/
-static struct resource orion_sata_resources[] = {
+static struct resource orion5x_sata_resources[] = {
         {
                 .name   = "sata base",
-                .start  = ORION_SATA_PHYS_BASE,
-                .end    = ORION_SATA_PHYS_BASE + 0x5000 - 1,
+                .start  = ORION5X_SATA_PHYS_BASE,
+                .end    = ORION5X_SATA_PHYS_BASE + 0x5000 - 1,
                 .flags  = IORESOURCE_MEM,
         },
        {
                 .name   = "sata irq",
-                .start  = IRQ_ORION_SATA,
-                .end    = IRQ_ORION_SATA,
+                .start  = IRQ_ORION5X_SATA,
+                .end    = IRQ_ORION5X_SATA,
                 .flags  = IORESOURCE_IRQ,
         },
 };
 
-static struct platform_device orion_sata = {
+static struct platform_device orion5x_sata = {
        .name           = "sata_mv",
        .id             = 0,
        .dev            = {
                .coherent_dma_mask      = 0xffffffff,
        },
-       .num_resources  = ARRAY_SIZE(orion_sata_resources),
-       .resource       = orion_sata_resources,
+       .num_resources  = ARRAY_SIZE(orion5x_sata_resources),
+       .resource       = orion5x_sata_resources,
 };
 
-void __init orion_sata_init(struct mv_sata_platform_data *sata_data)
+void __init orion5x_sata_init(struct mv_sata_platform_data *sata_data)
 {
-       orion_sata.dev.platform_data = sata_data;
-       platform_device_register(&orion_sata);
+       sata_data->dram = &orion5x_mbus_dram_info;
+       orion5x_sata.dev.platform_data = sata_data;
+       platform_device_register(&orion5x_sata);
 }
 
+/*****************************************************************************
+ * Time handling
+ ****************************************************************************/
+
+static void orion5x_timer_init(void)
+{
+       orion_time_init(IRQ_ORION5X_BRIDGE, ORION5X_TCLK);
+}
+
+struct sys_timer orion5x_timer = {
+        .init = orion5x_timer_init,
+};
+
 /*****************************************************************************
  * General
  ****************************************************************************/
@@ -292,9 +319,9 @@ void __init orion_sata_init(struct mv_sata_platform_data *sata_data)
 /*
  * Identify device ID and rev from PCIE configuration header space '0'.
  */
-static void orion_id(u32 *dev, u32 *rev, char **dev_name)
+static void __init orion5x_id(u32 *dev, u32 *rev, char **dev_name)
 {
-       orion_pcie_id(dev, rev);
+       orion5x_pcie_id(dev, rev);
 
        if (*dev == MV88F5281_DEV_ID) {
                if (*rev == MV88F5281_REV_D2) {
@@ -321,33 +348,28 @@ static void orion_id(u32 *dev, u32 *rev, char **dev_name)
        }
 }
 
-void __init orion_init(void)
+void __init orion5x_init(void)
 {
        char *dev_name;
        u32 dev, rev;
 
-       orion_id(&dev, &rev, &dev_name);
-       printk(KERN_INFO "Orion ID: %s. TCLK=%d.\n", dev_name, ORION_TCLK);
+       orion5x_id(&dev, &rev, &dev_name);
+       printk(KERN_INFO "Orion ID: %s. TCLK=%d.\n", dev_name, ORION5X_TCLK);
 
        /*
         * Setup Orion address map
         */
-       orion_setup_cpu_wins();
-       orion_setup_usb_wins();
-       orion_setup_eth_wins();
-       orion_setup_pci_wins();
-       orion_setup_pcie_wins();
-       if (dev == MV88F5182_DEV_ID)
-               orion_setup_sata_wins();
+       orion5x_setup_cpu_mbus_bridge();
+       orion5x_setup_eth_wins();
 
        /*
-        * REgister devices
+        * Register devices.
         */
-       platform_device_register(&orion_uart);
-       platform_device_register(&orion_ehci0);
+       platform_device_register(&orion5x_uart);
+       platform_device_register(&orion5x_ehci0);
        if (dev == MV88F5182_DEV_ID)
-               platform_device_register(&orion_ehci1);
-       platform_device_register(&orion_i2c);
+               platform_device_register(&orion5x_ehci1);
+       platform_device_register(&orion5x_i2c);
 }
 
 /*
diff --git a/arch/arm/mach-orion5x/common.h b/arch/arm/mach-orion5x/common.h
new file mode 100644 (file)
index 0000000..f4c4c9a
--- /dev/null
@@ -0,0 +1,72 @@
+#ifndef __ARCH_ORION5X_COMMON_H
+#define __ARCH_ORION5X_COMMON_H
+
+/*
+ * Basic Orion init functions used early by machine-setup.
+ */
+
+void orion5x_map_io(void);
+void orion5x_init_irq(void);
+void orion5x_init(void);
+extern struct sys_timer orion5x_timer;
+
+/*
+ * Enumerations and functions for Orion windows mapping. Used by Orion core
+ * functions to map its interfaces and by the machine-setup to map its on-
+ * board devices. Details in /mach-orion/addr-map.c
+ */
+extern struct mbus_dram_target_info orion5x_mbus_dram_info;
+void orion5x_setup_cpu_mbus_bridge(void);
+void orion5x_setup_dev_boot_win(u32 base, u32 size);
+void orion5x_setup_dev0_win(u32 base, u32 size);
+void orion5x_setup_dev1_win(u32 base, u32 size);
+void orion5x_setup_dev2_win(u32 base, u32 size);
+void orion5x_setup_pcie_wa_win(u32 base, u32 size);
+void orion5x_setup_eth_wins(void);
+
+/*
+ * Shared code used internally by other Orion core functions.
+ * (/mach-orion/pci.c)
+ */
+
+struct pci_sys_data;
+struct pci_bus;
+
+void orion5x_pcie_id(u32 *dev, u32 *rev);
+int orion5x_pcie_local_bus_nr(void);
+int orion5x_pci_local_bus_nr(void);
+int orion5x_pci_sys_setup(int nr, struct pci_sys_data *sys);
+struct pci_bus *orion5x_pci_sys_scan_bus(int nr, struct pci_sys_data *sys);
+
+/*
+ * Valid GPIO pins according to MPP setup, used by machine-setup.
+ * (/mach-orion/gpio.c).
+ */
+
+void orion5x_gpio_set_valid_pins(u32 pins);
+void gpio_display(void);       /* debug */
+
+/*
+ * Pull in Orion Ethernet platform_data, used by machine-setup
+ */
+
+struct mv643xx_eth_platform_data;
+
+void orion5x_eth_init(struct mv643xx_eth_platform_data *eth_data);
+
+/*
+ * Orion Sata platform_data, used by machine-setup
+ */
+
+struct mv_sata_platform_data;
+
+void orion5x_sata_init(struct mv_sata_platform_data *sata_data);
+
+struct machine_desc;
+struct meminfo;
+struct tag;
+extern void __init tag_fixup_mem32(struct machine_desc *, struct tag *,
+                                  char **, struct meminfo *);
+
+
+#endif
similarity index 88%
rename from arch/arm/mach-orion/db88f5281-setup.c
rename to arch/arm/mach-orion5x/db88f5281-setup.c
index 5ef44e1a2d36cb1882b84c32def55b6f05deb940..872aed372327de33c6aa481bf74f753b20328ba1 100644 (file)
@@ -1,12 +1,12 @@
 /*
- * arch/arm/mach-orion/db88f5281-setup.c
+ * arch/arm/mach-orion5x/db88f5281-setup.c
  *
  * Marvell Orion-2 Development Board Setup
  *
  * Maintainer: Tzachi Perelstein <tzachi@marvell.com>
  *
- * This file is licensed under  the terms of the GNU General Public
- * License version 2. This program is licensed "as is" without any
+ * This file is licensed under the terms of the GNU General Public
+ * License version 2.  This program is licensed "as is" without any
  * warranty of any kind, whether express or implied.
  */
 
@@ -24,8 +24,8 @@
 #include <asm/gpio.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/pci.h>
-#include <asm/arch/orion.h>
-#include <asm/arch/platform.h>
+#include <asm/arch/orion5x.h>
+#include <asm/plat-orion/orion_nand.h>
 #include "common.h"
 
 /*****************************************************************************
@@ -244,8 +244,8 @@ static int __init db88f5281_pci_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
        /*
         * PCIE IRQ is connected internally (not GPIO)
         */
-       if (dev->bus->number == orion_pcie_local_bus_nr())
-               return IRQ_ORION_PCIE0_INT;
+       if (dev->bus->number == orion5x_pcie_local_bus_nr())
+               return IRQ_ORION5X_PCIE0_INT;
 
        /*
         * PCI IRQs are connected via GPIOs
@@ -265,8 +265,8 @@ static struct hw_pci db88f5281_pci __initdata = {
        .nr_controllers = 2,
        .preinit        = db88f5281_pci_preinit,
        .swizzle        = pci_std_swizzle,
-       .setup          = orion_pci_sys_setup,
-       .scan           = orion_pci_sys_scan_bus,
+       .setup          = orion5x_pci_sys_setup,
+       .scan           = orion5x_pci_sys_scan_bus,
        .map_irq        = db88f5281_pci_map_irq,
 };
 
@@ -312,19 +312,16 @@ static void __init db88f5281_init(void)
        /*
         * Basic Orion setup. Need to be called early.
         */
-       orion_init();
+       orion5x_init();
 
        /*
         * Setup the CPU address decode windows for our on-board devices
         */
-       orion_setup_cpu_win(ORION_DEV_BOOT, DB88F5281_NOR_BOOT_BASE,
-                               DB88F5281_NOR_BOOT_SIZE, -1);
-       orion_setup_cpu_win(ORION_DEV0, DB88F5281_7SEG_BASE,
-                               DB88F5281_7SEG_SIZE, -1);
-       orion_setup_cpu_win(ORION_DEV1, DB88F5281_NOR_BASE,
-                               DB88F5281_NOR_SIZE, -1);
-       orion_setup_cpu_win(ORION_DEV2, DB88F5281_NAND_BASE,
-                               DB88F5281_NAND_SIZE, -1);
+       orion5x_setup_dev_boot_win(DB88F5281_NOR_BOOT_BASE,
+                               DB88F5281_NOR_BOOT_SIZE);
+       orion5x_setup_dev0_win(DB88F5281_7SEG_BASE, DB88F5281_7SEG_SIZE);
+       orion5x_setup_dev1_win(DB88F5281_NOR_BASE, DB88F5281_NOR_SIZE);
+       orion5x_setup_dev2_win(DB88F5281_NAND_BASE, DB88F5281_NAND_SIZE);
 
        /*
         * Setup Multiplexing Pins:
@@ -340,25 +337,25 @@ static void __init db88f5281_init(void)
         * MPP18: UART1_CTS                     MPP19: UART1_RTS
         * MPP-DEV: DEV_D[16:31]
         */
-       orion_write(MPP_0_7_CTRL, 0x00222203);
-       orion_write(MPP_8_15_CTRL, 0x44000000);
-       orion_write(MPP_16_19_CTRL, 0);
-       orion_write(MPP_DEV_CTRL, 0);
+       orion5x_write(MPP_0_7_CTRL, 0x00222203);
+       orion5x_write(MPP_8_15_CTRL, 0x44000000);
+       orion5x_write(MPP_16_19_CTRL, 0);
+       orion5x_write(MPP_DEV_CTRL, 0);
 
-       orion_gpio_set_valid_pins(0x00003fc3);
+       orion5x_gpio_set_valid_pins(0x00003fc3);
 
        platform_add_devices(db88f5281_devs, ARRAY_SIZE(db88f5281_devs));
        i2c_register_board_info(0, &db88f5281_i2c_rtc, 1);
-       orion_eth_init(&db88f5281_eth_data);
+       orion5x_eth_init(&db88f5281_eth_data);
 }
 
 MACHINE_START(DB88F5281, "Marvell Orion-2 Development Board")
        /* Maintainer: Tzachi Perelstein <tzachi@marvell.com> */
-       .phys_io        = ORION_REGS_PHYS_BASE,
-       .io_pg_offst    = ((ORION_REGS_VIRT_BASE) >> 18) & 0xfffc,
+       .phys_io        = ORION5X_REGS_PHYS_BASE,
+       .io_pg_offst    = ((ORION5X_REGS_VIRT_BASE) >> 18) & 0xfffc,
        .boot_params    = 0x00000100,
        .init_machine   = db88f5281_init,
-       .map_io         = orion_map_io,
-       .init_irq       = orion_init_irq,
-       .timer          = &orion_timer,
+       .map_io         = orion5x_map_io,
+       .init_irq       = orion5x_init_irq,
+       .timer          = &orion5x_timer,
 MACHINE_END
similarity index 89%
rename from arch/arm/mach-orion/dns323-setup.c
rename to arch/arm/mach-orion5x/dns323-setup.c
index 076e155ad5106106980f6ea05ef93762d986a4c7..d67790ef236e13863c20c53b8b24412a0555c2dd 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * arch/arm/mach-orion/dns323-setup.c
+ * arch/arm/mach-orion5x/dns323-setup.c
  *
  * Copyright (C) 2007 Herbert Valerio Riedel <hvr@gnu.org>
  *
@@ -25,8 +25,7 @@
 #include <asm/gpio.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/pci.h>
-#include <asm/arch/orion.h>
-#include <asm/arch/platform.h>
+#include <asm/arch/orion5x.h>
 #include "common.h"
 
 #define DNS323_GPIO_LED_RIGHT_AMBER    1
@@ -45,8 +44,8 @@
 static int __init dns323_pci_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
 {
        /* PCI-E */
-       if (dev->bus->number == orion_pcie_local_bus_nr())
-               return IRQ_ORION_PCIE0_INT;
+       if (dev->bus->number == orion5x_pcie_local_bus_nr())
+               return IRQ_ORION5X_PCIE0_INT;
 
        pr_err("%s: requested mapping for unknown bus\n", __func__);
 
@@ -56,8 +55,8 @@ static int __init dns323_pci_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
 static struct hw_pci dns323_pci __initdata = {
        .nr_controllers = 1,
        .swizzle        = pci_std_swizzle,
-       .setup          = orion_pci_sys_setup,
-       .scan           = orion_pci_sys_scan_bus,
+       .setup          = orion5x_pci_sys_setup,
+       .scan           = orion5x_pci_sys_scan_bus,
        .map_irq        = dns323_pci_map_irq,
 };
 
@@ -247,27 +246,25 @@ static void dns323_power_off(void)
 static void __init dns323_init(void)
 {
        /* Setup basic Orion functions. Need to be called early. */
-       orion_init();
+       orion5x_init();
 
        /* setup flash mapping
         * CS3 holds a 8 MB Spansion S29GL064M90TFIR4
         */
-       orion_setup_cpu_win(ORION_DEV_BOOT, DNS323_NOR_BOOT_BASE,
-                           DNS323_NOR_BOOT_SIZE, -1);
+       orion5x_setup_dev_boot_win(DNS323_NOR_BOOT_BASE, DNS323_NOR_BOOT_SIZE);
 
        /* DNS-323 has a Marvell 88X7042 SATA controller attached via PCIE
         *
         * Open a special address decode windows for the PCIE WA.
         */
-       orion_write(ORION_REGS_VIRT_BASE | 0x20074, ORION_PCIE_WA_PHYS_BASE);
-       orion_write(ORION_REGS_VIRT_BASE | 0x20070,
-                   (0x7941 | (((ORION_PCIE_WA_SIZE >> 16) - 1)) << 16));
+       orion5x_setup_pcie_wa_win(ORION5X_PCIE_WA_PHYS_BASE,
+                               ORION5X_PCIE_WA_SIZE);
 
        /* set MPP to 0 as D-Link's 2.6.12.6 kernel did */
-       orion_write(MPP_0_7_CTRL, 0);
-       orion_write(MPP_8_15_CTRL, 0);
-       orion_write(MPP_16_19_CTRL, 0);
-       orion_write(MPP_DEV_CTRL, 0);
+       orion5x_write(MPP_0_7_CTRL, 0);
+       orion5x_write(MPP_8_15_CTRL, 0);
+       orion5x_write(MPP_16_19_CTRL, 0);
+       orion5x_write(MPP_DEV_CTRL, 0);
 
        /* Define used GPIO pins
 
@@ -290,7 +287,7 @@ static void __init dns323_init(void)
          | 14 | Out | //unknown//
          | 15 | Out | //unknown//
        */
-       orion_gpio_set_valid_pins(0x07f6);
+       orion5x_gpio_set_valid_pins(0x07f6);
 
        /* register dns323 specific power-off method */
        if ((gpio_request(DNS323_GPIO_POWER_OFF, "POWEROFF") != 0)
@@ -306,18 +303,18 @@ static void __init dns323_init(void)
        i2c_register_board_info(0, dns323_i2c_devices,
                                ARRAY_SIZE(dns323_i2c_devices));
 
-       orion_eth_init(&dns323_eth_data);
+       orion5x_eth_init(&dns323_eth_data);
 }
 
 /* Warning: D-Link uses a wrong mach-type (=526) in their bootloader */
 MACHINE_START(DNS323, "D-Link DNS-323")
        /* Maintainer: Herbert Valerio Riedel <hvr@gnu.org> */
-       .phys_io        = ORION_REGS_PHYS_BASE,
-       .io_pg_offst    = ((ORION_REGS_VIRT_BASE) >> 18) & 0xFFFC,
+       .phys_io        = ORION5X_REGS_PHYS_BASE,
+       .io_pg_offst    = ((ORION5X_REGS_VIRT_BASE) >> 18) & 0xFFFC,
        .boot_params    = 0x00000100,
        .init_machine   = dns323_init,
-       .map_io         = orion_map_io,
-       .init_irq       = orion_init_irq,
-       .timer          = &orion_timer,
+       .map_io         = orion5x_map_io,
+       .init_irq       = orion5x_init_irq,
+       .timer          = &orion5x_timer,
        .fixup          = tag_fixup_mem32,
 MACHINE_END
similarity index 68%
rename from arch/arm/mach-orion/gpio.c
rename to arch/arm/mach-orion5x/gpio.c
index f713818c66a3dd3814f45c44fe31f02fa7e5dc64..8108c316c426e2585c2b94a23879b60ab61e2c7c 100644 (file)
@@ -1,12 +1,12 @@
 /*
- * arch/arm/mach-orion/gpio.c
+ * arch/arm/mach-orion5x/gpio.c
  *
  * GPIO functions for Marvell Orion System On Chip
  *
  * Maintainer: Tzachi Perelstein <tzachi@marvell.com>
  *
- * This file is licensed under  the terms of the GNU General Public
- * License version 2. This program is licensed "as is" without any
+ * This file is licensed under the terms of the GNU General Public
+ * License version 2.  This program is licensed "as is" without any
  * warranty of any kind, whether express or implied.
  */
 
 #include <linux/spinlock.h>
 #include <linux/bitops.h>
 #include <asm/gpio.h>
-#include <asm/arch/orion.h>
+#include <asm/io.h>
+#include <asm/arch/orion5x.h>
 #include "common.h"
 
 static DEFINE_SPINLOCK(gpio_lock);
 static unsigned long gpio_valid[BITS_TO_LONGS(GPIO_MAX)];
 static const char *gpio_label[GPIO_MAX];  /* non null for allocated GPIOs */
 
-void __init orion_gpio_set_valid_pins(u32 pins)
+void __init orion5x_gpio_set_valid_pins(u32 pins)
 {
        gpio_valid[0] = pins;
 }
@@ -49,7 +50,7 @@ int gpio_direction_input(unsigned pin)
        if (!gpio_label[pin])
                gpio_label[pin] = "?";
 
-       orion_setbits(GPIO_IO_CONF, 1 << pin);
+       orion5x_setbits(GPIO_IO_CONF, 1 << pin);
 
        spin_unlock_irqrestore(&gpio_lock, flags);
        return 0;
@@ -76,12 +77,12 @@ int gpio_direction_output(unsigned pin, int value)
                gpio_label[pin] = "?";
 
        mask = 1 << pin;
-       orion_clrbits(GPIO_BLINK_EN, mask);
+       orion5x_clrbits(GPIO_BLINK_EN, mask);
        if (value)
-               orion_setbits(GPIO_OUT, mask);
+               orion5x_setbits(GPIO_OUT, mask);
        else
-               orion_clrbits(GPIO_OUT, mask);
-       orion_clrbits(GPIO_IO_CONF, mask);
+               orion5x_clrbits(GPIO_OUT, mask);
+       orion5x_clrbits(GPIO_IO_CONF, mask);
 
        spin_unlock_irqrestore(&gpio_lock, flags);
        return 0;
@@ -92,10 +93,10 @@ int gpio_get_value(unsigned pin)
 {
        int val, mask = 1 << pin;
 
-       if (orion_read(GPIO_IO_CONF) & mask)
-               val = orion_read(GPIO_DATA_IN) ^ orion_read(GPIO_IN_POL);
+       if (orion5x_read(GPIO_IO_CONF) & mask)
+               val = orion5x_read(GPIO_DATA_IN) ^ orion5x_read(GPIO_IN_POL);
        else
-               val = orion_read(GPIO_OUT);
+               val = orion5x_read(GPIO_OUT);
 
        return val & mask;
 }
@@ -108,32 +109,32 @@ void gpio_set_value(unsigned pin, int value)
 
        spin_lock_irqsave(&gpio_lock, flags);
 
-       orion_clrbits(GPIO_BLINK_EN, mask);
+       orion5x_clrbits(GPIO_BLINK_EN, mask);
        if (value)
-               orion_setbits(GPIO_OUT, mask);
+               orion5x_setbits(GPIO_OUT, mask);
        else
-               orion_clrbits(GPIO_OUT, mask);
+               orion5x_clrbits(GPIO_OUT, mask);
 
        spin_unlock_irqrestore(&gpio_lock, flags);
 }
 EXPORT_SYMBOL(gpio_set_value);
 
-void orion_gpio_set_blink(unsigned pin, int blink)
+void orion5x_gpio_set_blink(unsigned pin, int blink)
 {
        unsigned long flags;
        int mask = 1 << pin;
 
        spin_lock_irqsave(&gpio_lock, flags);
 
-       orion_clrbits(GPIO_OUT, mask);
+       orion5x_clrbits(GPIO_OUT, mask);
        if (blink)
-               orion_setbits(GPIO_BLINK_EN, mask);
+               orion5x_setbits(GPIO_BLINK_EN, mask);
        else
-               orion_clrbits(GPIO_BLINK_EN, mask);
+               orion5x_clrbits(GPIO_BLINK_EN, mask);
 
        spin_unlock_irqrestore(&gpio_lock, flags);
 }
-EXPORT_SYMBOL(orion_gpio_set_blink);
+EXPORT_SYMBOL(orion5x_gpio_set_blink);
 
 int gpio_request(unsigned pin, const char *label)
 {
@@ -187,39 +188,39 @@ void gpio_display(void)
                        printk("GPIO, free\n");
                } else {
                        printk("GPIO, used by %s, ", gpio_label[i]);
-                       if (orion_read(GPIO_IO_CONF) & (1 << i)) {
+                       if (orion5x_read(GPIO_IO_CONF) & (1 << i)) {
                                printk("input, active %s, level %s, edge %s\n",
-                               ((orion_read(GPIO_IN_POL) >> i) & 1) ? "low" : "high",
-                               ((orion_read(GPIO_LEVEL_MASK) >> i) & 1) ? "enabled" : "masked",
-                               ((orion_read(GPIO_EDGE_MASK) >> i) & 1) ? "enabled" : "masked");
+                               ((orion5x_read(GPIO_IN_POL) >> i) & 1) ? "low" : "high",
+                               ((orion5x_read(GPIO_LEVEL_MASK) >> i) & 1) ? "enabled" : "masked",
+                               ((orion5x_read(GPIO_EDGE_MASK) >> i) & 1) ? "enabled" : "masked");
                        } else {
-                               printk("output, val=%d\n", (orion_read(GPIO_OUT) >> i) & 1);
+                               printk("output, val=%d\n", (orion5x_read(GPIO_OUT) >> i) & 1);
                        }
                }
        }
 
        printk(KERN_DEBUG "MPP_0_7_CTRL (0x%08x) = 0x%08x\n",
-                               MPP_0_7_CTRL, orion_read(MPP_0_7_CTRL));
+                               MPP_0_7_CTRL, orion5x_read(MPP_0_7_CTRL));
        printk(KERN_DEBUG "MPP_8_15_CTRL (0x%08x) = 0x%08x\n",
-                               MPP_8_15_CTRL, orion_read(MPP_8_15_CTRL));
+                               MPP_8_15_CTRL, orion5x_read(MPP_8_15_CTRL));
        printk(KERN_DEBUG "MPP_16_19_CTRL (0x%08x) = 0x%08x\n",
-                               MPP_16_19_CTRL, orion_read(MPP_16_19_CTRL));
+                               MPP_16_19_CTRL, orion5x_read(MPP_16_19_CTRL));
        printk(KERN_DEBUG "MPP_DEV_CTRL (0x%08x) = 0x%08x\n",
-                               MPP_DEV_CTRL, orion_read(MPP_DEV_CTRL));
+                               MPP_DEV_CTRL, orion5x_read(MPP_DEV_CTRL));
        printk(KERN_DEBUG "GPIO_OUT (0x%08x) = 0x%08x\n",
-                               GPIO_OUT, orion_read(GPIO_OUT));
+                               GPIO_OUT, orion5x_read(GPIO_OUT));
        printk(KERN_DEBUG "GPIO_IO_CONF (0x%08x) = 0x%08x\n",
-                               GPIO_IO_CONF, orion_read(GPIO_IO_CONF));
+                               GPIO_IO_CONF, orion5x_read(GPIO_IO_CONF));
        printk(KERN_DEBUG "GPIO_BLINK_EN (0x%08x) = 0x%08x\n",
-                               GPIO_BLINK_EN, orion_read(GPIO_BLINK_EN));
+                               GPIO_BLINK_EN, orion5x_read(GPIO_BLINK_EN));
        printk(KERN_DEBUG "GPIO_IN_POL (0x%08x) = 0x%08x\n",
-                               GPIO_IN_POL, orion_read(GPIO_IN_POL));
+                               GPIO_IN_POL, orion5x_read(GPIO_IN_POL));
        printk(KERN_DEBUG "GPIO_DATA_IN (0x%08x) = 0x%08x\n",
-                               GPIO_DATA_IN, orion_read(GPIO_DATA_IN));
+                               GPIO_DATA_IN, orion5x_read(GPIO_DATA_IN));
        printk(KERN_DEBUG "GPIO_LEVEL_MASK (0x%08x) = 0x%08x\n",
-                               GPIO_LEVEL_MASK, orion_read(GPIO_LEVEL_MASK));
+                               GPIO_LEVEL_MASK, orion5x_read(GPIO_LEVEL_MASK));
        printk(KERN_DEBUG "GPIO_EDGE_CAUSE (0x%08x) = 0x%08x\n",
-                               GPIO_EDGE_CAUSE, orion_read(GPIO_EDGE_CAUSE));
+                               GPIO_EDGE_CAUSE, orion5x_read(GPIO_EDGE_CAUSE));
        printk(KERN_DEBUG "GPIO_EDGE_MASK (0x%08x) = 0x%08x\n",
-                               GPIO_EDGE_MASK, orion_read(GPIO_EDGE_MASK));
+                               GPIO_EDGE_MASK, orion5x_read(GPIO_EDGE_MASK));
 }
similarity index 55%
rename from arch/arm/mach-orion/irq.c
rename to arch/arm/mach-orion5x/irq.c
index df7e12ad378be535d5e13082548d4a059d7c29aa..dd21f38c5d372e111aa74bcdc8a6d94474d69ddf 100644 (file)
@@ -1,12 +1,12 @@
 /*
- * arch/arm/mach-orion/irq.c
+ * arch/arm/mach-orion5x/irq.c
  *
  * Core IRQ functions for Marvell Orion System On Chip
  *
  * Maintainer: Tzachi Perelstein <tzachi@marvell.com>
  *
  * This file is licensed under the terms of the GNU General Public
- * License version 2. This program is licensed "as is" without any
+ * License version 2.  This program is licensed "as is" without any
  * warranty of any kind, whether express or implied.
  */
 
@@ -14,7 +14,9 @@
 #include <linux/init.h>
 #include <linux/irq.h>
 #include <asm/gpio.h>
-#include <asm/arch/orion.h>
+#include <asm/io.h>
+#include <asm/arch/orion5x.h>
+#include <asm/plat-orion/irq.h>
 #include "common.h"
 
 /*****************************************************************************
  *        polarity    LEVEL          mask
  *
  ****************************************************************************/
-static void orion_gpio_irq_ack(u32 irq)
+static void orion5x_gpio_irq_ack(u32 irq)
 {
        int pin = irq_to_gpio(irq);
        if (irq_desc[irq].status & IRQ_LEVEL)
                /*
                 * Mask bit for level interrupt
                 */
-               orion_clrbits(GPIO_LEVEL_MASK, 1 << pin);
+               orion5x_clrbits(GPIO_LEVEL_MASK, 1 << pin);
        else
                /*
                 * Clear casue bit for egde interrupt
                 */
-               orion_clrbits(GPIO_EDGE_CAUSE, 1 << pin);
+               orion5x_clrbits(GPIO_EDGE_CAUSE, 1 << pin);
 }
 
-static void orion_gpio_irq_mask(u32 irq)
+static void orion5x_gpio_irq_mask(u32 irq)
 {
        int pin = irq_to_gpio(irq);
        if (irq_desc[irq].status & IRQ_LEVEL)
-               orion_clrbits(GPIO_LEVEL_MASK, 1 << pin);
+               orion5x_clrbits(GPIO_LEVEL_MASK, 1 << pin);
        else
-               orion_clrbits(GPIO_EDGE_MASK, 1 << pin);
+               orion5x_clrbits(GPIO_EDGE_MASK, 1 << pin);
 }
 
-static void orion_gpio_irq_unmask(u32 irq)
+static void orion5x_gpio_irq_unmask(u32 irq)
 {
        int pin = irq_to_gpio(irq);
        if (irq_desc[irq].status & IRQ_LEVEL)
-               orion_setbits(GPIO_LEVEL_MASK, 1 << pin);
+               orion5x_setbits(GPIO_LEVEL_MASK, 1 << pin);
        else
-               orion_setbits(GPIO_EDGE_MASK, 1 << pin);
+               orion5x_setbits(GPIO_EDGE_MASK, 1 << pin);
 }
 
-static int orion_gpio_set_irq_type(u32 irq, u32 type)
+static int orion5x_gpio_set_irq_type(u32 irq, u32 type)
 {
        int pin = irq_to_gpio(irq);
        struct irq_desc *desc;
 
-       if ((orion_read(GPIO_IO_CONF) & (1 << pin)) == 0) {
-               printk(KERN_ERR "orion_gpio_set_irq_type failed "
+       if ((orion5x_read(GPIO_IO_CONF) & (1 << pin)) == 0) {
+               printk(KERN_ERR "orion5x_gpio_set_irq_type failed "
                                "(irq %d, pin %d).\n", irq, pin);
                return -EINVAL;
        }
@@ -92,22 +94,22 @@ static int orion_gpio_set_irq_type(u32 irq, u32 type)
        case IRQT_HIGH:
                desc->handle_irq = handle_level_irq;
                desc->status |= IRQ_LEVEL;
-               orion_clrbits(GPIO_IN_POL, (1 << pin));
+               orion5x_clrbits(GPIO_IN_POL, (1 << pin));
                break;
        case IRQT_LOW:
                desc->handle_irq = handle_level_irq;
                desc->status |= IRQ_LEVEL;
-               orion_setbits(GPIO_IN_POL, (1 << pin));
+               orion5x_setbits(GPIO_IN_POL, (1 << pin));
                break;
        case IRQT_RISING:
                desc->handle_irq = handle_edge_irq;
                desc->status &= ~IRQ_LEVEL;
-               orion_clrbits(GPIO_IN_POL, (1 << pin));
+               orion5x_clrbits(GPIO_IN_POL, (1 << pin));
                break;
        case IRQT_FALLING:
                desc->handle_irq = handle_edge_irq;
                desc->status &= ~IRQ_LEVEL;
-               orion_setbits(GPIO_IN_POL, (1 << pin));
+               orion5x_setbits(GPIO_IN_POL, (1 << pin));
                break;
        case IRQT_BOTHEDGE:
                desc->handle_irq = handle_edge_irq;
@@ -115,11 +117,11 @@ static int orion_gpio_set_irq_type(u32 irq, u32 type)
                /*
                 * set initial polarity based on current input level
                 */
-               if ((orion_read(GPIO_IN_POL) ^ orion_read(GPIO_DATA_IN))
+               if ((orion5x_read(GPIO_IN_POL) ^ orion5x_read(GPIO_DATA_IN))
                    & (1 << pin))
-                       orion_setbits(GPIO_IN_POL, (1 << pin)); /* falling */
+                       orion5x_setbits(GPIO_IN_POL, (1 << pin)); /* falling */
                else
-                       orion_clrbits(GPIO_IN_POL, (1 << pin)); /* rising */
+                       orion5x_clrbits(GPIO_IN_POL, (1 << pin)); /* rising */
 
                break;
        default:
@@ -133,22 +135,22 @@ static int orion_gpio_set_irq_type(u32 irq, u32 type)
        return 0;
 }
 
-static struct irq_chip orion_gpio_irq_chip = {
+static struct irq_chip orion5x_gpio_irq_chip = {
        .name           = "Orion-IRQ-GPIO",
-       .ack            = orion_gpio_irq_ack,
-       .mask           = orion_gpio_irq_mask,
-       .unmask         = orion_gpio_irq_unmask,
-       .set_type       = orion_gpio_set_irq_type,
+       .ack            = orion5x_gpio_irq_ack,
+       .mask           = orion5x_gpio_irq_mask,
+       .unmask         = orion5x_gpio_irq_unmask,
+       .set_type       = orion5x_gpio_set_irq_type,
 };
 
-static void orion_gpio_irq_handler(unsigned int irq, struct irq_desc *desc)
+static void orion5x_gpio_irq_handler(unsigned int irq, struct irq_desc *desc)
 {
        u32 cause, offs, pin;
 
-       BUG_ON(irq < IRQ_ORION_GPIO_0_7 || irq > IRQ_ORION_GPIO_24_31);
-       offs = (irq - IRQ_ORION_GPIO_0_7) * 8;
-       cause = (orion_read(GPIO_DATA_IN) & orion_read(GPIO_LEVEL_MASK)) |
-               (orion_read(GPIO_EDGE_CAUSE) & orion_read(GPIO_EDGE_MASK));
+       BUG_ON(irq < IRQ_ORION5X_GPIO_0_7 || irq > IRQ_ORION5X_GPIO_24_31);
+       offs = (irq - IRQ_ORION5X_GPIO_0_7) * 8;
+       cause = (orion5x_read(GPIO_DATA_IN) & orion5x_read(GPIO_LEVEL_MASK)) |
+               (orion5x_read(GPIO_EDGE_CAUSE) & orion5x_read(GPIO_EDGE_MASK));
 
        for (pin = offs; pin < offs + 8; pin++) {
                if (cause & (1 << pin)) {
@@ -156,16 +158,16 @@ static void orion_gpio_irq_handler(unsigned int irq, struct irq_desc *desc)
                        desc = irq_desc + irq;
                        if ((desc->status & IRQ_TYPE_SENSE_MASK) == IRQT_BOTHEDGE) {
                                /* Swap polarity (race with GPIO line) */
-                               u32 polarity = orion_read(GPIO_IN_POL);
+                               u32 polarity = orion5x_read(GPIO_IN_POL);
                                polarity ^= 1 << pin;
-                               orion_write(GPIO_IN_POL, polarity);
+                               orion5x_write(GPIO_IN_POL, polarity);
                        }
                        desc_handle_irq(irq, desc);
                }
        }
 }
 
-static void __init orion_init_gpio_irq(void)
+static void __init orion5x_init_gpio_irq(void)
 {
        int i;
        struct irq_desc *desc;
@@ -173,69 +175,37 @@ static void __init orion_init_gpio_irq(void)
        /*
         * Mask and clear GPIO IRQ interrupts
         */
-       orion_write(GPIO_LEVEL_MASK, 0x0);
-       orion_write(GPIO_EDGE_MASK, 0x0);
-       orion_write(GPIO_EDGE_CAUSE, 0x0);
+       orion5x_write(GPIO_LEVEL_MASK, 0x0);
+       orion5x_write(GPIO_EDGE_MASK, 0x0);
+       orion5x_write(GPIO_EDGE_CAUSE, 0x0);
 
        /*
         * Register chained level handlers for GPIO IRQs by default.
         * User can use set_type() if he wants to use edge types handlers.
         */
-       for (i = IRQ_ORION_GPIO_START; i < NR_IRQS; i++) {
-               set_irq_chip(i, &orion_gpio_irq_chip);
+       for (i = IRQ_ORION5X_GPIO_START; i < NR_IRQS; i++) {
+               set_irq_chip(i, &orion5x_gpio_irq_chip);
                set_irq_handler(i, handle_level_irq);
                desc = irq_desc + i;
                desc->status |= IRQ_LEVEL;
                set_irq_flags(i, IRQF_VALID);
        }
-       set_irq_chained_handler(IRQ_ORION_GPIO_0_7, orion_gpio_irq_handler);
-       set_irq_chained_handler(IRQ_ORION_GPIO_8_15, orion_gpio_irq_handler);
-       set_irq_chained_handler(IRQ_ORION_GPIO_16_23, orion_gpio_irq_handler);
-       set_irq_chained_handler(IRQ_ORION_GPIO_24_31, orion_gpio_irq_handler);
+       set_irq_chained_handler(IRQ_ORION5X_GPIO_0_7, orion5x_gpio_irq_handler);
+       set_irq_chained_handler(IRQ_ORION5X_GPIO_8_15, orion5x_gpio_irq_handler);
+       set_irq_chained_handler(IRQ_ORION5X_GPIO_16_23, orion5x_gpio_irq_handler);
+       set_irq_chained_handler(IRQ_ORION5X_GPIO_24_31, orion5x_gpio_irq_handler);
 }
 
 /*****************************************************************************
  * Orion Main IRQ
  ****************************************************************************/
-static void orion_main_irq_mask(u32 irq)
+static void __init orion5x_init_main_irq(void)
 {
-       orion_clrbits(MAIN_IRQ_MASK, 1 << irq);
+       orion_irq_init(0, (void __iomem *)MAIN_IRQ_MASK);
 }
 
-static void orion_main_irq_unmask(u32 irq)
+void __init orion5x_init_irq(void)
 {
-       orion_setbits(MAIN_IRQ_MASK, 1 << irq);
-}
-
-static struct irq_chip orion_main_irq_chip = {
-       .name           = "Orion-IRQ-Main",
-       .ack            = orion_main_irq_mask,
-       .mask           = orion_main_irq_mask,
-       .unmask         = orion_main_irq_unmask,
-};
-
-static void __init orion_init_main_irq(void)
-{
-       int i;
-
-       /*
-        * Mask and clear Main IRQ interrupts
-        */
-       orion_write(MAIN_IRQ_MASK, 0x0);
-       orion_write(MAIN_IRQ_CAUSE, 0x0);
-
-       /*
-        * Register level handler for Main IRQs
-        */
-       for (i = 0; i < IRQ_ORION_GPIO_START; i++) {
-               set_irq_chip(i, &orion_main_irq_chip);
-               set_irq_handler(i, handle_level_irq);
-               set_irq_flags(i, IRQF_VALID);
-       }
-}
-
-void __init orion_init_irq(void)
-{
-       orion_init_main_irq();
-       orion_init_gpio_irq();
+       orion5x_init_main_irq();
+       orion5x_init_gpio_irq();
 }
similarity index 75%
rename from arch/arm/mach-orion/kurobox_pro-setup.c
rename to arch/arm/mach-orion5x/kurobox_pro-setup.c
index 785a07bdf1e24681f63b28a0a603f43a2c89e00e..91413455beba0ca35f3f22d3ddad4b5d3b6f31ac 100644 (file)
@@ -1,10 +1,10 @@
 /*
- * arch/arm/mach-orion/kurobox_pro-setup.c
+ * arch/arm/mach-orion5x/kurobox_pro-setup.c
  *
  * Maintainer: Ronen Shitrit <rshitrit@marvell.com>
  *
- * This file is licensed under  the terms of the GNU General Public
- * License version 2. This program is licensed "as is" without any
+ * This file is licensed under the terms of the GNU General Public
+ * License version 2.  This program is licensed "as is" without any
  * warranty of any kind, whether express or implied.
  */
 
@@ -22,8 +22,8 @@
 #include <asm/gpio.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/pci.h>
-#include <asm/arch/orion.h>
-#include <asm/arch/platform.h>
+#include <asm/arch/orion5x.h>
+#include <asm/plat-orion/orion_nand.h>
 #include "common.h"
 
 /*****************************************************************************
@@ -123,8 +123,8 @@ static int __init kurobox_pro_pci_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
        /*
         * PCI isn't used on the Kuro
         */
-       if (dev->bus->number == orion_pcie_local_bus_nr())
-               return IRQ_ORION_PCIE0_INT;
+       if (dev->bus->number == orion5x_pcie_local_bus_nr())
+               return IRQ_ORION5X_PCIE0_INT;
        else
                printk(KERN_ERR "kurobox_pro_pci_map_irq failed, unknown bus\n");
 
@@ -134,8 +134,8 @@ static int __init kurobox_pro_pci_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
 static struct hw_pci kurobox_pro_pci __initdata = {
        .nr_controllers = 1,
        .swizzle        = pci_std_swizzle,
-       .setup          = orion_pci_sys_setup,
-       .scan           = orion_pci_sys_scan_bus,
+       .setup          = orion5x_pci_sys_setup,
+       .scan           = orion5x_pci_sys_scan_bus,
        .map_irq        = kurobox_pro_pci_map_irq,
 };
 
@@ -178,31 +178,25 @@ static struct mv_sata_platform_data kurobox_pro_sata_data = {
  * General Setup
  ****************************************************************************/
 
-static struct platform_device *kurobox_pro_devices[] __initdata = {
-       &kurobox_pro_nor_flash,
-       &kurobox_pro_nand_flash,
-};
-
 static void __init kurobox_pro_init(void)
 {
        /*
         * Setup basic Orion functions. Need to be called early.
         */
-       orion_init();
+       orion5x_init();
 
        /*
         * Setup the CPU address decode windows for our devices
         */
-       orion_setup_cpu_win(ORION_DEV_BOOT, KUROBOX_PRO_NOR_BOOT_BASE,
-                               KUROBOX_PRO_NOR_BOOT_SIZE, -1);
-       orion_setup_cpu_win(ORION_DEV0, KUROBOX_PRO_NAND_BASE,
-                               KUROBOX_PRO_NAND_SIZE, -1);
+       orion5x_setup_dev_boot_win(KUROBOX_PRO_NOR_BOOT_BASE,
+                               KUROBOX_PRO_NOR_BOOT_SIZE);
+       orion5x_setup_dev0_win(KUROBOX_PRO_NAND_BASE, KUROBOX_PRO_NAND_SIZE);
+
        /*
         * Open a special address decode windows for the PCIE WA.
         */
-       orion_write(ORION_REGS_VIRT_BASE | 0x20074, ORION_PCIE_WA_PHYS_BASE);
-       orion_write(ORION_REGS_VIRT_BASE | 0x20070, (0x7941 |
-               (((ORION_PCIE_WA_SIZE >> 16) - 1)) << 16));
+       orion5x_setup_pcie_wa_win(ORION5X_PCIE_WA_PHYS_BASE,
+                               ORION5X_PCIE_WA_SIZE);
 
        /*
         * Setup Multiplexing Pins --
@@ -219,26 +213,44 @@ static void __init kurobox_pro_init(void)
         * MPP[15] SATA 1 active indication
         * MPP[16-19] Not used
         */
-       orion_write(MPP_0_7_CTRL, 0x44220003);
-       orion_write(MPP_8_15_CTRL, 0x55550000);
-       orion_write(MPP_16_19_CTRL, 0x0);
+       orion5x_write(MPP_0_7_CTRL, 0x44220003);
+       orion5x_write(MPP_8_15_CTRL, 0x55550000);
+       orion5x_write(MPP_16_19_CTRL, 0x0);
 
-       orion_gpio_set_valid_pins(0x0000000c);
+       orion5x_gpio_set_valid_pins(0x0000000c);
 
-       platform_add_devices(kurobox_pro_devices, ARRAY_SIZE(kurobox_pro_devices));
+       platform_device_register(&kurobox_pro_nor_flash);
+       if (machine_is_kurobox_pro())
+               platform_device_register(&kurobox_pro_nand_flash);
        i2c_register_board_info(0, &kurobox_pro_i2c_rtc, 1);
-       orion_eth_init(&kurobox_pro_eth_data);
-       orion_sata_init(&kurobox_pro_sata_data);
+       orion5x_eth_init(&kurobox_pro_eth_data);
+       orion5x_sata_init(&kurobox_pro_sata_data);
 }
 
+#ifdef CONFIG_MACH_KUROBOX_PRO
 MACHINE_START(KUROBOX_PRO, "Buffalo/Revogear Kurobox Pro")
        /* Maintainer: Ronen Shitrit <rshitrit@marvell.com> */
-       .phys_io        = ORION_REGS_PHYS_BASE,
-       .io_pg_offst    = ((ORION_REGS_VIRT_BASE) >> 18) & 0xFFFC,
+       .phys_io        = ORION5X_REGS_PHYS_BASE,
+       .io_pg_offst    = ((ORION5X_REGS_VIRT_BASE) >> 18) & 0xFFFC,
+       .boot_params    = 0x00000100,
+       .init_machine   = kurobox_pro_init,
+       .map_io         = orion5x_map_io,
+       .init_irq       = orion5x_init_irq,
+       .timer          = &orion5x_timer,
+       .fixup          = tag_fixup_mem32,
+MACHINE_END
+#endif
+
+#ifdef CONFIG_MACH_LINKSTATION_PRO
+MACHINE_START(LINKSTATION_PRO, "Buffalo Linkstation Pro/Live")
+       /* Maintainer: Byron Bradley <byron.bbradley@gmail.com> */
+       .phys_io        = ORION5X_REGS_PHYS_BASE,
+       .io_pg_offst    = ((ORION5X_REGS_VIRT_BASE) >> 18) & 0xFFFC,
        .boot_params    = 0x00000100,
        .init_machine   = kurobox_pro_init,
-       .map_io         = orion_map_io,
-       .init_irq       = orion_init_irq,
-       .timer          = &orion_timer,
+       .map_io         = orion5x_map_io,
+       .init_irq       = orion5x_init_irq,
+       .timer          = &orion5x_timer,
        .fixup          = tag_fixup_mem32,
 MACHINE_END
+#endif
diff --git a/arch/arm/mach-orion5x/pci.c b/arch/arm/mach-orion5x/pci.c
new file mode 100644 (file)
index 0000000..fdf99fc
--- /dev/null
@@ -0,0 +1,559 @@
+/*
+ * arch/arm/mach-orion5x/pci.c
+ *
+ * PCI and PCIe functions for Marvell Orion System On Chip
+ *
+ * Maintainer: Tzachi Perelstein <tzachi@marvell.com>
+ *
+ * This file is licensed under the terms of the GNU General Public
+ * License version 2.  This program is licensed "as is" without any
+ * warranty of any kind, whether express or implied.
+ */
+
+#include <linux/kernel.h>
+#include <linux/pci.h>
+#include <linux/mbus.h>
+#include <asm/mach/pci.h>
+#include <asm/plat-orion/pcie.h>
+#include "common.h"
+
+/*****************************************************************************
+ * Orion has one PCIe controller and one PCI controller.
+ *
+ * Note1: The local PCIe bus number is '0'. The local PCI bus number
+ * follows the scanned PCIe bridged busses, if any.
+ *
+ * Note2: It is possible for PCI/PCIe agents to access many subsystem's
+ * space, by configuring BARs and Address Decode Windows, e.g. flashes on
+ * device bus, Orion registers, etc. However this code only enable the
+ * access to DDR banks.
+ ****************************************************************************/
+
+
+/*****************************************************************************
+ * PCIe controller
+ ****************************************************************************/
+#define PCIE_BASE      ((void __iomem *)ORION5X_PCIE_VIRT_BASE)
+
+void __init orion5x_pcie_id(u32 *dev, u32 *rev)
+{
+       *dev = orion_pcie_dev_id(PCIE_BASE);
+       *rev = orion_pcie_rev(PCIE_BASE);
+}
+
+int __init orion5x_pcie_local_bus_nr(void)
+{
+       return orion_pcie_get_local_bus_nr(PCIE_BASE);
+}
+
+static int pcie_valid_config(int bus, int dev)
+{
+       /*
+        * Don't go out when trying to access --
+        * 1. nonexisting device on local bus
+        * 2. where there's no device connected (no link)
+        */
+       if (bus == 0 && dev == 0)
+               return 1;
+
+       if (!orion_pcie_link_up(PCIE_BASE))
+               return 0;
+
+       if (bus == 0 && dev != 1)
+               return 0;
+
+       return 1;
+}
+
+
+/*
+ * PCIe config cycles are done by programming the PCIE_CONF_ADDR register
+ * and then reading the PCIE_CONF_DATA register. Need to make sure these
+ * transactions are atomic.
+ */
+static DEFINE_SPINLOCK(orion5x_pcie_lock);
+
+static int pcie_rd_conf(struct pci_bus *bus, u32 devfn, int where,
+                       int size, u32 *val)
+{
+       unsigned long flags;
+       int ret;
+
+       if (pcie_valid_config(bus->number, PCI_SLOT(devfn)) == 0) {
+               *val = 0xffffffff;
+               return PCIBIOS_DEVICE_NOT_FOUND;
+       }
+
+       spin_lock_irqsave(&orion5x_pcie_lock, flags);
+       ret = orion_pcie_rd_conf(PCIE_BASE, bus, devfn, where, size, val);
+       spin_unlock_irqrestore(&orion5x_pcie_lock, flags);
+
+       return ret;
+}
+
+static int pcie_rd_conf_wa(struct pci_bus *bus, u32 devfn,
+                          int where, int size, u32 *val)
+{
+       int ret;
+
+       if (pcie_valid_config(bus->number, PCI_SLOT(devfn)) == 0) {
+               *val = 0xffffffff;
+               return PCIBIOS_DEVICE_NOT_FOUND;
+       }
+
+       /*
+        * We only support access to the non-extended configuration
+        * space when using the WA access method (or we would have to
+        * sacrifice 256M of CPU virtual address space.)
+        */
+       if (where >= 0x100) {
+               *val = 0xffffffff;
+               return PCIBIOS_DEVICE_NOT_FOUND;
+       }
+
+       ret = orion_pcie_rd_conf_wa((void __iomem *)ORION5X_PCIE_WA_VIRT_BASE,
+                                   bus, devfn, where, size, val);
+
+       return ret;
+}
+
+static int pcie_wr_conf(struct pci_bus *bus, u32 devfn,
+                       int where, int size, u32 val)
+{
+       unsigned long flags;
+       int ret;
+
+       if (pcie_valid_config(bus->number, PCI_SLOT(devfn)) == 0)
+               return PCIBIOS_DEVICE_NOT_FOUND;
+
+       spin_lock_irqsave(&orion5x_pcie_lock, flags);
+       ret = orion_pcie_wr_conf(PCIE_BASE, bus, devfn, where, size, val);
+       spin_unlock_irqrestore(&orion5x_pcie_lock, flags);
+
+       return ret;
+}
+
+static struct pci_ops pcie_ops = {
+       .read = pcie_rd_conf,
+       .write = pcie_wr_conf,
+};
+
+
+static int __init pcie_setup(struct pci_sys_data *sys)
+{
+       struct resource *res;
+       int dev;
+
+       /*
+        * Generic PCIe unit setup.
+        */
+       orion_pcie_setup(PCIE_BASE, &orion5x_mbus_dram_info);
+
+       /*
+        * Check whether to apply Orion-1/Orion-NAS PCIe config
+        * read transaction workaround.
+        */
+       dev = orion_pcie_dev_id(PCIE_BASE);
+       if (dev == MV88F5181_DEV_ID || dev == MV88F5182_DEV_ID) {
+               printk(KERN_NOTICE "Applying Orion-1/Orion-NAS PCIe config "
+                                  "read transaction workaround\n");
+               pcie_ops.read = pcie_rd_conf_wa;
+       }
+
+       /*
+        * Request resources.
+        */
+       res = kzalloc(sizeof(struct resource) * 2, GFP_KERNEL);
+       if (!res)
+               panic("pcie_setup unable to alloc resources");
+
+       /*
+        * IORESOURCE_IO
+        */
+       res[0].name = "PCIe I/O Space";
+       res[0].flags = IORESOURCE_IO;
+       res[0].start = ORION5X_PCIE_IO_BUS_BASE;
+       res[0].end = res[0].start + ORION5X_PCIE_IO_SIZE - 1;
+       if (request_resource(&ioport_resource, &res[0]))
+               panic("Request PCIe IO resource failed\n");
+       sys->resource[0] = &res[0];
+
+       /*
+        * IORESOURCE_MEM
+        */
+       res[1].name = "PCIe Memory Space";
+       res[1].flags = IORESOURCE_MEM;
+       res[1].start = ORION5X_PCIE_MEM_PHYS_BASE;
+       res[1].end = res[1].start + ORION5X_PCIE_MEM_SIZE - 1;
+       if (request_resource(&iomem_resource, &res[1]))
+               panic("Request PCIe Memory resource failed\n");
+       sys->resource[1] = &res[1];
+
+       sys->resource[2] = NULL;
+       sys->io_offset = 0;
+
+       return 1;
+}
+
+/*****************************************************************************
+ * PCI controller
+ ****************************************************************************/
+#define PCI_MODE               ORION5X_PCI_REG(0xd00)
+#define PCI_CMD                        ORION5X_PCI_REG(0xc00)
+#define PCI_P2P_CONF           ORION5X_PCI_REG(0x1d14)
+#define PCI_CONF_ADDR          ORION5X_PCI_REG(0xc78)
+#define PCI_CONF_DATA          ORION5X_PCI_REG(0xc7c)
+
+/*
+ * PCI_MODE bits
+ */
+#define PCI_MODE_64BIT                 (1 << 2)
+#define PCI_MODE_PCIX                  ((1 << 4) | (1 << 5))
+
+/*
+ * PCI_CMD bits
+ */
+#define PCI_CMD_HOST_REORDER           (1 << 29)
+
+/*
+ * PCI_P2P_CONF bits
+ */
+#define PCI_P2P_BUS_OFFS               16
+#define PCI_P2P_BUS_MASK               (0xff << PCI_P2P_BUS_OFFS)
+#define PCI_P2P_DEV_OFFS               24
+#define PCI_P2P_DEV_MASK               (0x1f << PCI_P2P_DEV_OFFS)
+
+/*
+ * PCI_CONF_ADDR bits
+ */
+#define PCI_CONF_REG(reg)              ((reg) & 0xfc)
+#define PCI_CONF_FUNC(func)            (((func) & 0x3) << 8)
+#define PCI_CONF_DEV(dev)              (((dev) & 0x1f) << 11)
+#define PCI_CONF_BUS(bus)              (((bus) & 0xff) << 16)
+#define PCI_CONF_ADDR_EN               (1 << 31)
+
+/*
+ * Internal configuration space
+ */
+#define PCI_CONF_FUNC_STAT_CMD         0
+#define PCI_CONF_REG_STAT_CMD          4
+#define PCIX_STAT                      0x64
+#define PCIX_STAT_BUS_OFFS             8
+#define PCIX_STAT_BUS_MASK             (0xff << PCIX_STAT_BUS_OFFS)
+
+/*
+ * PCI Address Decode Windows registers
+ */
+#define PCI_BAR_SIZE_DDR_CS(n) (((n) == 0) ? ORION5X_PCI_REG(0xc08) : \
+                               ((n) == 1) ? ORION5X_PCI_REG(0xd08) :  \
+                               ((n) == 2) ? ORION5X_PCI_REG(0xc0c) :  \
+                               ((n) == 3) ? ORION5X_PCI_REG(0xd0c) : 0)
+#define PCI_BAR_REMAP_DDR_CS(n)        (((n) ==0) ? ORION5X_PCI_REG(0xc48) :  \
+                               ((n) == 1) ? ORION5X_PCI_REG(0xd48) :  \
+                               ((n) == 2) ? ORION5X_PCI_REG(0xc4c) :  \
+                               ((n) == 3) ? ORION5X_PCI_REG(0xd4c) : 0)
+#define PCI_BAR_ENABLE         ORION5X_PCI_REG(0xc3c)
+#define PCI_ADDR_DECODE_CTRL   ORION5X_PCI_REG(0xd3c)
+
+/*
+ * PCI configuration helpers for BAR settings
+ */
+#define PCI_CONF_FUNC_BAR_CS(n)                ((n) >> 1)
+#define PCI_CONF_REG_BAR_LO_CS(n)      (((n) & 1) ? 0x18 : 0x10)
+#define PCI_CONF_REG_BAR_HI_CS(n)      (((n) & 1) ? 0x1c : 0x14)
+
+/*
+ * PCI config cycles are done by programming the PCI_CONF_ADDR register
+ * and then reading the PCI_CONF_DATA register. Need to make sure these
+ * transactions are atomic.
+ */
+static DEFINE_SPINLOCK(orion5x_pci_lock);
+
+int orion5x_pci_local_bus_nr(void)
+{
+       u32 conf = orion5x_read(PCI_P2P_CONF);
+       return((conf & PCI_P2P_BUS_MASK) >> PCI_P2P_BUS_OFFS);
+}
+
+static int orion5x_pci_hw_rd_conf(int bus, int dev, u32 func,
+                                       u32 where, u32 size, u32 *val)
+{
+       unsigned long flags;
+       spin_lock_irqsave(&orion5x_pci_lock, flags);
+
+       orion5x_write(PCI_CONF_ADDR, PCI_CONF_BUS(bus) |
+                       PCI_CONF_DEV(dev) | PCI_CONF_REG(where) |
+                       PCI_CONF_FUNC(func) | PCI_CONF_ADDR_EN);
+
+       *val = orion5x_read(PCI_CONF_DATA);
+
+       if (size == 1)
+               *val = (*val >> (8*(where & 0x3))) & 0xff;
+       else if (size == 2)
+               *val = (*val >> (8*(where & 0x3))) & 0xffff;
+
+       spin_unlock_irqrestore(&orion5x_pci_lock, flags);
+
+       return PCIBIOS_SUCCESSFUL;
+}
+
+static int orion5x_pci_hw_wr_conf(int bus, int dev, u32 func,
+                                       u32 where, u32 size, u32 val)
+{
+       unsigned long flags;
+       int ret = PCIBIOS_SUCCESSFUL;
+
+       spin_lock_irqsave(&orion5x_pci_lock, flags);
+
+       orion5x_write(PCI_CONF_ADDR, PCI_CONF_BUS(bus) |
+                       PCI_CONF_DEV(dev) | PCI_CONF_REG(where) |
+                       PCI_CONF_FUNC(func) | PCI_CONF_ADDR_EN);
+
+       if (size == 4) {
+               __raw_writel(val, PCI_CONF_DATA);
+       } else if (size == 2) {
+               __raw_writew(val, PCI_CONF_DATA + (where & 0x3));
+       } else if (size == 1) {
+               __raw_writeb(val, PCI_CONF_DATA + (where & 0x3));
+       } else {
+               ret = PCIBIOS_BAD_REGISTER_NUMBER;
+       }
+
+       spin_unlock_irqrestore(&orion5x_pci_lock, flags);
+
+       return ret;
+}
+
+static int orion5x_pci_rd_conf(struct pci_bus *bus, u32 devfn,
+                               int where, int size, u32 *val)
+{
+       /*
+        * Don't go out for local device
+        */
+       if (bus->number == orion5x_pci_local_bus_nr() &&
+           PCI_SLOT(devfn) == 0 && PCI_FUNC(devfn) != 0) {
+               *val = 0xffffffff;
+               return PCIBIOS_DEVICE_NOT_FOUND;
+       }
+
+       return orion5x_pci_hw_rd_conf(bus->number, PCI_SLOT(devfn),
+                                       PCI_FUNC(devfn), where, size, val);
+}
+
+static int orion5x_pci_wr_conf(struct pci_bus *bus, u32 devfn,
+                               int where, int size, u32 val)
+{
+       if (bus->number == orion5x_pci_local_bus_nr() &&
+           PCI_SLOT(devfn) == 0 && PCI_FUNC(devfn) != 0)
+               return PCIBIOS_DEVICE_NOT_FOUND;
+
+       return orion5x_pci_hw_wr_conf(bus->number, PCI_SLOT(devfn),
+                                       PCI_FUNC(devfn), where, size, val);
+}
+
+static struct pci_ops pci_ops = {
+       .read = orion5x_pci_rd_conf,
+       .write = orion5x_pci_wr_conf,
+};
+
+static void __init orion5x_pci_set_bus_nr(int nr)
+{
+       u32 p2p = orion5x_read(PCI_P2P_CONF);
+
+       if (orion5x_read(PCI_MODE) & PCI_MODE_PCIX) {
+               /*
+                * PCI-X mode
+                */
+               u32 pcix_status, bus, dev;
+               bus = (p2p & PCI_P2P_BUS_MASK) >> PCI_P2P_BUS_OFFS;
+               dev = (p2p & PCI_P2P_DEV_MASK) >> PCI_P2P_DEV_OFFS;
+               orion5x_pci_hw_rd_conf(bus, dev, 0, PCIX_STAT, 4, &pcix_status);
+               pcix_status &= ~PCIX_STAT_BUS_MASK;
+               pcix_status |= (nr << PCIX_STAT_BUS_OFFS);
+               orion5x_pci_hw_wr_conf(bus, dev, 0, PCIX_STAT, 4, pcix_status);
+       } else {
+               /*
+                * PCI Conventional mode
+                */
+               p2p &= ~PCI_P2P_BUS_MASK;
+               p2p |= (nr << PCI_P2P_BUS_OFFS);
+               orion5x_write(PCI_P2P_CONF, p2p);
+       }
+}
+
+static void __init orion5x_pci_master_slave_enable(void)
+{
+       int bus_nr, func, reg;
+       u32 val;
+
+       bus_nr = orion5x_pci_local_bus_nr();
+       func = PCI_CONF_FUNC_STAT_CMD;
+       reg = PCI_CONF_REG_STAT_CMD;
+       orion5x_pci_hw_rd_conf(bus_nr, 0, func, reg, 4, &val);
+       val |= (PCI_COMMAND_IO | PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER);
+       orion5x_pci_hw_wr_conf(bus_nr, 0, func, reg, 4, val | 0x7);
+}
+
+static void __init orion5x_setup_pci_wins(struct mbus_dram_target_info *dram)
+{
+       u32 win_enable;
+       int bus;
+       int i;
+
+       /*
+        * First, disable windows.
+        */
+       win_enable = 0xffffffff;
+       orion5x_write(PCI_BAR_ENABLE, win_enable);
+
+       /*
+        * Setup windows for DDR banks.
+        */
+       bus = orion5x_pci_local_bus_nr();
+
+       for (i = 0; i < dram->num_cs; i++) {
+               struct mbus_dram_window *cs = dram->cs + i;
+               u32 func = PCI_CONF_FUNC_BAR_CS(cs->cs_index);
+               u32 reg;
+               u32 val;
+
+               /*
+                * Write DRAM bank base address register.
+                */
+               reg = PCI_CONF_REG_BAR_LO_CS(cs->cs_index);
+               orion5x_pci_hw_rd_conf(bus, 0, func, reg, 4, &val);
+               val = (cs->base & 0xfffff000) | (val & 0xfff);
+               orion5x_pci_hw_wr_conf(bus, 0, func, reg, 4, val);
+
+               /*
+                * Write DRAM bank size register.
+                */
+               reg = PCI_CONF_REG_BAR_HI_CS(cs->cs_index);
+               orion5x_pci_hw_wr_conf(bus, 0, func, reg, 4, 0);
+               orion5x_write(PCI_BAR_SIZE_DDR_CS(cs->cs_index),
+                               (cs->size - 1) & 0xfffff000);
+               orion5x_write(PCI_BAR_REMAP_DDR_CS(cs->cs_index),
+                               cs->base & 0xfffff000);
+
+               /*
+                * Enable decode window for this chip select.
+                */
+               win_enable &= ~(1 << cs->cs_index);
+       }
+
+       /*
+        * Re-enable decode windows.
+        */
+       orion5x_write(PCI_BAR_ENABLE, win_enable);
+
+       /*
+        * Disable automatic update of address remaping when writing to BARs.
+        */
+       orion5x_setbits(PCI_ADDR_DECODE_CTRL, 1);
+}
+
+static int __init pci_setup(struct pci_sys_data *sys)
+{
+       struct resource *res;
+
+       /*
+        * Point PCI unit MBUS decode windows to DRAM space.
+        */
+       orion5x_setup_pci_wins(&orion5x_mbus_dram_info);
+
+       /*
+        * Master + Slave enable
+        */
+       orion5x_pci_master_slave_enable();
+
+       /*
+        * Force ordering
+        */
+       orion5x_setbits(PCI_CMD, PCI_CMD_HOST_REORDER);
+
+       /*
+        * Request resources
+        */
+       res = kzalloc(sizeof(struct resource) * 2, GFP_KERNEL);
+       if (!res)
+               panic("pci_setup unable to alloc resources");
+
+       /*
+        * IORESOURCE_IO
+        */
+       res[0].name = "PCI I/O Space";
+       res[0].flags = IORESOURCE_IO;
+       res[0].start = ORION5X_PCI_IO_BUS_BASE;
+       res[0].end = res[0].start + ORION5X_PCI_IO_SIZE - 1;
+       if (request_resource(&ioport_resource, &res[0]))
+               panic("Request PCI IO resource failed\n");
+       sys->resource[0] = &res[0];
+
+       /*
+        * IORESOURCE_MEM
+        */
+       res[1].name = "PCI Memory Space";
+       res[1].flags = IORESOURCE_MEM;
+       res[1].start = ORION5X_PCI_MEM_PHYS_BASE;
+       res[1].end = res[1].start + ORION5X_PCI_MEM_SIZE - 1;
+       if (request_resource(&iomem_resource, &res[1]))
+               panic("Request PCI Memory resource failed\n");
+       sys->resource[1] = &res[1];
+
+       sys->resource[2] = NULL;
+       sys->io_offset = 0;
+
+       return 1;
+}
+
+
+/*****************************************************************************
+ * General PCIe + PCI
+ ****************************************************************************/
+static void __devinit rc_pci_fixup(struct pci_dev *dev)
+{
+       /*
+        * Prevent enumeration of root complex.
+        */
+       if (dev->bus->parent == NULL && dev->devfn == 0) {
+               int i;
+
+               for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) {
+                       dev->resource[i].start = 0;
+                       dev->resource[i].end   = 0;
+                       dev->resource[i].flags = 0;
+               }
+       }
+}
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_MARVELL, PCI_ANY_ID, rc_pci_fixup);
+
+int __init orion5x_pci_sys_setup(int nr, struct pci_sys_data *sys)
+{
+       int ret = 0;
+
+       if (nr == 0) {
+               orion_pcie_set_local_bus_nr(PCIE_BASE, sys->busnr);
+               ret = pcie_setup(sys);
+       } else if (nr == 1) {
+               orion5x_pci_set_bus_nr(sys->busnr);
+               ret = pci_setup(sys);
+       }
+
+       return ret;
+}
+
+struct pci_bus __init *orion5x_pci_sys_scan_bus(int nr, struct pci_sys_data *sys)
+{
+       struct pci_bus *bus;
+
+       if (nr == 0) {
+               bus = pci_scan_bus(sys->busnr, &pcie_ops, sys);
+       } else if (nr == 1) {
+               bus = pci_scan_bus(sys->busnr, &pci_ops, sys);
+       } else {
+               bus = NULL;
+               BUG();
+       }
+
+       return bus;
+}
similarity index 85%
rename from arch/arm/mach-orion/rd88f5182-setup.c
rename to arch/arm/mach-orion5x/rd88f5182-setup.c
index e851b8ca5ac6fb48921d6237477274dde5c0bb49..37e8b2dc3ed57eaef7e601464adaad03ec6ea10d 100644 (file)
@@ -1,12 +1,12 @@
 /*
- * arch/arm/mach-orion/rd88f5182-setup.c
+ * arch/arm/mach-orion5x/rd88f5182-setup.c
  *
  * Marvell Orion-NAS Reference Design Setup
  *
  * Maintainer: Ronen Shitrit <rshitrit@marvell.com>
  *
- * This file is licensed under  the terms of the GNU General Public
- * License version 2. This program is licensed "as is" without any
+ * This file is licensed under the terms of the GNU General Public
+ * License version 2.  This program is licensed "as is" without any
  * warranty of any kind, whether express or implied.
  */
 
@@ -24,8 +24,7 @@
 #include <asm/leds.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/pci.h>
-#include <asm/arch/orion.h>
-#include <asm/arch/platform.h>
+#include <asm/arch/orion5x.h>
 #include "common.h"
 
 /*****************************************************************************
@@ -176,8 +175,8 @@ static int __init rd88f5182_pci_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
        /*
         * PCI-E isn't used on the RD2
         */
-       if (dev->bus->number == orion_pcie_local_bus_nr())
-               return IRQ_ORION_PCIE0_INT;
+       if (dev->bus->number == orion5x_pcie_local_bus_nr())
+               return IRQ_ORION5X_PCIE0_INT;
 
        /*
         * PCI IRQs are connected via GPIOs
@@ -197,8 +196,8 @@ static struct hw_pci rd88f5182_pci __initdata = {
        .nr_controllers = 2,
        .preinit        = rd88f5182_pci_preinit,
        .swizzle        = pci_std_swizzle,
-       .setup          = orion_pci_sys_setup,
-       .scan           = orion_pci_sys_scan_bus,
+       .setup          = orion5x_pci_sys_setup,
+       .scan           = orion5x_pci_sys_scan_bus,
        .map_irq        = rd88f5182_pci_map_irq,
 };
 
@@ -250,22 +249,20 @@ static void __init rd88f5182_init(void)
        /*
         * Setup basic Orion functions. Need to be called early.
         */
-       orion_init();
+       orion5x_init();
 
        /*
         * Setup the CPU address decode windows for our devices
         */
-       orion_setup_cpu_win(ORION_DEV_BOOT, RD88F5182_NOR_BOOT_BASE,
-                               RD88F5182_NOR_BOOT_SIZE, -1);
-       orion_setup_cpu_win(ORION_DEV1, RD88F5182_NOR_BASE,
-                               RD88F5182_NOR_SIZE, -1);
+       orion5x_setup_dev_boot_win(RD88F5182_NOR_BOOT_BASE,
+                               RD88F5182_NOR_BOOT_SIZE);
+       orion5x_setup_dev1_win(RD88F5182_NOR_BASE, RD88F5182_NOR_SIZE);
 
        /*
         * Open a special address decode windows for the PCIE WA.
         */
-       orion_write(ORION_REGS_VIRT_BASE | 0x20074, ORION_PCIE_WA_PHYS_BASE);
-       orion_write(ORION_REGS_VIRT_BASE | 0x20070, (0x7941 |
-               (((ORION_PCIE_WA_SIZE >> 16) - 1)) << 16));
+       orion5x_setup_pcie_wa_win(ORION5X_PCIE_WA_PHYS_BASE,
+                               ORION5X_PCIE_WA_SIZE);
 
        /*
         * Setup Multiplexing Pins --
@@ -291,25 +288,25 @@ static void __init rd88f5182_init(void)
         * MPP[25] USB 0 over current enable
         */
 
-       orion_write(MPP_0_7_CTRL, 0x00000003);
-       orion_write(MPP_8_15_CTRL, 0x55550000);
-       orion_write(MPP_16_19_CTRL, 0x5555);
+       orion5x_write(MPP_0_7_CTRL, 0x00000003);
+       orion5x_write(MPP_8_15_CTRL, 0x55550000);
+       orion5x_write(MPP_16_19_CTRL, 0x5555);
 
-       orion_gpio_set_valid_pins(0x000000fb);
+       orion5x_gpio_set_valid_pins(0x000000fb);
 
        platform_add_devices(rd88f5182_devices, ARRAY_SIZE(rd88f5182_devices));
        i2c_register_board_info(0, &rd88f5182_i2c_rtc, 1);
-       orion_eth_init(&rd88f5182_eth_data);
-       orion_sata_init(&rd88f5182_sata_data);
+       orion5x_eth_init(&rd88f5182_eth_data);
+       orion5x_sata_init(&rd88f5182_sata_data);
 }
 
 MACHINE_START(RD88F5182, "Marvell Orion-NAS Reference Design")
        /* Maintainer: Ronen Shitrit <rshitrit@marvell.com> */
-       .phys_io        = ORION_REGS_PHYS_BASE,
-       .io_pg_offst    = ((ORION_REGS_VIRT_BASE) >> 18) & 0xFFFC,
+       .phys_io        = ORION5X_REGS_PHYS_BASE,
+       .io_pg_offst    = ((ORION5X_REGS_VIRT_BASE) >> 18) & 0xFFFC,
        .boot_params    = 0x00000100,
        .init_machine   = rd88f5182_init,
-       .map_io         = orion_map_io,
-       .init_irq       = orion_init_irq,
-       .timer          = &orion_timer,
+       .map_io         = orion5x_map_io,
+       .init_irq       = orion5x_init_irq,
+       .timer          = &orion5x_timer,
 MACHINE_END
similarity index 76%
rename from arch/arm/mach-orion/ts209-setup.c
rename to arch/arm/mach-orion5x/ts209-setup.c
index 45764dad16d0fb3bb121b5e5911761ae36051162..fd43863a86f6dbc0479bb22264db087a12c4ba42 100644 (file)
@@ -26,8 +26,7 @@
 #include <asm/gpio.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/pci.h>
-#include <asm/arch/orion.h>
-#include <asm/arch/platform.h>
+#include <asm/arch/orion5x.h>
 #include "common.h"
 
 #define QNAP_TS209_NOR_BOOT_BASE 0xf4000000
@@ -145,8 +144,8 @@ static int __init qnap_ts209_pci_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
        /*
         * PCIE IRQ is connected internally (not GPIO)
         */
-       if (dev->bus->number == orion_pcie_local_bus_nr())
-               return IRQ_ORION_PCIE0_INT;
+       if (dev->bus->number == orion5x_pcie_local_bus_nr())
+               return IRQ_ORION5X_PCIE0_INT;
 
        /*
         * PCI IRQs are connected via GPIOs
@@ -165,8 +164,8 @@ static struct hw_pci qnap_ts209_pci __initdata = {
        .nr_controllers = 2,
        .preinit        = qnap_ts209_pci_preinit,
        .swizzle        = pci_std_swizzle,
-       .setup          = orion_pci_sys_setup,
-       .scan           = orion_pci_sys_scan_bus,
+       .setup          = orion5x_pci_sys_setup,
+       .scan           = orion5x_pci_sys_scan_bus,
        .map_irq        = qnap_ts209_pci_map_irq,
 };
 
@@ -189,6 +188,87 @@ static struct mv643xx_eth_platform_data qnap_ts209_eth_data = {
        .force_phy_addr = 1,
 };
 
+static int __init parse_hex_nibble(char n)
+{
+       if (n >= '0' && n <= '9')
+               return n - '0';
+
+       if (n >= 'A' && n <= 'F')
+               return n - 'A' + 10;
+
+       if (n >= 'a' && n <= 'f')
+               return n - 'a' + 10;
+
+       return -1;
+}
+
+static int __init parse_hex_byte(const char *b)
+{
+       int hi;
+       int lo;
+
+       hi = parse_hex_nibble(b[0]);
+       lo = parse_hex_nibble(b[1]);
+
+       if (hi < 0 || lo < 0)
+               return -1;
+
+       return (hi << 4) | lo;
+}
+
+static int __init check_mac_addr(const char *addr_str)
+{
+       u_int8_t addr[6];
+       int i;
+
+       for (i = 0; i < 6; i++) {
+               int byte;
+
+               /*
+                * Enforce "xx:xx:xx:xx:xx:xx\n" format.
+                */
+               if (addr_str[(i * 3) + 2] != ((i < 5) ? ':' : '\n'))
+                       return -1;
+
+               byte = parse_hex_byte(addr_str + (i * 3));
+               if (byte < 0)
+                       return -1;
+               addr[i] = byte;
+       }
+
+       printk(KERN_INFO "ts209: found ethernet mac address ");
+       for (i = 0; i < 6; i++)
+               printk("%.2x%s", addr[i], (i < 5) ? ":" : ".\n");
+
+       memcpy(qnap_ts209_eth_data.mac_addr, addr, 6);
+
+       return 0;
+}
+
+/*
+ * The 'NAS Config' flash partition has an ext2 filesystem which
+ * contains a file that has the ethernet MAC address in plain text
+ * (format "xx:xx:xx:xx:xx:xx\n".)
+ */
+static void __init ts209_find_mac_addr(void)
+{
+       unsigned long addr;
+
+       for (addr = 0x00700000; addr < 0x00760000; addr += 1024) {
+               char *nor_page;
+               int ret = 0;
+
+               nor_page = ioremap(QNAP_TS209_NOR_BOOT_BASE + addr, 1024);
+               if (nor_page != NULL) {
+                       ret = check_mac_addr(nor_page);
+                       iounmap(nor_page);
+               }
+
+               if (ret == 0)
+                       break;
+       }
+}
+
 /*****************************************************************************
  * RTC S35390A on I2C bus
  ****************************************************************************/
@@ -262,21 +342,21 @@ static struct platform_device *qnap_ts209_devices[] __initdata = {
 static void qnap_ts209_power_off(void)
 {
        /* 19200 baud divisor */
-       const unsigned divisor = ((ORION_TCLK + (8 * 19200)) / (16 * 19200));
+       const unsigned divisor = ((ORION5X_TCLK + (8 * 19200)) / (16 * 19200));
 
        pr_info("%s: triggering power-off...\n", __func__);
 
        /* hijack uart1 and reset into sane state (19200,8n1) */
-       orion_write(UART1_REG(LCR), 0x83);
-       orion_write(UART1_REG(DLL), divisor & 0xff);
-       orion_write(UART1_REG(DLM), (divisor >> 8) & 0xff);
-       orion_write(UART1_REG(LCR), 0x03);
-       orion_write(UART1_REG(IER), 0x00);
-       orion_write(UART1_REG(FCR), 0x00);
-       orion_write(UART1_REG(MCR), 0x00);
+       orion5x_write(UART1_REG(LCR), 0x83);
+       orion5x_write(UART1_REG(DLL), divisor & 0xff);
+       orion5x_write(UART1_REG(DLM), (divisor >> 8) & 0xff);
+       orion5x_write(UART1_REG(LCR), 0x03);
+       orion5x_write(UART1_REG(IER), 0x00);
+       orion5x_write(UART1_REG(FCR), 0x00);
+       orion5x_write(UART1_REG(MCR), 0x00);
 
        /* send the power-off command 'A' to PIC */
-       orion_write(UART1_REG(TX), 'A');
+       orion5x_write(UART1_REG(TX), 'A');
 }
 
 static void __init qnap_ts209_init(void)
@@ -284,20 +364,19 @@ static void __init qnap_ts209_init(void)
        /*
         * Setup basic Orion functions. Need to be called early.
         */
-       orion_init();
+       orion5x_init();
 
        /*
         * Setup flash mapping
         */
-       orion_setup_cpu_win(ORION_DEV_BOOT, QNAP_TS209_NOR_BOOT_BASE,
-                           QNAP_TS209_NOR_BOOT_SIZE, -1);
+       orion5x_setup_dev_boot_win(QNAP_TS209_NOR_BOOT_BASE,
+                           QNAP_TS209_NOR_BOOT_SIZE);
 
        /*
         * Open a special address decode windows for the PCIE WA.
         */
-       orion_write(ORION_REGS_VIRT_BASE | 0x20074, ORION_PCIE_WA_PHYS_BASE);
-       orion_write(ORION_REGS_VIRT_BASE | 0x20070, (0x7941 |
-               (((ORION_PCIE_WA_SIZE >> 16) - 1)) << 16));
+       orion5x_setup_pcie_wa_win(ORION5X_PCIE_WA_PHYS_BASE,
+                               ORION5X_PCIE_WA_SIZE);
 
        /*
         * Setup Multiplexing Pins --
@@ -322,10 +401,10 @@ static void __init qnap_ts209_init(void)
         * MPP[22] USB 0 over current
         * MPP[23-25] Reserved
         */
-       orion_write(MPP_0_7_CTRL, 0x3);
-       orion_write(MPP_8_15_CTRL, 0x55550000);
-       orion_write(MPP_16_19_CTRL, 0x5500);
-       orion_gpio_set_valid_pins(0x3cc0fff);
+       orion5x_write(MPP_0_7_CTRL, 0x3);
+       orion5x_write(MPP_8_15_CTRL, 0x55550000);
+       orion5x_write(MPP_16_19_CTRL, 0x5500);
+       orion5x_gpio_set_valid_pins(0x3cc0fff);
 
        /* register ts209 specific power-off method */
        pm_power_off = qnap_ts209_power_off;
@@ -344,18 +423,20 @@ static void __init qnap_ts209_init(void)
                pr_warning("qnap_ts209_init: failed to get RTC IRQ\n");
        i2c_register_board_info(0, &qnap_ts209_i2c_rtc, 1);
 
-       orion_eth_init(&qnap_ts209_eth_data);
-       orion_sata_init(&qnap_ts209_sata_data);
+       ts209_find_mac_addr();
+       orion5x_eth_init(&qnap_ts209_eth_data);
+
+       orion5x_sata_init(&qnap_ts209_sata_data);
 }
 
 MACHINE_START(TS209, "QNAP TS-109/TS-209")
        /* Maintainer:  Byron Bradley <byron.bbradley@gmail.com> */
-       .phys_io        = ORION_REGS_PHYS_BASE,
-       .io_pg_offst    = ((ORION_REGS_VIRT_BASE) >> 18) & 0xFFFC,
+       .phys_io        = ORION5X_REGS_PHYS_BASE,
+       .io_pg_offst    = ((ORION5X_REGS_VIRT_BASE) >> 18) & 0xFFFC,
        .boot_params    = 0x00000100,
        .init_machine   = qnap_ts209_init,
-       .map_io         = orion_map_io,
-       .init_irq       = orion_init_irq,
-       .timer          = &orion_timer,
+       .map_io         = orion5x_map_io,
+       .init_irq       = orion5x_init_irq,
+       .timer          = &orion5x_timer,
        .fixup          = tag_fixup_mem32,
 MACHINE_END
index 8e00ed43fb95d76fb0dc5243cf0a3acdf0d2d809..a5268c3ac5a75332bf96cdb34887b69688c1ab93 100644 (file)
@@ -21,7 +21,6 @@
 #include <linux/err.h>
 #include <linux/delay.h>
 
-#include <asm/semaphore.h>
 #include <asm/hardware.h>
 #include <asm/io.h>
 
index 1ab84ced7b5a56d310e7b1654771421d6dc200d6..ef179cab80e2133ed71f8f3bf7fa92a4da6d188b 100644 (file)
@@ -17,7 +17,6 @@
 #include <linux/types.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
-#include <asm/semaphore.h>
 #include <asm/io.h>
 #include <asm/arch/platform.h>
 #include <asm/arch/gpio.h>
index 0908bea0f60968a3becd9223b3626074c84e10c2..5da7a68204920c5c67a26f8003f80ffd168e48cc 100644 (file)
@@ -23,6 +23,12 @@ endif
 choice
        prompt "Select target board"
 
+config ARCH_GUMSTIX
+       bool "Gumstix XScale boards"
+       help
+         Say Y here if you intend to run this kernel on a
+         Gumstix Full Function Minature Computer.
+
 config ARCH_LUBBOCK
        bool "Intel DBPXA250 Development Platform"
        select PXA25x
@@ -160,6 +166,20 @@ endchoice
 
 endif
 
+if ARCH_GUMSTIX
+
+choice
+       prompt "Select target Gumstix board"
+
+config MACH_GUMSTIX_F
+       bool "Basix, Connex, ws-200ax, ws-400ax systems"
+       select PXA25x
+
+endchoice
+
+endif
+
+
 if MACH_TRIZEPS4
 
 choice
index 6e0c4f5b5ae663526a9daf2750149f7f6fe2b89b..7cdcb459ea9dd266d1bb9c076bb19127144ec276 100644 (file)
@@ -5,13 +5,14 @@
 # Common support (must be linked before board specific support)
 obj-y                          += clock.o devices.o generic.o irq.o dma.o \
                                   time.o gpio.o
-obj-$(CONFIG_PXA25x)           += pxa25x.o
-obj-$(CONFIG_PXA27x)           += pxa27x.o
-obj-$(CONFIG_PXA3xx)           += pxa3xx.o mfp.o smemc.o
+obj-$(CONFIG_PXA25x)           += pxa25x.o mfp-pxa2xx.o
+obj-$(CONFIG_PXA27x)           += pxa27x.o mfp-pxa2xx.o
+obj-$(CONFIG_PXA3xx)           += pxa3xx.o mfp-pxa3xx.o smemc.o
 obj-$(CONFIG_CPU_PXA300)       += pxa300.o
 obj-$(CONFIG_CPU_PXA320)       += pxa320.o
 
 # Specific board support
+obj-$(CONFIG_ARCH_GUMSTIX)     += gumstix.o
 obj-$(CONFIG_ARCH_LUBBOCK)     += lubbock.o
 obj-$(CONFIG_MACH_LOGICPD_PXA270) += lpd270.o
 obj-$(CONFIG_MACH_MAINSTONE)   += mainstone.o
index df5ae2710ab1744197e1fc8d77bccce41f575622..e97dc59813c86af131d2b86395a5326cbb49fc7f 100644 (file)
@@ -13,6 +13,7 @@
 #include <linux/delay.h>
 
 #include <asm/arch/pxa-regs.h>
+#include <asm/arch/pxa2xx-gpio.h>
 #include <asm/hardware.h>
 
 #include "devices.h"
index fcda7d5cb693a15096f9b6420fa86572f33f206c..ac7f05f9f3eb8ad50722686f7e46da11e8ac9548 100644 (file)
@@ -23,6 +23,7 @@
 #include <asm/mach/pci.h>
 #include <asm/arch/cm-x270.h>
 #include <asm/arch/pxa-regs.h>
+#include <asm/arch/pxa2xx-gpio.h>
 #include <asm/mach-types.h>
 
 #include <asm/hardware/it8152.h>
index ecdbc96a4de1240f026c6b7c813409faf1073911..6d4416a4f378807e17b886862d012acbe51fca3c 100644 (file)
@@ -30,6 +30,7 @@
 
 #include <asm/arch/pxa-regs.h>
 #include <asm/arch/pxa2xx-regs.h>
+#include <asm/arch/pxa2xx-gpio.h>
 #include <asm/arch/pxafb.h>
 #include <asm/arch/ohci.h>
 #include <asm/arch/mmc.h>
index 6db54e31c3978d6e4cc8b841bc1075a4250537f7..43bf5a183e90da539d757505a4031d482ed4deb1 100644 (file)
@@ -29,6 +29,7 @@
 #include <asm/mach/irq.h>
 #include <asm/mach/flash.h>
 #include <asm/arch/pxa-regs.h>
+#include <asm/arch/pxa2xx-gpio.h>
 #include <asm/arch/colibri.h>
 
 #include "generic.h"
index 9292576b83b3fc9557bee7f2a54dcc89b3e500c1..259ca821e464444d3ae02b0d1bbad9031697cad1 100644 (file)
@@ -36,6 +36,7 @@
 #include <asm/mach/irq.h>
 
 #include <asm/arch/pxa-regs.h>
+#include <asm/arch/pxa2xx-gpio.h>
 #include <asm/arch/irda.h>
 #include <asm/arch/mmc.h>
 #include <asm/arch/udc.h>
index 392c38717362751b9614ae88e1db1abff6c229c7..0a85f706e88725bcdd64ba98484bc4da8ba7175e 100644 (file)
@@ -26,6 +26,7 @@
 #include <asm/arch/sharpsl.h>
 #include <asm/arch/corgi.h>
 #include <asm/arch/pxa-regs.h>
+#include <asm/arch/pxa2xx-gpio.h>
 #include "sharpsl.h"
 
 #define SHARPSL_CHARGE_ON_VOLT         0x99  /* 2.9V */
index 31706224a04c07a58e4c6e91a99a703ff5ff6f12..eccc45d21f753e693f18118d5022e29572c74e98 100644 (file)
@@ -21,6 +21,7 @@
 
 #include <asm/arch/ssp.h>
 #include <asm/arch/pxa-regs.h>
+#include <asm/arch/pxa2xx-gpio.h>
 #include <asm/arch/regs-ssp.h>
 #include "sharpsl.h"
 
index bfccb80ac8eff129d62aaccd02469fbec7b504de..d6c05b6eab359af09d97051bec813ccf67d8e61b 100644 (file)
@@ -11,6 +11,8 @@
 #include <asm/arch/irda.h>
 #include <asm/arch/i2c.h>
 #include <asm/arch/ohci.h>
+#include <asm/arch/pxa27x_keypad.h>
+#include <asm/arch/camera.h>
 
 #include "devices.h"
 
@@ -396,6 +398,31 @@ struct platform_device pxa25x_device_assp = {
 
 #if defined(CONFIG_PXA27x) || defined(CONFIG_PXA3xx)
 
+static struct resource pxa27x_resource_keypad[] = {
+       [0] = {
+               .start  = 0x41500000,
+               .end    = 0x4150004c,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = IRQ_KEYPAD,
+               .end    = IRQ_KEYPAD,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+struct platform_device pxa27x_device_keypad = {
+       .name           = "pxa27x-keypad",
+       .id             = -1,
+       .resource       = pxa27x_resource_keypad,
+       .num_resources  = ARRAY_SIZE(pxa27x_resource_keypad),
+};
+
+void __init pxa_set_keypad_info(struct pxa27x_keypad_platform_data *info)
+{
+       pxa_register_device(&pxa27x_device_keypad, info);
+}
+
 static u64 pxa27x_ohci_dma_mask = DMA_BIT_MASK(32);
 
 static struct resource pxa27x_resource_ohci[] = {
@@ -540,6 +567,37 @@ struct platform_device pxa27x_device_ssp3 = {
        .resource       = pxa27x_resource_ssp3,
        .num_resources  = ARRAY_SIZE(pxa27x_resource_ssp3),
 };
+
+static struct resource pxa27x_resource_camera[] = {
+       [0] = {
+               .start  = 0x50000000,
+               .end    = 0x50000fff,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = IRQ_CAMERA,
+               .end    = IRQ_CAMERA,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static u64 pxa27x_dma_mask_camera = DMA_BIT_MASK(32);
+
+static struct platform_device pxa27x_device_camera = {
+       .name           = "pxa27x-camera",
+       .id             = 0, /* This is used to put cameras on this interface */
+       .dev            = {
+               .dma_mask               = &pxa27x_dma_mask_camera,
+               .coherent_dma_mask      = 0xffffffff,
+       },
+       .num_resources  = ARRAY_SIZE(pxa27x_resource_camera),
+       .resource       = pxa27x_resource_camera,
+};
+
+void __init pxa_set_camera_info(struct pxacamera_platform_data *info)
+{
+       pxa_register_device(&pxa27x_device_camera, info);
+}
 #endif /* CONFIG_PXA27x || CONFIG_PXA3xx */
 
 #ifdef CONFIG_PXA3xx
index 96c7c890906852789bf016d0d26d51ab58c930f9..fcab017f27eef62b4d03203b8667d15df926caaf 100644 (file)
@@ -14,6 +14,7 @@ extern struct platform_device pxa_device_rtc;
 
 extern struct platform_device pxa27x_device_i2c_power;
 extern struct platform_device pxa27x_device_ohci;
+extern struct platform_device pxa27x_device_keypad;
 
 extern struct platform_device pxa25x_device_ssp;
 extern struct platform_device pxa25x_device_nssp;
index 3bb31314429af0568b9a3920e76895fca580d29b..edc4f07a230d3c9a5d61c9d63b4dc35f94c1a5b9 100644 (file)
@@ -23,6 +23,7 @@
 #include <asm/mach/arch.h>
 
 #include <asm/arch/pxa-regs.h>
+#include <asm/arch/pxa2xx-gpio.h>
 #include <asm/arch/pxafb.h>
 #include <asm/arch/ohci.h>
 #include <asm/arch/mmc.h>
index 80721c610d41dee16f74ebdbeb72bb4c3be2b7cf..331f29b2d0cd5e6e2cefeeb30d92fbed9fe4969a 100644 (file)
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
-#include <linux/delay.h>
-#include <linux/ioport.h>
-#include <linux/pm.h>
-#include <linux/string.h>
-#include <linux/sysdev.h>
 
 #include <asm/hardware.h>
-#include <asm/irq.h>
 #include <asm/system.h>
 #include <asm/pgtable.h>
 #include <asm/mach/map.h>
@@ -134,59 +128,3 @@ void __init pxa_map_io(void)
        iotable_init(standard_io_desc, ARRAY_SIZE(standard_io_desc));
        get_clk_frequency_khz(1);
 }
-
-#ifdef CONFIG_PM
-
-static unsigned long saved_gplr[4];
-static unsigned long saved_gpdr[4];
-static unsigned long saved_grer[4];
-static unsigned long saved_gfer[4];
-
-static int pxa_gpio_suspend(struct sys_device *dev, pm_message_t state)
-{
-       int i, gpio;
-
-       for (gpio = 0, i = 0; gpio < pxa_last_gpio; gpio += 32, i++) {
-               saved_gplr[i] = GPLR(gpio);
-               saved_gpdr[i] = GPDR(gpio);
-               saved_grer[i] = GRER(gpio);
-               saved_gfer[i] = GFER(gpio);
-
-               /* Clear GPIO transition detect bits */
-               GEDR(gpio) = GEDR(gpio);
-       }
-       return 0;
-}
-
-static int pxa_gpio_resume(struct sys_device *dev)
-{
-       int i, gpio;
-
-       for (gpio = 0, i = 0; gpio < pxa_last_gpio; gpio += 32, i++) {
-               /* restore level with set/clear */
-               GPSR(gpio) = saved_gplr[i];
-               GPCR(gpio) = ~saved_gplr[i];
-
-               GRER(gpio) = saved_grer[i];
-               GFER(gpio) = saved_gfer[i];
-               GPDR(gpio) = saved_gpdr[i];
-       }
-       return 0;
-}
-#else
-#define pxa_gpio_suspend       NULL
-#define pxa_gpio_resume                NULL
-#endif
-
-struct sysdev_class pxa_gpio_sysclass = {
-       .name           = "gpio",
-       .suspend        = pxa_gpio_suspend,
-       .resume         = pxa_gpio_resume,
-};
-
-static int __init pxa_gpio_init(void)
-{
-       return sysdev_class_register(&pxa_gpio_sysclass);
-}
-
-core_initcall(pxa_gpio_init);
index b3d10b0e52a01478055cf4e26b5f312d49d52b65..5bb7ae757831b2e5dbcb172fb12c792fe7c37df9 100644 (file)
@@ -9,14 +9,13 @@
  * published by the Free Software Foundation.
  */
 
+typedef int (*set_wake_t)(unsigned int, unsigned int);
+
 struct sys_timer;
 
 extern struct sys_timer pxa_timer;
-extern void __init pxa_init_irq_low(void);
-extern void __init pxa_init_irq_high(void);
-extern void __init pxa_init_irq_gpio(int gpio_nr);
-extern void __init pxa_init_irq_set_wake(int (*set_wake)(unsigned int, unsigned int));
-extern void __init pxa_init_gpio(int gpio_nr);
+extern void __init pxa_init_irq(int irq_nr, set_wake_t fn);
+extern void __init pxa_init_gpio(int gpio_nr, set_wake_t fn);
 extern void __init pxa25x_init_irq(void);
 extern void __init pxa27x_init_irq(void);
 extern void __init pxa3xx_init_irq(void);
@@ -30,6 +29,8 @@ extern int pxa_last_gpio;
        mi->bank[__nr].size = (__size), \
        mi->bank[__nr].node = (((unsigned)(__start) - PHYS_OFFSET) >> 27)
 
+#define ARRAY_AND_SIZE(x)      (x), ARRAY_SIZE(x)
+
 #ifdef CONFIG_PXA25x
 extern unsigned pxa25x_get_clk_frequency_khz(int);
 extern unsigned pxa25x_get_memclk_frequency_10khz(void);
@@ -56,3 +57,4 @@ extern unsigned pxa3xx_get_memclk_frequency_10khz(void);
 
 extern struct sysdev_class pxa_irq_sysclass;
 extern struct sysdev_class pxa_gpio_sysclass;
+extern struct sysdev_class pxa3xx_mfp_sysclass;
index 8638dd7dd076ffd4b8c457571505508e63eb2238..7d3e16970be0363ae33a557fe0176de275fafe3f 100644 (file)
 
 #include <linux/init.h>
 #include <linux/module.h>
+#include <linux/irq.h>
+#include <linux/sysdev.h>
 
 #include <asm/gpio.h>
 #include <asm/hardware.h>
 #include <asm/io.h>
 #include <asm/arch/pxa-regs.h>
+#include <asm/arch/pxa2xx-gpio.h>
 
 #include "generic.h"
 
@@ -129,69 +132,283 @@ static void pxa_gpio_set(struct gpio_chip *chip, unsigned offset, int value)
                __raw_writel(mask, pxa->regbase + GPCR_OFFSET);
 }
 
+#define GPIO_CHIP(_n)                                                  \
+       [_n] = {                                                        \
+               .regbase = GPIO##_n##_BASE,                             \
+               .chip = {                                               \
+                       .label            = "gpio-" #_n,                \
+                       .direction_input  = pxa_gpio_direction_input,   \
+                       .direction_output = pxa_gpio_direction_output,  \
+                       .get              = pxa_gpio_get,               \
+                       .set              = pxa_gpio_set,               \
+                       .base             = (_n) * 32,                  \
+                       .ngpio            = 32,                         \
+               },                                                      \
+       }
+
 static struct pxa_gpio_chip pxa_gpio_chip[] = {
-       [0] = {
-               .regbase = GPIO0_BASE,
-               .chip = {
-                       .label            = "gpio-0",
-                       .direction_input  = pxa_gpio_direction_input,
-                       .direction_output = pxa_gpio_direction_output,
-                       .get              = pxa_gpio_get,
-                       .set              = pxa_gpio_set,
-                       .base             = 0,
-                       .ngpio            = 32,
-               },
-       },
-       [1] = {
-               .regbase = GPIO1_BASE,
-               .chip = {
-                       .label            = "gpio-1",
-                       .direction_input  = pxa_gpio_direction_input,
-                       .direction_output = pxa_gpio_direction_output,
-                       .get              = pxa_gpio_get,
-                       .set              = pxa_gpio_set,
-                       .base             = 32,
-                       .ngpio            = 32,
-               },
-       },
-       [2] = {
-               .regbase = GPIO2_BASE,
-               .chip = {
-                       .label            = "gpio-2",
-                       .direction_input  = pxa_gpio_direction_input,
-                       .direction_output = pxa_gpio_direction_output,
-                       .get              = pxa_gpio_get,
-                       .set              = pxa_gpio_set,
-                       .base             = 64,
-                       .ngpio            = 32, /* 21 for PXA25x */
-               },
-       },
+       GPIO_CHIP(0),
+       GPIO_CHIP(1),
+       GPIO_CHIP(2),
 #if defined(CONFIG_PXA27x) || defined(CONFIG_PXA3xx)
-       [3] = {
-               .regbase = GPIO3_BASE,
-               .chip = {
-                       .label            = "gpio-3",
-                       .direction_input  = pxa_gpio_direction_input,
-                       .direction_output = pxa_gpio_direction_output,
-                       .get              = pxa_gpio_get,
-                       .set              = pxa_gpio_set,
-                       .base             = 96,
-                       .ngpio            = 32,
-               },
-       },
+       GPIO_CHIP(3),
 #endif
 };
 
-void __init pxa_init_gpio(int gpio_nr)
+/*
+ * PXA GPIO edge detection for IRQs:
+ * IRQs are generated on Falling-Edge, Rising-Edge, or both.
+ * Use this instead of directly setting GRER/GFER.
+ */
+
+static unsigned long GPIO_IRQ_rising_edge[4];
+static unsigned long GPIO_IRQ_falling_edge[4];
+static unsigned long GPIO_IRQ_mask[4];
+
+/*
+ * On PXA25x and PXA27x, GAFRx and GPDRx together decide the alternate
+ * function of a GPIO, and GPDRx cannot be altered once configured. It
+ * is attributed as "occupied" here (I know this terminology isn't
+ * accurate, you are welcome to propose a better one :-)
+ */
+static int __gpio_is_occupied(unsigned gpio)
+{
+       if (cpu_is_pxa25x() || cpu_is_pxa27x())
+               return GAFR(gpio) & (0x3 << (((gpio) & 0xf) * 2));
+       else
+               return 0;
+}
+
+static int pxa_gpio_irq_type(unsigned int irq, unsigned int type)
+{
+       int gpio, idx;
+
+       gpio = IRQ_TO_GPIO(irq);
+       idx = gpio >> 5;
+
+       if (type == IRQ_TYPE_PROBE) {
+               /* Don't mess with enabled GPIOs using preconfigured edges or
+                * GPIOs set to alternate function or to output during probe
+                */
+               if ((GPIO_IRQ_rising_edge[idx] |
+                    GPIO_IRQ_falling_edge[idx] |
+                    GPDR(gpio)) & GPIO_bit(gpio))
+                       return 0;
+
+               if (__gpio_is_occupied(gpio))
+                       return 0;
+
+               type = IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING;
+       }
+
+       GPDR(gpio) &= ~GPIO_bit(gpio);
+
+       if (type & IRQ_TYPE_EDGE_RISING)
+               __set_bit(gpio, GPIO_IRQ_rising_edge);
+       else
+               __clear_bit(gpio, GPIO_IRQ_rising_edge);
+
+       if (type & IRQ_TYPE_EDGE_FALLING)
+               __set_bit(gpio, GPIO_IRQ_falling_edge);
+       else
+               __clear_bit(gpio, GPIO_IRQ_falling_edge);
+
+       GRER(gpio) = GPIO_IRQ_rising_edge[idx] & GPIO_IRQ_mask[idx];
+       GFER(gpio) = GPIO_IRQ_falling_edge[idx] & GPIO_IRQ_mask[idx];
+
+       pr_debug("%s: IRQ%d (GPIO%d) - edge%s%s\n", __func__, irq, gpio,
+               ((type & IRQ_TYPE_EDGE_RISING)  ? " rising"  : ""),
+               ((type & IRQ_TYPE_EDGE_FALLING) ? " falling" : ""));
+       return 0;
+}
+
+/*
+ * GPIO IRQs must be acknowledged.  This is for GPIO 0 and 1.
+ */
+
+static void pxa_ack_low_gpio(unsigned int irq)
+{
+       GEDR0 = (1 << (irq - IRQ_GPIO0));
+}
+
+static void pxa_mask_low_gpio(unsigned int irq)
+{
+       ICMR &= ~(1 << (irq - PXA_IRQ(0)));
+}
+
+static void pxa_unmask_low_gpio(unsigned int irq)
+{
+       ICMR |= 1 << (irq - PXA_IRQ(0));
+}
+
+static struct irq_chip pxa_low_gpio_chip = {
+       .name           = "GPIO-l",
+       .ack            = pxa_ack_low_gpio,
+       .mask           = pxa_mask_low_gpio,
+       .unmask         = pxa_unmask_low_gpio,
+       .set_type       = pxa_gpio_irq_type,
+};
+
+/*
+ * Demux handler for GPIO>=2 edge detect interrupts
+ */
+
+#define GEDR_BITS      (sizeof(gedr) * BITS_PER_BYTE)
+
+static void pxa_gpio_demux_handler(unsigned int irq, struct irq_desc *desc)
+{
+       int loop, bit, n;
+       unsigned long gedr[4];
+
+       do {
+               gedr[0] = GEDR0 & GPIO_IRQ_mask[0] & ~3;
+               gedr[1] = GEDR1 & GPIO_IRQ_mask[1];
+               gedr[2] = GEDR2 & GPIO_IRQ_mask[2];
+               gedr[3] = GEDR3 & GPIO_IRQ_mask[3];
+
+               GEDR0 = gedr[0]; GEDR1 = gedr[1];
+               GEDR2 = gedr[2]; GEDR3 = gedr[3];
+
+               loop = 0;
+               bit = find_first_bit(gedr, GEDR_BITS);
+               while (bit < GEDR_BITS) {
+                       loop = 1;
+
+                       n = PXA_GPIO_IRQ_BASE + bit;
+                       desc_handle_irq(n, irq_desc + n);
+
+                       bit = find_next_bit(gedr, GEDR_BITS, bit + 1);
+               }
+       } while (loop);
+}
+
+static void pxa_ack_muxed_gpio(unsigned int irq)
+{
+       int gpio = irq - IRQ_GPIO(2) + 2;
+       GEDR(gpio) = GPIO_bit(gpio);
+}
+
+static void pxa_mask_muxed_gpio(unsigned int irq)
+{
+       int gpio = irq - IRQ_GPIO(2) + 2;
+       __clear_bit(gpio, GPIO_IRQ_mask);
+       GRER(gpio) &= ~GPIO_bit(gpio);
+       GFER(gpio) &= ~GPIO_bit(gpio);
+}
+
+static void pxa_unmask_muxed_gpio(unsigned int irq)
+{
+       int gpio = irq - IRQ_GPIO(2) + 2;
+       int idx = gpio >> 5;
+       __set_bit(gpio, GPIO_IRQ_mask);
+       GRER(gpio) = GPIO_IRQ_rising_edge[idx] & GPIO_IRQ_mask[idx];
+       GFER(gpio) = GPIO_IRQ_falling_edge[idx] & GPIO_IRQ_mask[idx];
+}
+
+static struct irq_chip pxa_muxed_gpio_chip = {
+       .name           = "GPIO",
+       .ack            = pxa_ack_muxed_gpio,
+       .mask           = pxa_mask_muxed_gpio,
+       .unmask         = pxa_unmask_muxed_gpio,
+       .set_type       = pxa_gpio_irq_type,
+};
+
+void __init pxa_init_gpio(int gpio_nr, set_wake_t fn)
 {
-       int i;
+       int irq, i, gpio;
+
+       pxa_last_gpio = gpio_nr - 1;
+
+       /* clear all GPIO edge detects */
+       for (i = 0; i < gpio_nr; i += 32) {
+               GFER(i) = 0;
+               GRER(i) = 0;
+               GEDR(i) = GEDR(i);
+       }
+
+       /* GPIO 0 and 1 must have their mask bit always set */
+       GPIO_IRQ_mask[0] = 3;
+
+       for (irq = IRQ_GPIO0; irq <= IRQ_GPIO1; irq++) {
+               set_irq_chip(irq, &pxa_low_gpio_chip);
+               set_irq_handler(irq, handle_edge_irq);
+               set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
+       }
+
+       for (irq = IRQ_GPIO(2); irq < IRQ_GPIO(gpio_nr); irq++) {
+               set_irq_chip(irq, &pxa_muxed_gpio_chip);
+               set_irq_handler(irq, handle_edge_irq);
+               set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
+       }
+
+       /* Install handler for GPIO>=2 edge detect interrupts */
+       set_irq_chained_handler(IRQ_GPIO_2_x, pxa_gpio_demux_handler);
+
+       pxa_low_gpio_chip.set_wake = fn;
+       pxa_muxed_gpio_chip.set_wake = fn;
 
        /* add a GPIO chip for each register bank.
         * the last PXA25x register only contains 21 GPIOs
         */
-       for (i = 0; i < gpio_nr; i += 32) {
-               if (i+32 > gpio_nr)
-                       pxa_gpio_chip[i/32].chip.ngpio = gpio_nr - i;
-               gpiochip_add(&pxa_gpio_chip[i/32].chip);
+       for (gpio = 0, i = 0; gpio < gpio_nr; gpio += 32, i++) {
+               if (gpio + 32 > gpio_nr)
+                       pxa_gpio_chip[i].chip.ngpio = gpio_nr - gpio;
+               gpiochip_add(&pxa_gpio_chip[i].chip);
        }
 }
+
+#ifdef CONFIG_PM
+
+static unsigned long saved_gplr[4];
+static unsigned long saved_gpdr[4];
+static unsigned long saved_grer[4];
+static unsigned long saved_gfer[4];
+
+static int pxa_gpio_suspend(struct sys_device *dev, pm_message_t state)
+{
+       int i, gpio;
+
+       for (gpio = 0, i = 0; gpio < pxa_last_gpio; gpio += 32, i++) {
+               saved_gplr[i] = GPLR(gpio);
+               saved_gpdr[i] = GPDR(gpio);
+               saved_grer[i] = GRER(gpio);
+               saved_gfer[i] = GFER(gpio);
+
+               /* Clear GPIO transition detect bits */
+               GEDR(gpio) = GEDR(gpio);
+       }
+       return 0;
+}
+
+static int pxa_gpio_resume(struct sys_device *dev)
+{
+       int i, gpio;
+
+       for (gpio = 0, i = 0; gpio < pxa_last_gpio; gpio += 32, i++) {
+               /* restore level with set/clear */
+               GPSR(gpio) = saved_gplr[i];
+               GPCR(gpio) = ~saved_gplr[i];
+
+               GRER(gpio) = saved_grer[i];
+               GFER(gpio) = saved_gfer[i];
+               GPDR(gpio) = saved_gpdr[i];
+       }
+       return 0;
+}
+#else
+#define pxa_gpio_suspend       NULL
+#define pxa_gpio_resume                NULL
+#endif
+
+struct sysdev_class pxa_gpio_sysclass = {
+       .name           = "gpio",
+       .suspend        = pxa_gpio_suspend,
+       .resume         = pxa_gpio_resume,
+};
+
+static int __init pxa_gpio_init(void)
+{
+       return sysdev_class_register(&pxa_gpio_sysclass);
+}
+
+core_initcall(pxa_gpio_init);
diff --git a/arch/arm/mach-pxa/gumstix.c b/arch/arm/mach-pxa/gumstix.c
new file mode 100644 (file)
index 0000000..f01d185
--- /dev/null
@@ -0,0 +1,147 @@
+/*
+ *  linux/arch/arm/mach-pxa/gumstix.c
+ *
+ *  Support for the Gumstix motherboards.
+ *
+ *  Original Author:   Craig Hughes
+ *  Created:   Feb 14, 2008
+ *  Copyright: Craig Hughes
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License version 2 as
+ *  published by the Free Software Foundation.
+ *
+ *  Implemented based on lubbock.c by Nicolas Pitre and code from Craig
+ *  Hughes
+ */
+
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/platform_device.h>
+#include <linux/interrupt.h>
+#include <linux/mtd/mtd.h>
+#include <linux/mtd/partitions.h>
+
+#include <asm/setup.h>
+#include <asm/memory.h>
+#include <asm/mach-types.h>
+#include <asm/hardware.h>
+#include <asm/irq.h>
+#include <asm/sizes.h>
+
+#include <asm/mach/arch.h>
+#include <asm/mach/map.h>
+#include <asm/mach/irq.h>
+#include <asm/mach/flash.h>
+#include <asm/arch/mmc.h>
+#include <asm/arch/udc.h>
+#include <asm/arch/gumstix.h>
+
+#include <asm/arch/pxa-regs.h>
+#include <asm/arch/pxa2xx-regs.h>
+
+#include "generic.h"
+
+static struct resource flash_resource = {
+       .start  = 0x00000000,
+       .end    = SZ_64M - 1,
+       .flags  = IORESOURCE_MEM,
+};
+
+static struct mtd_partition gumstix_partitions[] = {
+       {
+               .name =         "Bootloader",
+               .size =         0x00040000,
+               .offset =       0,
+               .mask_flags =   MTD_WRITEABLE  /* force read-only */
+       } , {
+               .name =         "rootfs",
+               .size =         MTDPART_SIZ_FULL,
+               .offset =       MTDPART_OFS_APPEND
+       }
+};
+
+static struct flash_platform_data gumstix_flash_data = {
+       .map_name       = "cfi_probe",
+       .parts          = gumstix_partitions,
+       .nr_parts       = ARRAY_SIZE(gumstix_partitions),
+       .width          = 2,
+};
+
+static struct platform_device gumstix_flash_device = {
+       .name           = "pxa2xx-flash",
+       .id             = 0,
+       .dev = {
+               .platform_data = &gumstix_flash_data,
+       },
+       .resource = &flash_resource,
+       .num_resources = 1,
+};
+
+static struct platform_device *devices[] __initdata = {
+       &gumstix_flash_device,
+};
+
+#ifdef CONFIG_MMC_PXA
+static struct pxamci_platform_data gumstix_mci_platform_data;
+
+static int gumstix_mci_init(struct device *dev, irq_handler_t detect_int,
+                               void *data)
+{
+       pxa_gpio_mode(GPIO6_MMCCLK_MD);
+       pxa_gpio_mode(GPIO53_MMCCLK_MD);
+       pxa_gpio_mode(GPIO8_MMCCS0_MD);
+
+       return 0;
+}
+
+static struct pxamci_platform_data gumstix_mci_platform_data = {
+       .ocr_mask       = MMC_VDD_32_33|MMC_VDD_33_34,
+       .init           = gumstix_mci_init,
+};
+
+static void __init gumstix_mmc_init(void)
+{
+       pxa_set_mci_info(&gumstix_mci_platform_data);
+}
+#else
+static void __init gumstix_mmc_init(void)
+{
+       printk(KERN_INFO "Gumstix mmc disabled\n");
+}
+#endif
+
+#ifdef CONFIG_USB_GADGET_PXA2XX
+static struct pxa2xx_udc_mach_info gumstix_udc_info __initdata = {
+       .gpio_vbus              = GPIO_GUMSTIX_USB_GPIOn,
+       .gpio_pullup            = GPIO_GUMSTIX_USB_GPIOx,
+};
+
+static void __init gumstix_udc_init(void)
+{
+       pxa_set_udc_info(&gumstix_udc_info);
+}
+#else
+static void gumstix_udc_init(void)
+{
+       printk(KERN_INFO "Gumstix udc is disabled\n");
+}
+#endif
+
+static void __init gumstix_init(void)
+{
+       gumstix_udc_init();
+       gumstix_mmc_init();
+       (void) platform_add_devices(devices, ARRAY_SIZE(devices));
+}
+
+MACHINE_START(GUMSTIX, "Gumstix")
+       .phys_io        = 0x40000000,
+       .boot_params    = 0xa0000100, /* match u-boot bi_boot_params */
+       .io_pg_offst    = (io_p2v(0x40000000) >> 18) & 0xfffc,
+       .map_io         = pxa_map_io,
+       .init_irq       = pxa25x_init_irq,
+       .timer          = &pxa_timer,
+       .init_machine   = gumstix_init,
+MACHINE_END
index 0a9434432c55162fa047164e04c3d538bfb40dbe..2637633f9166bbf2219ffa227f50ffa4d38b668d 100644 (file)
@@ -32,6 +32,7 @@
 #include <asm/mach/map.h>
 
 #include <asm/arch/pxa-regs.h>
+#include <asm/arch/pxa2xx-gpio.h>
 #include <asm/arch/idp.h>
 #include <asm/arch/pxafb.h>
 #include <asm/arch/bitfield.h>
index 36c6a68beca26e1fa895d6ebb2373bd4bdd0eed6..a9a0c3fab159744900a60b6bbbc27b5dd1385be2 100644 (file)
@@ -1,7 +1,7 @@
 /*
  *  linux/arch/arm/mach-pxa/irq.c
  *
- *  Generic PXA IRQ handling, GPIO IRQ demultiplexing, etc.
+ *  Generic PXA IRQ handling
  *
  *  Author:    Nicolas Pitre
  *  Created:   Jun 15, 2001
 #include <asm/irq.h>
 #include <asm/mach/irq.h>
 #include <asm/arch/pxa-regs.h>
+#include <asm/arch/pxa2xx-gpio.h>
 
 #include "generic.h"
 
+#define IRQ_BIT(n)     (((n) - PXA_IRQ(0)) & 0x1f)
+#define _ICMR(n)       (*((((n) - PXA_IRQ(0)) & ~0x1f) ? &ICMR2 : &ICMR))
+#define _ICLR(n)       (*((((n) - PXA_IRQ(0)) & ~0x1f) ? &ICLR2 : &ICLR))
 
 /*
  * This is for peripheral IRQs internal to the PXA chip.
  */
 
-static void pxa_mask_low_irq(unsigned int irq)
+static int pxa_internal_irq_nr;
+
+static void pxa_mask_irq(unsigned int irq)
 {
-       ICMR &= ~(1 << irq);
+       _ICMR(irq) &= ~(1 << IRQ_BIT(irq));
 }
 
-static void pxa_unmask_low_irq(unsigned int irq)
+static void pxa_unmask_irq(unsigned int irq)
 {
-       ICMR |= (1 << irq);
+       _ICMR(irq) |= 1 << IRQ_BIT(irq);
 }
 
-static struct irq_chip pxa_internal_chip_low = {
+static struct irq_chip pxa_internal_irq_chip = {
        .name           = "SC",
-       .ack            = pxa_mask_low_irq,
-       .mask           = pxa_mask_low_irq,
-       .unmask         = pxa_unmask_low_irq,
+       .ack            = pxa_mask_irq,
+       .mask           = pxa_mask_irq,
+       .unmask         = pxa_unmask_irq,
 };
 
-void __init pxa_init_irq_low(void)
+void __init pxa_init_irq(int irq_nr, set_wake_t fn)
 {
        int irq;
 
-       /* disable all IRQs */
-       ICMR = 0;
+       pxa_internal_irq_nr = irq_nr;
 
-       /* all IRQs are IRQ, not FIQ */
-       ICLR = 0;
+       for (irq = 0; irq < irq_nr; irq += 32) {
+               _ICMR(irq) = 0; /* disable all IRQs */
+               _ICLR(irq) = 0; /* all IRQs are IRQ, not FIQ */
+       }
 
        /* only unmasked interrupts kick us out of idle */
        ICCR = 1;
 
-       for (irq = PXA_IRQ(0); irq <= PXA_IRQ(31); irq++) {
-               set_irq_chip(irq, &pxa_internal_chip_low);
-               set_irq_handler(irq, handle_level_irq);
-               set_irq_flags(irq, IRQF_VALID);
-       }
-}
-
-#if defined(CONFIG_PXA27x) || defined(CONFIG_PXA3xx)
-
-/*
- * This is for the second set of internal IRQs as found on the PXA27x.
- */
-
-static void pxa_mask_high_irq(unsigned int irq)
-{
-       ICMR2 &= ~(1 << (irq - 32));
-}
-
-static void pxa_unmask_high_irq(unsigned int irq)
-{
-       ICMR2 |= (1 << (irq - 32));
-}
-
-static struct irq_chip pxa_internal_chip_high = {
-       .name           = "SC-hi",
-       .ack            = pxa_mask_high_irq,
-       .mask           = pxa_mask_high_irq,
-       .unmask         = pxa_unmask_high_irq,
-};
-
-void __init pxa_init_irq_high(void)
-{
-       int irq;
-
-       ICMR2 = 0;
-       ICLR2 = 0;
-
-       for (irq = PXA_IRQ(32); irq < PXA_IRQ(64); irq++) {
-               set_irq_chip(irq, &pxa_internal_chip_high);
+       for (irq = PXA_IRQ(0); irq < PXA_IRQ(irq_nr); irq++) {
+               set_irq_chip(irq, &pxa_internal_irq_chip);
                set_irq_handler(irq, handle_level_irq);
                set_irq_flags(irq, IRQF_VALID);
        }
-}
-#endif
-
-/*
- * PXA GPIO edge detection for IRQs:
- * IRQs are generated on Falling-Edge, Rising-Edge, or both.
- * Use this instead of directly setting GRER/GFER.
- */
-
-static long GPIO_IRQ_rising_edge[4];
-static long GPIO_IRQ_falling_edge[4];
-static long GPIO_IRQ_mask[4];
-
-static int pxa_gpio_irq_type(unsigned int irq, unsigned int type)
-{
-       int gpio, idx;
-
-       gpio = IRQ_TO_GPIO(irq);
-       idx = gpio >> 5;
-
-       if (type == IRQT_PROBE) {
-           /* Don't mess with enabled GPIOs using preconfigured edges or
-              GPIOs set to alternate function or to output during probe */
-               if ((GPIO_IRQ_rising_edge[idx] | GPIO_IRQ_falling_edge[idx] | GPDR(gpio)) &
-                   GPIO_bit(gpio))
-                       return 0;
-               if (GAFR(gpio) & (0x3 << (((gpio) & 0xf)*2)))
-                       return 0;
-               type = __IRQT_RISEDGE | __IRQT_FALEDGE;
-       }
-
-       /* printk(KERN_DEBUG "IRQ%d (GPIO%d): ", irq, gpio); */
-
-       pxa_gpio_mode(gpio | GPIO_IN);
-
-       if (type & __IRQT_RISEDGE) {
-               /* printk("rising "); */
-               __set_bit (gpio, GPIO_IRQ_rising_edge);
-       } else {
-               __clear_bit (gpio, GPIO_IRQ_rising_edge);
-       }
-
-       if (type & __IRQT_FALEDGE) {
-               /* printk("falling "); */
-               __set_bit (gpio, GPIO_IRQ_falling_edge);
-       } else {
-               __clear_bit (gpio, GPIO_IRQ_falling_edge);
-       }
-
-       /* printk("edges\n"); */
-
-       GRER(gpio) = GPIO_IRQ_rising_edge[idx] & GPIO_IRQ_mask[idx];
-       GFER(gpio) = GPIO_IRQ_falling_edge[idx] & GPIO_IRQ_mask[idx];
-       return 0;
-}
-
-/*
- * GPIO IRQs must be acknowledged.  This is for GPIO 0 and 1.
- */
-
-static void pxa_ack_low_gpio(unsigned int irq)
-{
-       GEDR0 = (1 << (irq - IRQ_GPIO0));
-}
-
-static struct irq_chip pxa_low_gpio_chip = {
-       .name           = "GPIO-l",
-       .ack            = pxa_ack_low_gpio,
-       .mask           = pxa_mask_low_irq,
-       .unmask         = pxa_unmask_low_irq,
-       .set_type       = pxa_gpio_irq_type,
-};
-
-/*
- * Demux handler for GPIO>=2 edge detect interrupts
- */
-
-static void pxa_gpio_demux_handler(unsigned int irq, struct irq_desc *desc)
-{
-       unsigned int mask;
-       int loop;
-
-       do {
-               loop = 0;
-
-               mask = GEDR0 & GPIO_IRQ_mask[0] & ~3;
-               if (mask) {
-                       GEDR0 = mask;
-                       irq = IRQ_GPIO(2);
-                       desc = irq_desc + irq;
-                       mask >>= 2;
-                       do {
-                               if (mask & 1)
-                                       desc_handle_irq(irq, desc);
-                               irq++;
-                               desc++;
-                               mask >>= 1;
-                       } while (mask);
-                       loop = 1;
-               }
-
-               mask = GEDR1 & GPIO_IRQ_mask[1];
-               if (mask) {
-                       GEDR1 = mask;
-                       irq = IRQ_GPIO(32);
-                       desc = irq_desc + irq;
-                       do {
-                               if (mask & 1)
-                                       desc_handle_irq(irq, desc);
-                               irq++;
-                               desc++;
-                               mask >>= 1;
-                       } while (mask);
-                       loop = 1;
-               }
-
-               mask = GEDR2 & GPIO_IRQ_mask[2];
-               if (mask) {
-                       GEDR2 = mask;
-                       irq = IRQ_GPIO(64);
-                       desc = irq_desc + irq;
-                       do {
-                               if (mask & 1)
-                                       desc_handle_irq(irq, desc);
-                               irq++;
-                               desc++;
-                               mask >>= 1;
-                       } while (mask);
-                       loop = 1;
-               }
-
-               mask = GEDR3 & GPIO_IRQ_mask[3];
-               if (mask) {
-                       GEDR3 = mask;
-                       irq = IRQ_GPIO(96);
-                       desc = irq_desc + irq;
-                       do {
-                               if (mask & 1)
-                                       desc_handle_irq(irq, desc);
-                               irq++;
-                               desc++;
-                               mask >>= 1;
-                       } while (mask);
-                       loop = 1;
-               }
-       } while (loop);
-}
-
-static void pxa_ack_muxed_gpio(unsigned int irq)
-{
-       int gpio = irq - IRQ_GPIO(2) + 2;
-       GEDR(gpio) = GPIO_bit(gpio);
-}
-
-static void pxa_mask_muxed_gpio(unsigned int irq)
-{
-       int gpio = irq - IRQ_GPIO(2) + 2;
-       __clear_bit(gpio, GPIO_IRQ_mask);
-       GRER(gpio) &= ~GPIO_bit(gpio);
-       GFER(gpio) &= ~GPIO_bit(gpio);
-}
-
-static void pxa_unmask_muxed_gpio(unsigned int irq)
-{
-       int gpio = irq - IRQ_GPIO(2) + 2;
-       int idx = gpio >> 5;
-       __set_bit(gpio, GPIO_IRQ_mask);
-       GRER(gpio) = GPIO_IRQ_rising_edge[idx] & GPIO_IRQ_mask[idx];
-       GFER(gpio) = GPIO_IRQ_falling_edge[idx] & GPIO_IRQ_mask[idx];
-}
-
-static struct irq_chip pxa_muxed_gpio_chip = {
-       .name           = "GPIO",
-       .ack            = pxa_ack_muxed_gpio,
-       .mask           = pxa_mask_muxed_gpio,
-       .unmask         = pxa_unmask_muxed_gpio,
-       .set_type       = pxa_gpio_irq_type,
-};
-
-void __init pxa_init_irq_gpio(int gpio_nr)
-{
-       int irq, i;
-
-       pxa_last_gpio = gpio_nr - 1;
-
-       /* clear all GPIO edge detects */
-       for (i = 0; i < gpio_nr; i += 32) {
-               GFER(i) = 0;
-               GRER(i) = 0;
-               GEDR(i) = GEDR(i);
-       }
-
-       /* GPIO 0 and 1 must have their mask bit always set */
-       GPIO_IRQ_mask[0] = 3;
-
-       for (irq = IRQ_GPIO0; irq <= IRQ_GPIO1; irq++) {
-               set_irq_chip(irq, &pxa_low_gpio_chip);
-               set_irq_handler(irq, handle_edge_irq);
-               set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
-       }
 
-       for (irq = IRQ_GPIO(2); irq < IRQ_GPIO(gpio_nr); irq++) {
-               set_irq_chip(irq, &pxa_muxed_gpio_chip);
-               set_irq_handler(irq, handle_edge_irq);
-               set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
-       }
-
-       /* Install handler for GPIO>=2 edge detect interrupts */
-       set_irq_chip(IRQ_GPIO_2_x, &pxa_internal_chip_low);
-       set_irq_chained_handler(IRQ_GPIO_2_x, pxa_gpio_demux_handler);
-
-       pxa_init_gpio(gpio_nr);
-}
-
-void __init pxa_init_irq_set_wake(int (*set_wake)(unsigned int, unsigned int))
-{
-       pxa_internal_chip_low.set_wake = set_wake;
-#ifdef CONFIG_PXA27x
-       pxa_internal_chip_high.set_wake = set_wake;
-#endif
-       pxa_low_gpio_chip.set_wake = set_wake;
-       pxa_muxed_gpio_chip.set_wake = set_wake;
+       pxa_internal_irq_chip.set_wake = fn;
 }
 
 #ifdef CONFIG_PM
@@ -330,19 +80,11 @@ static unsigned long saved_icmr[2];
 
 static int pxa_irq_suspend(struct sys_device *dev, pm_message_t state)
 {
-       switch (dev->id) {
-       case 0:
-               saved_icmr[0] = ICMR;
-               ICMR = 0;
-               break;
-#if defined(CONFIG_PXA27x) || defined(CONFIG_PXA3xx)
-       case 1:
-               saved_icmr[1] = ICMR2;
-               ICMR2 = 0;
-               break;
-#endif
-       default:
-               return -EINVAL;
+       int i, irq = PXA_IRQ(0);
+
+       for (i = 0; irq < PXA_IRQ(pxa_internal_irq_nr); i++, irq += 32) {
+               saved_icmr[i] = _ICMR(irq);
+               _ICMR(irq) = 0;
        }
 
        return 0;
@@ -350,22 +92,14 @@ static int pxa_irq_suspend(struct sys_device *dev, pm_message_t state)
 
 static int pxa_irq_resume(struct sys_device *dev)
 {
-       switch (dev->id) {
-       case 0:
-               ICMR = saved_icmr[0];
-               ICLR = 0;
-               ICCR = 1;
-               break;
-#if defined(CONFIG_PXA27x) || defined(CONFIG_PXA3xx)
-       case 1:
-               ICMR2 = saved_icmr[1];
-               ICLR2 = 0;
-               break;
-#endif
-       default:
-               return -EINVAL;
+       int i, irq = PXA_IRQ(0);
+
+       for (i = 0; irq < PXA_IRQ(pxa_internal_irq_nr); i++, irq += 32) {
+               _ICMR(irq) = saved_icmr[i];
+               _ICLR(irq) = 0;
        }
 
+       ICCR = 1;
        return 0;
 }
 #else
index 2271d20ffedaf7dc1abc1dc64ba747aa91e8c762..21880daabafea85a790c2c04616d1ba4bc16fa3c 100644 (file)
@@ -18,6 +18,7 @@
 #include <asm/leds.h>
 
 #include <asm/arch/pxa-regs.h>
+#include <asm/arch/pxa2xx-gpio.h>
 #include <asm/arch/trizeps4.h>
 
 #include "leds.h"
index 0a4b54c21314a4c7b7ddad589296e9880a1febb0..03396063b561b0c1a9ef71cc09f57d73c22a2e92 100644 (file)
 #include <asm/arch/gpio.h>
 #include <asm/arch/pxafb.h>
 #include <asm/arch/ssp.h>
+#include <asm/arch/pxa27x_keypad.h>
 #include <asm/arch/littleton.h>
 
 #include "generic.h"
 
-#define ARRAY_AND_SIZE(x)      (x), ARRAY_SIZE(x)
-
 /* Littleton MFP configurations */
 static mfp_cfg_t littleton_mfp_cfg[] __initdata = {
        /* LCD */
@@ -76,6 +75,21 @@ static mfp_cfg_t littleton_mfp_cfg[] __initdata = {
 
        /* Debug Ethernet */
        GPIO90_GPIO,
+
+       /* Keypad */
+       GPIO107_KP_DKIN_0,
+       GPIO108_KP_DKIN_1,
+       GPIO115_KP_MKIN_0,
+       GPIO116_KP_MKIN_1,
+       GPIO117_KP_MKIN_2,
+       GPIO118_KP_MKIN_3,
+       GPIO119_KP_MKIN_4,
+       GPIO120_KP_MKIN_5,
+       GPIO121_KP_MKOUT_0,
+       GPIO122_KP_MKOUT_1,
+       GPIO123_KP_MKOUT_2,
+       GPIO124_KP_MKOUT_3,
+       GPIO125_KP_MKOUT_4,
 };
 
 static struct resource smc91x_resources[] = {
@@ -300,6 +314,54 @@ static void littleton_init_lcd(void)
 static inline void littleton_init_lcd(void) {};
 #endif /* CONFIG_FB_PXA || CONFIG_FB_PXA_MODULES */
 
+#if defined(CONFIG_KEYBOARD_PXA27x) || defined(CONFIG_KEYBOARD_PXA27x_MODULES)
+static unsigned int littleton_matrix_key_map[] = {
+       /* KEY(row, col, key_code) */
+       KEY(1, 3, KEY_0), KEY(0, 0, KEY_1), KEY(1, 0, KEY_2), KEY(2, 0, KEY_3),
+       KEY(0, 1, KEY_4), KEY(1, 1, KEY_5), KEY(2, 1, KEY_6), KEY(0, 2, KEY_7),
+       KEY(1, 2, KEY_8), KEY(2, 2, KEY_9),
+
+       KEY(0, 3, KEY_KPASTERISK),      /* * */
+       KEY(2, 3, KEY_KPDOT),           /* # */
+
+       KEY(5, 4, KEY_ENTER),
+
+       KEY(5, 0, KEY_UP),
+       KEY(5, 1, KEY_DOWN),
+       KEY(5, 2, KEY_LEFT),
+       KEY(5, 3, KEY_RIGHT),
+       KEY(3, 2, KEY_HOME),
+       KEY(4, 1, KEY_END),
+       KEY(3, 3, KEY_BACK),
+
+       KEY(4, 0, KEY_SEND),
+       KEY(4, 2, KEY_VOLUMEUP),
+       KEY(4, 3, KEY_VOLUMEDOWN),
+
+       KEY(3, 0, KEY_F22),     /* soft1 */
+       KEY(3, 1, KEY_F23),     /* soft2 */
+};
+
+static struct pxa27x_keypad_platform_data littleton_keypad_info = {
+       .matrix_key_rows        = 6,
+       .matrix_key_cols        = 5,
+       .matrix_key_map         = littleton_matrix_key_map,
+       .matrix_key_map_size    = ARRAY_SIZE(littleton_matrix_key_map),
+
+       .enable_rotary0         = 1,
+       .rotary0_up_key         = KEY_UP,
+       .rotary0_down_key       = KEY_DOWN,
+
+       .debounce_interval      = 30,
+};
+static void __init littleton_init_keypad(void)
+{
+       pxa_set_keypad_info(&littleton_keypad_info);
+}
+#else
+static inline void littleton_init_keypad(void) {}
+#endif
+
 static void __init littleton_init(void)
 {
        /* initialize MFP configurations */
@@ -312,6 +374,7 @@ static void __init littleton_init(void)
        platform_device_register(&smc91x_device);
 
        littleton_init_lcd();
+       littleton_init_keypad();
 }
 
 MACHINE_START(LITTLETON, "Marvell Form Factor Development Platform (aka Littleton)")
index afa62ffe3ad5d0ccb1e8a31cec66a57937d432f5..a20e4b1649d60493df741d3ef1a0857f775704e3 100644 (file)
@@ -39,6 +39,7 @@
 
 #include <asm/arch/pxa-regs.h>
 #include <asm/arch/pxa2xx-regs.h>
+#include <asm/arch/pxa2xx-gpio.h>
 #include <asm/arch/lpd270.h>
 #include <asm/arch/audio.h>
 #include <asm/arch/pxafb.h>
index e7ae4bb3e36105b63f6f51463da5651c7bc52161..ca209c443f34c3c90fce9b8979ce04ac86702c4e 100644 (file)
@@ -42,6 +42,7 @@
 
 #include <asm/arch/pxa-regs.h>
 #include <asm/arch/pxa2xx-regs.h>
+#include <asm/arch/mfp-pxa25x.h>
 #include <asm/arch/lubbock.h>
 #include <asm/arch/udc.h>
 #include <asm/arch/irda.h>
 #include "generic.h"
 #include "devices.h"
 
+static unsigned long lubbock_pin_config[] __initdata = {
+       GPIO15_nCS_1,   /* CS1 - Flash */
+       GPIO79_nCS_3,   /* CS3 - SMC ethernet */
+
+       /* SSP data pins */
+       GPIO23_SSP1_SCLK,
+       GPIO25_SSP1_TXD,
+       GPIO26_SSP1_RXD,
+
+       /* BTUART */
+       GPIO42_BTUART_RXD,
+       GPIO43_BTUART_TXD,
+       GPIO44_BTUART_CTS,
+       GPIO45_BTUART_RTS,
+
+       /* PC Card */
+       GPIO48_nPOE,
+       GPIO49_nPWE,
+       GPIO50_nPIOR,
+       GPIO51_nPIOW,
+       GPIO52_nPCE_1,
+       GPIO53_nPCE_2,
+       GPIO54_nPSKTSEL,
+       GPIO55_nPREG,
+       GPIO56_nPWAIT,
+       GPIO57_nIOIS16,
+
+       /* MMC */
+       GPIO6_MMC_CLK,
+       GPIO8_MMC_CS0,
+
+       /* wakeup */
+       GPIO1_GPIO | WAKEUP_ON_EDGE_RISE,
+};
 
 #define LUB_MISC_WR            __LUB_REG(LUBBOCK_FPGA_PHYS + 0x080)
 
@@ -186,26 +221,6 @@ static struct platform_device sa1111_device = {
        .resource       = sa1111_resources,
 };
 
-static struct resource smc91x_resources[] = {
-       [0] = {
-               .name   = "smc91x-regs",
-               .start  = 0x0c000c00,
-               .end    = 0x0c0fffff,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = LUBBOCK_ETH_IRQ,
-               .end    = LUBBOCK_ETH_IRQ,
-               .flags  = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE,
-       },
-       [2] = {
-               .name   = "smc91x-attrib",
-               .start  = 0x0e000000,
-               .end    = 0x0e0fffff,
-               .flags  = IORESOURCE_MEM,
-       },
-};
-
 /* ADS7846 is connected through SSP ... and if your board has J5 populated,
  * you can select it to replace the ucb1400 by switching the touchscreen cable
  * (to J5) and poking board registers (as done below).  Else it's only useful
@@ -261,6 +276,26 @@ static struct spi_board_info spi_board_info[] __initdata = { {
 },
 };
 
+static struct resource smc91x_resources[] = {
+       [0] = {
+               .name   = "smc91x-regs",
+               .start  = 0x0c000c00,
+               .end    = 0x0c0fffff,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = LUBBOCK_ETH_IRQ,
+               .end    = LUBBOCK_ETH_IRQ,
+               .flags  = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE,
+       },
+       [2] = {
+               .name   = "smc91x-attrib",
+               .start  = 0x0e000000,
+               .end    = 0x0e0fffff,
+               .flags  = IORESOURCE_MEM,
+       },
+};
+
 static struct platform_device smc91x_device = {
        .name           = "smc91x",
        .id             = -1,
@@ -404,10 +439,6 @@ static int lubbock_mci_init(struct device *dev,
                irq_handler_t detect_int,
                void *data)
 {
-       /* setup GPIO for PXA25x MMC controller */
-       pxa_gpio_mode(GPIO6_MMCCLK_MD);
-       pxa_gpio_mode(GPIO8_MMCCS0_MD);
-
        /* detect card insert/eject */
        mmc_detect_int = detect_int;
        init_timer(&mmc_timer);
@@ -457,6 +488,8 @@ static void __init lubbock_init(void)
 {
        int flashboot = (LUB_CONF_SWITCHES & 1);
 
+       pxa2xx_mfp_config(ARRAY_AND_SIZE(lubbock_pin_config));
+
        pxa_set_udc_info(&udc_info);
        set_pxa_fb_info(&sharp_lm8v31);
        pxa_set_mci_info(&lubbock_mci_platform_data);
@@ -489,46 +522,6 @@ static void __init lubbock_map_io(void)
        pxa_map_io();
        iotable_init(lubbock_io_desc, ARRAY_SIZE(lubbock_io_desc));
 
-       /* SSP data pins */
-       pxa_gpio_mode(GPIO23_SCLK_MD);
-       pxa_gpio_mode(GPIO25_STXD_MD);
-       pxa_gpio_mode(GPIO26_SRXD_MD);
-
-       /* This enables the BTUART */
-       pxa_gpio_mode(GPIO42_BTRXD_MD);
-       pxa_gpio_mode(GPIO43_BTTXD_MD);
-       pxa_gpio_mode(GPIO44_BTCTS_MD);
-       pxa_gpio_mode(GPIO45_BTRTS_MD);
-
-       GPSR(GPIO48_nPOE) =
-               GPIO_bit(GPIO48_nPOE) |
-               GPIO_bit(GPIO49_nPWE) |
-               GPIO_bit(GPIO50_nPIOR) |
-               GPIO_bit(GPIO51_nPIOW) |
-               GPIO_bit(GPIO52_nPCE_1) |
-               GPIO_bit(GPIO53_nPCE_2);
-
-       pxa_gpio_mode(GPIO48_nPOE_MD);
-       pxa_gpio_mode(GPIO49_nPWE_MD);
-       pxa_gpio_mode(GPIO50_nPIOR_MD);
-       pxa_gpio_mode(GPIO51_nPIOW_MD);
-       pxa_gpio_mode(GPIO52_nPCE_1_MD);
-       pxa_gpio_mode(GPIO53_nPCE_2_MD);
-       pxa_gpio_mode(GPIO54_pSKTSEL_MD);
-       pxa_gpio_mode(GPIO55_nPREG_MD);
-       pxa_gpio_mode(GPIO56_nPWAIT_MD);
-       pxa_gpio_mode(GPIO57_nIOIS16_MD);
-
-       /* This is for the SMC chip select */
-       pxa_gpio_mode(GPIO79_nCS_3_MD);
-
-       /* setup sleep mode values */
-       PWER  = 0x00000002;
-       PFER  = 0x00000000;
-       PRER  = 0x00000002;
-       PGSR0 = 0x00008000;
-       PGSR1 = 0x003F0202;
-       PGSR2 = 0x0001C000;
        PCFR |= PCFR_OPDE;
 }
 
index d98ef7ada2f8e38008a3cf05646425021d3fa601..d70be75bd199552d63cbc7d851d9fbd39f87d4c4 100644 (file)
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/platform_device.h>
+#include <linux/delay.h>
 #include <linux/gpio_keys.h>
 #include <linux/input.h>
+#include <linux/mfd/htc-egpio.h>
+#include <linux/mfd/htc-pasic3.h>
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/map.h>
 #include <linux/mtd/physmap.h>
+#include <linux/pda_power.h>
 
 #include <asm/gpio.h>
 #include <asm/hardware.h>
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 #include <asm/arch/magician.h>
+#include <asm/arch/mfp-pxa27x.h>
 #include <asm/arch/pxa-regs.h>
 #include <asm/arch/pxafb.h>
+#include <asm/arch/i2c.h>
+#include <asm/arch/mmc.h>
 #include <asm/arch/irda.h>
 #include <asm/arch/ohci.h>
 
 #include "generic.h"
 
+static unsigned long magician_pin_config[] = {
+
+       /* SDRAM and Static Memory I/O Signals */
+       GPIO20_nSDCS_2,
+       GPIO21_nSDCS_3,
+       GPIO15_nCS_1,
+       GPIO78_nCS_2,   /* PASIC3 */
+       GPIO79_nCS_3,   /* EGPIO CPLD */
+       GPIO80_nCS_4,
+       GPIO33_nCS_5,
+
+       /* I2C */
+       GPIO117_I2C_SCL,
+       GPIO118_I2C_SDA,
+
+       /* PWM 0 */
+       GPIO16_PWM0_OUT,
+
+       /* I2S */
+       GPIO28_I2S_BITCLK_OUT,
+       GPIO29_I2S_SDATA_IN,
+       GPIO31_I2S_SYNC,
+       GPIO113_I2S_SYSCLK,
+
+       /* SSP 2 */
+       GPIO19_SSP2_SCLK,
+       GPIO14_SSP2_SFRM,
+       GPIO89_SSP2_TXD,
+       GPIO88_SSP2_RXD,
+
+       /* MMC */
+       GPIO32_MMC_CLK,
+       GPIO92_MMC_DAT_0,
+       GPIO109_MMC_DAT_1,
+       GPIO110_MMC_DAT_2,
+       GPIO111_MMC_DAT_3,
+       GPIO112_MMC_CMD,
+
+       /* LCD */
+       GPIO58_LCD_LDD_0,
+       GPIO59_LCD_LDD_1,
+       GPIO60_LCD_LDD_2,
+       GPIO61_LCD_LDD_3,
+       GPIO62_LCD_LDD_4,
+       GPIO63_LCD_LDD_5,
+       GPIO64_LCD_LDD_6,
+       GPIO65_LCD_LDD_7,
+       GPIO66_LCD_LDD_8,
+       GPIO67_LCD_LDD_9,
+       GPIO68_LCD_LDD_10,
+       GPIO69_LCD_LDD_11,
+       GPIO70_LCD_LDD_12,
+       GPIO71_LCD_LDD_13,
+       GPIO72_LCD_LDD_14,
+       GPIO73_LCD_LDD_15,
+       GPIO74_LCD_FCLK,
+       GPIO75_LCD_LCLK,
+       GPIO76_LCD_PCLK,
+       GPIO77_LCD_BIAS,
+
+       /* QCI */
+       GPIO12_CIF_DD_7,
+       GPIO17_CIF_DD_6,
+       GPIO50_CIF_DD_3,
+       GPIO51_CIF_DD_2,
+       GPIO52_CIF_DD_4,
+       GPIO53_CIF_MCLK,
+       GPIO54_CIF_PCLK,
+       GPIO55_CIF_DD_1,
+       GPIO81_CIF_DD_0,
+       GPIO82_CIF_DD_5,
+       GPIO84_CIF_FV,
+       GPIO85_CIF_LV,
+};
+
 /*
  * IRDA
  */
@@ -83,8 +165,64 @@ static struct platform_device gpio_keys = {
        .id   = -1,
 };
 
+
+/*
+ * EGPIO (Xilinx CPLD)
+ *
+ * 7 32-bit aligned 8-bit registers: 3x output, 1x irq, 3x input
+ */
+
+static struct resource egpio_resources[] = {
+       [0] = {
+               .start = PXA_CS3_PHYS,
+               .end   = PXA_CS3_PHYS + 0x20,
+               .flags = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start = gpio_to_irq(GPIO13_MAGICIAN_CPLD_IRQ),
+               .end   = gpio_to_irq(GPIO13_MAGICIAN_CPLD_IRQ),
+               .flags = IORESOURCE_IRQ,
+       },
+};
+
+static struct htc_egpio_chip egpio_chips[] = {
+       [0] = {
+               .reg_start = 0,
+               .gpio_base = MAGICIAN_EGPIO(0, 0),
+               .num_gpios = 24,
+               .direction = HTC_EGPIO_OUTPUT,
+               .initial_values = 0x40, /* EGPIO_MAGICIAN_GSM_RESET */
+       },
+       [1] = {
+               .reg_start = 4,
+               .gpio_base = MAGICIAN_EGPIO(4, 0),
+               .num_gpios = 24,
+               .direction = HTC_EGPIO_INPUT,
+       },
+};
+
+static struct htc_egpio_platform_data egpio_info = {
+       .reg_width    = 8,
+       .bus_width    = 32,
+       .irq_base     = IRQ_BOARD_START,
+       .num_irqs     = 4,
+       .ack_register = 3,
+       .chip         = egpio_chips,
+       .num_chips    = ARRAY_SIZE(egpio_chips),
+};
+
+static struct platform_device egpio = {
+       .name          = "htc-egpio",
+       .id            = -1,
+       .resource      = egpio_resources,
+       .num_resources = ARRAY_SIZE(egpio_resources),
+       .dev = {
+               .platform_data = &egpio_info,
+       },
+};
+
 /*
- * LCD - Toppoly TD028STEB1
+ * LCD - Toppoly TD028STEB1 or Samsung LTP280QV
  */
 
 static struct pxafb_mode_info toppoly_modes[] = {
@@ -103,12 +241,99 @@ static struct pxafb_mode_info toppoly_modes[] = {
        },
 };
 
+static struct pxafb_mode_info samsung_modes[] = {
+       {
+               .pixclock     = 96153,
+               .bpp          = 16,
+               .xres         = 240,
+               .yres         = 320,
+               .hsync_len    = 8,
+               .vsync_len    = 4,
+               .left_margin  = 9,
+               .upper_margin = 4,
+               .right_margin = 9,
+               .lower_margin = 4,
+               .sync         = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
+       },
+};
+
+static void toppoly_lcd_power(int on, struct fb_var_screeninfo *si)
+{
+       pr_debug("Toppoly LCD power\n");
+
+       if (on) {
+               pr_debug("on\n");
+               gpio_set_value(EGPIO_MAGICIAN_TOPPOLY_POWER, 1);
+               gpio_set_value(GPIO106_MAGICIAN_LCD_POWER_3, 1);
+               udelay(2000);
+               gpio_set_value(EGPIO_MAGICIAN_LCD_POWER, 1);
+               udelay(2000);
+               /* FIXME: enable LCDC here */
+               udelay(2000);
+               gpio_set_value(GPIO104_MAGICIAN_LCD_POWER_1, 1);
+               udelay(2000);
+               gpio_set_value(GPIO105_MAGICIAN_LCD_POWER_2, 1);
+       } else {
+               pr_debug("off\n");
+               msleep(15);
+               gpio_set_value(GPIO105_MAGICIAN_LCD_POWER_2, 0);
+               udelay(500);
+               gpio_set_value(GPIO104_MAGICIAN_LCD_POWER_1, 0);
+               udelay(1000);
+               gpio_set_value(GPIO106_MAGICIAN_LCD_POWER_3, 0);
+               gpio_set_value(EGPIO_MAGICIAN_LCD_POWER, 0);
+       }
+}
+
+static void samsung_lcd_power(int on, struct fb_var_screeninfo *si)
+{
+       pr_debug("Samsung LCD power\n");
+
+       if (on) {
+               pr_debug("on\n");
+               if (system_rev < 3)
+                       gpio_set_value(GPIO75_MAGICIAN_SAMSUNG_POWER, 1);
+               else
+                       gpio_set_value(EGPIO_MAGICIAN_LCD_POWER, 1);
+               mdelay(10);
+               gpio_set_value(GPIO106_MAGICIAN_LCD_POWER_3, 1);
+               mdelay(10);
+               gpio_set_value(GPIO104_MAGICIAN_LCD_POWER_1, 1);
+               mdelay(30);
+               gpio_set_value(GPIO105_MAGICIAN_LCD_POWER_2, 1);
+               mdelay(10);
+       } else {
+               pr_debug("off\n");
+               mdelay(10);
+               gpio_set_value(GPIO105_MAGICIAN_LCD_POWER_2, 0);
+               mdelay(30);
+               gpio_set_value(GPIO104_MAGICIAN_LCD_POWER_1, 0);
+               mdelay(10);
+               gpio_set_value(GPIO106_MAGICIAN_LCD_POWER_3, 0);
+               mdelay(10);
+               if (system_rev < 3)
+                       gpio_set_value(GPIO75_MAGICIAN_SAMSUNG_POWER, 0);
+               else
+                       gpio_set_value(EGPIO_MAGICIAN_LCD_POWER, 0);
+       }
+}
+
 static struct pxafb_mach_info toppoly_info = {
-       .modes       = toppoly_modes,
-       .num_modes   = 1,
-       .fixed_modes = 1,
-       .lccr0       = LCCR0_Color | LCCR0_Sngl | LCCR0_Act,
-       .lccr3       = LCCR3_PixRsEdg,
+       .modes           = toppoly_modes,
+       .num_modes       = 1,
+       .fixed_modes     = 1,
+       .lccr0           = LCCR0_Color | LCCR0_Sngl | LCCR0_Act,
+       .lccr3           = LCCR3_PixRsEdg,
+       .pxafb_lcd_power = toppoly_lcd_power,
+};
+
+static struct pxafb_mach_info samsung_info = {
+       .modes           = samsung_modes,
+       .num_modes       = 1,
+       .fixed_modes     = 1,
+       .lccr0           = LCCR0_LDDALT | LCCR0_Color | LCCR0_Sngl | LCCR0_Act,
+       .lccr3           = LCCR3_PixFlEdg,
+       .pxafb_lcd_power = samsung_lcd_power,
 };
 
 /*
@@ -120,9 +345,18 @@ static void magician_set_bl_intensity(int intensity)
        if (intensity) {
                PWM_CTRL0 = 1;
                PWM_PERVAL0 = 0xc8;
-               PWM_PWDUTY0 = intensity;
+               if (intensity > 0xc7) {
+                       PWM_PWDUTY0 = intensity - 0x48;
+                       gpio_set_value(EGPIO_MAGICIAN_BL_POWER2, 1);
+               } else {
+                       PWM_PWDUTY0 = intensity;
+                       gpio_set_value(EGPIO_MAGICIAN_BL_POWER2, 0);
+               }
+               gpio_set_value(EGPIO_MAGICIAN_BL_POWER, 1);
                pxa_set_cken(CKEN_PWM0, 1);
        } else {
+               /* PWM_PWDUTY0 = intensity; */
+               gpio_set_value(EGPIO_MAGICIAN_BL_POWER, 0);
                pxa_set_cken(CKEN_PWM0, 0);
        }
 }
@@ -130,18 +364,215 @@ static void magician_set_bl_intensity(int intensity)
 static struct generic_bl_info backlight_info = {
        .default_intensity = 0x64,
        .limit_mask        = 0x0b,
-       .max_intensity     = 0xc7,
+       .max_intensity     = 0xc7+0x48,
        .set_bl_intensity  = magician_set_bl_intensity,
 };
 
 static struct platform_device backlight = {
-       .name = "corgi-bl",
+       .name = "generic-bl",
        .dev  = {
                .platform_data = &backlight_info,
        },
        .id   = -1,
 };
 
+/*
+ * LEDs
+ */
+
+struct gpio_led gpio_leds[] = {
+       {
+               .name = "magician::vibra",
+               .default_trigger = "none",
+               .gpio = GPIO22_MAGICIAN_VIBRA_EN,
+       },
+       {
+               .name = "magician::phone_bl",
+               .default_trigger = "none",
+               .gpio = GPIO103_MAGICIAN_LED_KP,
+       },
+};
+
+static struct gpio_led_platform_data gpio_led_info = {
+       .leds = gpio_leds,
+       .num_leds = ARRAY_SIZE(gpio_leds),
+};
+
+static struct platform_device leds_gpio = {
+       .name = "leds-gpio",
+       .id   = -1,
+       .dev  = {
+               .platform_data = &gpio_led_info,
+       },
+};
+
+static struct pasic3_led pasic3_leds[] = {
+       {
+               .led = {
+                       .name            = "magician:red",
+                       .default_trigger = "ds2760-battery.0-charging",
+               },
+               .hw_num = 0,
+               .bit2   = PASIC3_BIT2_LED0,
+               .mask   = PASIC3_MASK_LED0,
+       },
+       {
+               .led = {
+                       .name            = "magician:green",
+                       .default_trigger = "ds2760-battery.0-charging-or-full",
+               },
+               .hw_num = 1,
+               .bit2   = PASIC3_BIT2_LED1,
+               .mask   = PASIC3_MASK_LED1,
+       },
+       {
+               .led = {
+                       .name            = "magician:blue",
+                       .default_trigger = "bluetooth",
+               },
+               .hw_num = 2,
+               .bit2   = PASIC3_BIT2_LED2,
+               .mask   = PASIC3_MASK_LED2,
+       },
+};
+
+static struct platform_device pasic3;
+
+static struct pasic3_leds_machinfo __devinit pasic3_leds_info = {
+       .num_leds   = ARRAY_SIZE(pasic3_leds),
+       .power_gpio = EGPIO_MAGICIAN_LED_POWER,
+       .leds       = pasic3_leds,
+};
+
+/*
+ * PASIC3 with DS1WM
+ */
+
+static struct resource pasic3_resources[] = {
+       [0] = {
+               .start  = PXA_CS2_PHYS,
+               .end    = PXA_CS2_PHYS + 0x1b,
+               .flags  = IORESOURCE_MEM,
+       },
+       /* No IRQ handler in the PASIC3, DS1WM needs an external IRQ */
+       [1] = {
+               .start  = gpio_to_irq(GPIO107_MAGICIAN_DS1WM_IRQ),
+               .end    = gpio_to_irq(GPIO107_MAGICIAN_DS1WM_IRQ),
+               .flags  = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE,
+       }
+};
+
+static struct pasic3_platform_data pasic3_platform_data = {
+       .bus_shift  = 2,
+       .led_pdata  = &pasic3_leds_info,
+       .clock_rate = 4000000,
+};
+
+static struct platform_device pasic3 = {
+       .name           = "pasic3",
+       .id             = -1,
+       .num_resources  = ARRAY_SIZE(pasic3_resources),
+       .resource       = pasic3_resources,
+       .dev = {
+               .platform_data = &pasic3_platform_data,
+       },
+};
+
+/*
+ * External power
+ */
+
+static int magician_is_ac_online(void)
+{
+       return gpio_get_value(EGPIO_MAGICIAN_CABLE_STATE_AC);
+}
+
+static int magician_is_usb_online(void)
+{
+       return gpio_get_value(EGPIO_MAGICIAN_CABLE_STATE_USB);
+}
+
+static void magician_set_charge(int flags)
+{
+       gpio_set_value(GPIO30_MAGICIAN_nCHARGE_EN, !flags);
+       gpio_set_value(EGPIO_MAGICIAN_CHARGE_EN, flags);
+}
+
+static char *magician_supplicants[] = {
+       "ds2760-battery.0", "backup-battery"
+};
+
+static struct pda_power_pdata power_supply_info = {
+       .is_ac_online    = magician_is_ac_online,
+       .is_usb_online   = magician_is_usb_online,
+       .set_charge      = magician_set_charge,
+       .supplied_to     = magician_supplicants,
+       .num_supplicants = ARRAY_SIZE(magician_supplicants),
+};
+
+static struct resource power_supply_resources[] = {
+       [0] = {
+               .name  = "ac",
+               .flags = IORESOURCE_IRQ,
+               .start = IRQ_MAGICIAN_AC,
+               .end   = IRQ_MAGICIAN_AC,
+       },
+       [1] = {
+               .name  = "usb",
+               .flags = IORESOURCE_IRQ,
+               .start = IRQ_MAGICIAN_AC,
+               .end   = IRQ_MAGICIAN_AC,
+       },
+};
+
+static struct platform_device power_supply = {
+       .name = "pda-power",
+       .id   = -1,
+       .dev  = {
+               .platform_data = &power_supply_info,
+       },
+       .resource      = power_supply_resources,
+       .num_resources = ARRAY_SIZE(power_supply_resources),
+};
+
+
+/*
+ * MMC/SD
+ */
+
+static int magician_mci_init(struct device *dev,
+                               irq_handler_t detect_irq, void *data)
+{
+       return request_irq(IRQ_MAGICIAN_SD, detect_irq,
+                               IRQF_DISABLED | IRQF_SAMPLE_RANDOM,
+                               "MMC card detect", data);
+}
+
+static void magician_mci_setpower(struct device *dev, unsigned int vdd)
+{
+       struct pxamci_platform_data *pdata = dev->platform_data;
+
+       gpio_set_value(EGPIO_MAGICIAN_SD_POWER, (1 << vdd) & pdata->ocr_mask);
+}
+
+static int magician_mci_get_ro(struct device *dev)
+{
+       return (!gpio_get_value(EGPIO_MAGICIAN_nSD_READONLY));
+}
+
+static void magician_mci_exit(struct device *dev, void *data)
+{
+       free_irq(IRQ_MAGICIAN_SD, data);
+}
+
+static struct pxamci_platform_data magician_mci_info = {
+       .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34,
+       .init     = magician_mci_init,
+       .get_ro   = magician_mci_get_ro,
+       .setpower = magician_mci_setpower,
+       .exit     = magician_mci_exit,
+};
+
 
 /*
  * USB OHCI
@@ -166,6 +597,11 @@ static struct pxaohci_platform_data magician_ohci_info = {
  * StrataFlash
  */
 
+static void magician_set_vpp(struct map_info *map, int vpp)
+{
+       gpio_set_value(EGPIO_MAGICIAN_FLASH_VPP, vpp);
+}
+
 #define PXA_CS_SIZE            0x04000000
 
 static struct resource strataflash_resource = {
@@ -176,13 +612,14 @@ static struct resource strataflash_resource = {
 
 static struct physmap_flash_data strataflash_data = {
        .width = 4,
+       .set_vpp = magician_set_vpp,
 };
 
 static struct platform_device strataflash = {
        .name          = "physmap-flash",
        .id            = -1,
-       .num_resources = 1,
        .resource      = &strataflash_resource,
+       .num_resources = 1,
        .dev = {
                .platform_data = &strataflash_data,
        },
@@ -194,16 +631,43 @@ static struct platform_device strataflash = {
 
 static struct platform_device *devices[] __initdata = {
        &gpio_keys,
+       &egpio,
        &backlight,
+       &pasic3,
+       &power_supply,
        &strataflash,
+       &leds_gpio,
 };
 
 static void __init magician_init(void)
 {
+       void __iomem *cpld;
+       int lcd_select;
+
+       pxa2xx_mfp_config(ARRAY_AND_SIZE(magician_pin_config));
+
        platform_add_devices(devices, ARRAY_SIZE(devices));
+       pxa_set_i2c_info(NULL);
+       pxa_set_mci_info(&magician_mci_info);
        pxa_set_ohci_info(&magician_ohci_info);
        pxa_set_ficp_info(&magician_ficp_info);
-       set_pxa_fb_info(&toppoly_info);
+
+       /* Check LCD type we have */
+       cpld = ioremap_nocache(PXA_CS3_PHYS, 0x1000);
+       if (cpld) {
+               u8 board_id = __raw_readb(cpld+0x14);
+               system_rev = board_id & 0x7;
+               lcd_select = board_id & 0x8;
+               iounmap(cpld);
+               pr_info("LCD type: %s\n", lcd_select ? "Samsung" : "Toppoly");
+               if (lcd_select && (system_rev < 3))
+                       pxa_gpio_mode(GPIO75_MAGICIAN_SAMSUNG_POWER_MD);
+               pxa_gpio_mode(GPIO104_MAGICIAN_LCD_POWER_1_MD);
+               pxa_gpio_mode(GPIO105_MAGICIAN_LCD_POWER_2_MD);
+               pxa_gpio_mode(GPIO106_MAGICIAN_LCD_POWER_3_MD);
+               set_pxa_fb_info(lcd_select ? &samsung_info : &toppoly_info);
+       } else
+               pr_err("LCD detection: CPLD mapping failed\n");
 }
 
 
index 72a436fb9a291f4509a314f6b8c39202b5080d16..18d47cfa2a188884fa48dd9886409d905c389fde 100644 (file)
@@ -24,6 +24,8 @@
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/partitions.h>
 #include <linux/backlight.h>
+#include <linux/input.h>
+#include <linux/gpio_keys.h>
 
 #include <asm/types.h>
 #include <asm/setup.h>
 
 #include <asm/arch/pxa-regs.h>
 #include <asm/arch/pxa2xx-regs.h>
+#include <asm/arch/mfp-pxa27x.h>
 #include <asm/arch/mainstone.h>
 #include <asm/arch/audio.h>
 #include <asm/arch/pxafb.h>
+#include <asm/arch/i2c.h>
 #include <asm/arch/mmc.h>
 #include <asm/arch/irda.h>
 #include <asm/arch/ohci.h>
+#include <asm/arch/pxa27x_keypad.h>
 
 #include "generic.h"
 #include "devices.h"
 
+static unsigned long mainstone_pin_config[] = {
+       /* Chip Select */
+       GPIO15_nCS_1,
+
+       /* LCD - 16bpp Active TFT */
+       GPIO58_LCD_LDD_0,
+       GPIO59_LCD_LDD_1,
+       GPIO60_LCD_LDD_2,
+       GPIO61_LCD_LDD_3,
+       GPIO62_LCD_LDD_4,
+       GPIO63_LCD_LDD_5,
+       GPIO64_LCD_LDD_6,
+       GPIO65_LCD_LDD_7,
+       GPIO66_LCD_LDD_8,
+       GPIO67_LCD_LDD_9,
+       GPIO68_LCD_LDD_10,
+       GPIO69_LCD_LDD_11,
+       GPIO70_LCD_LDD_12,
+       GPIO71_LCD_LDD_13,
+       GPIO72_LCD_LDD_14,
+       GPIO73_LCD_LDD_15,
+       GPIO74_LCD_FCLK,
+       GPIO75_LCD_LCLK,
+       GPIO76_LCD_PCLK,
+       GPIO77_LCD_BIAS,
+       GPIO16_PWM0_OUT,        /* Backlight */
+
+       /* MMC */
+       GPIO32_MMC_CLK,
+       GPIO112_MMC_CMD,
+       GPIO92_MMC_DAT_0,
+       GPIO109_MMC_DAT_1,
+       GPIO110_MMC_DAT_2,
+       GPIO111_MMC_DAT_3,
+
+       /* USB Host Port 1 */
+       GPIO88_USBH1_PWR,
+       GPIO89_USBH1_PEN,
+
+       /* PC Card */
+       GPIO48_nPOE,
+       GPIO49_nPWE,
+       GPIO50_nPIOR,
+       GPIO51_nPIOW,
+       GPIO85_nPCE_1,
+       GPIO54_nPCE_2,
+       GPIO79_PSKTSEL,
+       GPIO55_nPREG,
+       GPIO56_nPWAIT,
+       GPIO57_nIOIS16,
+
+       /* AC97 */
+       GPIO45_AC97_SYSCLK,
+
+       /* Keypad */
+       GPIO93_KP_DKIN_0        | WAKEUP_ON_LEVEL_HIGH,
+       GPIO94_KP_DKIN_1        | WAKEUP_ON_LEVEL_HIGH,
+       GPIO95_KP_DKIN_2        | WAKEUP_ON_LEVEL_HIGH,
+       GPIO100_KP_MKIN_0       | WAKEUP_ON_LEVEL_HIGH,
+       GPIO101_KP_MKIN_1       | WAKEUP_ON_LEVEL_HIGH,
+       GPIO102_KP_MKIN_2       | WAKEUP_ON_LEVEL_HIGH,
+       GPIO97_KP_MKIN_3        | WAKEUP_ON_LEVEL_HIGH,
+       GPIO98_KP_MKIN_4        | WAKEUP_ON_LEVEL_HIGH,
+       GPIO99_KP_MKIN_5        | WAKEUP_ON_LEVEL_HIGH,
+       GPIO103_KP_MKOUT_0,
+       GPIO104_KP_MKOUT_1,
+       GPIO105_KP_MKOUT_2,
+       GPIO106_KP_MKOUT_3,
+       GPIO107_KP_MKOUT_4,
+       GPIO108_KP_MKOUT_5,
+       GPIO96_KP_MKOUT_6,
+
+       /* GPIO */
+       GPIO1_GPIO | WAKEUP_ON_EDGE_BOTH,
+};
 
 static unsigned long mainstone_irq_enabled;
 
@@ -278,13 +358,13 @@ static int mainstone_backlight_update_status(struct backlight_device *bl)
            bl->props.fb_blank != FB_BLANK_UNBLANK)
                brightness = 0;
 
-       if (brightness != 0) {
-               pxa_gpio_mode(GPIO16_PWM0_MD);
+       if (brightness != 0)
                pxa_set_cken(CKEN_PWM0, 1);
-       }
+
        PWM_CTRL0 = 0;
        PWM_PWDUTY0 = brightness;
        PWM_PERVAL0 = bl->props.max_brightness;
+
        if (brightness == 0)
                pxa_set_cken(CKEN_PWM0, 0);
        return 0; /* pointless return value */
@@ -362,16 +442,6 @@ static int mainstone_mci_init(struct device *dev, irq_handler_t mstone_detect_in
 {
        int err;
 
-       /*
-        * setup GPIO for PXA27x MMC controller
-        */
-       pxa_gpio_mode(GPIO32_MMCCLK_MD);
-       pxa_gpio_mode(GPIO112_MMCCMD_MD);
-       pxa_gpio_mode(GPIO92_MMCDAT0_MD);
-       pxa_gpio_mode(GPIO109_MMCDAT1_MD);
-       pxa_gpio_mode(GPIO110_MMCDAT2_MD);
-       pxa_gpio_mode(GPIO111_MMCDAT3_MD);
-
        /* make sure SD/Memory Stick multiplexer's signals
         * are routed to MMC controller
         */
@@ -434,19 +504,39 @@ static struct pxaficp_platform_data mainstone_ficp_platform_data = {
        .transceiver_mode = mainstone_irda_transceiver_mode,
 };
 
+static struct gpio_keys_button gpio_keys_button[] = {
+       [0] = {
+               .desc   = "wakeup",
+               .code   = KEY_SUSPEND,
+               .type   = EV_KEY,
+               .gpio   = 1,
+               .wakeup = 1,
+       },
+};
+
+static struct gpio_keys_platform_data mainstone_gpio_keys = {
+       .buttons        = gpio_keys_button,
+       .nbuttons       = 1,
+};
+
+static struct platform_device mst_gpio_keys_device = {
+       .name           = "gpio-keys",
+       .id             = -1,
+       .dev            = {
+               .platform_data  = &mainstone_gpio_keys,
+       },
+};
+
 static struct platform_device *platform_devices[] __initdata = {
        &smc91x_device,
        &mst_audio_device,
        &mst_flash_device[0],
        &mst_flash_device[1],
+       &mst_gpio_keys_device,
 };
 
 static int mainstone_ohci_init(struct device *dev)
 {
-       /* setup Port1 GPIO pin. */
-       pxa_gpio_mode( 88 | GPIO_ALT_FN_1_IN);  /* USBHPWR1 */
-       pxa_gpio_mode( 89 | GPIO_ALT_FN_2_OUT); /* USBHPEN1 */
-
        /* Set the Power Control Polarity Low and Power Sense
           Polarity Low to active low. */
        UHCHR = (UHCHR | UHCHR_PCPL | UHCHR_PSPL) &
@@ -460,10 +550,63 @@ static struct pxaohci_platform_data mainstone_ohci_platform_data = {
        .init           = mainstone_ohci_init,
 };
 
+#if defined(CONFIG_KEYBOARD_PXA27x) || defined(CONFIG_KEYBOARD_PXA27x_MODULES)
+static unsigned int mainstone_matrix_keys[] = {
+       KEY(0, 0, KEY_A), KEY(1, 0, KEY_B), KEY(2, 0, KEY_C),
+       KEY(3, 0, KEY_D), KEY(4, 0, KEY_E), KEY(5, 0, KEY_F),
+       KEY(0, 1, KEY_G), KEY(1, 1, KEY_H), KEY(2, 1, KEY_I),
+       KEY(3, 1, KEY_J), KEY(4, 1, KEY_K), KEY(5, 1, KEY_L),
+       KEY(0, 2, KEY_M), KEY(1, 2, KEY_N), KEY(2, 2, KEY_O),
+       KEY(3, 2, KEY_P), KEY(4, 2, KEY_Q), KEY(5, 2, KEY_R),
+       KEY(0, 3, KEY_S), KEY(1, 3, KEY_T), KEY(2, 3, KEY_U),
+       KEY(3, 3, KEY_V), KEY(4, 3, KEY_W), KEY(5, 3, KEY_X),
+       KEY(2, 4, KEY_Y), KEY(3, 4, KEY_Z),
+
+       KEY(0, 4, KEY_DOT),     /* . */
+       KEY(1, 4, KEY_CLOSE),   /* @ */
+       KEY(4, 4, KEY_SLASH),
+       KEY(5, 4, KEY_BACKSLASH),
+       KEY(0, 5, KEY_HOME),
+       KEY(1, 5, KEY_LEFTSHIFT),
+       KEY(2, 5, KEY_SPACE),
+       KEY(3, 5, KEY_SPACE),
+       KEY(4, 5, KEY_ENTER),
+       KEY(5, 5, KEY_BACKSPACE),
+
+       KEY(0, 6, KEY_UP),
+       KEY(1, 6, KEY_DOWN),
+       KEY(2, 6, KEY_LEFT),
+       KEY(3, 6, KEY_RIGHT),
+       KEY(4, 6, KEY_SELECT),
+};
+
+struct pxa27x_keypad_platform_data mainstone_keypad_info = {
+       .matrix_key_rows        = 6,
+       .matrix_key_cols        = 7,
+       .matrix_key_map         = mainstone_matrix_keys,
+       .matrix_key_map_size    = ARRAY_SIZE(mainstone_matrix_keys),
+
+       .enable_rotary0         = 1,
+       .rotary0_up_key         = KEY_UP,
+       .rotary0_down_key       = KEY_DOWN,
+
+       .debounce_interval      = 30,
+};
+
+static void __init mainstone_init_keypad(void)
+{
+       pxa_set_keypad_info(&mainstone_keypad_info);
+}
+#else
+static inline void mainstone_init_keypad(void) {}
+#endif
+
 static void __init mainstone_init(void)
 {
        int SW7 = 0;  /* FIXME: get from SCR (Mst doc section 3.2.1.1) */
 
+       pxa2xx_mfp_config(ARRAY_AND_SIZE(mainstone_pin_config));
+
        mst_flash_data[0].width = (BOOT_DEF & 1) ? 2 : 4;
        mst_flash_data[1].width = 4;
 
@@ -480,31 +623,6 @@ static void __init mainstone_init(void)
         */
        ARB_CNTRL = ARB_CORE_PARK | 0x234;
 
-       /*
-        * On Mainstone, we route AC97_SYSCLK via GPIO45 to
-        * the audio daughter card
-        */
-       pxa_gpio_mode(GPIO45_SYSCLK_AC97_MD);
-
-       GPSR(GPIO48_nPOE) =
-               GPIO_bit(GPIO48_nPOE) |
-               GPIO_bit(GPIO49_nPWE) |
-               GPIO_bit(GPIO50_nPIOR) |
-               GPIO_bit(GPIO51_nPIOW) |
-               GPIO_bit(GPIO85_nPCE_1) |
-               GPIO_bit(GPIO54_nPCE_2);
-
-       pxa_gpio_mode(GPIO48_nPOE_MD);
-       pxa_gpio_mode(GPIO49_nPWE_MD);
-       pxa_gpio_mode(GPIO50_nPIOR_MD);
-       pxa_gpio_mode(GPIO51_nPIOW_MD);
-       pxa_gpio_mode(GPIO85_nPCE_1_MD);
-       pxa_gpio_mode(GPIO54_nPCE_2_MD);
-       pxa_gpio_mode(GPIO79_pSKTSEL_MD);
-       pxa_gpio_mode(GPIO55_nPREG_MD);
-       pxa_gpio_mode(GPIO56_nPWAIT_MD);
-       pxa_gpio_mode(GPIO57_nIOIS16_MD);
-
        platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices));
 
        /* reading Mainstone's "Virtual Configuration Register"
@@ -520,6 +638,9 @@ static void __init mainstone_init(void)
        pxa_set_mci_info(&mainstone_mci_platform_data);
        pxa_set_ficp_info(&mainstone_ficp_platform_data);
        pxa_set_ohci_info(&mainstone_ohci_platform_data);
+       pxa_set_i2c_info(NULL);
+
+       mainstone_init_keypad();
 }
 
 
@@ -537,23 +658,9 @@ static void __init mainstone_map_io(void)
        pxa_map_io();
        iotable_init(mainstone_io_desc, ARRAY_SIZE(mainstone_io_desc));
 
-       /* initialize sleep mode regs (wake-up sources, etc) */
-       PGSR0 = 0x00008800;
-       PGSR1 = 0x00000002;
-       PGSR2 = 0x0001FC00;
-       PGSR3 = 0x00001F81;
-       PWER  = 0xC0000002;
-       PRER  = 0x00000002;
-       PFER  = 0x00000002;
        /*      for use I SRAM as framebuffer.  */
        PSLR |= 0xF04;
        PCFR = 0x66;
-       /*      For Keypad wakeup.      */
-       KPC &=~KPC_ASACT;
-       KPC |=KPC_AS;
-       PKWR  = 0x000FD000;
-       /*      Need read PKWR back after set it.       */
-       PKWR;
 }
 
 MACHINE_START(MAINSTONE, "Intel HCDDBBVA0 Development Platform (aka Mainstone)")
diff --git a/arch/arm/mach-pxa/mfp-pxa2xx.c b/arch/arm/mach-pxa/mfp-pxa2xx.c
new file mode 100644 (file)
index 0000000..22097a1
--- /dev/null
@@ -0,0 +1,245 @@
+/*
+ *  linux/arch/arm/mach-pxa/mfp-pxa2xx.c
+ *
+ *  PXA2xx pin mux configuration support
+ *
+ *  The GPIOs on PXA2xx can be configured as one of many alternate
+ *  functions, this is by concept samilar to the MFP configuration
+ *  on PXA3xx,  what's more important, the low power pin state and
+ *  wakeup detection are also supported by the same framework.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License version 2 as
+ *  published by the Free Software Foundation.
+ */
+
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/sysdev.h>
+
+#include <asm/arch/hardware.h>
+#include <asm/arch/pxa-regs.h>
+#include <asm/arch/mfp-pxa2xx.h>
+
+#include "generic.h"
+
+#define PGSR(x)                __REG2(0x40F00020, ((x) & 0x60) >> 3)
+
+#define PWER_WE35      (1 << 24)
+
+struct gpio_desc {
+       unsigned        valid           : 1;
+       unsigned        can_wakeup      : 1;
+       unsigned        keypad_gpio     : 1;
+       unsigned int    mask; /* bit mask in PWER or PKWR */
+       unsigned long   config;
+};
+
+static struct gpio_desc gpio_desc[MFP_PIN_GPIO127 + 1];
+
+static int __mfp_config_gpio(unsigned gpio, unsigned long c)
+{
+       unsigned long gafr, mask = GPIO_bit(gpio);
+       int fn;
+
+       fn = MFP_AF(c);
+       if (fn > 3)
+               return -EINVAL;
+
+       /* alternate function and direction */
+       gafr = GAFR(gpio) & ~(0x3 << ((gpio & 0xf) * 2));
+       GAFR(gpio) = gafr |  (fn  << ((gpio & 0xf) * 2));
+
+       if (c & MFP_DIR_OUT)
+               GPDR(gpio) |= mask;
+       else
+               GPDR(gpio) &= ~mask;
+
+       /* low power state */
+       switch (c & MFP_LPM_STATE_MASK) {
+       case MFP_LPM_DRIVE_HIGH:
+               PGSR(gpio) |= mask;
+               break;
+       case MFP_LPM_DRIVE_LOW:
+               PGSR(gpio) &= ~mask;
+               break;
+       case MFP_LPM_INPUT:
+               break;
+       default:
+               pr_warning("%s: invalid low power state for GPIO%d\n",
+                               __func__, gpio);
+               return -EINVAL;
+       }
+
+       /* give early warning if MFP_LPM_CAN_WAKEUP is set on the
+        * configurations of those pins not able to wakeup
+        */
+       if ((c & MFP_LPM_CAN_WAKEUP) && !gpio_desc[gpio].can_wakeup) {
+               pr_warning("%s: GPIO%d unable to wakeup\n",
+                               __func__, gpio);
+               return -EINVAL;
+       }
+
+       if ((c & MFP_LPM_CAN_WAKEUP) && (c & MFP_DIR_OUT)) {
+               pr_warning("%s: output GPIO%d unable to wakeup\n",
+                               __func__, gpio);
+               return -EINVAL;
+       }
+
+       return 0;
+}
+
+void pxa2xx_mfp_config(unsigned long *mfp_cfgs, int num)
+{
+       unsigned long flags;
+       unsigned long *c;
+       int i, gpio;
+
+       for (i = 0, c = mfp_cfgs; i < num; i++, c++) {
+
+               gpio = mfp_to_gpio(MFP_PIN(*c));
+
+               if (!gpio_desc[gpio].valid) {
+                       pr_warning("%s: GPIO%d is invalid pin\n",
+                               __func__, gpio);
+                       continue;
+               }
+
+               local_irq_save(flags);
+
+               gpio_desc[gpio].config = *c;
+               __mfp_config_gpio(gpio, *c);
+
+               local_irq_restore(flags);
+       }
+}
+
+int gpio_set_wake(unsigned int gpio, unsigned int on)
+{
+       struct gpio_desc *d;
+       unsigned long c;
+
+       if (gpio > mfp_to_gpio(MFP_PIN_GPIO127))
+               return -EINVAL;
+
+       d = &gpio_desc[gpio];
+       c = d->config;
+
+       if (!d->valid)
+               return -EINVAL;
+
+       if (d->keypad_gpio)
+               return -EINVAL;
+
+       if (d->can_wakeup && (c & MFP_LPM_CAN_WAKEUP)) {
+               if (on) {
+                       PWER |= d->mask;
+
+                       if (c & MFP_LPM_EDGE_RISE)
+                               PRER |= d->mask;
+                       else
+                               PRER &= ~d->mask;
+
+                       if (c & MFP_LPM_EDGE_FALL)
+                               PFER |= d->mask;
+                       else
+                               PFER &= ~d->mask;
+               } else {
+                       PWER &= ~d->mask;
+                       PRER &= ~d->mask;
+                       PFER &= ~d->mask;
+               }
+       }
+       return 0;
+}
+
+#ifdef CONFIG_PXA25x
+static int __init pxa25x_mfp_init(void)
+{
+       int i;
+
+       if (cpu_is_pxa25x()) {
+               for (i = 0; i <= 84; i++)
+                       gpio_desc[i].valid = 1;
+
+               for (i = 0; i <= 15; i++) {
+                       gpio_desc[i].can_wakeup = 1;
+                       gpio_desc[i].mask = GPIO_bit(i);
+               }
+       }
+
+       return 0;
+}
+postcore_initcall(pxa25x_mfp_init);
+#endif /* CONFIG_PXA25x */
+
+#ifdef CONFIG_PXA27x
+static int pxa27x_pkwr_gpio[] = {
+       13, 16, 17, 34, 36, 37, 38, 39, 90, 91, 93, 94,
+       95, 96, 97, 98, 99, 100, 101, 102
+};
+
+int keypad_set_wake(unsigned int on)
+{
+       unsigned int i, gpio, mask = 0;
+
+       if (!on) {
+               PKWR = 0;
+               return 0;
+       }
+
+       for (i = 0; i < ARRAY_SIZE(pxa27x_pkwr_gpio); i++) {
+
+               gpio = pxa27x_pkwr_gpio[i];
+
+               if (gpio_desc[gpio].config & MFP_LPM_CAN_WAKEUP)
+                       mask |= gpio_desc[gpio].mask;
+       }
+
+       PKWR = mask;
+       return 0;
+}
+
+static int __init pxa27x_mfp_init(void)
+{
+       int i, gpio;
+
+       if (cpu_is_pxa27x()) {
+               for (i = 0; i <= 120; i++) {
+                       /* skip GPIO2, 5, 6, 7, 8, they are not
+                        * valid pins allow configuration
+                        */
+                       if (i == 2 || i == 5 || i == 6 ||
+                           i == 7 || i == 8)
+                               continue;
+
+                       gpio_desc[i].valid = 1;
+               }
+
+               /* Keypad GPIOs */
+               for (i = 0; i < ARRAY_SIZE(pxa27x_pkwr_gpio); i++) {
+                       gpio = pxa27x_pkwr_gpio[i];
+                       gpio_desc[gpio].can_wakeup = 1;
+                       gpio_desc[gpio].keypad_gpio = 1;
+                       gpio_desc[gpio].mask = 1 << i;
+               }
+
+               /* Overwrite GPIO13 as a PWER wakeup source */
+               for (i = 0; i <= 15; i++) {
+                       /* skip GPIO2, 5, 6, 7, 8 */
+                       if (GPIO_bit(i) & 0x1e4)
+                               continue;
+
+                       gpio_desc[i].can_wakeup = 1;
+                       gpio_desc[i].mask = GPIO_bit(i);
+               }
+
+               gpio_desc[35].can_wakeup = 1;
+               gpio_desc[35].mask = PWER_WE35;
+       }
+
+       return 0;
+}
+postcore_initcall(pxa27x_mfp_init);
+#endif /* CONFIG_PXA27x */
similarity index 96%
rename from arch/arm/mach-pxa/mfp.c
rename to arch/arm/mach-pxa/mfp-pxa3xx.c
index f5809adce298219a46f077d7234dd0a99cf952e3..b84c3ba7a8d62846cbb698f39caaad5651d80fbc 100644 (file)
@@ -234,22 +234,22 @@ static int pxa3xx_mfp_resume(struct sys_device *d)
 
        return 0;
 }
+#else
+#define pxa3xx_mfp_suspend     NULL
+#define pxa3xx_mfp_resume      NULL
+#endif
 
-static struct sysdev_class mfp_sysclass = {
+struct sysdev_class pxa3xx_mfp_sysclass = {
        .name           = "mfp",
        .suspend        = pxa3xx_mfp_suspend,
        .resume         = pxa3xx_mfp_resume,
 };
 
-static struct sys_device mfp_device = {
-       .id             = 0,
-       .cls            = &mfp_sysclass,
-};
-
 static int __init mfp_init_devicefs(void)
 {
-       sysdev_class_register(&mfp_sysclass);
-       return sysdev_register(&mfp_device);
+       if (cpu_is_pxa3xx())
+               return sysdev_class_register(&pxa3xx_mfp_sysclass);
+
+       return 0;
 }
-device_initcall(mfp_init_devicefs);
-#endif
+postcore_initcall(mfp_init_devicefs);
index c14696b9979dfbaba3e218ab082f3a1d0f77b0d5..3b945eb0aee3768a1c22b2efa12be75537b8a13a 100644 (file)
@@ -29,6 +29,7 @@
 #include <asm/mach/arch.h>
 #include <asm/arch/hardware.h>
 #include <asm/arch/pxa-regs.h>
+#include <asm/arch/pxa2xx-gpio.h>
 #include <asm/arch/pxa2xx-regs.h>
 #include <asm/arch/pxa2xx_spi.h>
 #include <asm/arch/pcm027.h>
index 3dda16a20049e5bf8387acfa2b556026105e6835..e6be9d0aeccf2d9e94c4a1ac11306529d5f1bf2f 100644 (file)
 #include <linux/irq.h>
 #include <linux/platform_device.h>
 #include <linux/ide.h>
+#include <linux/i2c.h>
+
+#include <media/soc_camera.h>
+
+#include <asm/gpio.h>
+#include <asm/arch/i2c.h>
+#include <asm/arch/camera.h>
 #include <asm/mach/map.h>
 #include <asm/arch/pxa-regs.h>
+#include <asm/arch/pxa2xx-gpio.h>
 #include <asm/arch/mmc.h>
 #include <asm/arch/ohci.h>
 #include <asm/arch/pcm990_baseboard.h>
@@ -257,6 +265,76 @@ static struct pxaohci_platform_data pcm990_ohci_platform_data = {
        .exit           = NULL,
 };
 
+/*
+ * PXA27x Camera specific stuff
+ */
+#if defined(CONFIG_VIDEO_PXA27x) || defined(CONFIG_VIDEO_PXA27x_MODULE)
+static int pcm990_pxacamera_init(struct device *dev)
+{
+       pxa_gpio_mode(GPIO98_CIF_DD_0_MD);
+       pxa_gpio_mode(GPIO105_CIF_DD_1_MD);
+       pxa_gpio_mode(GPIO104_CIF_DD_2_MD);
+       pxa_gpio_mode(GPIO103_CIF_DD_3_MD);
+       pxa_gpio_mode(GPIO95_CIF_DD_4_MD);
+       pxa_gpio_mode(GPIO94_CIF_DD_5_MD);
+       pxa_gpio_mode(GPIO93_CIF_DD_6_MD);
+       pxa_gpio_mode(GPIO108_CIF_DD_7_MD);
+       pxa_gpio_mode(GPIO107_CIF_DD_8_MD);
+       pxa_gpio_mode(GPIO106_CIF_DD_9_MD);
+       pxa_gpio_mode(GPIO42_CIF_MCLK_MD);
+       pxa_gpio_mode(GPIO45_CIF_PCLK_MD);
+       pxa_gpio_mode(GPIO43_CIF_FV_MD);
+       pxa_gpio_mode(GPIO44_CIF_LV_MD);
+
+       return 0;
+}
+
+/*
+ * CICR4: PCLK_EN:     Pixel clock is supplied by the sensor
+ *     MCLK_EN:        Master clock is generated by PXA
+ *     PCP:            Data sampled on the falling edge of pixel clock
+ */
+struct pxacamera_platform_data pcm990_pxacamera_platform_data = {
+       .init   = pcm990_pxacamera_init,
+       .flags  = PXA_CAMERA_MASTER | PXA_CAMERA_DATAWIDTH_8 | PXA_CAMERA_DATAWIDTH_10 |
+               PXA_CAMERA_PCLK_EN | PXA_CAMERA_MCLK_EN/* | PXA_CAMERA_PCP*/,
+       .mclk_10khz = 1000,
+};
+
+#include <linux/i2c/pca953x.h>
+
+static struct pca953x_platform_data pca9536_data = {
+       .gpio_base      = NR_BUILTIN_GPIO + 1,
+};
+
+static struct soc_camera_link iclink[] = {
+       {
+               .bus_id = 0, /* Must match with the camera ID above */
+               .gpio   = NR_BUILTIN_GPIO + 1,
+       }, {
+               .bus_id = 0, /* Must match with the camera ID above */
+       }
+};
+
+/* Board I2C devices. */
+static struct i2c_board_info __initdata pcm990_i2c_devices[] = {
+       {
+               /* Must initialize before the camera(s) */
+               I2C_BOARD_INFO("pca953x", 0x41),
+               .type = "pca9536",
+               .platform_data = &pca9536_data,
+       }, {
+               I2C_BOARD_INFO("mt9v022", 0x48),
+               .type = "mt9v022",
+               .platform_data = &iclink[0], /* With extender */
+       }, {
+               I2C_BOARD_INFO("mt9m001", 0x5d),
+               .type = "mt9m001",
+               .platform_data = &iclink[0], /* With extender */
+       },
+};
+#endif /* CONFIG_VIDEO_PXA27x ||CONFIG_VIDEO_PXA27x_MODULE */
+
 /*
  * AC97 support
  * Note: The connected AC97 mixer also reports interrupts at PCM990_AC97_IRQ
@@ -326,5 +404,14 @@ void __init pcm990_baseboard_init(void)
        /* USB host */
        pxa_set_ohci_info(&pcm990_ohci_platform_data);
 
+       pxa_set_i2c_info(NULL);
+
+#if defined(CONFIG_VIDEO_PXA27x) || defined(CONFIG_VIDEO_PXA27x_MODULE)
+       pxa_set_camera_info(&pcm990_pxacamera_platform_data);
+
+       i2c_register_board_info(0, pcm990_i2c_devices,
+               ARRAY_SIZE(pcm990_i2c_devices));
+#endif
+
        printk(KERN_INFO"PCM-990 Evaluation baseboard initialized\n");
 }
index 209eabf0ed3e60917ae29d72c5316efd54cfc8db..ca5ac196b47b71e3b011281ed5e77dc574df65b7 100644 (file)
@@ -32,6 +32,7 @@
 #include <asm/mach/irq.h>
 
 #include <asm/arch/pxa-regs.h>
+#include <asm/arch/pxa2xx-gpio.h>
 #include <asm/arch/mmc.h>
 #include <asm/arch/udc.h>
 #include <asm/arch/irda.h>
index 599e53fcc2c5abb7b039269e506dd8d2d71aeaff..d9b5450aee5b68e227e1fbf96ad24ad396a3ac88 100644 (file)
@@ -26,6 +26,7 @@
 #include <asm/hardware.h>
 #include <asm/arch/irqs.h>
 #include <asm/arch/pxa-regs.h>
+#include <asm/arch/mfp-pxa25x.h>
 #include <asm/arch/pm.h>
 #include <asm/arch/dma.h>
 
@@ -129,6 +130,8 @@ static struct clk pxa25x_clks[] = {
        INIT_CKEN("SSPCLK", NSSP, 3686400, 0, &pxa25x_device_nssp.dev),
        INIT_CKEN("SSPCLK", ASSP, 3686400, 0, &pxa25x_device_assp.dev),
 
+       INIT_CKEN("AC97CLK",     AC97,     24576000, 0, NULL),
+
        /*
        INIT_CKEN("PWMCLK",  PWM0, 3686400,  0, NULL),
        INIT_CKEN("PWMCLK",  PWM0, 3686400,  0, NULL),
@@ -228,24 +231,10 @@ static inline void pxa25x_init_pm(void) {}
 static int pxa25x_set_wake(unsigned int irq, unsigned int on)
 {
        int gpio = IRQ_TO_GPIO(irq);
-       uint32_t gpio_bit, mask = 0;
-
-       if (gpio >= 0 && gpio <= 15) {
-               gpio_bit = GPIO_bit(gpio);
-               mask = gpio_bit;
-               if (on) {
-                       if (GRER(gpio) | gpio_bit)
-                               PRER |= gpio_bit;
-                       else
-                               PRER &= ~gpio_bit;
-
-                       if (GFER(gpio) | gpio_bit)
-                               PFER |= gpio_bit;
-                       else
-                               PFER &= ~gpio_bit;
-               }
-               goto set_pwer;
-       }
+       uint32_t mask = 0;
+
+       if (gpio >= 0 && gpio < 85)
+               return gpio_set_wake(gpio, on);
 
        if (irq == IRQ_RTCAlrm) {
                mask = PWER_RTC;
@@ -265,9 +254,8 @@ set_pwer:
 
 void __init pxa25x_init_irq(void)
 {
-       pxa_init_irq_low();
-       pxa_init_irq_gpio(85);
-       pxa_init_irq_set_wake(pxa25x_set_wake);
+       pxa_init_irq(32, pxa25x_set_wake);
+       pxa_init_gpio(85, pxa25x_set_wake);
 }
 
 static struct platform_device *pxa25x_devices[] __initdata = {
@@ -325,4 +313,4 @@ static int __init pxa25x_init(void)
        return ret;
 }
 
-subsys_initcall(pxa25x_init);
+postcore_initcall(pxa25x_init);
index 46a951c3e5a0097e5c280bda04bbca0cf4936fb2..7a2449dd0fd4f19ebf7ac64c59290b7f4d8bd5b6 100644 (file)
@@ -23,6 +23,7 @@
 #include <asm/arch/irqs.h>
 #include <asm/arch/pxa-regs.h>
 #include <asm/arch/pxa2xx-regs.h>
+#include <asm/arch/mfp-pxa27x.h>
 #include <asm/arch/ohci.h>
 #include <asm/arch/pm.h>
 #include <asm/arch/dma.h>
@@ -151,12 +152,15 @@ static struct clk pxa27x_clks[] = {
 
        INIT_CKEN("USBCLK", USBHOST, 48000000, 0, &pxa27x_device_ohci.dev),
        INIT_CKEN("I2CCLK", PWRI2C, 13000000, 0, &pxa27x_device_i2c_power.dev),
-       INIT_CKEN("KBDCLK", KEYPAD, 32768, 0, NULL),
+       INIT_CKEN("KBDCLK", KEYPAD, 32768, 0, &pxa27x_device_keypad.dev),
 
        INIT_CKEN("SSPCLK", SSP1, 13000000, 0, &pxa27x_device_ssp1.dev),
        INIT_CKEN("SSPCLK", SSP2, 13000000, 0, &pxa27x_device_ssp2.dev),
        INIT_CKEN("SSPCLK", SSP3, 13000000, 0, &pxa27x_device_ssp3.dev),
 
+       INIT_CKEN("AC97CLK",     AC97,     24576000, 0, NULL),
+       INIT_CKEN("AC97CONFCLK", AC97CONF, 24576000, 0, NULL),
+
        /*
        INIT_CKEN("PWMCLK",  PWM0, 13000000, 0, NULL),
        INIT_CKEN("MSLCLK",  MSL,  48000000, 0, NULL),
@@ -283,37 +287,16 @@ static inline void pxa27x_init_pm(void) {}
 /* PXA27x:  Various gpios can issue wakeup events.  This logic only
  * handles the simple cases, not the WEMUX2 and WEMUX3 options
  */
-#define PXA27x_GPIO_NOWAKE_MASK \
-        ((1 << 8) | (1 << 7) | (1 << 6) | (1 << 5) | (1 << 2))
-#define WAKEMASK(gpio) \
-        (((gpio) <= 15) \
-                 ? ((1 << (gpio)) & ~PXA27x_GPIO_NOWAKE_MASK) \
-                 : ((gpio == 35) ? (1 << 24) : 0))
-
 static int pxa27x_set_wake(unsigned int irq, unsigned int on)
 {
        int gpio = IRQ_TO_GPIO(irq);
        uint32_t mask;
 
-       if ((gpio >= 0 && gpio <= 15) || (gpio == 35)) {
-               if (WAKEMASK(gpio) == 0)
-                       return -EINVAL;
-
-               mask = WAKEMASK(gpio);
-
-               if (on) {
-                       if (GRER(gpio) | GPIO_bit(gpio))
-                               PRER |= mask;
-                       else
-                               PRER &= ~mask;
+       if (gpio >= 0 && gpio < 128)
+               return gpio_set_wake(gpio, on);
 
-                       if (GFER(gpio) | GPIO_bit(gpio))
-                               PFER |= mask;
-                       else
-                               PFER &= ~mask;
-               }
-               goto set_pwer;
-       }
+       if (irq == IRQ_KEYPAD)
+               return keypad_set_wake(on);
 
        switch (irq) {
        case IRQ_RTCAlrm:
@@ -326,7 +309,6 @@ static int pxa27x_set_wake(unsigned int irq, unsigned int on)
                return -EINVAL;
        }
 
-set_pwer:
        if (on)
                PWER |= mask;
        else
@@ -337,10 +319,8 @@ set_pwer:
 
 void __init pxa27x_init_irq(void)
 {
-       pxa_init_irq_low();
-       pxa_init_irq_high();
-       pxa_init_irq_gpio(128);
-       pxa_init_irq_set_wake(pxa27x_set_wake);
+       pxa_init_irq(34, pxa27x_set_wake);
+       pxa_init_gpio(128, pxa27x_set_wake);
 }
 
 /*
@@ -386,10 +366,6 @@ static struct platform_device *devices[] __initdata = {
 
 static struct sys_device pxa27x_sysdev[] = {
        {
-               .id     = 0,
-               .cls    = &pxa_irq_sysclass,
-       }, {
-               .id     = 1,
                .cls    = &pxa_irq_sysclass,
        }, {
                .cls    = &pxa_gpio_sysclass,
@@ -420,4 +396,4 @@ static int __init pxa27x_init(void)
        return ret;
 }
 
-subsys_initcall(pxa27x_init);
+postcore_initcall(pxa27x_init);
index 35f25fdaeba3925303ed0dc1dacd4ed9f105c71a..dde355e88fa1574d3760a778a4cb7bf8297d166a 100644 (file)
@@ -109,6 +109,25 @@ unsigned int pxa3xx_get_memclk_frequency_10khz(void)
        return (clk / 10000);
 }
 
+/*
+ * Return the current AC97 clock frequency.
+ */
+static unsigned long clk_pxa3xx_ac97_getrate(struct clk *clk)
+{
+       unsigned long rate = 312000000;
+       unsigned long ac97_div;
+
+       ac97_div = AC97_DIV;
+
+       /* This may loose precision for some rates but won't for the
+        * standard 24.576MHz.
+        */
+       rate /= (ac97_div >> 12) & 0x7fff;
+       rate *= (ac97_div & 0xfff);
+
+       return rate;
+}
+
 /*
  * Return the current HSIO bus clock frequency
  */
@@ -156,6 +175,27 @@ static const struct clkops clk_pxa3xx_hsio_ops = {
        .getrate        = clk_pxa3xx_hsio_getrate,
 };
 
+static const struct clkops clk_pxa3xx_ac97_ops = {
+       .enable         = clk_pxa3xx_cken_enable,
+       .disable        = clk_pxa3xx_cken_disable,
+       .getrate        = clk_pxa3xx_ac97_getrate,
+};
+
+static void clk_pout_enable(struct clk *clk)
+{
+       OSCC |= OSCC_PEN;
+}
+
+static void clk_pout_disable(struct clk *clk)
+{
+       OSCC &= ~OSCC_PEN;
+}
+
+static const struct clkops clk_pout_ops = {
+       .enable         = clk_pout_enable,
+       .disable        = clk_pout_disable,
+};
+
 #define PXA3xx_CKEN(_name, _cken, _rate, _delay, _dev) \
        {                                               \
                .name   = _name,                        \
@@ -175,8 +215,16 @@ static const struct clkops clk_pxa3xx_hsio_ops = {
        }
 
 static struct clk pxa3xx_clks[] = {
-       PXA3xx_CK("LCDCLK", LCD,    &clk_pxa3xx_hsio_ops, &pxa_device_fb.dev),
-       PXA3xx_CK("CAMCLK", CAMERA, &clk_pxa3xx_hsio_ops, NULL),
+       {
+               .name           = "CLK_POUT",
+               .ops            = &clk_pout_ops,
+               .rate           = 13000000,
+               .delay          = 70,
+       },
+
+       PXA3xx_CK("LCDCLK",  LCD,    &clk_pxa3xx_hsio_ops, &pxa_device_fb.dev),
+       PXA3xx_CK("CAMCLK",  CAMERA, &clk_pxa3xx_hsio_ops, NULL),
+       PXA3xx_CK("AC97CLK", AC97,   &clk_pxa3xx_ac97_ops, NULL),
 
        PXA3xx_CKEN("UARTCLK", FFUART, 14857000, 1, &pxa_device_ffuart.dev),
        PXA3xx_CKEN("UARTCLK", BTUART, 14857000, 1, &pxa_device_btuart.dev),
@@ -185,6 +233,7 @@ static struct clk pxa3xx_clks[] = {
        PXA3xx_CKEN("I2CCLK", I2C,  32842000, 0, &pxa_device_i2c.dev),
        PXA3xx_CKEN("UDCCLK", UDC,  48000000, 5, &pxa_device_udc.dev),
        PXA3xx_CKEN("USBCLK", USBH, 48000000, 0, &pxa27x_device_ohci.dev),
+       PXA3xx_CKEN("KBDCLK", KEYPAD,  32768, 0, &pxa27x_device_keypad.dev),
 
        PXA3xx_CKEN("SSPCLK", SSP1, 13000000, 0, &pxa27x_device_ssp1.dev),
        PXA3xx_CKEN("SSPCLK", SSP2, 13000000, 0, &pxa27x_device_ssp2.dev),
@@ -305,8 +354,10 @@ static void pxa3xx_cpu_pm_enter(suspend_state_t state)
        /*
         * Don't sleep if no wakeup sources are defined
         */
-       if (wakeup_src == 0)
+       if (wakeup_src == 0) {
+               printk(KERN_ERR "Not suspending: no wakeup sources\n");
                return;
+       }
 
        switch (state) {
        case PM_SUSPEND_STANDBY:
@@ -446,15 +497,9 @@ static int pxa3xx_set_wake(unsigned int irq, unsigned int on)
 
        return 0;
 }
-
-static void pxa3xx_init_irq_pm(void)
-{
-       pxa_init_irq_set_wake(pxa3xx_set_wake);
-}
-
 #else
 static inline void pxa3xx_init_pm(void) {}
-static inline void pxa3xx_init_irq_pm(void) {}
+#define pxa3xx_set_wake        NULL
 #endif
 
 void __init pxa3xx_init_irq(void)
@@ -465,10 +510,8 @@ void __init pxa3xx_init_irq(void)
        value |= (1 << 6);
        __asm__ __volatile__("mcr p15, 0, %0, c15, c1, 0\n": :"r"(value));
 
-       pxa_init_irq_low();
-       pxa_init_irq_high();
-       pxa_init_irq_gpio(128);
-       pxa3xx_init_irq_pm();
+       pxa_init_irq(56, pxa3xx_set_wake);
+       pxa_init_gpio(128, NULL);
 }
 
 /*
@@ -490,11 +533,9 @@ static struct platform_device *devices[] __initdata = {
 
 static struct sys_device pxa3xx_sysdev[] = {
        {
-               .id     = 0,
                .cls    = &pxa_irq_sysclass,
        }, {
-               .id     = 1,
-               .cls    = &pxa_irq_sysclass,
+               .cls    = &pxa3xx_mfp_sysclass,
        }, {
                .cls    = &pxa_gpio_sysclass,
        },
@@ -532,4 +573,4 @@ static int __init pxa3xx_init(void)
        return ret;
 }
 
-subsys_initcall(pxa3xx_init);
+postcore_initcall(pxa3xx_init);
index f9d1b61e118523f70ef8422cc7dfcdd663592d96..34cd585075b076c76e517558d45f226588c9fa20 100644 (file)
@@ -26,6 +26,7 @@
 #include <asm/mach-types.h>
 #include <asm/arch/pm.h>
 #include <asm/arch/pxa-regs.h>
+#include <asm/arch/pxa2xx-gpio.h>
 #include <asm/arch/sharpsl.h>
 #include "sharpsl.h"
 
index 9e7773fca01cf391abbe3ccf79e841c8f9f0ab47..62a02c3927c576e26d0dd016c3518882a5e0778f 100644 (file)
@@ -37,6 +37,7 @@
 
 #include <asm/arch/pxa-regs.h>
 #include <asm/arch/pxa2xx-regs.h>
+#include <asm/arch/pxa2xx-gpio.h>
 #include <asm/arch/irda.h>
 #include <asm/arch/mmc.h>
 #include <asm/arch/ohci.h>
index 745a4dc7acdde6dc2fe4918c427178aac1a5f546..7a7f5f947cc557d2a5b4e81796ab92663a09e252 100644 (file)
@@ -26,6 +26,7 @@
 #include <asm/arch/sharpsl.h>
 #include <asm/arch/spitz.h>
 #include <asm/arch/pxa-regs.h>
+#include <asm/arch/pxa2xx-gpio.h>
 #include "sharpsl.h"
 
 #define SHARPSL_CHARGE_ON_VOLT         0x99  /* 2.9V */
index f99112d50b41ef44b82b99e9c187767646bb777b..6458f6d371d966e16399ce61c596df2835f75653 100644 (file)
@@ -23,6 +23,7 @@
 #include <linux/delay.h>
 #include <linux/gpio_keys.h>
 #include <linux/input.h>
+#include <linux/gpio.h>
 
 #include <asm/setup.h>
 #include <asm/memory.h>
@@ -32,7 +33,9 @@
 #include <asm/system.h>
 #include <asm/arch/pxa-regs.h>
 #include <asm/arch/pxa2xx-regs.h>
+#include <asm/arch/mfp-pxa25x.h>
 #include <asm/arch/irda.h>
+#include <asm/arch/i2c.h>
 #include <asm/arch/mmc.h>
 #include <asm/arch/udc.h>
 
 #include "generic.h"
 #include "devices.h"
 
+static unsigned long tosa_pin_config[] = {
+       GPIO78_nCS_2, /* Scoop */
+       GPIO80_nCS_4, /* tg6393xb */
+       GPIO33_nCS_5, /* Scoop */
+
+       // GPIO76 CARD_VCC_ON1
+
+       GPIO19_GPIO, /* Reset out */
+       GPIO1_RST | WAKEUP_ON_EDGE_FALL,
+
+       GPIO0_GPIO | WAKEUP_ON_EDGE_FALL, /* WAKE_UP */
+       GPIO2_GPIO | WAKEUP_ON_EDGE_BOTH, /* AC_IN */
+       GPIO3_GPIO | WAKEUP_ON_EDGE_FALL, /* RECORD */
+       GPIO4_GPIO | WAKEUP_ON_EDGE_FALL, /* SYNC */
+       GPIO20_GPIO, /* EAR_IN */
+       GPIO22_GPIO, /* On */
+
+       GPIO5_GPIO, /* USB_IN */
+       GPIO32_GPIO, /* Pen IRQ */
+
+       GPIO7_GPIO, /* Jacket Detect */
+       GPIO14_GPIO, /* BAT0_CRG */
+       GPIO12_GPIO, /* BAT1_CRG */
+       GPIO17_GPIO, /* BAT0_LOW */
+       GPIO84_GPIO, /* BAT1_LOW */
+       GPIO38_GPIO, /* BAT_LOCK */
+
+       GPIO11_3_6MHz,
+       GPIO15_GPIO, /* TC6393XB IRQ */
+       GPIO18_RDY,
+       GPIO27_GPIO, /* LCD Sync */
+
+       /* MMC */
+       GPIO6_MMC_CLK,
+       GPIO8_MMC_CS0,
+       GPIO9_GPIO, /* Detect */
+       // GPIO10 nSD_INT
+
+       /* CF */
+       GPIO13_GPIO, /* CD_IRQ */
+       GPIO21_GPIO, /* Main Slot IRQ */
+       GPIO36_GPIO, /* Jacket Slot IRQ */
+       GPIO48_nPOE,
+       GPIO49_nPWE,
+       GPIO50_nPIOR,
+       GPIO51_nPIOW,
+       GPIO52_nPCE_1,
+       GPIO53_nPCE_2,
+       GPIO54_nPSKTSEL,
+       GPIO55_nPREG,
+       GPIO56_nPWAIT,
+       GPIO57_nIOIS16,
+
+       /* AC97 */
+       GPIO31_AC97_SYNC,
+       GPIO30_AC97_SDATA_OUT,
+       GPIO28_AC97_BITCLK,
+       GPIO29_AC97_SDATA_IN_0,
+       // GPIO79 nAUD_IRQ
+
+       /* FFUART */
+       GPIO34_FFUART_RXD,
+       GPIO35_FFUART_CTS,
+       GPIO37_FFUART_DSR,
+       GPIO39_FFUART_TXD,
+       GPIO40_FFUART_DTR,
+       GPIO41_FFUART_RTS,
+
+       /* BTUART */
+       GPIO42_BTUART_RXD,
+       GPIO43_BTUART_TXD,
+       GPIO44_BTUART_CTS,
+       GPIO45_BTUART_RTS,
+
+       /* IrDA */
+       GPIO46_STUART_RXD,
+       GPIO47_STUART_TXD,
+
+       /* Keybd */
+       GPIO58_GPIO,
+       GPIO59_GPIO,
+       GPIO60_GPIO,
+       GPIO61_GPIO,
+       GPIO62_GPIO,
+       GPIO63_GPIO,
+       GPIO64_GPIO,
+       GPIO65_GPIO,
+       GPIO66_GPIO,
+       GPIO67_GPIO,
+       GPIO68_GPIO,
+       GPIO69_GPIO,
+       GPIO70_GPIO,
+       GPIO71_GPIO,
+       GPIO72_GPIO,
+       GPIO73_GPIO,
+       GPIO74_GPIO,
+       GPIO75_GPIO,
+
+       /* SPI */
+       GPIO81_SSP2_CLK_OUT,
+       GPIO82_SSP2_FRM_OUT,
+       GPIO83_SSP2_TXD,
+};
+
 /*
  * SCOOP Device
  */
@@ -60,11 +167,10 @@ static struct resource tosa_scoop_resources[] = {
 
 static struct scoop_config tosa_scoop_setup = {
        .io_dir         = TOSA_SCOOP_IO_DIR,
-       .io_out         = TOSA_SCOOP_IO_OUT,
-
+       .gpio_base      = TOSA_SCOOP_GPIO_BASE,
 };
 
-struct platform_device tosascoop_device = {
+static struct platform_device tosascoop_device = {
        .name           = "sharp-scoop",
        .id             = 0,
        .dev            = {
@@ -88,10 +194,10 @@ static struct resource tosa_scoop_jc_resources[] = {
 
 static struct scoop_config tosa_scoop_jc_setup = {
        .io_dir         = TOSA_SCOOP_JC_IO_DIR,
-       .io_out         = TOSA_SCOOP_JC_IO_OUT,
+       .gpio_base      = TOSA_SCOOP_JC_GPIO_BASE,
 };
 
-struct platform_device tosascoop_jc_device = {
+static struct platform_device tosascoop_jc_device = {
        .name           = "sharp-scoop",
        .id             = 1,
        .dev            = {
@@ -118,50 +224,16 @@ static struct scoop_pcmcia_dev tosa_pcmcia_scoop[] = {
 },
 };
 
-static void tosa_pcmcia_init(void)
-{
-       /* Setup default state of GPIO outputs
-          before we enable them as outputs. */
-       GPSR(GPIO48_nPOE) = GPIO_bit(GPIO48_nPOE) |
-               GPIO_bit(GPIO49_nPWE) | GPIO_bit(GPIO50_nPIOR) |
-               GPIO_bit(GPIO51_nPIOW) | GPIO_bit(GPIO52_nPCE_1) |
-               GPIO_bit(GPIO53_nPCE_2);
-
-       pxa_gpio_mode(GPIO48_nPOE_MD);
-       pxa_gpio_mode(GPIO49_nPWE_MD);
-       pxa_gpio_mode(GPIO50_nPIOR_MD);
-       pxa_gpio_mode(GPIO51_nPIOW_MD);
-       pxa_gpio_mode(GPIO55_nPREG_MD);
-       pxa_gpio_mode(GPIO56_nPWAIT_MD);
-       pxa_gpio_mode(GPIO57_nIOIS16_MD);
-       pxa_gpio_mode(GPIO52_nPCE_1_MD);
-       pxa_gpio_mode(GPIO53_nPCE_2_MD);
-       pxa_gpio_mode(GPIO54_pSKTSEL_MD);
-}
-
 static struct scoop_pcmcia_config tosa_pcmcia_config = {
        .devs         = &tosa_pcmcia_scoop[0],
        .num_devs     = 2,
-       .pcmcia_init  = tosa_pcmcia_init,
 };
 
 /*
  * USB Device Controller
  */
-static void tosa_udc_command(int cmd)
-{
-       switch(cmd)     {
-               case PXA2XX_UDC_CMD_CONNECT:
-                       set_scoop_gpio(&tosascoop_jc_device.dev,TOSA_SCOOP_JC_USB_PULLUP);
-                       break;
-               case PXA2XX_UDC_CMD_DISCONNECT:
-                       reset_scoop_gpio(&tosascoop_jc_device.dev,TOSA_SCOOP_JC_USB_PULLUP);
-                       break;
-       }
-}
-
 static struct pxa2xx_udc_mach_info udc_info __initdata = {
-       .udc_command            = tosa_udc_command,
+       .gpio_pullup            = TOSA_GPIO_USB_PULLUP,
        .gpio_vbus              = TOSA_GPIO_USB_IN,
        .gpio_vbus_inverted     = 1,
 };
@@ -175,19 +247,44 @@ static int tosa_mci_init(struct device *dev, irq_handler_t tosa_detect_int, void
 {
        int err;
 
-       /* setup GPIO for PXA25x MMC controller */
-       pxa_gpio_mode(GPIO6_MMCCLK_MD);
-       pxa_gpio_mode(GPIO8_MMCCS0_MD);
-       pxa_gpio_mode(TOSA_GPIO_nSD_DETECT | GPIO_IN);
-
        tosa_mci_platform_data.detect_delay = msecs_to_jiffies(250);
 
        err = request_irq(TOSA_IRQ_GPIO_nSD_DETECT, tosa_detect_int,
                          IRQF_DISABLED | IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
                                "MMC/SD card detect", data);
-       if (err)
+       if (err) {
                printk(KERN_ERR "tosa_mci_init: MMC/SD: can't request MMC card detect IRQ\n");
+               goto err_irq;
+       }
 
+       err = gpio_request(TOSA_GPIO_SD_WP, "sd_wp");
+       if (err) {
+               printk(KERN_ERR "tosa_mci_init: can't request SD_WP gpio\n");
+               goto err_gpio_wp;
+       }
+       err = gpio_direction_input(TOSA_GPIO_SD_WP);
+       if (err)
+               goto err_gpio_wp_dir;
+
+       err = gpio_request(TOSA_GPIO_PWR_ON, "sd_pwr");
+       if (err) {
+               printk(KERN_ERR "tosa_mci_init: can't request SD_PWR gpio\n");
+               goto err_gpio_pwr;
+       }
+       err = gpio_direction_output(TOSA_GPIO_PWR_ON, 0);
+       if (err)
+               goto err_gpio_pwr_dir;
+
+       return 0;
+
+err_gpio_pwr_dir:
+       gpio_free(TOSA_GPIO_PWR_ON);
+err_gpio_pwr:
+err_gpio_wp_dir:
+       gpio_free(TOSA_GPIO_SD_WP);
+err_gpio_wp:
+       free_irq(TOSA_IRQ_GPIO_nSD_DETECT, data);
+err_irq:
        return err;
 }
 
@@ -196,19 +293,21 @@ static void tosa_mci_setpower(struct device *dev, unsigned int vdd)
        struct pxamci_platform_data* p_d = dev->platform_data;
 
        if (( 1 << vdd) & p_d->ocr_mask) {
-               set_scoop_gpio(&tosascoop_device.dev,TOSA_SCOOP_PWR_ON);
+               gpio_set_value(TOSA_GPIO_PWR_ON, 1);
        } else {
-               reset_scoop_gpio(&tosascoop_device.dev,TOSA_SCOOP_PWR_ON);
+               gpio_set_value(TOSA_GPIO_PWR_ON, 0);
        }
 }
 
 static int tosa_mci_get_ro(struct device *dev)
 {
-       return (read_scoop_reg(&tosascoop_device.dev, SCOOP_GPWR)&TOSA_SCOOP_SD_WP);
+       return gpio_get_value(TOSA_GPIO_SD_WP);
 }
 
 static void tosa_mci_exit(struct device *dev, void *data)
 {
+       gpio_free(TOSA_GPIO_PWR_ON);
+       gpio_free(TOSA_GPIO_SD_WP);
        free_irq(TOSA_IRQ_GPIO_nSD_DETECT, data);
 }
 
@@ -223,21 +322,36 @@ static struct pxamci_platform_data tosa_mci_platform_data = {
 /*
  * Irda
  */
-static void tosa_irda_transceiver_mode(struct device *dev, int mode)
+static int tosa_irda_startup(struct device *dev)
 {
-       if (mode & IR_OFF) {
-               reset_scoop_gpio(&tosascoop_device.dev,TOSA_SCOOP_IR_POWERDWN);
-               pxa_gpio_mode(GPIO47_STTXD|GPIO_DFLT_LOW);
-               pxa_gpio_mode(GPIO47_STTXD|GPIO_OUT);
-       } else {
-               pxa_gpio_mode(GPIO47_STTXD_MD);
-               set_scoop_gpio(&tosascoop_device.dev,TOSA_SCOOP_IR_POWERDWN);
+       int ret;
+
+       ret = gpio_request(TOSA_GPIO_IR_POWERDWN, "IrDA powerdown");
+       if (ret)
+               return ret;
+
+       ret = gpio_direction_output(TOSA_GPIO_IR_POWERDWN, 0);
+       if (ret)
+               gpio_free(TOSA_GPIO_IR_POWERDWN);
+
+       return ret;
        }
+
+static void tosa_irda_shutdown(struct device *dev)
+{
+       gpio_free(TOSA_GPIO_IR_POWERDWN);
+}
+
+static void tosa_irda_transceiver_mode(struct device *dev, int mode)
+{
+       gpio_set_value(TOSA_GPIO_IR_POWERDWN, !(mode & IR_OFF));
 }
 
 static struct pxaficp_platform_data tosa_ficp_platform_data = {
        .transceiver_cap  = IR_SIRMODE | IR_OFF,
        .transceiver_mode = tosa_irda_transceiver_mode,
+       .startup = tosa_irda_startup,
+       .shutdown = tosa_irda_shutdown,
 };
 
 /*
@@ -249,12 +363,28 @@ static struct platform_device tosakbd_device = {
 };
 
 static struct gpio_keys_button tosa_gpio_keys[] = {
+       /*
+        * Two following keys are directly tied to "ON" button of tosa. Why?
+        * The first one can be used as a wakeup source, the second can't;
+        * also the first one is OR of ac_powered and on_button.
+        */
+       {
+               .type   = EV_PWR,
+               .code   = KEY_RESERVED,
+               .gpio   = TOSA_GPIO_POWERON,
+               .desc   = "Poweron",
+               .wakeup = 1,
+               .active_low = 1,
+       },
        {
                .type   = EV_PWR,
                .code   = KEY_SUSPEND,
                .gpio   = TOSA_GPIO_ON_KEY,
                .desc   = "On key",
-               .wakeup = 1,
+               /*
+                * can't be used as wakeup
+                * .wakeup      = 1,
+                */
                .active_low = 1,
        },
        {
@@ -291,9 +421,40 @@ static struct platform_device tosa_gpio_keys_device = {
 /*
  * Tosa LEDs
  */
+static struct gpio_led tosa_gpio_leds[] = {
+       {
+               .name                   = "tosa:amber:charge",
+               .default_trigger        = "main-battery-charging",
+               .gpio                   = TOSA_GPIO_CHRG_ERR_LED,
+       },
+       {
+               .name                   = "tosa:green:mail",
+               .default_trigger        = "nand-disk",
+               .gpio                   = TOSA_GPIO_NOTE_LED,
+       },
+       {
+               .name                   = "tosa:dual:wlan",
+               .default_trigger        = "none",
+               .gpio                   = TOSA_GPIO_WLAN_LED,
+       },
+       {
+               .name                   = "tosa:blue:bluetooth",
+               .default_trigger        = "none",
+               .gpio                   = TOSA_GPIO_BT_LED,
+       },
+};
+
+static struct gpio_led_platform_data tosa_gpio_leds_platform_data = {
+       .leds           = tosa_gpio_leds,
+       .num_leds       = ARRAY_SIZE(tosa_gpio_leds),
+};
+
 static struct platform_device tosaled_device = {
-    .name   = "tosa-led",
-    .id     = -1,
+       .name   = "leds-gpio",
+       .id     = -1,
+       .dev    = {
+               .platform_data  = &tosa_gpio_leds_platform_data,
+       },
 };
 
 static struct platform_device *devices[] __initdata = {
@@ -326,20 +487,13 @@ static void tosa_restart(char mode)
 
 static void __init tosa_init(void)
 {
+       pxa2xx_mfp_config(ARRAY_AND_SIZE(tosa_pin_config));
+       gpio_set_wake(MFP_PIN_GPIO1, 1);
+       /* We can't pass to gpio-keys since it will drop the Reset altfunc */
+
        pm_power_off = tosa_poweroff;
        arm_pm_restart = tosa_restart;
 
-       pxa_gpio_mode(TOSA_GPIO_ON_RESET | GPIO_IN);
-       pxa_gpio_mode(TOSA_GPIO_TC6393_INT | GPIO_IN);
-       pxa_gpio_mode(TOSA_GPIO_USB_IN | GPIO_IN);
-
-       /* setup sleep mode values */
-       PWER  = 0x00000002;
-       PFER  = 0x00000000;
-       PRER  = 0x00000002;
-       PGSR0 = 0x00000000;
-       PGSR1 = 0x00FF0002;
-       PGSR2 = 0x00014000;
        PCFR |= PCFR_OPDE;
 
        /* enable batt_fault */
@@ -348,6 +502,7 @@ static void __init tosa_init(void)
        pxa_set_mci_info(&tosa_mci_platform_data);
        pxa_set_udc_info(&udc_info);
        pxa_set_ficp_info(&tosa_ficp_platform_data);
+       pxa_set_i2c_info(NULL);
        platform_scoop_config = &tosa_pcmcia_config;
 
        platform_add_devices(devices, ARRAY_SIZE(devices));
index f207fcd30cd7426f041806d88f0b52db6be69832..931885d86b91116bd912e2b8b9ab9db6787fea57 100644 (file)
@@ -41,6 +41,7 @@
 #include <asm/mach/flash.h>
 
 #include <asm/arch/pxa-regs.h>
+#include <asm/arch/pxa2xx-gpio.h>
 #include <asm/arch/trizeps4.h>
 #include <asm/arch/audio.h>
 #include <asm/arch/pxafb.h>
index afd2cbfca0d91c993d94a8fd6400d73ff5807cf4..dbb546216be19d3220504fbce21bac09ab0780b5 100644 (file)
@@ -26,6 +26,7 @@
 #include <asm/arch/pxafb.h>
 #include <asm/arch/zylonite.h>
 #include <asm/arch/mmc.h>
+#include <asm/arch/pxa27x_keypad.h>
 
 #include "generic.h"
 
@@ -35,6 +36,8 @@ struct platform_mmc_slot zylonite_mmc_slot[MAX_SLOTS];
 int gpio_backlight;
 int gpio_eth_irq;
 
+int wm9713_irq;
+
 int lcd_id;
 int lcd_orientation;
 
@@ -249,6 +252,71 @@ static void __init zylonite_init_mmc(void)
 static inline void zylonite_init_mmc(void) {}
 #endif
 
+#if defined(CONFIG_KEYBOARD_PXA27x) || defined(CONFIG_KEYBOARD_PXA27x_MODULES)
+static unsigned int zylonite_matrix_key_map[] = {
+       /* KEY(row, col, key_code) */
+       KEY(0, 0, KEY_A), KEY(0, 1, KEY_B), KEY(0, 2, KEY_C), KEY(0, 5, KEY_D),
+       KEY(1, 0, KEY_E), KEY(1, 1, KEY_F), KEY(1, 2, KEY_G), KEY(1, 5, KEY_H),
+       KEY(2, 0, KEY_I), KEY(2, 1, KEY_J), KEY(2, 2, KEY_K), KEY(2, 5, KEY_L),
+       KEY(3, 0, KEY_M), KEY(3, 1, KEY_N), KEY(3, 2, KEY_O), KEY(3, 5, KEY_P),
+       KEY(5, 0, KEY_Q), KEY(5, 1, KEY_R), KEY(5, 2, KEY_S), KEY(5, 5, KEY_T),
+       KEY(6, 0, KEY_U), KEY(6, 1, KEY_V), KEY(6, 2, KEY_W), KEY(6, 5, KEY_X),
+       KEY(7, 1, KEY_Y), KEY(7, 2, KEY_Z),
+
+       KEY(4, 4, KEY_0), KEY(1, 3, KEY_1), KEY(4, 1, KEY_2), KEY(1, 4, KEY_3),
+       KEY(2, 3, KEY_4), KEY(4, 2, KEY_5), KEY(2, 4, KEY_6), KEY(3, 3, KEY_7),
+       KEY(4, 3, KEY_8), KEY(3, 4, KEY_9),
+
+       KEY(4, 5, KEY_SPACE),
+       KEY(5, 3, KEY_KPASTERISK),      /* * */
+       KEY(5, 4, KEY_KPDOT),           /* #" */
+
+       KEY(0, 7, KEY_UP),
+       KEY(1, 7, KEY_DOWN),
+       KEY(2, 7, KEY_LEFT),
+       KEY(3, 7, KEY_RIGHT),
+       KEY(2, 6, KEY_HOME),
+       KEY(3, 6, KEY_END),
+       KEY(6, 4, KEY_DELETE),
+       KEY(6, 6, KEY_BACK),
+       KEY(6, 3, KEY_CAPSLOCK),        /* KEY_LEFTSHIFT), */
+
+       KEY(4, 6, KEY_ENTER),           /* scroll push */
+       KEY(5, 7, KEY_ENTER),           /* keypad action */
+
+       KEY(0, 4, KEY_EMAIL),
+       KEY(5, 6, KEY_SEND),
+       KEY(4, 0, KEY_CALENDAR),
+       KEY(7, 6, KEY_RECORD),
+       KEY(6, 7, KEY_VOLUMEUP),
+       KEY(7, 7, KEY_VOLUMEDOWN),
+
+       KEY(0, 6, KEY_F22),     /* soft1 */
+       KEY(1, 6, KEY_F23),     /* soft2 */
+       KEY(0, 3, KEY_AUX),     /* contact */
+};
+
+static struct pxa27x_keypad_platform_data zylonite_keypad_info = {
+       .matrix_key_rows        = 8,
+       .matrix_key_cols        = 8,
+       .matrix_key_map         = zylonite_matrix_key_map,
+       .matrix_key_map_size    = ARRAY_SIZE(zylonite_matrix_key_map),
+
+       .enable_rotary0         = 1,
+       .rotary0_up_key         = KEY_UP,
+       .rotary0_down_key       = KEY_DOWN,
+
+       .debounce_interval      = 30,
+};
+
+static void __init zylonite_init_keypad(void)
+{
+       pxa_set_keypad_info(&zylonite_keypad_info);
+}
+#else
+static inline void zylonite_init_keypad(void) {}
+#endif
+
 static void __init zylonite_init(void)
 {
        /* board-processor specific initialization */
@@ -265,6 +333,7 @@ static void __init zylonite_init(void)
 
        zylonite_init_lcd();
        zylonite_init_mmc();
+       zylonite_init_keypad();
 }
 
 MACHINE_START(ZYLONITE, "PXA3xx Platform Development Kit (aka Zylonite)")
index 6ac04c09b0e9bd4ff5c4117b7a265f3e7d9ef3e5..324fb9daae285300d68d3fc5bbeaf543bc6bb296 100644 (file)
@@ -21,7 +21,7 @@
 #include <asm/arch/mfp-pxa300.h>
 #include <asm/arch/zylonite.h>
 
-#define ARRAY_AND_SIZE(x)      (x), ARRAY_SIZE(x)
+#include "generic.h"
 
 /* PXA300/PXA310 common configurations */
 static mfp_cfg_t common_mfp_cfg[] __initdata = {
@@ -69,6 +69,9 @@ static mfp_cfg_t common_mfp_cfg[] __initdata = {
        GPIO27_AC97_SDATA_OUT,
        GPIO28_AC97_SYNC,
 
+       /* WM9713 IRQ */
+       GPIO26_GPIO,
+
        /* Keypad */
        GPIO107_KP_DKIN_0 | MFP_LPM_EDGE_BOTH,
        GPIO108_KP_DKIN_1 | MFP_LPM_EDGE_BOTH,
@@ -203,6 +206,9 @@ void __init zylonite_pxa300_init(void)
                /* MMC card detect & write protect for controller 0 */
                zylonite_mmc_slot[0].gpio_cd  = EXT_GPIO(0);
                zylonite_mmc_slot[0].gpio_wp  = EXT_GPIO(2);
+
+               /* WM9713 IRQ */
+               wm9713_irq = mfp_to_gpio(MFP_PIN_GPIO26);
        }
 
        if (cpu_is_pxa300()) {
index dfa79992b8ab4905573ddc6cc1454753ab2ae613..193d07903b06f68b211edc2dcf9f7915b8a387a9 100644 (file)
@@ -21,7 +21,7 @@
 #include <asm/arch/mfp-pxa320.h>
 #include <asm/arch/zylonite.h>
 
-#define ARRAY_AND_SIZE(x)      (x), ARRAY_SIZE(x)
+#include "generic.h"
 
 static mfp_cfg_t mfp_cfg[] __initdata = {
        /* LCD */
@@ -68,6 +68,9 @@ static mfp_cfg_t mfp_cfg[] __initdata = {
        GPIO39_AC97_BITCLK,
        GPIO40_AC97_nACRESET,
 
+       /* WM9713 IRQ */
+       GPIO15_GPIO,
+
        /* I2C */
        GPIO32_I2C_SCL,
        GPIO33_I2C_SDA,
@@ -190,5 +193,8 @@ void __init zylonite_pxa320_init(void)
                /* MMC card detect & write protect for controller 0 */
                zylonite_mmc_slot[0].gpio_cd  = mfp_to_gpio(MFP_PIN_GPIO1);
                zylonite_mmc_slot[0].gpio_wp  = mfp_to_gpio(MFP_PIN_GPIO5);
+
+               /* WM9713 IRQ */
+               wm9713_irq = mfp_to_gpio(MFP_PIN_GPIO15);
        }
 }
index 39b3bb7f1020b35725ead58c7d5e051ce8ce0170..5ccde7cf39e868ce129c4f4fc204903d1f72f6d8 100644 (file)
@@ -10,7 +10,6 @@ config MACH_REALVIEW_EB
 config REALVIEW_EB_ARM11MP
        bool "Support ARM11MPCore tile"
        depends on MACH_REALVIEW_EB
-       select CACHE_L2X0
        help
          Enable support for the ARM11MPCore tile on the Realview platform.
 
@@ -24,4 +23,18 @@ config REALVIEW_EB_ARM11MP_REVB
          kernel built with this option enabled is not compatible with
          other revisions of the ARM11MPCore tile.
 
+config MACH_REALVIEW_PB11MP
+       bool "Support RealView/PB11MPCore platform"
+       select ARM_GIC
+       help
+         Include support for the ARM(R) RealView MPCore Platform Baseboard.
+         PB11MPCore is a platform with an on-board ARM11MPCore and has
+         support for PCI-E and Compact Flash.
+
+config MACH_REALVIEW_PB1176
+       bool "Support RealView/PB1176 platform"
+       select ARM_GIC
+       help
+         Include support for the ARM(R) RealView ARM1176 Platform Baseboard.
+
 endmenu
index ca1e390c3c28795f3873bc8249e3eb3c74a8f078..d2ae077431dd5629b7805924c18ed63399ad8ba6 100644 (file)
@@ -4,5 +4,7 @@
 
 obj-y                                  := core.o clock.o
 obj-$(CONFIG_MACH_REALVIEW_EB)         += realview_eb.o
+obj-$(CONFIG_MACH_REALVIEW_PB11MP)     += realview_pb11mp.o
+obj-$(CONFIG_MACH_REALVIEW_PB1176)     += realview_pb1176.o
 obj-$(CONFIG_SMP)                      += platsmp.o headsmp.o localtimer.o
 obj-$(CONFIG_HOTPLUG_CPU)              += hotplug.o
index 21325a4da9da65bd23a13bc2587a81312ba0bb4e..3e706c57833aebc16a39e0f61a1fa1356e4ed730 100644 (file)
@@ -16,7 +16,6 @@
 #include <linux/clk.h>
 #include <linux/mutex.h>
 
-#include <asm/semaphore.h>
 #include <asm/hardware/icst307.h>
 
 #include "clock.h"
index 98aefc9f4df3bb3b81e6237b900a61d3930429fb..131990d196f5cc2c7fc70da2f840ed4b26ef28eb 100644 (file)
@@ -109,22 +109,21 @@ static struct flash_platform_data realview_flash_data = {
        .set_vpp                = realview_flash_set_vpp,
 };
 
-static struct resource realview_flash_resource = {
-       .start                  = REALVIEW_FLASH_BASE,
-       .end                    = REALVIEW_FLASH_BASE + REALVIEW_FLASH_SIZE,
-       .flags                  = IORESOURCE_MEM,
-};
-
 struct platform_device realview_flash_device = {
        .name                   = "armflash",
        .id                     = 0,
        .dev                    = {
                .platform_data  = &realview_flash_data,
        },
-       .num_resources          = 1,
-       .resource               = &realview_flash_resource,
 };
 
+int realview_flash_register(struct resource *res, u32 num)
+{
+       realview_flash_device.resource = res;
+       realview_flash_device.num_resources = num;
+       return platform_device_register(&realview_flash_device);
+}
+
 static struct resource realview_i2c_resource = {
        .start          = REALVIEW_I2C_BASE,
        .end            = REALVIEW_I2C_BASE + SZ_4K - 1,
@@ -445,10 +444,10 @@ void realview_leds_event(led_event_t ledevt)
 /*
  * Where is the timer (VA)?
  */
-#define TIMER0_VA_BASE          __io_address(REALVIEW_TIMER0_1_BASE)
-#define TIMER1_VA_BASE         (__io_address(REALVIEW_TIMER0_1_BASE) + 0x20)
-#define TIMER2_VA_BASE          __io_address(REALVIEW_TIMER2_3_BASE)
-#define TIMER3_VA_BASE         (__io_address(REALVIEW_TIMER2_3_BASE) + 0x20)
+void __iomem *timer0_va_base;
+void __iomem *timer1_va_base;
+void __iomem *timer2_va_base;
+void __iomem *timer3_va_base;
 
 /*
  * How long is the timer interval?
@@ -475,7 +474,7 @@ static void timer_set_mode(enum clock_event_mode mode,
 
        switch(mode) {
        case CLOCK_EVT_MODE_PERIODIC:
-               writel(TIMER_RELOAD, TIMER0_VA_BASE + TIMER_LOAD);
+               writel(TIMER_RELOAD, timer0_va_base + TIMER_LOAD);
 
                ctrl = TIMER_CTRL_PERIODIC;
                ctrl |= TIMER_CTRL_32BIT | TIMER_CTRL_IE | TIMER_CTRL_ENABLE;
@@ -491,16 +490,16 @@ static void timer_set_mode(enum clock_event_mode mode,
                ctrl = 0;
        }
 
-       writel(ctrl, TIMER0_VA_BASE + TIMER_CTRL);
+       writel(ctrl, timer0_va_base + TIMER_CTRL);
 }
 
 static int timer_set_next_event(unsigned long evt,
                                struct clock_event_device *unused)
 {
-       unsigned long ctrl = readl(TIMER0_VA_BASE + TIMER_CTRL);
+       unsigned long ctrl = readl(timer0_va_base + TIMER_CTRL);
 
-       writel(evt, TIMER0_VA_BASE + TIMER_LOAD);
-       writel(ctrl | TIMER_CTRL_ENABLE, TIMER0_VA_BASE + TIMER_CTRL);
+       writel(evt, timer0_va_base + TIMER_LOAD);
+       writel(ctrl | TIMER_CTRL_ENABLE, timer0_va_base + TIMER_CTRL);
 
        return 0;
 }
@@ -536,7 +535,7 @@ static irqreturn_t realview_timer_interrupt(int irq, void *dev_id)
        struct clock_event_device *evt = &timer0_clockevent;
 
        /* clear the interrupt */
-       writel(1, TIMER0_VA_BASE + TIMER_INTCLR);
+       writel(1, timer0_va_base + TIMER_INTCLR);
 
        evt->event_handler(evt);
 
@@ -551,7 +550,7 @@ static struct irqaction realview_timer_irq = {
 
 static cycle_t realview_get_cycles(void)
 {
-       return ~readl(TIMER3_VA_BASE + TIMER_VALUE);
+       return ~readl(timer3_va_base + TIMER_VALUE);
 }
 
 static struct clocksource clocksource_realview = {
@@ -566,11 +565,11 @@ static struct clocksource clocksource_realview = {
 static void __init realview_clocksource_init(void)
 {
        /* setup timer 0 as free-running clocksource */
-       writel(0, TIMER3_VA_BASE + TIMER_CTRL);
-       writel(0xffffffff, TIMER3_VA_BASE + TIMER_LOAD);
-       writel(0xffffffff, TIMER3_VA_BASE + TIMER_VALUE);
+       writel(0, timer3_va_base + TIMER_CTRL);
+       writel(0xffffffff, timer3_va_base + TIMER_LOAD);
+       writel(0xffffffff, timer3_va_base + TIMER_VALUE);
        writel(TIMER_CTRL_32BIT | TIMER_CTRL_ENABLE | TIMER_CTRL_PERIODIC,
-               TIMER3_VA_BASE + TIMER_CTRL);
+               timer3_va_base + TIMER_CTRL);
 
        clocksource_realview.mult =
                clocksource_khz2mult(1000, clocksource_realview.shift);
@@ -607,10 +606,10 @@ void __init realview_timer_init(unsigned int timer_irq)
        /*
         * Initialise to a known state (all timers off)
         */
-       writel(0, TIMER0_VA_BASE + TIMER_CTRL);
-       writel(0, TIMER1_VA_BASE + TIMER_CTRL);
-       writel(0, TIMER2_VA_BASE + TIMER_CTRL);
-       writel(0, TIMER3_VA_BASE + TIMER_CTRL);
+       writel(0, timer0_va_base + TIMER_CTRL);
+       writel(0, timer1_va_base + TIMER_CTRL);
+       writel(0, timer2_va_base + TIMER_CTRL);
+       writel(0, timer3_va_base + TIMER_CTRL);
 
        /* 
         * Make irqs happen for the system timer
index 492a14c0d604baa39e8234f51e3b215aca41004e..33dbbb41a6638b23c141fb4598c7b1a59bf0004f 100644 (file)
@@ -55,8 +55,13 @@ extern void __iomem *gic_cpu_base_addr;
 extern void __iomem *twd_base_addr;
 extern unsigned int twd_size;
 #endif
+extern void __iomem *timer0_va_base;
+extern void __iomem *timer1_va_base;
+extern void __iomem *timer2_va_base;
+extern void __iomem *timer3_va_base;
 
 extern void realview_leds_event(led_event_t ledevt);
 extern void realview_timer_init(unsigned int timer_irq);
+extern int realview_flash_register(struct resource *res, u32 num);
 
 #endif
index de2b7159557dd56c56eb5f673124cc263f0bfa6d..3e57428affeedac7f32b8fd883bb159810b63181 100644 (file)
 #include <linux/smp.h>
 
 #include <asm/cacheflush.h>
-#include <asm/hardware/arm_scu.h>
 #include <asm/hardware.h>
 #include <asm/io.h>
 #include <asm/mach-types.h>
 
+#include <asm/arch/board-eb.h>
+#include <asm/arch/board-pb11mp.h>
+#include <asm/arch/scu.h>
+
 extern void realview_secondary_startup(void);
 
 /*
@@ -31,9 +34,15 @@ volatile int __cpuinitdata pen_release = -1;
 static unsigned int __init get_core_count(void)
 {
        unsigned int ncores;
+       void __iomem *scu_base = 0;
+
+       if (machine_is_realview_eb() && core_tile_eb11mp())
+               scu_base = __io_address(REALVIEW_EB11MP_SCU_BASE);
+       else if (machine_is_realview_pb11mp())
+               scu_base = __io_address(REALVIEW_TC11MP_SCU_BASE);
 
-       if (machine_is_realview_eb() && core_tile_eb11mp()) {
-               ncores = __raw_readl(__io_address(REALVIEW_EB11MP_SCU_BASE) + SCU_CONFIG);
+       if (scu_base) {
+               ncores = __raw_readl(scu_base + SCU_CONFIG);
                ncores = (ncores & 0x03) + 1;
        } else
                ncores = 1;
@@ -41,6 +50,26 @@ static unsigned int __init get_core_count(void)
        return ncores;
 }
 
+/*
+ * Setup the SCU
+ */
+static void scu_enable(void)
+{
+       u32 scu_ctrl;
+       void __iomem *scu_base;
+
+       if (machine_is_realview_eb() && core_tile_eb11mp())
+               scu_base = __io_address(REALVIEW_EB11MP_SCU_BASE);
+       else if (machine_is_realview_pb11mp())
+               scu_base = __io_address(REALVIEW_TC11MP_SCU_BASE);
+       else
+               BUG();
+
+       scu_ctrl = __raw_readl(scu_base + SCU_CTRL);
+       scu_ctrl |= 1;
+       __raw_writel(scu_ctrl, scu_base + SCU_CTRL);
+}
+
 static DEFINE_SPINLOCK(boot_lock);
 
 void __cpuinit platform_secondary_init(unsigned int cpu)
@@ -57,7 +86,10 @@ void __cpuinit platform_secondary_init(unsigned int cpu)
         * core (e.g. timer irq), then they will not have been enabled
         * for us: do so
         */
-       gic_cpu_init(0, __io_address(REALVIEW_EB11MP_GIC_CPU_BASE));
+       if (machine_is_realview_eb() && core_tile_eb11mp())
+               gic_cpu_init(0, __io_address(REALVIEW_EB11MP_GIC_CPU_BASE));
+       else if (machine_is_realview_pb11mp())
+               gic_cpu_init(0, __io_address(REALVIEW_TC11MP_GIC_CPU_BASE));
 
        /*
         * let the primary processor know we're out of the
@@ -198,7 +230,8 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
         * dummy (!CONFIG_LOCAL_TIMERS), it was already registers in
         * realview_timer_init
         */
-       if (machine_is_realview_eb() && core_tile_eb11mp())
+       if ((machine_is_realview_eb() && core_tile_eb11mp()) ||
+           machine_is_realview_pb11mp())
                local_timer_setup(cpu);
 #endif
 
@@ -210,11 +243,14 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
                cpu_set(i, cpu_present_map);
 
        /*
-        * Do we need any more CPUs? If so, then let them know where
-        * to start. Note that, on modern versions of MILO, the "poke"
-        * doesn't actually do anything until each individual core is
-        * sent a soft interrupt to get it out of WFI
+        * Initialise the SCU if there are more than one CPU and let
+        * them know where to start. Note that, on modern versions of
+        * MILO, the "poke" doesn't actually do anything until each
+        * individual core is sent a soft interrupt to get it out of
+        * WFI
         */
-       if (max_cpus > 1)
+       if (max_cpus > 1) {
+               scu_enable();
                poke_milo();
+       }
 }
index 60d9eb810246f23957597695566de56af573750e..5782d83fd88660f22e1e075118658380b9cc4c20 100644 (file)
@@ -51,13 +51,13 @@ static struct map_desc realview_eb_io_desc[] __initdata = {
                .length         = SZ_4K,
                .type           = MT_DEVICE,
        }, {
-               .virtual        = IO_ADDRESS(REALVIEW_GIC_CPU_BASE),
-               .pfn            = __phys_to_pfn(REALVIEW_GIC_CPU_BASE),
+               .virtual        = IO_ADDRESS(REALVIEW_EB_GIC_CPU_BASE),
+               .pfn            = __phys_to_pfn(REALVIEW_EB_GIC_CPU_BASE),
                .length         = SZ_4K,
                .type           = MT_DEVICE,
        }, {
-               .virtual        = IO_ADDRESS(REALVIEW_GIC_DIST_BASE),
-               .pfn            = __phys_to_pfn(REALVIEW_GIC_DIST_BASE),
+               .virtual        = IO_ADDRESS(REALVIEW_EB_GIC_DIST_BASE),
+               .pfn            = __phys_to_pfn(REALVIEW_EB_GIC_DIST_BASE),
                .length         = SZ_4K,
                .type           = MT_DEVICE,
        }, {
@@ -66,20 +66,20 @@ static struct map_desc realview_eb_io_desc[] __initdata = {
                .length         = SZ_4K,
                .type           = MT_DEVICE,
        }, {
-               .virtual        = IO_ADDRESS(REALVIEW_TIMER0_1_BASE),
-               .pfn            = __phys_to_pfn(REALVIEW_TIMER0_1_BASE),
+               .virtual        = IO_ADDRESS(REALVIEW_EB_TIMER0_1_BASE),
+               .pfn            = __phys_to_pfn(REALVIEW_EB_TIMER0_1_BASE),
                .length         = SZ_4K,
                .type           = MT_DEVICE,
        }, {
-               .virtual        = IO_ADDRESS(REALVIEW_TIMER2_3_BASE),
-               .pfn            = __phys_to_pfn(REALVIEW_TIMER2_3_BASE),
+               .virtual        = IO_ADDRESS(REALVIEW_EB_TIMER2_3_BASE),
+               .pfn            = __phys_to_pfn(REALVIEW_EB_TIMER2_3_BASE),
                .length         = SZ_4K,
                .type           = MT_DEVICE,
        },
 #ifdef CONFIG_DEBUG_LL
        {
-               .virtual        = IO_ADDRESS(REALVIEW_UART0_BASE),
-               .pfn            = __phys_to_pfn(REALVIEW_UART0_BASE),
+               .virtual        = IO_ADDRESS(REALVIEW_EB_UART0_BASE),
+               .pfn            = __phys_to_pfn(REALVIEW_EB_UART0_BASE),
                .length         = SZ_4K,
                .type           = MT_DEVICE,
        }
@@ -136,12 +136,12 @@ static void __init realview_eb_map_io(void)
 /*
  * These devices are connected directly to the multi-layer AHB switch
  */
-#define SMC_IRQ                { NO_IRQ, NO_IRQ }
-#define SMC_DMA                { 0, 0 }
+#define EB_SMC_IRQ     { NO_IRQ, NO_IRQ }
+#define EB_SMC_DMA     { 0, 0 }
 #define MPMC_IRQ       { NO_IRQ, NO_IRQ }
 #define MPMC_DMA       { 0, 0 }
-#define CLCD_IRQ       { IRQ_EB_CLCD, NO_IRQ }
-#define CLCD_DMA       { 0, 0 }
+#define EB_CLCD_IRQ    { IRQ_EB_CLCD, NO_IRQ }
+#define EB_CLCD_DMA    { 0, 0 }
 #define DMAC_IRQ       { IRQ_EB_DMA, NO_IRQ }
 #define DMAC_DMA       { 0, 0 }
 
@@ -150,53 +150,53 @@ static void __init realview_eb_map_io(void)
  */
 #define SCTL_IRQ       { NO_IRQ, NO_IRQ }
 #define SCTL_DMA       { 0, 0 }
-#define WATCHDOG_IRQ   { IRQ_EB_WDOG, NO_IRQ }
-#define WATCHDOG_DMA   { 0, 0 }
-#define GPIO0_IRQ      { IRQ_EB_GPIO0, NO_IRQ }
-#define GPIO0_DMA      { 0, 0 }
+#define EB_WATCHDOG_IRQ        { IRQ_EB_WDOG, NO_IRQ }
+#define EB_WATCHDOG_DMA        { 0, 0 }
+#define EB_GPIO0_IRQ   { IRQ_EB_GPIO0, NO_IRQ }
+#define EB_GPIO0_DMA   { 0, 0 }
 #define GPIO1_IRQ      { IRQ_EB_GPIO1, NO_IRQ }
 #define GPIO1_DMA      { 0, 0 }
-#define RTC_IRQ                { IRQ_EB_RTC, NO_IRQ }
-#define RTC_DMA                { 0, 0 }
+#define EB_RTC_IRQ     { IRQ_EB_RTC, NO_IRQ }
+#define EB_RTC_DMA     { 0, 0 }
 
 /*
  * These devices are connected via the DMA APB bridge
  */
 #define SCI_IRQ                { IRQ_EB_SCI, NO_IRQ }
 #define SCI_DMA                { 7, 6 }
-#define UART0_IRQ      { IRQ_EB_UART0, NO_IRQ }
-#define UART0_DMA      { 15, 14 }
-#define UART1_IRQ      { IRQ_EB_UART1, NO_IRQ }
-#define UART1_DMA      { 13, 12 }
-#define UART2_IRQ      { IRQ_EB_UART2, NO_IRQ }
-#define UART2_DMA      { 11, 10 }
-#define UART3_IRQ      { IRQ_EB_UART3, NO_IRQ }
-#define UART3_DMA      { 0x86, 0x87 }
-#define SSP_IRQ                { IRQ_EB_SSP, NO_IRQ }
-#define SSP_DMA                { 9, 8 }
+#define EB_UART0_IRQ   { IRQ_EB_UART0, NO_IRQ }
+#define EB_UART0_DMA   { 15, 14 }
+#define EB_UART1_IRQ   { IRQ_EB_UART1, NO_IRQ }
+#define EB_UART1_DMA   { 13, 12 }
+#define EB_UART2_IRQ   { IRQ_EB_UART2, NO_IRQ }
+#define EB_UART2_DMA   { 11, 10 }
+#define EB_UART3_IRQ   { IRQ_EB_UART3, NO_IRQ }
+#define EB_UART3_DMA   { 0x86, 0x87 }
+#define EB_SSP_IRQ     { IRQ_EB_SSP, NO_IRQ }
+#define EB_SSP_DMA     { 9, 8 }
 
 /* FPGA Primecells */
 AMBA_DEVICE(aaci,  "fpga:04", AACI,     NULL);
 AMBA_DEVICE(mmc0,  "fpga:05", MMCI0,    &realview_mmc0_plat_data);
 AMBA_DEVICE(kmi0,  "fpga:06", KMI0,     NULL);
 AMBA_DEVICE(kmi1,  "fpga:07", KMI1,     NULL);
-AMBA_DEVICE(uart3, "fpga:09", UART3,    NULL);
+AMBA_DEVICE(uart3, "fpga:09", EB_UART3, NULL);
 
 /* DevChip Primecells */
-AMBA_DEVICE(smc,   "dev:00",  SMC,      NULL);
-AMBA_DEVICE(clcd,  "dev:20",  CLCD,     &clcd_plat_data);
+AMBA_DEVICE(smc,   "dev:00",  EB_SMC,   NULL);
+AMBA_DEVICE(clcd,  "dev:20",  EB_CLCD,  &clcd_plat_data);
 AMBA_DEVICE(dmac,  "dev:30",  DMAC,     NULL);
 AMBA_DEVICE(sctl,  "dev:e0",  SCTL,     NULL);
-AMBA_DEVICE(wdog,  "dev:e1",  WATCHDOG, NULL);
-AMBA_DEVICE(gpio0, "dev:e4",  GPIO0,    NULL);
+AMBA_DEVICE(wdog,  "dev:e1",  EB_WATCHDOG, NULL);
+AMBA_DEVICE(gpio0, "dev:e4",  EB_GPIO0, NULL);
 AMBA_DEVICE(gpio1, "dev:e5",  GPIO1,    NULL);
 AMBA_DEVICE(gpio2, "dev:e6",  GPIO2,    NULL);
-AMBA_DEVICE(rtc,   "dev:e8",  RTC,      NULL);
+AMBA_DEVICE(rtc,   "dev:e8",  EB_RTC,   NULL);
 AMBA_DEVICE(sci0,  "dev:f0",  SCI,      NULL);
-AMBA_DEVICE(uart0, "dev:f1",  UART0,    NULL);
-AMBA_DEVICE(uart1, "dev:f2",  UART1,    NULL);
-AMBA_DEVICE(uart2, "dev:f3",  UART2,    NULL);
-AMBA_DEVICE(ssp0,  "dev:f4",  SSP,      NULL);
+AMBA_DEVICE(uart0, "dev:f1",  EB_UART0, NULL);
+AMBA_DEVICE(uart1, "dev:f2",  EB_UART1, NULL);
+AMBA_DEVICE(uart2, "dev:f3",  EB_UART2, NULL);
+AMBA_DEVICE(ssp0,  "dev:f4",  EB_SSP,   NULL);
 
 static struct amba_device *amba_devs[] __initdata = {
        &dmac_device,
@@ -223,11 +223,16 @@ static struct amba_device *amba_devs[] __initdata = {
 /*
  * RealView EB platform devices
  */
+static struct resource realview_eb_flash_resource = {
+       .start                  = REALVIEW_EB_FLASH_BASE,
+       .end                    = REALVIEW_EB_FLASH_BASE + REALVIEW_EB_FLASH_SIZE - 1,
+       .flags                  = IORESOURCE_MEM,
+};
 
-static struct resource realview_eb_smc91x_resources[] = {
+static struct resource realview_eb_eth_resources[] = {
        [0] = {
-               .start          = REALVIEW_ETH_BASE,
-               .end            = REALVIEW_ETH_BASE + SZ_64K - 1,
+               .start          = REALVIEW_EB_ETH_BASE,
+               .end            = REALVIEW_EB_ETH_BASE + SZ_64K - 1,
                .flags          = IORESOURCE_MEM,
        },
        [1] = {
@@ -237,13 +242,36 @@ static struct resource realview_eb_smc91x_resources[] = {
        },
 };
 
-static struct platform_device realview_eb_smc91x_device = {
-       .name           = "smc91x",
+static struct platform_device realview_eb_eth_device = {
        .id             = 0,
-       .num_resources  = ARRAY_SIZE(realview_eb_smc91x_resources),
-       .resource       = realview_eb_smc91x_resources,
+       .num_resources  = ARRAY_SIZE(realview_eb_eth_resources),
+       .resource       = realview_eb_eth_resources,
 };
 
+/*
+ * Detect and register the correct Ethernet device. RealView/EB rev D
+ * platforms use the newer SMSC LAN9118 Ethernet chip
+ */
+static int eth_device_register(void)
+{
+       void __iomem *eth_addr = ioremap(REALVIEW_EB_ETH_BASE, SZ_4K);
+       u32 idrev;
+
+       if (!eth_addr)
+               return -ENOMEM;
+
+       idrev = readl(eth_addr + 0x50);
+       if ((idrev & 0xFFFF0000) == 0x01180000)
+               /* SMSC LAN9118 chip present */
+               realview_eb_eth_device.name = "smc911x";
+       else
+               /* SMSC 91C111 chip present */
+               realview_eb_eth_device.name = "smc91x";
+
+       iounmap(eth_addr);
+       return platform_device_register(&realview_eb_eth_device);
+}
+
 static void __init gic_init_irq(void)
 {
        if (core_tile_eb11mp()) {
@@ -263,14 +291,14 @@ static void __init gic_init_irq(void)
 
 #ifndef CONFIG_REALVIEW_EB_ARM11MP_REVB
                /* board GIC, secondary */
-               gic_dist_init(1, __io_address(REALVIEW_GIC_DIST_BASE), 64);
-               gic_cpu_init(1, __io_address(REALVIEW_GIC_CPU_BASE));
+               gic_dist_init(1, __io_address(REALVIEW_EB_GIC_DIST_BASE), 64);
+               gic_cpu_init(1, __io_address(REALVIEW_EB_GIC_CPU_BASE));
                gic_cascade_irq(1, IRQ_EB11MP_EB_IRQ1);
 #endif
        } else {
                /* board GIC, primary */
-               gic_cpu_base_addr = __io_address(REALVIEW_GIC_CPU_BASE);
-               gic_dist_init(0, __io_address(REALVIEW_GIC_DIST_BASE), 29);
+               gic_cpu_base_addr = __io_address(REALVIEW_EB_GIC_CPU_BASE);
+               gic_dist_init(0, __io_address(REALVIEW_EB_GIC_DIST_BASE), 29);
                gic_cpu_init(0, gic_cpu_base_addr);
        }
 }
@@ -301,14 +329,19 @@ static void realview_eb11mp_fixup(void)
        kmi1_device.irq[0]      = IRQ_EB11MP_KMI1;
 
        /* platform devices */
-       realview_eb_smc91x_resources[1].start   = IRQ_EB11MP_ETH;
-       realview_eb_smc91x_resources[1].end     = IRQ_EB11MP_ETH;
+       realview_eb_eth_resources[1].start      = IRQ_EB11MP_ETH;
+       realview_eb_eth_resources[1].end        = IRQ_EB11MP_ETH;
 }
 
 static void __init realview_eb_timer_init(void)
 {
        unsigned int timer_irq;
 
+       timer0_va_base = __io_address(REALVIEW_EB_TIMER0_1_BASE);
+       timer1_va_base = __io_address(REALVIEW_EB_TIMER0_1_BASE) + 0x20;
+       timer2_va_base = __io_address(REALVIEW_EB_TIMER2_3_BASE);
+       timer3_va_base = __io_address(REALVIEW_EB_TIMER2_3_BASE) + 0x20;
+
        if (core_tile_eb11mp()) {
 #ifdef CONFIG_LOCAL_TIMERS
                twd_base_addr = __io_address(REALVIEW_EB11MP_TWD_BASE);
@@ -332,16 +365,18 @@ static void __init realview_eb_init(void)
        if (core_tile_eb11mp()) {
                realview_eb11mp_fixup();
 
+#ifdef CONFIG_CACHE_L2X0
                /* 1MB (128KB/way), 8-way associativity, evmon/parity/share enabled
                 * Bits:  .... ...0 0111 1001 0000 .... .... .... */
                l2x0_init(__io_address(REALVIEW_EB11MP_L220_BASE), 0x00790000, 0xfe000fff);
+#endif
        }
 
        clk_register(&realview_clcd_clk);
 
-       platform_device_register(&realview_flash_device);
-       platform_device_register(&realview_eb_smc91x_device);
+       realview_flash_register(&realview_eb_flash_resource, 1);
        platform_device_register(&realview_i2c_device);
+       eth_device_register();
 
        for (i = 0; i < ARRAY_SIZE(amba_devs); i++) {
                struct amba_device *d = amba_devs[i];
@@ -355,8 +390,8 @@ static void __init realview_eb_init(void)
 
 MACHINE_START(REALVIEW_EB, "ARM-RealView EB")
        /* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */
-       .phys_io        = REALVIEW_UART0_BASE,
-       .io_pg_offst    = (IO_ADDRESS(REALVIEW_UART0_BASE) >> 18) & 0xfffc,
+       .phys_io        = REALVIEW_EB_UART0_BASE,
+       .io_pg_offst    = (IO_ADDRESS(REALVIEW_EB_UART0_BASE) >> 18) & 0xfffc,
        .boot_params    = 0x00000100,
        .map_io         = realview_eb_map_io,
        .init_irq       = gic_init_irq,
diff --git a/arch/arm/mach-realview/realview_pb1176.c b/arch/arm/mach-realview/realview_pb1176.c
new file mode 100644 (file)
index 0000000..cf7f576
--- /dev/null
@@ -0,0 +1,292 @@
+/*
+ *  linux/arch/arm/mach-realview/realview_pb1176.c
+ *
+ *  Copyright (C) 2008 ARM Limited
+ *  Copyright (C) 2000 Deep Blue Solutions Ltd
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#include <linux/init.h>
+#include <linux/platform_device.h>
+#include <linux/sysdev.h>
+#include <linux/amba/bus.h>
+
+#include <asm/hardware.h>
+#include <asm/io.h>
+#include <asm/irq.h>
+#include <asm/leds.h>
+#include <asm/mach-types.h>
+#include <asm/hardware/gic.h>
+#include <asm/hardware/icst307.h>
+#include <asm/hardware/cache-l2x0.h>
+
+#include <asm/mach/arch.h>
+#include <asm/mach/flash.h>
+#include <asm/mach/map.h>
+#include <asm/mach/mmc.h>
+#include <asm/mach/time.h>
+
+#include <asm/arch/board-pb1176.h>
+#include <asm/arch/irqs.h>
+
+#include "core.h"
+#include "clock.h"
+
+static struct map_desc realview_pb1176_io_desc[] __initdata = {
+       {
+               .virtual        = IO_ADDRESS(REALVIEW_SYS_BASE),
+               .pfn            = __phys_to_pfn(REALVIEW_SYS_BASE),
+               .length         = SZ_4K,
+               .type           = MT_DEVICE,
+       }, {
+               .virtual        = IO_ADDRESS(REALVIEW_PB1176_GIC_CPU_BASE),
+               .pfn            = __phys_to_pfn(REALVIEW_PB1176_GIC_CPU_BASE),
+               .length         = SZ_4K,
+               .type           = MT_DEVICE,
+       }, {
+               .virtual        = IO_ADDRESS(REALVIEW_PB1176_GIC_DIST_BASE),
+               .pfn            = __phys_to_pfn(REALVIEW_PB1176_GIC_DIST_BASE),
+               .length         = SZ_4K,
+               .type           = MT_DEVICE,
+       }, {
+               .virtual        = IO_ADDRESS(REALVIEW_DC1176_GIC_CPU_BASE),
+               .pfn            = __phys_to_pfn(REALVIEW_DC1176_GIC_CPU_BASE),
+               .length         = SZ_4K,
+               .type           = MT_DEVICE,
+       }, {
+               .virtual        = IO_ADDRESS(REALVIEW_DC1176_GIC_DIST_BASE),
+               .pfn            = __phys_to_pfn(REALVIEW_DC1176_GIC_DIST_BASE),
+               .length         = SZ_4K,
+               .type           = MT_DEVICE,
+       }, {
+               .virtual        = IO_ADDRESS(REALVIEW_SCTL_BASE),
+               .pfn            = __phys_to_pfn(REALVIEW_SCTL_BASE),
+               .length         = SZ_4K,
+               .type           = MT_DEVICE,
+       }, {
+               .virtual        = IO_ADDRESS(REALVIEW_PB1176_TIMER0_1_BASE),
+               .pfn            = __phys_to_pfn(REALVIEW_PB1176_TIMER0_1_BASE),
+               .length         = SZ_4K,
+               .type           = MT_DEVICE,
+       }, {
+               .virtual        = IO_ADDRESS(REALVIEW_PB1176_TIMER2_3_BASE),
+               .pfn            = __phys_to_pfn(REALVIEW_PB1176_TIMER2_3_BASE),
+               .length         = SZ_4K,
+               .type           = MT_DEVICE,
+       }, {
+               .virtual        = IO_ADDRESS(REALVIEW_PB1176_L220_BASE),
+               .pfn            = __phys_to_pfn(REALVIEW_PB1176_L220_BASE),
+               .length         = SZ_8K,
+               .type           = MT_DEVICE,
+       },
+#ifdef CONFIG_DEBUG_LL
+       {
+               .virtual        = IO_ADDRESS(REALVIEW_PB1176_UART0_BASE),
+               .pfn            = __phys_to_pfn(REALVIEW_PB1176_UART0_BASE),
+               .length         = SZ_4K,
+               .type           = MT_DEVICE,
+       },
+#endif
+};
+
+static void __init realview_pb1176_map_io(void)
+{
+       iotable_init(realview_pb1176_io_desc, ARRAY_SIZE(realview_pb1176_io_desc));
+}
+
+/*
+ * RealView PB1176 AMBA devices
+ */
+#define GPIO2_IRQ      { IRQ_PB1176_GPIO2, NO_IRQ }
+#define GPIO2_DMA      { 0, 0 }
+#define GPIO3_IRQ      { IRQ_PB1176_GPIO3, NO_IRQ }
+#define GPIO3_DMA      { 0, 0 }
+#define AACI_IRQ       { IRQ_PB1176_AACI, NO_IRQ }
+#define AACI_DMA       { 0x80, 0x81 }
+#define MMCI0_IRQ      { IRQ_PB1176_MMCI0A, IRQ_PB1176_MMCI0B }
+#define MMCI0_DMA      { 0x84, 0 }
+#define KMI0_IRQ       { IRQ_PB1176_KMI0, NO_IRQ }
+#define KMI0_DMA       { 0, 0 }
+#define KMI1_IRQ       { IRQ_PB1176_KMI1, NO_IRQ }
+#define KMI1_DMA       { 0, 0 }
+#define PB1176_SMC_IRQ { NO_IRQ, NO_IRQ }
+#define PB1176_SMC_DMA { 0, 0 }
+#define MPMC_IRQ       { NO_IRQ, NO_IRQ }
+#define MPMC_DMA       { 0, 0 }
+#define PB1176_CLCD_IRQ        { IRQ_DC1176_CLCD, NO_IRQ }
+#define PB1176_CLCD_DMA        { 0, 0 }
+#define DMAC_IRQ       { IRQ_PB1176_DMAC, NO_IRQ }
+#define DMAC_DMA       { 0, 0 }
+#define SCTL_IRQ       { NO_IRQ, NO_IRQ }
+#define SCTL_DMA       { 0, 0 }
+#define PB1176_WATCHDOG_IRQ    { IRQ_DC1176_WATCHDOG, NO_IRQ }
+#define PB1176_WATCHDOG_DMA    { 0, 0 }
+#define PB1176_GPIO0_IRQ       { IRQ_PB1176_GPIO0, NO_IRQ }
+#define PB1176_GPIO0_DMA       { 0, 0 }
+#define GPIO1_IRQ      { IRQ_PB1176_GPIO1, NO_IRQ }
+#define GPIO1_DMA      { 0, 0 }
+#define PB1176_RTC_IRQ { IRQ_DC1176_RTC, NO_IRQ }
+#define PB1176_RTC_DMA { 0, 0 }
+#define SCI_IRQ                { IRQ_PB1176_SCI, NO_IRQ }
+#define SCI_DMA                { 7, 6 }
+#define PB1176_UART0_IRQ       { IRQ_DC1176_UART0, NO_IRQ }
+#define PB1176_UART0_DMA       { 15, 14 }
+#define PB1176_UART1_IRQ       { IRQ_DC1176_UART1, NO_IRQ }
+#define PB1176_UART1_DMA       { 13, 12 }
+#define PB1176_UART2_IRQ       { IRQ_DC1176_UART2, NO_IRQ }
+#define PB1176_UART2_DMA       { 11, 10 }
+#define PB1176_UART3_IRQ       { IRQ_DC1176_UART3, NO_IRQ }
+#define PB1176_UART3_DMA       { 0x86, 0x87 }
+#define PB1176_SSP_IRQ         { IRQ_PB1176_SSP, NO_IRQ }
+#define PB1176_SSP_DMA         { 9, 8 }
+
+/* FPGA Primecells */
+AMBA_DEVICE(aaci,      "fpga:04",      AACI,           NULL);
+AMBA_DEVICE(mmc0,      "fpga:05",      MMCI0,          &realview_mmc0_plat_data);
+AMBA_DEVICE(kmi0,      "fpga:06",      KMI0,           NULL);
+AMBA_DEVICE(kmi1,      "fpga:07",      KMI1,           NULL);
+AMBA_DEVICE(uart3,     "fpga:09",      PB1176_UART3,   NULL);
+
+/* DevChip Primecells */
+AMBA_DEVICE(smc,       "dev:00",       PB1176_SMC,     NULL);
+AMBA_DEVICE(sctl,      "dev:e0",       SCTL,           NULL);
+AMBA_DEVICE(wdog,      "dev:e1",       PB1176_WATCHDOG,        NULL);
+AMBA_DEVICE(gpio0,     "dev:e4",       PB1176_GPIO0,   NULL);
+AMBA_DEVICE(gpio1,     "dev:e5",       GPIO1,          NULL);
+AMBA_DEVICE(gpio2,     "dev:e6",       GPIO2,          NULL);
+AMBA_DEVICE(rtc,       "dev:e8",       PB1176_RTC,     NULL);
+AMBA_DEVICE(sci0,      "dev:f0",       SCI,            NULL);
+AMBA_DEVICE(uart0,     "dev:f1",       PB1176_UART0,   NULL);
+AMBA_DEVICE(uart1,     "dev:f2",       PB1176_UART1,   NULL);
+AMBA_DEVICE(uart2,     "dev:f3",       PB1176_UART2,   NULL);
+AMBA_DEVICE(ssp0,      "dev:f4",       PB1176_SSP,     NULL);
+
+/* Primecells on the NEC ISSP chip */
+AMBA_DEVICE(clcd,      "issp:20",      PB1176_CLCD,    &clcd_plat_data);
+//AMBA_DEVICE(dmac,    "issp:30",      PB1176_DMAC,    NULL);
+
+static struct amba_device *amba_devs[] __initdata = {
+//     &dmac_device,
+       &uart0_device,
+       &uart1_device,
+       &uart2_device,
+       &uart3_device,
+       &smc_device,
+       &clcd_device,
+       &sctl_device,
+       &wdog_device,
+       &gpio0_device,
+       &gpio1_device,
+       &gpio2_device,
+       &rtc_device,
+       &sci0_device,
+       &ssp0_device,
+       &aaci_device,
+       &mmc0_device,
+       &kmi0_device,
+       &kmi1_device,
+};
+
+/*
+ * RealView PB1176 platform devices
+ */
+static struct resource realview_pb1176_flash_resource = {
+       .start                  = REALVIEW_PB1176_FLASH_BASE,
+       .end                    = REALVIEW_PB1176_FLASH_BASE + REALVIEW_PB1176_FLASH_SIZE - 1,
+       .flags                  = IORESOURCE_MEM,
+};
+
+static struct resource realview_pb1176_smsc911x_resources[] = {
+       [0] = {
+               .start          = REALVIEW_PB1176_ETH_BASE,
+               .end            = REALVIEW_PB1176_ETH_BASE + SZ_64K - 1,
+               .flags          = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start          = IRQ_PB1176_ETH,
+               .end            = IRQ_PB1176_ETH,
+               .flags          = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device realview_pb1176_smsc911x_device = {
+       .name           = "smc911x",
+       .id             = 0,
+       .num_resources  = ARRAY_SIZE(realview_pb1176_smsc911x_resources),
+       .resource       = realview_pb1176_smsc911x_resources,
+};
+
+static void __init gic_init_irq(void)
+{
+       /* ARM1176 DevChip GIC, primary */
+       gic_cpu_base_addr = __io_address(REALVIEW_DC1176_GIC_CPU_BASE);
+       gic_dist_init(0, __io_address(REALVIEW_DC1176_GIC_DIST_BASE), IRQ_DC1176_GIC_START);
+       gic_cpu_init(0, gic_cpu_base_addr);
+
+       /* board GIC, secondary */
+       gic_dist_init(1, __io_address(REALVIEW_PB1176_GIC_DIST_BASE), IRQ_PB1176_GIC_START);
+       gic_cpu_init(1, __io_address(REALVIEW_PB1176_GIC_CPU_BASE));
+       gic_cascade_irq(1, IRQ_DC1176_PB_IRQ1);
+}
+
+static void __init realview_pb1176_timer_init(void)
+{
+       timer0_va_base = __io_address(REALVIEW_PB1176_TIMER0_1_BASE);
+       timer1_va_base = __io_address(REALVIEW_PB1176_TIMER0_1_BASE) + 0x20;
+       timer2_va_base = __io_address(REALVIEW_PB1176_TIMER2_3_BASE);
+       timer3_va_base = __io_address(REALVIEW_PB1176_TIMER2_3_BASE) + 0x20;
+
+       realview_timer_init(IRQ_DC1176_TIMER0);
+}
+
+static struct sys_timer realview_pb1176_timer = {
+       .init           = realview_pb1176_timer_init,
+};
+
+static void __init realview_pb1176_init(void)
+{
+       int i;
+
+#ifdef CONFIG_CACHE_L2X0
+       /* 128Kb (16Kb/way) 8-way associativity. evmon/parity/share enabled. */
+       l2x0_init(__io_address(REALVIEW_PB1176_L220_BASE), 0x00730000, 0xfe000fff);
+#endif
+
+       clk_register(&realview_clcd_clk);
+
+       realview_flash_register(&realview_pb1176_flash_resource, 1);
+       platform_device_register(&realview_pb1176_smsc911x_device);
+
+       for (i = 0; i < ARRAY_SIZE(amba_devs); i++) {
+               struct amba_device *d = amba_devs[i];
+               amba_device_register(d, &iomem_resource);
+       }
+
+#ifdef CONFIG_LEDS
+       leds_event = realview_leds_event;
+#endif
+}
+
+MACHINE_START(REALVIEW_PB1176, "ARM-RealView PB1176")
+       /* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */
+       .phys_io        = REALVIEW_PB1176_UART0_BASE,
+       .io_pg_offst    = (IO_ADDRESS(REALVIEW_PB1176_UART0_BASE) >> 18) & 0xfffc,
+       .boot_params    = 0x00000100,
+       .map_io         = realview_pb1176_map_io,
+       .init_irq       = gic_init_irq,
+       .timer          = &realview_pb1176_timer,
+       .init_machine   = realview_pb1176_init,
+MACHINE_END
diff --git a/arch/arm/mach-realview/realview_pb11mp.c b/arch/arm/mach-realview/realview_pb11mp.c
new file mode 100644 (file)
index 0000000..f7ce1c5
--- /dev/null
@@ -0,0 +1,342 @@
+/*
+ *  linux/arch/arm/mach-realview/realview_pb11mp.c
+ *
+ *  Copyright (C) 2008 ARM Limited
+ *  Copyright (C) 2000 Deep Blue Solutions Ltd
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#include <linux/init.h>
+#include <linux/platform_device.h>
+#include <linux/sysdev.h>
+#include <linux/amba/bus.h>
+
+#include <asm/hardware.h>
+#include <asm/io.h>
+#include <asm/irq.h>
+#include <asm/leds.h>
+#include <asm/mach-types.h>
+#include <asm/hardware/gic.h>
+#include <asm/hardware/icst307.h>
+#include <asm/hardware/cache-l2x0.h>
+
+#include <asm/mach/arch.h>
+#include <asm/mach/flash.h>
+#include <asm/mach/map.h>
+#include <asm/mach/mmc.h>
+#include <asm/mach/time.h>
+
+#include <asm/arch/board-pb11mp.h>
+#include <asm/arch/irqs.h>
+
+#include "core.h"
+#include "clock.h"
+
+static struct map_desc realview_pb11mp_io_desc[] __initdata = {
+       {
+               .virtual        = IO_ADDRESS(REALVIEW_SYS_BASE),
+               .pfn            = __phys_to_pfn(REALVIEW_SYS_BASE),
+               .length         = SZ_4K,
+               .type           = MT_DEVICE,
+       }, {
+               .virtual        = IO_ADDRESS(REALVIEW_PB11MP_GIC_CPU_BASE),
+               .pfn            = __phys_to_pfn(REALVIEW_PB11MP_GIC_CPU_BASE),
+               .length         = SZ_4K,
+               .type           = MT_DEVICE,
+       }, {
+               .virtual        = IO_ADDRESS(REALVIEW_PB11MP_GIC_DIST_BASE),
+               .pfn            = __phys_to_pfn(REALVIEW_PB11MP_GIC_DIST_BASE),
+               .length         = SZ_4K,
+               .type           = MT_DEVICE,
+       }, {
+               .virtual        = IO_ADDRESS(REALVIEW_TC11MP_GIC_CPU_BASE),
+               .pfn            = __phys_to_pfn(REALVIEW_TC11MP_GIC_CPU_BASE),
+               .length         = SZ_4K,
+               .type           = MT_DEVICE,
+       }, {
+               .virtual        = IO_ADDRESS(REALVIEW_TC11MP_GIC_DIST_BASE),
+               .pfn            = __phys_to_pfn(REALVIEW_TC11MP_GIC_DIST_BASE),
+               .length         = SZ_4K,
+               .type           = MT_DEVICE,
+       }, {
+               .virtual        = IO_ADDRESS(REALVIEW_SCTL_BASE),
+               .pfn            = __phys_to_pfn(REALVIEW_SCTL_BASE),
+               .length         = SZ_4K,
+               .type           = MT_DEVICE,
+       }, {
+               .virtual        = IO_ADDRESS(REALVIEW_PB11MP_TIMER0_1_BASE),
+               .pfn            = __phys_to_pfn(REALVIEW_PB11MP_TIMER0_1_BASE),
+               .length         = SZ_4K,
+               .type           = MT_DEVICE,
+       }, {
+               .virtual        = IO_ADDRESS(REALVIEW_PB11MP_TIMER2_3_BASE),
+               .pfn            = __phys_to_pfn(REALVIEW_PB11MP_TIMER2_3_BASE),
+               .length         = SZ_4K,
+               .type           = MT_DEVICE,
+       }, {
+               .virtual        = IO_ADDRESS(REALVIEW_TC11MP_L220_BASE),
+               .pfn            = __phys_to_pfn(REALVIEW_TC11MP_L220_BASE),
+               .length         = SZ_8K,
+               .type           = MT_DEVICE,
+       },
+#ifdef CONFIG_DEBUG_LL
+       {
+               .virtual        = IO_ADDRESS(REALVIEW_PB11MP_UART0_BASE),
+               .pfn            = __phys_to_pfn(REALVIEW_PB11MP_UART0_BASE),
+               .length         = SZ_4K,
+               .type           = MT_DEVICE,
+       },
+#endif
+};
+
+static void __init realview_pb11mp_map_io(void)
+{
+       iotable_init(realview_pb11mp_io_desc, ARRAY_SIZE(realview_pb11mp_io_desc));
+}
+
+/*
+ * RealView PB11MPCore AMBA devices
+ */
+
+#define GPIO2_IRQ              { IRQ_PB11MP_GPIO2, NO_IRQ }
+#define GPIO2_DMA              { 0, 0 }
+#define GPIO3_IRQ              { IRQ_PB11MP_GPIO3, NO_IRQ }
+#define GPIO3_DMA              { 0, 0 }
+#define AACI_IRQ               { IRQ_TC11MP_AACI, NO_IRQ }
+#define AACI_DMA               { 0x80, 0x81 }
+#define MMCI0_IRQ              { IRQ_TC11MP_MMCI0A, IRQ_TC11MP_MMCI0B }
+#define MMCI0_DMA              { 0x84, 0 }
+#define KMI0_IRQ               { IRQ_TC11MP_KMI0, NO_IRQ }
+#define KMI0_DMA               { 0, 0 }
+#define KMI1_IRQ               { IRQ_TC11MP_KMI1, NO_IRQ }
+#define KMI1_DMA               { 0, 0 }
+#define PB11MP_SMC_IRQ         { NO_IRQ, NO_IRQ }
+#define PB11MP_SMC_DMA         { 0, 0 }
+#define MPMC_IRQ               { NO_IRQ, NO_IRQ }
+#define MPMC_DMA               { 0, 0 }
+#define PB11MP_CLCD_IRQ                { IRQ_PB11MP_CLCD, NO_IRQ }
+#define PB11MP_CLCD_DMA                { 0, 0 }
+#define DMAC_IRQ               { IRQ_PB11MP_DMAC, NO_IRQ }
+#define DMAC_DMA               { 0, 0 }
+#define SCTL_IRQ               { NO_IRQ, NO_IRQ }
+#define SCTL_DMA               { 0, 0 }
+#define PB11MP_WATCHDOG_IRQ    { IRQ_PB11MP_WATCHDOG, NO_IRQ }
+#define PB11MP_WATCHDOG_DMA    { 0, 0 }
+#define PB11MP_GPIO0_IRQ       { IRQ_PB11MP_GPIO0, NO_IRQ }
+#define PB11MP_GPIO0_DMA       { 0, 0 }
+#define GPIO1_IRQ              { IRQ_PB11MP_GPIO1, NO_IRQ }
+#define GPIO1_DMA              { 0, 0 }
+#define PB11MP_RTC_IRQ         { IRQ_TC11MP_RTC, NO_IRQ }
+#define PB11MP_RTC_DMA         { 0, 0 }
+#define SCI_IRQ                        { IRQ_PB11MP_SCI, NO_IRQ }
+#define SCI_DMA                        { 7, 6 }
+#define PB11MP_UART0_IRQ       { IRQ_TC11MP_UART0, NO_IRQ }
+#define PB11MP_UART0_DMA       { 15, 14 }
+#define PB11MP_UART1_IRQ       { IRQ_TC11MP_UART1, NO_IRQ }
+#define PB11MP_UART1_DMA       { 13, 12 }
+#define PB11MP_UART2_IRQ       { IRQ_PB11MP_UART2, NO_IRQ }
+#define PB11MP_UART2_DMA       { 11, 10 }
+#define PB11MP_UART3_IRQ       { IRQ_PB11MP_UART3, NO_IRQ }
+#define PB11MP_UART3_DMA       { 0x86, 0x87 }
+#define PB11MP_SSP_IRQ         { IRQ_PB11MP_SSP, NO_IRQ }
+#define PB11MP_SSP_DMA         { 9, 8 }
+
+/* FPGA Primecells */
+AMBA_DEVICE(aaci,      "fpga:04",      AACI,           NULL);
+AMBA_DEVICE(mmc0,      "fpga:05",      MMCI0,          &realview_mmc0_plat_data);
+AMBA_DEVICE(kmi0,      "fpga:06",      KMI0,           NULL);
+AMBA_DEVICE(kmi1,      "fpga:07",      KMI1,           NULL);
+AMBA_DEVICE(uart3,     "fpga:09",      PB11MP_UART3,   NULL);
+
+/* DevChip Primecells */
+AMBA_DEVICE(smc,       "dev:00",       PB11MP_SMC,     NULL);
+AMBA_DEVICE(sctl,      "dev:e0",       SCTL,           NULL);
+AMBA_DEVICE(wdog,      "dev:e1",       PB11MP_WATCHDOG, NULL);
+AMBA_DEVICE(gpio0,     "dev:e4",       PB11MP_GPIO0,   NULL);
+AMBA_DEVICE(gpio1,     "dev:e5",       GPIO1,          NULL);
+AMBA_DEVICE(gpio2,     "dev:e6",       GPIO2,          NULL);
+AMBA_DEVICE(rtc,       "dev:e8",       PB11MP_RTC,     NULL);
+AMBA_DEVICE(sci0,      "dev:f0",       SCI,            NULL);
+AMBA_DEVICE(uart0,     "dev:f1",       PB11MP_UART0,   NULL);
+AMBA_DEVICE(uart1,     "dev:f2",       PB11MP_UART1,   NULL);
+AMBA_DEVICE(uart2,     "dev:f3",       PB11MP_UART2,   NULL);
+AMBA_DEVICE(ssp0,      "dev:f4",       PB11MP_SSP,     NULL);
+
+/* Primecells on the NEC ISSP chip */
+AMBA_DEVICE(clcd,      "issp:20",      PB11MP_CLCD,    &clcd_plat_data);
+AMBA_DEVICE(dmac,      "issp:30",      DMAC,           NULL);
+
+static struct amba_device *amba_devs[] __initdata = {
+       &dmac_device,
+       &uart0_device,
+       &uart1_device,
+       &uart2_device,
+       &uart3_device,
+       &smc_device,
+       &clcd_device,
+       &sctl_device,
+       &wdog_device,
+       &gpio0_device,
+       &gpio1_device,
+       &gpio2_device,
+       &rtc_device,
+       &sci0_device,
+       &ssp0_device,
+       &aaci_device,
+       &mmc0_device,
+       &kmi0_device,
+       &kmi1_device,
+};
+
+/*
+ * RealView PB11MPCore platform devices
+ */
+static struct resource realview_pb11mp_flash_resource[] = {
+       [0] = {
+               .start          = REALVIEW_PB11MP_FLASH0_BASE,
+               .end            = REALVIEW_PB11MP_FLASH0_BASE + REALVIEW_PB11MP_FLASH0_SIZE - 1,
+               .flags          = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start          = REALVIEW_PB11MP_FLASH1_BASE,
+               .end            = REALVIEW_PB11MP_FLASH1_BASE + REALVIEW_PB11MP_FLASH1_SIZE - 1,
+               .flags          = IORESOURCE_MEM,
+       },
+};
+
+static struct resource realview_pb11mp_smsc911x_resources[] = {
+       [0] = {
+               .start          = REALVIEW_PB11MP_ETH_BASE,
+               .end            = REALVIEW_PB11MP_ETH_BASE + SZ_64K - 1,
+               .flags          = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start          = IRQ_TC11MP_ETH,
+               .end            = IRQ_TC11MP_ETH,
+               .flags          = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device realview_pb11mp_smsc911x_device = {
+       .name           = "smc911x",
+       .id             = 0,
+       .num_resources  = ARRAY_SIZE(realview_pb11mp_smsc911x_resources),
+       .resource       = realview_pb11mp_smsc911x_resources,
+};
+
+struct resource realview_pb11mp_cf_resources[] = {
+       [0] = {
+               .start          = REALVIEW_PB11MP_CF_BASE,
+               .end            = REALVIEW_PB11MP_CF_BASE + SZ_4K - 1,
+               .flags          = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start          = REALVIEW_PB11MP_CF_MEM_BASE,
+               .end            = REALVIEW_PB11MP_CF_MEM_BASE + SZ_4K - 1,
+               .flags          = IORESOURCE_MEM,
+       },
+       [2] = {
+               .start          = -1,           /* FIXME: Find correct irq */
+               .end            = -1,
+               .flags          = IORESOURCE_IRQ,
+       },
+};
+
+struct platform_device realview_pb11mp_cf_device = {
+       .name           = "compactflash",
+       .id             = 0,
+       .num_resources  = ARRAY_SIZE(realview_pb11mp_cf_resources),
+       .resource       = realview_pb11mp_cf_resources,
+};
+
+static void __init gic_init_irq(void)
+{
+       unsigned int pldctrl;
+
+       /* new irq mode with no DCC */
+       writel(0x0000a05f, __io_address(REALVIEW_SYS_LOCK));
+       pldctrl = readl(__io_address(REALVIEW_SYS_BASE) + REALVIEW_PB11MP_SYS_PLD_CTRL1);
+       pldctrl |= 2 << 22;
+       writel(pldctrl, __io_address(REALVIEW_SYS_BASE) + REALVIEW_PB11MP_SYS_PLD_CTRL1);
+       writel(0x00000000, __io_address(REALVIEW_SYS_LOCK));
+
+       /* ARM11MPCore test chip GIC, primary */
+       gic_cpu_base_addr = __io_address(REALVIEW_TC11MP_GIC_CPU_BASE);
+       gic_dist_init(0, __io_address(REALVIEW_TC11MP_GIC_DIST_BASE), 29);
+       gic_cpu_init(0, gic_cpu_base_addr);
+
+       /* board GIC, secondary */
+       gic_dist_init(1, __io_address(REALVIEW_PB11MP_GIC_DIST_BASE), IRQ_PB11MP_GIC_START);
+       gic_cpu_init(1, __io_address(REALVIEW_PB11MP_GIC_CPU_BASE));
+       gic_cascade_irq(1, IRQ_TC11MP_PB_IRQ1);
+}
+
+static void __init realview_pb11mp_timer_init(void)
+{
+       timer0_va_base = __io_address(REALVIEW_PB11MP_TIMER0_1_BASE);
+       timer1_va_base = __io_address(REALVIEW_PB11MP_TIMER0_1_BASE) + 0x20;
+       timer2_va_base = __io_address(REALVIEW_PB11MP_TIMER2_3_BASE);
+       timer3_va_base = __io_address(REALVIEW_PB11MP_TIMER2_3_BASE) + 0x20;
+
+#ifdef CONFIG_LOCAL_TIMERS
+       twd_base_addr = __io_address(REALVIEW_TC11MP_TWD_BASE);
+       twd_size = REALVIEW_TC11MP_TWD_SIZE;
+#endif
+       realview_timer_init(IRQ_TC11MP_TIMER0_1);
+}
+
+static struct sys_timer realview_pb11mp_timer = {
+       .init           = realview_pb11mp_timer_init,
+};
+
+static void __init realview_pb11mp_init(void)
+{
+       int i;
+
+#ifdef CONFIG_CACHE_L2X0
+       /* 1MB (128KB/way), 8-way associativity, evmon/parity/share enabled
+        * Bits:  .... ...0 0111 1001 0000 .... .... .... */
+       l2x0_init(__io_address(REALVIEW_TC11MP_L220_BASE), 0x00790000, 0xfe000fff);
+#endif
+
+       clk_register(&realview_clcd_clk);
+
+       realview_flash_register(realview_pb11mp_flash_resource,
+                               ARRAY_SIZE(realview_pb11mp_flash_resource));
+       platform_device_register(&realview_pb11mp_smsc911x_device);
+       platform_device_register(&realview_i2c_device);
+       platform_device_register(&realview_pb11mp_cf_device);
+
+       for (i = 0; i < ARRAY_SIZE(amba_devs); i++) {
+               struct amba_device *d = amba_devs[i];
+               amba_device_register(d, &iomem_resource);
+       }
+
+#ifdef CONFIG_LEDS
+       leds_event = realview_leds_event;
+#endif
+}
+
+MACHINE_START(REALVIEW_PB11MP, "ARM-RealView PB11MPCore")
+       /* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */
+       .phys_io        = REALVIEW_PB11MP_UART0_BASE,
+       .io_pg_offst    = (IO_ADDRESS(REALVIEW_PB11MP_UART0_BASE) >> 18) & 0xfffc,
+       .boot_params    = 0x00000100,
+       .map_io         = realview_pb11mp_map_io,
+       .init_irq       = gic_init_irq,
+       .timer          = &realview_pb11mp_timer,
+       .init_machine   = realview_pb11mp_init,
+MACHINE_END
index e2079cf9266fd44c5f2bff2ab81826585cd65f9b..cd3dc0834b3b85c9c6d47dff19947eab0357f427 100644 (file)
@@ -97,6 +97,13 @@ config BAST_PC104_IRQ
          Say Y here to enable the PC104 IRQ routing on the
          Simtec BAST (EB2410ITX)
 
+config MACH_TCT_HAMMER
+       bool "TCT Hammer Board"
+       select CPU_S3C2410
+       help
+          Say Y here if you are using the TinCanTools Hammer Board
+           <http://www.tincantools.com>
+
 config MACH_VR1000
        bool "Thorcom VR1000"
        select PM_SIMTEC if PM
index 3e7a85594d9cf6221cfb0e735d6f4f75770162c7..cabc13ce09e401f30e6adf5a4989122049ad830c 100644 (file)
@@ -27,5 +27,6 @@ obj-$(CONFIG_ARCH_BAST)               += mach-bast.o usb-simtec.o
 obj-$(CONFIG_MACH_OTOM)                += mach-otom.o
 obj-$(CONFIG_MACH_AML_M5900)   += mach-amlm5900.o
 obj-$(CONFIG_BAST_PC104_IRQ)   += bast-irq.o
+obj-$(CONFIG_MACH_TCT_HAMMER)  += mach-tct_hammer.o
 obj-$(CONFIG_MACH_VR1000)      += mach-vr1000.o usb-simtec.o
 obj-$(CONFIG_MACH_QT2410)      += mach-qt2410.o
index 66175471fff30492ebf45e8a4518b20af5915344..661a2358ac222a9ac10c59a7a9e2cebd08b2aac0 100644 (file)
@@ -16,6 +16,7 @@
 #include <linux/list.h>
 #include <linux/timer.h>
 #include <linux/init.h>
+#include <linux/sysdev.h>
 #include <linux/serial_core.h>
 #include <linux/platform_device.h>
 #include <linux/dm9000.h>
@@ -236,6 +237,36 @@ static struct platform_device bast_device_nor = {
 
 /* NAND Flash on BAST board */
 
+#ifdef CONFIG_PM
+static int bast_pm_suspend(struct sys_device *sd, pm_message_t state)
+{
+       /* ensure that an nRESET is not generated on resume. */
+       s3c2410_gpio_setpin(S3C2410_GPA21, 1);
+       s3c2410_gpio_cfgpin(S3C2410_GPA21, S3C2410_GPA21_OUT);
+
+       return 0;
+}
+
+static int bast_pm_resume(struct sys_device *sd)
+{
+       s3c2410_gpio_cfgpin(S3C2410_GPA21, S3C2410_GPA21_nRSTOUT);
+       return 0;
+}
+
+#else
+#define bast_pm_suspend NULL
+#define bast_pm_resume NULL
+#endif
+
+static struct sysdev_class bast_pm_sysclass = {
+       .name           = "mach-bast",
+       .suspend        = bast_pm_suspend,
+       .resume         = bast_pm_resume,
+};
+
+static struct sys_device bast_pm_sysdev = {
+       .cls            = &bast_pm_sysclass,
+};
 
 static int smartmedia_map[] = { 0 };
 static int chip0_map[] = { 1 };
@@ -561,10 +592,10 @@ static void __init bast_map_io(void)
 {
        /* initialise the clocks */
 
-       s3c24xx_dclk0.parent = NULL;
+       s3c24xx_dclk0.parent = &clk_upll;
        s3c24xx_dclk0.rate   = 12*1000*1000;
 
-       s3c24xx_dclk1.parent = NULL;
+       s3c24xx_dclk1.parent = &clk_upll;
        s3c24xx_dclk1.rate   = 24*1000*1000;
 
        s3c24xx_clkout0.parent  = &s3c24xx_dclk0;
@@ -586,6 +617,9 @@ static void __init bast_map_io(void)
 
 static void __init bast_init(void)
 {
+       sysdev_class_register(&bast_pm_sysclass);
+       sysdev_register(&bast_pm_sysdev);
+
        s3c24xx_fb_set_platdata(&bast_fb_info);
        platform_add_devices(bast_devices, ARRAY_SIZE(bast_devices));
 }
diff --git a/arch/arm/mach-s3c2410/mach-tct_hammer.c b/arch/arm/mach-s3c2410/mach-tct_hammer.c
new file mode 100644 (file)
index 0000000..d90d445
--- /dev/null
@@ -0,0 +1,160 @@
+/* linux/arch/arm/mach-s3c2410/mach-tct_hammer.c
+ *
+ * Copyright (c) 2007 TinCanTools
+ *     David Anders <danders@amltd.com>
+
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ * @History:
+ * derived from linux/arch/arm/mach-s3c2410/mach-bast.c, written by
+ * Ben Dooks <ben@simtec.co.uk>
+ *
+ ***********************************************************************/
+
+#include <linux/kernel.h>
+#include <linux/types.h>
+#include <linux/interrupt.h>
+#include <linux/list.h>
+#include <linux/timer.h>
+#include <linux/init.h>
+#include <linux/device.h>
+#include <linux/platform_device.h>
+#include <linux/serial_core.h>
+
+#include <asm/mach/arch.h>
+#include <asm/mach/map.h>
+#include <asm/mach/irq.h>
+#include <asm/mach/flash.h>
+
+#include <asm/hardware.h>
+#include <asm/io.h>
+#include <asm/irq.h>
+#include <asm/mach-types.h>
+
+#include <asm/plat-s3c/regs-serial.h>
+#include <asm/plat-s3c24xx/devs.h>
+#include <asm/plat-s3c24xx/cpu.h>
+
+#ifdef CONFIG_MTD_PARTITIONS
+
+#include <linux/mtd/mtd.h>
+#include <linux/mtd/partitions.h>
+#include <linux/mtd/map.h>
+#include <linux/mtd/physmap.h>
+
+static struct resource tct_hammer_nor_resource = {
+               .start = 0x00000000,
+               .end   = 0x01000000 - 1,
+               .flags = IORESOURCE_MEM,
+};
+
+static struct mtd_partition tct_hammer_mtd_partitions[] = {
+       {
+               .name           = "System",
+               .size           = 0x240000,
+               .offset         = 0,
+               .mask_flags     = MTD_WRITEABLE,  /* force read-only */
+       }, {
+               .name           = "JFFS2",
+               .size           = MTDPART_SIZ_FULL,
+               .offset         = MTDPART_OFS_APPEND,
+       }
+};
+
+static struct physmap_flash_data tct_hammer_flash_data = {
+       .width          = 2,
+       .parts          = tct_hammer_mtd_partitions,
+       .nr_parts       = ARRAY_SIZE(tct_hammer_mtd_partitions),
+};
+
+static struct platform_device tct_hammer_device_nor = {
+       .name           = "physmap-flash",
+       .id             = 0,
+       .dev = {
+                       .platform_data = &tct_hammer_flash_data,
+               },
+       .num_resources  = 1,
+       .resource       = &tct_hammer_nor_resource,
+};
+
+#endif
+
+static struct map_desc tct_hammer_iodesc[] __initdata = {
+};
+
+#define UCON S3C2410_UCON_DEFAULT
+#define ULCON S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB
+#define UFCON S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE
+
+static struct s3c2410_uartcfg tct_hammer_uartcfgs[] = {
+       [0] = {
+               .hwport      = 0,
+               .flags       = 0,
+               .ucon        = UCON,
+               .ulcon       = ULCON,
+               .ufcon       = UFCON,
+       },
+       [1] = {
+               .hwport      = 1,
+               .flags       = 0,
+               .ucon        = UCON,
+               .ulcon       = ULCON,
+               .ufcon       = UFCON,
+       },
+       [2] = {
+               .hwport      = 2,
+               .flags       = 0,
+               .ucon        = UCON,
+               .ulcon       = ULCON,
+               .ufcon       = UFCON,
+       }
+};
+
+
+static struct platform_device *tct_hammer_devices[] __initdata = {
+       &s3c_device_adc,
+       &s3c_device_wdt,
+       &s3c_device_i2c,
+       &s3c_device_usb,
+       &s3c_device_rtc,
+       &s3c_device_usbgadget,
+       &s3c_device_sdi,
+#ifdef CONFIG_MTD_PARTITIONS
+       &tct_hammer_device_nor,
+#endif
+};
+
+static void __init tct_hammer_map_io(void)
+{
+       s3c24xx_init_io(tct_hammer_iodesc, ARRAY_SIZE(tct_hammer_iodesc));
+       s3c24xx_init_clocks(0);
+       s3c24xx_init_uarts(tct_hammer_uartcfgs, ARRAY_SIZE(tct_hammer_uartcfgs));
+}
+
+static void __init tct_hammer_init(void)
+{
+       platform_add_devices(tct_hammer_devices, ARRAY_SIZE(tct_hammer_devices));
+}
+
+MACHINE_START(TCT_HAMMER, "TCT_HAMMER")
+       .phys_io        = S3C2410_PA_UART,
+       .io_pg_offst    = (((u32)S3C24XX_VA_UART) >> 18) & 0xfffc,
+       .boot_params    = S3C2410_SDRAM_PA + 0x100,
+       .map_io         = tct_hammer_map_io,
+       .init_irq       = s3c24xx_init_irq,
+       .init_machine   = tct_hammer_init,
+       .timer          = &s3c24xx_timer,
+MACHINE_END
index 3aade7b78fe5929a4deddb621f858b424336d8af..c56423373ff311af067e8ad5d37cb7152bf1fdcd 100644 (file)
@@ -393,7 +393,7 @@ static void __init vr1000_map_io(void)
 {
        /* initialise clock sources */
 
-       s3c24xx_dclk0.parent = NULL;
+       s3c24xx_dclk0.parent = &clk_upll;
        s3c24xx_dclk0.rate   = 12*1000*1000;
 
        s3c24xx_dclk1.parent = NULL;
index abf1599c9f97f277b009fd6c64ed6e14629bba46..98a0de924c227e7eb28b2bdaf4aaa01ec3c7e50f 100644 (file)
@@ -175,7 +175,7 @@ void __init s3c2412_init_clocks(int xtal)
        /* work out clock scalings */
 
        hclk = fclk / ((tmp & S3C2412_CLKDIVN_HDIVN_MASK) + 1);
-       hclk /= ((tmp & S3C2421_CLKDIVN_ARMDIVN) ? 2 : 1);
+       hclk /= ((tmp & S3C2412_CLKDIVN_ARMDIVN) ? 2 : 1);
        pclk = hclk / ((tmp & S3C2412_CLKDIVN_PDIVN) ? 2 : 1);
 
        /* print brieft summary of clocks, etc */
index 3d3dfa95db8ef7dcfcd668150e7fb4959638213f..47258915a2f9da5a2208ca5581cc60e8b551a197 100644 (file)
@@ -413,10 +413,10 @@ static void __init anubis_map_io(void)
 {
        /* initialise the clocks */
 
-       s3c24xx_dclk0.parent = NULL;
+       s3c24xx_dclk0.parent = &clk_upll;
        s3c24xx_dclk0.rate   = 12*1000*1000;
 
-       s3c24xx_dclk1.parent = NULL;
+       s3c24xx_dclk1.parent = &clk_upll;
        s3c24xx_dclk1.rate   = 24*1000*1000;
 
        s3c24xx_clkout0.parent  = &s3c24xx_dclk0;
index 78af7664988b98746f1499a79dd142a0fb33b5fd..8a8acdbd072da9854d99aeccae9a7af20dec3eda 100644 (file)
@@ -18,6 +18,7 @@
 #include <linux/device.h>
 #include <linux/sysdev.h>
 #include <linux/serial_core.h>
+#include <linux/clk.h>
 
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
@@ -344,10 +345,10 @@ static void __init osiris_map_io(void)
 
        /* initialise the clocks */
 
-       s3c24xx_dclk0.parent = NULL;
+       s3c24xx_dclk0.parent = &clk_upll;
        s3c24xx_dclk0.rate   = 12*1000*1000;
 
-       s3c24xx_dclk1.parent = NULL;
+       s3c24xx_dclk1.parent = &clk_upll;
        s3c24xx_dclk1.rate   = 24*1000*1000;
 
        s3c24xx_clkout0.parent  = &s3c24xx_dclk0;
index 7a61e8d33ab7527240ec74d6cc50812b72a57c71..8e0244631d651808132aaf57dd8cb50dcd9d1453 100644 (file)
@@ -3,7 +3,7 @@
 #
 
 # Common support
-obj-y := clock.o generic.o irq.o dma.o time.o #nmi-oopser.o
+obj-y := clock.o generic.o gpio.o irq.o dma.o time.o #nmi-oopser.o
 obj-m :=
 obj-n :=
 obj-  :=
index 5c84c604ed86d1fc5b68c89ab802d1713aa2311d..0c2fa1c4fb4c776093a4b1460271017b8677c084 100644 (file)
@@ -139,37 +139,6 @@ unsigned long long sched_clock(void)
        return v;
 }
 
-int gpio_direction_input(unsigned gpio)
-{
-       unsigned long flags;
-
-       if (gpio > GPIO_MAX)
-               return -EINVAL;
-
-       local_irq_save(flags);
-       GPDR &= ~GPIO_GPIO(gpio);
-       local_irq_restore(flags);
-       return 0;
-}
-
-EXPORT_SYMBOL(gpio_direction_input);
-
-int gpio_direction_output(unsigned gpio, int value)
-{
-       unsigned long flags;
-
-       if (gpio > GPIO_MAX)
-               return -EINVAL;
-
-       local_irq_save(flags);
-       gpio_set_value(gpio, value);
-       GPDR |= GPIO_GPIO(gpio);
-       local_irq_restore(flags);
-       return 0;
-}
-
-EXPORT_SYMBOL(gpio_direction_output);
-
 /*
  * Default power-off for SA1100
  */
index f085d68e568e4f049587ba5f741551e0ee2ee516..793c2e6c991fd3e968f9ea54bce4bd77dd64cfb3 100644 (file)
@@ -9,6 +9,7 @@ struct sys_timer;
 extern struct sys_timer sa1100_timer;
 extern void __init sa1100_map_io(void);
 extern void __init sa1100_init_irq(void);
+extern void __init sa1100_init_gpio(void);
 
 #define SET_BANK(__nr,__start,__size) \
        mi->bank[__nr].start = (__start), \
diff --git a/arch/arm/mach-sa1100/gpio.c b/arch/arm/mach-sa1100/gpio.c
new file mode 100644 (file)
index 0000000..372f1f4
--- /dev/null
@@ -0,0 +1,65 @@
+/*
+ * linux/arch/arm/mach-sa1100/gpio.c
+ *
+ * Generic SA-1100 GPIO handling
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <linux/init.h>
+#include <linux/module.h>
+
+#include <asm/gpio.h>
+#include <asm/hardware.h>
+#include "generic.h"
+
+static int sa1100_gpio_get(struct gpio_chip *chip, unsigned offset)
+{
+       return GPLR & GPIO_GPIO(offset);
+}
+
+static void sa1100_gpio_set(struct gpio_chip *chip, unsigned offset, int value)
+{
+       if (value)
+               GPSR = GPIO_GPIO(offset);
+       else
+               GPCR = GPIO_GPIO(offset);
+}
+
+static int sa1100_direction_input(struct gpio_chip *chip, unsigned offset)
+{
+       unsigned long flags;
+
+       local_irq_save(flags);
+       GPDR &= ~GPIO_GPIO(offset);
+       local_irq_restore(flags);
+       return 0;
+}
+
+static int sa1100_direction_output(struct gpio_chip *chip, unsigned offset, int value)
+{
+       unsigned long flags;
+
+       local_irq_save(flags);
+       sa1100_gpio_set(chip, offset, value);
+       GPDR |= GPIO_GPIO(offset);
+       local_irq_restore(flags);
+       return 0;
+}
+
+static struct gpio_chip sa1100_gpio_chip = {
+       .label                  = "gpio",
+       .direction_input        = sa1100_direction_input,
+       .direction_output       = sa1100_direction_output,
+       .set                    = sa1100_gpio_set,
+       .get                    = sa1100_gpio_get,
+       .base                   = 0,
+       .ngpio                  = GPIO_MAX + 1,
+};
+
+void __init sa1100_init_gpio(void)
+{
+       gpiochip_add(&sa1100_gpio_chip);
+}
index 3dc17d7bf38e823f407c05e30f1af20d8ae2022d..fa0403af7eecf3f078a18225f6f8ab485bcf8811 100644 (file)
@@ -347,4 +347,6 @@ void __init sa1100_init_irq(void)
         */
        set_irq_chip(IRQ_GPIO11_27, &sa1100_normal_chip);
        set_irq_chained_handler(IRQ_GPIO11_27, sa1100_high_gpio_handler);
+
+       sa1100_init_gpio();
 }
index c2677368d6af9568d97616b6d0d6becb1a3a5385..a9799cb35b74aebe0d005adb6c547b83e92e5b21 100644 (file)
 #include <linux/interrupt.h>
 #include <linux/irq.h>
 #include <linux/timex.h>
-#include <linux/signal.h>
-#include <linux/clocksource.h>
+#include <linux/clockchips.h>
 
 #include <asm/mach/time.h>
 #include <asm/hardware.h>
 
-#define RTC_DEF_DIVIDER                (32768 - 1)
-#define RTC_DEF_TRIM            0
+#define MIN_OSCR_DELTA 2
 
-static int sa1100_set_rtc(void)
+static irqreturn_t sa1100_ost0_interrupt(int irq, void *dev_id)
 {
-       unsigned long current_time = xtime.tv_sec;
+       struct clock_event_device *c = dev_id;
 
-       if (RTSR & RTSR_ALE) {
-               /* make sure not to forward the clock over an alarm */
-               unsigned long alarm = RTAR;
-               if (current_time >= alarm && alarm >= RCNR)
-                       return -ERESTARTSYS;
-       }
-       RCNR = current_time;
-       return 0;
-}
+       /* Disarm the compare/match, signal the event. */
+       OIER &= ~OIER_E0;
+       OSSR = OSSR_M0;
+       c->event_handler(c);
 
-#ifdef CONFIG_NO_IDLE_HZ
-static unsigned long initial_match;
-static int match_posponed;
-#endif
+       return IRQ_HANDLED;
+}
 
-static irqreturn_t
-sa1100_timer_interrupt(int irq, void *dev_id)
+static int
+sa1100_osmr0_set_next_event(unsigned long delta, struct clock_event_device *c)
 {
-       unsigned int next_match;
+       unsigned long flags, next, oscr;
 
-#ifdef CONFIG_NO_IDLE_HZ
-       if (match_posponed) {
-               match_posponed = 0;
-               OSMR0 = initial_match;
-       }
-#endif
+       raw_local_irq_save(flags);
+       OIER |= OIER_E0;
+       next = OSCR + delta;
+       OSMR0 = next;
+       oscr = OSCR;
+       raw_local_irq_restore(flags);
 
-       /*
-        * Loop until we get ahead of the free running timer.
-        * This ensures an exact clock tick count and time accuracy.
-        * Since IRQs are disabled at this point, coherence between
-        * lost_ticks(updated in do_timer()) and the match reg value is
-        * ensured, hence we can use do_gettimeofday() from interrupt
-        * handlers.
-        */
-       do {
-               timer_tick();
-               OSSR = OSSR_M0;  /* Clear match on timer 0 */
-               next_match = (OSMR0 += LATCH);
-       } while ((signed long)(next_match - OSCR) <= 0);
+       return (signed)(next - oscr) <= MIN_OSCR_DELTA ? -ETIME : 0;
+}
 
-       return IRQ_HANDLED;
+static void
+sa1100_osmr0_set_mode(enum clock_event_mode mode, struct clock_event_device *c)
+{
+       unsigned long flags;
+
+       switch (mode) {
+       case CLOCK_EVT_MODE_ONESHOT:
+       case CLOCK_EVT_MODE_UNUSED:
+       case CLOCK_EVT_MODE_SHUTDOWN:
+               raw_local_irq_save(flags);
+               OIER &= ~OIER_E0;
+               OSSR = OSSR_M0;
+               raw_local_irq_restore(flags);
+               break;
+
+       case CLOCK_EVT_MODE_RESUME:
+       case CLOCK_EVT_MODE_PERIODIC:
+               break;
+       }
 }
 
-static struct irqaction sa1100_timer_irq = {
-       .name           = "SA11xx Timer Tick",
-       .flags          = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL,
-       .handler        = sa1100_timer_interrupt,
+static struct clock_event_device ckevt_sa1100_osmr0 = {
+       .name           = "osmr0",
+       .features       = CLOCK_EVT_FEAT_ONESHOT,
+       .shift          = 32,
+       .rating         = 200,
+       .cpumask        = CPU_MASK_CPU0,
+       .set_next_event = sa1100_osmr0_set_next_event,
+       .set_mode       = sa1100_osmr0_set_mode,
 };
 
 static cycle_t sa1100_read_oscr(void)
@@ -90,62 +92,34 @@ static struct clocksource cksrc_sa1100_oscr = {
        .flags          = CLOCK_SOURCE_IS_CONTINUOUS,
 };
 
+static struct irqaction sa1100_timer_irq = {
+       .name           = "ost0",
+       .flags          = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL,
+       .handler        = sa1100_ost0_interrupt,
+       .dev_id         = &ckevt_sa1100_osmr0,
+};
+
 static void __init sa1100_timer_init(void)
 {
-       unsigned long flags;
-
-       set_rtc = sa1100_set_rtc;
-
        OIER = 0;               /* disable any timer interrupts */
        OSSR = 0xf;             /* clear status on all timers */
-       setup_irq(IRQ_OST0, &sa1100_timer_irq);
-       local_irq_save(flags);
-       OIER = OIER_E0;         /* enable match on timer 0 to cause interrupts */
-       OSMR0 = OSCR + LATCH;   /* set initial match */
-       local_irq_restore(flags);
+
+       ckevt_sa1100_osmr0.mult =
+               div_sc(3686400, NSEC_PER_SEC, ckevt_sa1100_osmr0.shift);
+       ckevt_sa1100_osmr0.max_delta_ns =
+               clockevent_delta2ns(0x7fffffff, &ckevt_sa1100_osmr0);
+       ckevt_sa1100_osmr0.min_delta_ns =
+               clockevent_delta2ns(MIN_OSCR_DELTA * 2, &ckevt_sa1100_osmr0) + 1;
 
        cksrc_sa1100_oscr.mult =
                clocksource_hz2mult(CLOCK_TICK_RATE, cksrc_sa1100_oscr.shift);
 
-       clocksource_register(&cksrc_sa1100_oscr);
-}
-
-#ifdef CONFIG_NO_IDLE_HZ
-static int sa1100_dyn_tick_enable_disable(void)
-{
-       /* nothing to do */
-       return 0;
-}
-
-static void sa1100_dyn_tick_reprogram(unsigned long ticks)
-{
-       if (ticks > 1) {
-               initial_match = OSMR0;
-               OSMR0 = initial_match + ticks * LATCH;
-               match_posponed = 1;
-       }
-}
+       setup_irq(IRQ_OST0, &sa1100_timer_irq);
 
-static irqreturn_t
-sa1100_dyn_tick_handler(int irq, void *dev_id)
-{
-       if (match_posponed) {
-               match_posponed = 0;
-               OSMR0 = initial_match;
-               if ((signed long)(initial_match - OSCR) <= 0)
-                       return sa1100_timer_interrupt(irq, dev_id);
-       }
-       return IRQ_NONE;
+       clocksource_register(&cksrc_sa1100_oscr);
+       clockevents_register_device(&ckevt_sa1100_osmr0);
 }
 
-static struct dyn_tick_timer sa1100_dyn_tick = {
-       .enable         = sa1100_dyn_tick_enable_disable,
-       .disable        = sa1100_dyn_tick_enable_disable,
-       .reprogram      = sa1100_dyn_tick_reprogram,
-       .handler        = sa1100_dyn_tick_handler,
-};
-#endif
-
 #ifdef CONFIG_PM
 unsigned long osmr[4], oier;
 
@@ -181,7 +155,4 @@ struct sys_timer sa1100_timer = {
        .init           = sa1100_timer_init,
        .suspend        = sa1100_timer_suspend,
        .resume         = sa1100_timer_resume,
-#ifdef CONFIG_NO_IDLE_HZ
-       .dyn_tick       = &sa1100_dyn_tick,
-#endif
 };
index 9858c96560e247e2b5cf92a263907b85cb5c9f6d..9336508ec0b2b1311bbf6c0ceda0fdaa40d8910d 100644 (file)
@@ -17,7 +17,6 @@
 #include <linux/clk.h>
 #include <linux/mutex.h>
 
-#include <asm/semaphore.h>
 #include <asm/hardware/icst307.h>
 
 #include "clock.h"
index 76348f060f27473b71c71de0086ff70cf6ad26d7..746cbb7c8e95a7273dc899e811a81cd55d960a3b 100644 (file)
@@ -18,6 +18,7 @@ config CPU_ARM610
        select CPU_CP15_MMU
        select CPU_COPY_V3 if MMU
        select CPU_TLB_V3 if MMU
+       select CPU_PABRT_NOIFAR
        help
          The ARM610 is the successor to the ARM3 processor
          and was produced by VLSI Technology Inc.
@@ -49,6 +50,7 @@ config CPU_ARM710
        select CPU_CP15_MMU
        select CPU_COPY_V3 if MMU
        select CPU_TLB_V3 if MMU
+       select CPU_PABRT_NOIFAR
        help
          A 32-bit RISC microprocessor based on the ARM7 processor core
          designed by Advanced RISC Machines Ltd. The ARM710 is the
@@ -64,6 +66,7 @@ config CPU_ARM720T
        default y if ARCH_CLPS711X || ARCH_L7200 || ARCH_CDB89712 || ARCH_H720X
        select CPU_32v4T
        select CPU_ABRT_LV4T
+       select CPU_PABRT_NOIFAR
        select CPU_CACHE_V4
        select CPU_CACHE_VIVT
        select CPU_CP15_MMU
@@ -113,6 +116,7 @@ config CPU_ARM920T
        default y if CPU_S3C2410 || CPU_S3C2440 || CPU_S3C2442 || ARCH_AT91RM9200
        select CPU_32v4T
        select CPU_ABRT_EV4T
+       select CPU_PABRT_NOIFAR
        select CPU_CACHE_V4WT
        select CPU_CACHE_VIVT
        select CPU_CP15_MMU
@@ -135,6 +139,7 @@ config CPU_ARM922T
        default y if ARCH_LH7A40X || ARCH_KS8695
        select CPU_32v4T
        select CPU_ABRT_EV4T
+       select CPU_PABRT_NOIFAR
        select CPU_CACHE_V4WT
        select CPU_CACHE_VIVT
        select CPU_CP15_MMU
@@ -155,6 +160,7 @@ config CPU_ARM925T
        default y if ARCH_OMAP15XX
        select CPU_32v4T
        select CPU_ABRT_EV4T
+       select CPU_PABRT_NOIFAR
        select CPU_CACHE_V4WT
        select CPU_CACHE_VIVT
        select CPU_CP15_MMU
@@ -175,6 +181,7 @@ config CPU_ARM926T
        default y if ARCH_VERSATILE_PB || MACH_VERSATILE_AB || ARCH_OMAP730 || ARCH_OMAP16XX || ARCH_PNX4008 || ARCH_NETX || CPU_S3C2412 || ARCH_AT91SAM9260 || ARCH_AT91SAM9261 || ARCH_AT91SAM9263 || ARCH_AT91SAM9RL || ARCH_AT91CAP9 || ARCH_NS9XXX || ARCH_DAVINCI
        select CPU_32v5
        select CPU_ABRT_EV5TJ
+       select CPU_PABRT_NOIFAR
        select CPU_CACHE_VIVT
        select CPU_CP15_MMU
        select CPU_COPY_V4WB if MMU
@@ -226,6 +233,7 @@ config CPU_ARM1020
        depends on ARCH_INTEGRATOR
        select CPU_32v5
        select CPU_ABRT_EV4T
+       select CPU_PABRT_NOIFAR
        select CPU_CACHE_V4WT
        select CPU_CACHE_VIVT
        select CPU_CP15_MMU
@@ -244,6 +252,7 @@ config CPU_ARM1020E
        depends on ARCH_INTEGRATOR
        select CPU_32v5
        select CPU_ABRT_EV4T
+       select CPU_PABRT_NOIFAR
        select CPU_CACHE_V4WT
        select CPU_CACHE_VIVT
        select CPU_CP15_MMU
@@ -257,6 +266,7 @@ config CPU_ARM1022
        depends on ARCH_INTEGRATOR
        select CPU_32v5
        select CPU_ABRT_EV4T
+       select CPU_PABRT_NOIFAR
        select CPU_CACHE_VIVT
        select CPU_CP15_MMU
        select CPU_COPY_V4WB if MMU # can probably do better
@@ -275,6 +285,7 @@ config CPU_ARM1026
        depends on ARCH_INTEGRATOR
        select CPU_32v5
        select CPU_ABRT_EV5T # But need Jazelle, but EV5TJ ignores bit 10
+       select CPU_PABRT_NOIFAR
        select CPU_CACHE_VIVT
        select CPU_CP15_MMU
        select CPU_COPY_V4WB if MMU # can probably do better
@@ -293,6 +304,7 @@ config CPU_SA110
        select CPU_32v3 if ARCH_RPC
        select CPU_32v4 if !ARCH_RPC
        select CPU_ABRT_EV4
+       select CPU_PABRT_NOIFAR
        select CPU_CACHE_V4WB
        select CPU_CACHE_VIVT
        select CPU_CP15_MMU
@@ -314,6 +326,7 @@ config CPU_SA1100
        default y
        select CPU_32v4
        select CPU_ABRT_EV4
+       select CPU_PABRT_NOIFAR
        select CPU_CACHE_V4WB
        select CPU_CACHE_VIVT
        select CPU_CP15_MMU
@@ -326,6 +339,7 @@ config CPU_XSCALE
        default y
        select CPU_32v5
        select CPU_ABRT_EV5T
+       select CPU_PABRT_NOIFAR
        select CPU_CACHE_VIVT
        select CPU_CP15_MMU
        select CPU_TLB_V4WBI if MMU
@@ -345,10 +359,11 @@ config CPU_XSC3
 # Feroceon
 config CPU_FEROCEON
        bool
-       depends on ARCH_ORION
+       depends on ARCH_ORION5X
        default y
        select CPU_32v5
        select CPU_ABRT_EV5T
+       select CPU_PABRT_NOIFAR
        select CPU_CACHE_VIVT
        select CPU_CP15_MMU
        select CPU_COPY_V4WB if MMU
@@ -366,11 +381,12 @@ config CPU_FEROCEON_OLD_ID
 # ARMv6
 config CPU_V6
        bool "Support ARM V6 processor"
-       depends on ARCH_INTEGRATOR || MACH_REALVIEW_EB || ARCH_OMAP2 || ARCH_MX3 || ARCH_MSM7X00A
+       depends on ARCH_INTEGRATOR || MACH_REALVIEW_EB || ARCH_OMAP2 || ARCH_MX3 || ARCH_MSM7X00A || MACH_REALVIEW_PB11MP || MACH_REALVIEW_PB1176
        default y if ARCH_MX3
        default y if ARCH_MSM7X00A
        select CPU_32v6
        select CPU_ABRT_EV6
+       select CPU_PABRT_NOIFAR
        select CPU_CACHE_V6
        select CPU_CACHE_VIPT
        select CPU_CP15_MMU
@@ -393,10 +409,11 @@ config CPU_32v6K
 # ARMv7
 config CPU_V7
        bool "Support ARM V7 processor"
-       depends on ARCH_INTEGRATOR
+       depends on ARCH_INTEGRATOR || MACH_REALVIEW_EB
        select CPU_32v6K
        select CPU_32v7
        select CPU_ABRT_EV7
+       select CPU_PABRT_IFAR
        select CPU_CACHE_V7
        select CPU_CACHE_VIPT
        select CPU_CP15_MMU
@@ -458,6 +475,12 @@ config CPU_ABRT_EV6
 config CPU_ABRT_EV7
        bool
 
+config CPU_PABRT_IFAR
+       bool
+
+config CPU_PABRT_NOIFAR
+       bool
+
 # The cache model
 config CPU_CACHE_V3
        bool
@@ -572,6 +595,13 @@ config ARM_THUMB
 
          If you don't know what this all is, saying Y is a safe choice.
 
+config ARM_THUMBEE
+       bool "Enable ThumbEE CPU extension"
+       depends on CPU_V7
+       help
+         Say Y here if you have a CPU with the ThumbEE extension and code to
+         make use of it. Say N for code that can run on CPUs without ThumbEE.
+
 config CPU_BIG_ENDIAN
        bool "Build big-endian kernel"
        depends on ARCH_SUPPORTS_BIG_ENDIAN
@@ -671,5 +701,9 @@ config OUTER_CACHE
        default n
 
 config CACHE_L2X0
-       bool
+       bool "Enable the L2x0 outer cache controller"
+       depends on REALVIEW_EB_ARM11MP || MACH_REALVIEW_PB11MP || MACH_REALVIEW_PB1176
+       default y
        select OUTER_CACHE
+       help
+         This option enables the L2x0 PrimeCell.
index ec00f26bffa4825c5ee61bf6c4f635f992550949..b657f1719af0e0f50a2498566d981acb616e967f 100644 (file)
@@ -48,8 +48,6 @@ void show_mem(void)
 
        printk("Mem-info:\n");
        show_free_areas();
-       printk("Free swap:       %6ldkB\n", nr_swap_pages<<(PAGE_SHIFT-10));
-
        for_each_online_node(node) {
                pg_data_t *n = NODE_DATA(node);
                struct page *map = n->node_mem_map - n->node_start_pfn;
index 700c04d6996ea3e646c91175747d30a5d127dff1..32fd7ea533f21d6387c65f1b1dbb50f269139d6e 100644 (file)
@@ -478,6 +478,7 @@ arm1020_processor_functions:
        .word   cpu_arm1020_dcache_clean_area
        .word   cpu_arm1020_switch_mm
        .word   cpu_arm1020_set_pte_ext
+       .word   pabort_noifar
        .size   arm1020_processor_functions, . - arm1020_processor_functions
 
        .section ".rodata"
index 1cc206ab5eae6a76378b79537d3fd7912805a01d..fe2b0ae70274a9ca48ffc5442c7b16259550e90c 100644 (file)
@@ -459,6 +459,7 @@ arm1020e_processor_functions:
        .word   cpu_arm1020e_dcache_clean_area
        .word   cpu_arm1020e_switch_mm
        .word   cpu_arm1020e_set_pte_ext
+       .word   pabort_noifar
        .size   arm1020e_processor_functions, . - arm1020e_processor_functions
 
        .section ".rodata"
index aff0ea08e2f8df5936f66f8f3ab50705d3623ce9..06dde678e19dc51b314dc082a98cefad66ce10d1 100644 (file)
@@ -442,6 +442,7 @@ arm1022_processor_functions:
        .word   cpu_arm1022_dcache_clean_area
        .word   cpu_arm1022_switch_mm
        .word   cpu_arm1022_set_pte_ext
+       .word   pabort_noifar
        .size   arm1022_processor_functions, . - arm1022_processor_functions
 
        .section ".rodata"
index 65e43a1090855df170c30b2b8fa576c4c7803e1d..f5506e6e681e251b2154248e8be510f770cb6c65 100644 (file)
@@ -437,6 +437,7 @@ arm1026_processor_functions:
        .word   cpu_arm1026_dcache_clean_area
        .word   cpu_arm1026_switch_mm
        .word   cpu_arm1026_set_pte_ext
+       .word   pabort_noifar
        .size   arm1026_processor_functions, . - arm1026_processor_functions
 
        .section .rodata
index 123a7dc7a4338c395ac2ae1adc416c845d1b3bcf..14b6a95c8d45a96490072967c15d147f0d220845 100644 (file)
@@ -300,6 +300,7 @@ ENTRY(arm6_processor_functions)
                .word   cpu_arm6_dcache_clean_area
                .word   cpu_arm6_switch_mm
                .word   cpu_arm6_set_pte_ext
+               .word   pabort_noifar
                .size   arm6_processor_functions, . - arm6_processor_functions
 
 /*
@@ -316,6 +317,7 @@ ENTRY(arm7_processor_functions)
                .word   cpu_arm7_dcache_clean_area
                .word   cpu_arm7_switch_mm
                .word   cpu_arm7_set_pte_ext
+               .word   pabort_noifar
                .size   arm7_processor_functions, . - arm7_processor_functions
 
                .section ".rodata"
index dc763be433622fabc8087ee8bcabdd0050a1559a..ca5e7aac2da7d711518ae74cd828b4a483828028 100644 (file)
@@ -205,6 +205,7 @@ ENTRY(arm720_processor_functions)
                .word   cpu_arm720_dcache_clean_area
                .word   cpu_arm720_switch_mm
                .word   cpu_arm720_set_pte_ext
+               .word   pabort_noifar
                .size   arm720_processor_functions, . - arm720_processor_functions
 
                .section ".rodata"
index 75c945ed6c4d3d8a339adf394c541495e9d166f0..0170d4f466eacdfde844905d4a7b05194eb7db15 100644 (file)
@@ -424,6 +424,7 @@ arm920_processor_functions:
        .word   cpu_arm920_dcache_clean_area
        .word   cpu_arm920_switch_mm
        .word   cpu_arm920_set_pte_ext
+       .word   pabort_noifar
        .size   arm920_processor_functions, . - arm920_processor_functions
 
        .section ".rodata"
index ffb751b877ff9cc43a8236a12dfe40f9af63b11e..b7952493d4049deae3ba251785bdad043a008a37 100644 (file)
@@ -428,6 +428,7 @@ arm922_processor_functions:
        .word   cpu_arm922_dcache_clean_area
        .word   cpu_arm922_switch_mm
        .word   cpu_arm922_set_pte_ext
+       .word   pabort_noifar
        .size   arm922_processor_functions, . - arm922_processor_functions
 
        .section ".rodata"
index 44c2c997819f522393b6b9454877fd1d79f64cba..e2988eba4cf605e8dd1a456ad723a8f8a6c09bd5 100644 (file)
@@ -491,6 +491,7 @@ arm925_processor_functions:
        .word   cpu_arm925_dcache_clean_area
        .word   cpu_arm925_switch_mm
        .word   cpu_arm925_set_pte_ext
+       .word   pabort_noifar
        .size   arm925_processor_functions, . - arm925_processor_functions
 
        .section ".rodata"
index 194ef48968e600b2cb1818fcf9dc961d3d998c83..62f7d1dfe01695a003b104a58b92818c85e77f74 100644 (file)
@@ -444,6 +444,7 @@ arm926_processor_functions:
        .word   cpu_arm926_dcache_clean_area
        .word   cpu_arm926_switch_mm
        .word   cpu_arm926_set_pte_ext
+       .word   pabort_noifar
        .size   arm926_processor_functions, . - arm926_processor_functions
 
        .section ".rodata"
index fa0dc7e6f0ea6f473174ea877e54e2bb10c82d8d..2f169b28e93849883ff08cdb296f79084ebf25ce 100644 (file)
@@ -430,6 +430,7 @@ feroceon_processor_functions:
        .word   cpu_feroceon_dcache_clean_area
        .word   cpu_feroceon_switch_mm
        .word   cpu_feroceon_set_pte_ext
+       .word   pabort_noifar
        .size   feroceon_processor_functions, . - feroceon_processor_functions
 
        .section ".rodata"
index 6e226e12989f8737b8e11af5f792491bdc2354fc..4db3d6299a2bd5830d7cd52e276062cb1f8c21d6 100644 (file)
@@ -223,6 +223,7 @@ ENTRY(sa110_processor_functions)
        .word   cpu_sa110_dcache_clean_area
        .word   cpu_sa110_switch_mm
        .word   cpu_sa110_set_pte_ext
+       .word   pabort_noifar
        .size   sa110_processor_functions, . - sa110_processor_functions
 
        .section ".rodata"
index 9afb11d089fe76abbd07a84143b44ecfd318b383..3cdef043760fce46d4de813df4e859b61243a106 100644 (file)
@@ -238,6 +238,7 @@ ENTRY(sa1100_processor_functions)
        .word   cpu_sa1100_dcache_clean_area
        .word   cpu_sa1100_switch_mm
        .word   cpu_sa1100_set_pte_ext
+       .word   pabort_noifar
        .size   sa1100_processor_functions, . - sa1100_processor_functions
 
        .section ".rodata"
index eb42e5b948630d106372b6296d71bdf02e7943d6..bf760ea2f789ee5796ef9c6702dec5ba3bfec1b7 100644 (file)
 #include <asm/pgtable-hwdef.h>
 #include <asm/pgtable.h>
 
-#ifdef CONFIG_SMP
-#include <asm/hardware/arm_scu.h>
-#endif
-
 #include "proc-macros.S"
 
 #define D_CACHE_LINE_SIZE      32
@@ -187,19 +183,9 @@ cpu_v6_name:
  */
 __v6_setup:
 #ifdef CONFIG_SMP
-       /* Set up the SCU on core 0 only */
-       mrc     p15, 0, r0, c0, c0, 5           @ CPU core number
-       ands    r0, r0, #15
-       ldreq   r0, =SCU_BASE
-       ldreq   r5, [r0, #SCU_CTRL]
-       orreq   r5, r5, #1
-       streq   r5, [r0, #SCU_CTRL]
-
-#ifndef CONFIG_CPU_DCACHE_DISABLE
        mrc     p15, 0, r0, c1, c0, 1           @ Enable SMP/nAMP mode
        orr     r0, r0, #0x20
        mcr     p15, 0, r0, c1, c0, 1
-#endif
 #endif
 
        mov     r0, #0
@@ -240,6 +226,7 @@ ENTRY(v6_processor_functions)
        .word   cpu_v6_dcache_clean_area
        .word   cpu_v6_switch_mm
        .word   cpu_v6_set_pte_ext
+       .word   pabort_noifar
        .size   v6_processor_functions, . - v6_processor_functions
 
        .type   cpu_arch_name, #object
index e0acc5ae6f6ff4a501ee1d74991cdd7b58f2f332..a1d7331cd64c4cf17715315a5675ec1dcec55fe0 100644 (file)
@@ -212,6 +212,7 @@ ENTRY(v7_processor_functions)
        .word   cpu_v7_dcache_clean_area
        .word   cpu_v7_switch_mm
        .word   cpu_v7_set_pte_ext
+       .word   pabort_ifar
        .size   v7_processor_functions, . - v7_processor_functions
 
        .type   cpu_arch_name, #object
index 016690b9d5648c3e8b717a235358bc22e996f1d8..1a6d89823dffb581a21c8908f6586f46b95eb1a4 100644 (file)
@@ -534,6 +534,7 @@ ENTRY(xscale_processor_functions)
        .word   cpu_xscale_dcache_clean_area
        .word   cpu_xscale_switch_mm
        .word   cpu_xscale_set_pte_ext
+       .word   pabort_noifar
        .size   xscale_processor_functions, . - xscale_processor_functions
 
        .section ".rodata"
index 98d01517b5634faf1448164f82183ba08c4f1aa7..d9bc15a69e5ddc103337ad18f79d7b0dc0c7499f 100644 (file)
@@ -24,6 +24,7 @@
 #include <asm/hardware.h>
 #include <asm/mach/pci.h>
 #include <asm/hardware/iop3xx.h>
+#include <asm/mach-types.h>
 
 // #define DEBUG
 
@@ -209,8 +210,11 @@ int iop3xx_pci_setup(int nr, struct pci_sys_data *sys)
        res[1].flags = IORESOURCE_MEM;
        request_resource(&iomem_resource, &res[1]);
 
-       sys->mem_offset = IOP3XX_PCI_LOWER_MEM_PA - IOP3XX_PCI_LOWER_MEM_BA;
-       sys->io_offset  = IOP3XX_PCI_LOWER_IO_PA - IOP3XX_PCI_LOWER_IO_BA;
+       /*
+        * Use whatever translation is already setup.
+        */
+       sys->mem_offset = IOP3XX_PCI_LOWER_MEM_PA - *IOP3XX_OMWTVR0;
+       sys->io_offset  = IOP3XX_PCI_LOWER_IO_PA - *IOP3XX_OIOWTVR;
 
        sys->resource[0] = &res[0];
        sys->resource[1] = &res[1];
@@ -250,11 +254,11 @@ void __init iop3xx_atu_setup(void)
        *IOP3XX_IATVR2 = PHYS_OFFSET;
 
        /* Outbound window 0 */
-       *IOP3XX_OMWTVR0 = IOP3XX_PCI_LOWER_MEM_PA;
+       *IOP3XX_OMWTVR0 = IOP3XX_PCI_LOWER_MEM_BA;
        *IOP3XX_OUMWTVR0 = 0;
 
        /* Outbound window 1 */
-       *IOP3XX_OMWTVR1 = IOP3XX_PCI_LOWER_MEM_PA + IOP3XX_PCI_MEM_WINDOW_SIZE;
+       *IOP3XX_OMWTVR1 = IOP3XX_PCI_LOWER_MEM_BA + IOP3XX_PCI_MEM_WINDOW_SIZE;
        *IOP3XX_OUMWTVR1 = 0;
 
        /* BAR 3 ( Disabled ) */
@@ -265,7 +269,7 @@ void __init iop3xx_atu_setup(void)
 
        /* Setup the I/O Bar
         */
-       *IOP3XX_OIOWTVR = IOP3XX_PCI_LOWER_IO_PA;;
+       *IOP3XX_OIOWTVR = IOP3XX_PCI_LOWER_IO_BA;
 
        /* Enable inbound and outbound cycles
         */
@@ -322,34 +326,59 @@ void __init iop3xx_atu_disable(void)
 /* Flag to determine whether the ATU is initialized and the PCI bus scanned */
 int init_atu;
 
-void __init iop3xx_pci_preinit(void)
+int iop3xx_get_init_atu(void) {
+       /* check if default has been overridden */
+       if (init_atu != IOP3XX_INIT_ATU_DEFAULT)
+               return init_atu;
+       else
+               return IOP3XX_INIT_ATU_DISABLE;
+}
+
+static void __init iop3xx_atu_debug(void)
 {
-       if (iop3xx_get_init_atu() == IOP3XX_INIT_ATU_ENABLE) {
-               iop3xx_atu_disable();
-               iop3xx_atu_setup();
-       }
+       DBG("PCI: Intel IOP3xx PCI init.\n");
+       DBG("PCI: Outbound memory window 0: PCI 0x%08x%08x\n",
+               *IOP3XX_OUMWTVR0, *IOP3XX_OMWTVR0);
+       DBG("PCI: Outbound memory window 1: PCI 0x%08x%08x\n",
+               *IOP3XX_OUMWTVR1, *IOP3XX_OMWTVR1);
+       DBG("PCI: Outbound IO window: PCI 0x%08x\n",
+               *IOP3XX_OIOWTVR);
+
+       DBG("PCI: Inbound memory window 0: PCI 0x%08x%08x 0x%08x -> 0x%08x\n",
+               *IOP3XX_IAUBAR0, *IOP3XX_IABAR0, *IOP3XX_IALR0, *IOP3XX_IATVR0);
+       DBG("PCI: Inbound memory window 1: PCI 0x%08x%08x 0x%08x\n",
+               *IOP3XX_IAUBAR1, *IOP3XX_IABAR1, *IOP3XX_IALR1);
+       DBG("PCI: Inbound memory window 2: PCI 0x%08x%08x 0x%08x -> 0x%08x\n",
+               *IOP3XX_IAUBAR2, *IOP3XX_IABAR2, *IOP3XX_IALR2, *IOP3XX_IATVR2);
+       DBG("PCI: Inbound memory window 3: PCI 0x%08x%08x 0x%08x -> 0x%08x\n",
+               *IOP3XX_IAUBAR3, *IOP3XX_IABAR3, *IOP3XX_IALR3, *IOP3XX_IATVR3);
+
+       DBG("PCI: Expansion ROM window: PCI 0x%08x%08x 0x%08x -> 0x%08x\n",
+               0, *IOP3XX_ERBAR, *IOP3XX_ERLR, *IOP3XX_ERTVR);
 
-       DBG("PCI:  Intel 803xx PCI init code.\n");
        DBG("ATU: IOP3XX_ATUCMD=0x%04x\n", *IOP3XX_ATUCMD);
-       DBG("ATU: IOP3XX_OMWTVR0=0x%04x, IOP3XX_OIOWTVR=0x%04x\n",
-                       *IOP3XX_OMWTVR0,
-                       *IOP3XX_OIOWTVR);
        DBG("ATU: IOP3XX_ATUCR=0x%08x\n", *IOP3XX_ATUCR);
-       DBG("ATU: IOP3XX_IABAR0=0x%08x IOP3XX_IALR0=0x%08x IOP3XX_IATVR0=%08x\n",
-                       *IOP3XX_IABAR0, *IOP3XX_IALR0, *IOP3XX_IATVR0);
-       DBG("ATU: IOP3XX_OMWTVR0=0x%08x\n", *IOP3XX_OMWTVR0);
-       DBG("ATU: IOP3XX_IABAR1=0x%08x IOP3XX_IALR1=0x%08x\n",
-                       *IOP3XX_IABAR1, *IOP3XX_IALR1);
-       DBG("ATU: IOP3XX_ERBAR=0x%08x IOP3XX_ERLR=0x%08x IOP3XX_ERTVR=%08x\n",
-                       *IOP3XX_ERBAR, *IOP3XX_ERLR, *IOP3XX_ERTVR);
-       DBG("ATU: IOP3XX_IABAR2=0x%08x IOP3XX_IALR2=0x%08x IOP3XX_IATVR2=%08x\n",
-                       *IOP3XX_IABAR2, *IOP3XX_IALR2, *IOP3XX_IATVR2);
-       DBG("ATU: IOP3XX_IABAR3=0x%08x IOP3XX_IALR3=0x%08x IOP3XX_IATVR3=%08x\n",
-                       *IOP3XX_IABAR3, *IOP3XX_IALR3, *IOP3XX_IATVR3);
 
        hook_fault_code(16+6, iop3xx_pci_abort, SIGBUS, "imprecise external abort");
 }
 
+/* for platforms that might be host-bus-adapters */
+void __init iop3xx_pci_preinit_cond(void)
+{
+       if (iop3xx_get_init_atu() == IOP3XX_INIT_ATU_ENABLE) {
+               iop3xx_atu_disable();
+               iop3xx_atu_setup();
+               iop3xx_atu_debug();
+       }
+}
+
+void __init iop3xx_pci_preinit(void)
+{
+       iop3xx_atu_disable();
+       iop3xx_atu_setup();
+       iop3xx_atu_debug();
+}
+
 /* allow init_atu to be user overridden */
 static int __init iop3xx_init_atu_setup(char *str)
 {
index 03a65c0dfb6087de55a7b0627351d8406f38b278..bb6e12738fb3d749c9c2c0c13a40532790aa571b 100644 (file)
@@ -4,7 +4,7 @@ menu "Freescale MXC Implementations"
 
 choice
        prompt "MXC/iMX System Type"
-       default 0
+       default ARCH_MX3
 
 config ARCH_MX3
        bool "MX3-based"
index 66ad9c2b6d64ecfb170125c588bc261844128106..f96dc0362068d40e8e027e68ea5c33f8a42eee6a 100644 (file)
@@ -4,7 +4,3 @@
 
 # Common support
 obj-y := irq.o
-
-obj-m :=
-obj-n :=
-obj-  :=
index 87d253bc3d3c0541c845693e3714385f92f988a7..2ad5a6917b3f3119c15b6f7289d5841df555f6c1 100644 (file)
 #include <asm/mach/irq.h>
 #include <asm/arch/common.h>
 
-/*!
- * Disable interrupt number "irq" in the AVIC
- *
- * @param  irq          interrupt source number
- */
+/* Disable interrupt number "irq" in the AVIC */
 static void mxc_mask_irq(unsigned int irq)
 {
        __raw_writel(irq, AVIC_INTDISNUM);
 }
 
-/*!
- * Enable interrupt number "irq" in the AVIC
- *
- * @param  irq          interrupt source number
- */
+/* Enable interrupt number "irq" in the AVIC */
 static void mxc_unmask_irq(unsigned int irq)
 {
        __raw_writel(irq, AVIC_INTENNUM);
@@ -45,7 +37,7 @@ static struct irq_chip mxc_avic_chip = {
        .unmask = mxc_unmask_irq,
 };
 
-/*!
+/*
  * This function initializes the AVIC hardware and disables all the
  * interrupts. It registers the interrupt enable and disable functions
  * to the kernel for each interrupt source.
index 8f56c255d1ee2c61a5807098766941ef74045f03..bc639a30d6d1718890576735810772cd51a34e4f 100644 (file)
@@ -9,8 +9,6 @@ obj-m :=
 obj-n :=
 obj-  :=
 
-obj-$(CONFIG_OMAP_32K_TIMER)   += timer32k.o
-
 # OCPI interconnect support for 1710, 1610 and 5912
 obj-$(CONFIG_ARCH_OMAP16XX) += ocpi.o
 
index 0a603242f36712e1060542f6c14c97efd3100a76..72d34a23a2ec6276073af8906e916075b6808945 100644 (file)
@@ -23,7 +23,6 @@
 #include <linux/platform_device.h>
 
 #include <asm/io.h>
-#include <asm/semaphore.h>
 
 #include <asm/arch/clock.h>
 
@@ -304,6 +303,23 @@ void propagate_rate(struct clk * tclk)
        }
 }
 
+/**
+ * recalculate_root_clocks - recalculate and propagate all root clocks
+ *
+ * Recalculates all root clocks (clocks with no parent), which if the
+ * clock's .recalc is set correctly, should also propagate their rates.
+ * Called at init.
+ */
+void recalculate_root_clocks(void)
+{
+       struct clk *clkp;
+
+       list_for_each_entry(clkp, &clocks, node) {
+               if (unlikely(!clkp->parent) && likely((u32)clkp->recalc))
+                       clkp->recalc(clkp);
+       }
+}
+
 int clk_register(struct clk *clk)
 {
        if (clk == NULL || IS_ERR(clk))
@@ -358,6 +374,30 @@ void clk_allow_idle(struct clk *clk)
 }
 EXPORT_SYMBOL(clk_allow_idle);
 
+void clk_enable_init_clocks(void)
+{
+       struct clk *clkp;
+
+       list_for_each_entry(clkp, &clocks, node) {
+               if (clkp->flags & ENABLE_ON_INIT)
+                       clk_enable(clkp);
+       }
+}
+EXPORT_SYMBOL(clk_enable_init_clocks);
+
+#ifdef CONFIG_CPU_FREQ
+void clk_init_cpufreq_table(struct cpufreq_frequency_table **table)
+{
+       unsigned long flags;
+
+       spin_lock_irqsave(&clockfw_lock, flags);
+       if (arch_clock->clk_init_cpufreq_table)
+               arch_clock->clk_init_cpufreq_table(table);
+       spin_unlock_irqrestore(&clockfw_lock, flags);
+}
+EXPORT_SYMBOL(clk_init_cpufreq_table);
+#endif
+
 /*-------------------------------------------------------------------------*/
 
 #ifdef CONFIG_OMAP_RESET_CLOCKS
@@ -396,3 +436,4 @@ int __init clk_init(struct clk_functions * custom_clocks)
 
        return 0;
 }
+
index 4f0f9c4e938ee7fbb2937c4fb4841de6de8acbcc..bd1cef2c3c1485fbef1fe4105d98186249124982 100644 (file)
 #include <asm/setup.h>
 
 #include <asm/arch/board.h>
+#include <asm/arch/control.h>
 #include <asm/arch/mux.h>
 #include <asm/arch/fpga.h>
 
 #include <asm/arch/clock.h>
 
+#if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3)
+# include "../mach-omap2/sdrc.h"
+#endif
+
 #define NO_LENGTH_CHECK 0xffffffff
 
 unsigned char omap_bootloader_tag[512];
@@ -171,8 +176,8 @@ console_initcall(omap_add_serial_console);
 
 #if defined(CONFIG_ARCH_OMAP16XX)
 #define TIMER_32K_SYNCHRONIZED         0xfffbc410
-#elif defined(CONFIG_ARCH_OMAP24XX)
-#define TIMER_32K_SYNCHRONIZED         (OMAP24XX_32KSYNCT_BASE + 0x10)
+#elif defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX)
+#define TIMER_32K_SYNCHRONIZED         (OMAP2_32KSYNCT_BASE + 0x10)
 #endif
 
 #ifdef TIMER_32K_SYNCHRONIZED
@@ -193,12 +198,35 @@ static struct clocksource clocksource_32k = {
        .flags          = CLOCK_SOURCE_IS_CONTINUOUS,
 };
 
+/*
+ * Rounds down to nearest nsec.
+ */
+unsigned long long omap_32k_ticks_to_nsecs(unsigned long ticks_32k)
+{
+       return cyc2ns(&clocksource_32k, ticks_32k);
+}
+
+/*
+ * Returns current time from boot in nsecs. It's OK for this to wrap
+ * around for now, as it's just a relative time stamp.
+ */
+unsigned long long sched_clock(void)
+{
+       return omap_32k_ticks_to_nsecs(omap_32k_read());
+}
+
 static int __init omap_init_clocksource_32k(void)
 {
        static char err[] __initdata = KERN_ERR
                        "%s: can't register clocksource!\n";
 
-       if (cpu_is_omap16xx() || cpu_is_omap24xx()) {
+       if (cpu_is_omap16xx() || cpu_class_is_omap2()) {
+               struct clk *sync_32k_ick;
+
+               sync_32k_ick = clk_get(NULL, "omap_32ksync_ick");
+               if (sync_32k_ick)
+                       clk_enable(sync_32k_ick);
+
                clocksource_32k.mult = clocksource_hz2mult(32768,
                                            clocksource_32k.shift);
 
@@ -210,3 +238,33 @@ static int __init omap_init_clocksource_32k(void)
 arch_initcall(omap_init_clocksource_32k);
 
 #endif /* TIMER_32K_SYNCHRONIZED */
+
+/* Global address base setup code */
+
+#if defined(CONFIG_ARCH_OMAP2420)
+void __init omap2_set_globals_242x(void)
+{
+       omap2_sdrc_base = OMAP2420_SDRC_BASE;
+       omap2_sms_base = OMAP2420_SMS_BASE;
+       omap_ctrl_base_set(OMAP2420_CTRL_BASE);
+}
+#endif
+
+#if defined(CONFIG_ARCH_OMAP2430)
+void __init omap2_set_globals_243x(void)
+{
+       omap2_sdrc_base = OMAP243X_SDRC_BASE;
+       omap2_sms_base = OMAP243X_SMS_BASE;
+       omap_ctrl_base_set(OMAP243X_CTRL_BASE);
+}
+#endif
+
+#if defined(CONFIG_ARCH_OMAP3430)
+void __init omap2_set_globals_343x(void)
+{
+       omap2_sdrc_base = OMAP343X_SDRC_BASE;
+       omap2_sms_base = OMAP343X_SMS_BASE;
+       omap_ctrl_base_set(OMAP343X_CTRL_BASE);
+}
+#endif
+
index 8c78e4e57b5cf09c44547eb74c277ed3fc7d4803..1903a3491ee9ff7f330e90a3c9a7df5cd4897d22 100644 (file)
@@ -136,7 +136,6 @@ struct gpio_bank {
        u16 irq;
        u16 virtual_irq_start;
        int method;
-       u32 reserved_map;
 #if defined(CONFIG_ARCH_OMAP16XX) || defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX)
        u32 suspend_wakeup;
        u32 saved_wakeup;
@@ -149,7 +148,9 @@ struct gpio_bank {
        u32 saved_fallingdetect;
        u32 saved_risingdetect;
 #endif
+       u32 level_mask;
        spinlock_t lock;
+       struct gpio_chip chip;
 };
 
 #define METHOD_MPUIO           0
@@ -538,10 +539,9 @@ static inline void set_24xx_gpio_triggering(struct gpio_bank *bank, int gpio,
                        bank->enabled_non_wakeup_gpios &= ~gpio_bit;
        }
 
-       /*
-        * FIXME: Possibly do 'set_irq_handler(j, handle_level_irq)' if only
-        * level triggering requested.
-        */
+       bank->level_mask =
+               __raw_readl(bank->base + OMAP24XX_GPIO_LEVELDETECT0) |
+               __raw_readl(bank->base + OMAP24XX_GPIO_LEVELDETECT1);
 }
 #endif
 
@@ -652,6 +652,12 @@ static int gpio_irq_type(unsigned irq, unsigned type)
                irq_desc[irq].status |= type;
        }
        spin_unlock_irqrestore(&bank->lock, flags);
+
+       if (type & (IRQ_TYPE_LEVEL_LOW | IRQ_TYPE_LEVEL_HIGH))
+               __set_irq_handler_unlocked(irq, handle_level_irq);
+       else if (type & (IRQ_TYPE_EDGE_FALLING | IRQ_TYPE_EDGE_RISING))
+               __set_irq_handler_unlocked(irq, handle_edge_irq);
+
        return retval;
 }
 
@@ -903,19 +909,17 @@ int omap_request_gpio(int gpio)
 {
        struct gpio_bank *bank;
        unsigned long flags;
+       int status;
 
        if (check_gpio(gpio) < 0)
                return -EINVAL;
 
+       status = gpio_request(gpio, NULL);
+       if (status < 0)
+               return status;
+
        bank = get_gpio_bank(gpio);
        spin_lock_irqsave(&bank->lock, flags);
-       if (unlikely(bank->reserved_map & (1 << get_gpio_index(gpio)))) {
-               printk(KERN_ERR "omap-gpio: GPIO %d is already reserved!\n", gpio);
-               dump_stack();
-               spin_unlock_irqrestore(&bank->lock, flags);
-               return -1;
-       }
-       bank->reserved_map |= (1 << get_gpio_index(gpio));
 
        /* Set trigger to none. You need to enable the desired trigger with
         * request_irq() or set_irq_type().
@@ -945,10 +949,11 @@ void omap_free_gpio(int gpio)
                return;
        bank = get_gpio_bank(gpio);
        spin_lock_irqsave(&bank->lock, flags);
-       if (unlikely(!(bank->reserved_map & (1 << get_gpio_index(gpio))))) {
+       if (unlikely(!gpiochip_is_requested(&bank->chip,
+                               get_gpio_index(gpio)))) {
+               spin_unlock_irqrestore(&bank->lock, flags);
                printk(KERN_ERR "omap-gpio: GPIO %d wasn't reserved!\n", gpio);
                dump_stack();
-               spin_unlock_irqrestore(&bank->lock, flags);
                return;
        }
 #ifdef CONFIG_ARCH_OMAP16XX
@@ -965,9 +970,9 @@ void omap_free_gpio(int gpio)
                __raw_writel(1 << get_gpio_index(gpio), reg);
        }
 #endif
-       bank->reserved_map &= ~(1 << get_gpio_index(gpio));
        _reset_gpio(bank, gpio);
        spin_unlock_irqrestore(&bank->lock, flags);
+       gpio_free(gpio);
 }
 
 /*
@@ -1022,12 +1027,7 @@ static void gpio_irq_handler(unsigned int irq, struct irq_desc *desc)
                        isr &= 0x0000ffff;
 
                if (cpu_class_is_omap2()) {
-                       level_mask =
-                               __raw_readl(bank->base +
-                                       OMAP24XX_GPIO_LEVELDETECT0) |
-                               __raw_readl(bank->base +
-                                       OMAP24XX_GPIO_LEVELDETECT1);
-                       level_mask &= enabled;
+                       level_mask = bank->level_mask & enabled;
                }
 
                /* clear edge sensitive interrupts before handler(s) are
@@ -1052,51 +1052,13 @@ static void gpio_irq_handler(unsigned int irq, struct irq_desc *desc)
                gpio_irq = bank->virtual_irq_start;
                for (; isr != 0; isr >>= 1, gpio_irq++) {
                        struct irq_desc *d;
-                       int irq_mask;
+
                        if (!(isr & 1))
                                continue;
                        d = irq_desc + gpio_irq;
-                       /* Don't run the handler if it's already running
-                        * or was disabled lazely.
-                        */
-                       if (unlikely((d->depth ||
-                                     (d->status & IRQ_INPROGRESS)))) {
-                               irq_mask = 1 <<
-                                       (gpio_irq - bank->virtual_irq_start);
-                               /* The unmasking will be done by
-                                * enable_irq in case it is disabled or
-                                * after returning from the handler if
-                                * it's already running.
-                                */
-                               _enable_gpio_irqbank(bank, irq_mask, 0);
-                               if (!d->depth) {
-                                       /* Level triggered interrupts
-                                        * won't ever be reentered
-                                        */
-                                       BUG_ON(level_mask & irq_mask);
-                                       d->status |= IRQ_PENDING;
-                               }
-                               continue;
-                       }
 
                        desc_handle_irq(gpio_irq, d);
-
-                       if (unlikely((d->status & IRQ_PENDING) && !d->depth)) {
-                               irq_mask = 1 <<
-                                       (gpio_irq - bank->virtual_irq_start);
-                               d->status &= ~IRQ_PENDING;
-                               _enable_gpio_irqbank(bank, irq_mask, 1);
-                               retrigger |= irq_mask;
-                       }
                }
-
-               if (cpu_class_is_omap2()) {
-                       /* clear level sensitive interrupts after handler(s) */
-                       _enable_gpio_irqbank(bank, isr_saved & level_mask, 0);
-                       _clear_gpio_irqbank(bank, isr_saved & level_mask);
-                       _enable_gpio_irqbank(bank, isr_saved & level_mask, 1);
-               }
-
        }
        /* if bank has any level sensitive GPIO pin interrupt
        configured, we must unmask the bank interrupt only after
@@ -1135,6 +1097,14 @@ static void gpio_unmask_irq(unsigned int irq)
 {
        unsigned int gpio = irq - IH_GPIO_BASE;
        struct gpio_bank *bank = get_irq_chip_data(irq);
+       unsigned int irq_mask = 1 << get_gpio_index(gpio);
+
+       /* For level-triggered GPIOs, the clearing must be done after
+        * the HW source is cleared, thus after the handler has run */
+       if (bank->level_mask & irq_mask) {
+               _set_gpio_irqenable(bank, gpio, 0);
+               _clear_gpio_irqstatus(bank, gpio);
+       }
 
        _set_gpio_irqenable(bank, gpio, 1);
 }
@@ -1266,6 +1236,53 @@ static inline void mpuio_init(void) {}
 
 /*---------------------------------------------------------------------*/
 
+/* REVISIT these are stupid implementations!  replace by ones that
+ * don't switch on METHOD_* and which mostly avoid spinlocks
+ */
+
+static int gpio_input(struct gpio_chip *chip, unsigned offset)
+{
+       struct gpio_bank *bank;
+       unsigned long flags;
+
+       bank = container_of(chip, struct gpio_bank, chip);
+       spin_lock_irqsave(&bank->lock, flags);
+       _set_gpio_direction(bank, offset, 1);
+       spin_unlock_irqrestore(&bank->lock, flags);
+       return 0;
+}
+
+static int gpio_get(struct gpio_chip *chip, unsigned offset)
+{
+       return omap_get_gpio_datain(chip->base + offset);
+}
+
+static int gpio_output(struct gpio_chip *chip, unsigned offset, int value)
+{
+       struct gpio_bank *bank;
+       unsigned long flags;
+
+       bank = container_of(chip, struct gpio_bank, chip);
+       spin_lock_irqsave(&bank->lock, flags);
+       _set_gpio_dataout(bank, offset, value);
+       _set_gpio_direction(bank, offset, 0);
+       spin_unlock_irqrestore(&bank->lock, flags);
+       return 0;
+}
+
+static void gpio_set(struct gpio_chip *chip, unsigned offset, int value)
+{
+       struct gpio_bank *bank;
+       unsigned long flags;
+
+       bank = container_of(chip, struct gpio_bank, chip);
+       spin_lock_irqsave(&bank->lock, flags);
+       _set_gpio_dataout(bank, offset, value);
+       spin_unlock_irqrestore(&bank->lock, flags);
+}
+
+/*---------------------------------------------------------------------*/
+
 static int initialized;
 #if !defined(CONFIG_ARCH_OMAP3)
 static struct clk * gpio_ick;
@@ -1293,6 +1310,7 @@ static struct lock_class_key gpio_lock_class;
 static int __init _omap_gpio_init(void)
 {
        int i;
+       int gpio = 0;
        struct gpio_bank *bank;
 #if defined(CONFIG_ARCH_OMAP3)
        char clk_name[11];
@@ -1423,7 +1441,6 @@ static int __init _omap_gpio_init(void)
                int j, gpio_count = 16;
 
                bank = &gpio_bank[i];
-               bank->reserved_map = 0;
                bank->base = IO_ADDRESS(bank->base);
                spin_lock_init(&bank->lock);
                if (bank_is_mpuio(bank))
@@ -1461,6 +1478,26 @@ static int __init _omap_gpio_init(void)
                        gpio_count = 32;
                }
 #endif
+
+               /* REVISIT eventually switch from OMAP-specific gpio structs
+                * over to the generic ones
+                */
+               bank->chip.direction_input = gpio_input;
+               bank->chip.get = gpio_get;
+               bank->chip.direction_output = gpio_output;
+               bank->chip.set = gpio_set;
+               if (bank_is_mpuio(bank)) {
+                       bank->chip.label = "mpuio";
+                       bank->chip.base = OMAP_MPUIO(0);
+               } else {
+                       bank->chip.label = "gpio";
+                       bank->chip.base = gpio;
+                       gpio += gpio_count;
+               }
+               bank->chip.ngpio = gpio_count;
+
+               gpiochip_add(&bank->chip);
+
                for (j = bank->virtual_irq_start;
                     j < bank->virtual_irq_start + gpio_count; j++) {
                        lockdep_set_class(&irq_desc[j].lock, &gpio_lock_class);
@@ -1757,8 +1794,10 @@ static int dbg_gpio_show(struct seq_file *s, void *unused)
 
                for (j = 0; j < bankwidth; j++, gpio++, mask <<= 1) {
                        unsigned        irq, value, is_in, irqstat;
+                       const char      *label;
 
-                       if (!(bank->reserved_map & mask))
+                       label = gpiochip_is_requested(&bank->chip, j);
+                       if (!label)
                                continue;
 
                        irq = bank->virtual_irq_start + j;
@@ -1766,13 +1805,16 @@ static int dbg_gpio_show(struct seq_file *s, void *unused)
                        is_in = gpio_is_input(bank, mask);
 
                        if (bank_is_mpuio(bank))
-                               seq_printf(s, "MPUIO %2d: ", j);
+                               seq_printf(s, "MPUIO %2d ", j);
                        else
-                               seq_printf(s, "GPIO %3d: ", gpio);
-                       seq_printf(s, "%s %s",
+                               seq_printf(s, "GPIO %3d ", gpio);
+                       seq_printf(s, "(%10s): %s %s",
+                                       label,
                                        is_in ? "in " : "out",
                                        value ? "hi"  : "lo");
 
+/* FIXME for at least omap2, show pullup/pulldown state */
+
                        irqstat = irq_desc[irq].status;
                        if (is_in && ((bank->suspend_wakeup & mask)
                                        || irqstat & IRQ_TYPE_SENSE_MASK)) {
@@ -1795,10 +1837,10 @@ static int dbg_gpio_show(struct seq_file *s, void *unused)
                                        trigger = "high";
                                        break;
                                case IRQ_TYPE_NONE:
-                                       trigger = "(unspecified)";
+                                       trigger = "(?)";
                                        break;
                                }
-                               seq_printf(s, ", irq-%d %s%s",
+                               seq_printf(s, ", irq-%d %-8s%s",
                                                irq, trigger,
                                                (bank->suspend_wakeup & mask)
                                                        ? " wakeup" : "");
index 75211f20ccb3db11dc04347f991a30d82a5447a3..6f3f459731c8feb650f2cb37bb9742671cfc3b4d 100644 (file)
@@ -3,9 +3,9 @@
  *
  * Utility to set the Omap MUX and PULL_DWN registers from a table in mux.h
  *
- * Copyright (C) 2003 - 2005 Nokia Corporation
+ * Copyright (C) 2003 - 2008 Nokia Corporation
  *
- * Written by Tony Lindgren <tony.lindgren@nokia.com>
+ * Written by Tony Lindgren
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
 
 #ifdef CONFIG_OMAP_MUX
 
-#define OMAP24XX_L4_BASE       0x48000000
-#define OMAP24XX_PULL_ENA      (1 << 3)
-#define OMAP24XX_PULL_UP       (1 << 4)
+static struct omap_mux_cfg *mux_cfg;
 
-static struct pin_config * pin_table;
-static unsigned long pin_table_sz;
-
-extern struct pin_config * omap730_pins;
-extern struct pin_config * omap1xxx_pins;
-extern struct pin_config * omap24xx_pins;
-
-int __init omap_mux_register(struct pin_config * pins, unsigned long size)
+int __init omap_mux_register(struct omap_mux_cfg *arch_mux_cfg)
 {
-       pin_table = pins;
-       pin_table_sz = size;
+       if (!arch_mux_cfg || !arch_mux_cfg->pins || arch_mux_cfg->size == 0
+                       || !arch_mux_cfg->cfg_reg) {
+               printk(KERN_ERR "Invalid pin table\n");
+               return -EINVAL;
+       }
+
+       mux_cfg = arch_mux_cfg;
 
        return 0;
 }
@@ -56,152 +52,26 @@ int __init omap_mux_register(struct pin_config * pins, unsigned long size)
  */
 int __init_or_module omap_cfg_reg(const unsigned long index)
 {
-       static DEFINE_SPINLOCK(mux_spin_lock);
-
-       unsigned long flags;
-       struct pin_config *cfg;
-       unsigned int reg_orig = 0, reg = 0, pu_pd_orig = 0, pu_pd = 0,
-               pull_orig = 0, pull = 0;
-       unsigned int mask, warn = 0;
+       struct pin_config *reg;
 
-       if (!pin_table)
-               BUG();
+       if (mux_cfg == NULL) {
+               printk(KERN_ERR "Pin mux table not initialized\n");
+               return -ENODEV;
+       }
 
-       if (index >= pin_table_sz) {
+       if (index >= mux_cfg->size) {
                printk(KERN_ERR "Invalid pin mux index: %lu (%lu)\n",
-                      index, pin_table_sz);
+                      index, mux_cfg->size);
                dump_stack();
                return -ENODEV;
        }
 
-       cfg = (struct pin_config *)&pin_table[index];
-       if (cpu_is_omap24xx()) {
-               u8 reg = 0;
-
-               reg |= cfg->mask & 0x7;
-               if (cfg->pull_val)
-                       reg |= OMAP24XX_PULL_ENA;
-               if(cfg->pu_pd_val)
-                       reg |= OMAP24XX_PULL_UP;
-#if defined(CONFIG_OMAP_MUX_DEBUG) || defined(CONFIG_OMAP_MUX_WARNINGS)
-               {
-                       u8 orig = omap_readb(OMAP24XX_L4_BASE + cfg->mux_reg);
-                       u8 debug = 0;
-
-#ifdef CONFIG_OMAP_MUX_DEBUG
-                       debug = cfg->debug;
-#endif
-                       warn = (orig != reg);
-                       if (debug || warn)
-                               printk("MUX: setup %s (0x%08x): 0x%02x -> 0x%02x\n",
-                                               cfg->name,
-                                               OMAP24XX_L4_BASE + cfg->mux_reg,
-                                               orig, reg);
-               }
-#endif
-               omap_writeb(reg, OMAP24XX_L4_BASE + cfg->mux_reg);
+       reg = (struct pin_config *)&mux_cfg->pins[index];
 
-               return 0;
-       }
-
-       /* Check the mux register in question */
-       if (cfg->mux_reg) {
-               unsigned        tmp1, tmp2;
-
-               spin_lock_irqsave(&mux_spin_lock, flags);
-               reg_orig = omap_readl(cfg->mux_reg);
-
-               /* The mux registers always seem to be 3 bits long */
-               mask = (0x7 << cfg->mask_offset);
-               tmp1 = reg_orig & mask;
-               reg = reg_orig & ~mask;
-
-               tmp2 = (cfg->mask << cfg->mask_offset);
-               reg |= tmp2;
-
-               if (tmp1 != tmp2)
-                       warn = 1;
-
-               omap_writel(reg, cfg->mux_reg);
-               spin_unlock_irqrestore(&mux_spin_lock, flags);
-       }
-
-       /* Check for pull up or pull down selection on 1610 */
-       if (!cpu_is_omap15xx()) {
-               if (cfg->pu_pd_reg && cfg->pull_val) {
-                       spin_lock_irqsave(&mux_spin_lock, flags);
-                       pu_pd_orig = omap_readl(cfg->pu_pd_reg);
-                       mask = 1 << cfg->pull_bit;
-
-                       if (cfg->pu_pd_val) {
-                               if (!(pu_pd_orig & mask))
-                                       warn = 1;
-                               /* Use pull up */
-                               pu_pd = pu_pd_orig | mask;
-                       } else {
-                               if (pu_pd_orig & mask)
-                                       warn = 1;
-                               /* Use pull down */
-                               pu_pd = pu_pd_orig & ~mask;
-                       }
-                       omap_writel(pu_pd, cfg->pu_pd_reg);
-                       spin_unlock_irqrestore(&mux_spin_lock, flags);
-               }
-       }
-
-       /* Check for an associated pull down register */
-       if (cfg->pull_reg) {
-               spin_lock_irqsave(&mux_spin_lock, flags);
-               pull_orig = omap_readl(cfg->pull_reg);
-               mask = 1 << cfg->pull_bit;
-
-               if (cfg->pull_val) {
-                       if (pull_orig & mask)
-                               warn = 1;
-                       /* Low bit = pull enabled */
-                       pull = pull_orig & ~mask;
-               } else {
-                       if (!(pull_orig & mask))
-                               warn = 1;
-                       /* High bit = pull disabled */
-                       pull = pull_orig | mask;
-               }
-
-               omap_writel(pull, cfg->pull_reg);
-               spin_unlock_irqrestore(&mux_spin_lock, flags);
-       }
-
-       if (warn) {
-#ifdef CONFIG_OMAP_MUX_WARNINGS
-               printk(KERN_WARNING "MUX: initialized %s\n", cfg->name);
-#endif
-       }
-
-#ifdef CONFIG_OMAP_MUX_DEBUG
-       if (cfg->debug || warn) {
-               printk("MUX: Setting register %s\n", cfg->name);
-               printk("      %s (0x%08x) = 0x%08x -> 0x%08x\n",
-                      cfg->mux_reg_name, cfg->mux_reg, reg_orig, reg);
-
-               if (!cpu_is_omap15xx()) {
-                       if (cfg->pu_pd_reg && cfg->pull_val) {
-                               printk("      %s (0x%08x) = 0x%08x -> 0x%08x\n",
-                                      cfg->pu_pd_name, cfg->pu_pd_reg,
-                                      pu_pd_orig, pu_pd);
-                       }
-               }
-
-               if (cfg->pull_reg)
-                       printk("      %s (0x%08x) = 0x%08x -> 0x%08x\n",
-                              cfg->pull_name, cfg->pull_reg, pull_orig, pull);
-       }
-#endif
+       if (!mux_cfg->cfg_reg)
+               return -ENODEV;
 
-#ifdef CONFIG_OMAP_MUX_ERRORS
-       return warn ? -ETXTBSY : 0;
-#else
-       return 0;
-#endif
+       return mux_cfg->cfg_reg(reg);
 }
 EXPORT_SYMBOL(omap_cfg_reg);
 #else
index a5aedf964b88042d6b74765ec3b5fb6cf548eb9b..a619475c4b769ab613c516920d61b5d853807d99 100644 (file)
@@ -33,6 +33,7 @@
 #include <asm/system.h>
 #include <asm/hardware.h>
 
+#include <asm/arch/control.h>
 #include <asm/arch/mux.h>
 #include <asm/arch/usb.h>
 #include <asm/arch/board.h>
@@ -76,7 +77,7 @@
 
 /*-------------------------------------------------------------------------*/
 
-#ifdef CONFIG_ARCH_OMAP_OTG
+#if    defined(CONFIG_ARCH_OMAP_OTG) || defined(CONFIG_USB_MUSB_OTG)
 
 static struct otg_transceiver *xceiv;
 
@@ -110,12 +111,48 @@ EXPORT_SYMBOL(otg_set_transceiver);
 
 #if defined(CONFIG_ARCH_OMAP_OTG) || defined(CONFIG_ARCH_OMAP15XX)
 
+static void omap2_usb_devconf_clear(u8 port, u32 mask)
+{
+       u32 r;
+
+       r = omap_ctrl_readl(OMAP2_CONTROL_DEVCONF0);
+       r &= ~USBTXWRMODEI(port, mask);
+       omap_ctrl_writel(r, OMAP2_CONTROL_DEVCONF0);
+}
+
+static void omap2_usb_devconf_set(u8 port, u32 mask)
+{
+       u32 r;
+
+       r = omap_ctrl_readl(OMAP2_CONTROL_DEVCONF0);
+       r |= USBTXWRMODEI(port, mask);
+       omap_ctrl_writel(r, OMAP2_CONTROL_DEVCONF0);
+}
+
+static void omap2_usb2_disable_5pinbitll(void)
+{
+       u32 r;
+
+       r = omap_ctrl_readl(OMAP2_CONTROL_DEVCONF0);
+       r &= ~(USBTXWRMODEI(2, USB_BIDIR_TLL) | USBT2TLL5PI);
+       omap_ctrl_writel(r, OMAP2_CONTROL_DEVCONF0);
+}
+
+static void omap2_usb2_enable_5pinunitll(void)
+{
+       u32 r;
+
+       r = omap_ctrl_readl(OMAP2_CONTROL_DEVCONF0);
+       r |= USBTXWRMODEI(2, USB_UNIDIR_TLL) | USBT2TLL5PI;
+       omap_ctrl_writel(r, OMAP2_CONTROL_DEVCONF0);
+}
+
 static u32 __init omap_usb0_init(unsigned nwires, unsigned is_device)
 {
        u32     syscon1 = 0;
 
        if (cpu_is_omap24xx())
-               CONTROL_DEVCONF_REG &= ~USBT0WRMODEI(USB_BIDIR_TLL);
+               omap2_usb_devconf_clear(0, USB_BIDIR_TLL);
 
        if (nwires == 0) {
                if (cpu_class_is_omap1() && !cpu_is_omap15xx()) {
@@ -187,19 +224,19 @@ static u32 __init omap_usb0_init(unsigned nwires, unsigned is_device)
        case 3:
                syscon1 = 2;
                if (cpu_is_omap24xx())
-                       CONTROL_DEVCONF_REG |= USBT0WRMODEI(USB_BIDIR);
+                       omap2_usb_devconf_set(0, USB_BIDIR);
                break;
        case 4:
                syscon1 = 1;
                if (cpu_is_omap24xx())
-                       CONTROL_DEVCONF_REG |= USBT0WRMODEI(USB_BIDIR);
+                       omap2_usb_devconf_set(0, USB_BIDIR);
                break;
        case 6:
                syscon1 = 3;
                if (cpu_is_omap24xx()) {
                        omap_cfg_reg(J19_24XX_USB0_VP);
                        omap_cfg_reg(K20_24XX_USB0_VM);
-                       CONTROL_DEVCONF_REG |= USBT0WRMODEI(USB_UNIDIR);
+                       omap2_usb_devconf_set(0, USB_UNIDIR);
                } else {
                        omap_cfg_reg(AA9_USB0_VP);
                        omap_cfg_reg(R9_USB0_VM);
@@ -220,7 +257,7 @@ static u32 __init omap_usb1_init(unsigned nwires)
        if (cpu_class_is_omap1() && !cpu_is_omap15xx() && nwires != 6)
                USB_TRANSCEIVER_CTRL_REG &= ~CONF_USB1_UNI_R;
        if (cpu_is_omap24xx())
-               CONTROL_DEVCONF_REG &= ~USBT1WRMODEI(USB_BIDIR_TLL);
+               omap2_usb_devconf_clear(1, USB_BIDIR_TLL);
 
        if (nwires == 0)
                return 0;
@@ -261,17 +298,17 @@ static u32 __init omap_usb1_init(unsigned nwires)
                 * this TLL link is not using DP/DM
                 */
                syscon1 = 1;
-               CONTROL_DEVCONF_REG |= USBT1WRMODEI(USB_BIDIR_TLL);
+               omap2_usb_devconf_set(1, USB_BIDIR_TLL);
                break;
        case 3:
                syscon1 = 2;
                if (cpu_is_omap24xx())
-                       CONTROL_DEVCONF_REG |= USBT1WRMODEI(USB_BIDIR);
+                       omap2_usb_devconf_set(1, USB_BIDIR);
                break;
        case 4:
                syscon1 = 1;
                if (cpu_is_omap24xx())
-                       CONTROL_DEVCONF_REG |= USBT1WRMODEI(USB_BIDIR);
+                       omap2_usb_devconf_set(1, USB_BIDIR);
                break;
        case 6:
                if (cpu_is_omap24xx())
@@ -295,8 +332,7 @@ static u32 __init omap_usb2_init(unsigned nwires, unsigned alt_pingroup)
        u32     syscon1 = 0;
 
        if (cpu_is_omap24xx()) {
-               CONTROL_DEVCONF_REG &= ~(USBT2WRMODEI(USB_BIDIR_TLL)
-                                       | USBT2TLL5PI);
+               omap2_usb2_disable_5pinbitll();
                alt_pingroup = 0;
        }
 
@@ -343,17 +379,17 @@ static u32 __init omap_usb2_init(unsigned nwires, unsigned alt_pingroup)
                 * this TLL link is not using DP/DM
                 */
                syscon1 = 1;
-               CONTROL_DEVCONF_REG |= USBT2WRMODEI(USB_BIDIR_TLL);
+               omap2_usb_devconf_set(2, USB_BIDIR_TLL);
                break;
        case 3:
                syscon1 = 2;
                if (cpu_is_omap24xx())
-                       CONTROL_DEVCONF_REG |= USBT2WRMODEI(USB_BIDIR);
+                       omap2_usb_devconf_set(2, USB_BIDIR);
                break;
        case 4:
                syscon1 = 1;
                if (cpu_is_omap24xx())
-                       CONTROL_DEVCONF_REG |= USBT2WRMODEI(USB_BIDIR);
+                       omap2_usb_devconf_set(2, USB_BIDIR);
                break;
        case 5:
                if (!cpu_is_omap24xx())
@@ -364,8 +400,7 @@ static u32 __init omap_usb2_init(unsigned nwires, unsigned alt_pingroup)
                 * set up OTG_SYSCON2.HMC_TLL{ATTACH,SPEED}
                 */
                syscon1 = 3;
-               CONTROL_DEVCONF_REG |= USBT2WRMODEI(USB_UNIDIR_TLL)
-                                       | USBT2TLL5PI;
+               omap2_usb2_enable_5pinunitll();
                break;
        case 6:
                if (cpu_is_omap24xx())
diff --git a/arch/arm/plat-orion/Makefile b/arch/arm/plat-orion/Makefile
new file mode 100644 (file)
index 0000000..198f3dd
--- /dev/null
@@ -0,0 +1,8 @@
+#
+# Makefile for the linux kernel.
+#
+
+obj-y  := irq.o pcie.o time.o
+obj-m  :=
+obj-n  :=
+obj-   :=
diff --git a/arch/arm/plat-orion/irq.c b/arch/arm/plat-orion/irq.c
new file mode 100644 (file)
index 0000000..c5b669d
--- /dev/null
@@ -0,0 +1,64 @@
+/*
+ * arch/arm/plat-orion/irq.c
+ *
+ * Marvell Orion SoC IRQ handling.
+ *
+ * This file is licensed under the terms of the GNU General Public
+ * License version 2.  This program is licensed "as is" without any
+ * warranty of any kind, whether express or implied.
+ */
+
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/irq.h>
+#include <linux/io.h>
+#include <asm/plat-orion/irq.h>
+
+static void orion_irq_mask(u32 irq)
+{
+       void __iomem *maskaddr = get_irq_chip_data(irq);
+       u32 mask;
+
+       mask = readl(maskaddr);
+       mask &= ~(1 << (irq & 31));
+       writel(mask, maskaddr);
+}
+
+static void orion_irq_unmask(u32 irq)
+{
+       void __iomem *maskaddr = get_irq_chip_data(irq);
+       u32 mask;
+
+       mask = readl(maskaddr);
+       mask |= 1 << (irq & 31);
+       writel(mask, maskaddr);
+}
+
+static struct irq_chip orion_irq_chip = {
+       .name           = "orion_irq",
+       .ack            = orion_irq_mask,
+       .mask           = orion_irq_mask,
+       .unmask         = orion_irq_unmask,
+};
+
+void __init orion_irq_init(unsigned int irq_start, void __iomem *maskaddr)
+{
+       unsigned int i;
+
+       /*
+        * Mask all interrupts initially.
+        */
+       writel(0, maskaddr);
+
+       /*
+        * Register IRQ sources.
+        */
+       for (i = 0; i < 32; i++) {
+               unsigned int irq = irq_start + i;
+
+               set_irq_chip(irq, &orion_irq_chip);
+               set_irq_chip_data(irq, maskaddr);
+               set_irq_handler(irq, handle_level_irq);
+               set_irq_flags(irq, IRQF_VALID);
+       }
+}
diff --git a/arch/arm/plat-orion/pcie.c b/arch/arm/plat-orion/pcie.c
new file mode 100644 (file)
index 0000000..abfda53
--- /dev/null
@@ -0,0 +1,245 @@
+/*
+ * arch/arm/plat-orion/pcie.c
+ *
+ * Marvell Orion SoC PCIe handling.
+ *
+ * This file is licensed under the terms of the GNU General Public
+ * License version 2.  This program is licensed "as is" without any
+ * warranty of any kind, whether express or implied.
+ */
+
+#include <linux/kernel.h>
+#include <linux/pci.h>
+#include <linux/mbus.h>
+#include <asm/mach/pci.h>
+#include <asm/plat-orion/pcie.h>
+
+/*
+ * PCIe unit register offsets.
+ */
+#define PCIE_DEV_ID_OFF                0x0000
+#define PCIE_CMD_OFF           0x0004
+#define PCIE_DEV_REV_OFF       0x0008
+#define PCIE_BAR_LO_OFF(n)     (0x0010 + ((n) << 3))
+#define PCIE_BAR_HI_OFF(n)     (0x0014 + ((n) << 3))
+#define PCIE_HEADER_LOG_4_OFF  0x0128
+#define PCIE_BAR_CTRL_OFF(n)   (0x1804 + ((n - 1) * 4))
+#define PCIE_WIN04_CTRL_OFF(n) (0x1820 + ((n) << 4))
+#define PCIE_WIN04_BASE_OFF(n) (0x1824 + ((n) << 4))
+#define PCIE_WIN04_REMAP_OFF(n)        (0x182c + ((n) << 4))
+#define PCIE_WIN5_CTRL_OFF     0x1880
+#define PCIE_WIN5_BASE_OFF     0x1884
+#define PCIE_WIN5_REMAP_OFF    0x188c
+#define PCIE_CONF_ADDR_OFF     0x18f8
+#define  PCIE_CONF_ADDR_EN             0x80000000
+#define  PCIE_CONF_REG(r)              ((((r) & 0xf00) << 16) | ((r) & 0xfc))
+#define  PCIE_CONF_BUS(b)              (((b) & 0xff) << 16)
+#define  PCIE_CONF_DEV(d)              (((d) & 0x1f) << 11)
+#define  PCIE_CONF_FUNC(f)             (((f) & 0x3) << 8)
+#define PCIE_CONF_DATA_OFF     0x18fc
+#define PCIE_MASK_OFF          0x1910
+#define PCIE_CTRL_OFF          0x1a00
+#define PCIE_STAT_OFF          0x1a04
+#define  PCIE_STAT_DEV_OFFS            20
+#define  PCIE_STAT_DEV_MASK            0x1f
+#define  PCIE_STAT_BUS_OFFS            8
+#define  PCIE_STAT_BUS_MASK            0xff
+#define  PCIE_STAT_LINK_DOWN           1
+
+
+u32 __init orion_pcie_dev_id(void __iomem *base)
+{
+       return readl(base + PCIE_DEV_ID_OFF) >> 16;
+}
+
+u32 __init orion_pcie_rev(void __iomem *base)
+{
+       return readl(base + PCIE_DEV_REV_OFF) & 0xff;
+}
+
+int orion_pcie_link_up(void __iomem *base)
+{
+       return !(readl(base + PCIE_STAT_OFF) & PCIE_STAT_LINK_DOWN);
+}
+
+int orion_pcie_get_local_bus_nr(void __iomem *base)
+{
+       u32 stat = readl(base + PCIE_STAT_OFF);
+
+       return (stat >> PCIE_STAT_BUS_OFFS) & PCIE_STAT_BUS_MASK;
+}
+
+void __init orion_pcie_set_local_bus_nr(void __iomem *base, int nr)
+{
+       u32 stat;
+
+       stat = readl(base + PCIE_STAT_OFF);
+       stat &= ~(PCIE_STAT_BUS_MASK << PCIE_STAT_BUS_OFFS);
+       stat |= nr << PCIE_STAT_BUS_OFFS;
+       writel(stat, base + PCIE_STAT_OFF);
+}
+
+/*
+ * Setup PCIE BARs and Address Decode Wins:
+ * BAR[0,2] -> disabled, BAR[1] -> covers all DRAM banks
+ * WIN[0-3] -> DRAM bank[0-3]
+ */
+static void __init orion_pcie_setup_wins(void __iomem *base,
+                                        struct mbus_dram_target_info *dram)
+{
+       u32 size;
+       int i;
+
+       /*
+        * First, disable and clear BARs and windows.
+        */
+       for (i = 1; i <= 2; i++) {
+               writel(0, base + PCIE_BAR_CTRL_OFF(i));
+               writel(0, base + PCIE_BAR_LO_OFF(i));
+               writel(0, base + PCIE_BAR_HI_OFF(i));
+       }
+
+       for (i = 0; i < 5; i++) {
+               writel(0, base + PCIE_WIN04_CTRL_OFF(i));
+               writel(0, base + PCIE_WIN04_BASE_OFF(i));
+               writel(0, base + PCIE_WIN04_REMAP_OFF(i));
+       }
+
+       writel(0, base + PCIE_WIN5_CTRL_OFF);
+       writel(0, base + PCIE_WIN5_BASE_OFF);
+       writel(0, base + PCIE_WIN5_REMAP_OFF);
+
+       /*
+        * Setup windows for DDR banks.  Count total DDR size on the fly.
+        */
+       size = 0;
+       for (i = 0; i < dram->num_cs; i++) {
+               struct mbus_dram_window *cs = dram->cs + i;
+
+               writel(cs->base & 0xffff0000, base + PCIE_WIN04_BASE_OFF(i));
+               writel(0, base + PCIE_WIN04_REMAP_OFF(i));
+               writel(((cs->size - 1) & 0xffff0000) |
+                       (cs->mbus_attr << 8) |
+                       (dram->mbus_dram_target_id << 4) | 1,
+                               base + PCIE_WIN04_CTRL_OFF(i));
+
+               size += cs->size;
+       }
+
+       /*
+        * Setup BAR[1] to all DRAM banks.
+        */
+       writel(dram->cs[0].base, base + PCIE_BAR_LO_OFF(1));
+       writel(0, base + PCIE_BAR_HI_OFF(1));
+       writel(((size - 1) & 0xffff0000) | 1, base + PCIE_BAR_CTRL_OFF(1));
+}
+
+void __init orion_pcie_setup(void __iomem *base,
+                            struct mbus_dram_target_info *dram)
+{
+       u16 cmd;
+       u32 mask;
+
+       /*
+        * Point PCIe unit MBUS decode windows to DRAM space.
+        */
+       orion_pcie_setup_wins(base, dram);
+
+       /*
+        * Master + slave enable.
+        */
+       cmd = readw(base + PCIE_CMD_OFF);
+       cmd |= PCI_COMMAND_IO;
+       cmd |= PCI_COMMAND_MEMORY;
+       cmd |= PCI_COMMAND_MASTER;
+       writew(cmd, base + PCIE_CMD_OFF);
+
+       /*
+        * Enable interrupt lines A-D.
+        */
+       mask = readl(base + PCIE_MASK_OFF);
+       mask |= 0x0f000000;
+       writel(mask, base + PCIE_MASK_OFF);
+}
+
+int orion_pcie_rd_conf(void __iomem *base, struct pci_bus *bus,
+                      u32 devfn, int where, int size, u32 *val)
+{
+       writel(PCIE_CONF_BUS(bus->number) |
+               PCIE_CONF_DEV(PCI_SLOT(devfn)) |
+               PCIE_CONF_FUNC(PCI_FUNC(devfn)) |
+               PCIE_CONF_REG(where) | PCIE_CONF_ADDR_EN,
+                       base + PCIE_CONF_ADDR_OFF);
+
+       *val = readl(base + PCIE_CONF_DATA_OFF);
+
+       if (size == 1)
+               *val = (*val >> (8 * (where & 3))) & 0xff;
+       else if (size == 2)
+               *val = (*val >> (8 * (where & 3))) & 0xffff;
+
+       return PCIBIOS_SUCCESSFUL;
+}
+
+int orion_pcie_rd_conf_tlp(void __iomem *base, struct pci_bus *bus,
+                          u32 devfn, int where, int size, u32 *val)
+{
+       writel(PCIE_CONF_BUS(bus->number) |
+               PCIE_CONF_DEV(PCI_SLOT(devfn)) |
+               PCIE_CONF_FUNC(PCI_FUNC(devfn)) |
+               PCIE_CONF_REG(where) | PCIE_CONF_ADDR_EN,
+                       base + PCIE_CONF_ADDR_OFF);
+
+       *val = readl(base + PCIE_CONF_DATA_OFF);
+
+       if (bus->number != orion_pcie_get_local_bus_nr(base) ||
+           PCI_FUNC(devfn) != 0)
+               *val = readl(base + PCIE_HEADER_LOG_4_OFF);
+
+       if (size == 1)
+               *val = (*val >> (8 * (where & 3))) & 0xff;
+       else if (size == 2)
+               *val = (*val >> (8 * (where & 3))) & 0xffff;
+
+       return PCIBIOS_SUCCESSFUL;
+}
+
+int orion_pcie_rd_conf_wa(void __iomem *wa_base, struct pci_bus *bus,
+                         u32 devfn, int where, int size, u32 *val)
+{
+       *val = readl(wa_base + (PCIE_CONF_BUS(bus->number) |
+                               PCIE_CONF_DEV(PCI_SLOT(devfn)) |
+                               PCIE_CONF_FUNC(PCI_FUNC(devfn)) |
+                               PCIE_CONF_REG(where)));
+
+       if (size == 1)
+               *val = (*val >> (8 * (where & 3))) & 0xff;
+       else if (size == 2)
+               *val = (*val >> (8 * (where & 3))) & 0xffff;
+
+       return PCIBIOS_SUCCESSFUL;
+}
+
+int orion_pcie_wr_conf(void __iomem *base, struct pci_bus *bus,
+                      u32 devfn, int where, int size, u32 val)
+{
+       int ret = PCIBIOS_SUCCESSFUL;
+
+       writel(PCIE_CONF_BUS(bus->number) |
+               PCIE_CONF_DEV(PCI_SLOT(devfn)) |
+               PCIE_CONF_FUNC(PCI_FUNC(devfn)) |
+               PCIE_CONF_REG(where) | PCIE_CONF_ADDR_EN,
+                       base + PCIE_CONF_ADDR_OFF);
+
+       if (size == 4) {
+               writel(val, base + PCIE_CONF_DATA_OFF);
+       } else if (size == 2) {
+               writew(val, base + PCIE_CONF_DATA_OFF + (where & 3));
+       } else if (size == 1) {
+               writeb(val, base + PCIE_CONF_DATA_OFF + (where & 3));
+       } else {
+               ret = PCIBIOS_BAD_REGISTER_NUMBER;
+       }
+
+       return ret;
+}
diff --git a/arch/arm/plat-orion/time.c b/arch/arm/plat-orion/time.c
new file mode 100644 (file)
index 0000000..28b5285
--- /dev/null
@@ -0,0 +1,203 @@
+/*
+ * arch/arm/plat-orion/time.c
+ *
+ * Marvell Orion SoC timer handling.
+ *
+ * This file is licensed under the terms of the GNU General Public
+ * License version 2.  This program is licensed "as is" without any
+ * warranty of any kind, whether express or implied.
+ *
+ * Timer 0 is used as free-running clocksource, while timer 1 is
+ * used as clock_event_device.
+ */
+
+#include <linux/kernel.h>
+#include <linux/clockchips.h>
+#include <linux/interrupt.h>
+#include <linux/irq.h>
+#include <asm/mach/time.h>
+#include <asm/arch/hardware.h>
+
+/*
+ * Number of timer ticks per jiffy.
+ */
+static u32 ticks_per_jiffy;
+
+
+/*
+ * Timer block registers.
+ */
+#define TIMER_CTRL             (TIMER_VIRT_BASE + 0x0000)
+#define  TIMER0_EN             0x0001
+#define  TIMER0_RELOAD_EN      0x0002
+#define  TIMER1_EN             0x0004
+#define  TIMER1_RELOAD_EN      0x0008
+#define TIMER0_RELOAD          (TIMER_VIRT_BASE + 0x0010)
+#define TIMER0_VAL             (TIMER_VIRT_BASE + 0x0014)
+#define TIMER1_RELOAD          (TIMER_VIRT_BASE + 0x0018)
+#define TIMER1_VAL             (TIMER_VIRT_BASE + 0x001c)
+
+
+/*
+ * Clocksource handling.
+ */
+static cycle_t orion_clksrc_read(void)
+{
+       return 0xffffffff - readl(TIMER0_VAL);
+}
+
+static struct clocksource orion_clksrc = {
+       .name           = "orion_clocksource",
+       .shift          = 20,
+       .rating         = 300,
+       .read           = orion_clksrc_read,
+       .mask           = CLOCKSOURCE_MASK(32),
+       .flags          = CLOCK_SOURCE_IS_CONTINUOUS,
+};
+
+
+
+/*
+ * Clockevent handling.
+ */
+static int
+orion_clkevt_next_event(unsigned long delta, struct clock_event_device *dev)
+{
+       unsigned long flags;
+       u32 u;
+
+       if (delta == 0)
+               return -ETIME;
+
+       local_irq_save(flags);
+
+       /*
+        * Clear and enable clockevent timer interrupt.
+        */
+       writel(~BRIDGE_INT_TIMER1, BRIDGE_CAUSE);
+
+       u = readl(BRIDGE_MASK);
+       u |= BRIDGE_INT_TIMER1;
+       writel(u, BRIDGE_MASK);
+
+       /*
+        * Setup new clockevent timer value.
+        */
+       writel(delta, TIMER1_VAL);
+
+       /*
+        * Enable the timer.
+        */
+       u = readl(TIMER_CTRL);
+       u = (u & ~TIMER1_RELOAD_EN) | TIMER1_EN;
+       writel(u, TIMER_CTRL);
+
+       local_irq_restore(flags);
+
+       return 0;
+}
+
+static void
+orion_clkevt_mode(enum clock_event_mode mode, struct clock_event_device *dev)
+{
+       unsigned long flags;
+       u32 u;
+
+       local_irq_save(flags);
+       if (mode == CLOCK_EVT_MODE_PERIODIC) {
+               /*
+                * Setup timer to fire at 1/HZ intervals.
+                */
+               writel(ticks_per_jiffy - 1, TIMER1_RELOAD);
+               writel(ticks_per_jiffy - 1, TIMER1_VAL);
+
+               /*
+                * Enable timer interrupt.
+                */
+               u = readl(BRIDGE_MASK);
+               writel(u | BRIDGE_INT_TIMER1, BRIDGE_MASK);
+
+               /*
+                * Enable timer.
+                */
+               u = readl(TIMER_CTRL);
+               writel(u | TIMER1_EN | TIMER1_RELOAD_EN, TIMER_CTRL);
+       } else {
+               /*
+                * Disable timer.
+                */
+               u = readl(TIMER_CTRL);
+               writel(u & ~TIMER1_EN, TIMER_CTRL);
+
+               /*
+                * Disable timer interrupt.
+                */
+               u = readl(BRIDGE_MASK);
+               writel(u & ~BRIDGE_INT_TIMER1, BRIDGE_MASK);
+
+               /*
+                * ACK pending timer interrupt.
+                */
+               writel(~BRIDGE_INT_TIMER1, BRIDGE_CAUSE);
+
+       }
+       local_irq_restore(flags);
+}
+
+static struct clock_event_device orion_clkevt = {
+       .name           = "orion_tick",
+       .features       = CLOCK_EVT_FEAT_ONESHOT | CLOCK_EVT_FEAT_PERIODIC,
+       .shift          = 32,
+       .rating         = 300,
+       .cpumask        = CPU_MASK_CPU0,
+       .set_next_event = orion_clkevt_next_event,
+       .set_mode       = orion_clkevt_mode,
+};
+
+static irqreturn_t orion_timer_interrupt(int irq, void *dev_id)
+{
+       /*
+        * ACK timer interrupt and call event handler.
+        */
+       writel(~BRIDGE_INT_TIMER1, BRIDGE_CAUSE);
+       orion_clkevt.event_handler(&orion_clkevt);
+
+       return IRQ_HANDLED;
+}
+
+static struct irqaction orion_timer_irq = {
+       .name           = "orion_tick",
+       .flags          = IRQF_DISABLED | IRQF_TIMER,
+       .handler        = orion_timer_interrupt
+};
+
+void __init orion_time_init(unsigned int irq, unsigned int tclk)
+{
+       u32 u;
+
+       ticks_per_jiffy = (tclk + HZ/2) / HZ;
+
+
+       /*
+        * Setup free-running clocksource timer (interrupts
+        * disabled.)
+        */
+       writel(0xffffffff, TIMER0_VAL);
+       writel(0xffffffff, TIMER0_RELOAD);
+       u = readl(BRIDGE_MASK);
+       writel(u & ~BRIDGE_INT_TIMER0, BRIDGE_MASK);
+       u = readl(TIMER_CTRL);
+       writel(u | TIMER0_EN | TIMER0_RELOAD_EN, TIMER_CTRL);
+       orion_clksrc.mult = clocksource_hz2mult(tclk, orion_clksrc.shift);
+       clocksource_register(&orion_clksrc);
+
+
+       /*
+        * Setup clockevent timer (interrupt-driven.)
+        */
+       setup_irq(irq, &orion_timer_irq);
+       orion_clkevt.mult = div_sc(tclk, NSEC_PER_SEC, orion_clkevt.shift);
+       orion_clkevt.max_delta_ns = clockevent_delta2ns(0xfffffffe, &orion_clkevt);
+       orion_clkevt.min_delta_ns = clockevent_delta2ns(1, &orion_clkevt);
+       clockevents_register_device(&orion_clkevt);
+}
index 99a44746f8f27f89fb4943197a1d6b55b1a259c8..d84167fb33b1fa69df54602a925ffc2f573ed008 100644 (file)
@@ -332,6 +332,58 @@ static int s3c24xx_dclk_setparent(struct clk *clk, struct clk *parent)
        return 0;
 }
 
+static unsigned long s3c24xx_calc_div(struct clk *clk, unsigned long rate)
+{
+       unsigned long div;
+
+       if ((rate == 0) || !clk->parent)
+               return 0;
+
+       div = clk_get_rate(clk->parent) / rate;
+       if (div < 2)
+               div = 2;
+       else if (div > 16)
+               div = 16;
+
+       return div;
+}
+
+static unsigned long s3c24xx_round_dclk_rate(struct clk *clk,
+       unsigned long rate)
+{
+       unsigned long div = s3c24xx_calc_div(clk, rate);
+
+       if (div == 0)
+               return 0;
+
+       return clk_get_rate(clk->parent) / div;
+}
+
+static int s3c24xx_set_dclk_rate(struct clk *clk, unsigned long rate)
+{
+       unsigned long mask, data, div = s3c24xx_calc_div(clk, rate);
+
+       if (div == 0)
+               return -EINVAL;
+
+       if (clk == &s3c24xx_dclk0) {
+               mask = S3C2410_DCLKCON_DCLK0_DIV_MASK |
+                       S3C2410_DCLKCON_DCLK0_CMP_MASK;
+               data = S3C2410_DCLKCON_DCLK0_DIV(div) |
+                       S3C2410_DCLKCON_DCLK0_CMP((div + 1) / 2);
+       } else if (clk == &s3c24xx_dclk1) {
+               mask = S3C2410_DCLKCON_DCLK1_DIV_MASK |
+                       S3C2410_DCLKCON_DCLK1_CMP_MASK;
+               data = S3C2410_DCLKCON_DCLK1_DIV(div) |
+                       S3C2410_DCLKCON_DCLK1_CMP((div + 1) / 2);
+       } else
+               return -EINVAL;
+
+       clk->rate = clk_get_rate(clk->parent) / div;
+       __raw_writel(((__raw_readl(S3C24XX_DCLKCON) & ~mask) | data),
+               S3C24XX_DCLKCON);
+       return clk->rate;
+}
 
 static int s3c24xx_clkout_setparent(struct clk *clk, struct clk *parent)
 {
@@ -378,6 +430,8 @@ struct clk s3c24xx_dclk0 = {
        .ctrlbit        = S3C2410_DCLKCON_DCLK0EN,
        .enable         = s3c24xx_dclk_enable,
        .set_parent     = s3c24xx_dclk_setparent,
+       .set_rate       = s3c24xx_set_dclk_rate,
+       .round_rate     = s3c24xx_round_dclk_rate,
 };
 
 struct clk s3c24xx_dclk1 = {
@@ -386,6 +440,8 @@ struct clk s3c24xx_dclk1 = {
        .ctrlbit        = S3C2410_DCLKCON_DCLK0EN,
        .enable         = s3c24xx_dclk_enable,
        .set_parent     = s3c24xx_dclk_setparent,
+       .set_rate       = s3c24xx_set_dclk_rate,
+       .round_rate     = s3c24xx_round_dclk_rate,
 };
 
 struct clk s3c24xx_clkout0 = {
index f513ab083b8f24c9106253b65c8fc185237cfad3..f5699cadb0c3737557b2ab2d66b0ac2f08fdb4a1 100644 (file)
 #include <linux/ioport.h>
 #include <linux/serial_core.h>
 #include <linux/platform_device.h>
+#include <linux/delay.h>
 
 #include <asm/hardware.h>
 #include <asm/irq.h>
 #include <asm/io.h>
 #include <asm/delay.h>
+#include <asm/cacheflush.h>
 
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
 
+#include <asm/arch/system-reset.h>
+
 #include <asm/arch/regs-gpio.h>
 #include <asm/plat-s3c/regs-serial.h>
 
@@ -203,6 +207,27 @@ static unsigned long s3c24xx_read_idcode_v4(void)
 #endif
 }
 
+/* Hook for arm_pm_restart to ensure we execute the reset code
+ * with the caches enabled. It seems at least the S3C2440 has a problem
+ * resetting if there is bus activity interrupted by the reset.
+ */
+static void s3c24xx_pm_restart(char mode)
+{
+       if (mode != 's') {
+               unsigned long flags;
+
+               local_irq_save(flags);
+               __cpuc_flush_kern_all();
+               __cpuc_flush_user_all();
+
+               arch_reset(mode);
+               local_irq_restore(flags);
+       }
+
+       /* fallback, or unhandled */
+       arm_machine_restart(mode);
+}
+
 void __init s3c24xx_init_io(struct map_desc *mach_desc, int size)
 {
        unsigned long idcode = 0x0;
@@ -230,6 +255,8 @@ void __init s3c24xx_init_io(struct map_desc *mach_desc, int size)
                panic("Unsupported S3C24XX CPU");
        }
 
+       arm_pm_restart = s3c24xx_pm_restart;
+
        (cpu->map_io)(mach_desc, size);
 }
 
index 7ed58c0c24c200ec7093d17d5c4528695b07f9cf..207a8b5a0c4a006c2853a78a646310bccef7d884 100644 (file)
@@ -12,7 +12,7 @@
 #
 #   http://www.arm.linux.org.uk/developer/machines/?action=new
 #
-# Last update: Sat Jan 26 14:45:34 2008
+# Last update: Sat Apr 19 11:23:38 2008
 #
 # machine_is_xxx       CONFIG_xxxx             MACH_TYPE_xxx           number
 #
@@ -381,13 +381,13 @@ ks8695p                   ARCH_KS8695P            KS8695P                 363
 se4000                 ARCH_SE4000             SE4000                  364
 quadriceps             ARCH_QUADRICEPS         QUADRICEPS              365
 bronco                 ARCH_BRONCO             BRONCO                  366
-esl_wireless_tab       ARCH_ESL_WIRELESS_TABLETESL_WIRELESS_TABLET     367
+esl_wireless_tab       ARCH_ESL_WIRELESS_TAB   ESL_WIRELESS_TAB        367
 esl_sofcomp            ARCH_ESL_SOFCOMP        ESL_SOFCOMP             368
 s5c7375                        ARCH_S5C7375            S5C7375                 369
 spearhead              ARCH_SPEARHEAD          SPEARHEAD               370
 pantera                        ARCH_PANTERA            PANTERA                 371
 prayoglite             ARCH_PRAYOGLITE         PRAYOGLITE              372
-gumstix                        ARCH_GUMSTIK            GUMSTIK                 373
+gumstix                        ARCH_GUMSTIX            GUMSTIX                 373
 rcube                  ARCH_RCUBE              RCUBE                   374
 rea_olv                        ARCH_REA_OLV            REA_OLV                 375
 pxa_iphone             ARCH_PXA_IPHONE         PXA_IPHONE              376
@@ -1463,7 +1463,7 @@ artemis                   MACH_ARTEMIS            ARTEMIS                 1462
 htctitan               MACH_HTCTITAN           HTCTITAN                1463
 qranium                        MACH_QRANIUM            QRANIUM                 1464
 adx_wsc2               MACH_ADX_WSC2           ADX_WSC2                1465
-adx_medinet            MACH_ADX_MEDINET        ADX_MEDINET             1466
+adx_medcom             MACH_ADX_MEDINET        ADX_MEDINET             1466
 bboard                 MACH_BBOARD             BBOARD                  1467
 cambria                        MACH_CAMBRIA            CAMBRIA                 1468
 mt7xxx                 MACH_MT7XXX             MT7XXX                  1469
@@ -1611,3 +1611,112 @@ kb9263                  MACH_KB9263             KB9263                  1612
 mt7108                 MACH_MT7108             MT7108                  1613
 smtr2440               MACH_SMTR2440           SMTR2440                1614
 manao                  MACH_MANAO              MANAO                   1615
+cm_x300                        MACH_CM_X300            CM_X300                 1616
+gulfstream_kp          MACH_GULFSTREAM_KP      GULFSTREAM_KP           1617
+lanreadyfn522          MACH_LANREADYFN522      LANREADYFN522           1618
+arma37                 MACH_ARMA37             ARMA37                  1619
+mendel                 MACH_MENDEL             MENDEL                  1620
+pelco_iliad            MACH_PELCO_ILIAD        PELCO_ILIAD             1621
+unit2p                 MACH_UNIT2P             UNIT2P                  1622
+inc20otter             MACH_INC20OTTER         INC20OTTER              1623
+at91sam9g20ek          MACH_AT91SAM9G20EK      AT91SAM9G20EK           1624
+sc_ge2                 MACH_STORCENTER         STORCENTER              1625
+smdk6410               MACH_SMDK6410           SMDK6410                1626
+u300                   MACH_U300               U300                    1627
+u500                   MACH_U500               U500                    1628
+ds9260                 MACH_DS9260             DS9260                  1629
+riverrock              MACH_RIVERROCK          RIVERROCK               1630
+scibath                        MACH_SCIBATH            SCIBATH                 1631
+at91sam7se             MACH_AT91SAM7SE512EK    AT91SAM7SE512EK         1632
+wrt350n_v2             MACH_WRT350N_V2         WRT350N_V2              1633
+multimedia             MACH_MULTIMEDIA         MULTIMEDIA              1634
+marvin                 MACH_MARVIN             MARVIN                  1635
+x500                   MACH_X500               X500                    1636
+awlug4lcu              MACH_AWLUG4LCU          AWLUG4LCU               1637
+palermoc               MACH_PALERMOC           PALERMOC                1638
+omap_ldp               MACH_OMAP_LDP           OMAP_LDP                1639
+ip500                  MACH_IP500              IP500                   1640
+mx35ads                        MACH_MACH_MX35ADS       MACH_MX35ADS            1641
+ase2                   MACH_ASE2               ASE2                    1642
+mx35evb                        MACH_MX35EVB            MX35EVB                 1643
+aml_m8050              MACH_AML_M8050          AML_M8050               1644
+mx35_3ds               MACH_MX35_3DS           MX35_3DS                1645
+mars                   MACH_MARS               MARS                    1646
+ntosd_644xa            MACH_NTOSD_644XA        NTOSD_644XA             1647
+badger                 MACH_BADGER             BADGER                  1648
+trizeps4wl             MACH_TRIZEPS4WL         TRIZEPS4WL              1649
+trizeps5               MACH_TRIZEPS5           TRIZEPS5                1650
+marlin                 MACH_MARLIN             MARLIN                  1651
+ts7800                 MACH_TS7800             TS7800                  1652
+hpipaq214              MACH_HPIPAQ214          HPIPAQ214               1653
+at572d940dcm           MACH_AT572D940DCM       AT572D940DCM            1654
+ne1board               MACH_NE1BOARD           NE1BOARD                1655
+zante                  MACH_ZANTE              ZANTE                   1656
+sffsdr                 MACH_SFFSDR             SFFSDR                  1657
+tw2662                 MACH_TW2662             TW2662                  1658
+vf10xx                 MACH_VF10XX             VF10XX                  1659
+zoran43xx              MACH_ZORAN43XX          ZORAN43XX               1660
+sonix926               MACH_SONIX926           SONIX926                1661
+celestialsemi          MACH_CELESTIALSEMI      CELESTIALSEMI           1662
+cc9m2443               MACH_CC9M2443           CC9M2443                1663
+tw5334                 MACH_TW5334             TW5334                  1664
+omap_htcartemis                MACH_HTCARTEMIS         HTCARTEMIS              1665
+nal_hlite              MACH_NAL_HLITE          NAL_HLITE               1666
+htcvogue               MACH_HTCVOGUE           HTCVOGUE                1667
+smartweb               MACH_SMARTWEB           SMARTWEB                1668
+mv86xx                 MACH_MV86XX             MV86XX                  1669
+mv87xx                 MACH_MV87XX             MV87XX                  1670
+songyoungho            MACH_SONGYOUNGHO        SONGYOUNGHO             1671
+younghotema            MACH_YOUNGHOTEMA        YOUNGHOTEMA             1672
+pcm037                 MACH_PCM037             PCM037                  1673
+mmvp                   MACH_MMVP               MMVP                    1674
+mmap                   MACH_MMAP               MMAP                    1675
+ptid2410               MACH_PTID2410           PTID2410                1676
+james_926              MACH_JAMES_926          JAMES_926               1677
+fm6000                 MACH_FM6000             FM6000                  1678
+db88f6281_bp           MACH_DB88F6281_BP       DB88F6281_BP            1680
+rd88f6192_nas          MACH_RD88F6192_NAS      RD88F6192_NAS           1681
+rd88f6281              MACH_RD88F6281          RD88F6281               1682
+db78x00_bp             MACH_DB78X00_BP         DB78X00_BP              1683
+smdk2416               MACH_SMDK2416           SMDK2416                1685
+oce_spider_si          MACH_OCE_SPIDER_SI      OCE_SPIDER_SI           1686
+oce_spider_sk          MACH_OCE_SPIDER_SK      OCE_SPIDER_SK           1687
+rovern6                        MACH_ROVERN6            ROVERN6                 1688
+pelco_evolution                MACH_PELCO_EVOLUTION    PELCO_EVOLUTION         1689
+wbd111                 MACH_WBD111             WBD111                  1690
+elaracpe               MACH_ELARACPE           ELARACPE                1691
+mabv3                  MACH_MABV3              MABV3                   1692
+mv2120                 MACH_MV2120             MV2120                  1693
+csb737                 MACH_CSB737             CSB737                  1695
+mx51_3ds               MACH_MX51_3DS           MX51_3DS                1696
+g900                   MACH_G900               G900                    1697
+apf27                  MACH_APF27              APF27                   1698
+ggus2000               MACH_GGUS2000           GGUS2000                1699
+omap_2430_mimic                MACH_OMAP_2430_MIMIC    OMAP_2430_MIMIC         1700
+imx27lite              MACH_IMX27LITE          IMX27LITE               1701
+almex                  MACH_ALMEX              ALMEX                   1702
+control                        MACH_CONTROL            CONTROL                 1703
+mba2410                        MACH_MBA2410            MBA2410                 1704
+volcano                        MACH_VOLCANO            VOLCANO                 1705
+zenith                 MACH_ZENITH             ZENITH                  1706
+muchip                 MACH_MUCHIP             MUCHIP                  1707
+magellan               MACH_MAGELLAN           MAGELLAN                1708
+usb_a9260              MACH_USB_A9260          USB_A9260               1709
+usb_a9263              MACH_USB_A9263          USB_A9263               1710
+qil_a9260              MACH_QIL_A9260          QIL_A9260               1711
+cme9210                        MACH_CME9210            CME9210                 1712
+hczh4                  MACH_HCZH4              HCZH4                   1713
+spearbasic             MACH_SPEARBASIC         SPEARBASIC              1714
+dep2440                        MACH_DEP2440            DEP2440                 1715
+hdl_gxr                        MACH_HDL_GXR            HDL_GXR                 1716
+hdl_gt                 MACH_HDL_GT             HDL_GT                  1717
+hdl_4g                 MACH_HDL_4G             HDL_4G                  1718
+s3c6000                        MACH_S3C6000            S3C6000                 1719
+mmsp2_mdk              MACH_MMSP2_MDK          MMSP2_MDK               1720
+mpx220                 MACH_MPX220             MPX220                  1721
+kzm_arm11_01           MACH_KZM_ARM11_01       KZM_ARM11_01            1722
+htc_polaris            MACH_HTC_POLARIS        HTC_POLARIS             1723
+htc_kaiser             MACH_HTC_KAISER         HTC_KAISER              1724
+lg_ks20                        MACH_LG_KS20            LG_KS20                 1725
+hhgps                  MACH_HHGPS              HHGPS                   1726
+nokia_n810_wimax       MACH_NOKIA_N810_WIMAX   NOKIA_N810_WIMAX        1727
index 28e0caf4156ca68bb066d8300fd1947264e28037..09ad7995080c879cc4b944cf671484ac24746830 100644 (file)
@@ -47,6 +47,9 @@ config RWSEM_GENERIC_SPINLOCK
 config GENERIC_TIME
        def_bool y
 
+config GENERIC_CLOCKEVENTS
+       def_bool y
+
 config RWSEM_XCHGADD_ALGORITHM
        def_bool n
 
@@ -70,6 +73,8 @@ source "init/Kconfig"
 
 menu "System Type and features"
 
+source "kernel/time/Kconfig"
+
 config SUBARCH_AVR32B
        bool
 config MMU
index 8cf16d7a70409b1994990030cdef47612775a9b0..5f31702d6b1c9e3ffc55ee4866b8ac4f7b2dfdcb 100644 (file)
@@ -741,26 +741,6 @@ irq_level\level:
 
        .section .irq.text,"ax",@progbits
 
-.global cpu_idle_sleep
-cpu_idle_sleep:
-       mask_interrupts
-       get_thread_info r8
-       ld.w    r9, r8[TI_flags]
-       bld     r9, TIF_NEED_RESCHED
-       brcs    cpu_idle_enable_int_and_exit
-       sbr     r9, TIF_CPU_GOING_TO_SLEEP
-       st.w    r8[TI_flags], r9
-       unmask_interrupts
-       sleep 0
-cpu_idle_skip_sleep:
-       mask_interrupts
-       ld.w    r9, r8[TI_flags]
-       cbr     r9, TIF_CPU_GOING_TO_SLEEP
-       st.w    r8[TI_flags], r9
-cpu_idle_enable_int_and_exit:
-       unmask_interrupts
-       retal   r12
-
        .global irq_level0
        .global irq_level1
        .global irq_level2
index 7f4af0b1e111448f4941fbb7d3ae94589f13a961..6cf9df1762743a29813db51b5d82d5ba8f6acedf 100644 (file)
 #include <asm/sysreg.h>
 #include <asm/ocd.h>
 
+#include <asm/arch/pm.h>
+
 void (*pm_power_off)(void) = NULL;
 EXPORT_SYMBOL(pm_power_off);
 
-extern void cpu_idle_sleep(void);
-
 /*
  * This file handles the architecture-dependent parts of process handling..
  */
@@ -54,6 +54,8 @@ void machine_halt(void)
 
 void machine_power_off(void)
 {
+       if (pm_power_off)
+               pm_power_off();
 }
 
 void machine_restart(char *cmd)
index 36a46c3ae30880c8f2b478f6c9df7c2d84b27247..00a9862380ff3e10e3fc0dd73137197ad1982fe0 100644 (file)
@@ -1,16 +1,12 @@
 /*
  * Copyright (C) 2004-2007 Atmel Corporation
  *
- * Based on MIPS implementation arch/mips/kernel/time.c
- *   Copyright 2001 MontaVista Software Inc.
- *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
  */
-
 #include <linux/clk.h>
-#include <linux/clocksource.h>
+#include <linux/clockchips.h>
 #include <linux/time.h>
 #include <linux/module.h>
 #include <linux/interrupt.h>
 #include <asm/io.h>
 #include <asm/sections.h>
 
-/* how many counter cycles in a jiffy? */
-static u32 cycles_per_jiffy;
+#include <asm/arch/pm.h>
 
-/* the count value for the next timer interrupt */
-static u32 expirelo;
 
-cycle_t __weak read_cycle_count(void)
+static cycle_t read_cycle_count(void)
 {
        return (cycle_t)sysreg_read(COUNT);
 }
 
-struct clocksource __weak clocksource_avr32 = {
-       .name           = "avr32",
-       .rating         = 350,
+/*
+ * The architectural cycle count registers are a fine clocksource unless
+ * the system idle loop use sleep states like "idle":  the CPU cycles
+ * measured by COUNT (and COMPARE) don't happen during sleep states.
+ * Their duration also changes if cpufreq changes the CPU clock rate.
+ * So we rate the clocksource using COUNT as very low quality.
+ */
+static struct clocksource counter = {
+       .name           = "avr32_counter",
+       .rating         = 50,
        .read           = read_cycle_count,
        .mask           = CLOCKSOURCE_MASK(32),
        .shift          = 16,
        .flags          = CLOCK_SOURCE_IS_CONTINUOUS,
 };
 
-irqreturn_t __weak timer_interrupt(int irq, void *dev_id);
-
-struct irqaction timer_irqaction = {
-       .handler        = timer_interrupt,
-       .flags          = IRQF_DISABLED,
-       .name           = "timer",
-};
-
-/*
- * By default we provide the null RTC ops
- */
-static unsigned long null_rtc_get_time(void)
+static irqreturn_t timer_interrupt(int irq, void *dev_id)
 {
-       return mktime(2007, 1, 1, 0, 0, 0);
-}
-
-static int null_rtc_set_time(unsigned long sec)
-{
-       return 0;
-}
+       struct clock_event_device *evdev = dev_id;
 
-static unsigned long (*rtc_get_time)(void) = null_rtc_get_time;
-static int (*rtc_set_time)(unsigned long) = null_rtc_set_time;
-
-static void avr32_timer_ack(void)
-{
-       u32 count;
-
-       /* Ack this timer interrupt and set the next one */
-       expirelo += cycles_per_jiffy;
-       /* setting COMPARE to 0 stops the COUNT-COMPARE */
-       if (expirelo == 0) {
-               sysreg_write(COMPARE, expirelo + 1);
-       } else {
-               sysreg_write(COMPARE, expirelo);
-       }
+       /*
+        * Disable the interrupt until the clockevent subsystem
+        * reprograms it.
+        */
+       sysreg_write(COMPARE, 0);
 
-       /* Check to see if we have missed any timer interrupts */
-       count = sysreg_read(COUNT);
-       if ((count - expirelo) < 0x7fffffff) {
-               expirelo = count + cycles_per_jiffy;
-               sysreg_write(COMPARE, expirelo);
-       }
+       evdev->event_handler(evdev);
+       return IRQ_HANDLED;
 }
 
-int __weak avr32_hpt_init(void)
-{
-       int ret;
-       unsigned long mult, shift, count_hz;
-
-       count_hz = clk_get_rate(boot_cpu_data.clk);
-       shift = clocksource_avr32.shift;
-       mult = clocksource_hz2mult(count_hz, shift);
-       clocksource_avr32.mult = mult;
-
-       {
-               u64 tmp;
-
-               tmp = TICK_NSEC;
-               tmp <<= shift;
-               tmp += mult / 2;
-               do_div(tmp, mult);
-
-               cycles_per_jiffy = tmp;
-       }
+static struct irqaction timer_irqaction = {
+       .handler        = timer_interrupt,
+       .flags          = IRQF_TIMER | IRQF_DISABLED,
+       .name           = "avr32_comparator",
+};
 
-       ret = setup_irq(0, &timer_irqaction);
-       if (ret) {
-               pr_debug("timer: could not request IRQ 0: %d\n", ret);
-               return -ENODEV;
-       }
+static int comparator_next_event(unsigned long delta,
+               struct clock_event_device *evdev)
+{
+       unsigned long   flags;
 
-       printk(KERN_INFO "timer: AT32AP COUNT-COMPARE at irq 0, "
-                       "%lu.%03lu MHz\n",
-                       ((count_hz + 500) / 1000) / 1000,
-                       ((count_hz + 500) / 1000) % 1000);
+       raw_local_irq_save(flags);
 
-       return 0;
-}
+       /* The time to read COUNT then update COMPARE must be less
+        * than the min_delta_ns value for this clockevent source.
+        */
+       sysreg_write(COMPARE, (sysreg_read(COUNT) + delta) ? : 1);
 
-/*
- * Taken from MIPS c0_hpt_timer_init().
- *
- * The reason COUNT is written twice is probably to make sure we don't get any
- * timer interrupts while we are messing with the counter.
- */
-int __weak avr32_hpt_start(void)
-{
-       u32 count = sysreg_read(COUNT);
-       expirelo = (count / cycles_per_jiffy + 1) * cycles_per_jiffy;
-       sysreg_write(COUNT, expirelo - cycles_per_jiffy);
-       sysreg_write(COMPARE, expirelo);
-       sysreg_write(COUNT, count);
+       raw_local_irq_restore(flags);
 
        return 0;
 }
 
-/*
- * local_timer_interrupt() does profiling and process accounting on a
- * per-CPU basis.
- *
- * In UP mode, it is invoked from the (global) timer_interrupt.
- */
-void local_timer_interrupt(int irq, void *dev_id)
+static void comparator_mode(enum clock_event_mode mode,
+               struct clock_event_device *evdev)
 {
-       if (current->pid)
-               profile_tick(CPU_PROFILING);
-       update_process_times(user_mode(get_irq_regs()));
+       switch (mode) {
+       case CLOCK_EVT_MODE_ONESHOT:
+               pr_debug("%s: start\n", evdev->name);
+               /* FALLTHROUGH */
+       case CLOCK_EVT_MODE_RESUME:
+               cpu_disable_idle_sleep();
+               break;
+       case CLOCK_EVT_MODE_UNUSED:
+       case CLOCK_EVT_MODE_SHUTDOWN:
+               sysreg_write(COMPARE, 0);
+               pr_debug("%s: stop\n", evdev->name);
+               cpu_enable_idle_sleep();
+               break;
+       default:
+               BUG();
+       }
 }
 
-irqreturn_t __weak timer_interrupt(int irq, void *dev_id)
-{
-       /* ack timer interrupt and try to set next interrupt */
-       avr32_timer_ack();
-
-       /*
-        * Call the generic timer interrupt handler
-        */
-       write_seqlock(&xtime_lock);
-       do_timer(1);
-       write_sequnlock(&xtime_lock);
-
-       /*
-        * In UP mode, we call local_timer_interrupt() to do profiling
-        * and process accounting.
-        *
-        * SMP is not supported yet.
-        */
-       local_timer_interrupt(irq, dev_id);
-
-       return IRQ_HANDLED;
-}
+static struct clock_event_device comparator = {
+       .name           = "avr32_comparator",
+       .features       = CLOCK_EVT_FEAT_ONESHOT,
+       .shift          = 16,
+       .rating         = 50,
+       .cpumask        = CPU_MASK_CPU0,
+       .set_next_event = comparator_next_event,
+       .set_mode       = comparator_mode,
+};
 
 void __init time_init(void)
 {
+       unsigned long counter_hz;
        int ret;
 
-       /*
-        * Make sure we don't get any COMPARE interrupts before we can
-        * handle them.
-        */
-       sysreg_write(COMPARE, 0);
-
-       xtime.tv_sec = rtc_get_time();
+       xtime.tv_sec = mktime(2007, 1, 1, 0, 0, 0);
        xtime.tv_nsec = 0;
 
        set_normalized_timespec(&wall_to_monotonic,
                                -xtime.tv_sec, -xtime.tv_nsec);
 
-       ret = avr32_hpt_init();
-       if (ret) {
-               pr_debug("timer: failed setup: %d\n", ret);
-               return;
-       }
+       /* figure rate for counter */
+       counter_hz = clk_get_rate(boot_cpu_data.clk);
+       counter.mult = clocksource_hz2mult(counter_hz, counter.shift);
 
-       ret = clocksource_register(&clocksource_avr32);
+       ret = clocksource_register(&counter);
        if (ret)
                pr_debug("timer: could not register clocksource: %d\n", ret);
 
-       ret = avr32_hpt_start();
-       if (ret) {
-               pr_debug("timer: failed starting: %d\n", ret);
-               return;
-       }
-}
+       /* setup COMPARE clockevent */
+       comparator.mult = div_sc(counter_hz, NSEC_PER_SEC, comparator.shift);
+       comparator.max_delta_ns = clockevent_delta2ns((u32)~0, &comparator);
+       comparator.min_delta_ns = clockevent_delta2ns(50, &comparator) + 1;
 
-static struct sysdev_class timer_class = {
-       .name = "timer",
-};
+       sysreg_write(COMPARE, 0);
+       timer_irqaction.dev_id = &comparator;
 
-static struct sys_device timer_device = {
-       .id     = 0,
-       .cls    = &timer_class,
-};
+       ret = setup_irq(0, &timer_irqaction);
+       if (ret)
+               pr_debug("timer: could not request IRQ 0: %d\n", ret);
+       else {
+               clockevents_register_device(&comparator);
 
-static int __init init_timer_sysfs(void)
-{
-       int err = sysdev_class_register(&timer_class);
-       if (!err)
-               err = sysdev_register(&timer_device);
-       return err;
+               pr_info("%s: irq 0, %lu.%03lu MHz\n", comparator.name,
+                               ((counter_hz + 500) / 1000) / 1000,
+                               ((counter_hz + 500) / 1000) % 1000);
+       }
 }
-
-device_initcall(init_timer_sysfs);
index 5e9f8217befc16f4095918f8be3c710a1c4fb621..e89009439e4aebf043bf335561ba7b1f93e7d4db 100644 (file)
@@ -1,4 +1,3 @@
 obj-y                          += at32ap.o clock.o intc.o extint.o pio.o hsmc.o
-obj-$(CONFIG_CPU_AT32AP700X)   += at32ap700x.o
-obj-$(CONFIG_CPU_AT32AP700X)   += time-tc.o
+obj-$(CONFIG_CPU_AT32AP700X)   += at32ap700x.o pm-at32ap700x.o
 obj-$(CONFIG_CPU_FREQ_AT32AP)  += cpufreq.o
index 7678fee9a885ecc8fc0d041dfe5cb14427fc7a75..0f24b4f85c17c6022b4dccf624532ec7e4aeb7db 100644 (file)
@@ -6,11 +6,13 @@
  * published by the Free Software Foundation.
  */
 #include <linux/clk.h>
+#include <linux/delay.h>
 #include <linux/fb.h>
 #include <linux/init.h>
 #include <linux/platform_device.h>
 #include <linux/dma-mapping.h>
 #include <linux/spi/spi.h>
+#include <linux/usb/atmel_usba_udc.h>
 
 #include <asm/io.h>
 #include <asm/irq.h>
@@ -98,6 +100,9 @@ unsigned long at32ap7000_osc_rates[3] = {
        [2] = 12000000,
 };
 
+static struct clk osc0;
+static struct clk osc1;
+
 static unsigned long osc_get_rate(struct clk *clk)
 {
        return at32ap7000_osc_rates[clk->index];
@@ -107,9 +112,6 @@ static unsigned long pll_get_rate(struct clk *clk, unsigned long control)
 {
        unsigned long div, mul, rate;
 
-       if (!(control & PM_BIT(PLLEN)))
-               return 0;
-
        div = PM_BFEXT(PLLDIV, control) + 1;
        mul = PM_BFEXT(PLLMUL, control) + 1;
 
@@ -120,6 +122,71 @@ static unsigned long pll_get_rate(struct clk *clk, unsigned long control)
        return rate;
 }
 
+static long pll_set_rate(struct clk *clk, unsigned long rate,
+                        u32 *pll_ctrl)
+{
+       unsigned long mul;
+       unsigned long mul_best_fit = 0;
+       unsigned long div;
+       unsigned long div_min;
+       unsigned long div_max;
+       unsigned long div_best_fit = 0;
+       unsigned long base;
+       unsigned long pll_in;
+       unsigned long actual = 0;
+       unsigned long rate_error;
+       unsigned long rate_error_prev = ~0UL;
+       u32 ctrl;
+
+       /* Rate must be between 80 MHz and 200 Mhz. */
+       if (rate < 80000000UL || rate > 200000000UL)
+               return -EINVAL;
+
+       ctrl = PM_BF(PLLOPT, 4);
+       base = clk->parent->get_rate(clk->parent);
+
+       /* PLL input frequency must be between 6 MHz and 32 MHz. */
+       div_min = DIV_ROUND_UP(base, 32000000UL);
+       div_max = base / 6000000UL;
+
+       if (div_max < div_min)
+               return -EINVAL;
+
+       for (div = div_min; div <= div_max; div++) {
+               pll_in = (base + div / 2) / div;
+               mul = (rate + pll_in / 2) / pll_in;
+
+               if (mul == 0)
+                       continue;
+
+               actual = pll_in * mul;
+               rate_error = abs(actual - rate);
+
+               if (rate_error < rate_error_prev) {
+                       mul_best_fit = mul;
+                       div_best_fit = div;
+                       rate_error_prev = rate_error;
+               }
+
+               if (rate_error == 0)
+                       break;
+       }
+
+       if (div_best_fit == 0)
+               return -EINVAL;
+
+       ctrl |= PM_BF(PLLMUL, mul_best_fit - 1);
+       ctrl |= PM_BF(PLLDIV, div_best_fit - 1);
+       ctrl |= PM_BF(PLLCOUNT, 16);
+
+       if (clk->parent == &osc1)
+               ctrl |= PM_BIT(PLLOSC);
+
+       *pll_ctrl = ctrl;
+
+       return actual;
+}
+
 static unsigned long pll0_get_rate(struct clk *clk)
 {
        u32 control;
@@ -129,6 +196,41 @@ static unsigned long pll0_get_rate(struct clk *clk)
        return pll_get_rate(clk, control);
 }
 
+static void pll1_mode(struct clk *clk, int enabled)
+{
+       unsigned long timeout;
+       u32 status;
+       u32 ctrl;
+
+       ctrl = pm_readl(PLL1);
+
+       if (enabled) {
+               if (!PM_BFEXT(PLLMUL, ctrl) && !PM_BFEXT(PLLDIV, ctrl)) {
+                       pr_debug("clk %s: failed to enable, rate not set\n",
+                                       clk->name);
+                       return;
+               }
+
+               ctrl |= PM_BIT(PLLEN);
+               pm_writel(PLL1, ctrl);
+
+               /* Wait for PLL lock. */
+               for (timeout = 10000; timeout; timeout--) {
+                       status = pm_readl(ISR);
+                       if (status & PM_BIT(LOCK1))
+                               break;
+                       udelay(10);
+               }
+
+               if (!(status & PM_BIT(LOCK1)))
+                       printk(KERN_ERR "clk %s: timeout waiting for lock\n",
+                                       clk->name);
+       } else {
+               ctrl &= ~PM_BIT(PLLEN);
+               pm_writel(PLL1, ctrl);
+       }
+}
+
 static unsigned long pll1_get_rate(struct clk *clk)
 {
        u32 control;
@@ -138,6 +240,49 @@ static unsigned long pll1_get_rate(struct clk *clk)
        return pll_get_rate(clk, control);
 }
 
+static long pll1_set_rate(struct clk *clk, unsigned long rate, int apply)
+{
+       u32 ctrl = 0;
+       unsigned long actual_rate;
+
+       actual_rate = pll_set_rate(clk, rate, &ctrl);
+
+       if (apply) {
+               if (actual_rate != rate)
+                       return -EINVAL;
+               if (clk->users > 0)
+                       return -EBUSY;
+               pr_debug(KERN_INFO "clk %s: new rate %lu (actual rate %lu)\n",
+                               clk->name, rate, actual_rate);
+               pm_writel(PLL1, ctrl);
+       }
+
+       return actual_rate;
+}
+
+static int pll1_set_parent(struct clk *clk, struct clk *parent)
+{
+       u32 ctrl;
+
+       if (clk->users > 0)
+               return -EBUSY;
+
+       ctrl = pm_readl(PLL1);
+       WARN_ON(ctrl & PM_BIT(PLLEN));
+
+       if (parent == &osc0)
+               ctrl &= ~PM_BIT(PLLOSC);
+       else if (parent == &osc1)
+               ctrl |= PM_BIT(PLLOSC);
+       else
+               return -EINVAL;
+
+       pm_writel(PLL1, ctrl);
+       clk->parent = parent;
+
+       return 0;
+}
+
 /*
  * The AT32AP7000 has five primary clock sources: One 32kHz
  * oscillator, two crystal oscillators and two PLLs.
@@ -166,7 +311,10 @@ static struct clk pll0 = {
 };
 static struct clk pll1 = {
        .name           = "pll1",
+       .mode           = pll1_mode,
        .get_rate       = pll1_get_rate,
+       .set_rate       = pll1_set_rate,
+       .set_parent     = pll1_set_parent,
        .parent         = &osc0,
 };
 
@@ -605,19 +753,32 @@ static inline void set_ebi_sfr_bits(u32 mask)
 }
 
 /* --------------------------------------------------------------------
- *  System Timer/Counter (TC)
+ *  Timer/Counter (TC)
  * -------------------------------------------------------------------- */
-static struct resource at32_systc0_resource[] = {
+
+static struct resource at32_tcb0_resource[] = {
        PBMEM(0xfff00c00),
        IRQ(22),
 };
-struct platform_device at32_systc0_device = {
-       .name           = "systc",
+static struct platform_device at32_tcb0_device = {
+       .name           = "atmel_tcb",
        .id             = 0,
-       .resource       = at32_systc0_resource,
-       .num_resources  = ARRAY_SIZE(at32_systc0_resource),
+       .resource       = at32_tcb0_resource,
+       .num_resources  = ARRAY_SIZE(at32_tcb0_resource),
 };
-DEV_CLK(pclk, at32_systc0, pbb, 3);
+DEV_CLK(t0_clk, at32_tcb0, pbb, 3);
+
+static struct resource at32_tcb1_resource[] = {
+       PBMEM(0xfff01000),
+       IRQ(23),
+};
+static struct platform_device at32_tcb1_device = {
+       .name           = "atmel_tcb",
+       .id             = 1,
+       .resource       = at32_tcb1_resource,
+       .num_resources  = ARRAY_SIZE(at32_tcb1_resource),
+};
+DEV_CLK(t0_clk, at32_tcb1, pbb, 4);
 
 /* --------------------------------------------------------------------
  *  PIO
@@ -669,7 +830,8 @@ void __init at32_add_system_devices(void)
        platform_device_register(&pdc_device);
        platform_device_register(&dmaca0_device);
 
-       platform_device_register(&at32_systc0_device);
+       platform_device_register(&at32_tcb0_device);
+       platform_device_register(&at32_tcb1_device);
 
        platform_device_register(&pio0_device);
        platform_device_register(&pio1_device);
@@ -989,7 +1151,9 @@ static struct clk atmel_twi0_pclk = {
        .index          = 2,
 };
 
-struct platform_device *__init at32_add_device_twi(unsigned int id)
+struct platform_device *__init at32_add_device_twi(unsigned int id,
+                                                   struct i2c_board_info *b,
+                                                   unsigned int n)
 {
        struct platform_device *pdev;
 
@@ -1009,6 +1173,9 @@ struct platform_device *__init at32_add_device_twi(unsigned int id)
 
        atmel_twi0_pclk.dev = &pdev->dev;
 
+       if (b)
+               i2c_register_board_info(id, b, n);
+
        platform_device_add(pdev);
        return pdev;
 
@@ -1351,9 +1518,39 @@ static struct clk usba0_hclk = {
        .index          = 6,
 };
 
+#define EP(nam, idx, maxpkt, maxbk, dma, isoc)                 \
+       [idx] = {                                               \
+               .name           = nam,                          \
+               .index          = idx,                          \
+               .fifo_size      = maxpkt,                       \
+               .nr_banks       = maxbk,                        \
+               .can_dma        = dma,                          \
+               .can_isoc       = isoc,                         \
+       }
+
+static struct usba_ep_data at32_usba_ep[] __initdata = {
+       EP("ep0",     0,   64, 1, 0, 0),
+       EP("ep1",     1,  512, 2, 1, 1),
+       EP("ep2",     2,  512, 2, 1, 1),
+       EP("ep3-int", 3,   64, 3, 1, 0),
+       EP("ep4-int", 4,   64, 3, 1, 0),
+       EP("ep5",     5, 1024, 3, 1, 1),
+       EP("ep6",     6, 1024, 3, 1, 1),
+};
+
+#undef EP
+
 struct platform_device *__init
 at32_add_device_usba(unsigned int id, struct usba_platform_data *data)
 {
+       /*
+        * pdata doesn't have room for any endpoints, so we need to
+        * append room for the ones we need right after it.
+        */
+       struct {
+               struct usba_platform_data pdata;
+               struct usba_ep_data ep[7];
+       } usba_data;
        struct platform_device *pdev;
 
        if (id != 0)
@@ -1367,13 +1564,20 @@ at32_add_device_usba(unsigned int id, struct usba_platform_data *data)
                                          ARRAY_SIZE(usba0_resource)))
                goto out_free_pdev;
 
-       if (data) {
-               if (platform_device_add_data(pdev, data, sizeof(*data)))
-                       goto out_free_pdev;
+       if (data)
+               usba_data.pdata.vbus_pin = data->vbus_pin;
+       else
+               usba_data.pdata.vbus_pin = -EINVAL;
+
+       data = &usba_data.pdata;
+       data->num_ep = ARRAY_SIZE(at32_usba_ep);
+       memcpy(data->ep, at32_usba_ep, sizeof(at32_usba_ep));
 
-               if (data->vbus_pin != GPIO_PIN_NONE)
-                       at32_select_gpio(data->vbus_pin, 0);
-       }
+       if (platform_device_add_data(pdev, data, sizeof(usba_data)))
+               goto out_free_pdev;
+
+       if (data->vbus_pin >= 0)
+               at32_select_gpio(data->vbus_pin, 0);
 
        usba0_pclk.dev = &pdev->dev;
        usba0_hclk.dev = &pdev->dev;
@@ -1694,7 +1898,8 @@ struct clk *at32_clock_list[] = {
        &pio2_mck,
        &pio3_mck,
        &pio4_mck,
-       &at32_systc0_pclk,
+       &at32_tcb0_t0_clk,
+       &at32_tcb1_t0_clk,
        &atmel_usart0_usart,
        &atmel_usart1_usart,
        &atmel_usart2_usart,
index 0b286cd53028a469441af1ad99b56f97a6c37287..097cf4e8405260e738ee02dcec3dd29b7c5dbd33 100644 (file)
@@ -13,7 +13,6 @@
 #include <linux/irq.h>
 #include <linux/platform_device.h>
 
-#include <asm/intc.h>
 #include <asm/io.h>
 
 #include "intc.h"
diff --git a/arch/avr32/mach-at32ap/pm-at32ap700x.S b/arch/avr32/mach-at32ap/pm-at32ap700x.S
new file mode 100644 (file)
index 0000000..949e248
--- /dev/null
@@ -0,0 +1,66 @@
+/*
+ * Low-level Power Management code.
+ *
+ * Copyright (C) 2008 Atmel Corporation
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+#include <asm/asm.h>
+#include <asm/asm-offsets.h>
+#include <asm/thread_info.h>
+#include <asm/arch/pm.h>
+
+       .section .bss, "wa", @nobits
+       .global disable_idle_sleep
+       .type   disable_idle_sleep, @object
+disable_idle_sleep:
+       .int    4
+       .size   disable_idle_sleep, . - disable_idle_sleep
+
+       /* Keep this close to the irq handlers */
+       .section .irq.text, "ax", @progbits
+
+       /*
+        * void cpu_enter_idle(void)
+        *
+        * Put the CPU into "idle" mode, in which it will consume
+        * significantly less power.
+        *
+        * If an interrupt comes along in the window between
+        * unmask_interrupts and the sleep instruction below, the
+        * interrupt code will adjust the return address so that we
+        * never execute the sleep instruction. This is required
+        * because the AP7000 doesn't unmask interrupts when entering
+        * sleep modes; later CPUs may not need this workaround.
+        */
+       .global cpu_enter_idle
+       .type   cpu_enter_idle, @function
+cpu_enter_idle:
+       mask_interrupts
+       get_thread_info r8
+       ld.w    r9, r8[TI_flags]
+       bld     r9, TIF_NEED_RESCHED
+       brcs    .Lret_from_sleep
+       sbr     r9, TIF_CPU_GOING_TO_SLEEP
+       st.w    r8[TI_flags], r9
+       unmask_interrupts
+       sleep   CPU_SLEEP_IDLE
+       .size   cpu_idle_sleep, . - cpu_idle_sleep
+
+       /*
+        * Common return path for PM functions that don't run from
+        * SRAM.
+        */
+       .global cpu_idle_skip_sleep
+       .type   cpu_idle_skip_sleep, @function
+cpu_idle_skip_sleep:
+       mask_interrupts
+       ld.w    r9, r8[TI_flags]
+       cbr     r9, TIF_CPU_GOING_TO_SLEEP
+       st.w    r8[TI_flags], r9
+.Lret_from_sleep:
+       unmask_interrupts
+       retal   r12
+       .size   cpu_idle_skip_sleep, . - cpu_idle_skip_sleep
diff --git a/arch/avr32/mach-at32ap/time-tc.c b/arch/avr32/mach-at32ap/time-tc.c
deleted file mode 100644 (file)
index 1026586..0000000
+++ /dev/null
@@ -1,218 +0,0 @@
-/*
- * Copyright (C) 2004-2007 Atmel Corporation
- *
- * Based on MIPS implementation arch/mips/kernel/time.c
- *   Copyright 2001 MontaVista Software Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-
-#include <linux/clk.h>
-#include <linux/clocksource.h>
-#include <linux/time.h>
-#include <linux/module.h>
-#include <linux/interrupt.h>
-#include <linux/irq.h>
-#include <linux/kernel_stat.h>
-#include <linux/errno.h>
-#include <linux/init.h>
-#include <linux/profile.h>
-#include <linux/sysdev.h>
-#include <linux/err.h>
-
-#include <asm/div64.h>
-#include <asm/sysreg.h>
-#include <asm/io.h>
-#include <asm/sections.h>
-
-#include <asm/arch/time.h>
-
-/* how many counter cycles in a jiffy? */
-static u32 cycles_per_jiffy;
-
-/* the count value for the next timer interrupt */
-static u32 expirelo;
-
-/* the I/O registers of the TC module */
-static void __iomem *ioregs;
-
-cycle_t read_cycle_count(void)
-{
-       return (cycle_t)timer_read(ioregs, 0, CV);
-}
-
-struct clocksource clocksource_avr32 = {
-       .name           = "avr32",
-       .rating         = 342,
-       .read           = read_cycle_count,
-       .mask           = CLOCKSOURCE_MASK(16),
-       .shift          = 16,
-       .flags          = CLOCK_SOURCE_IS_CONTINUOUS,
-};
-
-static void avr32_timer_ack(void)
-{
-       u16 count = expirelo;
-
-       /* Ack this timer interrupt and set the next one, use a u16
-        * variable so it will wrap around correctly */
-       count += cycles_per_jiffy;
-       expirelo = count;
-       timer_write(ioregs, 0, RC, expirelo);
-
-       /* Check to see if we have missed any timer interrupts */
-       count = timer_read(ioregs, 0, CV);
-       if ((count - expirelo) < 0x7fff) {
-               expirelo = count + cycles_per_jiffy;
-               timer_write(ioregs, 0, RC, expirelo);
-       }
-}
-
-u32 avr32_hpt_read(void)
-{
-       return timer_read(ioregs, 0, CV);
-}
-
-static int avr32_timer_calc_div_and_set_jiffies(struct clk *pclk)
-{
-       unsigned int cycles_max = (clocksource_avr32.mask + 1) / 2;
-       unsigned int divs[] = { 4, 8, 16, 32 };
-       int divs_size = ARRAY_SIZE(divs);
-       int i = 0;
-       unsigned long count_hz;
-       unsigned long shift;
-       unsigned long mult;
-       int clock_div = -1;
-       u64 tmp;
-
-       shift = clocksource_avr32.shift;
-
-       do {
-               count_hz = clk_get_rate(pclk) / divs[i];
-               mult = clocksource_hz2mult(count_hz, shift);
-               clocksource_avr32.mult = mult;
-
-               tmp = TICK_NSEC;
-               tmp <<= shift;
-               tmp += mult / 2;
-               do_div(tmp, mult);
-
-               cycles_per_jiffy = tmp;
-       } while (cycles_per_jiffy > cycles_max && ++i < divs_size);
-
-       clock_div = i + 1;
-
-       if (clock_div > divs_size) {
-               pr_debug("timer: could not calculate clock divider\n");
-               return -EFAULT;
-       }
-
-       /* Set the clock divider */
-       timer_write(ioregs, 0, CMR, TIMER_BF(CMR_TCCLKS, clock_div));
-
-       return 0;
-}
-
-int avr32_hpt_init(unsigned int count)
-{
-       struct resource *regs;
-       struct clk *pclk;
-       int irq = -1;
-       int ret = 0;
-
-       ret = -ENXIO;
-
-       irq = platform_get_irq(&at32_systc0_device, 0);
-       if (irq < 0) {
-               pr_debug("timer: could not get irq\n");
-               goto out_error;
-       }
-
-       pclk = clk_get(&at32_systc0_device.dev, "pclk");
-       if (IS_ERR(pclk)) {
-               pr_debug("timer: could not get clk: %ld\n", PTR_ERR(pclk));
-               goto out_error;
-       }
-       clk_enable(pclk);
-
-       regs = platform_get_resource(&at32_systc0_device, IORESOURCE_MEM, 0);
-       if (!regs) {
-               pr_debug("timer: could not get resource\n");
-               goto out_error_clk;
-       }
-
-       ioregs = ioremap(regs->start, regs->end - regs->start + 1);
-       if (!ioregs) {
-               pr_debug("timer: could not get ioregs\n");
-               goto out_error_clk;
-       }
-
-       ret = avr32_timer_calc_div_and_set_jiffies(pclk);
-       if (ret)
-               goto out_error_io;
-
-       ret = setup_irq(irq, &timer_irqaction);
-       if (ret) {
-               pr_debug("timer: could not request irq %d: %d\n",
-                               irq, ret);
-               goto out_error_io;
-       }
-
-       expirelo = (timer_read(ioregs, 0, CV) / cycles_per_jiffy + 1)
-               * cycles_per_jiffy;
-
-       /* Enable clock and interrupts on RC compare */
-       timer_write(ioregs, 0, CCR, TIMER_BIT(CCR_CLKEN));
-       timer_write(ioregs, 0, IER, TIMER_BIT(IER_CPCS));
-       /* Set cycles to first interrupt */
-       timer_write(ioregs, 0,  RC, expirelo);
-
-       printk(KERN_INFO "timer: AT32AP system timer/counter at 0x%p irq %d\n",
-                       ioregs, irq);
-
-       return 0;
-
-out_error_io:
-       iounmap(ioregs);
-out_error_clk:
-       clk_put(pclk);
-out_error:
-       return ret;
-}
-
-int avr32_hpt_start(void)
-{
-       timer_write(ioregs, 0, CCR, TIMER_BIT(CCR_SWTRG));
-       return 0;
-}
-
-irqreturn_t timer_interrupt(int irq, void *dev_id)
-{
-       unsigned int sr = timer_read(ioregs, 0, SR);
-
-       if (sr & TIMER_BIT(SR_CPCS)) {
-               /* ack timer interrupt and try to set next interrupt */
-               avr32_timer_ack();
-
-               /*
-                * Call the generic timer interrupt handler
-                */
-               write_seqlock(&xtime_lock);
-               do_timer(1);
-               write_sequnlock(&xtime_lock);
-
-               /*
-                * In UP mode, we call local_timer_interrupt() to do profiling
-                * and process accounting.
-                *
-                * SMP is not supported yet.
-                */
-               local_timer_interrupt(irq, dev_id);
-
-               return IRQ_HANDLED;
-       }
-
-       return IRQ_NONE;
-}
index 480760bde63f9d2f342c5d32364ffa078800349a..0e64ddc45e3750f17e33b5be98789c9bed6176cc 100644 (file)
@@ -34,9 +34,6 @@ struct page *empty_zero_page;
  */
 unsigned long mmu_context_cache = NO_CONTEXT;
 
-#define START_PFN      (NODE_DATA(0)->bdata->node_boot_start >> PAGE_SHIFT)
-#define MAX_LOW_PFN    (NODE_DATA(0)->bdata->node_low_pfn)
-
 void show_mem(void)
 {
        int total = 0, reserved = 0, cached = 0;
index e2f876bfc86bbcab43be6cd47306a962e3140068..df42325c7f81da49e882c23c535a8eafd7a2356c 100644 (file)
@@ -16,7 +16,6 @@
 #include <linux/sched.h>
 #include <linux/types.h>
 
-#include <asm/intc.h>
 #include <asm/sysreg.h>
 #include <asm/system.h>
 
index 9bdc8f99183a5e66a215ffeec71440fbe48b7bf6..715b3945e4c7119b4af88c4f986b38cf91d63700 100644 (file)
@@ -39,8 +39,7 @@
 /* This is an NTP setting */
 #define        TICK_SIZE (tick_nsec / 1000)
 
-static void time_sched_init(irqreturn_t(*timer_routine)
-                       (int, void *));
+static void time_sched_init(irq_handler_t timer_routine);
 static unsigned long gettimeoffset(void);
 
 static struct irqaction bfin_timer_irq = {
@@ -64,7 +63,7 @@ static struct irqaction bfin_timer_irq = {
 #define TIME_SCALE 1
 
 static void
-time_sched_init(irqreturn_t(*timer_routine) (int, void *))
+time_sched_init(irq_handler_t timer_routine)
 {
        u32 tcount;
 
index 779c3cca206c524ea1ad0caf0d17b9a202db4f64..b11bb50a197a68ff8aa5f8661ef7552618940c56 100644 (file)
@@ -44,8 +44,8 @@
 #include <linux/smp.h>
 #include <linux/timer.h>
 #include <linux/vmalloc.h>
+#include <linux/semaphore.h>
 
-#include <asm/semaphore.h>
 #include <asm/sal.h>
 #include <asm/uaccess.h>
 
index 4b0d1538e7e5586450fd2fe39c363af2768bdc35..8cc0c4753d8933a5558a6e073a8b320bd1e0ff0f 100644 (file)
@@ -37,7 +37,6 @@
 
 #include <asm/processor.h>
 #include <asm/topology.h>
-#include <asm/semaphore.h>
 #include <asm/uaccess.h>
 #include <asm/sal.h>
 #include <asm/sn/io.h>
index 0055a6c06f755a9aa2ab0f10301782ecf4ab632e..04c69ffbea71635b23a1652e9c6159e37eb8f82c 100644 (file)
@@ -29,7 +29,6 @@
 #include <asm/atarihw.h>
 #include <asm/atari_stram.h>
 #include <asm/io.h>
-#include <asm/semaphore.h>
 
 #undef DEBUG
 
index db359d7402a6e3ef8b2b6dc46a26c6b539f2b958..0116d208d300c7cb996a4d11fc34481c2c2be138 100644 (file)
@@ -15,7 +15,6 @@
 
 #include <asm/errno.h>
 #include <asm/system.h>
-#include <asm/semaphore.h>
 #include <asm/rtc.h>
 #include <asm/intersil.h>
 
index 3ba830651c58f93d317212a04b784b00d6a17155..984e561f0f7ad58aca4a6a58d8644b79f1ad0fbf 100644 (file)
@@ -8,7 +8,6 @@
 #include <linux/init.h>
 
 #include <asm/page.h>
-#include <asm/semaphore.h>
 #include <asm/sn/addrs.h>
 #include <asm/sn/sn0/hub.h>
 #include <asm/sn/klconfig.h>
index 50bbf33ee00c3d6d40d692640a9c8669faba6d97..71efd6a28e2a39b60a3151836d50facd9594984f 100644 (file)
@@ -49,7 +49,6 @@
 
 #include <asm/types.h>
 #include <asm/uaccess.h>
-#include <asm/semaphore.h>
 #include <asm/mmu_context.h>
 
 #include "sys32.h"
index 1189d8d6170d252013ddcf112903073297308da7..4bb2e9310a569d092835cf6cb7ba528444adac7d 100644 (file)
@@ -49,6 +49,19 @@ config IRQ_PER_CPU
        bool
        default y
 
+config STACKTRACE_SUPPORT
+       bool
+       default y
+
+config TRACE_IRQFLAGS_SUPPORT
+       bool
+       depends on PPC64
+       default y
+
+config LOCKDEP_SUPPORT
+       bool
+       default y
+
 config RWSEM_GENERIC_SPINLOCK
        bool
 
@@ -81,6 +94,11 @@ config GENERIC_FIND_NEXT_BIT
        bool
        default y
 
+config GENERIC_GPIO
+       bool
+       help
+         Generic GPIO API support
+
 config ARCH_NO_VIRT_TO_BUS
        def_bool PPC64
 
@@ -91,6 +109,7 @@ config PPC
        select HAVE_OPROFILE
        select HAVE_KPROBES
        select HAVE_KRETPROBES
+       select HAVE_LMB
 
 config EARLY_PRINTK
        bool
@@ -210,15 +229,6 @@ source kernel/Kconfig.hz
 source kernel/Kconfig.preempt
 source "fs/Kconfig.binfmt"
 
-# We optimistically allocate largepages from the VM, so make the limit
-# large enough (16MB). This badly named config option is actually
-# max order + 1
-config FORCE_MAX_ZONEORDER
-       int
-       depends on PPC64
-       default "9" if PPC_64K_PAGES
-       default "13"
-
 config HUGETLB_PAGE_SIZE_VARIABLE
        bool
        depends on HUGETLB_PAGE
@@ -307,6 +317,16 @@ config CRASH_DUMP
 
          Don't change this unless you know what you are doing.
 
+config PHYP_DUMP
+       bool "Hypervisor-assisted dump (EXPERIMENTAL)"
+       depends on PPC_PSERIES && EXPERIMENTAL
+       help
+         Hypervisor-assisted dump is meant to be a kdump replacement
+         offering robustness and speed not possible without system
+         hypervisor assistence.
+
+         If unsure, say "N"
+
 config PPCBUG_NVRAM
        bool "Enable reading PPCBUG NVRAM during boot" if PPLUS || LOPEC
        default y if PPC_PREP
@@ -381,6 +401,26 @@ config PPC_64K_PAGES
          while on hardware with such support, it will be used to map
          normal application pages.
 
+config FORCE_MAX_ZONEORDER
+       int "Maximum zone order"
+       default "9" if PPC_64K_PAGES
+       default "13" if PPC64 && !PPC_64K_PAGES
+       default "11"
+       help
+         The kernel memory allocator divides physically contiguous memory
+         blocks into "zones", where each zone is a power of two number of
+         pages.  This option selects the largest power of two that the kernel
+         keeps in the memory allocator.  If you need to allocate very large
+         blocks of physically contiguous memory, then you may need to
+         increase this value.
+
+         This config option is actually maximum order plus one. For example,
+         a value of 11 means that the largest free memory block is 2^10 pages.
+
+         The page size is not necessarily 4KB.  For example, on 64-bit
+         systems, 64KB pages can be enabled via CONFIG_PPC_64K_PAGES.  Keep
+         this in mind when choosing a value for this option.
+
 config PPC_SUBPAGE_PROT
        bool "Support setting protections for 4k subpages"
        depends on PPC_64K_PAGES
@@ -490,6 +530,14 @@ config FSL_PCI
        bool
        select PPC_INDIRECT_PCI
 
+config 4xx_SOC
+       bool
+
+config FSL_LBC
+       bool
+       help
+         Freescale Localbus support
+
 # Yes MCA RS/6000s exist but Linux-PPC does not currently support any
 config MCA
        bool
@@ -663,22 +711,6 @@ config CONSISTENT_SIZE
        hex "Size of consistent memory pool" if CONSISTENT_SIZE_BOOL
        default "0x00200000" if NOT_COHERENT_CACHE
 
-config BOOT_LOAD_BOOL
-       bool "Set the boot link/load address"
-       depends on ADVANCED_OPTIONS && !PPC_MULTIPLATFORM
-       help
-         This option allows you to set the initial load address of the zImage
-         or zImage.initrd file.  This can be useful if you are on a board
-         which has a small amount of memory.
-
-         Say N here unless you know what you are doing.
-
-config BOOT_LOAD
-       hex "Link/load address for booting" if BOOT_LOAD_BOOL
-       default "0x00400000" if 40x || 8xx || 8260
-       default "0x01000000" if 44x
-       default "0x00800000"
-
 config PIN_TLB
        bool "Pinned Kernel TLBs (860 ONLY)"
        depends on ADVANCED_OPTIONS && 8xx
index db7cc34c24d4d983030adeebb029be70925587e3..a86d8d853214a37c6e807c3e5515c7cf21ef36c6 100644 (file)
@@ -269,7 +269,7 @@ config PPC_EARLY_DEBUG_CPM_ADDR
        hex "CPM UART early debug transmit descriptor address"
        depends on PPC_EARLY_DEBUG_CPM
        default "0xfa202008" if PPC_EP88XC
-       default "0xf0000008" if CPM2
+       default "0xf0001ff8" if CPM2
        default "0xff002008" if CPM1
        help
          This specifies the address of the transmit descriptor
index ab5cfe8ef988f53361b42c418e477f36eb94b32d..e2ec4a91ccefee1b68b22a4b2c834ebc578983f7 100644 (file)
@@ -71,13 +71,11 @@ endif
 
 LDFLAGS_vmlinux        := -Bstatic
 
-CPPFLAGS-$(CONFIG_PPC32) := -Iarch/$(ARCH)
-AFLAGS-$(CONFIG_PPC32) := -Iarch/$(ARCH)
 CFLAGS-$(CONFIG_PPC64) := -mminimal-toc -mtraceback=none  -mcall-aixdesc
-CFLAGS-$(CONFIG_PPC32) := -Iarch/$(ARCH) -ffixed-r2 -mmultiple
-KBUILD_CPPFLAGS        += $(CPPFLAGS-y)
-KBUILD_AFLAGS  += $(AFLAGS-y)
-KBUILD_CFLAGS  += -msoft-float -pipe $(CFLAGS-y)
+CFLAGS-$(CONFIG_PPC32) := -ffixed-r2 -mmultiple
+KBUILD_CPPFLAGS        += -Iarch/$(ARCH)
+KBUILD_AFLAGS  += -Iarch/$(ARCH)
+KBUILD_CFLAGS  += -msoft-float -pipe -Iarch/$(ARCH) $(CFLAGS-y)
 CPP            = $(CC) -E $(KBUILD_CFLAGS)
 
 CHECKFLAGS     += -m$(CONFIG_WORD_SIZE) -D__powerpc__ -D__powerpc$(CONFIG_WORD_SIZE)__
@@ -164,7 +162,7 @@ boot := arch/$(ARCH)/boot
 $(BOOT_TARGETS): vmlinux
        $(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@)
 
-bootwrapper_install:
+bootwrapper_install %.dtb:
        $(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@)
 
 define archhelp
index 1aded8f759d0fc7e164b91a5208e0256ad7ea9cd..5ba50c673390312eca8a5f1a817ccf1ace781712 100644 (file)
@@ -40,6 +40,7 @@ $(obj)/ebony.o: BOOTCFLAGS += -mcpu=405
 $(obj)/cuboot-taishan.o: BOOTCFLAGS += -mcpu=405
 $(obj)/cuboot-katmai.o: BOOTCFLAGS += -mcpu=405
 $(obj)/treeboot-walnut.o: BOOTCFLAGS += -mcpu=405
+$(obj)/virtex405-head.o: BOOTCFLAGS += -mcpu=405
 
 
 zlib       := inffast.c inflate.c inftrees.c
@@ -64,7 +65,8 @@ src-plat := of.c cuboot-52xx.c cuboot-824x.c cuboot-83xx.c cuboot-85xx.c holly.c
                cuboot-bamboo.c cuboot-mpc7448hpc2.c cuboot-taishan.c \
                fixed-head.S ep88xc.c ep405.c \
                cuboot-katmai.c cuboot-rainier.c redboot-8xx.c ep8248e.c \
-               cuboot-warp.c cuboot-85xx-cpm2.c
+               cuboot-warp.c cuboot-85xx-cpm2.c cuboot-yosemite.c simpleboot.c \
+               virtex405-head.S
 src-boot := $(src-wlib) $(src-plat) empty.c
 
 src-boot := $(addprefix $(obj)/, $(src-boot))
@@ -192,7 +194,7 @@ image-$(CONFIG_PPC_CHRP)            += zImage.chrp
 image-$(CONFIG_PPC_EFIKA)              += zImage.chrp
 image-$(CONFIG_PPC_PMAC)               += zImage.pmac
 image-$(CONFIG_PPC_HOLLY)              += zImage.holly
-image-$(CONFIG_PPC_PRPMC2800)          += zImage.prpmc2800
+image-$(CONFIG_PPC_PRPMC2800)          += dtbImage.prpmc2800
 image-$(CONFIG_PPC_ISERIES)            += zImage.iseries
 image-$(CONFIG_DEFAULT_UIMAGE)         += uImage
 
@@ -216,6 +218,7 @@ image-$(CONFIG_RAINIER)                     += cuImage.rainier
 image-$(CONFIG_TAISHAN)                        += cuImage.taishan
 image-$(CONFIG_KATMAI)                 += cuImage.katmai
 image-$(CONFIG_WARP)                   += cuImage.warp
+image-$(CONFIG_YOSEMITE)               += cuImage.yosemite
 
 # Board ports in arch/powerpc/platform/8xx/Kconfig
 image-$(CONFIG_PPC_MPC86XADS)          += cuImage.mpc866ads
@@ -255,6 +258,7 @@ image-$(CONFIG_TQM8555)                     += cuImage.tqm8555
 image-$(CONFIG_TQM8560)                        += cuImage.tqm8560
 image-$(CONFIG_SBC8548)                        += cuImage.sbc8548
 image-$(CONFIG_SBC8560)                        += cuImage.sbc8560
+image-$(CONFIG_KSI8560)                        += cuImage.ksi8560
 
 # Board ports in arch/powerpc/platform/embedded6xx/Kconfig
 image-$(CONFIG_STORCENTER)             += cuImage.storcenter
@@ -285,11 +289,11 @@ $(obj)/zImage.%: vmlinux $(wrapperbits)
        $(call if_changed,wrap,$*)
 
 # dtbImage% - a dtbImage is a zImage with an embedded device tree blob
-$(obj)/dtbImage.initrd.%: vmlinux $(wrapperbits) $(dtstree)/%.dts
-       $(call if_changed,wrap,$*,$(dtstree)/$*.dts,,$(obj)/ramdisk.image.gz)
+$(obj)/dtbImage.initrd.%: vmlinux $(wrapperbits) $(obj)/%.dtb
+       $(call if_changed,wrap,$*,,$(obj)/$*.dtb,$(obj)/ramdisk.image.gz)
 
-$(obj)/dtbImage.%: vmlinux $(wrapperbits) $(dtstree)/%.dts
-       $(call if_changed,wrap,$*,$(dtstree)/$*.dts)
+$(obj)/dtbImage.%: vmlinux $(wrapperbits) $(obj)/%.dtb
+       $(call if_changed,wrap,$*,,$(obj)/$*.dtb)
 
 # This cannot be in the root of $(src) as the zImage rule always adds a $(obj)
 # prefix
@@ -302,14 +306,24 @@ $(obj)/zImage.iseries: vmlinux
 $(obj)/uImage: vmlinux $(wrapperbits)
        $(call if_changed,wrap,uboot)
 
-$(obj)/cuImage.%: vmlinux $(dtstree)/%.dts $(wrapperbits)
-       $(call if_changed,wrap,cuboot-$*,$(dtstree)/$*.dts)
+$(obj)/cuImage.%: vmlinux $(obj)/%.dtb $(wrapperbits)
+       $(call if_changed,wrap,cuboot-$*,,$(obj)/$*.dtb)
 
-$(obj)/treeImage.initrd.%: vmlinux $(dtstree)/%.dts $(wrapperbits)
-       $(call if_changed,wrap,treeboot-$*,$(dtstree)/$*.dts,,$(obj)/ramdisk.image.gz)
+$(obj)/simpleImage.initrd.%: vmlinux $(obj)/%.dtb $(wrapperbits)
+       $(call if_changed,wrap,simpleboot-$*,,$(obj)/$*.dtb,$(obj)/ramdisk.image.gz)
 
-$(obj)/treeImage.%: vmlinux $(dtstree)/%.dts $(wrapperbits)
-       $(call if_changed,wrap,treeboot-$*,$(dtstree)/$*.dts)
+$(obj)/simpleImage.%: vmlinux $(obj)/%.dtb $(wrapperbits)
+       $(call if_changed,wrap,simpleboot-$*,,$(obj)/$*.dtb)
+
+$(obj)/treeImage.initrd.%: vmlinux $(obj)/%.dtb $(wrapperbits)
+       $(call if_changed,wrap,treeboot-$*,,$(obj)/$*.dtb,$(obj)/ramdisk.image.gz)
+
+$(obj)/treeImage.%: vmlinux $(obj)/%.dtb $(wrapperbits)
+       $(call if_changed,wrap,treeboot-$*,,$(obj)/$*.dtb)
+
+# Rule to build device tree blobs
+$(obj)/%.dtb: $(dtstree)/%.dts $(obj)/dtc
+       $(obj)/dtc -O dtb -o $(obj)/$*.dtb -b 0 $(DTS_FLAGS) $(dtstree)/$*.dts
 
 # If there isn't a platform selected then just strip the vmlinux.
 ifeq (,$(image-y))
@@ -326,7 +340,7 @@ install: $(CONFIGURE) $(addprefix $(obj)/, $(image-y))
 
 # anything not in $(targets)
 clean-files += $(image-) $(initrd-) zImage zImage.initrd cuImage.* treeImage.* \
-       otheros.bld
+       otheros.bld *.dtb
 
 # clean up files cached by wrapper
 clean-kernel := vmlinux.strip vmlinux.bin
index 54b33f1500e24dcf9ae87ce597013f31216e8a84..b82cacbc60dbc5962b27392e7f804ec5a22e235e 100644 (file)
@@ -33,7 +33,8 @@ static void bamboo_fixups(void)
        ibm440ep_fixup_clocks(sysclk, 11059200, 25000000);
        ibm4xx_sdram_fixup_memsize();
        ibm4xx_quiesce_eth((u32 *)0xef600e00, (u32 *)0xef600f00);
-       dt_fixup_mac_addresses(bamboo_mac0, bamboo_mac1);
+       dt_fixup_mac_address_by_alias("ethernet0", bamboo_mac0);
+       dt_fixup_mac_address_by_alias("ethernet1", bamboo_mac1);
 }
 
 void bamboo_init(void *mac0, void *mac1)
index 28296facb2ae921876c8859c2cee95db80f72b10..19dc15abe43de27a693f214ec44aa7de77260834 100644 (file)
@@ -11,6 +11,7 @@
 #include "types.h"
 #include "io.h"
 #include "ops.h"
+#include "page.h"
 
 struct cpm_scc {
        u32 gsmrl;
@@ -42,6 +43,22 @@ struct cpm_param {
        u16 tbase;
        u8 rfcr;
        u8 tfcr;
+       u16 mrblr;
+       u32 rstate;
+       u8 res1[4];
+       u16 rbptr;
+       u8 res2[6];
+       u32 tstate;
+       u8 res3[4];
+       u16 tbptr;
+       u8 res4[6];
+       u16 maxidl;
+       u16 idlc;
+       u16 brkln;
+       u16 brkec;
+       u16 brkcr;
+       u16 rmask;
+       u8 res5[4];
 };
 
 struct cpm_bd {
@@ -54,10 +71,10 @@ static void *cpcr;
 static struct cpm_param *param;
 static struct cpm_smc *smc;
 static struct cpm_scc *scc;
-struct cpm_bd *tbdf, *rbdf;
+static struct cpm_bd *tbdf, *rbdf;
 static u32 cpm_cmd;
-static u8 *muram_start;
-static u32 muram_offset;
+static void *cbd_addr;
+static u32 cbd_offset;
 
 static void (*do_cmd)(int op);
 static void (*enable_port)(void);
@@ -119,20 +136,25 @@ static int cpm_serial_open(void)
 
        out_8(&param->rfcr, 0x10);
        out_8(&param->tfcr, 0x10);
-
-       rbdf = (struct cpm_bd *)muram_start;
-       rbdf->addr = (u8 *)(rbdf + 2);
+       out_be16(&param->mrblr, 1);
+       out_be16(&param->maxidl, 0);
+       out_be16(&param->brkec, 0);
+       out_be16(&param->brkln, 0);
+       out_be16(&param->brkcr, 0);
+
+       rbdf = cbd_addr;
+       rbdf->addr = (u8 *)rbdf - 1;
        rbdf->sc = 0xa000;
        rbdf->len = 1;
 
        tbdf = rbdf + 1;
-       tbdf->addr = (u8 *)(rbdf + 2) + 1;
+       tbdf->addr = (u8 *)rbdf - 2;
        tbdf->sc = 0x2000;
        tbdf->len = 1;
 
        sync();
-       out_be16(&param->rbase, muram_offset);
-       out_be16(&param->tbase, muram_offset + sizeof(struct cpm_bd));
+       out_be16(&param->rbase, cbd_offset);
+       out_be16(&param->tbase, cbd_offset + sizeof(struct cpm_bd));
 
        do_cmd(CPM_CMD_INIT_RX_TX);
 
@@ -175,10 +197,12 @@ static unsigned char cpm_serial_getc(void)
 
 int cpm_console_init(void *devp, struct serial_console_data *scdp)
 {
-       void *reg_virt[2];
-       int is_smc = 0, is_cpm2 = 0, n;
-       unsigned long reg_phys;
+       void *vreg[2];
+       u32 reg[2];
+       int is_smc = 0, is_cpm2 = 0;
        void *parent, *muram;
+       void *muram_addr;
+       unsigned long muram_offset, muram_size;
 
        if (dt_is_compatible(devp, "fsl,cpm1-smc-uart")) {
                is_smc = 1;
@@ -202,63 +226,64 @@ int cpm_console_init(void *devp, struct serial_console_data *scdp)
        else
                do_cmd = cpm1_cmd;
 
-       n = getprop(devp, "fsl,cpm-command", &cpm_cmd, 4);
-       if (n < 4)
+       if (getprop(devp, "fsl,cpm-command", &cpm_cmd, 4) < 4)
                return -1;
 
-       n = getprop(devp, "virtual-reg", reg_virt, sizeof(reg_virt));
-       if (n < (int)sizeof(reg_virt)) {
-               for (n = 0; n < 2; n++) {
-                       if (!dt_xlate_reg(devp, n, &reg_phys, NULL))
-                               return -1;
-
-                       reg_virt[n] = (void *)reg_phys;
-               }
-       }
+       if (dt_get_virtual_reg(devp, vreg, 2) < 2)
+               return -1;
 
        if (is_smc)
-               smc = reg_virt[0];
+               smc = vreg[0];
        else
-               scc = reg_virt[0];
+               scc = vreg[0];
 
-       param = reg_virt[1];
+       param = vreg[1];
 
        parent = get_parent(devp);
        if (!parent)
                return -1;
 
-       n = getprop(parent, "virtual-reg", reg_virt, sizeof(reg_virt));
-       if (n < (int)sizeof(reg_virt)) {
-               if (!dt_xlate_reg(parent, 0, &reg_phys, NULL))
-                       return -1;
-
-               reg_virt[0] = (void *)reg_phys;
-       }
-
-       cpcr = reg_virt[0];
+       if (dt_get_virtual_reg(parent, &cpcr, 1) < 1)
+               return -1;
 
        muram = finddevice("/soc/cpm/muram/data");
        if (!muram)
                return -1;
 
        /* For bootwrapper-compatible device trees, we assume that the first
-        * entry has at least 18 bytes, and that #address-cells/#data-cells
+        * entry has at least 128 bytes, and that #address-cells/#data-cells
         * is one for both parent and child.
         */
 
-       n = getprop(muram, "virtual-reg", reg_virt, sizeof(reg_virt));
-       if (n < (int)sizeof(reg_virt)) {
-               if (!dt_xlate_reg(muram, 0, &reg_phys, NULL))
-                       return -1;
+       if (dt_get_virtual_reg(muram, &muram_addr, 1) < 1)
+               return -1;
 
-               reg_virt[0] = (void *)reg_phys;
-       }
+       if (getprop(muram, "reg", reg, 8) < 8)
+               return -1;
 
-       muram_start = reg_virt[0];
+       muram_offset = reg[0];
+       muram_size = reg[1];
 
-       n = getprop(muram, "reg", &muram_offset, 4);
-       if (n < 4)
-               return -1;
+       /* Store the buffer descriptors at the end of the first muram chunk.
+        * For SMC ports on CPM2-based platforms, relocate the parameter RAM
+        * just before the buffer descriptors.
+        */
+
+       cbd_offset = muram_offset + muram_size - 2 * sizeof(struct cpm_bd);
+
+       if (is_cpm2 && is_smc) {
+               u16 *smc_base = (u16 *)param;
+               u16 pram_offset;
+
+               pram_offset = cbd_offset - 64;
+               pram_offset = _ALIGN_DOWN(pram_offset, 64);
+
+               disable_port();
+               out_be16(smc_base, pram_offset);
+               param = muram_addr - muram_offset + pram_offset;
+       }
+
+       cbd_addr = muram_addr - muram_offset + cbd_offset;
 
        scdp->open = cpm_serial_open;
        scdp->putc = cpm_serial_putc;
index f56ac6cae9f3b291c1744a21958dc27d2e487a28..9c7d13428293cb9ff90cb35ef6cdebc1a3fabccb 100644 (file)
@@ -128,7 +128,7 @@ static void fixup_pci(void)
        u8 *soc_regs;
        int i, len;
        void *node, *parent_node;
-       u32 naddr, nsize, mem_log2;
+       u32 naddr, nsize, mem_pow2, mem_mask;
 
        node = finddevice("/pci");
        if (!node || !dt_is_compatible(node, "fsl,pq2-pci"))
@@ -141,7 +141,7 @@ static void fixup_pci(void)
 
        soc_regs = (u8 *)fsl_get_immr();
        if (!soc_regs)
-               goto err;
+               goto unhandled;
 
        dt_get_reg_format(node, &naddr, &nsize);
        if (naddr != 3 || nsize != 2)
@@ -153,7 +153,7 @@ static void fixup_pci(void)
 
        dt_get_reg_format(parent_node, &naddr, &nsize);
        if (naddr != 1 || nsize != 1)
-               goto err;
+               goto unhandled;
 
        len = getprop(node, "ranges", pci_ranges_buf,
                      sizeof(pci_ranges_buf));
@@ -170,14 +170,20 @@ static void fixup_pci(void)
        }
 
        if (!mem || !mmio || !io)
-               goto err;
+               goto unhandled;
+       if (mem->size[1] != mmio->size[1])
+               goto unhandled;
+       if (mem->size[1] & (mem->size[1] - 1))
+               goto unhandled;
+       if (io->size[1] & (io->size[1] - 1))
+               goto unhandled;
 
        if (mem->phys_addr + mem->size[1] == mmio->phys_addr)
                mem_base = mem;
        else if (mmio->phys_addr + mmio->size[1] == mem->phys_addr)
                mem_base = mmio;
        else
-               goto err;
+               goto unhandled;
 
        out_be32(&pci_regs[1][0], mem_base->phys_addr | 1);
        out_be32(&pci_regs[2][0], ~(mem->size[1] + mmio->size[1] - 1));
@@ -201,8 +207,9 @@ static void fixup_pci(void)
        out_le32(&pci_regs[0][58], 0);
        out_le32(&pci_regs[0][60], 0);
 
-       mem_log2 = 1 << (__ilog2_u32(bd.bi_memsize - 1) + 1);
-       out_le32(&pci_regs[0][62], 0xa0000000 | ~((1 << (mem_log2 - 12)) - 1));
+       mem_pow2 = 1 << (__ilog2_u32(bd.bi_memsize - 1) + 1);
+       mem_mask = ~(mem_pow2 - 1) >> 12;
+       out_le32(&pci_regs[0][62], 0xa0000000 | mem_mask);
 
        /* If PCI is disabled, drive RST high to enable. */
        if (!(in_le32(&pci_regs[0][32]) & 1)) {
@@ -228,7 +235,11 @@ static void fixup_pci(void)
        return;
 
 err:
-       printf("Bad PCI node\r\n");
+       printf("Bad PCI node -- using existing firmware setup.\r\n");
+       return;
+
+unhandled:
+       printf("Unsupported PCI node -- using existing firmware setup.\r\n");
 }
 
 static void pq2_platform_fixups(void)
index cf452b66dce8235671aaae32510cc506204d68cb..0a3fddee54dfab38eecb2d6f779026525eda31c5 100644 (file)
@@ -42,7 +42,8 @@ static void rainier_fixups(void)
        ibm440ep_fixup_clocks(sysclk, 11059200, 50000000);
        ibm4xx_fixup_ebc_ranges("/plb/opb/ebc");
        ibm4xx_denali_fixup_memsize();
-       dt_fixup_mac_addresses(&bd.bi_enetaddr, &bd.bi_enet1addr);
+       dt_fixup_mac_address_by_alias("ethernet0", bd.bi_enetaddr);
+       dt_fixup_mac_address_by_alias("ethernet1", bd.bi_enet1addr);
 }
 
 void platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
index f555575a44ded1e2bf0adfd23856d9edebb3fd48..caf8f2e842ea459f28ee7f02e85df08bfad9649e 100644 (file)
@@ -42,7 +42,8 @@ static void sequoia_fixups(void)
        ibm440ep_fixup_clocks(sysclk, 11059200, 50000000);
        ibm4xx_fixup_ebc_ranges("/plb/opb/ebc");
        ibm4xx_denali_fixup_memsize();
-       dt_fixup_mac_addresses(&bd.bi_enetaddr, &bd.bi_enet1addr);
+       dt_fixup_mac_address_by_alias("ethernet0", bd.bi_enetaddr);
+       dt_fixup_mac_address_by_alias("ethernet1", bd.bi_enet1addr);
 }
 
 void platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
index b55b80467eed9b23e70d7347e134745723116af1..9bc906a754dd53dbdbab24f6d5721fcf4f6835ff 100644 (file)
@@ -40,7 +40,8 @@ static void taishan_fixups(void)
 
        ibm4xx_sdram_fixup_memsize();
 
-       dt_fixup_mac_addresses(bd.bi_enetaddr, bd.bi_enet1addr);
+       dt_fixup_mac_address_by_alias("ethernet0", bd.bi_enetaddr);
+       dt_fixup_mac_address_by_alias("ethernet1", bd.bi_enet1addr);
 
        ibm4xx_fixup_ebc_ranges("/plb/opb/ebc");
 }
index 3db93e85e9eaa65cc954bfdf0384d3e273b761f0..eb108a877492adad8771416e749655999111f7f4 100644 (file)
@@ -24,7 +24,7 @@ static void warp_fixups(void)
        ibm440ep_fixup_clocks(sysclk, 11059200, 50000000);
        ibm4xx_sdram_fixup_memsize();
        ibm4xx_fixup_ebc_ranges("/plb/opb/ebc");
-       dt_fixup_mac_addresses(&bd.bi_enetaddr);
+       dt_fixup_mac_address_by_alias("ethernet0", bd.bi_enetaddr);
 }
 
 
diff --git a/arch/powerpc/boot/cuboot-yosemite.c b/arch/powerpc/boot/cuboot-yosemite.c
new file mode 100644 (file)
index 0000000..cc6e338
--- /dev/null
@@ -0,0 +1,44 @@
+/*
+ * Old U-boot compatibility for Yosemite
+ *
+ * Author: Josh Boyer <jwboyer@linux.vnet.ibm.com>
+ *
+ * Copyright 2008 IBM Corporation
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published
+ * by the Free Software Foundation.
+ */
+
+#include "ops.h"
+#include "stdio.h"
+#include "4xx.h"
+#include "44x.h"
+#include "cuboot.h"
+
+#define TARGET_4xx
+#define TARGET_44x
+#include "ppcboot.h"
+
+static bd_t bd;
+
+static void yosemite_fixups(void)
+{
+       unsigned long sysclk = 66666666;
+
+       ibm440ep_fixup_clocks(sysclk, 11059200, 50000000);
+       ibm4xx_sdram_fixup_memsize();
+       ibm4xx_quiesce_eth((u32 *)0xef600e00, (u32 *)0xef600f00);
+       dt_fixup_mac_address_by_alias("ethernet0", bd.bi_enetaddr);
+       dt_fixup_mac_address_by_alias("ethernet1", bd.bi_enet1addr);
+}
+
+void platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
+               unsigned long r6, unsigned long r7)
+{
+       CUBOOT_INIT();
+       platform_ops.fixups = yosemite_fixups;
+       platform_ops.exit = ibm44x_dbcr_reset;
+       fdt_init(_dtb_start);
+       serial_console_init();
+}
index 60f561e307a99090b423bc3e02e90891e9d51b48..5d12336dc3609d9d0cb9df0089f273ffc7fabe77 100644 (file)
@@ -350,3 +350,23 @@ int dt_is_compatible(void *node, const char *compat)
 
        return 0;
 }
+
+int dt_get_virtual_reg(void *node, void **addr, int nres)
+{
+       unsigned long xaddr;
+       int n;
+
+       n = getprop(node, "virtual-reg", addr, nres * 4);
+       if (n > 0)
+               return n / 4;
+
+       for (n = 0; n < nres; n++) {
+               if (!dt_xlate_reg(node, n, &xaddr, NULL))
+                       break;
+
+               addr[n] = (void *)xaddr;
+       }
+
+       return n;
+}
+
index 7dc37c9a7446b28d58af7a1d5134bfb43f89b21f..ba2521bdaab1ccdb7423acaa97ec9ea47985934d 100644 (file)
                        };
 
                        EMAC0: ethernet@ef600e00 {
-                               linux,network-index = <0>;
                                device_type = "network";
                                compatible = "ibm,emac-440ep", "ibm,emac-440gp", "ibm,emac";
                                interrupt-parent = <&UIC1>;
                        };
 
                        EMAC1: ethernet@ef600f00 {
-                               linux,network-index = <1>;
                                device_type = "network";
                                compatible = "ibm,emac-440ep", "ibm,emac-440gp", "ibm,emac";
                                interrupt-parent = <&UIC1>;
diff --git a/arch/powerpc/boot/dts/canyonlands.dts b/arch/powerpc/boot/dts/canyonlands.dts
new file mode 100644 (file)
index 0000000..6f3d38a
--- /dev/null
@@ -0,0 +1,402 @@
+/*
+ * Device Tree Source for AMCC Canyonlands (460EX)
+ *
+ * Copyright 2008 DENX Software Engineering, Stefan Roese <sr@denx.de>
+ *
+ * This file is licensed under the terms of the GNU General Public
+ * License version 2.  This program is licensed "as is" without
+ * any warranty of any kind, whether express or implied.
+ */
+
+/ {
+       #address-cells = <2>;
+       #size-cells = <1>;
+       model = "amcc,canyonlands";
+       compatible = "amcc,canyonlands";
+       dcr-parent = <&/cpus/cpu@0>;
+
+       aliases {
+               ethernet0 = &EMAC0;
+               ethernet1 = &EMAC1;
+               serial0 = &UART0;
+               serial1 = &UART1;
+       };
+
+       cpus {
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               cpu@0 {
+                       device_type = "cpu";
+                       model = "PowerPC,460EX";
+                       reg = <0>;
+                       clock-frequency = <0>; /* Filled in by U-Boot */
+                       timebase-frequency = <0>; /* Filled in by U-Boot */
+                       i-cache-line-size = <20>;
+                       d-cache-line-size = <20>;
+                       i-cache-size = <8000>;
+                       d-cache-size = <8000>;
+                       dcr-controller;
+                       dcr-access-method = "native";
+               };
+       };
+
+       memory {
+               device_type = "memory";
+               reg = <0 0 0>; /* Filled in by U-Boot */
+       };
+
+       UIC0: interrupt-controller0 {
+               compatible = "ibm,uic-460ex","ibm,uic";
+               interrupt-controller;
+               cell-index = <0>;
+               dcr-reg = <0c0 009>;
+               #address-cells = <0>;
+               #size-cells = <0>;
+               #interrupt-cells = <2>;
+       };
+
+       UIC1: interrupt-controller1 {
+               compatible = "ibm,uic-460ex","ibm,uic";
+               interrupt-controller;
+               cell-index = <1>;
+               dcr-reg = <0d0 009>;
+               #address-cells = <0>;
+               #size-cells = <0>;
+               #interrupt-cells = <2>;
+               interrupts = <1e 4 1f 4>; /* cascade */
+               interrupt-parent = <&UIC0>;
+       };
+
+       UIC2: interrupt-controller2 {
+               compatible = "ibm,uic-460ex","ibm,uic";
+               interrupt-controller;
+               cell-index = <2>;
+               dcr-reg = <0e0 009>;
+               #address-cells = <0>;
+               #size-cells = <0>;
+               #interrupt-cells = <2>;
+               interrupts = <a 4 b 4>; /* cascade */
+               interrupt-parent = <&UIC0>;
+       };
+
+       UIC3: interrupt-controller3 {
+               compatible = "ibm,uic-460ex","ibm,uic";
+               interrupt-controller;
+               cell-index = <3>;
+               dcr-reg = <0f0 009>;
+               #address-cells = <0>;
+               #size-cells = <0>;
+               #interrupt-cells = <2>;
+               interrupts = <10 4 11 4>; /* cascade */
+               interrupt-parent = <&UIC0>;
+       };
+
+       SDR0: sdr {
+               compatible = "ibm,sdr-460ex";
+               dcr-reg = <00e 002>;
+       };
+
+       CPR0: cpr {
+               compatible = "ibm,cpr-460ex";
+               dcr-reg = <00c 002>;
+       };
+
+       plb {
+               compatible = "ibm,plb-460ex", "ibm,plb4";
+               #address-cells = <2>;
+               #size-cells = <1>;
+               ranges;
+               clock-frequency = <0>; /* Filled in by U-Boot */
+
+               SDRAM0: sdram {
+                       compatible = "ibm,sdram-460ex", "ibm,sdram-405gp";
+                       dcr-reg = <010 2>;
+               };
+
+               MAL0: mcmal {
+                       compatible = "ibm,mcmal-460ex", "ibm,mcmal2";
+                       dcr-reg = <180 62>;
+                       num-tx-chans = <2>;
+                       num-rx-chans = <10>;
+                       #address-cells = <0>;
+                       #size-cells = <0>;
+                       interrupt-parent = <&UIC2>;
+                       interrupts = <  /*TXEOB*/ 6 4
+                                       /*RXEOB*/ 7 4
+                                       /*SERR*/  3 4
+                                       /*TXDE*/  4 4
+                                       /*RXDE*/  5 4>;
+               };
+
+               POB0: opb {
+                       compatible = "ibm,opb-460ex", "ibm,opb";
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       ranges = <b0000000 4 b0000000 50000000>;
+                       clock-frequency = <0>; /* Filled in by U-Boot */
+
+                       EBC0: ebc {
+                               compatible = "ibm,ebc-460ex", "ibm,ebc";
+                               dcr-reg = <012 2>;
+                               #address-cells = <2>;
+                               #size-cells = <1>;
+                               clock-frequency = <0>; /* Filled in by U-Boot */
+                               interrupts = <6 4>;
+                               interrupt-parent = <&UIC1>;
+                       };
+
+                       UART0: serial@ef600300 {
+                               device_type = "serial";
+                               compatible = "ns16550";
+                               reg = <ef600300 8>;
+                               virtual-reg = <ef600300>;
+                               clock-frequency = <0>; /* Filled in by U-Boot */
+                               current-speed = <0>; /* Filled in by U-Boot */
+                               interrupt-parent = <&UIC1>;
+                               interrupts = <1 4>;
+                       };
+
+                       UART1: serial@ef600400 {
+                               device_type = "serial";
+                               compatible = "ns16550";
+                               reg = <ef600400 8>;
+                               virtual-reg = <ef600400>;
+                               clock-frequency = <0>; /* Filled in by U-Boot */
+                               current-speed = <0>; /* Filled in by U-Boot */
+                               interrupt-parent = <&UIC0>;
+                               interrupts = <1 4>;
+                       };
+
+                       UART2: serial@ef600500 {
+                               device_type = "serial";
+                               compatible = "ns16550";
+                               reg = <ef600500 8>;
+                               virtual-reg = <ef600500>;
+                               clock-frequency = <0>; /* Filled in by U-Boot */
+                               current-speed = <0>; /* Filled in by U-Boot */
+                               interrupt-parent = <&UIC1>;
+                               interrupts = <1d 4>;
+                       };
+
+                       UART3: serial@ef600600 {
+                               device_type = "serial";
+                               compatible = "ns16550";
+                               reg = <ef600600 8>;
+                               virtual-reg = <ef600600>;
+                               clock-frequency = <0>; /* Filled in by U-Boot */
+                               current-speed = <0>; /* Filled in by U-Boot */
+                               interrupt-parent = <&UIC1>;
+                               interrupts = <1e 4>;
+                       };
+
+                       IIC0: i2c@ef600700 {
+                               compatible = "ibm,iic-460ex", "ibm,iic";
+                               reg = <ef600700 14>;
+                               interrupt-parent = <&UIC0>;
+                               interrupts = <2 4>;
+                       };
+
+                       IIC1: i2c@ef600800 {
+                               compatible = "ibm,iic-460ex", "ibm,iic";
+                               reg = <ef600800 14>;
+                               interrupt-parent = <&UIC0>;
+                               interrupts = <3 4>;
+                       };
+
+                       ZMII0: emac-zmii@ef600d00 {
+                               compatible = "ibm,zmii-460ex", "ibm,zmii";
+                               reg = <ef600d00 c>;
+                       };
+
+                       RGMII0: emac-rgmii@ef601500 {
+                               compatible = "ibm,rgmii-460ex", "ibm,rgmii";
+                               reg = <ef601500 8>;
+                               has-mdio;
+                       };
+
+                       TAH0: emac-tah@ef601350 {
+                               compatible = "ibm,tah-460ex", "ibm,tah";
+                               reg = <ef601350 30>;
+                       };
+
+                       TAH1: emac-tah@ef601450 {
+                               compatible = "ibm,tah-460ex", "ibm,tah";
+                               reg = <ef601450 30>;
+                       };
+
+                       EMAC0: ethernet@ef600e00 {
+                               device_type = "network";
+                               compatible = "ibm,emac-460ex", "ibm,emac4";
+                               interrupt-parent = <&EMAC0>;
+                               interrupts = <0 1>;
+                               #interrupt-cells = <1>;
+                               #address-cells = <0>;
+                               #size-cells = <0>;
+                               interrupt-map = </*Status*/ 0 &UIC2 10 4
+                                                /*Wake*/   1 &UIC2 14 4>;
+                               reg = <ef600e00 70>;
+                               local-mac-address = [000000000000]; /* Filled in by U-Boot */
+                               mal-device = <&MAL0>;
+                               mal-tx-channel = <0>;
+                               mal-rx-channel = <0>;
+                               cell-index = <0>;
+                               max-frame-size = <2328>;
+                               rx-fifo-size = <1000>;
+                               tx-fifo-size = <800>;
+                               phy-mode = "rgmii";
+                               phy-map = <00000000>;
+                               rgmii-device = <&RGMII0>;
+                               rgmii-channel = <0>;
+                               tah-device = <&TAH0>;
+                               tah-channel = <0>;
+                               has-inverted-stacr-oc;
+                               has-new-stacr-staopc;
+                       };
+
+                       EMAC1: ethernet@ef600f00 {
+                               device_type = "network";
+                               compatible = "ibm,emac-460ex", "ibm,emac4";
+                               interrupt-parent = <&EMAC1>;
+                               interrupts = <0 1>;
+                               #interrupt-cells = <1>;
+                               #address-cells = <0>;
+                               #size-cells = <0>;
+                               interrupt-map = </*Status*/ 0 &UIC2 11 4
+                                                /*Wake*/   1 &UIC2 15 4>;
+                               reg = <ef600f00 70>;
+                               local-mac-address = [000000000000]; /* Filled in by U-Boot */
+                               mal-device = <&MAL0>;
+                               mal-tx-channel = <1>;
+                               mal-rx-channel = <8>;
+                               cell-index = <1>;
+                               max-frame-size = <2328>;
+                               rx-fifo-size = <1000>;
+                               tx-fifo-size = <800>;
+                               phy-mode = "rgmii";
+                               phy-map = <00000000>;
+                               rgmii-device = <&RGMII0>;
+                               rgmii-channel = <1>;
+                               tah-device = <&TAH1>;
+                               tah-channel = <1>;
+                               has-inverted-stacr-oc;
+                               has-new-stacr-staopc;
+                               mdio-device = <&EMAC0>;
+                       };
+               };
+
+               PCIX0: pci@c0ec00000 {
+                       device_type = "pci";
+                       #interrupt-cells = <1>;
+                       #size-cells = <2>;
+                       #address-cells = <3>;
+                       compatible = "ibm,plb-pcix-460ex", "ibm,plb-pcix";
+                       primary;
+                       large-inbound-windows;
+                       enable-msi-hole;
+                       reg = <c 0ec00000   8   /* Config space access */
+                              0 0 0            /* no IACK cycles */
+                              c 0ed00000   4   /* Special cycles */
+                              c 0ec80000 100   /* Internal registers */
+                              c 0ec80100  fc>; /* Internal messaging registers */
+
+                       /* Outbound ranges, one memory and one IO,
+                        * later cannot be changed
+                        */
+                       ranges = <02000000 0 80000000 0000000d 80000000 0 80000000
+                                 01000000 0 00000000 0000000c 08000000 0 00010000>;
+
+                       /* Inbound 2GB range starting at 0 */
+                       dma-ranges = <42000000 0 0 0 0 0 80000000>;
+
+                       /* This drives busses 0 to 0x3f */
+                       bus-range = <0 3f>;
+
+                       /* All PCI interrupts are routed to ext IRQ 2 -> UIC1-0 */
+                       interrupt-map-mask = <0000 0 0 0>;
+                       interrupt-map = < 0000 0 0 0 &UIC1 0 8 >;
+               };
+
+               PCIE0: pciex@d00000000 {
+                       device_type = "pci";
+                       #interrupt-cells = <1>;
+                       #size-cells = <2>;
+                       #address-cells = <3>;
+                       compatible = "ibm,plb-pciex-460ex", "ibm,plb-pciex";
+                       primary;
+                       port = <0>; /* port number */
+                       reg = <d 00000000 20000000      /* Config space access */
+                              c 08010000 00001000>;    /* Registers */
+                       dcr-reg = <100 020>;
+                       sdr-base = <300>;
+
+                       /* Outbound ranges, one memory and one IO,
+                        * later cannot be changed
+                        */
+                       ranges = <02000000 0 80000000 0000000e 00000000 0 80000000
+                                 01000000 0 00000000 0000000f 80000000 0 00010000>;
+
+                       /* Inbound 2GB range starting at 0 */
+                       dma-ranges = <42000000 0 0 0 0 0 80000000>;
+
+                       /* This drives busses 40 to 0x7f */
+                       bus-range = <40 7f>;
+
+                       /* Legacy interrupts (note the weird polarity, the bridge seems
+                        * to invert PCIe legacy interrupts).
+                        * We are de-swizzling here because the numbers are actually for
+                        * port of the root complex virtual P2P bridge. But I want
+                        * to avoid putting a node for it in the tree, so the numbers
+                        * below are basically de-swizzled numbers.
+                        * The real slot is on idsel 0, so the swizzling is 1:1
+                        */
+                       interrupt-map-mask = <0000 0 0 7>;
+                       interrupt-map = <
+                               0000 0 0 1 &UIC3 c 4 /* swizzled int A */
+                               0000 0 0 2 &UIC3 d 4 /* swizzled int B */
+                               0000 0 0 3 &UIC3 e 4 /* swizzled int C */
+                               0000 0 0 4 &UIC3 f 4 /* swizzled int D */>;
+               };
+
+               PCIE1: pciex@d20000000 {
+                       device_type = "pci";
+                       #interrupt-cells = <1>;
+                       #size-cells = <2>;
+                       #address-cells = <3>;
+                       compatible = "ibm,plb-pciex-460ex", "ibm,plb-pciex";
+                       primary;
+                       port = <1>; /* port number */
+                       reg = <d 20000000 20000000      /* Config space access */
+                              c 08011000 00001000>;    /* Registers */
+                       dcr-reg = <120 020>;
+                       sdr-base = <340>;
+
+                       /* Outbound ranges, one memory and one IO,
+                        * later cannot be changed
+                        */
+                       ranges = <02000000 0 80000000 0000000e 80000000 0 80000000
+                                 01000000 0 00000000 0000000f 80010000 0 00010000>;
+
+                       /* Inbound 2GB range starting at 0 */
+                       dma-ranges = <42000000 0 0 0 0 0 80000000>;
+
+                       /* This drives busses 80 to 0xbf */
+                       bus-range = <80 bf>;
+
+                       /* Legacy interrupts (note the weird polarity, the bridge seems
+                        * to invert PCIe legacy interrupts).
+                        * We are de-swizzling here because the numbers are actually for
+                        * port of the root complex virtual P2P bridge. But I want
+                        * to avoid putting a node for it in the tree, so the numbers
+                        * below are basically de-swizzled numbers.
+                        * The real slot is on idsel 0, so the swizzling is 1:1
+                        */
+                       interrupt-map-mask = <0000 0 0 7>;
+                       interrupt-map = <
+                               0000 0 0 1 &UIC3 10 4 /* swizzled int A */
+                               0000 0 0 2 &UIC3 11 4 /* swizzled int B */
+                               0000 0 0 3 &UIC3 12 4 /* swizzled int C */
+                               0000 0 0 4 &UIC3 13 4 /* swizzled int D */>;
+               };
+       };
+};
index 0b000cb7ed8b3983fe1e2e659210c8b54f3b7ed4..5079dc890e0e47915f9c5dfce531093f0f26e618 100644 (file)
                        };
 
                        EMAC0: ethernet@40000800 {
-                               linux,network-index = <0>;
                                device_type = "network";
                                compatible = "ibm,emac-440gp", "ibm,emac";
                                interrupt-parent = <&UIC1>;
                                zmii-channel = <0>;
                        };
                        EMAC1: ethernet@40000900 {
-                               linux,network-index = <1>;
                                device_type = "network";
                                compatible = "ibm,emac-440gp", "ibm,emac";
                                interrupt-parent = <&UIC1>;
index 5d2fb76a72c12b16ce4dcdd447d599b50ec8ee1d..756758fb5b7b45369fc7f3138eea3ae5f9d93bd5 100644 (file)
 
                                data@0 {
                                        compatible = "fsl,cpm-muram-data";
-                                       reg = <0 0x1100 0x1140
-                                              0xec0 0x9800 0x800>;
+                                       reg = <0 0x2000 0x9800 0x800>;
                                };
                        };
 
                                device_type = "serial";
                                compatible = "fsl,mpc8248-smc-uart",
                                             "fsl,cpm2-smc-uart";
-                               reg = <0x11a80 0x20 0x1100 0x40>;
+                               reg = <0x11a80 0x20 0x87fc 2>;
                                interrupts = <4 8>;
                                interrupt-parent = <&PIC>;
                                fsl,cpm-brg = <7>;
index 02705f299790d467ff07343bd1733134f5c573bd..ae57d62401209c5a5ad80abc3fd1bbdafd0013b0 100644 (file)
@@ -2,7 +2,7 @@
  * EP88xC Device Tree Source
  *
  * Copyright 2006 MontaVista Software, Inc.
- * Copyright 2007 Freescale Semiconductor, Inc.
+ * Copyright 2007,2008 Freescale Semiconductor, Inc.
  *
  * This program is free software; you can redistribute  it and/or modify it
  * under  the terms of  the GNU General  Public License as published by the
@@ -10,6 +10,7 @@
  * option) any later version.
  */
 
+/dts-v1/;
 
 / {
        model = "EP88xC";
 
                PowerPC,885@0 {
                        device_type = "cpu";
-                       reg = <0>;
-                       d-cache-line-size = <d#16>;
-                       i-cache-line-size = <d#16>;
-                       d-cache-size = <d#8192>;
-                       i-cache-size = <d#8192>;
+                       reg = <0x0>;
+                       d-cache-line-size = <16>;
+                       i-cache-line-size = <16>;
+                       d-cache-size = <8192>;
+                       i-cache-size = <8192>;
                        timebase-frequency = <0>;
                        bus-frequency = <0>;
                        clock-frequency = <0>;
-                       interrupts = <f 2>;     // decrementer interrupt
+                       interrupts = <15 2>;    // decrementer interrupt
                        interrupt-parent = <&PIC>;
                };
        };
 
        memory {
                device_type = "memory";
-               reg = <0 0>;
+               reg = <0x0 0x0>;
        };
 
        localbus@fa200100 {
                compatible = "fsl,mpc885-localbus", "fsl,pq1-localbus";
                #address-cells = <2>;
                #size-cells = <1>;
-               reg = <fa200100 40>;
+               reg = <0xfa200100 0x40>;
 
                ranges = <
-                       0 0 fc000000 04000000
-                       3 0 fa000000 01000000
+                       0x0 0x0 0xfc000000 0x4000000
+                       0x3 0x0 0xfa000000 0x1000000
                >;
 
                flash@0,2000000 {
                        compatible = "cfi-flash";
-                       reg = <0 2000000 2000000>;
+                       reg = <0x0 0x2000000 0x2000000>;
                        bank-width = <4>;
                        device-width = <2>;
                };
 
                board-control@3,400000 {
-                       reg = <3 400000 10>;
+                       reg = <0x3 0x400000 0x10>;
                        compatible = "fsl,ep88xc-bcsr";
                };
        };
                #address-cells = <1>;
                #size-cells = <1>;
                device_type = "soc";
-               ranges = <0 fa200000 00004000>;
+               ranges = <0x0 0xfa200000 0x4000>;
                bus-frequency = <0>;
 
                // Temporary -- will go away once kernel uses ranges for get_immrbase().
-               reg = <fa200000 4000>;
+               reg = <0xfa200000 0x4000>;
 
                mdio@e00 {
                        compatible = "fsl,mpc885-fec-mdio", "fsl,pq1-fec-mdio";
-                       reg = <e00 188>;
+                       reg = <0xe00 0x188>;
                        #address-cells = <1>;
                        #size-cells = <0>;
 
                        PHY0: ethernet-phy@0 {
-                               reg = <0>;
+                               reg = <0x0>;
                                device_type = "ethernet-phy";
                        };
 
                        PHY1: ethernet-phy@1 {
-                               reg = <1>;
+                               reg = <0x1>;
                                device_type = "ethernet-phy";
                        };
                };
@@ -97,7 +98,7 @@
                        device_type = "network";
                        compatible = "fsl,mpc885-fec-enet",
                                     "fsl,pq1-fec-enet";
-                       reg = <e00 188>;
+                       reg = <0xe00 0x188>;
                        local-mac-address = [ 00 00 00 00 00 00 ];
                        interrupts = <3 1>;
                        interrupt-parent = <&PIC>;
                        device_type = "network";
                        compatible = "fsl,mpc885-fec-enet",
                                     "fsl,pq1-fec-enet";
-                       reg = <1e00 188>;
+                       reg = <0x1e00 0x188>;
                        local-mac-address = [ 00 00 00 00 00 00 ];
                        interrupts = <7 1>;
                        interrupt-parent = <&PIC>;
                PIC: interrupt-controller@0 {
                        interrupt-controller;
                        #interrupt-cells = <2>;
-                       reg = <0 24>;
+                       reg = <0x0 0x24>;
                        compatible = "fsl,mpc885-pic", "fsl,pq1-pic";
                };
 
                        #size-cells = <2>;
                        compatible = "fsl,pq-pcmcia";
                        device_type = "pcmcia";
-                       reg = <80 80>;
+                       reg = <0x80 0x80>;
                        interrupt-parent = <&PIC>;
-                       interrupts = <d 1>;
+                       interrupts = <13 1>;
                };
 
                cpm@9c0 {
                        #address-cells = <1>;
                        #size-cells = <1>;
                        compatible = "fsl,mpc885-cpm", "fsl,cpm1";
-                       command-proc = <9c0>;
+                       command-proc = <0x9c0>;
                        interrupts = <0>;       // cpm error interrupt
                        interrupt-parent = <&CPM_PIC>;
-                       reg = <9c0 40>;
+                       reg = <0x9c0 0x40>;
                        ranges;
 
                        muram@2000 {
                                #address-cells = <1>;
                                #size-cells = <1>;
-                               ranges = <0 2000 2000>;
+                               ranges = <0x0 0x2000 0x2000>;
 
                                data@0 {
                                        compatible = "fsl,cpm-muram-data";
-                                       reg = <0 1c00>;
+                                       reg = <0x0 0x1c00>;
                                };
                        };
 
                                compatible = "fsl,mpc885-brg",
                                             "fsl,cpm1-brg",
                                             "fsl,cpm-brg";
-                               reg = <9f0 10>;
+                               reg = <0x9f0 0x10>;
                        };
 
                        CPM_PIC: interrupt-controller@930 {
                                #interrupt-cells = <1>;
                                interrupts = <5 2 0 2>;
                                interrupt-parent = <&PIC>;
-                               reg = <930 20>;
+                               reg = <0x930 0x20>;
                                compatible = "fsl,mpc885-cpm-pic",
                                             "fsl,cpm1-pic";
                        };
                                device_type = "serial";
                                compatible = "fsl,mpc885-smc-uart",
                                             "fsl,cpm1-smc-uart";
-                               reg = <a80 10 3e80 40>;
+                               reg = <0xa80 0x10 0x3e80 0x40>;
                                interrupts = <4>;
                                interrupt-parent = <&CPM_PIC>;
                                fsl,cpm-brg = <1>;
-                               fsl,cpm-command = <0090>;
+                               fsl,cpm-command = <0x90>;
                                linux,planetcore-label = "SMC1";
                        };
 
                                device_type = "serial";
                                compatible = "fsl,mpc885-scc-uart",
                                             "fsl,cpm1-scc-uart";
-                               reg = <a20 20 3d00 80>;
-                               interrupts = <1d>;
+                               reg = <0xa20 0x20 0x3d00 0x80>;
+                               interrupts = <29>;
                                interrupt-parent = <&CPM_PIC>;
                                fsl,cpm-brg = <2>;
-                               fsl,cpm-command = <0040>;
+                               fsl,cpm-command = <0x40>;
                                linux,planetcore-label = "SCC2";
                        };
 
                                #size-cells = <0>;
                                compatible = "fsl,mpc885-usb",
                                             "fsl,cpm1-usb";
-                               reg = <a00 18 1c00 80>;
+                               reg = <0xa00 0x18 0x1c00 0x80>;
                                interrupt-parent = <&CPM_PIC>;
-                               interrupts = <1e>;
+                               interrupts = <30>;
                                fsl,cpm-command = <0000>;
                        };
                };
diff --git a/arch/powerpc/boot/dts/glacier.dts b/arch/powerpc/boot/dts/glacier.dts
new file mode 100644 (file)
index 0000000..958a5ca
--- /dev/null
@@ -0,0 +1,467 @@
+/*
+ * Device Tree Source for AMCC Glacier (460GT)
+ *
+ * Copyright 2008 DENX Software Engineering, Stefan Roese <sr@denx.de>
+ *
+ * This file is licensed under the terms of the GNU General Public
+ * License version 2.  This program is licensed "as is" without
+ * any warranty of any kind, whether express or implied.
+ */
+
+/ {
+       #address-cells = <2>;
+       #size-cells = <1>;
+       model = "amcc,glacier";
+       compatible = "amcc,glacier", "amcc,canyonlands";
+       dcr-parent = <&/cpus/cpu@0>;
+
+       aliases {
+               ethernet0 = &EMAC0;
+               ethernet1 = &EMAC1;
+               ethernet2 = &EMAC2;
+               ethernet3 = &EMAC3;
+               serial0 = &UART0;
+               serial1 = &UART1;
+       };
+
+       cpus {
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               cpu@0 {
+                       device_type = "cpu";
+                       model = "PowerPC,460GT";
+                       reg = <0>;
+                       clock-frequency = <0>; /* Filled in by U-Boot */
+                       timebase-frequency = <0>; /* Filled in by U-Boot */
+                       i-cache-line-size = <20>;
+                       d-cache-line-size = <20>;
+                       i-cache-size = <8000>;
+                       d-cache-size = <8000>;
+                       dcr-controller;
+                       dcr-access-method = "native";
+               };
+       };
+
+       memory {
+               device_type = "memory";
+               reg = <0 0 0>; /* Filled in by U-Boot */
+       };
+
+       UIC0: interrupt-controller0 {
+               compatible = "ibm,uic-460gt","ibm,uic";
+               interrupt-controller;
+               cell-index = <0>;
+               dcr-reg = <0c0 009>;
+               #address-cells = <0>;
+               #size-cells = <0>;
+               #interrupt-cells = <2>;
+       };
+
+       UIC1: interrupt-controller1 {
+               compatible = "ibm,uic-460gt","ibm,uic";
+               interrupt-controller;
+               cell-index = <1>;
+               dcr-reg = <0d0 009>;
+               #address-cells = <0>;
+               #size-cells = <0>;
+               #interrupt-cells = <2>;
+               interrupts = <1e 4 1f 4>; /* cascade */
+               interrupt-parent = <&UIC0>;
+       };
+
+       UIC2: interrupt-controller2 {
+               compatible = "ibm,uic-460gt","ibm,uic";
+               interrupt-controller;
+               cell-index = <2>;
+               dcr-reg = <0e0 009>;
+               #address-cells = <0>;
+               #size-cells = <0>;
+               #interrupt-cells = <2>;
+               interrupts = <a 4 b 4>; /* cascade */
+               interrupt-parent = <&UIC0>;
+       };
+
+       UIC3: interrupt-controller3 {
+               compatible = "ibm,uic-460gt","ibm,uic";
+               interrupt-controller;
+               cell-index = <3>;
+               dcr-reg = <0f0 009>;
+               #address-cells = <0>;
+               #size-cells = <0>;
+               #interrupt-cells = <2>;
+               interrupts = <10 4 11 4>; /* cascade */
+               interrupt-parent = <&UIC0>;
+       };
+
+       SDR0: sdr {
+               compatible = "ibm,sdr-460gt";
+               dcr-reg = <00e 002>;
+       };
+
+       CPR0: cpr {
+               compatible = "ibm,cpr-460gt";
+               dcr-reg = <00c 002>;
+       };
+
+       plb {
+               compatible = "ibm,plb-460gt", "ibm,plb4";
+               #address-cells = <2>;
+               #size-cells = <1>;
+               ranges;
+               clock-frequency = <0>; /* Filled in by U-Boot */
+
+               SDRAM0: sdram {
+                       compatible = "ibm,sdram-460gt", "ibm,sdram-405gp";
+                       dcr-reg = <010 2>;
+               };
+
+               MAL0: mcmal {
+                       compatible = "ibm,mcmal-460gt", "ibm,mcmal2";
+                       dcr-reg = <180 62>;
+                       num-tx-chans = <4>;
+                       num-rx-chans = <20>;
+                       #address-cells = <0>;
+                       #size-cells = <0>;
+                       interrupt-parent = <&UIC2>;
+                       interrupts = <  /*TXEOB*/ 6 4
+                                       /*RXEOB*/ 7 4
+                                       /*SERR*/  3 4
+                                       /*TXDE*/  4 4
+                                       /*RXDE*/  5 4>;
+                       desc-base-addr-high = <8>;
+               };
+
+               POB0: opb {
+                       compatible = "ibm,opb-460gt", "ibm,opb";
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       ranges = <b0000000 4 b0000000 50000000>;
+                       clock-frequency = <0>; /* Filled in by U-Boot */
+
+                       EBC0: ebc {
+                               compatible = "ibm,ebc-460gt", "ibm,ebc";
+                               dcr-reg = <012 2>;
+                               #address-cells = <2>;
+                               #size-cells = <1>;
+                               clock-frequency = <0>; /* Filled in by U-Boot */
+                               interrupts = <6 4>;
+                               interrupt-parent = <&UIC1>;
+                       };
+
+                       UART0: serial@ef600300 {
+                               device_type = "serial";
+                               compatible = "ns16550";
+                               reg = <ef600300 8>;
+                               virtual-reg = <ef600300>;
+                               clock-frequency = <0>; /* Filled in by U-Boot */
+                               current-speed = <0>; /* Filled in by U-Boot */
+                               interrupt-parent = <&UIC1>;
+                               interrupts = <1 4>;
+                       };
+
+                       UART1: serial@ef600400 {
+                               device_type = "serial";
+                               compatible = "ns16550";
+                               reg = <ef600400 8>;
+                               virtual-reg = <ef600400>;
+                               clock-frequency = <0>; /* Filled in by U-Boot */
+                               current-speed = <0>; /* Filled in by U-Boot */
+                               interrupt-parent = <&UIC0>;
+                               interrupts = <1 4>;
+                       };
+
+                       UART2: serial@ef600500 {
+                               device_type = "serial";
+                               compatible = "ns16550";
+                               reg = <ef600500 8>;
+                               virtual-reg = <ef600500>;
+                               clock-frequency = <0>; /* Filled in by U-Boot */
+                               current-speed = <0>; /* Filled in by U-Boot */
+                               interrupt-parent = <&UIC1>;
+                               interrupts = <1d 4>;
+                       };
+
+                       UART3: serial@ef600600 {
+                               device_type = "serial";
+                               compatible = "ns16550";
+                               reg = <ef600600 8>;
+                               virtual-reg = <ef600600>;
+                               clock-frequency = <0>; /* Filled in by U-Boot */
+                               current-speed = <0>; /* Filled in by U-Boot */
+                               interrupt-parent = <&UIC1>;
+                               interrupts = <1e 4>;
+                       };
+
+                       IIC0: i2c@ef600700 {
+                               compatible = "ibm,iic-460gt", "ibm,iic";
+                               reg = <ef600700 14>;
+                               interrupt-parent = <&UIC0>;
+                               interrupts = <2 4>;
+                       };
+
+                       IIC1: i2c@ef600800 {
+                               compatible = "ibm,iic-460gt", "ibm,iic";
+                               reg = <ef600800 14>;
+                               interrupt-parent = <&UIC0>;
+                               interrupts = <3 4>;
+                       };
+
+                       ZMII0: emac-zmii@ef600d00 {
+                               compatible = "ibm,zmii-460gt", "ibm,zmii";
+                               reg = <ef600d00 c>;
+                       };
+
+                       RGMII0: emac-rgmii@ef601500 {
+                               compatible = "ibm,rgmii-460gt", "ibm,rgmii";
+                               reg = <ef601500 8>;
+                               has-mdio;
+                       };
+
+                       RGMII1: emac-rgmii@ef601600 {
+                               compatible = "ibm,rgmii-460gt", "ibm,rgmii";
+                               reg = <ef601600 8>;
+                               has-mdio;
+                       };
+
+                       TAH0: emac-tah@ef601350 {
+                               compatible = "ibm,tah-460gt", "ibm,tah";
+                               reg = <ef601350 30>;
+                       };
+
+                       TAH1: emac-tah@ef601450 {
+                               compatible = "ibm,tah-460gt", "ibm,tah";
+                               reg = <ef601450 30>;
+                       };
+
+                       EMAC0: ethernet@ef600e00 {
+                               device_type = "network";
+                               compatible = "ibm,emac-460gt", "ibm,emac4";
+                               interrupt-parent = <&EMAC0>;
+                               interrupts = <0 1>;
+                               #interrupt-cells = <1>;
+                               #address-cells = <0>;
+                               #size-cells = <0>;
+                               interrupt-map = </*Status*/ 0 &UIC2 10 4
+                                                /*Wake*/   1 &UIC2 14 4>;
+                               reg = <ef600e00 70>;
+                               local-mac-address = [000000000000]; /* Filled in by U-Boot */
+                               mal-device = <&MAL0>;
+                               mal-tx-channel = <0>;
+                               mal-rx-channel = <0>;
+                               cell-index = <0>;
+                               max-frame-size = <2328>;
+                               rx-fifo-size = <1000>;
+                               tx-fifo-size = <800>;
+                               phy-mode = "rgmii";
+                               phy-map = <00000000>;
+                               rgmii-device = <&RGMII0>;
+                               rgmii-channel = <0>;
+                               tah-device = <&TAH0>;
+                               tah-channel = <0>;
+                               has-inverted-stacr-oc;
+                               has-new-stacr-staopc;
+                       };
+
+                       EMAC1: ethernet@ef600f00 {
+                               device_type = "network";
+                               compatible = "ibm,emac-460gt", "ibm,emac4";
+                               interrupt-parent = <&EMAC1>;
+                               interrupts = <0 1>;
+                               #interrupt-cells = <1>;
+                               #address-cells = <0>;
+                               #size-cells = <0>;
+                               interrupt-map = </*Status*/ 0 &UIC2 11 4
+                                                /*Wake*/   1 &UIC2 15 4>;
+                               reg = <ef600f00 70>;
+                               local-mac-address = [000000000000]; /* Filled in by U-Boot */
+                               mal-device = <&MAL0>;
+                               mal-tx-channel = <1>;
+                               mal-rx-channel = <8>;
+                               cell-index = <1>;
+                               max-frame-size = <2328>;
+                               rx-fifo-size = <1000>;
+                               tx-fifo-size = <800>;
+                               phy-mode = "rgmii";
+                               phy-map = <00000000>;
+                               rgmii-device = <&RGMII0>;
+                               rgmii-channel = <1>;
+                               tah-device = <&TAH1>;
+                               tah-channel = <1>;
+                               has-inverted-stacr-oc;
+                               has-new-stacr-staopc;
+                               mdio-device = <&EMAC0>;
+                       };
+
+                       EMAC2: ethernet@ef601100 {
+                               device_type = "network";
+                               compatible = "ibm,emac-460gt", "ibm,emac4";
+                               interrupt-parent = <&EMAC2>;
+                               interrupts = <0 1>;
+                               #interrupt-cells = <1>;
+                               #address-cells = <0>;
+                               #size-cells = <0>;
+                               interrupt-map = </*Status*/ 0 &UIC2 12 4
+                                                /*Wake*/   1 &UIC2 16 4>;
+                               reg = <ef601100 70>;
+                               local-mac-address = [000000000000]; /* Filled in by U-Boot */
+                               mal-device = <&MAL0>;
+                               mal-tx-channel = <2>;
+                               mal-rx-channel = <10>;
+                               cell-index = <2>;
+                               max-frame-size = <2328>;
+                               rx-fifo-size = <1000>;
+                               tx-fifo-size = <800>;
+                               phy-mode = "rgmii";
+                               phy-map = <00000000>;
+                               rgmii-device = <&RGMII1>;
+                               rgmii-channel = <0>;
+                               has-inverted-stacr-oc;
+                               has-new-stacr-staopc;
+                               mdio-device = <&EMAC0>;
+                       };
+
+                       EMAC3: ethernet@ef601200 {
+                               device_type = "network";
+                               compatible = "ibm,emac-460gt", "ibm,emac4";
+                               interrupt-parent = <&EMAC3>;
+                               interrupts = <0 1>;
+                               #interrupt-cells = <1>;
+                               #address-cells = <0>;
+                               #size-cells = <0>;
+                               interrupt-map = </*Status*/ 0 &UIC2 13 4
+                                                /*Wake*/   1 &UIC2 17 4>;
+                               reg = <ef601200 70>;
+                               local-mac-address = [000000000000]; /* Filled in by U-Boot */
+                               mal-device = <&MAL0>;
+                               mal-tx-channel = <3>;
+                               mal-rx-channel = <18>;
+                               cell-index = <3>;
+                               max-frame-size = <2328>;
+                               rx-fifo-size = <1000>;
+                               tx-fifo-size = <800>;
+                               phy-mode = "rgmii";
+                               phy-map = <00000000>;
+                               rgmii-device = <&RGMII1>;
+                               rgmii-channel = <1>;
+                               has-inverted-stacr-oc;
+                               has-new-stacr-staopc;
+                               mdio-device = <&EMAC0>;
+                       };
+               };
+
+               PCIX0: pci@c0ec00000 {
+                       device_type = "pci";
+                       #interrupt-cells = <1>;
+                       #size-cells = <2>;
+                       #address-cells = <3>;
+                       compatible = "ibm,plb-pcix-460gt", "ibm,plb-pcix";
+                       primary;
+                       large-inbound-windows;
+                       enable-msi-hole;
+                       reg = <c 0ec00000   8   /* Config space access */
+                              0 0 0            /* no IACK cycles */
+                              c 0ed00000   4   /* Special cycles */
+                              c 0ec80000 100   /* Internal registers */
+                              c 0ec80100  fc>; /* Internal messaging registers */
+
+                       /* Outbound ranges, one memory and one IO,
+                        * later cannot be changed
+                        */
+                       ranges = <02000000 0 80000000 0000000d 80000000 0 80000000
+                                 01000000 0 00000000 0000000c 08000000 0 00010000>;
+
+                       /* Inbound 2GB range starting at 0 */
+                       dma-ranges = <42000000 0 0 0 0 0 80000000>;
+
+                       /* This drives busses 0 to 0x3f */
+                       bus-range = <0 3f>;
+
+                       /* All PCI interrupts are routed to ext IRQ 2 -> UIC1-0 */
+                       interrupt-map-mask = <0000 0 0 0>;
+                       interrupt-map = < 0000 0 0 0 &UIC1 0 8 >;
+               };
+
+               PCIE0: pciex@d00000000 {
+                       device_type = "pci";
+                       #interrupt-cells = <1>;
+                       #size-cells = <2>;
+                       #address-cells = <3>;
+                       compatible = "ibm,plb-pciex-460ex", "ibm,plb-pciex";
+                       primary;
+                       port = <0>; /* port number */
+                       reg = <d 00000000 20000000      /* Config space access */
+                              c 08010000 00001000>;    /* Registers */
+                       dcr-reg = <100 020>;
+                       sdr-base = <300>;
+
+                       /* Outbound ranges, one memory and one IO,
+                        * later cannot be changed
+                        */
+                       ranges = <02000000 0 80000000 0000000e 00000000 0 80000000
+                                 01000000 0 00000000 0000000f 80000000 0 00010000>;
+
+                       /* Inbound 2GB range starting at 0 */
+                       dma-ranges = <42000000 0 0 0 0 0 80000000>;
+
+                       /* This drives busses 40 to 0x7f */
+                       bus-range = <40 7f>;
+
+                       /* Legacy interrupts (note the weird polarity, the bridge seems
+                        * to invert PCIe legacy interrupts).
+                        * We are de-swizzling here because the numbers are actually for
+                        * port of the root complex virtual P2P bridge. But I want
+                        * to avoid putting a node for it in the tree, so the numbers
+                        * below are basically de-swizzled numbers.
+                        * The real slot is on idsel 0, so the swizzling is 1:1
+                        */
+                       interrupt-map-mask = <0000 0 0 7>;
+                       interrupt-map = <
+                               0000 0 0 1 &UIC3 c 4 /* swizzled int A */
+                               0000 0 0 2 &UIC3 d 4 /* swizzled int B */
+                               0000 0 0 3 &UIC3 e 4 /* swizzled int C */
+                               0000 0 0 4 &UIC3 f 4 /* swizzled int D */>;
+               };
+
+               PCIE1: pciex@d20000000 {
+                       device_type = "pci";
+                       #interrupt-cells = <1>;
+                       #size-cells = <2>;
+                       #address-cells = <3>;
+                       compatible = "ibm,plb-pciex-460ex", "ibm,plb-pciex";
+                       primary;
+                       port = <1>; /* port number */
+                       reg = <d 20000000 20000000      /* Config space access */
+                              c 08011000 00001000>;    /* Registers */
+                       dcr-reg = <120 020>;
+                       sdr-base = <340>;
+
+                       /* Outbound ranges, one memory and one IO,
+                        * later cannot be changed
+                        */
+                       ranges = <02000000 0 80000000 0000000e 80000000 0 80000000
+                                 01000000 0 00000000 0000000f 80010000 0 00010000>;
+
+                       /* Inbound 2GB range starting at 0 */
+                       dma-ranges = <42000000 0 0 0 0 0 80000000>;
+
+                       /* This drives busses 80 to 0xbf */
+                       bus-range = <80 bf>;
+
+                       /* Legacy interrupts (note the weird polarity, the bridge seems
+                        * to invert PCIe legacy interrupts).
+                        * We are de-swizzling here because the numbers are actually for
+                        * port of the root complex virtual P2P bridge. But I want
+                        * to avoid putting a node for it in the tree, so the numbers
+                        * below are basically de-swizzled numbers.
+                        * The real slot is on idsel 0, so the swizzling is 1:1
+                        */
+                       interrupt-map-mask = <0000 0 0 7>;
+                       interrupt-map = <
+                               0000 0 0 1 &UIC3 10 4 /* swizzled int A */
+                               0000 0 0 2 &UIC3 11 4 /* swizzled int B */
+                               0000 0 0 3 &UIC3 12 4 /* swizzled int C */
+                               0000 0 0 4 &UIC3 13 4 /* swizzled int D */>;
+               };
+       };
+};
index ae68fefc01b6a054b62eaaaffde5930e983e72dc..b5d95ac24dbf1bd1cb6d589aed908f31f3b152de 100644 (file)
@@ -12,7 +12,7 @@
        #address-cells = <1>;
        #size-cells = <1>;
        model = "amcc,haleakala";
-       compatible = "amcc,kilauea";
+       compatible = "amcc,haleakala", "amcc,kilauea";
        dcr-parent = <&/cpus/cpu@0>;
 
        aliases {
                                mal-tx-channel = <0>;
                                mal-rx-channel = <0>;
                                cell-index = <0>;
-                               max-frame-size = <5dc>;
+                               max-frame-size = <2328>;
                                rx-fifo-size = <1000>;
                                tx-fifo-size = <800>;
                                phy-mode = "rgmii";
index fc86e5a3afc47ebd16be1b2fc7115721d6d2f79e..cc2873a531d27727219fa20210d075b1ccdd3995 100644 (file)
                                mal-tx-channel = <0>;
                                mal-rx-channel = <0>;
                                cell-index = <0>;
-                               max-frame-size = <5dc>;
+                               max-frame-size = <2328>;
                                rx-fifo-size = <1000>;
                                tx-fifo-size = <800>;
                                phy-mode = "gmii";
index 8baef61f31cda349a98d21378cc18d12ff64613a..48c9a6e71f1a6eebd65a65879cb2b333ab1a062d 100644 (file)
                                mal-tx-channel = <0>;
                                mal-rx-channel = <0>;
                                cell-index = <0>;
-                               max-frame-size = <5dc>;
+                               max-frame-size = <2328>;
                                rx-fifo-size = <1000>;
                                tx-fifo-size = <800>;
                                phy-mode = "rgmii";
                                mal-tx-channel = <1>;
                                mal-rx-channel = <1>;
                                cell-index = <1>;
-                               max-frame-size = <5dc>;
+                               max-frame-size = <2328>;
                                rx-fifo-size = <1000>;
                                tx-fifo-size = <800>;
                                phy-mode = "rgmii";
diff --git a/arch/powerpc/boot/dts/ksi8560.dts b/arch/powerpc/boot/dts/ksi8560.dts
new file mode 100644 (file)
index 0000000..f869ce3
--- /dev/null
@@ -0,0 +1,267 @@
+/*
+ * Device Tree Source for Emerson KSI8560
+ *
+ * Author: Alexandr Smirnov <asmirnov@ru.mvista.com>
+ *
+ * Based on mpc8560ads.dts
+ *
+ * 2008 (c) MontaVista, Software, Inc.  This file is licensed under
+ * the terms of the GNU General Public License version 2.  This program
+ * is licensed "as is" without any warranty of any kind, whether express
+ * or implied.
+ *
+ */
+
+/dts-v1/;
+
+/ {
+       model = "KSI8560";
+       compatible = "emerson,KSI8560";
+       #address-cells = <1>;
+       #size-cells = <1>;
+
+       aliases {
+               ethernet0 = &enet0;
+               ethernet1 = &enet1;
+               ethernet2 = &enet2;
+       };
+
+       cpus {
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               PowerPC,8560@0 {
+                       device_type = "cpu";
+                       reg = <0>;
+                       d-cache-line-size = <32>;
+                       i-cache-line-size = <32>;
+                       d-cache-size = <0x8000>;                /* L1, 32K */
+                       i-cache-size = <0x8000>;                /* L1, 32K */
+                       timebase-frequency = <0>;               /* From U-boot */
+                       bus-frequency = <0>;                    /* From U-boot */
+                       clock-frequency = <0>;                  /* From U-boot */
+               };
+       };
+
+       memory {
+               device_type = "memory";
+               reg = <0x00000000 0x10000000>;                  /* Fixed by bootwrapper */
+       };
+
+       soc@fdf00000 {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               device_type = "soc";
+               ranges = <0x00000000 0xfdf00000 0x00100000>;
+               bus-frequency = <0>;                            /* Fixed by bootwrapper */
+
+               memory-controller@2000 {
+                       compatible = "fsl,8540-memory-controller";
+                       reg = <0x2000 0x1000>;
+                       interrupt-parent = <&MPIC>;
+                       interrupts = <0x12 0x2>;
+               };
+
+               l2-cache-controller@20000 {
+                       compatible = "fsl,8540-l2-cache-controller";
+                       reg = <0x20000 0x1000>;
+                       cache-line-size = <0x20>;               /* 32 bytes */
+                       cache-size = <0x40000>;                 /* L2, 256K */
+                       interrupt-parent = <&MPIC>;
+                       interrupts = <0x10 0x2>;
+               };
+
+               i2c@3000 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       cell-index = <0>;
+                       compatible = "fsl-i2c";
+                       reg = <0x3000 0x100>;
+                       interrupts = <0x2b 0x2>;
+                       interrupt-parent = <&MPIC>;
+                       dfsrr;
+               };
+
+               mdio@24520 {                                    /* For TSECs */
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       compatible = "fsl,gianfar-mdio";
+                       reg = <0x24520 0x20>;
+
+                       PHY1: ethernet-phy@1 {
+                               interrupt-parent = <&MPIC>;
+                               reg = <0x1>;
+                               device_type = "ethernet-phy";
+                       };
+
+                       PHY2: ethernet-phy@2 {
+                               interrupt-parent = <&MPIC>;
+                               reg = <0x2>;
+                               device_type = "ethernet-phy";
+                       };
+               };
+
+               enet0: ethernet@24000 {
+                       device_type = "network";
+                       model = "TSEC";
+                       compatible = "gianfar";
+                       reg = <0x24000 0x1000>;
+                       /* Mac address filled in by bootwrapper */
+                       local-mac-address = [ 00 00 00 00 00 00 ];
+                       interrupts = <0x1d 0x2 0x1e 0x2 0x22 0x2>;
+                       interrupt-parent = <&MPIC>;
+                       phy-handle = <&PHY1>;
+               };
+
+               enet1: ethernet@25000 {
+                       device_type = "network";
+                       model = "TSEC";
+                       compatible = "gianfar";
+                       reg = <0x25000 0x1000>;
+                       /* Mac address filled in by bootwrapper */
+                       local-mac-address = [ 00 00 00 00 00 00 ];
+                       interrupts = <0x23 0x2 0x24 0x2 0x28 0x2>;
+                       interrupt-parent = <&MPIC>;
+                       phy-handle = <&PHY2>;
+               };
+
+               MPIC: pic@40000 {
+                       #address-cells = <0>;
+                       #interrupt-cells = <2>;
+                       interrupt-controller;
+                       reg = <0x40000 0x40000>;
+                       device_type = "open-pic";
+               };
+
+               cpm@919c0 {
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       compatible = "fsl,mpc8560-cpm", "fsl,cpm2";
+                       reg = <0x919c0 0x30>;
+                       ranges;
+
+                       muram@80000 {
+                               #address-cells = <1>;
+                               #size-cells = <1>;
+                               ranges = <0x0 0x80000 0x10000>;
+
+                               data@0 {
+                                       compatible = "fsl,cpm-muram-data";
+                                       reg = <0x0 0x4000 0x9000 0x2000>;
+                               };
+                       };
+
+                       brg@919f0 {
+                               compatible = "fsl,mpc8560-brg",
+                                            "fsl,cpm2-brg",
+                                            "fsl,cpm-brg";
+                               reg = <0x919f0 0x10 0x915f0 0x10>;
+                               clock-frequency = <165000000>;  /* 166MHz */
+                       };
+
+                       CPMPIC: pic@90c00 {
+                               #address-cells = <0>;
+                               #interrupt-cells = <2>;
+                               interrupt-controller;
+                               interrupts = <0x2e 0x2>;
+                               interrupt-parent = <&MPIC>;
+                               reg = <0x90c00 0x80>;
+                               compatible = "fsl,mpc8560-cpm-pic", "fsl,cpm2-pic";
+                       };
+
+                       serial@91a00 {
+                               device_type = "serial";
+                               compatible = "fsl,mpc8560-scc-uart",
+                                            "fsl,cpm2-scc-uart";
+                               reg = <0x91a00 0x20 0x88000 0x100>;
+                               fsl,cpm-brg = <1>;
+                               fsl,cpm-command = <0x800000>;
+                               current-speed = <0x1c200>;
+                               interrupts = <0x28 0x8>;
+                               interrupt-parent = <&CPMPIC>;
+                       };
+
+                       serial@91a20 {
+                               device_type = "serial";
+                               compatible = "fsl,mpc8560-scc-uart",
+                                            "fsl,cpm2-scc-uart";
+                               reg = <0x91a20 0x20 0x88100 0x100>;
+                               fsl,cpm-brg = <2>;
+                               fsl,cpm-command = <0x4a00000>;
+                               current-speed = <0x1c200>;
+                               interrupts = <0x29 0x8>;
+                               interrupt-parent = <&CPMPIC>;
+                       };
+
+                       mdio@90d00 {                            /* For FCCs */
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                               compatible = "fsl,cpm2-mdio-bitbang";
+                               reg = <0x90d00 0x14>;
+                               fsl,mdio-pin = <24>;
+                               fsl,mdc-pin = <25>;
+
+                               PHY0: ethernet-phy@0 {
+                                       interrupt-parent = <&MPIC>;
+                                       reg = <0x0>;
+                                       device_type = "ethernet-phy";
+                               };
+                       };
+
+                       enet2: ethernet@91300 {
+                               device_type = "network";
+                               compatible = "fsl,mpc8560-fcc-enet",
+                                            "fsl,cpm2-fcc-enet";
+                               reg = <0x91300 0x20 0x88400 0x100 0x91390 0x1>;
+                               /* Mac address filled in by bootwrapper */
+                               local-mac-address = [ 00 00 00 00 00 00 ];
+                               fsl,cpm-command = <0x12000300>;
+                               interrupts = <0x20 0x8>;
+                               interrupt-parent = <&CPMPIC>;
+                               phy-handle = <&PHY0>;
+                       };
+               };
+       };
+
+       localbus@fdf05000 {
+               #address-cells = <2>;
+               #size-cells = <1>;
+               compatible = "fsl,mpc8560-localbus";
+               reg = <0xfdf05000 0x68>;
+
+               ranges = <0x0 0x0 0xe0000000 0x00800000
+                         0x4 0x0 0xe8080000 0x00080000>;
+
+               flash@0,0 {
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       compatible = "jedec-flash";
+                       reg = <0x0 0x0 0x800000>;
+                       bank-width = <0x2>;
+
+                       partition@0 {
+                               label = "Primary Kernel";
+                               reg = <0x0 0x180000>;
+                       };
+                       partition@180000 {
+                               label = "Primary Filesystem";
+                               reg = <0x180000 0x580000>;
+                       };
+                       partition@700000 {
+                               label = "Monitor";
+                               reg = <0x300000 0x100000>;
+                               read-only;
+                       };
+               };
+
+               cpld@4,0 {
+                       compatible = "emerson,KSI8560-cpld";
+                       reg = <0x4 0x0 0x80000>;
+               };
+       };
+
+
+       chosen {
+               linux,stdout-path = "/soc/cpm/serial@91a00";
+       };
+};
index 4469588545190ffce105c9e89c97be3c9f56a715..2e5a1a1812b6343fa2e82f806a3b99527c9354b7 100644 (file)
@@ -7,6 +7,7 @@
  * Based on sandpoint.dts
  *
  * 2006 (c) G. Liakhovetski <g.liakhovetski@gmx.de>
+ * Copyright 2008 Freescale Semiconductor, Inc.
  *
  * This file is licensed under
  * the terms of the GNU General Public License version 2.  This program
@@ -17,6 +18,8 @@ XXXX add flash parts, rtc, ??
 
  */
 
+/dts-v1/;
+
 / {
        model = "KuroboxHD";
        compatible = "linkstation";
@@ -35,19 +38,19 @@ XXXX add flash parts, rtc, ??
 
                PowerPC,603e { /* Really 8241 */
                        device_type = "cpu";
-                       reg = <0>;
-                       clock-frequency = <bebc200>;    /* Fixed by bootloader */
-                       timebase-frequency = <1743000>; /* Fixed by bootloader */
+                       reg = <0x0>;
+                       clock-frequency = <200000000>;  /* Fixed by bootloader */
+                       timebase-frequency = <24391680>; /* Fixed by bootloader */
                        bus-frequency = <0>;            /* Fixed by bootloader */
                        /* Following required by dtc but not used */
-                       i-cache-size = <4000>;
-                       d-cache-size = <4000>;
+                       i-cache-size = <0x4000>;
+                       d-cache-size = <0x4000>;
                };
        };
 
        memory {
                device_type = "memory";
-               reg = <00000000 04000000>;
+               reg = <0x0 0x4000000>;
        };
 
        soc10x { /* AFAICT need to make soc for 8245's uarts to be defined */
@@ -56,26 +59,26 @@ XXXX add flash parts, rtc, ??
                device_type = "soc";
                compatible = "mpc10x";
                store-gathering = <0>; /* 0 == off, !0 == on */
-               reg = <80000000 00100000>;
-               ranges = <80000000 80000000 70000000    /* pci mem space */
-                         fc000000 fc000000 00100000    /* EUMB */
-                         fe000000 fe000000 00c00000    /* pci i/o space */
-                         fec00000 fec00000 00300000    /* pci cfg regs */
-                         fef00000 fef00000 00100000>;  /* pci iack */
+               reg = <0x80000000 0x100000>;
+               ranges = <0x80000000 0x80000000 0x70000000      /* pci mem space */
+                         0xfc000000 0xfc000000 0x100000        /* EUMB */
+                         0xfe000000 0xfe000000 0xc00000        /* pci i/o space */
+                         0xfec00000 0xfec00000 0x300000        /* pci cfg regs */
+                         0xfef00000 0xfef00000 0x100000>;      /* pci iack */
 
                i2c@80003000 {
                        #address-cells = <1>;
                        #size-cells = <0>;
                        cell-index = <0>;
                        compatible = "fsl-i2c";
-                       reg = <80003000 1000>;
+                       reg = <0x80003000 0x1000>;
                        interrupts = <5 2>;
                        interrupt-parent = <&mpic>;
 
                        rtc@32 {
                                device_type = "rtc";
                                compatible = "ricoh,rs5c372a";
-                               reg = <32>;
+                               reg = <0x32>;
                        };
                };
 
@@ -83,9 +86,9 @@ XXXX add flash parts, rtc, ??
                        cell-index = <0>;
                        device_type = "serial";
                        compatible = "ns16550";
-                       reg = <80004500 8>;
-                       clock-frequency = <5d08d88>;
-                       current-speed = <2580>;
+                       reg = <0x80004500 0x8>;
+                       clock-frequency = <97553800>;
+                       current-speed = <9600>;
                        interrupts = <9 0>;
                        interrupt-parent = <&mpic>;
                };
@@ -94,10 +97,10 @@ XXXX add flash parts, rtc, ??
                        cell-index = <1>;
                        device_type = "serial";
                        compatible = "ns16550";
-                       reg = <80004600 8>;
-                       clock-frequency = <5d08d88>;
-                       current-speed = <e100>;
-                       interrupts = <a 0>;
+                       reg = <0x80004600 0x8>;
+                       clock-frequency = <97553800>;
+                       current-speed = <57600>;
+                       interrupts = <10 0>;
                        interrupt-parent = <&mpic>;
                };
 
@@ -107,7 +110,7 @@ XXXX add flash parts, rtc, ??
                        device_type = "open-pic";
                        compatible = "chrp,open-pic";
                        interrupt-controller;
-                       reg = <80040000 40000>;
+                       reg = <0x80040000 0x40000>;
                };
 
                pci0: pci@fec00000 {
@@ -116,29 +119,29 @@ XXXX add flash parts, rtc, ??
                        #interrupt-cells = <1>;
                        device_type = "pci";
                        compatible = "mpc10x-pci";
-                       reg = <fec00000 400000>;
-                       ranges = <01000000 0        0 fe000000 0 00c00000
-                                 02000000 0 80000000 80000000 0 70000000>;
-                       bus-range = <0 ff>;
-                       clock-frequency = <7f28155>;
+                       reg = <0xfec00000 0x400000>;
+                       ranges = <0x1000000 0x0        0x0 0xfe000000 0x0 0xc00000
+                                 0x2000000 0x0 0x80000000 0x80000000 0x0 0x70000000>;
+                       bus-range = <0 255>;
+                       clock-frequency = <133333333>;
                        interrupt-parent = <&mpic>;
-                       interrupt-map-mask = <f800 0 0 7>;
+                       interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
                        interrupt-map = <
                                /* IDSEL 11 - IRQ0 ETH */
-                               5800 0 0 1 &mpic 0 1
-                               5800 0 0 2 &mpic 1 1
-                               5800 0 0 3 &mpic 2 1
-                               5800 0 0 4 &mpic 3 1
+                               0x5800 0x0 0x0 0x1 &mpic 0x0 0x1
+                               0x5800 0x0 0x0 0x2 &mpic 0x1 0x1
+                               0x5800 0x0 0x0 0x3 &mpic 0x2 0x1
+                               0x5800 0x0 0x0 0x4 &mpic 0x3 0x1
                                /* IDSEL 12 - IRQ1 IDE0 */
-                               6000 0 0 1 &mpic 1 1
-                               6000 0 0 2 &mpic 2 1
-                               6000 0 0 3 &mpic 3 1
-                               6000 0 0 4 &mpic 0 1
+                               0x6000 0x0 0x0 0x1 &mpic 0x1 0x1
+                               0x6000 0x0 0x0 0x2 &mpic 0x2 0x1
+                               0x6000 0x0 0x0 0x3 &mpic 0x3 0x1
+                               0x6000 0x0 0x0 0x4 &mpic 0x0 0x1
                                /* IDSEL 14 - IRQ3 USB2.0 */
-                               7000 0 0 1 &mpic 3 1
-                               7000 0 0 2 &mpic 3 1
-                               7000 0 0 3 &mpic 3 1
-                               7000 0 0 4 &mpic 3 1
+                               0x7000 0x0 0x0 0x1 &mpic 0x3 0x1
+                               0x7000 0x0 0x0 0x2 &mpic 0x3 0x1
+                               0x7000 0x0 0x0 0x3 &mpic 0x3 0x1
+                               0x7000 0x0 0x0 0x4 &mpic 0x3 0x1
                        >;
                };
        };
index 8443c85b7b3096ba00a2ea439a0685e3ffb4e35f..e4916e69ad31fc33d9768875d679252a996144b1 100644 (file)
@@ -7,6 +7,7 @@
  * Based on sandpoint.dts
  *
  * 2006 (c) G. Liakhovetski <g.liakhovetski@gmx.de>
+ * Copyright 2008 Freescale Semiconductor, Inc.
  *
  * This file is licensed under
  * the terms of the GNU General Public License version 2.  This program
@@ -17,6 +18,8 @@ XXXX add flash parts, rtc, ??
 
  */
 
+/dts-v1/;
+
 / {
        model = "KuroboxHG";
        compatible = "linkstation";
@@ -35,19 +38,19 @@ XXXX add flash parts, rtc, ??
 
                PowerPC,603e { /* Really 8241 */
                        device_type = "cpu";
-                       reg = <0>;
-                       clock-frequency = <fdad680>;    /* Fixed by bootloader */
-                       timebase-frequency = <1F04000>; /* Fixed by bootloader */
+                       reg = <0x0>;
+                       clock-frequency = <266000000>;  /* Fixed by bootloader */
+                       timebase-frequency = <32522240>; /* Fixed by bootloader */
                        bus-frequency = <0>;            /* Fixed by bootloader */
                        /* Following required by dtc but not used */
-                       i-cache-size = <4000>;
-                       d-cache-size = <4000>;
+                       i-cache-size = <0x4000>;
+                       d-cache-size = <0x4000>;
                };
        };
 
        memory {
                device_type = "memory";
-               reg = <00000000 08000000>;
+               reg = <0x0 0x8000000>;
        };
 
        soc10x { /* AFAICT need to make soc for 8245's uarts to be defined */
@@ -56,26 +59,26 @@ XXXX add flash parts, rtc, ??
                device_type = "soc";
                compatible = "mpc10x";
                store-gathering = <0>; /* 0 == off, !0 == on */
-               reg = <80000000 00100000>;
-               ranges = <80000000 80000000 70000000    /* pci mem space */
-                         fc000000 fc000000 00100000    /* EUMB */
-                         fe000000 fe000000 00c00000    /* pci i/o space */
-                         fec00000 fec00000 00300000    /* pci cfg regs */
-                         fef00000 fef00000 00100000>;  /* pci iack */
+               reg = <0x80000000 0x100000>;
+               ranges = <0x80000000 0x80000000 0x70000000      /* pci mem space */
+                         0xfc000000 0xfc000000 0x100000        /* EUMB */
+                         0xfe000000 0xfe000000 0xc00000        /* pci i/o space */
+                         0xfec00000 0xfec00000 0x300000        /* pci cfg regs */
+                         0xfef00000 0xfef00000 0x100000>;      /* pci iack */
 
                i2c@80003000 {
                        #address-cells = <1>;
                        #size-cells = <0>;
                        cell-index = <0>;
                        compatible = "fsl-i2c";
-                       reg = <80003000 1000>;
+                       reg = <0x80003000 0x1000>;
                        interrupts = <5 2>;
                        interrupt-parent = <&mpic>;
 
                        rtc@32 {
                                device_type = "rtc";
                                compatible = "ricoh,rs5c372a";
-                               reg = <32>;
+                               reg = <0x32>;
                        };
                };
 
@@ -83,9 +86,9 @@ XXXX add flash parts, rtc, ??
                        cell-index = <0>;
                        device_type = "serial";
                        compatible = "ns16550";
-                       reg = <80004500 8>;
-                       clock-frequency = <7c044a8>;
-                       current-speed = <2580>;
+                       reg = <0x80004500 0x8>;
+                       clock-frequency = <130041000>;
+                       current-speed = <9600>;
                        interrupts = <9 0>;
                        interrupt-parent = <&mpic>;
                };
@@ -94,10 +97,10 @@ XXXX add flash parts, rtc, ??
                        cell-index = <1>;
                        device_type = "serial";
                        compatible = "ns16550";
-                       reg = <80004600 8>;
-                       clock-frequency = <7c044a8>;
-                       current-speed = <e100>;
-                       interrupts = <a 0>;
+                       reg = <0x80004600 0x8>;
+                       clock-frequency = <130041000>;
+                       current-speed = <57600>;
+                       interrupts = <10 0>;
                        interrupt-parent = <&mpic>;
                };
 
@@ -107,7 +110,7 @@ XXXX add flash parts, rtc, ??
                        device_type = "open-pic";
                        compatible = "chrp,open-pic";
                        interrupt-controller;
-                       reg = <80040000 40000>;
+                       reg = <0x80040000 0x40000>;
                };
 
                pci0: pci@fec00000 {
@@ -116,29 +119,29 @@ XXXX add flash parts, rtc, ??
                        #interrupt-cells = <1>;
                        device_type = "pci";
                        compatible = "mpc10x-pci";
-                       reg = <fec00000 400000>;
-                       ranges = <01000000 0        0 fe000000 0 00c00000
-                                 02000000 0 80000000 80000000 0 70000000>;
-                       bus-range = <0 ff>;
-                       clock-frequency = <7f28155>;
+                       reg = <0xfec00000 0x400000>;
+                       ranges = <0x1000000 0x0        0x0 0xfe000000 0x0 0xc00000
+                                 0x2000000 0x0 0x80000000 0x80000000 0x0 0x70000000>;
+                       bus-range = <0 255>;
+                       clock-frequency = <133333333>;
                        interrupt-parent = <&mpic>;
-                       interrupt-map-mask = <f800 0 0 7>;
+                       interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
                        interrupt-map = <
                                /* IDSEL 11 - IRQ0 ETH */
-                               5800 0 0 1 &mpic 0 1
-                               5800 0 0 2 &mpic 1 1
-                               5800 0 0 3 &mpic 2 1
-                               5800 0 0 4 &mpic 3 1
+                               0x5800 0x0 0x0 0x1 &mpic 0x0 0x1
+                               0x5800 0x0 0x0 0x2 &mpic 0x1 0x1
+                               0x5800 0x0 0x0 0x3 &mpic 0x2 0x1
+                               0x5800 0x0 0x0 0x4 &mpic 0x3 0x1
                                /* IDSEL 12 - IRQ1 IDE0 */
-                               6000 0 0 1 &mpic 1 1
-                               6000 0 0 2 &mpic 2 1
-                               6000 0 0 3 &mpic 3 1
-                               6000 0 0 4 &mpic 0 1
+                               0x6000 0x0 0x0 0x1 &mpic 0x1 0x1
+                               0x6000 0x0 0x0 0x2 &mpic 0x2 0x1
+                               0x6000 0x0 0x0 0x3 &mpic 0x3 0x1
+                               0x6000 0x0 0x0 0x4 &mpic 0x0 0x1
                                /* IDSEL 14 - IRQ3 USB2.0 */
-                               7000 0 0 1 &mpic 3 1
-                               7000 0 0 2 &mpic 3 1
-                               7000 0 0 3 &mpic 3 1
-                               7000 0 0 4 &mpic 3 1
+                               0x7000 0x0 0x0 0x1 &mpic 0x3 0x1
+                               0x7000 0x0 0x0 0x2 &mpic 0x3 0x1
+                               0x7000 0x0 0x0 0x3 &mpic 0x3 0x1
+                               0x7000 0x0 0x0 0x4 &mpic 0x3 0x1
                        >;
                };
        };
index 710c011681790ea89562d783aa3fee28b72c56af..84cc5e72ddd845afd9348d614b7dd1c37b15443d 100644 (file)
                                mal-tx-channel = <0>;
                                mal-rx-channel = <0>;
                                cell-index = <0>;
-                               max-frame-size = <5dc>;
+                               max-frame-size = <2328>;
                                rx-fifo-size = <1000>;
                                tx-fifo-size = <800>;
                                phy-mode = "rgmii";
                                mal-tx-channel = <1>;
                                mal-rx-channel = <1>;
                                cell-index = <1>;
-                               max-frame-size = <5dc>;
+                               max-frame-size = <2328>;
                                rx-fifo-size = <1000>;
                                tx-fifo-size = <800>;
                                phy-mode = "rgmii";
index 8fb5423874365da12ca167cb5fbe10c11bbbdae8..4936349b87cd6eabb8a1649642d7ed7a4829be8a 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * MPC7448HPC2 (Taiga) board Device Tree Source
  *
- * Copyright 2006 Freescale Semiconductor Inc.
+ * Copyright 2006, 2008 Freescale Semiconductor Inc.
  * 2006 Roy Zang <Roy Zang at freescale.com>.
  *
  * This program is free software; you can redistribute  it and/or modify it
@@ -10,6 +10,7 @@
  * option) any later version.
  */
 
+/dts-v1/;
 
 / {
        model = "mpc7448hpc2";
                                
                PowerPC,7448@0 {
                        device_type = "cpu";
-                       reg = <0>;
-                       d-cache-line-size = <20>;       // 32 bytes
-                       i-cache-line-size = <20>;       // 32 bytes
-                       d-cache-size = <8000>;          // L1, 32K bytes
-                       i-cache-size = <8000>;          // L1, 32K bytes
+                       reg = <0x0>;
+                       d-cache-line-size = <32>;       // 32 bytes
+                       i-cache-line-size = <32>;       // 32 bytes
+                       d-cache-size = <0x8000>;                // L1, 32K bytes
+                       i-cache-size = <0x8000>;                // L1, 32K bytes
                        timebase-frequency = <0>;       // 33 MHz, from uboot
                        clock-frequency = <0>;          // From U-Boot
                        bus-frequency = <0>;            // From U-Boot
@@ -36,7 +37,7 @@
 
        memory {
                device_type = "memory";
-               reg = <00000000 20000000        // DDR2   512M at 0
+               reg = <0x0 0x20000000   // DDR2   512M at 0
                       >;
        };
 
                #address-cells = <1>;
                #size-cells = <1>;
                device_type = "tsi-bridge";
-               ranges = <00000000 c0000000 00010000>;
-               reg = <c0000000 00010000>;
+               ranges = <0x0 0xc0000000 0x10000>;
+               reg = <0xc0000000 0x10000>;
                bus-frequency = <0>;
 
                i2c@7000 {
                        interrupt-parent = <&mpic>;
-                       interrupts = <E 0>;
-                       reg = <7000 400>;
+                       interrupts = <14 0>;
+                       reg = <0x7000 0x400>;
                        device_type = "i2c";
                        compatible  = "tsi108-i2c";
                };
                MDIO: mdio@6000 {
                        device_type = "mdio";
                        compatible = "tsi108-mdio";
-                       reg = <6000 50>;
+                       reg = <0x6000 0x50>;
                        #address-cells = <1>;
                        #size-cells = <0>;
 
                        phy8: ethernet-phy@8 {
                                interrupt-parent = <&mpic>;
                                interrupts = <2 1>;
-                               reg = <8>;
+                               reg = <0x8>;
                        };
 
                        phy9: ethernet-phy@9 {
                                interrupt-parent = <&mpic>;
                                interrupts = <2 1>;
-                               reg = <9>;
+                               reg = <0x9>;
                        };
 
                };
@@ -82,9 +83,9 @@
                        #size-cells = <0>;
                        device_type = "network";
                        compatible = "tsi108-ethernet";
-                       reg = <6000 200>;
+                       reg = <0x6000 0x200>;
                        address = [ 00 06 D2 00 00 01 ];
-                       interrupts = <10 2>;
+                       interrupts = <16 2>;
                        interrupt-parent = <&mpic>;
                        mdio-handle = <&MDIO>;
                        phy-handle = <&phy8>;
@@ -96,9 +97,9 @@
                        #size-cells = <0>;
                        device_type = "network";
                        compatible = "tsi108-ethernet";
-                       reg = <6400 200>;
+                       reg = <0x6400 0x200>;
                        address = [ 00 06 D2 00 00 02 ];
-                       interrupts = <11 2>;
+                       interrupts = <17 2>;
                        interrupt-parent = <&mpic>;
                        mdio-handle = <&MDIO>;
                        phy-handle = <&phy9>;
                serial@7808 {
                        device_type = "serial";
                        compatible = "ns16550";
-                       reg = <7808 200>;
-                       clock-frequency = <3f6b5a00>;
-                       interrupts = <c 0>;
+                       reg = <0x7808 0x200>;
+                       clock-frequency = <1064000000>;
+                       interrupts = <12 0>;
                        interrupt-parent = <&mpic>;
                };
 
                serial@7c08 {
                        device_type = "serial";
                        compatible = "ns16550";
-                       reg = <7c08 200>;
-                       clock-frequency = <3f6b5a00>;
-                       interrupts = <d 0>;
+                       reg = <0x7c08 0x200>;
+                       clock-frequency = <1064000000>;
+                       interrupts = <13 0>;
                        interrupt-parent = <&mpic>;
                };
 
                        interrupt-controller;
                        #address-cells = <0>;
                        #interrupt-cells = <2>;
-                       reg = <7400 400>;
+                       reg = <0x7400 0x400>;
                        compatible = "chrp,open-pic";
                        device_type = "open-pic";
                                big-endian;
                        #interrupt-cells = <1>;
                        #size-cells = <2>;
                        #address-cells = <3>;
-                       reg = <1000 1000>;
+                       reg = <0x1000 0x1000>;
                        bus-range = <0 0>;
-                       ranges = <02000000 0 e0000000 e0000000 0 1A000000       
-                                 01000000 0 00000000 fa000000 0 00010000>;
-                       clock-frequency = <7f28154>;
+                       ranges = <0x2000000 0x0 0xe0000000 0xe0000000 0x0 0x1a000000    
+                                 0x1000000 0x0 0x0 0xfa000000 0x0 0x10000>;
+                       clock-frequency = <133333332>;
                        interrupt-parent = <&mpic>;
-                       interrupts = <17 2>;
-                       interrupt-map-mask = <f800 0 0 7>;
+                       interrupts = <23 2>;
+                       interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
                        interrupt-map = <
 
                                /* IDSEL 0x11 */
-                               0800 0 0 1 &RT0 24 0
-                               0800 0 0 2 &RT0 25 0
-                               0800 0 0 3 &RT0 26 0
-                               0800 0 0 4 &RT0 27 0
+                               0x800 0x0 0x0 0x1 &RT0 0x24 0x0
+                               0x800 0x0 0x0 0x2 &RT0 0x25 0x0
+                               0x800 0x0 0x0 0x3 &RT0 0x26 0x0
+                               0x800 0x0 0x0 0x4 &RT0 0x27 0x0
 
                                /* IDSEL 0x12 */
-                               1000 0 0 1 &RT0 25 0
-                               1000 0 0 2 &RT0 26 0
-                               1000 0 0 3 &RT0 27 0
-                               1000 0 0 4 &RT0 24 0
+                               0x1000 0x0 0x0 0x1 &RT0 0x25 0x0
+                               0x1000 0x0 0x0 0x2 &RT0 0x26 0x0
+                               0x1000 0x0 0x0 0x3 &RT0 0x27 0x0
+                               0x1000 0x0 0x0 0x4 &RT0 0x24 0x0
 
                                /* IDSEL 0x13 */
-                               1800 0 0 1 &RT0 26 0
-                               1800 0 0 2 &RT0 27 0
-                               1800 0 0 3 &RT0 24 0
-                               1800 0 0 4 &RT0 25 0
+                               0x1800 0x0 0x0 0x1 &RT0 0x26 0x0
+                               0x1800 0x0 0x0 0x2 &RT0 0x27 0x0
+                               0x1800 0x0 0x0 0x3 &RT0 0x24 0x0
+                               0x1800 0x0 0x0 0x4 &RT0 0x25 0x0
 
                                /* IDSEL 0x14 */
-                               2000 0 0 1 &RT0 27 0
-                               2000 0 0 2 &RT0 24 0
-                               2000 0 0 3 &RT0 25 0
-                               2000 0 0 4 &RT0 26 0
+                               0x2000 0x0 0x0 0x1 &RT0 0x27 0x0
+                               0x2000 0x0 0x0 0x2 &RT0 0x24 0x0
+                               0x2000 0x0 0x0 0x3 &RT0 0x25 0x0
+                               0x2000 0x0 0x0 0x4 &RT0 0x26 0x0
                                >;
 
                        RT0: router@1180 {
                                #address-cells = <0>;
                                #interrupt-cells = <2>;
                                big-endian;
-                               interrupts = <17 2>;
+                               interrupts = <23 2>;
                                interrupt-parent = <&mpic>;
                        };
                };
index 7285ca1325fdeb8892306e6cc44ae6f3f2c43525..46e2da30c3dd2b895e5e9c9a575855a736359086 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * MPC8272 ADS Device Tree Source
  *
- * Copyright 2005 Freescale Semiconductor Inc.
+ * Copyright 2005,2008 Freescale Semiconductor Inc.
  *
  * This program is free software; you can redistribute  it and/or modify it
  * under  the terms of  the GNU General  Public License as published by the
@@ -9,6 +9,8 @@
  * option) any later version.
  */
 
+/dts-v1/;
+
 / {
        model = "MPC8272ADS";
        compatible = "fsl,mpc8272ads";
 
                PowerPC,8272@0 {
                        device_type = "cpu";
-                       reg = <0>;
-                       d-cache-line-size = <d#32>;
-                       i-cache-line-size = <d#32>;
-                       d-cache-size = <d#16384>;
-                       i-cache-size = <d#16384>;
+                       reg = <0x0>;
+                       d-cache-line-size = <32>;
+                       i-cache-line-size = <32>;
+                       d-cache-size = <16384>;
+                       i-cache-size = <16384>;
                        timebase-frequency = <0>;
                        bus-frequency = <0>;
                        clock-frequency = <0>;
@@ -34,7 +36,7 @@
 
        memory {
                device_type = "memory";
-               reg = <0 0>;
+               reg = <0x0 0x0>;
        };
 
        localbus@f0010100 {
                             "fsl,pq2-localbus";
                #address-cells = <2>;
                #size-cells = <1>;
-               reg = <f0010100 40>;
+               reg = <0xf0010100 0x40>;
 
-               ranges = <0 0 fe000000 02000000
-                         1 0 f4500000 00008000
-                         3 0 f8200000 00008000>;
+               ranges = <0x0 0x0 0xfe000000 0x2000000
+                         0x1 0x0 0xf4500000 0x8000
+                         0x3 0x0 0xf8200000 0x8000>;
 
                flash@0,0 {
                        compatible = "jedec-flash";
-                       reg = <0 0 2000000>;
+                       reg = <0x0 0x0 0x2000000>;
                        bank-width = <4>;
                        device-width = <1>;
                };
 
                board-control@1,0 {
-                       reg = <1 0 20>;
+                       reg = <0x1 0x0 0x20>;
                        compatible = "fsl,mpc8272ads-bcsr";
                };
 
                                     "fsl,pq2ads-pci-pic";
                        #interrupt-cells = <1>;
                        interrupt-controller;
-                       reg = <3 0 8>;
+                       reg = <0x3 0x0 0x8>;
                        interrupt-parent = <&PIC>;
-                       interrupts = <14 8>;
+                       interrupts = <20 8>;
                };
        };
 
 
        pci@f0010800 {
                device_type = "pci";
-               reg = <f0010800 10c f00101ac 8 f00101c4 8>;
+               reg = <0xf0010800 0x10c 0xf00101ac 0x8 0xf00101c4 0x8>;
                compatible = "fsl,mpc8272-pci", "fsl,pq2-pci";
                #interrupt-cells = <1>;
                #size-cells = <2>;
                #address-cells = <3>;
-               clock-frequency = <d#66666666>;
-               interrupt-map-mask = <f800 0 0 7>;
+               clock-frequency = <66666666>;
+               interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
                interrupt-map = <
                                 /* IDSEL 0x16 */
-                                b000 0 0 1 &PCI_PIC 0
-                                b000 0 0 2 &PCI_PIC 1
-                                b000 0 0 3 &PCI_PIC 2
-                                b000 0 0 4 &PCI_PIC 3
+                                0xb000 0x0 0x0 0x1 &PCI_PIC 0
+                                0xb000 0x0 0x0 0x2 &PCI_PIC 1
+                                0xb000 0x0 0x0 0x3 &PCI_PIC 2
+                                0xb000 0x0 0x0 0x4 &PCI_PIC 3
 
                                 /* IDSEL 0x17 */
-                                b800 0 0 1 &PCI_PIC 4
-                                b800 0 0 2 &PCI_PIC 5
-                                b800 0 0 3 &PCI_PIC 6
-                                b800 0 0 4 &PCI_PIC 7
+                                0xb800 0x0 0x0 0x1 &PCI_PIC 4
+                                0xb800 0x0 0x0 0x2 &PCI_PIC 5
+                                0xb800 0x0 0x0 0x3 &PCI_PIC 6
+                                0xb800 0x0 0x0 0x4 &PCI_PIC 7
 
                                 /* IDSEL 0x18 */
-                                c000 0 0 1 &PCI_PIC 8
-                                c000 0 0 2 &PCI_PIC 9
-                                c000 0 0 3 &PCI_PIC a
-                                c000 0 0 4 &PCI_PIC b>;
+                                0xc000 0x0 0x0 0x1 &PCI_PIC 8
+                                0xc000 0x0 0x0 0x2 &PCI_PIC 9
+                                0xc000 0x0 0x0 0x3 &PCI_PIC 10
+                                0xc000 0x0 0x0 0x4 &PCI_PIC 11>;
 
                interrupt-parent = <&PIC>;
-               interrupts = <12 8>;
-               ranges = <42000000 0 80000000 80000000 0 20000000
-                         02000000 0 a0000000 a0000000 0 20000000
-                         01000000 0 00000000 f6000000 0 02000000>;
+               interrupts = <18 8>;
+               ranges = <0x42000000 0x0 0x80000000 0x80000000 0x0 0x20000000
+                         0x2000000 0x0 0xa0000000 0xa0000000 0x0 0x20000000
+                         0x1000000 0x0 0x0 0xf6000000 0x0 0x2000000>;
        };
 
        soc@f0000000 {
                #size-cells = <1>;
                device_type = "soc";
                compatible = "fsl,mpc8272", "fsl,pq2-soc";
-               ranges = <00000000 f0000000 00053000>;
+               ranges = <0x0 0xf0000000 0x53000>;
 
                // Temporary -- will go away once kernel uses ranges for get_immrbase().
-               reg = <f0000000 00053000>;
+               reg = <0xf0000000 0x53000>;
 
                cpm@119c0 {
                        #address-cells = <1>;
                        #size-cells = <1>;
                        compatible = "fsl,mpc8272-cpm", "fsl,cpm2";
-                       reg = <119c0 30>;
+                       reg = <0x119c0 0x30>;
                        ranges;
 
                        muram@0 {
                                #address-cells = <1>;
                                #size-cells = <1>;
-                               ranges = <0 0 10000>;
+                               ranges = <0x0 0x0 0x10000>;
 
                                data@0 {
                                        compatible = "fsl,cpm-muram-data";
-                                       reg = <0 2000 9800 800>;
+                                       reg = <0x0 0x2000 0x9800 0x800>;
                                };
                        };
 
                                compatible = "fsl,mpc8272-brg",
                                             "fsl,cpm2-brg",
                                             "fsl,cpm-brg";
-                               reg = <119f0 10 115f0 10>;
+                               reg = <0x119f0 0x10 0x115f0 0x10>;
                        };
 
                        serial@11a00 {
                                device_type = "serial";
                                compatible = "fsl,mpc8272-scc-uart",
                                             "fsl,cpm2-scc-uart";
-                               reg = <11a00 20 8000 100>;
-                               interrupts = <28 8>;
+                               reg = <0x11a00 0x20 0x8000 0x100>;
+                               interrupts = <40 8>;
                                interrupt-parent = <&PIC>;
                                fsl,cpm-brg = <1>;
-                               fsl,cpm-command = <00800000>;
+                               fsl,cpm-command = <0x800000>;
                        };
 
                        serial@11a60 {
                                device_type = "serial";
                                compatible = "fsl,mpc8272-scc-uart",
                                             "fsl,cpm2-scc-uart";
-                               reg = <11a60 20 8300 100>;
-                               interrupts = <2b 8>;
+                               reg = <0x11a60 0x20 0x8300 0x100>;
+                               interrupts = <43 8>;
                                interrupt-parent = <&PIC>;
                                fsl,cpm-brg = <4>;
-                               fsl,cpm-command = <0ce00000>;
+                               fsl,cpm-command = <0xce00000>;
                        };
 
                        mdio@10d40 {
                                compatible = "fsl,mpc8272ads-mdio-bitbang",
                                             "fsl,mpc8272-mdio-bitbang",
                                             "fsl,cpm2-mdio-bitbang";
-                               reg = <10d40 14>;
+                               reg = <0x10d40 0x14>;
                                #address-cells = <1>;
                                #size-cells = <0>;
-                               fsl,mdio-pin = <12>;
-                               fsl,mdc-pin = <13>;
+                               fsl,mdio-pin = <18>;
+                               fsl,mdc-pin = <19>;
 
                                PHY0: ethernet-phy@0 {
                                        interrupt-parent = <&PIC>;
-                                       interrupts = <17 8>;
-                                       reg = <0>;
+                                       interrupts = <23 8>;
+                                       reg = <0x0>;
                                        device_type = "ethernet-phy";
                                };
 
                                PHY1: ethernet-phy@1 {
                                        interrupt-parent = <&PIC>;
-                                       interrupts = <17 8>;
-                                       reg = <3>;
+                                       interrupts = <23 8>;
+                                       reg = <0x3>;
                                        device_type = "ethernet-phy";
                                };
                        };
                                device_type = "network";
                                compatible = "fsl,mpc8272-fcc-enet",
                                             "fsl,cpm2-fcc-enet";
-                               reg = <11300 20 8400 100 11390 1>;
+                               reg = <0x11300 0x20 0x8400 0x100 0x11390 0x1>;
                                local-mac-address = [ 00 00 00 00 00 00 ];
-                               interrupts = <20 8>;
+                               interrupts = <32 8>;
                                interrupt-parent = <&PIC>;
                                phy-handle = <&PHY0>;
                                linux,network-index = <0>;
-                               fsl,cpm-command = <12000300>;
+                               fsl,cpm-command = <0x12000300>;
                        };
 
                        ethernet@11320 {
                                device_type = "network";
                                compatible = "fsl,mpc8272-fcc-enet",
                                             "fsl,cpm2-fcc-enet";
-                               reg = <11320 20 8500 100 113b0 1>;
+                               reg = <0x11320 0x20 0x8500 0x100 0x113b0 0x1>;
                                local-mac-address = [ 00 00 00 00 00 00 ];
-                               interrupts = <21 8>;
+                               interrupts = <33 8>;
                                interrupt-parent = <&PIC>;
                                phy-handle = <&PHY1>;
                                linux,network-index = <1>;
-                               fsl,cpm-command = <16200300>;
+                               fsl,cpm-command = <0x16200300>;
                        };
                };
 
                PIC: interrupt-controller@10c00 {
                        #interrupt-cells = <2>;
                        interrupt-controller;
-                       reg = <10c00 80>;
+                       reg = <0x10c00 0x80>;
                        compatible = "fsl,mpc8272-pic", "fsl,cpm2-pic";
                };
 
                                     "fsl,talitos-sec2",
                                     "fsl,talitos",
                                     "talitos";
-                       reg = <30000 10000>;
-                       interrupts = <b 8>;
+                       reg = <0x30000 0x10000>;
+                       interrupts = <11 8>;
                        interrupt-parent = <&PIC>;
                        num-channels = <4>;
-                       channel-fifo-len = <18>;
-                       exec-units-mask = <0000007e>;
+                       channel-fifo-len = <24>;
+                       exec-units-mask = <0x7e>;
 /* desc mask is for rev1.x, we need runtime fixup for >=2.x */
-                       descriptor-types-mask = <01010ebf>;
+                       descriptor-types-mask = <0x1010ebf>;
                };
        };
 
index 9bb408371bcd555fd46e4fc0aeb16fc3561db27b..539e02fb35266e12d21bf1327b3e8675ca0d3dfe 100644 (file)
                enet0: ucc@2200 {
                        device_type = "network";
                        compatible = "ucc_geth";
-                       model = "UCC";
                        cell-index = <3>;
-                       device-id = <3>;
                        reg = <0x2200 0x200>;
                        interrupts = <34>;
                        interrupt-parent = <&qeic>;
                enet1: ucc@3200 {
                        device_type = "network";
                        compatible = "ucc_geth";
-                       model = "UCC";
                        cell-index = <4>;
-                       device-id = <4>;
                        reg = <0x3200 0x200>;
                        interrupts = <35>;
                        interrupt-parent = <&qeic>;
                ucc@2400 {
                        device_type = "serial";
                        compatible = "ucc_uart";
-                       model = "UCC";
-                       device-id = <5>;        /* The UCC number, 1-7*/
+                       cell-index = <5>;       /* The UCC number, 1-7*/
                        port-number = <0>;      /* Which ttyQEx device */
                        soft-uart;              /* We need Soft-UART */
                        reg = <0x2400 0x200>;
index 94f93d209de82e10660eda645d23d8ba0155aab3..179c81c6a7acb5272866919ada396c4a46990971 100644 (file)
                enet0: ucc@3000 {
                        device_type = "network";
                        compatible = "ucc_geth";
-                       model = "UCC";
                        cell-index = <2>;
-                       device-id = <2>;
                        reg = <0x3000 0x200>;
                        interrupts = <33>;
                        interrupt-parent = <&qeic>;
                enet1: ucc@2200 {
                        device_type = "network";
                        compatible = "ucc_geth";
-                       model = "UCC";
                        cell-index = <3>;
-                       device-id = <3>;
                        reg = <0x2200 0x200>;
                        interrupts = <34>;
                        interrupt-parent = <&qeic>;
index 55f03e8dc97f3f7f0d0ff7c140b48a9d09ba0217..8160ff24e87ed811f425a068cec1b4f757a081d2 100644 (file)
                enet0: ucc@2000 {
                        device_type = "network";
                        compatible = "ucc_geth";
-                       model = "UCC";
                        cell-index = <1>;
-                       device-id = <1>;
                        reg = <0x2000 0x200>;
                        interrupts = <32>;
                        interrupt-parent = <&qeic>;
                enet1: ucc@3000 {
                        device_type = "network";
                        compatible = "ucc_geth";
-                       model = "UCC";
                        cell-index = <2>;
-                       device-id = <2>;
                        reg = <0x3000 0x200>;
                        interrupts = <33>;
                        interrupt-parent = <&qeic>;
index 975248491b7b9dcb258a5377781a07d0ae6ed12f..18033ed0b5356319332b71b035fbda62d87b25c5 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * MPC8540 ADS Device Tree Source
  *
- * Copyright 2006 Freescale Semiconductor Inc.
+ * Copyright 2006, 2008 Freescale Semiconductor Inc.
  *
  * This program is free software; you can redistribute  it and/or modify it
  * under  the terms of  the GNU General  Public License as published by the
@@ -9,6 +9,7 @@
  * option) any later version.
  */
 
+/dts-v1/;
 
 / {
        model = "MPC8540ADS";
 
                PowerPC,8540@0 {
                        device_type = "cpu";
-                       reg = <0>;
-                       d-cache-line-size = <20>;       // 32 bytes
-                       i-cache-line-size = <20>;       // 32 bytes
-                       d-cache-size = <8000>;          // L1, 32K
-                       i-cache-size = <8000>;          // L1, 32K
+                       reg = <0x0>;
+                       d-cache-line-size = <32>;       // 32 bytes
+                       i-cache-line-size = <32>;       // 32 bytes
+                       d-cache-size = <0x8000>;                // L1, 32K
+                       i-cache-size = <0x8000>;                // L1, 32K
                        timebase-frequency = <0>;       //  33 MHz, from uboot
                        bus-frequency = <0>;    // 166 MHz
                        clock-frequency = <0>;  // 825 MHz, from uboot
 
        memory {
                device_type = "memory";
-               reg = <00000000 08000000>;      // 128M at 0x0
+               reg = <0x0 0x8000000>;  // 128M at 0x0
        };
 
        soc8540@e0000000 {
                #address-cells = <1>;
                #size-cells = <1>;
                device_type = "soc";
-               ranges = <0 e0000000 00100000>;
-               reg = <e0000000 00100000>;      // CCSRBAR 1M
+               ranges = <0x0 0xe0000000 0x100000>;
+               reg = <0xe0000000 0x100000>;    // CCSRBAR 1M
                bus-frequency = <0>;
 
                memory-controller@2000 {
                        compatible = "fsl,8540-memory-controller";
-                       reg = <2000 1000>;
+                       reg = <0x2000 0x1000>;
                        interrupt-parent = <&mpic>;
-                       interrupts = <12 2>;
+                       interrupts = <18 2>;
                };
 
                l2-cache-controller@20000 {
                        compatible = "fsl,8540-l2-cache-controller";
-                       reg = <20000 1000>;
-                       cache-line-size = <20>; // 32 bytes
-                       cache-size = <40000>;   // L2, 256K
+                       reg = <0x20000 0x1000>;
+                       cache-line-size = <32>; // 32 bytes
+                       cache-size = <0x40000>; // L2, 256K
                        interrupt-parent = <&mpic>;
-                       interrupts = <10 2>;
+                       interrupts = <16 2>;
                };
 
                i2c@3000 {
@@ -76,8 +77,8 @@
                        #size-cells = <0>;
                        cell-index = <0>;
                        compatible = "fsl-i2c";
-                       reg = <3000 100>;
-                       interrupts = <2b 2>;
+                       reg = <0x3000 0x100>;
+                       interrupts = <43 2>;
                        interrupt-parent = <&mpic>;
                        dfsrr;
                };
                        #address-cells = <1>;
                        #size-cells = <0>;
                        compatible = "fsl,gianfar-mdio";
-                       reg = <24520 20>;
+                       reg = <0x24520 0x20>;
 
                        phy0: ethernet-phy@0 {
                                interrupt-parent = <&mpic>;
                                interrupts = <5 1>;
-                               reg = <0>;
+                               reg = <0x0>;
                                device_type = "ethernet-phy";
                        };
                        phy1: ethernet-phy@1 {
                                interrupt-parent = <&mpic>;
                                interrupts = <5 1>;
-                               reg = <1>;
+                               reg = <0x1>;
                                device_type = "ethernet-phy";
                        };
                        phy3: ethernet-phy@3 {
                                interrupt-parent = <&mpic>;
                                interrupts = <7 1>;
-                               reg = <3>;
+                               reg = <0x3>;
                                device_type = "ethernet-phy";
                        };
                };
                        device_type = "network";
                        model = "TSEC";
                        compatible = "gianfar";
-                       reg = <24000 1000>;
+                       reg = <0x24000 0x1000>;
                        local-mac-address = [ 00 00 00 00 00 00 ];
-                       interrupts = <1d 2 1e 2 22 2>;
+                       interrupts = <29 2 30 2 34 2>;
                        interrupt-parent = <&mpic>;
                        phy-handle = <&phy0>;
                };
                        device_type = "network";
                        model = "TSEC";
                        compatible = "gianfar";
-                       reg = <25000 1000>;
+                       reg = <0x25000 0x1000>;
                        local-mac-address = [ 00 00 00 00 00 00 ];
-                       interrupts = <23 2 24 2 28 2>;
+                       interrupts = <35 2 36 2 40 2>;
                        interrupt-parent = <&mpic>;
                        phy-handle = <&phy1>;
                };
                        device_type = "network";
                        model = "FEC";
                        compatible = "gianfar";
-                       reg = <26000 1000>;
+                       reg = <0x26000 0x1000>;
                        local-mac-address = [ 00 00 00 00 00 00 ];
-                       interrupts = <29 2>;
+                       interrupts = <41 2>;
                        interrupt-parent = <&mpic>;
                        phy-handle = <&phy3>;
                };
                        cell-index = <0>;
                        device_type = "serial";
                        compatible = "ns16550";
-                       reg = <4500 100>;       // reg base, size
+                       reg = <0x4500 0x100>;   // reg base, size
                        clock-frequency = <0>;  // should we fill in in uboot?
-                       interrupts = <2a 2>;
+                       interrupts = <42 2>;
                        interrupt-parent = <&mpic>;
                };
 
                        cell-index = <1>;
                        device_type = "serial";
                        compatible = "ns16550";
-                       reg = <4600 100>;       // reg base, size
+                       reg = <0x4600 0x100>;   // reg base, size
                        clock-frequency = <0>;  // should we fill in in uboot?
-                       interrupts = <2a 2>;
+                       interrupts = <42 2>;
                        interrupt-parent = <&mpic>;
                };
                mpic: pic@40000 {
                        interrupt-controller;
                        #address-cells = <0>;
                        #interrupt-cells = <2>;
-                       reg = <40000 40000>;
+                       reg = <0x40000 0x40000>;
                        compatible = "chrp,open-pic";
                        device_type = "open-pic";
                        big-endian;
 
        pci0: pci@e0008000 {
                cell-index = <0>;
-               interrupt-map-mask = <f800 0 0 7>;
+               interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
                interrupt-map = <
 
                        /* IDSEL 0x02 */
-                       1000 0 0 1 &mpic 1 1
-                       1000 0 0 2 &mpic 2 1
-                       1000 0 0 3 &mpic 3 1
-                       1000 0 0 4 &mpic 4 1
+                       0x1000 0x0 0x0 0x1 &mpic 0x1 0x1
+                       0x1000 0x0 0x0 0x2 &mpic 0x2 0x1
+                       0x1000 0x0 0x0 0x3 &mpic 0x3 0x1
+                       0x1000 0x0 0x0 0x4 &mpic 0x4 0x1
 
                        /* IDSEL 0x03 */
-                       1800 0 0 1 &mpic 4 1
-                       1800 0 0 2 &mpic 1 1
-                       1800 0 0 3 &mpic 2 1
-                       1800 0 0 4 &mpic 3 1
+                       0x1800 0x0 0x0 0x1 &mpic 0x4 0x1
+                       0x1800 0x0 0x0 0x2 &mpic 0x1 0x1
+                       0x1800 0x0 0x0 0x3 &mpic 0x2 0x1
+                       0x1800 0x0 0x0 0x4 &mpic 0x3 0x1
 
                        /* IDSEL 0x04 */
-                       2000 0 0 1 &mpic 3 1
-                       2000 0 0 2 &mpic 4 1
-                       2000 0 0 3 &mpic 1 1
-                       2000 0 0 4 &mpic 2 1
+                       0x2000 0x0 0x0 0x1 &mpic 0x3 0x1
+                       0x2000 0x0 0x0 0x2 &mpic 0x4 0x1
+                       0x2000 0x0 0x0 0x3 &mpic 0x1 0x1
+                       0x2000 0x0 0x0 0x4 &mpic 0x2 0x1
 
                        /* IDSEL 0x05 */
-                       2800 0 0 1 &mpic 2 1
-                       2800 0 0 2 &mpic 3 1
-                       2800 0 0 3 &mpic 4 1
-                       2800 0 0 4 &mpic 1 1
+                       0x2800 0x0 0x0 0x1 &mpic 0x2 0x1
+                       0x2800 0x0 0x0 0x2 &mpic 0x3 0x1
+                       0x2800 0x0 0x0 0x3 &mpic 0x4 0x1
+                       0x2800 0x0 0x0 0x4 &mpic 0x1 0x1
 
                        /* IDSEL 0x0c */
-                       6000 0 0 1 &mpic 1 1
-                       6000 0 0 2 &mpic 2 1
-                       6000 0 0 3 &mpic 3 1
-                       6000 0 0 4 &mpic 4 1
+                       0x6000 0x0 0x0 0x1 &mpic 0x1 0x1
+                       0x6000 0x0 0x0 0x2 &mpic 0x2 0x1
+                       0x6000 0x0 0x0 0x3 &mpic 0x3 0x1
+                       0x6000 0x0 0x0 0x4 &mpic 0x4 0x1
 
                        /* IDSEL 0x0d */
-                       6800 0 0 1 &mpic 4 1
-                       6800 0 0 2 &mpic 1 1
-                       6800 0 0 3 &mpic 2 1
-                       6800 0 0 4 &mpic 3 1
+                       0x6800 0x0 0x0 0x1 &mpic 0x4 0x1
+                       0x6800 0x0 0x0 0x2 &mpic 0x1 0x1
+                       0x6800 0x0 0x0 0x3 &mpic 0x2 0x1
+                       0x6800 0x0 0x0 0x4 &mpic 0x3 0x1
 
                        /* IDSEL 0x0e */
-                       7000 0 0 1 &mpic 3 1
-                       7000 0 0 2 &mpic 4 1
-                       7000 0 0 3 &mpic 1 1
-                       7000 0 0 4 &mpic 2 1
+                       0x7000 0x0 0x0 0x1 &mpic 0x3 0x1
+                       0x7000 0x0 0x0 0x2 &mpic 0x4 0x1
+                       0x7000 0x0 0x0 0x3 &mpic 0x1 0x1
+                       0x7000 0x0 0x0 0x4 &mpic 0x2 0x1
 
                        /* IDSEL 0x0f */
-                       7800 0 0 1 &mpic 2 1
-                       7800 0 0 2 &mpic 3 1
-                       7800 0 0 3 &mpic 4 1
-                       7800 0 0 4 &mpic 1 1
+                       0x7800 0x0 0x0 0x1 &mpic 0x2 0x1
+                       0x7800 0x0 0x0 0x2 &mpic 0x3 0x1
+                       0x7800 0x0 0x0 0x3 &mpic 0x4 0x1
+                       0x7800 0x0 0x0 0x4 &mpic 0x1 0x1
 
                        /* IDSEL 0x12 */
-                       9000 0 0 1 &mpic 1 1
-                       9000 0 0 2 &mpic 2 1
-                       9000 0 0 3 &mpic 3 1
-                       9000 0 0 4 &mpic 4 1
+                       0x9000 0x0 0x0 0x1 &mpic 0x1 0x1
+                       0x9000 0x0 0x0 0x2 &mpic 0x2 0x1
+                       0x9000 0x0 0x0 0x3 &mpic 0x3 0x1
+                       0x9000 0x0 0x0 0x4 &mpic 0x4 0x1
 
                        /* IDSEL 0x13 */
-                       9800 0 0 1 &mpic 4 1
-                       9800 0 0 2 &mpic 1 1
-                       9800 0 0 3 &mpic 2 1
-                       9800 0 0 4 &mpic 3 1
+                       0x9800 0x0 0x0 0x1 &mpic 0x4 0x1
+                       0x9800 0x0 0x0 0x2 &mpic 0x1 0x1
+                       0x9800 0x0 0x0 0x3 &mpic 0x2 0x1
+                       0x9800 0x0 0x0 0x4 &mpic 0x3 0x1
 
                        /* IDSEL 0x14 */
-                       a000 0 0 1 &mpic 3 1
-                       a000 0 0 2 &mpic 4 1
-                       a000 0 0 3 &mpic 1 1
-                       a000 0 0 4 &mpic 2 1
+                       0xa000 0x0 0x0 0x1 &mpic 0x3 0x1
+                       0xa000 0x0 0x0 0x2 &mpic 0x4 0x1
+                       0xa000 0x0 0x0 0x3 &mpic 0x1 0x1
+                       0xa000 0x0 0x0 0x4 &mpic 0x2 0x1
 
                        /* IDSEL 0x15 */
-                       a800 0 0 1 &mpic 2 1
-                       a800 0 0 2 &mpic 3 1
-                       a800 0 0 3 &mpic 4 1
-                       a800 0 0 4 &mpic 1 1>;
+                       0xa800 0x0 0x0 0x1 &mpic 0x2 0x1
+                       0xa800 0x0 0x0 0x2 &mpic 0x3 0x1
+                       0xa800 0x0 0x0 0x3 &mpic 0x4 0x1
+                       0xa800 0x0 0x0 0x4 &mpic 0x1 0x1>;
                interrupt-parent = <&mpic>;
-               interrupts = <18 2>;
+               interrupts = <24 2>;
                bus-range = <0 0>;
-               ranges = <02000000 0 80000000 80000000 0 20000000
-                         01000000 0 00000000 e2000000 0 00100000>;
-               clock-frequency = <3f940aa>;
+               ranges = <0x2000000 0x0 0x80000000 0x80000000 0x0 0x20000000
+                         0x1000000 0x0 0x0 0xe2000000 0x0 0x100000>;
+               clock-frequency = <66666666>;
                #interrupt-cells = <1>;
                #size-cells = <2>;
                #address-cells = <3>;
-               reg = <e0008000 1000>;
+               reg = <0xe0008000 0x1000>;
                compatible = "fsl,mpc8540-pcix", "fsl,mpc8540-pci";
                device_type = "pci";
        };
index fa8d9aaad157974645ac5988a9ce4d1fcc632217..663c7c50ca4552c90a9362e933305cd83e5ccda9 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * MPC8541 CDS Device Tree Source
  *
- * Copyright 2006 Freescale Semiconductor Inc.
+ * Copyright 2006, 2008 Freescale Semiconductor Inc.
  *
  * This program is free software; you can redistribute  it and/or modify it
  * under  the terms of  the GNU General  Public License as published by the
@@ -9,6 +9,7 @@
  * option) any later version.
  */
 
+/dts-v1/;
 
 / {
        model = "MPC8541CDS";
 
                PowerPC,8541@0 {
                        device_type = "cpu";
-                       reg = <0>;
-                       d-cache-line-size = <20>;       // 32 bytes
-                       i-cache-line-size = <20>;       // 32 bytes
-                       d-cache-size = <8000>;          // L1, 32K
-                       i-cache-size = <8000>;          // L1, 32K
+                       reg = <0x0>;
+                       d-cache-line-size = <32>;       // 32 bytes
+                       i-cache-line-size = <32>;       // 32 bytes
+                       d-cache-size = <0x8000>;                // L1, 32K
+                       i-cache-size = <0x8000>;                // L1, 32K
                        timebase-frequency = <0>;       //  33 MHz, from uboot
                        bus-frequency = <0>;    // 166 MHz
                        clock-frequency = <0>;  // 825 MHz, from uboot
 
        memory {
                device_type = "memory";
-               reg = <00000000 08000000>;      // 128M at 0x0
+               reg = <0x0 0x8000000>;  // 128M at 0x0
        };
 
        soc8541@e0000000 {
                #address-cells = <1>;
                #size-cells = <1>;
                device_type = "soc";
-               ranges = <0 e0000000 00100000>;
-               reg = <e0000000 00001000>;      // CCSRBAR 1M
+               ranges = <0x0 0xe0000000 0x100000>;
+               reg = <0xe0000000 0x1000>;      // CCSRBAR 1M
                bus-frequency = <0>;
 
                memory-controller@2000 {
                        compatible = "fsl,8541-memory-controller";
-                       reg = <2000 1000>;
+                       reg = <0x2000 0x1000>;
                        interrupt-parent = <&mpic>;
-                       interrupts = <12 2>;
+                       interrupts = <18 2>;
                };
 
                l2-cache-controller@20000 {
                        compatible = "fsl,8541-l2-cache-controller";
-                       reg = <20000 1000>;
-                       cache-line-size = <20>; // 32 bytes
-                       cache-size = <40000>;   // L2, 256K
+                       reg = <0x20000 0x1000>;
+                       cache-line-size = <32>; // 32 bytes
+                       cache-size = <0x40000>; // L2, 256K
                        interrupt-parent = <&mpic>;
-                       interrupts = <10 2>;
+                       interrupts = <16 2>;
                };
 
                i2c@3000 {
@@ -76,8 +77,8 @@
                        #size-cells = <0>;
                        cell-index = <0>;
                        compatible = "fsl-i2c";
-                       reg = <3000 100>;
-                       interrupts = <2b 2>;
+                       reg = <0x3000 0x100>;
+                       interrupts = <43 2>;
                        interrupt-parent = <&mpic>;
                        dfsrr;
                };
                        #address-cells = <1>;
                        #size-cells = <0>;
                        compatible = "fsl,gianfar-mdio";
-                       reg = <24520 20>;
+                       reg = <0x24520 0x20>;
 
                        phy0: ethernet-phy@0 {
                                interrupt-parent = <&mpic>;
                                interrupts = <5 1>;
-                               reg = <0>;
+                               reg = <0x0>;
                                device_type = "ethernet-phy";
                        };
                        phy1: ethernet-phy@1 {
                                interrupt-parent = <&mpic>;
                                interrupts = <5 1>;
-                               reg = <1>;
+                               reg = <0x1>;
                                device_type = "ethernet-phy";
                        };
                };
                        device_type = "network";
                        model = "TSEC";
                        compatible = "gianfar";
-                       reg = <24000 1000>;
+                       reg = <0x24000 0x1000>;
                        local-mac-address = [ 00 00 00 00 00 00 ];
-                       interrupts = <1d 2 1e 2 22 2>;
+                       interrupts = <29 2 30 2 34 2>;
                        interrupt-parent = <&mpic>;
                        phy-handle = <&phy0>;
                };
                        device_type = "network";
                        model = "TSEC";
                        compatible = "gianfar";
-                       reg = <25000 1000>;
+                       reg = <0x25000 0x1000>;
                        local-mac-address = [ 00 00 00 00 00 00 ];
-                       interrupts = <23 2 24 2 28 2>;
+                       interrupts = <35 2 36 2 40 2>;
                        interrupt-parent = <&mpic>;
                        phy-handle = <&phy1>;
                };
                        cell-index = <0>;
                        device_type = "serial";
                        compatible = "ns16550";
-                       reg = <4500 100>;       // reg base, size
+                       reg = <0x4500 0x100>;   // reg base, size
                        clock-frequency = <0>;  // should we fill in in uboot?
-                       interrupts = <2a 2>;
+                       interrupts = <42 2>;
                        interrupt-parent = <&mpic>;
                };
 
                        cell-index = <1>;
                        device_type = "serial";
                        compatible = "ns16550";
-                       reg = <4600 100>;       // reg base, size
+                       reg = <0x4600 0x100>;   // reg base, size
                        clock-frequency = <0>;  // should we fill in in uboot?
-                       interrupts = <2a 2>;
+                       interrupts = <42 2>;
                        interrupt-parent = <&mpic>;
                };
 
                        interrupt-controller;
                        #address-cells = <0>;
                        #interrupt-cells = <2>;
-                       reg = <40000 40000>;
+                       reg = <0x40000 0x40000>;
                        compatible = "chrp,open-pic";
                        device_type = "open-pic";
                         big-endian;
                        #address-cells = <1>;
                        #size-cells = <1>;
                        compatible = "fsl,mpc8541-cpm", "fsl,cpm2";
-                       reg = <919c0 30>;
+                       reg = <0x919c0 0x30>;
                        ranges;
 
                        muram@80000 {
                                #address-cells = <1>;
                                #size-cells = <1>;
-                               ranges = <0 80000 10000>;
+                               ranges = <0x0 0x80000 0x10000>;
 
                                data@0 {
                                        compatible = "fsl,cpm-muram-data";
-                                       reg = <0 2000 9000 1000>;
+                                       reg = <0x0 0x2000 0x9000 0x1000>;
                                };
                        };
 
                                compatible = "fsl,mpc8541-brg",
                                             "fsl,cpm2-brg",
                                             "fsl,cpm-brg";
-                               reg = <919f0 10 915f0 10>;
+                               reg = <0x919f0 0x10 0x915f0 0x10>;
                        };
 
                        cpmpic: pic@90c00 {
                                interrupt-controller;
                                #address-cells = <0>;
                                #interrupt-cells = <2>;
-                               interrupts = <2e 2>;
+                               interrupts = <46 2>;
                                interrupt-parent = <&mpic>;
-                               reg = <90c00 80>;
+                               reg = <0x90c00 0x80>;
                                compatible = "fsl,mpc8541-cpm-pic", "fsl,cpm2-pic";
                        };
                };
 
        pci0: pci@e0008000 {
                cell-index = <0>;
-               interrupt-map-mask = <1f800 0 0 7>;
+               interrupt-map-mask = <0x1f800 0x0 0x0 0x7>;
                interrupt-map = <
 
                        /* IDSEL 0x10 */
-                       08000 0 0 1 &mpic 0 1
-                       08000 0 0 2 &mpic 1 1
-                       08000 0 0 3 &mpic 2 1
-                       08000 0 0 4 &mpic 3 1
+                       0x8000 0x0 0x0 0x1 &mpic 0x0 0x1
+                       0x8000 0x0 0x0 0x2 &mpic 0x1 0x1
+                       0x8000 0x0 0x0 0x3 &mpic 0x2 0x1
+                       0x8000 0x0 0x0 0x4 &mpic 0x3 0x1
 
                        /* IDSEL 0x11 */
-                       08800 0 0 1 &mpic 0 1
-                       08800 0 0 2 &mpic 1 1
-                       08800 0 0 3 &mpic 2 1
-                       08800 0 0 4 &mpic 3 1
+                       0x8800 0x0 0x0 0x1 &mpic 0x0 0x1
+                       0x8800 0x0 0x0 0x2 &mpic 0x1 0x1
+                       0x8800 0x0 0x0 0x3 &mpic 0x2 0x1
+                       0x8800 0x0 0x0 0x4 &mpic 0x3 0x1
 
                        /* IDSEL 0x12 (Slot 1) */
-                       09000 0 0 1 &mpic 0 1
-                       09000 0 0 2 &mpic 1 1
-                       09000 0 0 3 &mpic 2 1
-                       09000 0 0 4 &mpic 3 1
+                       0x9000 0x0 0x0 0x1 &mpic 0x0 0x1
+                       0x9000 0x0 0x0 0x2 &mpic 0x1 0x1
+                       0x9000 0x0 0x0 0x3 &mpic 0x2 0x1
+                       0x9000 0x0 0x0 0x4 &mpic 0x3 0x1
 
                        /* IDSEL 0x13 (Slot 2) */
-                       09800 0 0 1 &mpic 1 1
-                       09800 0 0 2 &mpic 2 1
-                       09800 0 0 3 &mpic 3 1
-                       09800 0 0 4 &mpic 0 1
+                       0x9800 0x0 0x0 0x1 &mpic 0x1 0x1
+                       0x9800 0x0 0x0 0x2 &mpic 0x2 0x1
+                       0x9800 0x0 0x0 0x3 &mpic 0x3 0x1
+                       0x9800 0x0 0x0 0x4 &mpic 0x0 0x1
 
                        /* IDSEL 0x14 (Slot 3) */
-                       0a000 0 0 1 &mpic 2 1
-                       0a000 0 0 2 &mpic 3 1
-                       0a000 0 0 3 &mpic 0 1
-                       0a000 0 0 4 &mpic 1 1
+                       0xa000 0x0 0x0 0x1 &mpic 0x2 0x1
+                       0xa000 0x0 0x0 0x2 &mpic 0x3 0x1
+                       0xa000 0x0 0x0 0x3 &mpic 0x0 0x1
+                       0xa000 0x0 0x0 0x4 &mpic 0x1 0x1
 
                        /* IDSEL 0x15 (Slot 4) */
-                       0a800 0 0 1 &mpic 3 1
-                       0a800 0 0 2 &mpic 0 1
-                       0a800 0 0 3 &mpic 1 1
-                       0a800 0 0 4 &mpic 2 1
+                       0xa800 0x0 0x0 0x1 &mpic 0x3 0x1
+                       0xa800 0x0 0x0 0x2 &mpic 0x0 0x1
+                       0xa800 0x0 0x0 0x3 &mpic 0x1 0x1
+                       0xa800 0x0 0x0 0x4 &mpic 0x2 0x1
 
                        /* Bus 1 (Tundra Bridge) */
                        /* IDSEL 0x12 (ISA bridge) */
-                       19000 0 0 1 &mpic 0 1
-                       19000 0 0 2 &mpic 1 1
-                       19000 0 0 3 &mpic 2 1
-                       19000 0 0 4 &mpic 3 1>;
+                       0x19000 0x0 0x0 0x1 &mpic 0x0 0x1
+                       0x19000 0x0 0x0 0x2 &mpic 0x1 0x1
+                       0x19000 0x0 0x0 0x3 &mpic 0x2 0x1
+                       0x19000 0x0 0x0 0x4 &mpic 0x3 0x1>;
                interrupt-parent = <&mpic>;
-               interrupts = <18 2>;
+               interrupts = <24 2>;
                bus-range = <0 0>;
-               ranges = <02000000 0 80000000 80000000 0 20000000
-                         01000000 0 00000000 e2000000 0 00100000>;
-               clock-frequency = <3f940aa>;
+               ranges = <0x2000000 0x0 0x80000000 0x80000000 0x0 0x20000000
+                         0x1000000 0x0 0x0 0xe2000000 0x0 0x100000>;
+               clock-frequency = <66666666>;
                #interrupt-cells = <1>;
                #size-cells = <2>;
                #address-cells = <3>;
-               reg = <e0008000 1000>;
+               reg = <0xe0008000 0x1000>;
                compatible = "fsl,mpc8540-pci";
                device_type = "pci";
 
                i8259@19000 {
                        interrupt-controller;
                        device_type = "interrupt-controller";
-                       reg = <19000 0 0 0 1>;
+                       reg = <0x19000 0x0 0x0 0x0 0x1>;
                        #address-cells = <0>;
                        #interrupt-cells = <2>;
                        compatible = "chrp,iic";
 
        pci1: pci@e0009000 {
                cell-index = <1>;
-               interrupt-map-mask = <f800 0 0 7>;
+               interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
                interrupt-map = <
 
                        /* IDSEL 0x15 */
-                       a800 0 0 1 &mpic b 1
-                       a800 0 0 2 &mpic b 1
-                       a800 0 0 3 &mpic b 1
-                       a800 0 0 4 &mpic b 1>;
+                       0xa800 0x0 0x0 0x1 &mpic 0xb 0x1
+                       0xa800 0x0 0x0 0x2 &mpic 0xb 0x1
+                       0xa800 0x0 0x0 0x3 &mpic 0xb 0x1
+                       0xa800 0x0 0x0 0x4 &mpic 0xb 0x1>;
                interrupt-parent = <&mpic>;
-               interrupts = <19 2>;
+               interrupts = <25 2>;
                bus-range = <0 0>;
-               ranges = <02000000 0 a0000000 a0000000 0 20000000
-                         01000000 0 00000000 e3000000 0 00100000>;
-               clock-frequency = <3f940aa>;
+               ranges = <0x2000000 0x0 0xa0000000 0xa0000000 0x0 0x20000000
+                         0x1000000 0x0 0x0 0xe3000000 0x0 0x100000>;
+               clock-frequency = <66666666>;
                #interrupt-cells = <1>;
                #size-cells = <2>;
                #address-cells = <3>;
-               reg = <e0009000 1000>;
+               reg = <0xe0009000 0x1000>;
                compatible = "fsl,mpc8540-pci";
                device_type = "pci";
        };
index 688af9d06382b5b1b2b70390488a65c474915045..6a0d8db96d97c8935838e6978ec88a3583deca42 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * MPC8544 DS Device Tree Source
  *
- * Copyright 2007 Freescale Semiconductor Inc.
+ * Copyright 2007, 2008 Freescale Semiconductor Inc.
  *
  * This program is free software; you can redistribute  it and/or modify it
  * under  the terms of  the GNU General  Public License as published by the
@@ -9,6 +9,7 @@
  * option) any later version.
  */
 
+/dts-v1/;
 / {
        model = "MPC8544DS";
        compatible = "MPC8544DS", "MPC85xxDS";
        };
 
        cpus {
-               #cpus = <1>;
                #address-cells = <1>;
                #size-cells = <0>;
 
                PowerPC,8544@0 {
                        device_type = "cpu";
-                       reg = <0>;
-                       d-cache-line-size = <20>;       // 32 bytes
-                       i-cache-line-size = <20>;       // 32 bytes
-                       d-cache-size = <8000>;          // L1, 32K
-                       i-cache-size = <8000>;          // L1, 32K
+                       reg = <0x0>;
+                       d-cache-line-size = <32>;       // 32 bytes
+                       i-cache-line-size = <32>;       // 32 bytes
+                       d-cache-size = <0x8000>;                // L1, 32K
+                       i-cache-size = <0x8000>;                // L1, 32K
                        timebase-frequency = <0>;
                        bus-frequency = <0>;
                        clock-frequency = <0>;
@@ -46,7 +46,7 @@
 
        memory {
                device_type = "memory";
-               reg = <00000000 00000000>;      // Filled by U-Boot
+               reg = <0x0 0x0>;        // Filled by U-Boot
        };
 
        soc8544@e0000000 {
                #size-cells = <1>;
                device_type = "soc";
 
-               ranges = <00000000 e0000000 00100000>;
-               reg = <e0000000 00001000>;      // CCSRBAR 1M
+               ranges = <0x0 0xe0000000 0x100000>;
+               reg = <0xe0000000 0x1000>;      // CCSRBAR 1M
                bus-frequency = <0>;            // Filled out by uboot.
 
                memory-controller@2000 {
                        compatible = "fsl,8544-memory-controller";
-                       reg = <2000 1000>;
+                       reg = <0x2000 0x1000>;
                        interrupt-parent = <&mpic>;
-                       interrupts = <12 2>;
+                       interrupts = <18 2>;
                };
 
                l2-cache-controller@20000 {
                        compatible = "fsl,8544-l2-cache-controller";
-                       reg = <20000 1000>;
-                       cache-line-size = <20>; // 32 bytes
-                       cache-size = <40000>;   // L2, 256K
+                       reg = <0x20000 0x1000>;
+                       cache-line-size = <32>; // 32 bytes
+                       cache-size = <0x40000>; // L2, 256K
                        interrupt-parent = <&mpic>;
-                       interrupts = <10 2>;
+                       interrupts = <16 2>;
                };
 
                i2c@3000 {
@@ -79,8 +79,8 @@
                        #size-cells = <0>;
                        cell-index = <0>;
                        compatible = "fsl-i2c";
-                       reg = <3000 100>;
-                       interrupts = <2b 2>;
+                       reg = <0x3000 0x100>;
+                       interrupts = <43 2>;
                        interrupt-parent = <&mpic>;
                        dfsrr;
                };
@@ -90,8 +90,8 @@
                        #size-cells = <0>;
                        cell-index = <1>;
                        compatible = "fsl-i2c";
-                       reg = <3100 100>;
-                       interrupts = <2b 2>;
+                       reg = <0x3100 0x100>;
+                       interrupts = <43 2>;
                        interrupt-parent = <&mpic>;
                        dfsrr;
                };
                        #address-cells = <1>;
                        #size-cells = <0>;
                        compatible = "fsl,gianfar-mdio";
-                       reg = <24520 20>;
+                       reg = <0x24520 0x20>;
 
                        phy0: ethernet-phy@0 {
                                interrupt-parent = <&mpic>;
-                               interrupts = <a 1>;
-                               reg = <0>;
+                               interrupts = <10 1>;
+                               reg = <0x0>;
                                device_type = "ethernet-phy";
                        };
                        phy1: ethernet-phy@1 {
                                interrupt-parent = <&mpic>;
-                               interrupts = <a 1>;
-                               reg = <1>;
+                               interrupts = <10 1>;
+                               reg = <0x1>;
                                device_type = "ethernet-phy";
                        };
                };
 
+               dma@21300 {
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       compatible = "fsl,mpc8544-dma", "fsl,eloplus-dma";
+                       reg = <0x21300 0x4>;
+                       ranges = <0x0 0x21100 0x200>;
+                       cell-index = <0>;
+                       dma-channel@0 {
+                               compatible = "fsl,mpc8544-dma-channel",
+                                               "fsl,eloplus-dma-channel";
+                               reg = <0x0 0x80>;
+                               cell-index = <0>;
+                               interrupt-parent = <&mpic>;
+                               interrupts = <20 2>;
+                       };
+                       dma-channel@80 {
+                               compatible = "fsl,mpc8544-dma-channel",
+                                               "fsl,eloplus-dma-channel";
+                               reg = <0x80 0x80>;
+                               cell-index = <1>;
+                               interrupt-parent = <&mpic>;
+                               interrupts = <21 2>;
+                       };
+                       dma-channel@100 {
+                               compatible = "fsl,mpc8544-dma-channel",
+                                               "fsl,eloplus-dma-channel";
+                               reg = <0x100 0x80>;
+                               cell-index = <2>;
+                               interrupt-parent = <&mpic>;
+                               interrupts = <22 2>;
+                       };
+                       dma-channel@180 {
+                               compatible = "fsl,mpc8544-dma-channel",
+                                               "fsl,eloplus-dma-channel";
+                               reg = <0x180 0x80>;
+                               cell-index = <3>;
+                               interrupt-parent = <&mpic>;
+                               interrupts = <23 2>;
+                       };
+               };
+
                enet0: ethernet@24000 {
                        cell-index = <0>;
                        device_type = "network";
                        model = "TSEC";
                        compatible = "gianfar";
-                       reg = <24000 1000>;
+                       reg = <0x24000 0x1000>;
                        local-mac-address = [ 00 00 00 00 00 00 ];
-                       interrupts = <1d 2 1e 2 22 2>;
+                       interrupts = <29 2 30 2 34 2>;
                        interrupt-parent = <&mpic>;
                        phy-handle = <&phy0>;
                        phy-connection-type = "rgmii-id";
                        device_type = "network";
                        model = "TSEC";
                        compatible = "gianfar";
-                       reg = <26000 1000>;
+                       reg = <0x26000 0x1000>;
                        local-mac-address = [ 00 00 00 00 00 00 ];
-                       interrupts = <1f 2 20 2 21 2>;
+                       interrupts = <31 2 32 2 33 2>;
                        interrupt-parent = <&mpic>;
                        phy-handle = <&phy1>;
                        phy-connection-type = "rgmii-id";
                        cell-index = <0>;
                        device_type = "serial";
                        compatible = "ns16550";
-                       reg = <4500 100>;
+                       reg = <0x4500 0x100>;
                        clock-frequency = <0>;
-                       interrupts = <2a 2>;
+                       interrupts = <42 2>;
                        interrupt-parent = <&mpic>;
                };
 
                        cell-index = <1>;
                        device_type = "serial";
                        compatible = "ns16550";
-                       reg = <4600 100>;
+                       reg = <0x4600 0x100>;
                        clock-frequency = <0>;
-                       interrupts = <2a 2>;
+                       interrupts = <42 2>;
                        interrupt-parent = <&mpic>;
                };
 
                global-utilities@e0000 {        //global utilities block
                        compatible = "fsl,mpc8548-guts";
-                       reg = <e0000 1000>;
+                       reg = <0xe0000 0x1000>;
                        fsl,has-rstcr;
                };
 
                        interrupt-controller;
                        #address-cells = <0>;
                        #interrupt-cells = <2>;
-                       reg = <40000 40000>;
+                       reg = <0x40000 0x40000>;
                        compatible = "chrp,open-pic";
                        device_type = "open-pic";
                        big-endian;
                cell-index = <0>;
                compatible = "fsl,mpc8540-pci";
                device_type = "pci";
-               interrupt-map-mask = <f800 0 0 7>;
+               interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
                interrupt-map = <
 
                        /* IDSEL 0x11 J17 Slot 1 */
-                       8800 0 0 1 &mpic 2 1
-                       8800 0 0 2 &mpic 3 1
-                       8800 0 0 3 &mpic 4 1
-                       8800 0 0 4 &mpic 1 1
+                       0x8800 0x0 0x0 0x1 &mpic 0x2 0x1
+                       0x8800 0x0 0x0 0x2 &mpic 0x3 0x1
+                       0x8800 0x0 0x0 0x3 &mpic 0x4 0x1
+                       0x8800 0x0 0x0 0x4 &mpic 0x1 0x1
 
                        /* IDSEL 0x12 J16 Slot 2 */
 
-                       9000 0 0 1 &mpic 3 1
-                       9000 0 0 2 &mpic 4 1
-                       9000 0 0 3 &mpic 2 1
-                       9000 0 0 4 &mpic 1 1>;
+                       0x9000 0x0 0x0 0x1 &mpic 0x3 0x1
+                       0x9000 0x0 0x0 0x2 &mpic 0x4 0x1
+                       0x9000 0x0 0x0 0x3 &mpic 0x2 0x1
+                       0x9000 0x0 0x0 0x4 &mpic 0x1 0x1>;
 
                interrupt-parent = <&mpic>;
-               interrupts = <18 2>;
-               bus-range = <0 ff>;
-               ranges = <02000000 0 c0000000 c0000000 0 20000000
-                         01000000 0 00000000 e1000000 0 00010000>;
-               clock-frequency = <3f940aa>;
+               interrupts = <24 2>;
+               bus-range = <0 255>;
+               ranges = <0x2000000 0x0 0xc0000000 0xc0000000 0x0 0x20000000
+                         0x1000000 0x0 0x0 0xe1000000 0x0 0x10000>;
+               clock-frequency = <66666666>;
                #interrupt-cells = <1>;
                #size-cells = <2>;
                #address-cells = <3>;
-               reg = <e0008000 1000>;
+               reg = <0xe0008000 0x1000>;
        };
 
        pci1: pcie@e0009000 {
                #interrupt-cells = <1>;
                #size-cells = <2>;
                #address-cells = <3>;
-               reg = <e0009000 1000>;
-               bus-range = <0 ff>;
-               ranges = <02000000 0 80000000 80000000 0 20000000
-                         01000000 0 00000000 e1010000 0 00010000>;
-               clock-frequency = <1fca055>;
+               reg = <0xe0009000 0x1000>;
+               bus-range = <0 255>;
+               ranges = <0x2000000 0x0 0x80000000 0x80000000 0x0 0x20000000
+                         0x1000000 0x0 0x0 0xe1010000 0x0 0x10000>;
+               clock-frequency = <33333333>;
                interrupt-parent = <&mpic>;
-               interrupts = <1a 2>;
-               interrupt-map-mask = <f800 0 0 7>;
+               interrupts = <26 2>;
+               interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
                interrupt-map = <
                        /* IDSEL 0x0 */
-                       0000 0 0 1 &mpic 4 1
-                       0000 0 0 2 &mpic 5 1
-                       0000 0 0 3 &mpic 6 1
-                       0000 0 0 4 &mpic 7 1
+                       0000 0x0 0x0 0x1 &mpic 0x4 0x1
+                       0000 0x0 0x0 0x2 &mpic 0x5 0x1
+                       0000 0x0 0x0 0x3 &mpic 0x6 0x1
+                       0000 0x0 0x0 0x4 &mpic 0x7 0x1
                        >;
                pcie@0 {
-                       reg = <0 0 0 0 0>;
+                       reg = <0x0 0x0 0x0 0x0 0x0>;
                        #size-cells = <2>;
                        #address-cells = <3>;
                        device_type = "pci";
-                       ranges = <02000000 0 80000000
-                                 02000000 0 80000000
-                                 0 20000000
+                       ranges = <0x2000000 0x0 0x80000000
+                                 0x2000000 0x0 0x80000000
+                                 0x0 0x20000000
 
-                                 01000000 0 00000000
-                                 01000000 0 00000000
-                                 0 00010000>;
+                                 0x1000000 0x0 0x0
+                                 0x1000000 0x0 0x0
+                                 0x0 0x10000>;
                };
        };
 
                #interrupt-cells = <1>;
                #size-cells = <2>;
                #address-cells = <3>;
-               reg = <e000a000 1000>;
-               bus-range = <0 ff>;
-               ranges = <02000000 0 a0000000 a0000000 0 10000000
-                         01000000 0 00000000 e1020000 0 00010000>;
-               clock-frequency = <1fca055>;
+               reg = <0xe000a000 0x1000>;
+               bus-range = <0 255>;
+               ranges = <0x2000000 0x0 0xa0000000 0xa0000000 0x0 0x10000000
+                         0x1000000 0x0 0x0 0xe1020000 0x0 0x10000>;
+               clock-frequency = <33333333>;
                interrupt-parent = <&mpic>;
-               interrupts = <19 2>;
-               interrupt-map-mask = <f800 0 0 7>;
+               interrupts = <25 2>;
+               interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
                interrupt-map = <
                        /* IDSEL 0x0 */
-                       0000 0 0 1 &mpic 0 1
-                       0000 0 0 2 &mpic 1 1
-                       0000 0 0 3 &mpic 2 1
-                       0000 0 0 4 &mpic 3 1
+                       0000 0x0 0x0 0x1 &mpic 0x0 0x1
+                       0000 0x0 0x0 0x2 &mpic 0x1 0x1
+                       0000 0x0 0x0 0x3 &mpic 0x2 0x1
+                       0000 0x0 0x0 0x4 &mpic 0x3 0x1
                        >;
                pcie@0 {
-                       reg = <0 0 0 0 0>;
+                       reg = <0x0 0x0 0x0 0x0 0x0>;
                        #size-cells = <2>;
                        #address-cells = <3>;
                        device_type = "pci";
-                       ranges = <02000000 0 a0000000
-                                 02000000 0 a0000000
-                                 0 10000000
+                       ranges = <0x2000000 0x0 0xa0000000
+                                 0x2000000 0x0 0xa0000000
+                                 0x0 0x10000000
 
-                                 01000000 0 00000000
-                                 01000000 0 00000000
-                                 0 00010000>;
+                                 0x1000000 0x0 0x0
+                                 0x1000000 0x0 0x0
+                                 0x0 0x10000>;
                };
        };
 
                #interrupt-cells = <1>;
                #size-cells = <2>;
                #address-cells = <3>;
-               reg = <e000b000 1000>;
-               bus-range = <0 ff>;
-               ranges = <02000000 0 b0000000 b0000000 0 00100000
-                         01000000 0 00000000 b0100000 0 00100000>;
-               clock-frequency = <1fca055>;
+               reg = <0xe000b000 0x1000>;
+               bus-range = <0 255>;
+               ranges = <0x2000000 0x0 0xb0000000 0xb0000000 0x0 0x100000
+                         0x1000000 0x0 0x0 0xb0100000 0x0 0x100000>;
+               clock-frequency = <33333333>;
                interrupt-parent = <&mpic>;
-               interrupts = <1b 2>;
-               interrupt-map-mask = <ff00 0 0 1>;
+               interrupts = <27 2>;
+               interrupt-map-mask = <0xff00 0x0 0x0 0x1>;
                interrupt-map = <
                        // IDSEL 0x1c  USB
-                       e000 0 0 1 &i8259 c 2
-                       e100 0 0 2 &i8259 9 2
-                       e200 0 0 3 &i8259 a 2
-                       e300 0 0 4 &i8259 b 2
+                       0xe000 0x0 0x0 0x1 &i8259 0xc 0x2
+                       0xe100 0x0 0x0 0x2 &i8259 0x9 0x2
+                       0xe200 0x0 0x0 0x3 &i8259 0xa 0x2
+                       0xe300 0x0 0x0 0x4 &i8259 0xb 0x2
 
                        // IDSEL 0x1d  Audio
-                       e800 0 0 1 &i8259 6 2
+                       0xe800 0x0 0x0 0x1 &i8259 0x6 0x2
 
                        // IDSEL 0x1e Legacy
-                       f000 0 0 1 &i8259 7 2
-                       f100 0 0 1 &i8259 7 2
+                       0xf000 0x0 0x0 0x1 &i8259 0x7 0x2
+                       0xf100 0x0 0x0 0x1 &i8259 0x7 0x2
 
                        // IDSEL 0x1f IDE/SATA
-                       f800 0 0 1 &i8259 e 2
-                       f900 0 0 1 &i8259 5 2
+                       0xf800 0x0 0x0 0x1 &i8259 0xe 0x2
+                       0xf900 0x0 0x0 0x1 &i8259 0x5 0x2
                >;
 
                pcie@0 {
-                       reg = <0 0 0 0 0>;
+                       reg = <0x0 0x0 0x0 0x0 0x0>;
                        #size-cells = <2>;
                        #address-cells = <3>;
                        device_type = "pci";
-                       ranges = <02000000 0 b0000000
-                                 02000000 0 b0000000
-                                 0 00100000
+                       ranges = <0x2000000 0x0 0xb0000000
+                                 0x2000000 0x0 0xb0000000
+                                 0x0 0x100000
 
-                                 01000000 0 00000000
-                                 01000000 0 00000000
-                                 0 00100000>;
+                                 0x1000000 0x0 0x0
+                                 0x1000000 0x0 0x0
+                                 0x0 0x100000>;
 
                        uli1575@0 {
-                               reg = <0 0 0 0 0>;
+                               reg = <0x0 0x0 0x0 0x0 0x0>;
                                #size-cells = <2>;
                                #address-cells = <3>;
-                               ranges = <02000000 0 b0000000
-                                         02000000 0 b0000000
-                                         0 00100000
+                               ranges = <0x2000000 0x0 0xb0000000
+                                         0x2000000 0x0 0xb0000000
+                                         0x0 0x100000
 
-                                         01000000 0 00000000
-                                         01000000 0 00000000
-                                         0 00100000>;
+                                         0x1000000 0x0 0x0
+                                         0x1000000 0x0 0x0
+                                         0x0 0x100000>;
                                isa@1e {
                                        device_type = "isa";
                                        #interrupt-cells = <2>;
                                        #size-cells = <1>;
                                        #address-cells = <2>;
-                                       reg = <f000 0 0 0 0>;
-                                       ranges = <0
-                                                 01000000 0 0
-                                                 00001000>;
+                                       reg = <0xf000 0x0 0x0 0x0 0x0>;
+                                       ranges = <0x1 0x0
+                                                 0x1000000 0x0 0x0
+                                                 0x1000>;
                                        interrupt-parent = <&i8259>;
 
                                        i8259: interrupt-controller@20 {
-                                               reg = <1 20 2
-                                                      1 a0 2
-                                                      1 4d0 2>;
+                                               reg = <0x1 0x20 0x2
+                                                      0x1 0xa0 0x2
+                                                      0x1 0x4d0 0x2>;
                                                interrupt-controller;
                                                device_type = "interrupt-controller";
                                                #address-cells = <0>;
                                        i8042@60 {
                                                #size-cells = <0>;
                                                #address-cells = <1>;
-                                               reg = <1 60 1 1 64 1>;
-                                               interrupts = <1 3 c 3>;
+                                               reg = <0x1 0x60 0x1 0x1 0x64 0x1>;
+                                               interrupts = <1 3 12 3>;
                                                interrupt-parent = <&i8259>;
 
                                                keyboard@0 {
-                                                       reg = <0>;
+                                                       reg = <0x0>;
                                                        compatible = "pnpPNP,303";
                                                };
 
                                                mouse@1 {
-                                                       reg = <1>;
+                                                       reg = <0x1>;
                                                        compatible = "pnpPNP,f03";
                                                };
                                        };
 
                                        rtc@70 {
                                                compatible = "pnpPNP,b00";
-                                               reg = <1 70 2>;
+                                               reg = <0x1 0x70 0x2>;
                                        };
 
                                        gpio@400 {
-                                               reg = <1 400 80>;
+                                               reg = <0x1 0x400 0x80>;
                                        };
                                };
                        };
index 1f470c6a1c63cf89a08452196862e5d5e149d0ea..fa298a8c81cc11c12d753375d467276f554a5754 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * MPC8548 CDS Device Tree Source
  *
- * Copyright 2006 Freescale Semiconductor Inc.
+ * Copyright 2006, 2008 Freescale Semiconductor Inc.
  *
  * This program is free software; you can redistribute  it and/or modify it
  * under  the terms of  the GNU General  Public License as published by the
@@ -9,6 +9,7 @@
  * option) any later version.
  */
 
+/dts-v1/;
 
 / {
        model = "MPC8548CDS";
 
                PowerPC,8548@0 {
                        device_type = "cpu";
-                       reg = <0>;
-                       d-cache-line-size = <20>;       // 32 bytes
-                       i-cache-line-size = <20>;       // 32 bytes
-                       d-cache-size = <8000>;          // L1, 32K
-                       i-cache-size = <8000>;          // L1, 32K
+                       reg = <0x0>;
+                       d-cache-line-size = <32>;       // 32 bytes
+                       i-cache-line-size = <32>;       // 32 bytes
+                       d-cache-size = <0x8000>;                // L1, 32K
+                       i-cache-size = <0x8000>;                // L1, 32K
                        timebase-frequency = <0>;       //  33 MHz, from uboot
                        bus-frequency = <0>;    // 166 MHz
                        clock-frequency = <0>;  // 825 MHz, from uboot
 
        memory {
                device_type = "memory";
-               reg = <00000000 08000000>;      // 128M at 0x0
+               reg = <0x0 0x8000000>;  // 128M at 0x0
        };
 
        soc8548@e0000000 {
                #address-cells = <1>;
                #size-cells = <1>;
                device_type = "soc";
-               ranges = <00000000 e0000000 00100000>;
-               reg = <e0000000 00001000>;      // CCSRBAR
+               ranges = <0x0 0xe0000000 0x100000>;
+               reg = <0xe0000000 0x1000>;      // CCSRBAR
                bus-frequency = <0>;
 
                memory-controller@2000 {
                        compatible = "fsl,8548-memory-controller";
-                       reg = <2000 1000>;
+                       reg = <0x2000 0x1000>;
                        interrupt-parent = <&mpic>;
-                       interrupts = <12 2>;
+                       interrupts = <18 2>;
                };
 
                l2-cache-controller@20000 {
                        compatible = "fsl,8548-l2-cache-controller";
-                       reg = <20000 1000>;
-                       cache-line-size = <20>; // 32 bytes
-                       cache-size = <80000>;   // L2, 512K
+                       reg = <0x20000 0x1000>;
+                       cache-line-size = <32>; // 32 bytes
+                       cache-size = <0x80000>; // L2, 512K
                        interrupt-parent = <&mpic>;
-                       interrupts = <10 2>;
+                       interrupts = <16 2>;
                };
 
                i2c@3000 {
@@ -81,8 +82,8 @@
                        #size-cells = <0>;
                        cell-index = <0>;
                        compatible = "fsl-i2c";
-                       reg = <3000 100>;
-                       interrupts = <2b 2>;
+                       reg = <0x3000 0x100>;
+                       interrupts = <43 2>;
                        interrupt-parent = <&mpic>;
                        dfsrr;
                };
@@ -92,8 +93,8 @@
                        #size-cells = <0>;
                        cell-index = <1>;
                        compatible = "fsl-i2c";
-                       reg = <3100 100>;
-                       interrupts = <2b 2>;
+                       reg = <0x3100 0x100>;
+                       interrupts = <43 2>;
                        interrupt-parent = <&mpic>;
                        dfsrr;
                };
                        #address-cells = <1>;
                        #size-cells = <0>;
                        compatible = "fsl,gianfar-mdio";
-                       reg = <24520 20>;
+                       reg = <0x24520 0x20>;
 
                        phy0: ethernet-phy@0 {
                                interrupt-parent = <&mpic>;
                                interrupts = <5 1>;
-                               reg = <0>;
+                               reg = <0x0>;
                                device_type = "ethernet-phy";
                        };
                        phy1: ethernet-phy@1 {
                                interrupt-parent = <&mpic>;
                                interrupts = <5 1>;
-                               reg = <1>;
+                               reg = <0x1>;
                                device_type = "ethernet-phy";
                        };
                        phy2: ethernet-phy@2 {
                                interrupt-parent = <&mpic>;
                                interrupts = <5 1>;
-                               reg = <2>;
+                               reg = <0x2>;
                                device_type = "ethernet-phy";
                        };
                        phy3: ethernet-phy@3 {
                                interrupt-parent = <&mpic>;
                                interrupts = <5 1>;
-                               reg = <3>;
+                               reg = <0x3>;
                                device_type = "ethernet-phy";
                        };
                };
                        device_type = "network";
                        model = "eTSEC";
                        compatible = "gianfar";
-                       reg = <24000 1000>;
+                       reg = <0x24000 0x1000>;
                        local-mac-address = [ 00 00 00 00 00 00 ];
-                       interrupts = <1d 2 1e 2 22 2>;
+                       interrupts = <29 2 30 2 34 2>;
                        interrupt-parent = <&mpic>;
                        phy-handle = <&phy0>;
                };
                        device_type = "network";
                        model = "eTSEC";
                        compatible = "gianfar";
-                       reg = <25000 1000>;
+                       reg = <0x25000 0x1000>;
                        local-mac-address = [ 00 00 00 00 00 00 ];
-                       interrupts = <23 2 24 2 28 2>;
+                       interrupts = <35 2 36 2 40 2>;
                        interrupt-parent = <&mpic>;
                        phy-handle = <&phy1>;
                };
                        device_type = "network";
                        model = "eTSEC";
                        compatible = "gianfar";
-                       reg = <26000 1000>;
+                       reg = <0x26000 0x1000>;
                        local-mac-address = [ 00 00 00 00 00 00 ];
-                       interrupts = <1f 2 20 2 21 2>;
+                       interrupts = <31 2 32 2 33 2>;
                        interrupt-parent = <&mpic>;
                        phy-handle = <&phy2>;
                };
                        device_type = "network";
                        model = "eTSEC";
                        compatible = "gianfar";
-                       reg = <27000 1000>;
+                       reg = <0x27000 0x1000>;
                        local-mac-address = [ 00 00 00 00 00 00 ];
-                       interrupts = <25 2 26 2 27 2>;
+                       interrupts = <37 2 38 2 39 2>;
                        interrupt-parent = <&mpic>;
                        phy-handle = <&phy3>;
                };
                        cell-index = <0>;
                        device_type = "serial";
                        compatible = "ns16550";
-                       reg = <4500 100>;       // reg base, size
+                       reg = <0x4500 0x100>;   // reg base, size
                        clock-frequency = <0>;  // should we fill in in uboot?
-                       interrupts = <2a 2>;
+                       interrupts = <42 2>;
                        interrupt-parent = <&mpic>;
                };
 
                        cell-index = <1>;
                        device_type = "serial";
                        compatible = "ns16550";
-                       reg = <4600 100>;       // reg base, size
+                       reg = <0x4600 0x100>;   // reg base, size
                        clock-frequency = <0>;  // should we fill in in uboot?
-                       interrupts = <2a 2>;
+                       interrupts = <42 2>;
                        interrupt-parent = <&mpic>;
                };
 
                global-utilities@e0000 {        //global utilities reg
                        compatible = "fsl,mpc8548-guts";
-                       reg = <e0000 1000>;
+                       reg = <0xe0000 0x1000>;
                        fsl,has-rstcr;
                };
 
                        interrupt-controller;
                        #address-cells = <0>;
                        #interrupt-cells = <2>;
-                       reg = <40000 40000>;
+                       reg = <0x40000 0x40000>;
                        compatible = "chrp,open-pic";
                        device_type = "open-pic";
                         big-endian;
 
        pci0: pci@e0008000 {
                cell-index = <0>;
-               interrupt-map-mask = <f800 0 0 7>;
+               interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
                interrupt-map = <
                        /* IDSEL 0x4 (PCIX Slot 2) */
-                       02000 0 0 1 &mpic 0 1
-                       02000 0 0 2 &mpic 1 1
-                       02000 0 0 3 &mpic 2 1
-                       02000 0 0 4 &mpic 3 1
+                       0x2000 0x0 0x0 0x1 &mpic 0x0 0x1
+                       0x2000 0x0 0x0 0x2 &mpic 0x1 0x1
+                       0x2000 0x0 0x0 0x3 &mpic 0x2 0x1
+                       0x2000 0x0 0x0 0x4 &mpic 0x3 0x1
 
                        /* IDSEL 0x5 (PCIX Slot 3) */
-                       02800 0 0 1 &mpic 1 1
-                       02800 0 0 2 &mpic 2 1
-                       02800 0 0 3 &mpic 3 1
-                       02800 0 0 4 &mpic 0 1
+                       0x2800 0x0 0x0 0x1 &mpic 0x1 0x1
+                       0x2800 0x0 0x0 0x2 &mpic 0x2 0x1
+                       0x2800 0x0 0x0 0x3 &mpic 0x3 0x1
+                       0x2800 0x0 0x0 0x4 &mpic 0x0 0x1
 
                        /* IDSEL 0x6 (PCIX Slot 4) */
-                       03000 0 0 1 &mpic 2 1
-                       03000 0 0 2 &mpic 3 1
-                       03000 0 0 3 &mpic 0 1
-                       03000 0 0 4 &mpic 1 1
+                       0x3000 0x0 0x0 0x1 &mpic 0x2 0x1
+                       0x3000 0x0 0x0 0x2 &mpic 0x3 0x1
+                       0x3000 0x0 0x0 0x3 &mpic 0x0 0x1
+                       0x3000 0x0 0x0 0x4 &mpic 0x1 0x1
 
                        /* IDSEL 0x8 (PCIX Slot 5) */
-                       04000 0 0 1 &mpic 0 1
-                       04000 0 0 2 &mpic 1 1
-                       04000 0 0 3 &mpic 2 1
-                       04000 0 0 4 &mpic 3 1
+                       0x4000 0x0 0x0 0x1 &mpic 0x0 0x1
+                       0x4000 0x0 0x0 0x2 &mpic 0x1 0x1
+                       0x4000 0x0 0x0 0x3 &mpic 0x2 0x1
+                       0x4000 0x0 0x0 0x4 &mpic 0x3 0x1
 
                        /* IDSEL 0xC (Tsi310 bridge) */
-                       06000 0 0 1 &mpic 0 1
-                       06000 0 0 2 &mpic 1 1
-                       06000 0 0 3 &mpic 2 1
-                       06000 0 0 4 &mpic 3 1
+                       0x6000 0x0 0x0 0x1 &mpic 0x0 0x1
+                       0x6000 0x0 0x0 0x2 &mpic 0x1 0x1
+                       0x6000 0x0 0x0 0x3 &mpic 0x2 0x1
+                       0x6000 0x0 0x0 0x4 &mpic 0x3 0x1
 
                        /* IDSEL 0x14 (Slot 2) */
-                       0a000 0 0 1 &mpic 0 1
-                       0a000 0 0 2 &mpic 1 1
-                       0a000 0 0 3 &mpic 2 1
-                       0a000 0 0 4 &mpic 3 1
+                       0xa000 0x0 0x0 0x1 &mpic 0x0 0x1
+                       0xa000 0x0 0x0 0x2 &mpic 0x1 0x1
+                       0xa000 0x0 0x0 0x3 &mpic 0x2 0x1
+                       0xa000 0x0 0x0 0x4 &mpic 0x3 0x1
 
                        /* IDSEL 0x15 (Slot 3) */
-                       0a800 0 0 1 &mpic 1 1
-                       0a800 0 0 2 &mpic 2 1
-                       0a800 0 0 3 &mpic 3 1
-                       0a800 0 0 4 &mpic 0 1
+                       0xa800 0x0 0x0 0x1 &mpic 0x1 0x1
+                       0xa800 0x0 0x0 0x2 &mpic 0x2 0x1
+                       0xa800 0x0 0x0 0x3 &mpic 0x3 0x1
+                       0xa800 0x0 0x0 0x4 &mpic 0x0 0x1
 
                        /* IDSEL 0x16 (Slot 4) */
-                       0b000 0 0 1 &mpic 2 1
-                       0b000 0 0 2 &mpic 3 1
-                       0b000 0 0 3 &mpic 0 1
-                       0b000 0 0 4 &mpic 1 1
+                       0xb000 0x0 0x0 0x1 &mpic 0x2 0x1
+                       0xb000 0x0 0x0 0x2 &mpic 0x3 0x1
+                       0xb000 0x0 0x0 0x3 &mpic 0x0 0x1
+                       0xb000 0x0 0x0 0x4 &mpic 0x1 0x1
 
                        /* IDSEL 0x18 (Slot 5) */
-                       0c000 0 0 1 &mpic 0 1
-                       0c000 0 0 2 &mpic 1 1
-                       0c000 0 0 3 &mpic 2 1
-                       0c000 0 0 4 &mpic 3 1
+                       0xc000 0x0 0x0 0x1 &mpic 0x0 0x1
+                       0xc000 0x0 0x0 0x2 &mpic 0x1 0x1
+                       0xc000 0x0 0x0 0x3 &mpic 0x2 0x1
+                       0xc000 0x0 0x0 0x4 &mpic 0x3 0x1
 
                        /* IDSEL 0x1C (Tsi310 bridge PCI primary) */
-                       0E000 0 0 1 &mpic 0 1
-                       0E000 0 0 2 &mpic 1 1
-                       0E000 0 0 3 &mpic 2 1
-                       0E000 0 0 4 &mpic 3 1>;
+                       0xe000 0x0 0x0 0x1 &mpic 0x0 0x1
+                       0xe000 0x0 0x0 0x2 &mpic 0x1 0x1
+                       0xe000 0x0 0x0 0x3 &mpic 0x2 0x1
+                       0xe000 0x0 0x0 0x4 &mpic 0x3 0x1>;
 
                interrupt-parent = <&mpic>;
-               interrupts = <18 2>;
+               interrupts = <24 2>;
                bus-range = <0 0>;
-               ranges = <02000000 0 80000000 80000000 0 10000000
-                         01000000 0 00000000 e2000000 0 00800000>;
-               clock-frequency = <3f940aa>;
+               ranges = <0x2000000 0x0 0x80000000 0x80000000 0x0 0x10000000
+                         0x1000000 0x0 0x0 0xe2000000 0x0 0x800000>;
+               clock-frequency = <66666666>;
                #interrupt-cells = <1>;
                #size-cells = <2>;
                #address-cells = <3>;
-               reg = <e0008000 1000>;
+               reg = <0xe0008000 0x1000>;
                compatible = "fsl,mpc8540-pcix", "fsl,mpc8540-pci";
                device_type = "pci";
 
                pci_bridge@1c {
-                       interrupt-map-mask = <f800 0 0 7>;
+                       interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
                        interrupt-map = <
 
                                /* IDSEL 0x00 (PrPMC Site) */
-                               0000 0 0 1 &mpic 0 1
-                               0000 0 0 2 &mpic 1 1
-                               0000 0 0 3 &mpic 2 1
-                               0000 0 0 4 &mpic 3 1
+                               0000 0x0 0x0 0x1 &mpic 0x0 0x1
+                               0000 0x0 0x0 0x2 &mpic 0x1 0x1
+                               0000 0x0 0x0 0x3 &mpic 0x2 0x1
+                               0000 0x0 0x0 0x4 &mpic 0x3 0x1
 
                                /* IDSEL 0x04 (VIA chip) */
-                               2000 0 0 1 &mpic 0 1
-                               2000 0 0 2 &mpic 1 1
-                               2000 0 0 3 &mpic 2 1
-                               2000 0 0 4 &mpic 3 1
+                               0x2000 0x0 0x0 0x1 &mpic 0x0 0x1
+                               0x2000 0x0 0x0 0x2 &mpic 0x1 0x1
+                               0x2000 0x0 0x0 0x3 &mpic 0x2 0x1
+                               0x2000 0x0 0x0 0x4 &mpic 0x3 0x1
 
                                /* IDSEL 0x05 (8139) */
-                               2800 0 0 1 &mpic 1 1
+                               0x2800 0x0 0x0 0x1 &mpic 0x1 0x1
 
                                /* IDSEL 0x06 (Slot 6) */
-                               3000 0 0 1 &mpic 2 1
-                               3000 0 0 2 &mpic 3 1
-                               3000 0 0 3 &mpic 0 1
-                               3000 0 0 4 &mpic 1 1
+                               0x3000 0x0 0x0 0x1 &mpic 0x2 0x1
+                               0x3000 0x0 0x0 0x2 &mpic 0x3 0x1
+                               0x3000 0x0 0x0 0x3 &mpic 0x0 0x1
+                               0x3000 0x0 0x0 0x4 &mpic 0x1 0x1
 
                                /* IDESL 0x07 (Slot 7) */
-                               3800 0 0 1 &mpic 3 1
-                               3800 0 0 2 &mpic 0 1
-                               3800 0 0 3 &mpic 1 1
-                               3800 0 0 4 &mpic 2 1>;
+                               0x3800 0x0 0x0 0x1 &mpic 0x3 0x1
+                               0x3800 0x0 0x0 0x2 &mpic 0x0 0x1
+                               0x3800 0x0 0x0 0x3 &mpic 0x1 0x1
+                               0x3800 0x0 0x0 0x4 &mpic 0x2 0x1>;
 
-                       reg = <e000 0 0 0 0>;
+                       reg = <0xe000 0x0 0x0 0x0 0x0>;
                        #interrupt-cells = <1>;
                        #size-cells = <2>;
                        #address-cells = <3>;
-                       ranges = <02000000 0 80000000
-                                 02000000 0 80000000
-                                 0 20000000
-                                 01000000 0 00000000
-                                 01000000 0 00000000
-                                 0 00080000>;
-                       clock-frequency = <1fca055>;
+                       ranges = <0x2000000 0x0 0x80000000
+                                 0x2000000 0x0 0x80000000
+                                 0x0 0x20000000
+                                 0x1000000 0x0 0x0
+                                 0x1000000 0x0 0x0
+                                 0x0 0x80000>;
+                       clock-frequency = <33333333>;
 
                        isa@4 {
                                device_type = "isa";
                                #interrupt-cells = <2>;
                                #size-cells = <1>;
                                #address-cells = <2>;
-                               reg = <2000 0 0 0 0>;
-                               ranges = <1 0 01000000 0 0 00001000>;
+                               reg = <0x2000 0x0 0x0 0x0 0x0>;
+                               ranges = <0x1 0x0 0x1000000 0x0 0x0 0x1000>;
                                interrupt-parent = <&i8259>;
 
                                i8259: interrupt-controller@20 {
                                        interrupt-controller;
                                        device_type = "interrupt-controller";
-                                       reg = <1 20 2
-                                              1 a0 2
-                                              1 4d0 2>;
+                                       reg = <0x1 0x20 0x2
+                                              0x1 0xa0 0x2
+                                              0x1 0x4d0 0x2>;
                                        #address-cells = <0>;
                                        #interrupt-cells = <2>;
                                        compatible = "chrp,iic";
 
                                rtc@70 {
                                        compatible = "pnpPNP,b00";
-                                       reg = <1 70 2>;
+                                       reg = <0x1 0x70 0x2>;
                                };
                        };
                };
 
        pci1: pci@e0009000 {
                cell-index = <1>;
-               interrupt-map-mask = <f800 0 0 7>;
+               interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
                interrupt-map = <
 
                        /* IDSEL 0x15 */
-                       a800 0 0 1 &mpic b 1
-                       a800 0 0 2 &mpic 1 1
-                       a800 0 0 3 &mpic 2 1
-                       a800 0 0 4 &mpic 3 1>;
+                       0xa800 0x0 0x0 0x1 &mpic 0xb 0x1
+                       0xa800 0x0 0x0 0x2 &mpic 0x1 0x1
+                       0xa800 0x0 0x0 0x3 &mpic 0x2 0x1
+                       0xa800 0x0 0x0 0x4 &mpic 0x3 0x1>;
 
                interrupt-parent = <&mpic>;
-               interrupts = <19 2>;
+               interrupts = <25 2>;
                bus-range = <0 0>;
-               ranges = <02000000 0 90000000 90000000 0 10000000
-                         01000000 0 00000000 e2800000 0 00800000>;
-               clock-frequency = <3f940aa>;
+               ranges = <0x2000000 0x0 0x90000000 0x90000000 0x0 0x10000000
+                         0x1000000 0x0 0x0 0xe2800000 0x0 0x800000>;
+               clock-frequency = <66666666>;
                #interrupt-cells = <1>;
                #size-cells = <2>;
                #address-cells = <3>;
-               reg = <e0009000 1000>;
+               reg = <0xe0009000 0x1000>;
                compatible = "fsl,mpc8540-pci";
                device_type = "pci";
        };
 
        pci2: pcie@e000a000 {
                cell-index = <2>;
-               interrupt-map-mask = <f800 0 0 7>;
+               interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
                interrupt-map = <
 
                        /* IDSEL 0x0 (PEX) */
-                       00000 0 0 1 &mpic 0 1
-                       00000 0 0 2 &mpic 1 1
-                       00000 0 0 3 &mpic 2 1
-                       00000 0 0 4 &mpic 3 1>;
+                       00000 0x0 0x0 0x1 &mpic 0x0 0x1
+                       00000 0x0 0x0 0x2 &mpic 0x1 0x1
+                       00000 0x0 0x0 0x3 &mpic 0x2 0x1
+                       00000 0x0 0x0 0x4 &mpic 0x3 0x1>;
 
                interrupt-parent = <&mpic>;
-               interrupts = <1a 2>;
-               bus-range = <0 ff>;
-               ranges = <02000000 0 a0000000 a0000000 0 20000000
-                         01000000 0 00000000 e3000000 0 08000000>;
-               clock-frequency = <1fca055>;
+               interrupts = <26 2>;
+               bus-range = <0 255>;
+               ranges = <0x2000000 0x0 0xa0000000 0xa0000000 0x0 0x20000000
+                         0x1000000 0x0 0x0 0xe3000000 0x0 0x8000000>;
+               clock-frequency = <33333333>;
                #interrupt-cells = <1>;
                #size-cells = <2>;
                #address-cells = <3>;
-               reg = <e000a000 1000>;
+               reg = <0xe000a000 0x1000>;
                compatible = "fsl,mpc8548-pcie";
                device_type = "pci";
                pcie@0 {
-                       reg = <0 0 0 0 0>;
+                       reg = <0x0 0x0 0x0 0x0 0x0>;
                        #size-cells = <2>;
                        #address-cells = <3>;
                        device_type = "pci";
-                       ranges = <02000000 0 a0000000
-                                 02000000 0 a0000000
-                                 0 20000000
+                       ranges = <0x2000000 0x0 0xa0000000
+                                 0x2000000 0x0 0xa0000000
+                                 0x0 0x20000000
 
-                                 01000000 0 00000000
-                                 01000000 0 00000000
-                                 0 08000000>;
+                                 0x1000000 0x0 0x0
+                                 0x1000000 0x0 0x0
+                                 0x0 0x8000000>;
                };
        };
 };
index 4538f3c388629cd68da8ed93914e8ee2f82e4d9f..b025c566c10d1cf725a3675d113f0efb6c73c940 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * MPC8555 CDS Device Tree Source
  *
- * Copyright 2006 Freescale Semiconductor Inc.
+ * Copyright 2006, 2008 Freescale Semiconductor Inc.
  *
  * This program is free software; you can redistribute  it and/or modify it
  * under  the terms of  the GNU General  Public License as published by the
@@ -9,6 +9,7 @@
  * option) any later version.
  */
 
+/dts-v1/;
 
 / {
        model = "MPC8555CDS";
 
                PowerPC,8555@0 {
                        device_type = "cpu";
-                       reg = <0>;
-                       d-cache-line-size = <20>;       // 32 bytes
-                       i-cache-line-size = <20>;       // 32 bytes
-                       d-cache-size = <8000>;          // L1, 32K
-                       i-cache-size = <8000>;          // L1, 32K
+                       reg = <0x0>;
+                       d-cache-line-size = <32>;       // 32 bytes
+                       i-cache-line-size = <32>;       // 32 bytes
+                       d-cache-size = <0x8000>;                // L1, 32K
+                       i-cache-size = <0x8000>;                // L1, 32K
                        timebase-frequency = <0>;       //  33 MHz, from uboot
                        bus-frequency = <0>;    // 166 MHz
                        clock-frequency = <0>;  // 825 MHz, from uboot
 
        memory {
                device_type = "memory";
-               reg = <00000000 08000000>;      // 128M at 0x0
+               reg = <0x0 0x8000000>;  // 128M at 0x0
        };
 
        soc8555@e0000000 {
                #address-cells = <1>;
                #size-cells = <1>;
                device_type = "soc";
-               ranges = <0 e0000000 00100000>;
-               reg = <e0000000 00001000>;      // CCSRBAR 1M
+               ranges = <0x0 0xe0000000 0x100000>;
+               reg = <0xe0000000 0x1000>;      // CCSRBAR 1M
                bus-frequency = <0>;
 
                memory-controller@2000 {
                        compatible = "fsl,8555-memory-controller";
-                       reg = <2000 1000>;
+                       reg = <0x2000 0x1000>;
                        interrupt-parent = <&mpic>;
-                       interrupts = <12 2>;
+                       interrupts = <18 2>;
                };
 
                l2-cache-controller@20000 {
                        compatible = "fsl,8555-l2-cache-controller";
-                       reg = <20000 1000>;
-                       cache-line-size = <20>; // 32 bytes
-                       cache-size = <40000>;   // L2, 256K
+                       reg = <0x20000 0x1000>;
+                       cache-line-size = <32>; // 32 bytes
+                       cache-size = <0x40000>; // L2, 256K
                        interrupt-parent = <&mpic>;
-                       interrupts = <10 2>;
+                       interrupts = <16 2>;
                };
 
                i2c@3000 {
@@ -76,8 +77,8 @@
                        #size-cells = <0>;
                        cell-index = <0>;
                        compatible = "fsl-i2c";
-                       reg = <3000 100>;
-                       interrupts = <2b 2>;
+                       reg = <0x3000 0x100>;
+                       interrupts = <43 2>;
                        interrupt-parent = <&mpic>;
                        dfsrr;
                };
                        #address-cells = <1>;
                        #size-cells = <0>;
                        compatible = "fsl,gianfar-mdio";
-                       reg = <24520 20>;
+                       reg = <0x24520 0x20>;
 
                        phy0: ethernet-phy@0 {
                                interrupt-parent = <&mpic>;
                                interrupts = <5 1>;
-                               reg = <0>;
+                               reg = <0x0>;
                                device_type = "ethernet-phy";
                        };
                        phy1: ethernet-phy@1 {
                                interrupt-parent = <&mpic>;
                                interrupts = <5 1>;
-                               reg = <1>;
+                               reg = <0x1>;
                                device_type = "ethernet-phy";
                        };
                };
                        device_type = "network";
                        model = "TSEC";
                        compatible = "gianfar";
-                       reg = <24000 1000>;
+                       reg = <0x24000 0x1000>;
                        local-mac-address = [ 00 00 00 00 00 00 ];
-                       interrupts = <1d 2 1e 2 22 2>;
+                       interrupts = <29 2 30 2 34 2>;
                        interrupt-parent = <&mpic>;
                        phy-handle = <&phy0>;
                };
                        device_type = "network";
                        model = "TSEC";
                        compatible = "gianfar";
-                       reg = <25000 1000>;
+                       reg = <0x25000 0x1000>;
                        local-mac-address = [ 00 00 00 00 00 00 ];
-                       interrupts = <23 2 24 2 28 2>;
+                       interrupts = <35 2 36 2 40 2>;
                        interrupt-parent = <&mpic>;
                        phy-handle = <&phy1>;
                };
                        cell-index = <0>;
                        device_type = "serial";
                        compatible = "ns16550";
-                       reg = <4500 100>;       // reg base, size
+                       reg = <0x4500 0x100>;   // reg base, size
                        clock-frequency = <0>;  // should we fill in in uboot?
-                       interrupts = <2a 2>;
+                       interrupts = <42 2>;
                        interrupt-parent = <&mpic>;
                };
 
                        cell-index = <1>;
                        device_type = "serial";
                        compatible = "ns16550";
-                       reg = <4600 100>;       // reg base, size
+                       reg = <0x4600 0x100>;   // reg base, size
                        clock-frequency = <0>;  // should we fill in in uboot?
-                       interrupts = <2a 2>;
+                       interrupts = <42 2>;
                        interrupt-parent = <&mpic>;
                };
 
                        interrupt-controller;
                        #address-cells = <0>;
                        #interrupt-cells = <2>;
-                       reg = <40000 40000>;
+                       reg = <0x40000 0x40000>;
                        compatible = "chrp,open-pic";
                        device_type = "open-pic";
                         big-endian;
                        #address-cells = <1>;
                        #size-cells = <1>;
                        compatible = "fsl,mpc8555-cpm", "fsl,cpm2";
-                       reg = <919c0 30>;
+                       reg = <0x919c0 0x30>;
                        ranges;
 
                        muram@80000 {
                                #address-cells = <1>;
                                #size-cells = <1>;
-                               ranges = <0 80000 10000>;
+                               ranges = <0x0 0x80000 0x10000>;
 
                                data@0 {
                                        compatible = "fsl,cpm-muram-data";
-                                       reg = <0 2000 9000 1000>;
+                                       reg = <0x0 0x2000 0x9000 0x1000>;
                                };
                        };
 
                                compatible = "fsl,mpc8555-brg",
                                             "fsl,cpm2-brg",
                                             "fsl,cpm-brg";
-                               reg = <919f0 10 915f0 10>;
+                               reg = <0x919f0 0x10 0x915f0 0x10>;
                        };
 
                        cpmpic: pic@90c00 {
                                interrupt-controller;
                                #address-cells = <0>;
                                #interrupt-cells = <2>;
-                               interrupts = <2e 2>;
+                               interrupts = <46 2>;
                                interrupt-parent = <&mpic>;
-                               reg = <90c00 80>;
+                               reg = <0x90c00 0x80>;
                                compatible = "fsl,mpc8555-cpm-pic", "fsl,cpm2-pic";
                        };
                };
 
        pci0: pci@e0008000 {
                cell-index = <0>;
-               interrupt-map-mask = <1f800 0 0 7>;
+               interrupt-map-mask = <0x1f800 0x0 0x0 0x7>;
                interrupt-map = <
 
                        /* IDSEL 0x10 */
-                       08000 0 0 1 &mpic 0 1
-                       08000 0 0 2 &mpic 1 1
-                       08000 0 0 3 &mpic 2 1
-                       08000 0 0 4 &mpic 3 1
+                       0x8000 0x0 0x0 0x1 &mpic 0x0 0x1
+                       0x8000 0x0 0x0 0x2 &mpic 0x1 0x1
+                       0x8000 0x0 0x0 0x3 &mpic 0x2 0x1
+                       0x8000 0x0 0x0 0x4 &mpic 0x3 0x1
 
                        /* IDSEL 0x11 */
-                       08800 0 0 1 &mpic 0 1
-                       08800 0 0 2 &mpic 1 1
-                       08800 0 0 3 &mpic 2 1
-                       08800 0 0 4 &mpic 3 1
+                       0x8800 0x0 0x0 0x1 &mpic 0x0 0x1
+                       0x8800 0x0 0x0 0x2 &mpic 0x1 0x1
+                       0x8800 0x0 0x0 0x3 &mpic 0x2 0x1
+                       0x8800 0x0 0x0 0x4 &mpic 0x3 0x1
 
                        /* IDSEL 0x12 (Slot 1) */
-                       09000 0 0 1 &mpic 0 1
-                       09000 0 0 2 &mpic 1 1
-                       09000 0 0 3 &mpic 2 1
-                       09000 0 0 4 &mpic 3 1
+                       0x9000 0x0 0x0 0x1 &mpic 0x0 0x1
+                       0x9000 0x0 0x0 0x2 &mpic 0x1 0x1
+                       0x9000 0x0 0x0 0x3 &mpic 0x2 0x1
+                       0x9000 0x0 0x0 0x4 &mpic 0x3 0x1
 
                        /* IDSEL 0x13 (Slot 2) */
-                       09800 0 0 1 &mpic 1 1
-                       09800 0 0 2 &mpic 2 1
-                       09800 0 0 3 &mpic 3 1
-                       09800 0 0 4 &mpic 0 1
+                       0x9800 0x0 0x0 0x1 &mpic 0x1 0x1
+                       0x9800 0x0 0x0 0x2 &mpic 0x2 0x1
+                       0x9800 0x0 0x0 0x3 &mpic 0x3 0x1
+                       0x9800 0x0 0x0 0x4 &mpic 0x0 0x1
 
                        /* IDSEL 0x14 (Slot 3) */
-                       0a000 0 0 1 &mpic 2 1
-                       0a000 0 0 2 &mpic 3 1
-                       0a000 0 0 3 &mpic 0 1
-                       0a000 0 0 4 &mpic 1 1
+                       0xa000 0x0 0x0 0x1 &mpic 0x2 0x1
+                       0xa000 0x0 0x0 0x2 &mpic 0x3 0x1
+                       0xa000 0x0 0x0 0x3 &mpic 0x0 0x1
+                       0xa000 0x0 0x0 0x4 &mpic 0x1 0x1
 
                        /* IDSEL 0x15 (Slot 4) */
-                       0a800 0 0 1 &mpic 3 1
-                       0a800 0 0 2 &mpic 0 1
-                       0a800 0 0 3 &mpic 1 1
-                       0a800 0 0 4 &mpic 2 1
+                       0xa800 0x0 0x0 0x1 &mpic 0x3 0x1
+                       0xa800 0x0 0x0 0x2 &mpic 0x0 0x1
+                       0xa800 0x0 0x0 0x3 &mpic 0x1 0x1
+                       0xa800 0x0 0x0 0x4 &mpic 0x2 0x1
 
                        /* Bus 1 (Tundra Bridge) */
                        /* IDSEL 0x12 (ISA bridge) */
-                       19000 0 0 1 &mpic 0 1
-                       19000 0 0 2 &mpic 1 1
-                       19000 0 0 3 &mpic 2 1
-                       19000 0 0 4 &mpic 3 1>;
+                       0x19000 0x0 0x0 0x1 &mpic 0x0 0x1
+                       0x19000 0x0 0x0 0x2 &mpic 0x1 0x1
+                       0x19000 0x0 0x0 0x3 &mpic 0x2 0x1
+                       0x19000 0x0 0x0 0x4 &mpic 0x3 0x1>;
                interrupt-parent = <&mpic>;
-               interrupts = <18 2>;
+               interrupts = <24 2>;
                bus-range = <0 0>;
-               ranges = <02000000 0 80000000 80000000 0 20000000
-                         01000000 0 00000000 e2000000 0 00100000>;
-               clock-frequency = <3f940aa>;
+               ranges = <0x2000000 0x0 0x80000000 0x80000000 0x0 0x20000000
+                         0x1000000 0x0 0x0 0xe2000000 0x0 0x100000>;
+               clock-frequency = <66666666>;
                #interrupt-cells = <1>;
                #size-cells = <2>;
                #address-cells = <3>;
-               reg = <e0008000 1000>;
+               reg = <0xe0008000 0x1000>;
                compatible = "fsl,mpc8540-pci";
                device_type = "pci";
 
                i8259@19000 {
                        interrupt-controller;
                        device_type = "interrupt-controller";
-                       reg = <19000 0 0 0 1>;
+                       reg = <0x19000 0x0 0x0 0x0 0x1>;
                        #address-cells = <0>;
                        #interrupt-cells = <2>;
                        compatible = "chrp,iic";
 
        pci1: pci@e0009000 {
                cell-index = <1>;
-               interrupt-map-mask = <f800 0 0 7>;
+               interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
                interrupt-map = <
 
                        /* IDSEL 0x15 */
-                       a800 0 0 1 &mpic b 1
-                       a800 0 0 2 &mpic b 1
-                       a800 0 0 3 &mpic b 1
-                       a800 0 0 4 &mpic b 1>;
+                       0xa800 0x0 0x0 0x1 &mpic 0xb 0x1
+                       0xa800 0x0 0x0 0x2 &mpic 0xb 0x1
+                       0xa800 0x0 0x0 0x3 &mpic 0xb 0x1
+                       0xa800 0x0 0x0 0x4 &mpic 0xb 0x1>;
                interrupt-parent = <&mpic>;
-               interrupts = <19 2>;
+               interrupts = <25 2>;
                bus-range = <0 0>;
-               ranges = <02000000 0 a0000000 a0000000 0 20000000
-                         01000000 0 00000000 e3000000 0 00100000>;
-               clock-frequency = <3f940aa>;
+               ranges = <0x2000000 0x0 0xa0000000 0xa0000000 0x0 0x20000000
+                         0x1000000 0x0 0x0 0xe3000000 0x0 0x100000>;
+               clock-frequency = <66666666>;
                #interrupt-cells = <1>;
                #size-cells = <2>;
                #address-cells = <3>;
-               reg = <e0009000 1000>;
+               reg = <0xe0009000 0x1000>;
                compatible = "fsl,mpc8540-pci";
                device_type = "pci";
        };
index 639ce8a709a63b03fb05761a927ee52566b0a9e9..0cc16ab305d118879ad59dba5a144bc21a6af1c6 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * MPC8560 ADS Device Tree Source
  *
- * Copyright 2006 Freescale Semiconductor Inc.
+ * Copyright 2006, 2008 Freescale Semiconductor Inc.
  *
  * This program is free software; you can redistribute  it and/or modify it
  * under  the terms of  the GNU General  Public License as published by the
@@ -9,6 +9,7 @@
  * option) any later version.
  */
 
+/dts-v1/;
 
 / {
        model = "MPC8560ADS";
 
                PowerPC,8560@0 {
                        device_type = "cpu";
-                       reg = <0>;
-                       d-cache-line-size = <20>;       // 32 bytes
-                       i-cache-line-size = <20>;       // 32 bytes
-                       d-cache-size = <8000>;          // L1, 32K
-                       i-cache-size = <8000>;          // L1, 32K
-                       timebase-frequency = <04ead9a0>;
-                       bus-frequency = <13ab6680>;
-                       clock-frequency = <312c8040>;
+                       reg = <0x0>;
+                       d-cache-line-size = <32>;       // 32 bytes
+                       i-cache-line-size = <32>;       // 32 bytes
+                       d-cache-size = <0x8000>;                // L1, 32K
+                       i-cache-size = <0x8000>;                // L1, 32K
+                       timebase-frequency = <82500000>;
+                       bus-frequency = <330000000>;
+                       clock-frequency = <825000000>;
                };
        };
 
        memory {
                device_type = "memory";
-               reg = <00000000 10000000>;
+               reg = <0x0 0x10000000>;
        };
 
        soc8560@e0000000 {
                #address-cells = <1>;
                #size-cells = <1>;
                device_type = "soc";
-               ranges = <0 e0000000 00100000>;
-               reg = <e0000000 00000200>;
-               bus-frequency = <13ab6680>;
+               ranges = <0x0 0xe0000000 0x100000>;
+               reg = <0xe0000000 0x200>;
+               bus-frequency = <330000000>;
 
                memory-controller@2000 {
                        compatible = "fsl,8540-memory-controller";
-                       reg = <2000 1000>;
+                       reg = <0x2000 0x1000>;
                        interrupt-parent = <&mpic>;
-                       interrupts = <12 2>;
+                       interrupts = <18 2>;
                };
 
                l2-cache-controller@20000 {
                        compatible = "fsl,8540-l2-cache-controller";
-                       reg = <20000 1000>;
-                       cache-line-size = <20>; // 32 bytes
-                       cache-size = <40000>;   // L2, 256K
+                       reg = <0x20000 0x1000>;
+                       cache-line-size = <32>; // 32 bytes
+                       cache-size = <0x40000>; // L2, 256K
                        interrupt-parent = <&mpic>;
-                       interrupts = <10 2>;
+                       interrupts = <16 2>;
                };
 
                mdio@24520 {
                        #address-cells = <1>;
                        #size-cells = <0>;
                        compatible = "fsl,gianfar-mdio";
-                       reg = <24520 20>;
+                       reg = <0x24520 0x20>;
 
                        phy0: ethernet-phy@0 {
                                interrupt-parent = <&mpic>;
                                interrupts = <5 1>;
-                               reg = <0>;
+                               reg = <0x0>;
                                device_type = "ethernet-phy";
                        };
                        phy1: ethernet-phy@1 {
                                interrupt-parent = <&mpic>;
                                interrupts = <5 1>;
-                               reg = <1>;
+                               reg = <0x1>;
                                device_type = "ethernet-phy";
                        };
                        phy2: ethernet-phy@2 {
                                interrupt-parent = <&mpic>;
                                interrupts = <7 1>;
-                               reg = <2>;
+                               reg = <0x2>;
                                device_type = "ethernet-phy";
                        };
                        phy3: ethernet-phy@3 {
                                interrupt-parent = <&mpic>;
                                interrupts = <7 1>;
-                               reg = <3>;
+                               reg = <0x3>;
                                device_type = "ethernet-phy";
                        };
                };
                        device_type = "network";
                        model = "TSEC";
                        compatible = "gianfar";
-                       reg = <24000 1000>;
+                       reg = <0x24000 0x1000>;
                        local-mac-address = [ 00 00 00 00 00 00 ];
-                       interrupts = <1d 2 1e 2 22 2>;
+                       interrupts = <29 2 30 2 34 2>;
                        interrupt-parent = <&mpic>;
                        phy-handle = <&phy0>;
                };
                        device_type = "network";
                        model = "TSEC";
                        compatible = "gianfar";
-                       reg = <25000 1000>;
+                       reg = <0x25000 0x1000>;
                        local-mac-address = [ 00 00 00 00 00 00 ];
-                       interrupts = <23 2 24 2 28 2>;
+                       interrupts = <35 2 36 2 40 2>;
                        interrupt-parent = <&mpic>;
                        phy-handle = <&phy1>;
                };
                        interrupt-controller;
                        #address-cells = <0>;
                        #interrupt-cells = <2>;
-                       reg = <40000 40000>;
+                       reg = <0x40000 0x40000>;
                        device_type = "open-pic";
                };
 
                        #address-cells = <1>;
                        #size-cells = <1>;
                        compatible = "fsl,mpc8560-cpm", "fsl,cpm2";
-                       reg = <919c0 30>;
+                       reg = <0x919c0 0x30>;
                        ranges;
 
                        muram@80000 {
                                #address-cells = <1>;
                                #size-cells = <1>;
-                               ranges = <0 80000 10000>;
+                               ranges = <0x0 0x80000 0x10000>;
 
                                data@0 {
                                        compatible = "fsl,cpm-muram-data";
-                                       reg = <0 4000 9000 2000>;
+                                       reg = <0x0 0x4000 0x9000 0x2000>;
                                };
                        };
 
                                compatible = "fsl,mpc8560-brg",
                                             "fsl,cpm2-brg",
                                             "fsl,cpm-brg";
-                               reg = <919f0 10 915f0 10>;
-                               clock-frequency = <d#165000000>;
+                               reg = <0x919f0 0x10 0x915f0 0x10>;
+                               clock-frequency = <165000000>;
                        };
 
                        cpmpic: pic@90c00 {
                                interrupt-controller;
                                #address-cells = <0>;
                                #interrupt-cells = <2>;
-                               interrupts = <2e 2>;
+                               interrupts = <46 2>;
                                interrupt-parent = <&mpic>;
-                               reg = <90c00 80>;
+                               reg = <0x90c00 0x80>;
                                compatible = "fsl,mpc8560-cpm-pic", "fsl,cpm2-pic";
                        };
 
                                device_type = "serial";
                                compatible = "fsl,mpc8560-scc-uart",
                                             "fsl,cpm2-scc-uart";
-                               reg = <91a00 20 88000 100>;
+                               reg = <0x91a00 0x20 0x88000 0x100>;
                                fsl,cpm-brg = <1>;
-                               fsl,cpm-command = <00800000>;
-                               current-speed = <1c200>;
-                               interrupts = <28 8>;
+                               fsl,cpm-command = <0x800000>;
+                               current-speed = <115200>;
+                               interrupts = <40 8>;
                                interrupt-parent = <&cpmpic>;
                        };
 
                                device_type = "serial";
                                compatible = "fsl,mpc8560-scc-uart",
                                             "fsl,cpm2-scc-uart";
-                               reg = <91a20 20 88100 100>;
+                               reg = <0x91a20 0x20 0x88100 0x100>;
                                fsl,cpm-brg = <2>;
-                               fsl,cpm-command = <04a00000>;
-                               current-speed = <1c200>;
-                               interrupts = <29 8>;
+                               fsl,cpm-command = <0x4a00000>;
+                               current-speed = <115200>;
+                               interrupts = <41 8>;
                                interrupt-parent = <&cpmpic>;
                        };
 
                                device_type = "network";
                                compatible = "fsl,mpc8560-fcc-enet",
                                             "fsl,cpm2-fcc-enet";
-                               reg = <91320 20 88500 100 913b0 1>;
+                               reg = <0x91320 0x20 0x88500 0x100 0x913b0 0x1>;
                                local-mac-address = [ 00 00 00 00 00 00 ];
-                               fsl,cpm-command = <16200300>;
-                               interrupts = <21 8>;
+                               fsl,cpm-command = <0x16200300>;
+                               interrupts = <33 8>;
                                interrupt-parent = <&cpmpic>;
                                phy-handle = <&phy2>;
                        };
                                device_type = "network";
                                compatible = "fsl,mpc8560-fcc-enet",
                                             "fsl,cpm2-fcc-enet";
-                               reg = <91340 20 88600 100 913d0 1>;
+                               reg = <0x91340 0x20 0x88600 0x100 0x913d0 0x1>;
                                local-mac-address = [ 00 00 00 00 00 00 ];
-                               fsl,cpm-command = <1a400300>;
-                               interrupts = <22 8>;
+                               fsl,cpm-command = <0x1a400300>;
+                               interrupts = <34 8>;
                                interrupt-parent = <&cpmpic>;
                                phy-handle = <&phy3>;
                        };
                #address-cells = <3>;
                compatible = "fsl,mpc8540-pcix", "fsl,mpc8540-pci";
                device_type = "pci";
-               reg = <e0008000 1000>;
-               clock-frequency = <3f940aa>;
-               interrupt-map-mask = <f800 0 0 7>;
+               reg = <0xe0008000 0x1000>;
+               clock-frequency = <66666666>;
+               interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
                interrupt-map = <
 
                                /* IDSEL 0x2 */
-                                1000 0 0 1 &mpic 1 1
-                                1000 0 0 2 &mpic 2 1
-                                1000 0 0 3 &mpic 3 1
-                                1000 0 0 4 &mpic 4 1
+                                0x1000 0x0 0x0 0x1 &mpic 0x1 0x1
+                                0x1000 0x0 0x0 0x2 &mpic 0x2 0x1
+                                0x1000 0x0 0x0 0x3 &mpic 0x3 0x1
+                                0x1000 0x0 0x0 0x4 &mpic 0x4 0x1
 
                                /* IDSEL 0x3 */
-                                1800 0 0 1 &mpic 4 1
-                                1800 0 0 2 &mpic 1 1
-                                1800 0 0 3 &mpic 2 1
-                                1800 0 0 4 &mpic 3 1
+                                0x1800 0x0 0x0 0x1 &mpic 0x4 0x1
+                                0x1800 0x0 0x0 0x2 &mpic 0x1 0x1
+                                0x1800 0x0 0x0 0x3 &mpic 0x2 0x1
+                                0x1800 0x0 0x0 0x4 &mpic 0x3 0x1
 
                                /* IDSEL 0x4 */
-                                2000 0 0 1 &mpic 3 1
-                                2000 0 0 2 &mpic 4 1
-                                2000 0 0 3 &mpic 1 1
-                                2000 0 0 4 &mpic 2 1
+                                0x2000 0x0 0x0 0x1 &mpic 0x3 0x1
+                                0x2000 0x0 0x0 0x2 &mpic 0x4 0x1
+                                0x2000 0x0 0x0 0x3 &mpic 0x1 0x1
+                                0x2000 0x0 0x0 0x4 &mpic 0x2 0x1
 
                                /* IDSEL 0x5  */
-                                2800 0 0 1 &mpic 2 1
-                                2800 0 0 2 &mpic 3 1
-                                2800 0 0 3 &mpic 4 1
-                                2800 0 0 4 &mpic 1 1
+                                0x2800 0x0 0x0 0x1 &mpic 0x2 0x1
+                                0x2800 0x0 0x0 0x2 &mpic 0x3 0x1
+                                0x2800 0x0 0x0 0x3 &mpic 0x4 0x1
+                                0x2800 0x0 0x0 0x4 &mpic 0x1 0x1
 
                                /* IDSEL 12 */
-                                6000 0 0 1 &mpic 1 1
-                                6000 0 0 2 &mpic 2 1
-                                6000 0 0 3 &mpic 3 1
-                                6000 0 0 4 &mpic 4 1
+                                0x6000 0x0 0x0 0x1 &mpic 0x1 0x1
+                                0x6000 0x0 0x0 0x2 &mpic 0x2 0x1
+                                0x6000 0x0 0x0 0x3 &mpic 0x3 0x1
+                                0x6000 0x0 0x0 0x4 &mpic 0x4 0x1
 
                                /* IDSEL 13 */
-                                6800 0 0 1 &mpic 4 1
-                                6800 0 0 2 &mpic 1 1
-                                6800 0 0 3 &mpic 2 1
-                                6800 0 0 4 &mpic 3 1
+                                0x6800 0x0 0x0 0x1 &mpic 0x4 0x1
+                                0x6800 0x0 0x0 0x2 &mpic 0x1 0x1
+                                0x6800 0x0 0x0 0x3 &mpic 0x2 0x1
+                                0x6800 0x0 0x0 0x4 &mpic 0x3 0x1
 
                                /* IDSEL 14*/
-                                7000 0 0 1 &mpic 3 1
-                                7000 0 0 2 &mpic 4 1
-                                7000 0 0 3 &mpic 1 1
-                                7000 0 0 4 &mpic 2 1
+                                0x7000 0x0 0x0 0x1 &mpic 0x3 0x1
+                                0x7000 0x0 0x0 0x2 &mpic 0x4 0x1
+                                0x7000 0x0 0x0 0x3 &mpic 0x1 0x1
+                                0x7000 0x0 0x0 0x4 &mpic 0x2 0x1
 
                                /* IDSEL 15 */
-                                7800 0 0 1 &mpic 2 1
-                                7800 0 0 2 &mpic 3 1
-                                7800 0 0 3 &mpic 4 1
-                                7800 0 0 4 &mpic 1 1
+                                0x7800 0x0 0x0 0x1 &mpic 0x2 0x1
+                                0x7800 0x0 0x0 0x2 &mpic 0x3 0x1
+                                0x7800 0x0 0x0 0x3 &mpic 0x4 0x1
+                                0x7800 0x0 0x0 0x4 &mpic 0x1 0x1
 
                                /* IDSEL 18 */
-                                9000 0 0 1 &mpic 1 1
-                                9000 0 0 2 &mpic 2 1
-                                9000 0 0 3 &mpic 3 1
-                                9000 0 0 4 &mpic 4 1
+                                0x9000 0x0 0x0 0x1 &mpic 0x1 0x1
+                                0x9000 0x0 0x0 0x2 &mpic 0x2 0x1
+                                0x9000 0x0 0x0 0x3 &mpic 0x3 0x1
+                                0x9000 0x0 0x0 0x4 &mpic 0x4 0x1
 
                                /* IDSEL 19 */
-                                9800 0 0 1 &mpic 4 1
-                                9800 0 0 2 &mpic 1 1
-                                9800 0 0 3 &mpic 2 1
-                                9800 0 0 4 &mpic 3 1
+                                0x9800 0x0 0x0 0x1 &mpic 0x4 0x1
+                                0x9800 0x0 0x0 0x2 &mpic 0x1 0x1
+                                0x9800 0x0 0x0 0x3 &mpic 0x2 0x1
+                                0x9800 0x0 0x0 0x4 &mpic 0x3 0x1
 
                                /* IDSEL 20 */
-                                a000 0 0 1 &mpic 3 1
-                                a000 0 0 2 &mpic 4 1
-                                a000 0 0 3 &mpic 1 1
-                                a000 0 0 4 &mpic 2 1
+                                0xa000 0x0 0x0 0x1 &mpic 0x3 0x1
+                                0xa000 0x0 0x0 0x2 &mpic 0x4 0x1
+                                0xa000 0x0 0x0 0x3 &mpic 0x1 0x1
+                                0xa000 0x0 0x0 0x4 &mpic 0x2 0x1
 
                                /* IDSEL 21 */
-                                a800 0 0 1 &mpic 2 1
-                                a800 0 0 2 &mpic 3 1
-                                a800 0 0 3 &mpic 4 1
-                                a800 0 0 4 &mpic 1 1>;
+                                0xa800 0x0 0x0 0x1 &mpic 0x2 0x1
+                                0xa800 0x0 0x0 0x2 &mpic 0x3 0x1
+                                0xa800 0x0 0x0 0x3 &mpic 0x4 0x1
+                                0xa800 0x0 0x0 0x4 &mpic 0x1 0x1>;
 
                interrupt-parent = <&mpic>;
-               interrupts = <18 2>;
+               interrupts = <24 2>;
                bus-range = <0 0>;
-               ranges = <02000000 0 80000000 80000000 0 20000000
-                         01000000 0 00000000 e2000000 0 01000000>;
+               ranges = <0x2000000 0x0 0x80000000 0x80000000 0x0 0x20000000
+                         0x1000000 0x0 0x0 0xe2000000 0x0 0x1000000>;
        };
 };
index 97bc048f2158cef52f6f265344df9a976dbb8054..a025a8ededc5706277795ca44d7997aa722e1187 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * MPC8568E MDS Device Tree Source
  *
- * Copyright 2007 Freescale Semiconductor Inc.
+ * Copyright 2007, 2008 Freescale Semiconductor Inc.
  *
  * This program is free software; you can redistribute  it and/or modify it
  * under  the terms of  the GNU General  Public License as published by the
@@ -9,10 +9,7 @@
  * option) any later version.
  */
 
-
-/*
-/memreserve/   00000000 1000000;
-*/
+/dts-v1/;
 
 / {
        model = "MPC8568EMDS";
 
                PowerPC,8568@0 {
                        device_type = "cpu";
-                       reg = <0>;
-                       d-cache-line-size = <20>;       // 32 bytes
-                       i-cache-line-size = <20>;       // 32 bytes
-                       d-cache-size = <8000>;          // L1, 32K
-                       i-cache-size = <8000>;          // L1, 32K
+                       reg = <0x0>;
+                       d-cache-line-size = <32>;       // 32 bytes
+                       i-cache-line-size = <32>;       // 32 bytes
+                       d-cache-size = <0x8000>;                // L1, 32K
+                       i-cache-size = <0x8000>;                // L1, 32K
                        timebase-frequency = <0>;
                        bus-frequency = <0>;
                        clock-frequency = <0>;
 
        memory {
                device_type = "memory";
-               reg = <00000000 10000000>;
+               reg = <0x0 0x10000000>;
        };
 
        bcsr@f8000000 {
                device_type = "board-control";
-               reg = <f8000000 8000>;
+               reg = <0xf8000000 0x8000>;
        };
 
        soc8568@e0000000 {
                #address-cells = <1>;
                #size-cells = <1>;
                device_type = "soc";
-               ranges = <0 e0000000 00100000>;
-               reg = <e0000000 00001000>;
+               ranges = <0x0 0xe0000000 0x100000>;
+               reg = <0xe0000000 0x1000>;
                bus-frequency = <0>;
 
                memory-controller@2000 {
                        compatible = "fsl,8568-memory-controller";
-                       reg = <2000 1000>;
+                       reg = <0x2000 0x1000>;
                        interrupt-parent = <&mpic>;
-                       interrupts = <12 2>;
+                       interrupts = <18 2>;
                };
 
                l2-cache-controller@20000 {
                        compatible = "fsl,8568-l2-cache-controller";
-                       reg = <20000 1000>;
-                       cache-line-size = <20>; // 32 bytes
-                       cache-size = <80000>;   // L2, 512K
+                       reg = <0x20000 0x1000>;
+                       cache-line-size = <32>; // 32 bytes
+                       cache-size = <0x80000>; // L2, 512K
                        interrupt-parent = <&mpic>;
-                       interrupts = <10 2>;
+                       interrupts = <16 2>;
                };
 
                i2c@3000 {
                        #size-cells = <0>;
                        cell-index = <0>;
                        compatible = "fsl-i2c";
-                       reg = <3000 100>;
-                       interrupts = <2b 2>;
+                       reg = <0x3000 0x100>;
+                       interrupts = <43 2>;
                        interrupt-parent = <&mpic>;
                        dfsrr;
 
                        rtc@68 {
                                compatible = "dallas,ds1374";
-                               reg = <68>;
+                               reg = <0x68>;
                        };
                };
 
                        #size-cells = <0>;
                        cell-index = <1>;
                        compatible = "fsl-i2c";
-                       reg = <3100 100>;
-                       interrupts = <2b 2>;
+                       reg = <0x3100 0x100>;
+                       interrupts = <43 2>;
                        interrupt-parent = <&mpic>;
                        dfsrr;
                };
                        #address-cells = <1>;
                        #size-cells = <0>;
                        compatible = "fsl,gianfar-mdio";
-                       reg = <24520 20>;
+                       reg = <0x24520 0x20>;
 
                        phy0: ethernet-phy@7 {
                                interrupt-parent = <&mpic>;
                                interrupts = <1 1>;
-                               reg = <7>;
+                               reg = <0x7>;
                                device_type = "ethernet-phy";
                        };
                        phy1: ethernet-phy@1 {
                                interrupt-parent = <&mpic>;
                                interrupts = <2 1>;
-                               reg = <1>;
+                               reg = <0x1>;
                                device_type = "ethernet-phy";
                        };
                        phy2: ethernet-phy@2 {
                                interrupt-parent = <&mpic>;
                                interrupts = <1 1>;
-                               reg = <2>;
+                               reg = <0x2>;
                                device_type = "ethernet-phy";
                        };
                        phy3: ethernet-phy@3 {
                                interrupt-parent = <&mpic>;
                                interrupts = <2 1>;
-                               reg = <3>;
+                               reg = <0x3>;
                                device_type = "ethernet-phy";
                        };
                };
                        device_type = "network";
                        model = "eTSEC";
                        compatible = "gianfar";
-                       reg = <24000 1000>;
+                       reg = <0x24000 0x1000>;
                        local-mac-address = [ 00 00 00 00 00 00 ];
-                       interrupts = <1d 2 1e 2 22 2>;
+                       interrupts = <29 2 30 2 34 2>;
                        interrupt-parent = <&mpic>;
                        phy-handle = <&phy2>;
                };
                        device_type = "network";
                        model = "eTSEC";
                        compatible = "gianfar";
-                       reg = <25000 1000>;
+                       reg = <0x25000 0x1000>;
                        local-mac-address = [ 00 00 00 00 00 00 ];
-                       interrupts = <23 2 24 2 28 2>;
+                       interrupts = <35 2 36 2 40 2>;
                        interrupt-parent = <&mpic>;
                        phy-handle = <&phy3>;
                };
                        cell-index = <0>;
                        device_type = "serial";
                        compatible = "ns16550";
-                       reg = <4500 100>;
+                       reg = <0x4500 0x100>;
                        clock-frequency = <0>;
-                       interrupts = <2a 2>;
+                       interrupts = <42 2>;
                        interrupt-parent = <&mpic>;
                };
 
                global-utilities@e0000 {        //global utilities block
                        compatible = "fsl,mpc8548-guts";
-                       reg = <e0000 1000>;
+                       reg = <0xe0000 0x1000>;
                        fsl,has-rstcr;
                };
 
                        cell-index = <1>;
                        device_type = "serial";
                        compatible = "ns16550";
-                       reg = <4600 100>;
+                       reg = <0x4600 0x100>;
                        clock-frequency = <0>;
-                       interrupts = <2a 2>;
+                       interrupts = <42 2>;
                        interrupt-parent = <&mpic>;
                };
 
                        device_type = "crypto";
                        model = "SEC2";
                        compatible = "talitos";
-                       reg = <30000 f000>;
-                       interrupts = <2d 2>;
+                       reg = <0x30000 0xf000>;
+                       interrupts = <45 2>;
                        interrupt-parent = <&mpic>;
                        num-channels = <4>;
-                       channel-fifo-len = <18>;
-                       exec-units-mask = <000000fe>;
-                       descriptor-types-mask = <012b0ebf>;
+                       channel-fifo-len = <24>;
+                       exec-units-mask = <0xfe>;
+                       descriptor-types-mask = <0x12b0ebf>;
                };
 
                mpic: pic@40000 {
                        interrupt-controller;
                        #address-cells = <0>;
                        #interrupt-cells = <2>;
-                       reg = <40000 40000>;
+                       reg = <0x40000 0x40000>;
                        compatible = "chrp,open-pic";
                        device_type = "open-pic";
                         big-endian;
                };
 
                par_io@e0100 {
-                       reg = <e0100 100>;
+                       reg = <0xe0100 0x100>;
                        device_type = "par_io";
                        num-ports = <7>;
 
                        pio1: ucc_pin@01 {
                                pio-map = <
                        /* port  pin  dir  open_drain  assignment  has_irq */
-                                       4  0a  1  0  2  0       /* TxD0 */
-                                       4  09  1  0  2  0       /* TxD1 */
-                                       4  08  1  0  2  0       /* TxD2 */
-                                       4  07  1  0  2  0       /* TxD3 */
-                                       4  17  1  0  2  0       /* TxD4 */
-                                       4  16  1  0  2  0       /* TxD5 */
-                                       4  15  1  0  2  0       /* TxD6 */
-                                       4  14  1  0  2  0       /* TxD7 */
-                                       4  0f  2  0  2  0       /* RxD0 */
-                                       4  0e  2  0  2  0       /* RxD1 */
-                                       4  0d  2  0  2  0       /* RxD2 */
-                                       4  0c  2  0  2  0       /* RxD3 */
-                                       4  1d  2  0  2  0       /* RxD4 */
-                                       4  1c  2  0  2  0       /* RxD5 */
-                                       4  1b  2  0  2  0       /* RxD6 */
-                                       4  1a  2  0  2  0       /* RxD7 */
-                                       4  0b  1  0  2  0       /* TX_EN */
-                                       4  18  1  0  2  0       /* TX_ER */
-                                       4  10  2  0  2  0       /* RX_DV */
-                                       4  1e  2  0  2  0       /* RX_ER */
-                                       4  11  2  0  2  0       /* RX_CLK */
-                                       4  13  1  0  2  0       /* GTX_CLK */
-                                       1  1f  2  0  3  0>;     /* GTX125 */
+                                       0x4  0xa  0x1  0x0  0x2  0x0    /* TxD0 */
+                                       0x4  0x9  0x1  0x0  0x2  0x0    /* TxD1 */
+                                       0x4  0x8  0x1  0x0  0x2  0x0    /* TxD2 */
+                                       0x4  0x7  0x1  0x0  0x2  0x0    /* TxD3 */
+                                       0x4  0x17  0x1  0x0  0x2  0x0   /* TxD4 */
+                                       0x4  0x16  0x1  0x0  0x2  0x0   /* TxD5 */
+                                       0x4  0x15  0x1  0x0  0x2  0x0   /* TxD6 */
+                                       0x4  0x14  0x1  0x0  0x2  0x0   /* TxD7 */
+                                       0x4  0xf  0x2  0x0  0x2  0x0    /* RxD0 */
+                                       0x4  0xe  0x2  0x0  0x2  0x0    /* RxD1 */
+                                       0x4  0xd  0x2  0x0  0x2  0x0    /* RxD2 */
+                                       0x4  0xc  0x2  0x0  0x2  0x0    /* RxD3 */
+                                       0x4  0x1d  0x2  0x0  0x2  0x0   /* RxD4 */
+                                       0x4  0x1c  0x2  0x0  0x2  0x0   /* RxD5 */
+                                       0x4  0x1b  0x2  0x0  0x2  0x0   /* RxD6 */
+                                       0x4  0x1a  0x2  0x0  0x2  0x0   /* RxD7 */
+                                       0x4  0xb  0x1  0x0  0x2  0x0    /* TX_EN */
+                                       0x4  0x18  0x1  0x0  0x2  0x0   /* TX_ER */
+                                       0x4  0x10  0x2  0x0  0x2  0x0   /* RX_DV */
+                                       0x4  0x1e  0x2  0x0  0x2  0x0   /* RX_ER */
+                                       0x4  0x11  0x2  0x0  0x2  0x0   /* RX_CLK */
+                                       0x4  0x13  0x1  0x0  0x2  0x0   /* GTX_CLK */
+                                       0x1  0x1f  0x2  0x0  0x3  0x0>; /* GTX125 */
                        };
 
                        pio2: ucc_pin@02 {
                                pio-map = <
                        /* port  pin  dir  open_drain  assignment  has_irq */
-                                       5  0a 1  0  2  0   /* TxD0 */
-                                       5  09 1  0  2  0   /* TxD1 */
-                                       5  08 1  0  2  0   /* TxD2 */
-                                       5  07 1  0  2  0   /* TxD3 */
-                                       5  17 1  0  2  0   /* TxD4 */
-                                       5  16 1  0  2  0   /* TxD5 */
-                                       5  15 1  0  2  0   /* TxD6 */
-                                       5  14 1  0  2  0   /* TxD7 */
-                                       5  0f 2  0  2  0   /* RxD0 */
-                                       5  0e 2  0  2  0   /* RxD1 */
-                                       5  0d 2  0  2  0   /* RxD2 */
-                                       5  0c 2  0  2  0   /* RxD3 */
-                                       5  1d 2  0  2  0   /* RxD4 */
-                                       5  1c 2  0  2  0   /* RxD5 */
-                                       5  1b 2  0  2  0   /* RxD6 */
-                                       5  1a 2  0  2  0   /* RxD7 */
-                                       5  0b 1  0  2  0   /* TX_EN */
-                                       5  18 1  0  2  0   /* TX_ER */
-                                       5  10 2  0  2  0   /* RX_DV */
-                                       5  1e 2  0  2  0   /* RX_ER */
-                                       5  11 2  0  2  0   /* RX_CLK */
-                                       5  13 1  0  2  0   /* GTX_CLK */
-                                       1  1f 2  0  3  0   /* GTX125 */
-                                       4  06 3  0  2  0   /* MDIO */
-                                       4  05 1  0  2  0>; /* MDC */
+                                       0x5  0xa 0x1  0x0  0x2  0x0   /* TxD0 */
+                                       0x5  0x9 0x1  0x0  0x2  0x0   /* TxD1 */
+                                       0x5  0x8 0x1  0x0  0x2  0x0   /* TxD2 */
+                                       0x5  0x7 0x1  0x0  0x2  0x0   /* TxD3 */
+                                       0x5  0x17 0x1  0x0  0x2  0x0   /* TxD4 */
+                                       0x5  0x16 0x1  0x0  0x2  0x0   /* TxD5 */
+                                       0x5  0x15 0x1  0x0  0x2  0x0   /* TxD6 */
+                                       0x5  0x14 0x1  0x0  0x2  0x0   /* TxD7 */
+                                       0x5  0xf 0x2  0x0  0x2  0x0   /* RxD0 */
+                                       0x5  0xe 0x2  0x0  0x2  0x0   /* RxD1 */
+                                       0x5  0xd 0x2  0x0  0x2  0x0   /* RxD2 */
+                                       0x5  0xc 0x2  0x0  0x2  0x0   /* RxD3 */
+                                       0x5  0x1d 0x2  0x0  0x2  0x0   /* RxD4 */
+                                       0x5  0x1c 0x2  0x0  0x2  0x0   /* RxD5 */
+                                       0x5  0x1b 0x2  0x0  0x2  0x0   /* RxD6 */
+                                       0x5  0x1a 0x2  0x0  0x2  0x0   /* RxD7 */
+                                       0x5  0xb 0x1  0x0  0x2  0x0   /* TX_EN */
+                                       0x5  0x18 0x1  0x0  0x2  0x0   /* TX_ER */
+                                       0x5  0x10 0x2  0x0  0x2  0x0   /* RX_DV */
+                                       0x5  0x1e 0x2  0x0  0x2  0x0   /* RX_ER */
+                                       0x5  0x11 0x2  0x0  0x2  0x0   /* RX_CLK */
+                                       0x5  0x13 0x1  0x0  0x2  0x0   /* GTX_CLK */
+                                       0x1  0x1f 0x2  0x0  0x3  0x0   /* GTX125 */
+                                       0x4  0x6 0x3  0x0  0x2  0x0   /* MDIO */
+                                       0x4  0x5 0x1  0x0  0x2  0x0>; /* MDC */
                        };
                };
        };
                #size-cells = <1>;
                device_type = "qe";
                compatible = "fsl,qe";
-               ranges = <0 e0080000 00040000>;
-               reg = <e0080000 480>;
+               ranges = <0x0 0xe0080000 0x40000>;
+               reg = <0xe0080000 0x480>;
                brg-frequency = <0>;
-               bus-frequency = <179A7B00>;
+               bus-frequency = <396000000>;
 
                muram@10000 {
                        #address-cells = <1>;
                        #size-cells = <1>;
                        compatible = "fsl,qe-muram", "fsl,cpm-muram";
-                       ranges = <0 00010000 0000c000>;
+                       ranges = <0x0 0x10000 0x10000>;
 
                        data-only@0 {
                                compatible = "fsl,qe-muram-data",
                                             "fsl,cpm-muram-data";
-                               reg = <0 c000>;
+                               reg = <0x0 0x10000>;
                        };
                };
 
                spi@4c0 {
                        cell-index = <0>;
                        compatible = "fsl,spi";
-                       reg = <4c0 40>;
+                       reg = <0x4c0 0x40>;
                        interrupts = <2>;
                        interrupt-parent = <&qeic>;
                        mode = "cpu";
                spi@500 {
                        cell-index = <1>;
                        compatible = "fsl,spi";
-                       reg = <500 40>;
+                       reg = <0x500 0x40>;
                        interrupts = <1>;
                        interrupt-parent = <&qeic>;
                        mode = "cpu";
                enet2: ucc@2000 {
                        device_type = "network";
                        compatible = "ucc_geth";
-                       model = "UCC";
                        cell-index = <1>;
-                       device-id = <1>;
-                       reg = <2000 200>;
-                       interrupts = <20>;
+                       reg = <0x2000 0x200>;
+                       interrupts = <32>;
                        interrupt-parent = <&qeic>;
                        local-mac-address = [ 00 00 00 00 00 00 ];
                        rx-clock-name = "none";
                enet3: ucc@3000 {
                        device_type = "network";
                        compatible = "ucc_geth";
-                       model = "UCC";
                        cell-index = <2>;
-                       device-id = <2>;
-                       reg = <3000 200>;
-                       interrupts = <21>;
+                       reg = <0x3000 0x200>;
+                       interrupts = <33>;
                        interrupt-parent = <&qeic>;
                        local-mac-address = [ 00 00 00 00 00 00 ];
                        rx-clock-name = "none";
                mdio@2120 {
                        #address-cells = <1>;
                        #size-cells = <0>;
-                       reg = <2120 18>;
+                       reg = <0x2120 0x18>;
                        compatible = "fsl,ucc-mdio";
 
                        /* These are the same PHYs as on
                        qe_phy0: ethernet-phy@07 {
                                interrupt-parent = <&mpic>;
                                interrupts = <1 1>;
-                               reg = <7>;
+                               reg = <0x7>;
                                device_type = "ethernet-phy";
                        };
                        qe_phy1: ethernet-phy@01 {
                                interrupt-parent = <&mpic>;
                                interrupts = <2 1>;
-                               reg = <1>;
+                               reg = <0x1>;
                                device_type = "ethernet-phy";
                        };
                        qe_phy2: ethernet-phy@02 {
                                interrupt-parent = <&mpic>;
                                interrupts = <1 1>;
-                               reg = <2>;
+                               reg = <0x2>;
                                device_type = "ethernet-phy";
                        };
                        qe_phy3: ethernet-phy@03 {
                                interrupt-parent = <&mpic>;
                                interrupts = <2 1>;
-                               reg = <3>;
+                               reg = <0x3>;
                                device_type = "ethernet-phy";
                        };
                };
                        compatible = "fsl,qe-ic";
                        #address-cells = <0>;
                        #interrupt-cells = <1>;
-                       reg = <80 80>;
+                       reg = <0x80 0x80>;
                        big-endian;
-                       interrupts = <2e 2 2e 2>; //high:30 low:30
+                       interrupts = <46 2 46 2>; //high:30 low:30
                        interrupt-parent = <&mpic>;
                };
 
 
        pci0: pci@e0008000 {
                cell-index = <0>;
-               interrupt-map-mask = <f800 0 0 7>;
+               interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
                interrupt-map = <
                        /* IDSEL 0x12 AD18 */
-                       9000 0 0 1 &mpic 5 1
-                       9000 0 0 2 &mpic 6 1
-                       9000 0 0 3 &mpic 7 1
-                       9000 0 0 4 &mpic 4 1
+                       0x9000 0x0 0x0 0x1 &mpic 0x5 0x1
+                       0x9000 0x0 0x0 0x2 &mpic 0x6 0x1
+                       0x9000 0x0 0x0 0x3 &mpic 0x7 0x1
+                       0x9000 0x0 0x0 0x4 &mpic 0x4 0x1
 
                        /* IDSEL 0x13 AD19 */
-                       9800 0 0 1 &mpic 6 1
-                       9800 0 0 2 &mpic 7 1
-                       9800 0 0 3 &mpic 4 1
-                       9800 0 0 4 &mpic 5 1>;
+                       0x9800 0x0 0x0 0x1 &mpic 0x6 0x1
+                       0x9800 0x0 0x0 0x2 &mpic 0x7 0x1
+                       0x9800 0x0 0x0 0x3 &mpic 0x4 0x1
+                       0x9800 0x0 0x0 0x4 &mpic 0x5 0x1>;
 
                interrupt-parent = <&mpic>;
-               interrupts = <18 2>;
-               bus-range = <0 ff>;
-               ranges = <02000000 0 80000000 80000000 0 20000000
-                         01000000 0 00000000 e2000000 0 00800000>;
-               clock-frequency = <3f940aa>;
+               interrupts = <24 2>;
+               bus-range = <0 255>;
+               ranges = <0x2000000 0x0 0x80000000 0x80000000 0x0 0x20000000
+                         0x1000000 0x0 0x0 0xe2000000 0x0 0x800000>;
+               clock-frequency = <66666666>;
                #interrupt-cells = <1>;
                #size-cells = <2>;
                #address-cells = <3>;
-               reg = <e0008000 1000>;
+               reg = <0xe0008000 0x1000>;
                compatible = "fsl,mpc8540-pci";
                device_type = "pci";
        };
        /* PCI Express */
        pci1: pcie@e000a000 {
                cell-index = <2>;
-               interrupt-map-mask = <f800 0 0 7>;
+               interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
                interrupt-map = <
 
                        /* IDSEL 0x0 (PEX) */
-                       00000 0 0 1 &mpic 0 1
-                       00000 0 0 2 &mpic 1 1
-                       00000 0 0 3 &mpic 2 1
-                       00000 0 0 4 &mpic 3 1>;
+                       00000 0x0 0x0 0x1 &mpic 0x0 0x1
+                       00000 0x0 0x0 0x2 &mpic 0x1 0x1
+                       00000 0x0 0x0 0x3 &mpic 0x2 0x1
+                       00000 0x0 0x0 0x4 &mpic 0x3 0x1>;
 
                interrupt-parent = <&mpic>;
-               interrupts = <1a 2>;
-               bus-range = <0 ff>;
-               ranges = <02000000 0 a0000000 a0000000 0 10000000
-                         01000000 0 00000000 e2800000 0 00800000>;
-               clock-frequency = <1fca055>;
+               interrupts = <26 2>;
+               bus-range = <0 255>;
+               ranges = <0x2000000 0x0 0xa0000000 0xa0000000 0x0 0x10000000
+                         0x1000000 0x0 0x0 0xe2800000 0x0 0x800000>;
+               clock-frequency = <33333333>;
                #interrupt-cells = <1>;
                #size-cells = <2>;
                #address-cells = <3>;
-               reg = <e000a000 1000>;
+               reg = <0xe000a000 0x1000>;
                compatible = "fsl,mpc8548-pcie";
                device_type = "pci";
                pcie@0 {
-                       reg = <0 0 0 0 0>;
+                       reg = <0x0 0x0 0x0 0x0 0x0>;
                        #size-cells = <2>;
                        #address-cells = <3>;
                        device_type = "pci";
-                       ranges = <02000000 0 a0000000
-                                 02000000 0 a0000000
-                                 0 10000000
+                       ranges = <0x2000000 0x0 0xa0000000
+                                 0x2000000 0x0 0xa0000000
+                                 0x0 0x10000000
 
-                                 01000000 0 00000000
-                                 01000000 0 00000000
-                                 0 00800000>;
+                                 0x1000000 0x0 0x0
+                                 0x1000000 0x0 0x0
+                                 0x0 0x800000>;
                };
        };
 };
index db37214aee37a0851bbacffe70f64e565608c3f9..66f27ab613a28eb89f893c98283af7aef9ad2c25 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * MPC8572 DS Device Tree Source
  *
- * Copyright 2007 Freescale Semiconductor Inc.
+ * Copyright 2007, 2008 Freescale Semiconductor Inc.
  *
  * This program is free software; you can redistribute  it and/or modify it
  * under  the terms of  the GNU General  Public License as published by the
@@ -9,6 +9,7 @@
  * option) any later version.
  */
 
+/dts-v1/;
 / {
        model = "fsl,MPC8572DS";
        compatible = "fsl,MPC8572DS";
 
                PowerPC,8572@0 {
                        device_type = "cpu";
-                       reg = <0>;
-                       d-cache-line-size = <20>;       // 32 bytes
-                       i-cache-line-size = <20>;       // 32 bytes
-                       d-cache-size = <8000>;          // L1, 32K
-                       i-cache-size = <8000>;          // L1, 32K
+                       reg = <0x0>;
+                       d-cache-line-size = <32>;       // 32 bytes
+                       i-cache-line-size = <32>;       // 32 bytes
+                       d-cache-size = <0x8000>;                // L1, 32K
+                       i-cache-size = <0x8000>;                // L1, 32K
                        timebase-frequency = <0>;
                        bus-frequency = <0>;
                        clock-frequency = <0>;
 
                PowerPC,8572@1 {
                        device_type = "cpu";
-                       reg = <1>;
-                       d-cache-line-size = <20>;       // 32 bytes
-                       i-cache-line-size = <20>;       // 32 bytes
-                       d-cache-size = <8000>;          // L1, 32K
-                       i-cache-size = <8000>;          // L1, 32K
+                       reg = <0x1>;
+                       d-cache-line-size = <32>;       // 32 bytes
+                       i-cache-line-size = <32>;       // 32 bytes
+                       d-cache-size = <0x8000>;                // L1, 32K
+                       i-cache-size = <0x8000>;                // L1, 32K
                        timebase-frequency = <0>;
                        bus-frequency = <0>;
                        clock-frequency = <0>;
 
        memory {
                device_type = "memory";
-               reg = <00000000 00000000>;      // Filled by U-Boot
+               reg = <0x0 0x0>;        // Filled by U-Boot
        };
 
        soc8572@ffe00000 {
                #address-cells = <1>;
                #size-cells = <1>;
                device_type = "soc";
-               ranges = <00000000 ffe00000 00100000>;
-               reg = <ffe00000 00001000>;      // CCSRBAR & soc regs, remove once parse code for immrbase fixed
+               ranges = <0x0 0xffe00000 0x100000>;
+               reg = <0xffe00000 0x1000>;      // CCSRBAR & soc regs, remove once parse code for immrbase fixed
                bus-frequency = <0>;            // Filled out by uboot.
 
                memory-controller@2000 {
                        compatible = "fsl,mpc8572-memory-controller";
-                       reg = <2000 1000>;
+                       reg = <0x2000 0x1000>;
                        interrupt-parent = <&mpic>;
-                       interrupts = <12 2>;
+                       interrupts = <18 2>;
                };
 
                memory-controller@6000 {
                        compatible = "fsl,mpc8572-memory-controller";
-                       reg = <6000 1000>;
+                       reg = <0x6000 0x1000>;
                        interrupt-parent = <&mpic>;
-                       interrupts = <12 2>;
+                       interrupts = <18 2>;
                };
 
                l2-cache-controller@20000 {
                        compatible = "fsl,mpc8572-l2-cache-controller";
-                       reg = <20000 1000>;
-                       cache-line-size = <20>; // 32 bytes
-                       cache-size = <80000>;   // L2, 512K
+                       reg = <0x20000 0x1000>;
+                       cache-line-size = <32>; // 32 bytes
+                       cache-size = <0x80000>; // L2, 512K
                        interrupt-parent = <&mpic>;
-                       interrupts = <10 2>;
+                       interrupts = <16 2>;
                };
 
                i2c@3000 {
@@ -97,8 +98,8 @@
                        #size-cells = <0>;
                        cell-index = <0>;
                        compatible = "fsl-i2c";
-                       reg = <3000 100>;
-                       interrupts = <2b 2>;
+                       reg = <0x3000 0x100>;
+                       interrupts = <43 2>;
                        interrupt-parent = <&mpic>;
                        dfsrr;
                };
                        #size-cells = <0>;
                        cell-index = <1>;
                        compatible = "fsl-i2c";
-                       reg = <3100 100>;
-                       interrupts = <2b 2>;
+                       reg = <0x3100 0x100>;
+                       interrupts = <43 2>;
                        interrupt-parent = <&mpic>;
                        dfsrr;
                };
                        #address-cells = <1>;
                        #size-cells = <0>;
                        compatible = "fsl,gianfar-mdio";
-                       reg = <24520 20>;
+                       reg = <0x24520 0x20>;
 
                        phy0: ethernet-phy@0 {
                                interrupt-parent = <&mpic>;
-                               interrupts = <a 1>;
-                               reg = <0>;
+                               interrupts = <10 1>;
+                               reg = <0x0>;
                        };
                        phy1: ethernet-phy@1 {
                                interrupt-parent = <&mpic>;
-                               interrupts = <a 1>;
-                               reg = <1>;
+                               interrupts = <10 1>;
+                               reg = <0x1>;
                        };
                        phy2: ethernet-phy@2 {
                                interrupt-parent = <&mpic>;
-                               interrupts = <a 1>;
-                               reg = <2>;
+                               interrupts = <10 1>;
+                               reg = <0x2>;
                        };
                        phy3: ethernet-phy@3 {
                                interrupt-parent = <&mpic>;
-                               interrupts = <a 1>;
-                               reg = <3>;
+                               interrupts = <10 1>;
+                               reg = <0x3>;
                        };
                };
 
                        device_type = "network";
                        model = "eTSEC";
                        compatible = "gianfar";
-                       reg = <24000 1000>;
+                       reg = <0x24000 0x1000>;
                        local-mac-address = [ 00 00 00 00 00 00 ];
-                       interrupts = <1d 2 1e 2 22 2>;
+                       interrupts = <29 2 30 2 34 2>;
                        interrupt-parent = <&mpic>;
                        phy-handle = <&phy0>;
                        phy-connection-type = "rgmii-id";
                        device_type = "network";
                        model = "eTSEC";
                        compatible = "gianfar";
-                       reg = <25000 1000>;
+                       reg = <0x25000 0x1000>;
                        local-mac-address = [ 00 00 00 00 00 00 ];
-                       interrupts = <23 2 24 2 28 2>;
+                       interrupts = <35 2 36 2 40 2>;
                        interrupt-parent = <&mpic>;
                        phy-handle = <&phy1>;
                        phy-connection-type = "rgmii-id";
                        device_type = "network";
                        model = "eTSEC";
                        compatible = "gianfar";
-                       reg = <26000 1000>;
+                       reg = <0x26000 0x1000>;
                        local-mac-address = [ 00 00 00 00 00 00 ];
-                       interrupts = <1f 2 20 2 21 2>;
+                       interrupts = <31 2 32 2 33 2>;
                        interrupt-parent = <&mpic>;
                        phy-handle = <&phy2>;
                        phy-connection-type = "rgmii-id";
                        device_type = "network";
                        model = "eTSEC";
                        compatible = "gianfar";
-                       reg = <27000 1000>;
+                       reg = <0x27000 0x1000>;
                        local-mac-address = [ 00 00 00 00 00 00 ];
-                       interrupts = <25 2 26 2 27 2>;
+                       interrupts = <37 2 38 2 39 2>;
                        interrupt-parent = <&mpic>;
                        phy-handle = <&phy3>;
                        phy-connection-type = "rgmii-id";
                        cell-index = <0>;
                        device_type = "serial";
                        compatible = "ns16550";
-                       reg = <4500 100>;
+                       reg = <0x4500 0x100>;
                        clock-frequency = <0>;
-                       interrupts = <2a 2>;
+                       interrupts = <42 2>;
                        interrupt-parent = <&mpic>;
                };
 
                        cell-index = <1>;
                        device_type = "serial";
                        compatible = "ns16550";
-                       reg = <4600 100>;
+                       reg = <0x4600 0x100>;
                        clock-frequency = <0>;
-                       interrupts = <2a 2>;
+                       interrupts = <42 2>;
                        interrupt-parent = <&mpic>;
                };
 
                global-utilities@e0000 {        //global utilities block
                        compatible = "fsl,mpc8572-guts";
-                       reg = <e0000 1000>;
+                       reg = <0xe0000 0x1000>;
                        fsl,has-rstcr;
                };
 
                        interrupt-controller;
                        #address-cells = <0>;
                        #interrupt-cells = <2>;
-                       reg = <40000 40000>;
+                       reg = <0x40000 0x40000>;
                        compatible = "chrp,open-pic";
                        device_type = "open-pic";
                        big-endian;
                #interrupt-cells = <1>;
                #size-cells = <2>;
                #address-cells = <3>;
-               reg = <ffe08000 1000>;
-               bus-range = <0 ff>;
-               ranges = <02000000 0 80000000 80000000 0 20000000
-                         01000000 0 00000000 ffc00000 0 00010000>;
-               clock-frequency = <1fca055>;
+               reg = <0xffe08000 0x1000>;
+               bus-range = <0 255>;
+               ranges = <0x2000000 0x0 0x80000000 0x80000000 0x0 0x20000000
+                         0x1000000 0x0 0x0 0xffc00000 0x0 0x10000>;
+               clock-frequency = <33333333>;
                interrupt-parent = <&mpic>;
-               interrupts = <18 2>;
-               interrupt-map-mask = <ff00 0 0 7>;
+               interrupts = <24 2>;
+               interrupt-map-mask = <0xff00 0x0 0x0 0x7>;
                interrupt-map = <
                        /* IDSEL 0x11 func 0 - PCI slot 1 */
-                       8800 0 0 1 &mpic 2 1
-                       8800 0 0 2 &mpic 3 1
-                       8800 0 0 3 &mpic 4 1
-                       8800 0 0 4 &mpic 1 1
+                       0x8800 0x0 0x0 0x1 &mpic 0x2 0x1
+                       0x8800 0x0 0x0 0x2 &mpic 0x3 0x1
+                       0x8800 0x0 0x0 0x3 &mpic 0x4 0x1
+                       0x8800 0x0 0x0 0x4 &mpic 0x1 0x1
 
                        /* IDSEL 0x11 func 1 - PCI slot 1 */
-                       8900 0 0 1 &mpic 2 1
-                       8900 0 0 2 &mpic 3 1
-                       8900 0 0 3 &mpic 4 1
-                       8900 0 0 4 &mpic 1 1
+                       0x8900 0x0 0x0 0x1 &mpic 0x2 0x1
+                       0x8900 0x0 0x0 0x2 &mpic 0x3 0x1
+                       0x8900 0x0 0x0 0x3 &mpic 0x4 0x1
+                       0x8900 0x0 0x0 0x4 &mpic 0x1 0x1
 
                        /* IDSEL 0x11 func 2 - PCI slot 1 */
-                       8a00 0 0 1 &mpic 2 1
-                       8a00 0 0 2 &mpic 3 1
-                       8a00 0 0 3 &mpic 4 1
-                       8a00 0 0 4 &mpic 1 1
+                       0x8a00 0x0 0x0 0x1 &mpic 0x2 0x1
+                       0x8a00 0x0 0x0 0x2 &mpic 0x3 0x1
+                       0x8a00 0x0 0x0 0x3 &mpic 0x4 0x1
+                       0x8a00 0x0 0x0 0x4 &mpic 0x1 0x1
 
                        /* IDSEL 0x11 func 3 - PCI slot 1 */
-                       8b00 0 0 1 &mpic 2 1
-                       8b00 0 0 2 &mpic 3 1
-                       8b00 0 0 3 &mpic 4 1
-                       8b00 0 0 4 &mpic 1 1
+                       0x8b00 0x0 0x0 0x1 &mpic 0x2 0x1
+                       0x8b00 0x0 0x0 0x2 &mpic 0x3 0x1
+                       0x8b00 0x0 0x0 0x3 &mpic 0x4 0x1
+                       0x8b00 0x0 0x0 0x4 &mpic 0x1 0x1
 
                        /* IDSEL 0x11 func 4 - PCI slot 1 */
-                       8c00 0 0 1 &mpic 2 1
-                       8c00 0 0 2 &mpic 3 1
-                       8c00 0 0 3 &mpic 4 1
-                       8c00 0 0 4 &mpic 1 1
+                       0x8c00 0x0 0x0 0x1 &mpic 0x2 0x1
+                       0x8c00 0x0 0x0 0x2 &mpic 0x3 0x1
+                       0x8c00 0x0 0x0 0x3 &mpic 0x4 0x1
+                       0x8c00 0x0 0x0 0x4 &mpic 0x1 0x1
 
                        /* IDSEL 0x11 func 5 - PCI slot 1 */
-                       8d00 0 0 1 &mpic 2 1
-                       8d00 0 0 2 &mpic 3 1
-                       8d00 0 0 3 &mpic 4 1
-                       8d00 0 0 4 &mpic 1 1
+                       0x8d00 0x0 0x0 0x1 &mpic 0x2 0x1
+                       0x8d00 0x0 0x0 0x2 &mpic 0x3 0x1
+                       0x8d00 0x0 0x0 0x3 &mpic 0x4 0x1
+                       0x8d00 0x0 0x0 0x4 &mpic 0x1 0x1
 
                        /* IDSEL 0x11 func 6 - PCI slot 1 */
-                       8e00 0 0 1 &mpic 2 1
-                       8e00 0 0 2 &mpic 3 1
-                       8e00 0 0 3 &mpic 4 1
-                       8e00 0 0 4 &mpic 1 1
+                       0x8e00 0x0 0x0 0x1 &mpic 0x2 0x1
+                       0x8e00 0x0 0x0 0x2 &mpic 0x3 0x1
+                       0x8e00 0x0 0x0 0x3 &mpic 0x4 0x1
+                       0x8e00 0x0 0x0 0x4 &mpic 0x1 0x1
 
                        /* IDSEL 0x11 func 7 - PCI slot 1 */
-                       8f00 0 0 1 &mpic 2 1
-                       8f00 0 0 2 &mpic 3 1
-                       8f00 0 0 3 &mpic 4 1
-                       8f00 0 0 4 &mpic 1 1
+                       0x8f00 0x0 0x0 0x1 &mpic 0x2 0x1
+                       0x8f00 0x0 0x0 0x2 &mpic 0x3 0x1
+                       0x8f00 0x0 0x0 0x3 &mpic 0x4 0x1
+                       0x8f00 0x0 0x0 0x4 &mpic 0x1 0x1
 
                        /* IDSEL 0x12 func 0 - PCI slot 2 */
-                       9000 0 0 1 &mpic 3 1
-                       9000 0 0 2 &mpic 4 1
-                       9000 0 0 3 &mpic 1 1
-                       9000 0 0 4 &mpic 2 1
+                       0x9000 0x0 0x0 0x1 &mpic 0x3 0x1
+                       0x9000 0x0 0x0 0x2 &mpic 0x4 0x1
+                       0x9000 0x0 0x0 0x3 &mpic 0x1 0x1
+                       0x9000 0x0 0x0 0x4 &mpic 0x2 0x1
 
                        /* IDSEL 0x12 func 1 - PCI slot 2 */
-                       9100 0 0 1 &mpic 3 1
-                       9100 0 0 2 &mpic 4 1
-                       9100 0 0 3 &mpic 1 1
-                       9100 0 0 4 &mpic 2 1
+                       0x9100 0x0 0x0 0x1 &mpic 0x3 0x1
+                       0x9100 0x0 0x0 0x2 &mpic 0x4 0x1
+                       0x9100 0x0 0x0 0x3 &mpic 0x1 0x1
+                       0x9100 0x0 0x0 0x4 &mpic 0x2 0x1
 
                        /* IDSEL 0x12 func 2 - PCI slot 2 */
-                       9200 0 0 1 &mpic 3 1
-                       9200 0 0 2 &mpic 4 1
-                       9200 0 0 3 &mpic 1 1
-                       9200 0 0 4 &mpic 2 1
+                       0x9200 0x0 0x0 0x1 &mpic 0x3 0x1
+                       0x9200 0x0 0x0 0x2 &mpic 0x4 0x1
+                       0x9200 0x0 0x0 0x3 &mpic 0x1 0x1
+                       0x9200 0x0 0x0 0x4 &mpic 0x2 0x1
 
                        /* IDSEL 0x12 func 3 - PCI slot 2 */
-                       9300 0 0 1 &mpic 3 1
-                       9300 0 0 2 &mpic 4 1
-                       9300 0 0 3 &mpic 1 1
-                       9300 0 0 4 &mpic 2 1
+                       0x9300 0x0 0x0 0x1 &mpic 0x3 0x1
+                       0x9300 0x0 0x0 0x2 &mpic 0x4 0x1
+                       0x9300 0x0 0x0 0x3 &mpic 0x1 0x1
+                       0x9300 0x0 0x0 0x4 &mpic 0x2 0x1
 
                        /* IDSEL 0x12 func 4 - PCI slot 2 */
-                       9400 0 0 1 &mpic 3 1
-                       9400 0 0 2 &mpic 4 1
-                       9400 0 0 3 &mpic 1 1
-                       9400 0 0 4 &mpic 2 1
+                       0x9400 0x0 0x0 0x1 &mpic 0x3 0x1
+                       0x9400 0x0 0x0 0x2 &mpic 0x4 0x1
+                       0x9400 0x0 0x0 0x3 &mpic 0x1 0x1
+                       0x9400 0x0 0x0 0x4 &mpic 0x2 0x1
 
                        /* IDSEL 0x12 func 5 - PCI slot 2 */
-                       9500 0 0 1 &mpic 3 1
-                       9500 0 0 2 &mpic 4 1
-                       9500 0 0 3 &mpic 1 1
-                       9500 0 0 4 &mpic 2 1
+                       0x9500 0x0 0x0 0x1 &mpic 0x3 0x1
+                       0x9500 0x0 0x0 0x2 &mpic 0x4 0x1
+                       0x9500 0x0 0x0 0x3 &mpic 0x1 0x1
+                       0x9500 0x0 0x0 0x4 &mpic 0x2 0x1
 
                        /* IDSEL 0x12 func 6 - PCI slot 2 */
-                       9600 0 0 1 &mpic 3 1
-                       9600 0 0 2 &mpic 4 1
-                       9600 0 0 3 &mpic 1 1
-                       9600 0 0 4 &mpic 2 1
+                       0x9600 0x0 0x0 0x1 &mpic 0x3 0x1
+                       0x9600 0x0 0x0 0x2 &mpic 0x4 0x1
+                       0x9600 0x0 0x0 0x3 &mpic 0x1 0x1
+                       0x9600 0x0 0x0 0x4 &mpic 0x2 0x1
 
                        /* IDSEL 0x12 func 7 - PCI slot 2 */
-                       9700 0 0 1 &mpic 3 1
-                       9700 0 0 2 &mpic 4 1
-                       9700 0 0 3 &mpic 1 1
-                       9700 0 0 4 &mpic 2 1
+                       0x9700 0x0 0x0 0x1 &mpic 0x3 0x1
+                       0x9700 0x0 0x0 0x2 &mpic 0x4 0x1
+                       0x9700 0x0 0x0 0x3 &mpic 0x1 0x1
+                       0x9700 0x0 0x0 0x4 &mpic 0x2 0x1
 
                        // IDSEL 0x1c  USB
-                       e000 0 0 1 &i8259 c 2
-                       e100 0 0 2 &i8259 9 2
-                       e200 0 0 3 &i8259 a 2
-                       e300 0 0 4 &i8259 b 2
+                       0xe000 0x0 0x0 0x1 &i8259 0xc 0x2
+                       0xe100 0x0 0x0 0x2 &i8259 0x9 0x2
+                       0xe200 0x0 0x0 0x3 &i8259 0xa 0x2
+                       0xe300 0x0 0x0 0x4 &i8259 0xb 0x2
 
                        // IDSEL 0x1d  Audio
-                       e800 0 0 1 &i8259 6 2
+                       0xe800 0x0 0x0 0x1 &i8259 0x6 0x2
 
                        // IDSEL 0x1e Legacy
-                       f000 0 0 1 &i8259 7 2
-                       f100 0 0 1 &i8259 7 2
+                       0xf000 0x0 0x0 0x1 &i8259 0x7 0x2
+                       0xf100 0x0 0x0 0x1 &i8259 0x7 0x2
 
                        // IDSEL 0x1f IDE/SATA
-                       f800 0 0 1 &i8259 e 2
-                       f900 0 0 1 &i8259 5 2
+                       0xf800 0x0 0x0 0x1 &i8259 0xe 0x2
+                       0xf900 0x0 0x0 0x1 &i8259 0x5 0x2
 
                        >;
 
                pcie@0 {
-                       reg = <0 0 0 0 0>;
+                       reg = <0x0 0x0 0x0 0x0 0x0>;
                        #size-cells = <2>;
                        #address-cells = <3>;
                        device_type = "pci";
-                       ranges = <02000000 0 80000000
-                                 02000000 0 80000000
-                                 0 20000000
+                       ranges = <0x2000000 0x0 0x80000000
+                                 0x2000000 0x0 0x80000000
+                                 0x0 0x20000000
 
-                                 01000000 0 00000000
-                                 01000000 0 00000000
-                                 0 00100000>;
+                                 0x1000000 0x0 0x0
+                                 0x1000000 0x0 0x0
+                                 0x0 0x100000>;
                        uli1575@0 {
-                               reg = <0 0 0 0 0>;
+                               reg = <0x0 0x0 0x0 0x0 0x0>;
                                #size-cells = <2>;
                                #address-cells = <3>;
-                               ranges = <02000000 0 80000000
-                                         02000000 0 80000000
-                                         0 20000000
+                               ranges = <0x2000000 0x0 0x80000000
+                                         0x2000000 0x0 0x80000000
+                                         0x0 0x20000000
 
-                                         01000000 0 00000000
-                                         01000000 0 00000000
-                                         0 00100000>;
+                                         0x1000000 0x0 0x0
+                                         0x1000000 0x0 0x0
+                                         0x0 0x100000>;
                                isa@1e {
                                        device_type = "isa";
                                        #interrupt-cells = <2>;
                                        #size-cells = <1>;
                                        #address-cells = <2>;
-                                       reg = <f000 0 0 0 0>;
-                                       ranges = <1 0 01000000 0 0
-                                                 00001000>;
+                                       reg = <0xf000 0x0 0x0 0x0 0x0>;
+                                       ranges = <0x1 0x0 0x1000000 0x0 0x0
+                                                 0x1000>;
                                        interrupt-parent = <&i8259>;
 
                                        i8259: interrupt-controller@20 {
-                                               reg = <1 20 2
-                                                      1 a0 2
-                                                      1 4d0 2>;
+                                               reg = <0x1 0x20 0x2
+                                                      0x1 0xa0 0x2
+                                                      0x1 0x4d0 0x2>;
                                                interrupt-controller;
                                                device_type = "interrupt-controller";
                                                #address-cells = <0>;
                                        i8042@60 {
                                                #size-cells = <0>;
                                                #address-cells = <1>;
-                                               reg = <1 60 1 1 64 1>;
-                                               interrupts = <1 3 c 3>;
+                                               reg = <0x1 0x60 0x1 0x1 0x64 0x1>;
+                                               interrupts = <1 3 12 3>;
                                                interrupt-parent =
                                                        <&i8259>;
 
                                                keyboard@0 {
-                                                       reg = <0>;
+                                                       reg = <0x0>;
                                                        compatible = "pnpPNP,303";
                                                };
 
                                                mouse@1 {
-                                                       reg = <1>;
+                                                       reg = <0x1>;
                                                        compatible = "pnpPNP,f03";
                                                };
                                        };
 
                                        rtc@70 {
                                                compatible = "pnpPNP,b00";
-                                               reg = <1 70 2>;
+                                               reg = <0x1 0x70 0x2>;
                                        };
 
                                        gpio@400 {
-                                               reg = <1 400 80>;
+                                               reg = <0x1 0x400 0x80>;
                                        };
                                };
                        };
                #interrupt-cells = <1>;
                #size-cells = <2>;
                #address-cells = <3>;
-               reg = <ffe09000 1000>;
-               bus-range = <0 ff>;
-               ranges = <02000000 0 a0000000 a0000000 0 20000000
-                         01000000 0 00000000 ffc10000 0 00010000>;
-               clock-frequency = <1fca055>;
+               reg = <0xffe09000 0x1000>;
+               bus-range = <0 255>;
+               ranges = <0x2000000 0x0 0xa0000000 0xa0000000 0x0 0x20000000
+                         0x1000000 0x0 0x0 0xffc10000 0x0 0x10000>;
+               clock-frequency = <33333333>;
                interrupt-parent = <&mpic>;
-               interrupts = <1a 2>;
-               interrupt-map-mask = <f800 0 0 7>;
+               interrupts = <26 2>;
+               interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
                interrupt-map = <
                        /* IDSEL 0x0 */
-                       0000 0 0 1 &mpic 4 1
-                       0000 0 0 2 &mpic 5 1
-                       0000 0 0 3 &mpic 6 1
-                       0000 0 0 4 &mpic 7 1
+                       0000 0x0 0x0 0x1 &mpic 0x4 0x1
+                       0000 0x0 0x0 0x2 &mpic 0x5 0x1
+                       0000 0x0 0x0 0x3 &mpic 0x6 0x1
+                       0000 0x0 0x0 0x4 &mpic 0x7 0x1
                        >;
                pcie@0 {
-                       reg = <0 0 0 0 0>;
+                       reg = <0x0 0x0 0x0 0x0 0x0>;
                        #size-cells = <2>;
                        #address-cells = <3>;
                        device_type = "pci";
-                       ranges = <02000000 0 a0000000
-                                 02000000 0 a0000000
-                                 0 20000000
+                       ranges = <0x2000000 0x0 0xa0000000
+                                 0x2000000 0x0 0xa0000000
+                                 0x0 0x20000000
 
-                                 01000000 0 00000000
-                                 01000000 0 00000000
-                                 0 00100000>;
+                                 0x1000000 0x0 0x0
+                                 0x1000000 0x0 0x0
+                                 0x0 0x100000>;
                };
        };
 
                #interrupt-cells = <1>;
                #size-cells = <2>;
                #address-cells = <3>;
-               reg = <ffe0a000 1000>;
-               bus-range = <0 ff>;
-               ranges = <02000000 0 c0000000 c0000000 0 20000000
-                         01000000 0 00000000 ffc20000 0 00010000>;
-               clock-frequency = <1fca055>;
+               reg = <0xffe0a000 0x1000>;
+               bus-range = <0 255>;
+               ranges = <0x2000000 0x0 0xc0000000 0xc0000000 0x0 0x20000000
+                         0x1000000 0x0 0x0 0xffc20000 0x0 0x10000>;
+               clock-frequency = <33333333>;
                interrupt-parent = <&mpic>;
-               interrupts = <1b 2>;
-               interrupt-map-mask = <f800 0 0 7>;
+               interrupts = <27 2>;
+               interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
                interrupt-map = <
                        /* IDSEL 0x0 */
-                       0000 0 0 1 &mpic 0 1
-                       0000 0 0 2 &mpic 1 1
-                       0000 0 0 3 &mpic 2 1
-                       0000 0 0 4 &mpic 3 1
+                       0000 0x0 0x0 0x1 &mpic 0x0 0x1
+                       0000 0x0 0x0 0x2 &mpic 0x1 0x1
+                       0000 0x0 0x0 0x3 &mpic 0x2 0x1
+                       0000 0x0 0x0 0x4 &mpic 0x3 0x1
                        >;
                pcie@0 {
-                       reg = <0 0 0 0 0>;
+                       reg = <0x0 0x0 0x0 0x0 0x0>;
                        #size-cells = <2>;
                        #address-cells = <3>;
                        device_type = "pci";
-                       ranges = <02000000 0 c0000000
-                                 02000000 0 c0000000
-                                 0 20000000
+                       ranges = <0x2000000 0x0 0xc0000000
+                                 0x2000000 0x0 0xc0000000
+                                 0x0 0x20000000
 
-                                 01000000 0 00000000
-                                 01000000 0 00000000
-                                 0 00100000>;
+                                 0x1000000 0x0 0x0
+                                 0x1000000 0x0 0x0
+                                 0x0 0x100000>;
                };
        };
 };
index 79385bcd5c5fc3b9fa2b77faba94e580c102a6ff..7f9b999843ce2e25a81c1c038c2a6ed05c3842e7 100644 (file)
@@ -13,7 +13,7 @@
 
 / {
        model = "MPC8641HPCN";
-       compatible = "mpc86xx";
+       compatible = "fsl,mpc8641hpcn";
        #address-cells = <1>;
        #size-cells = <1>;
 
index daf9433e906b5626987237e5a19a99c54b430519..765e43c997da1458b6aae6ea1216b59e57aff390 100644 (file)
@@ -2,6 +2,7 @@
  * MPC866 ADS Device Tree Source
  *
  * Copyright 2006 MontaVista Software, Inc.
+ * Copyright 2008 Freescale Semiconductor, Inc.
  *
  * This program is free software; you can redistribute  it and/or modify it
  * under  the terms of  the GNU General  Public License as published by the
@@ -9,6 +10,7 @@
  * option) any later version.
  */
 
+/dts-v1/;
 
 / {
        model = "MPC866ADS";
 
                PowerPC,866@0 {
                        device_type = "cpu";
-                       reg = <0>;
-                       d-cache-line-size = <10>;       // 16 bytes
-                       i-cache-line-size = <10>;       // 16 bytes
-                       d-cache-size = <2000>;          // L1, 8K
-                       i-cache-size = <4000>;          // L1, 16K
+                       reg = <0x0>;
+                       d-cache-line-size = <16>;       // 16 bytes
+                       i-cache-line-size = <16>;       // 16 bytes
+                       d-cache-size = <0x2000>;                // L1, 8K
+                       i-cache-size = <0x4000>;                // L1, 16K
                        timebase-frequency = <0>;
                        bus-frequency = <0>;
                        clock-frequency = <0>;
-                       interrupts = <f 2>;     // decrementer interrupt
+                       interrupts = <15 2>;    // decrementer interrupt
                        interrupt-parent = <&PIC>;
                };
        };
 
        memory {
                device_type = "memory";
-               reg = <00000000 800000>;
+               reg = <0x0 0x800000>;
        };
 
        localbus@ff000100 {
                compatible = "fsl,mpc866-localbus", "fsl,pq1-localbus";
                #address-cells = <2>;
                #size-cells = <1>;
-               reg = <ff000100 40>;
+               reg = <0xff000100 0x40>;
 
                ranges = <
-                       1 0 ff080000 00008000
-                       5 0 ff0a0000 00008000
+                       0x1 0x0 0xff080000 0x8000
+                       0x5 0x0 0xff0a0000 0x8000
                >;
 
                board-control@1,0 {
-                       reg = <1 0 20 5 300 4>;
+                       reg = <0x1 0x0 0x20 0x5 0x300 0x4>;
                        compatible = "fsl,mpc866ads-bcsr";
                };
        };
                #address-cells = <1>;
                #size-cells = <1>;
                device_type = "soc";
-               ranges = <0 ff000000 00100000>;
-               reg = <ff000000 00000200>;
+               ranges = <0x0 0xff000000 0x100000>;
+               reg = <0xff000000 0x200>;
                bus-frequency = <0>;
 
                mdio@e00 {
                        compatible = "fsl,mpc866-fec-mdio", "fsl,pq1-fec-mdio";
-                       reg = <e00 188>;
+                       reg = <0xe00 0x188>;
                        #address-cells = <1>;
                        #size-cells = <0>;
                        PHY: ethernet-phy@f {
-                               reg = <f>;
+                               reg = <0xf>;
                                device_type = "ethernet-phy";
                        };
                };
@@ -80,7 +82,7 @@
                        device_type = "network";
                        compatible = "fsl,mpc866-fec-enet",
                                     "fsl,pq1-fec-enet";
-                       reg = <e00 188>;
+                       reg = <0xe00 0x188>;
                        local-mac-address = [ 00 00 00 00 00 00 ];
                        interrupts = <3 1>;
                        interrupt-parent = <&PIC>;
@@ -91,7 +93,7 @@
                PIC: pic@0 {
                        interrupt-controller;
                        #interrupt-cells = <2>;
-                       reg = <0 24>;
+                       reg = <0x0 0x24>;
                        compatible = "fsl,mpc866-pic", "fsl,pq1-pic";
                };
 
                        #size-cells = <1>;
                        compatible = "fsl,mpc866-cpm", "fsl,cpm1";
                        ranges;
-                       reg = <9c0 40>;
+                       reg = <0x9c0 0x40>;
                        brg-frequency = <0>;
                        interrupts = <0 2>;     // cpm error interrupt
                        interrupt-parent = <&CPM_PIC>;
                        muram@2000 {
                                #address-cells = <1>;
                                #size-cells = <1>;
-                               ranges = <0 2000 2000>;
+                               ranges = <0x0 0x2000 0x2000>;
 
                                data@0 {
                                        compatible = "fsl,cpm-muram-data";
-                                       reg = <0 1c00>;
+                                       reg = <0x0 0x1c00>;
                                };
                        };
 
                                compatible = "fsl,mpc866-brg",
                                             "fsl,cpm1-brg",
                                             "fsl,cpm-brg";
-                               reg = <9f0 10>;
+                               reg = <0x9f0 0x10>;
                                clock-frequency = <0>;
                        };
 
                                #interrupt-cells = <1>;
                                interrupts = <5 2 0 2>;
                                interrupt-parent = <&PIC>;
-                               reg = <930 20>;
+                               reg = <0x930 0x20>;
                                compatible = "fsl,mpc866-cpm-pic",
                                             "fsl,cpm1-pic";
                        };
                                device_type = "serial";
                                compatible = "fsl,mpc866-smc-uart",
                                             "fsl,cpm1-smc-uart";
-                               reg = <a80 10 3e80 40>;
+                               reg = <0xa80 0x10 0x3e80 0x40>;
                                interrupts = <4>;
                                interrupt-parent = <&CPM_PIC>;
                                fsl,cpm-brg = <1>;
-                               fsl,cpm-command = <0090>;
+                               fsl,cpm-command = <0x90>;
                        };
 
                        serial@a90 {
                                device_type = "serial";
                                compatible = "fsl,mpc866-smc-uart",
                                             "fsl,cpm1-smc-uart";
-                               reg = <a90 10 3f80 40>;
+                               reg = <0xa90 0x10 0x3f80 0x40>;
                                interrupts = <3>;
                                interrupt-parent = <&CPM_PIC>;
                                fsl,cpm-brg = <2>;
-                               fsl,cpm-command = <00d0>;
+                               fsl,cpm-command = <0xd0>;
                        };
 
                        ethernet@a00 {
                                device_type = "network";
                                compatible = "fsl,mpc866-scc-enet",
                                             "fsl,cpm1-scc-enet";
-                               reg = <a00 18 3c00 100>;
+                               reg = <0xa00 0x18 0x3c00 0x100>;
                                local-mac-address = [ 00 00 00 00 00 00 ];
-                               interrupts = <1e>;
+                               interrupts = <30>;
                                interrupt-parent = <&CPM_PIC>;
                                fsl,cpm-command = <0000>;
                                linux,network-index = <1>;
index d84a012c2aaf10340daa1d6c9c24d67070b0a21c..9895043722b9fd1a88f4ebd05df9b3606cbcad0f 100644 (file)
@@ -2,7 +2,7 @@
  * MPC885 ADS Device Tree Source
  *
  * Copyright 2006 MontaVista Software, Inc.
- * Copyright 2007 Freescale Semiconductor, Inc.
+ * Copyright 2007,2008 Freescale Semiconductor, Inc.
  *
  * This program is free software; you can redistribute  it and/or modify it
  * under  the terms of  the GNU General  Public License as published by the
@@ -10,6 +10,7 @@
  * option) any later version.
  */
 
+/dts-v1/;
 
 / {
        model = "MPC885ADS";
 
                PowerPC,885@0 {
                        device_type = "cpu";
-                       reg = <0>;
-                       d-cache-line-size = <d#16>;
-                       i-cache-line-size = <d#16>;
-                       d-cache-size = <d#8192>;
-                       i-cache-size = <d#8192>;
+                       reg = <0x0>;
+                       d-cache-line-size = <16>;
+                       i-cache-line-size = <16>;
+                       d-cache-size = <8192>;
+                       i-cache-size = <8192>;
                        timebase-frequency = <0>;
                        bus-frequency = <0>;
                        clock-frequency = <0>;
-                       interrupts = <f 2>;     // decrementer interrupt
+                       interrupts = <15 2>;    // decrementer interrupt
                        interrupt-parent = <&PIC>;
                };
        };
 
        memory {
                device_type = "memory";
-               reg = <0 0>;
+               reg = <0x0 0x0>;
        };
 
        localbus@ff000100 {
                compatible = "fsl,mpc885-localbus", "fsl,pq1-localbus";
                #address-cells = <2>;
                #size-cells = <1>;
-               reg = <ff000100 40>;
+               reg = <0xff000100 0x40>;
 
                ranges = <
-                       0 0 fe000000 00800000
-                       1 0 ff080000 00008000
-                       5 0 ff0a0000 00008000
+                       0x0 0x0 0xfe000000 0x800000
+                       0x1 0x0 0xff080000 0x8000
+                       0x5 0x0 0xff0a0000 0x8000
                >;
 
                flash@0,0 {
                        compatible = "jedec-flash";
-                       reg = <0 0 800000>;
+                       reg = <0x0 0x0 0x800000>;
                        bank-width = <4>;
                        device-width = <1>;
                };
 
                board-control@1,0 {
-                       reg = <1 0 20 5 300 4>;
+                       reg = <0x1 0x0 0x20 0x5 0x300 0x4>;
                        compatible = "fsl,mpc885ads-bcsr";
                };
        };
                #address-cells = <1>;
                #size-cells = <1>;
                device_type = "soc";
-               ranges = <0 ff000000 00004000>;
+               ranges = <0x0 0xff000000 0x4000>;
                bus-frequency = <0>;
 
                // Temporary -- will go away once kernel uses ranges for get_immrbase().
-               reg = <ff000000 4000>;
+               reg = <0xff000000 0x4000>;
 
                mdio@e00 {
                        compatible = "fsl,mpc885-fec-mdio", "fsl,pq1-fec-mdio";
-                       reg = <e00 188>;
+                       reg = <0xe00 0x188>;
                        #address-cells = <1>;
                        #size-cells = <0>;
 
                        PHY0: ethernet-phy@0 {
-                               reg = <0>;
+                               reg = <0x0>;
                                device_type = "ethernet-phy";
                        };
 
                        PHY1: ethernet-phy@1 {
-                               reg = <1>;
+                               reg = <0x1>;
                                device_type = "ethernet-phy";
                        };
 
                        PHY2: ethernet-phy@2 {
-                               reg = <2>;
+                               reg = <0x2>;
                                device_type = "ethernet-phy";
                        };
                };
                        device_type = "network";
                        compatible = "fsl,mpc885-fec-enet",
                                     "fsl,pq1-fec-enet";
-                       reg = <e00 188>;
+                       reg = <0xe00 0x188>;
                        local-mac-address = [ 00 00 00 00 00 00 ];
                        interrupts = <3 1>;
                        interrupt-parent = <&PIC>;
                        device_type = "network";
                        compatible = "fsl,mpc885-fec-enet",
                                     "fsl,pq1-fec-enet";
-                       reg = <1e00 188>;
+                       reg = <0x1e00 0x188>;
                        local-mac-address = [ 00 00 00 00 00 00 ];
                        interrupts = <7 1>;
                        interrupt-parent = <&PIC>;
                PIC: interrupt-controller@0 {
                        interrupt-controller;
                        #interrupt-cells = <2>;
-                       reg = <0 24>;
+                       reg = <0x0 0x24>;
                        compatible = "fsl,mpc885-pic", "fsl,pq1-pic";
                };
 
                        #size-cells = <2>;
                        compatible = "fsl,pq-pcmcia";
                        device_type = "pcmcia";
-                       reg = <80 80>;
+                       reg = <0x80 0x80>;
                        interrupt-parent = <&PIC>;
-                       interrupts = <d 1>;
+                       interrupts = <13 1>;
                };
 
                cpm@9c0 {
                        #address-cells = <1>;
                        #size-cells = <1>;
                        compatible = "fsl,mpc885-cpm", "fsl,cpm1";
-                       command-proc = <9c0>;
+                       command-proc = <0x9c0>;
                        interrupts = <0>;       // cpm error interrupt
                        interrupt-parent = <&CPM_PIC>;
-                       reg = <9c0 40>;
+                       reg = <0x9c0 0x40>;
                        ranges;
 
                        muram@2000 {
                                #address-cells = <1>;
                                #size-cells = <1>;
-                               ranges = <0 2000 2000>;
+                               ranges = <0x0 0x2000 0x2000>;
 
                                data@0 {
                                        compatible = "fsl,cpm-muram-data";
-                                       reg = <0 1c00>;
+                                       reg = <0x0 0x1c00>;
                                };
                        };
 
                                             "fsl,cpm1-brg",
                                             "fsl,cpm-brg";
                                clock-frequency = <0>;
-                               reg = <9f0 10>;
+                               reg = <0x9f0 0x10>;
                        };
 
                        CPM_PIC: interrupt-controller@930 {
                                #interrupt-cells = <1>;
                                interrupts = <5 2 0 2>;
                                interrupt-parent = <&PIC>;
-                               reg = <930 20>;
+                               reg = <0x930 0x20>;
                                compatible = "fsl,mpc885-cpm-pic",
                                             "fsl,cpm1-pic";
                        };
                                device_type = "serial";
                                compatible = "fsl,mpc885-smc-uart",
                                             "fsl,cpm1-smc-uart";
-                               reg = <a80 10 3e80 40>;
+                               reg = <0xa80 0x10 0x3e80 0x40>;
                                interrupts = <4>;
                                interrupt-parent = <&CPM_PIC>;
                                fsl,cpm-brg = <1>;
-                               fsl,cpm-command = <0090>;
+                               fsl,cpm-command = <0x90>;
                        };
 
                        serial@a90 {
                                device_type = "serial";
                                compatible = "fsl,mpc885-smc-uart",
                                             "fsl,cpm1-smc-uart";
-                               reg = <a90 10 3f80 40>;
+                               reg = <0xa90 0x10 0x3f80 0x40>;
                                interrupts = <3>;
                                interrupt-parent = <&CPM_PIC>;
                                fsl,cpm-brg = <2>;
-                               fsl,cpm-command = <00d0>;
+                               fsl,cpm-command = <0xd0>;
                        };
 
                        ethernet@a40 {
                                device_type = "network";
                                compatible = "fsl,mpc885-scc-enet",
                                             "fsl,cpm1-scc-enet";
-                               reg = <a40 18 3e00 100>;
+                               reg = <0xa40 0x18 0x3e00 0x100>;
                                local-mac-address = [ 00 00 00 00 00 00 ];
-                               interrupts = <1c>;
+                               interrupts = <28>;
                                interrupt-parent = <&CPM_PIC>;
                                phy-handle = <&PHY2>;
-                               fsl,cpm-command = <0080>;
+                               fsl,cpm-command = <0x80>;
                                linux,network-index = <2>;
                        };
                };
index 2d564921897a0419e1e5fe9deed22939d8458e60..b2d61091b36daca5c5ee20959051faba9420fe51 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Device Tree for the PQ2FADS-ZU board with an MPC8280 chip.
  *
- * Copyright 2007 Freescale Semiconductor Inc.
+ * Copyright 2007,2008 Freescale Semiconductor Inc.
  *
  * This program is free software; you can redistribute  it and/or modify it
  * under  the terms of  the GNU General  Public License as published by the
@@ -9,6 +9,8 @@
  * option) any later version.
  */
 
+/dts-v1/;
+
 / {
        model = "pq2fads";
        compatible = "fsl,pq2fads";
 
                cpu@0 {
                        device_type = "cpu";
-                       reg = <0>;
-                       d-cache-line-size = <d#32>;
-                       i-cache-line-size = <d#32>;
-                       d-cache-size = <d#16384>;
-                       i-cache-size = <d#16384>;
+                       reg = <0x0>;
+                       d-cache-line-size = <32>;
+                       i-cache-line-size = <32>;
+                       d-cache-size = <16384>;
+                       i-cache-size = <16384>;
                        timebase-frequency = <0>;
                        clock-frequency = <0>;
                };
@@ -33,7 +35,7 @@
 
        memory {
                device_type = "memory";
-               reg = <0 0>;
+               reg = <0x0 0x0>;
        };
 
        localbus@f0010100 {
                             "fsl,pq2-localbus";
                #address-cells = <2>;
                #size-cells = <1>;
-               reg = <f0010100 60>;
+               reg = <0xf0010100 0x60>;
 
-               ranges = <0 0 fe000000 00800000
-                         1 0 f4500000 00008000
-                         8 0 f8200000 00008000>;
+               ranges = <0x0 0x0 0xfe000000 0x800000
+                         0x1 0x0 0xf4500000 0x8000
+                         0x8 0x0 0xf8200000 0x8000>;
 
                flash@0,0 {
                        compatible = "jedec-flash";
-                       reg = <0 0 800000>;
+                       reg = <0x0 0x0 0x800000>;
                        bank-width = <4>;
                        device-width = <1>;
                };
 
                bcsr@1,0 {
-                       reg = <1 0 20>;
+                       reg = <0x1 0x0 0x20>;
                        compatible = "fsl,pq2fads-bcsr";
                };
 
                PCI_PIC: pic@8,0 {
                        #interrupt-cells = <1>;
                        interrupt-controller;
-                       reg = <8 0 8>;
+                       reg = <0x8 0x0 0x8>;
                        compatible = "fsl,pq2ads-pci-pic";
                        interrupt-parent = <&PIC>;
-                       interrupts = <18 8>;
+                       interrupts = <24 8>;
                };
        };
 
        pci@f0010800 {
                device_type = "pci";
-               reg = <f0010800 10c f00101ac 8 f00101c4 8>;
+               reg = <0xf0010800 0x10c 0xf00101ac 0x8 0xf00101c4 0x8>;
                compatible = "fsl,mpc8280-pci", "fsl,pq2-pci";
                #interrupt-cells = <1>;
                #size-cells = <2>;
                #address-cells = <3>;
-               clock-frequency = <d#66000000>;
-               interrupt-map-mask = <f800 0 0 7>;
+               clock-frequency = <66000000>;
+               interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
                interrupt-map = <
                                /* IDSEL 0x16 */
-                                b000 0 0 1 &PCI_PIC 0
-                                b000 0 0 2 &PCI_PIC 1
-                                b000 0 0 3 &PCI_PIC 2
-                                b000 0 0 4 &PCI_PIC 3
+                                0xb000 0x0 0x0 0x1 &PCI_PIC 0
+                                0xb000 0x0 0x0 0x2 &PCI_PIC 1
+                                0xb000 0x0 0x0 0x3 &PCI_PIC 2
+                                0xb000 0x0 0x0 0x4 &PCI_PIC 3
 
                                /* IDSEL 0x17 */
-                                b800 0 0 1 &PCI_PIC 4
-                                b800 0 0 2 &PCI_PIC 5
-                                b800 0 0 3 &PCI_PIC 6
-                                b800 0 0 4 &PCI_PIC 7
+                                0xb800 0x0 0x0 0x1 &PCI_PIC 4
+                                0xb800 0x0 0x0 0x2 &PCI_PIC 5
+                                0xb800 0x0 0x0 0x3 &PCI_PIC 6
+                                0xb800 0x0 0x0 0x4 &PCI_PIC 7
 
                                /* IDSEL 0x18 */
-                                c000 0 0 1 &PCI_PIC 8
-                                c000 0 0 2 &PCI_PIC 9
-                                c000 0 0 3 &PCI_PIC a
-                                c000 0 0 4 &PCI_PIC b>;
+                                0xc000 0x0 0x0 0x1 &PCI_PIC 8
+                                0xc000 0x0 0x0 0x2 &PCI_PIC 9
+                                0xc000 0x0 0x0 0x3 &PCI_PIC 10
+                                0xc000 0x0 0x0 0x4 &PCI_PIC 11>;
 
                interrupt-parent = <&PIC>;
-               interrupts = <12 8>;
-               ranges = <42000000 0 80000000 80000000 0 20000000
-                         02000000 0 a0000000 a0000000 0 20000000
-                         01000000 0 00000000 f6000000 0 02000000>;
+               interrupts = <18 8>;
+               ranges = <0x42000000 0x0 0x80000000 0x80000000 0x0 0x20000000
+                         0x2000000 0x0 0xa0000000 0xa0000000 0x0 0x20000000
+                         0x1000000 0x0 0x0 0xf6000000 0x0 0x2000000>;
        };
 
        soc@f0000000 {
                #size-cells = <1>;
                device_type = "soc";
                compatible = "fsl,mpc8280", "fsl,pq2-soc";
-               ranges = <00000000 f0000000 00053000>;
+               ranges = <0x0 0xf0000000 0x53000>;
 
                // Temporary -- will go away once kernel uses ranges for get_immrbase().
-               reg = <f0000000 00053000>;
+               reg = <0xf0000000 0x53000>;
 
                cpm@119c0 {
                        #address-cells = <1>;
                        #size-cells = <1>;
                        #interrupt-cells = <2>;
                        compatible = "fsl,mpc8280-cpm", "fsl,cpm2";
-                       reg = <119c0 30>;
+                       reg = <0x119c0 0x30>;
                        ranges;
 
                        muram@0 {
                                #address-cells = <1>;
                                #size-cells = <1>;
-                               ranges = <0 0 10000>;
+                               ranges = <0x0 0x0 0x10000>;
 
                                data@0 {
                                        compatible = "fsl,cpm-muram-data";
-                                       reg = <0 2000 9800 800>;
+                                       reg = <0x0 0x2000 0x9800 0x800>;
                                };
                        };
 
                                compatible = "fsl,mpc8280-brg",
                                             "fsl,cpm2-brg",
                                             "fsl,cpm-brg";
-                               reg = <119f0 10 115f0 10>;
+                               reg = <0x119f0 0x10 0x115f0 0x10>;
                        };
 
                        serial@11a00 {
                                device_type = "serial";
                                compatible = "fsl,mpc8280-scc-uart",
                                             "fsl,cpm2-scc-uart";
-                               reg = <11a00 20 8000 100>;
-                               interrupts = <28 8>;
+                               reg = <0x11a00 0x20 0x8000 0x100>;
+                               interrupts = <40 8>;
                                interrupt-parent = <&PIC>;
                                fsl,cpm-brg = <1>;
-                               fsl,cpm-command = <00800000>;
+                               fsl,cpm-command = <0x800000>;
                        };
 
                        serial@11a20 {
                                device_type = "serial";
                                compatible = "fsl,mpc8280-scc-uart",
                                             "fsl,cpm2-scc-uart";
-                               reg = <11a20 20 8100 100>;
-                               interrupts = <29 8>;
+                               reg = <0x11a20 0x20 0x8100 0x100>;
+                               interrupts = <41 8>;
                                interrupt-parent = <&PIC>;
                                fsl,cpm-brg = <2>;
-                               fsl,cpm-command = <04a00000>;
+                               fsl,cpm-command = <0x4a00000>;
                        };
 
                        ethernet@11320 {
                                device_type = "network";
                                compatible = "fsl,mpc8280-fcc-enet",
                                             "fsl,cpm2-fcc-enet";
-                               reg = <11320 20 8500 100 113b0 1>;
-                               interrupts = <21 8>;
+                               reg = <0x11320 0x20 0x8500 0x100 0x113b0 0x1>;
+                               interrupts = <33 8>;
                                interrupt-parent = <&PIC>;
                                phy-handle = <&PHY0>;
                                linux,network-index = <0>;
-                               fsl,cpm-command = <16200300>;
+                               fsl,cpm-command = <0x16200300>;
                        };
 
                        ethernet@11340 {
                                device_type = "network";
                                compatible = "fsl,mpc8280-fcc-enet",
                                             "fsl,cpm2-fcc-enet";
-                               reg = <11340 20 8600 100 113d0 1>;
-                               interrupts = <22 8>;
+                               reg = <0x11340 0x20 0x8600 0x100 0x113d0 0x1>;
+                               interrupts = <34 8>;
                                interrupt-parent = <&PIC>;
                                phy-handle = <&PHY1>;
                                linux,network-index = <1>;
-                               fsl,cpm-command = <1a400300>;
+                               fsl,cpm-command = <0x1a400300>;
                                local-mac-address = [00 e0 0c 00 79 01];
                        };
 
                                             "fsl,cpm2-mdio-bitbang";
                                #address-cells = <1>;
                                #size-cells = <0>;
-                               reg = <10d40 14>;
+                               reg = <0x10d40 0x14>;
                                fsl,mdio-pin = <9>;
-                               fsl,mdc-pin = <a>;
+                               fsl,mdc-pin = <10>;
 
                                PHY0: ethernet-phy@0 {
                                        interrupt-parent = <&PIC>;
-                                       interrupts = <19 2>;
-                                       reg = <0>;
+                                       interrupts = <25 2>;
+                                       reg = <0x0>;
                                        device_type = "ethernet-phy";
                                };
 
                                PHY1: ethernet-phy@1 {
                                        interrupt-parent = <&PIC>;
-                                       interrupts = <19 2>;
-                                       reg = <3>;
+                                       interrupts = <25 2>;
+                                       reg = <0x3>;
                                        device_type = "ethernet-phy";
                                };
                        };
                                #size-cells = <0>;
                                compatible = "fsl,mpc8280-usb",
                                             "fsl,cpm2-usb";
-                               reg = <11b60 18 8b00 100>;
+                               reg = <0x11b60 0x18 0x8b00 0x100>;
                                interrupt-parent = <&PIC>;
-                               interrupts = <b 8>;
-                               fsl,cpm-command = <2e600000>;
+                               interrupts = <11 8>;
+                               fsl,cpm-command = <0x2e600000>;
                        };
                };
 
                PIC: interrupt-controller@10c00 {
                        #interrupt-cells = <2>;
                        interrupt-controller;
-                       reg = <10c00 80>;
+                       reg = <0x10c00 0x80>;
                        compatible = "fsl,mpc8280-pic", "fsl,cpm2-pic";
                };
 
index 297dfa53fe9e488be0c5532c50987dc711b25257..1ee6ff43dd57e772e543297a7b22b5809e7f6f48 100644 (file)
@@ -11,6 +11,8 @@
  * if it can determine the exact PrPMC type.
  */
 
+/dts-v1/;
+
 / {
        #address-cells = <1>;
        #size-cells = <1>;
                PowerPC,7447 {
                        device_type = "cpu";
                        reg = <0>;
-                       clock-frequency = <2bb0b140>;   /* Default (733 MHz) */
-                       bus-frequency = <7f28155>;      /* 133.333333 MHz */
-                       timebase-frequency = <1fca055>; /* 33.333333 MHz */
-                       i-cache-line-size = <20>;
-                       d-cache-line-size = <20>;
-                       i-cache-size = <8000>;
-                       d-cache-size = <8000>;
+                       clock-frequency = <733333333>;  /* Default */
+                       bus-frequency = <133333333>;
+                       timebase-frequency = <33333333>;
+                       i-cache-line-size = <32>;
+                       d-cache-line-size = <32>;
+                       i-cache-size = <32768>;
+                       d-cache-size = <32768>;
                };
        };
 
        memory {
                device_type = "memory";
-               reg = <00000000 20000000>;      /* Default (512MB) */
+               reg = <0x0 0x20000000>;                 /* Default (512MB) */
        };
 
-       mv64x60@f1000000 { /* Marvell Discovery */
+       system-controller@f1000000 { /* Marvell Discovery mv64360 */
                #address-cells = <1>;
                #size-cells = <1>;
                model = "mv64360";                      /* Default */
-               compatible = "marvell,mv64x60";
-               clock-frequency = <7f28155>;            /* 133.333333 MHz */
-               reg = <f1000000 00010000>;
-               virtual-reg = <f1000000>;
-               ranges = <88000000 88000000 01000000    /* PCI 0 I/O Space */
-                         80000000 80000000 08000000    /* PCI 0 MEM Space */
-                         a0000000 a0000000 04000000    /* User FLASH */
-                         00000000 f1000000 00010000    /* Bridge's regs */
-                         f2000000 f2000000 00040000>;  /* Integrated SRAM */
+               compatible = "marvell,mv64360";
+               clock-frequency = <133333333>;
+               reg = <0xf1000000 0x10000>;
+               virtual-reg = <0xf1000000>;
+               ranges = <0x88000000 0x88000000 0x1000000 /* PCI 0 I/O Space */
+                         0x80000000 0x80000000 0x8000000 /* PCI 0 MEM Space */
+                         0xa0000000 0xa0000000 0x4000000 /* User FLASH */
+                         0x00000000 0xf1000000 0x0010000 /* Bridge's regs */
+                         0xf2000000 0xf2000000 0x0040000>;/* Integrated SRAM */
 
                flash@a0000000 {
                        device_type = "rom";
                        compatible = "direct-mapped";
-                       reg = <a0000000 4000000>; /* Default (64MB) */
+                       reg = <0xa0000000 0x4000000>; /* Default (64MB) */
                        probe-type = "CFI";
                        bank-width = <4>;
-                       partitions = <00000000 00100000 /* RO */
-                                     00100000 00040001 /* RW */
-                                     00140000 00400000 /* RO */
-                                     00540000 039c0000 /* RO */
-                                     03f00000 00100000>; /* RO */
+                       partitions = <0x00000000 0x00100000 /* RO */
+                                     0x00100000 0x00040001 /* RW */
+                                     0x00140000 0x00400000 /* RO */
+                                     0x00540000 0x039c0000 /* RO */
+                                     0x03f00000 0x00100000>; /* RO */
                        partition-names = "FW Image A", "FW Config Data", "Kernel Image", "Filesystem", "FW Image B";
                };
 
                        #address-cells = <1>;
                        #size-cells = <0>;
                        device_type = "mdio";
-                       compatible = "marvell,mv64x60-mdio";
-                       ethernet-phy@1 {
+                       compatible = "marvell,mv64360-mdio";
+                       PHY0: ethernet-phy@1 {
                                device_type = "ethernet-phy";
                                compatible = "broadcom,bcm5421";
-                               interrupts = <4c>;      /* GPP 12 */
-                               interrupt-parent = <&/mv64x60/pic>;
+                               interrupts = <76>;      /* GPP 12 */
+                               interrupt-parent = <&PIC>;
                                reg = <1>;
                        };
-                       ethernet-phy@3 {
+                       PHY1: ethernet-phy@3 {
                                device_type = "ethernet-phy";
                                compatible = "broadcom,bcm5421";
-                               interrupts = <4c>;      /* GPP 12 */
-                               interrupt-parent = <&/mv64x60/pic>;
+                               interrupts = <76>;      /* GPP 12 */
+                               interrupt-parent = <&PIC>;
                                reg = <3>;
                        };
                };
 
-               ethernet@2000 {
-                       reg = <2000 2000>;
-                       eth0 {
+               ethernet-group@2000 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       compatible = "marvell,mv64360-eth-group";
+                       reg = <0x2000 0x2000>;
+                       ethernet@0 {
                                device_type = "network";
-                               compatible = "marvell,mv64x60-eth";
-                               block-index = <0>;
-                               interrupts = <20>;
-                               interrupt-parent = <&/mv64x60/pic>;
-                               phy = <&/mv64x60/mdio/ethernet-phy@1>;
+                               compatible = "marvell,mv64360-eth";
+                               reg = <0>;
+                               interrupts = <32>;
+                               interrupt-parent = <&PIC>;
+                               phy = <&PHY0>;
                                local-mac-address = [ 00 00 00 00 00 00 ];
                        };
-                       eth1 {
+                       ethernet@1 {
                                device_type = "network";
-                               compatible = "marvell,mv64x60-eth";
-                               block-index = <1>;
-                               interrupts = <21>;
-                               interrupt-parent = <&/mv64x60/pic>;
-                               phy = <&/mv64x60/mdio/ethernet-phy@3>;
+                               compatible = "marvell,mv64360-eth";
+                               reg = <1>;
+                               interrupts = <33>;
+                               interrupt-parent = <&PIC>;
+                               phy = <&PHY1>;
                                local-mac-address = [ 00 00 00 00 00 00 ];
                        };
                };
 
-               sdma@4000 {
-                       device_type = "dma";
-                       compatible = "marvell,mv64x60-sdma";
-                       reg = <4000 c18>;
-                       virtual-reg = <f1004000>;
-                       interrupt-base = <0>;
-                       interrupts = <24>;
-                       interrupt-parent = <&/mv64x60/pic>;
+               SDMA0: sdma@4000 {
+                       compatible = "marvell,mv64360-sdma";
+                       reg = <0x4000 0xc18>;
+                       virtual-reg = <0xf1004000>;
+                       interrupts = <36>;
+                       interrupt-parent = <&PIC>;
                };
 
-               sdma@6000 {
-                       device_type = "dma";
-                       compatible = "marvell,mv64x60-sdma";
-                       reg = <6000 c18>;
-                       virtual-reg = <f1006000>;
-                       interrupt-base = <0>;
-                       interrupts = <26>;
-                       interrupt-parent = <&/mv64x60/pic>;
+               SDMA1: sdma@6000 {
+                       compatible = "marvell,mv64360-sdma";
+                       reg = <0x6000 0xc18>;
+                       virtual-reg = <0xf1006000>;
+                       interrupts = <38>;
+                       interrupt-parent = <&PIC>;
                };
 
-               brg@b200 {
-                       compatible = "marvell,mv64x60-brg";
-                       reg = <b200 8>;
+               BRG0: brg@b200 {
+                       compatible = "marvell,mv64360-brg";
+                       reg = <0xb200 0x8>;
                        clock-src = <8>;
-                       clock-frequency = <7ed6b40>;
-                       current-speed = <2580>;
-                       bcr = <0>;
+                       clock-frequency = <133333333>;
+                       current-speed = <9600>;
                };
 
-               brg@b208 {
-                       compatible = "marvell,mv64x60-brg";
-                       reg = <b208 8>;
+               BRG1: brg@b208 {
+                       compatible = "marvell,mv64360-brg";
+                       reg = <0xb208 0x8>;
                        clock-src = <8>;
-                       clock-frequency = <7ed6b40>;
-                       current-speed = <2580>;
-                       bcr = <0>;
+                       clock-frequency = <133333333>;
+                       current-speed = <9600>;
                };
 
-               cunit@f200 {
-                       reg = <f200 200>;
+               CUNIT: cunit@f200 {
+                       reg = <0xf200 0x200>;
                };
 
-               mpscrouting@b400 {
-                       reg = <b400 c>;
+               MPSCROUTING: mpscrouting@b400 {
+                       reg = <0xb400 0xc>;
                };
 
-               mpscintr@b800 {
-                       reg = <b800 100>;
-                       virtual-reg = <f100b800>;
+               MPSCINTR: mpscintr@b800 {
+                       reg = <0xb800 0x100>;
+                       virtual-reg = <0xf100b800>;
                };
 
-               mpsc@8000 {
+               MPSC0: mpsc@8000 {
                        device_type = "serial";
-                       compatible = "marvell,mpsc";
-                       reg = <8000 38>;
-                       virtual-reg = <f1008000>;
-                       sdma = <&/mv64x60/sdma@4000>;
-                       brg = <&/mv64x60/brg@b200>;
-                       cunit = <&/mv64x60/cunit@f200>;
-                       mpscrouting = <&/mv64x60/mpscrouting@b400>;
-                       mpscintr = <&/mv64x60/mpscintr@b800>;
-                       block-index = <0>;
-                       max_idle = <28>;
-                       chr_1 = <0>;
-                       chr_2 = <0>;
-                       chr_10 = <3>;
-                       mpcr = <0>;
-                       interrupts = <28>;
-                       interrupt-parent = <&/mv64x60/pic>;
+                       compatible = "marvell,mv64360-mpsc";
+                       reg = <0x8000 0x38>;
+                       virtual-reg = <0xf1008000>;
+                       sdma = <&SDMA0>;
+                       brg = <&BRG0>;
+                       cunit = <&CUNIT>;
+                       mpscrouting = <&MPSCROUTING>;
+                       mpscintr = <&MPSCINTR>;
+                       cell-index = <0>;
+                       interrupts = <40>;
+                       interrupt-parent = <&PIC>;
                };
 
-               mpsc@9000 {
+               MPSC1: mpsc@9000 {
                        device_type = "serial";
-                       compatible = "marvell,mpsc";
-                       reg = <9000 38>;
-                       virtual-reg = <f1009000>;
-                       sdma = <&/mv64x60/sdma@6000>;
-                       brg = <&/mv64x60/brg@b208>;
-                       cunit = <&/mv64x60/cunit@f200>;
-                       mpscrouting = <&/mv64x60/mpscrouting@b400>;
-                       mpscintr = <&/mv64x60/mpscintr@b800>;
-                       block-index = <1>;
-                       max_idle = <28>;
-                       chr_1 = <0>;
-                       chr_2 = <0>;
-                       chr_10 = <3>;
-                       mpcr = <0>;
-                       interrupts = <2a>;
-                       interrupt-parent = <&/mv64x60/pic>;
+                       compatible = "marvell,mv64360-mpsc";
+                       reg = <0x9000 0x38>;
+                       virtual-reg = <0xf1009000>;
+                       sdma = <&SDMA1>;
+                       brg = <&BRG1>;
+                       cunit = <&CUNIT>;
+                       mpscrouting = <&MPSCROUTING>;
+                       mpscintr = <&MPSCINTR>;
+                       cell-index = <1>;
+                       interrupts = <42>;
+                       interrupt-parent = <&PIC>;
                };
 
                wdt@b410 {                      /* watchdog timer */
-                       compatible = "marvell,mv64x60-wdt";
-                       reg = <b410 8>;
-                       timeout = <a>;          /* wdt timeout in seconds */
+                       compatible = "marvell,mv64360-wdt";
+                       reg = <0xb410 0x8>;
                };
 
                i2c@c000 {
                        device_type = "i2c";
-                       compatible = "marvell,mv64x60-i2c";
-                       reg = <c000 20>;
-                       virtual-reg = <f100c000>;
-                       freq_m = <8>;
-                       freq_n = <3>;
-                       timeout = <3e8>;                /* 1000 = 1 second */
-                       retries = <1>;
-                       interrupts = <25>;
-                       interrupt-parent = <&/mv64x60/pic>;
+                       compatible = "marvell,mv64360-i2c";
+                       reg = <0xc000 0x20>;
+                       virtual-reg = <0xf100c000>;
+                       interrupts = <37>;
+                       interrupt-parent = <&PIC>;
                };
 
-               pic {
+               PIC: pic {
                        #interrupt-cells = <1>;
                        #address-cells = <0>;
-                       compatible = "marvell,mv64x60-pic";
-                       reg = <0000 88>;
+                       compatible = "marvell,mv64360-pic";
+                       reg = <0x0 0x88>;
                        interrupt-controller;
                };
 
                mpp@f000 {
-                       compatible = "marvell,mv64x60-mpp";
-                       reg = <f000 10>;
+                       compatible = "marvell,mv64360-mpp";
+                       reg = <0xf000 0x10>;
                };
 
                gpp@f100 {
-                       compatible = "marvell,mv64x60-gpp";
-                       reg = <f100 20>;
+                       compatible = "marvell,mv64360-gpp";
+                       reg = <0xf100 0x20>;
                };
 
                pci@80000000 {
                        #size-cells = <2>;
                        #interrupt-cells = <1>;
                        device_type = "pci";
-                       compatible = "marvell,mv64x60-pci";
-                       reg = <0cf8 8>;
-                       ranges = <01000000 0        0 88000000 0 01000000
-                                 02000000 0 80000000 80000000 0 08000000>;
-                       bus-range = <0 ff>;
-                       clock-frequency = <3EF1480>;
-                       interrupt-pci-iack = <0c34>;
-                       interrupt-parent = <&/mv64x60/pic>;
-                       interrupt-map-mask = <f800 0 0 7>;
+                       compatible = "marvell,mv64360-pci";
+                       reg = <0xcf8 0x8>;
+                       ranges = <0x01000000 0x0        0x0
+                                       0x88000000 0x0 0x01000000
+                                 0x02000000 0x0 0x80000000
+                                       0x80000000 0x0 0x08000000>;
+                       bus-range = <0 255>;
+                       clock-frequency = <66000000>;
+                       interrupt-pci-iack = <0xc34>;
+                       interrupt-parent = <&PIC>;
+                       interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
                        interrupt-map = <
                                /* IDSEL 0x0a */
-                               5000 0 0 1 &/mv64x60/pic 50
-                               5000 0 0 2 &/mv64x60/pic 51
-                               5000 0 0 3 &/mv64x60/pic 5b
-                               5000 0 0 4 &/mv64x60/pic 5d
+                               0x5000 0 0 1 &PIC 80
+                               0x5000 0 0 2 &PIC 81
+                               0x5000 0 0 3 &PIC 91
+                               0x5000 0 0 4 &PIC 93
 
                                /* IDSEL 0x0b */
-                               5800 0 0 1 &/mv64x60/pic 5b
-                               5800 0 0 2 &/mv64x60/pic 5d
-                               5800 0 0 3 &/mv64x60/pic 50
-                               5800 0 0 4 &/mv64x60/pic 51
+                               0x5800 0 0 1 &PIC 91
+                               0x5800 0 0 2 &PIC 93
+                               0x5800 0 0 3 &PIC 80
+                               0x5800 0 0 4 &PIC 81
 
                                /* IDSEL 0x0c */
-                               6000 0 0 1 &/mv64x60/pic 5b
-                               6000 0 0 2 &/mv64x60/pic 5d
-                               6000 0 0 3 &/mv64x60/pic 50
-                               6000 0 0 4 &/mv64x60/pic 51
+                               0x6000 0 0 1 &PIC 91
+                               0x6000 0 0 2 &PIC 93
+                               0x6000 0 0 3 &PIC 80
+                               0x6000 0 0 4 &PIC 81
 
                                /* IDSEL 0x0d */
-                               6800 0 0 1 &/mv64x60/pic 5d
-                               6800 0 0 2 &/mv64x60/pic 50
-                               6800 0 0 3 &/mv64x60/pic 51
-                               6800 0 0 4 &/mv64x60/pic 5b
+                               0x6800 0 0 1 &PIC 93
+                               0x6800 0 0 2 &PIC 80
+                               0x6800 0 0 3 &PIC 81
+                               0x6800 0 0 4 &PIC 91
                        >;
                };
 
                cpu-error@0070 {
-                       compatible = "marvell,mv64x60-cpu-error";
-                       reg = <0070 10 0128 28>;
-                       interrupts = <03>;
-                       interrupt-parent = <&/mv64x60/pic>;
+                       compatible = "marvell,mv64360-cpu-error";
+                       reg = <0x70 0x10 0x128 0x28>;
+                       interrupts = <3>;
+                       interrupt-parent = <&PIC>;
                };
 
                sram-ctrl@0380 {
-                       compatible = "marvell,mv64x60-sram-ctrl";
-                       reg = <0380 80>;
-                       interrupts = <0d>;
-                       interrupt-parent = <&/mv64x60/pic>;
+                       compatible = "marvell,mv64360-sram-ctrl";
+                       reg = <0x380 0x80>;
+                       interrupts = <13>;
+                       interrupt-parent = <&PIC>;
                };
 
                pci-error@1d40 {
-                       compatible = "marvell,mv64x60-pci-error";
-                       reg = <1d40 40 0c28 4>;
-                       interrupts = <0c>;
-                       interrupt-parent = <&/mv64x60/pic>;
+                       compatible = "marvell,mv64360-pci-error";
+                       reg = <0x1d40 0x40 0xc28 0x4>;
+                       interrupts = <12>;
+                       interrupt-parent = <&PIC>;
                };
 
                mem-ctrl@1400 {
-                       compatible = "marvell,mv64x60-mem-ctrl";
-                       reg = <1400 60>;
-                       interrupts = <11>;
-                       interrupt-parent = <&/mv64x60/pic>;
+                       compatible = "marvell,mv64360-mem-ctrl";
+                       reg = <0x1400 0x60>;
+                       interrupts = <17>;
+                       interrupt-parent = <&PIC>;
                };
        };
 
        chosen {
                bootargs = "ip=on";
-               linux,stdout-path = "/mv64x60@f1000000/mpsc@8000";
+               linux,stdout-path = &MPSC0;
        };
 };
index f947c75a2e94b724166700306eda2067fa9d726a..6a8fa7089ea2a456bf73f84cb805fec262dcf62b 100644 (file)
                        };
 
                        EMAC0: ethernet@ef600e00 {
-                               linux,network-index = <0>;
                                device_type = "network";
                                compatible = "ibm,emac-440grx", "ibm,emac-440epx", "ibm,emac4";
                                interrupt-parent = <&EMAC0>;
                                mal-tx-channel = <0>;
                                mal-rx-channel = <0>;
                                cell-index = <0>;
-                               max-frame-size = <5dc>;
+                               max-frame-size = <2328>;
                                rx-fifo-size = <1000>;
                                tx-fifo-size = <800>;
                                phy-mode = "rgmii";
                        };
 
                        EMAC1: ethernet@ef600f00 {
-                               linux,network-index = <1>;
                                device_type = "network";
                                compatible = "ibm,emac-440grx", "ibm,emac-440epx", "ibm,emac4";
                                interrupt-parent = <&EMAC1>;
                                mal-tx-channel = <1>;
                                mal-rx-channel = <1>;
                                cell-index = <1>;
-                               max-frame-size = <5dc>;
+                               max-frame-size = <2328>;
                                rx-fifo-size = <1000>;
                                tx-fifo-size = <800>;
                                phy-mode = "rgmii";
diff --git a/arch/powerpc/boot/dts/sbc8641d.dts b/arch/powerpc/boot/dts/sbc8641d.dts
new file mode 100644 (file)
index 0000000..3eebeec
--- /dev/null
@@ -0,0 +1,352 @@
+/*
+ * SBC8641D Device Tree Source
+ *
+ * Copyright 2008 Wind River Systems Inc.
+ *
+ * Paul Gortmaker (see MAINTAINERS for contact information)
+ *
+ * Based largely on the mpc8641_hpcn.dts by Freescale Semiconductor Inc.
+ *
+ * This program is free software; you can redistribute  it and/or modify it
+ * under  the terms of  the GNU General  Public License as published by the
+ * Free Software Foundation;  either version 2 of the  License, or (at your
+ * option) any later version.
+ */
+
+/dts-v1/;
+
+/ {
+       model = "SBC8641D";
+       compatible = "wind,sbc8641";
+       #address-cells = <1>;
+       #size-cells = <1>;
+
+       aliases {
+               ethernet0 = &enet0;
+               ethernet1 = &enet1;
+               ethernet2 = &enet2;
+               ethernet3 = &enet3;
+               serial0 = &serial0;
+               serial1 = &serial1;
+               pci0 = &pci0;
+               pci1 = &pci1;
+       };
+
+       cpus {
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               PowerPC,8641@0 {
+                       device_type = "cpu";
+                       reg = <0>;
+                       d-cache-line-size = <32>;
+                       i-cache-line-size = <32>;
+                       d-cache-size = <32768>;         // L1
+                       i-cache-size = <32768>;         // L1
+                       timebase-frequency = <0>;       // From uboot
+                       bus-frequency = <0>;            // From uboot
+                       clock-frequency = <0>;          // From uboot
+               };
+               PowerPC,8641@1 {
+                       device_type = "cpu";
+                       reg = <1>;
+                       d-cache-line-size = <32>;
+                       i-cache-line-size = <32>;
+                       d-cache-size = <32768>;
+                       i-cache-size = <32768>;
+                       timebase-frequency = <0>;       // From uboot
+                       bus-frequency = <0>;            // From uboot
+                       clock-frequency = <0>;          // From uboot
+               };
+       };
+
+       memory {
+               device_type = "memory";
+               reg = <0x00000000 0x20000000>;  // 512M at 0x0
+       };
+
+       localbus@f8005000 {
+               #address-cells = <2>;
+               #size-cells = <1>;
+               compatible = "fsl,mpc8641-localbus", "simple-bus";
+               reg = <0xf8005000 0x1000>;
+               interrupts = <19 2>;
+               interrupt-parent = <&mpic>;
+
+               ranges = <0 0 0xff000000 0x01000000     // 16MB Boot flash
+                         1 0 0xf0000000 0x00010000     // 64KB EEPROM
+                         2 0 0xf1000000 0x00100000     // EPLD (1MB)
+                         3 0 0xe0000000 0x04000000     // 64MB LB SDRAM (CS3)
+                         4 0 0xe4000000 0x04000000     // 64MB LB SDRAM (CS4)
+                         6 0 0xf4000000 0x00100000     // LCD display (1MB)
+                         7 0 0xe8000000 0x04000000>;   // 64MB OneNAND
+
+               flash@0,0 {
+                       compatible = "cfi-flash";
+                       reg = <0 0 0x01000000>;
+                       bank-width = <2>;
+                       device-width = <2>;
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       partition@0 {
+                               label = "dtb";
+                               reg = <0x00000000 0x00100000>;
+                               read-only;
+                       };
+                       partition@300000 {
+                               label = "kernel";
+                               reg = <0x00100000 0x00400000>;
+                               read-only;
+                       };
+                       partition@400000 {
+                               label = "fs";
+                               reg = <0x00500000 0x00a00000>;
+                       };
+                       partition@700000 {
+                               label = "firmware";
+                               reg = <0x00f00000 0x00100000>;
+                               read-only;
+                       };
+               };
+
+               epld@2,0 {
+                       compatible = "wrs,epld-localbus";
+                       #address-cells = <2>;
+                       #size-cells = <1>;
+                       reg = <2 0 0x100000>;
+                       ranges = <0 0 5 0 1     // User switches
+                                 1 0 5 1 1     // Board ID/Rev
+                                 3 0 5 3 1>;   // LEDs
+               };
+       };
+
+       soc@f8000000 {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               device_type = "soc";
+               compatible = "simple-bus";
+               ranges = <0x00000000 0xf8000000 0x00100000>;
+               reg = <0xf8000000 0x00001000>;  // CCSRBAR
+               bus-frequency = <0>;
+
+               i2c@3000 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       cell-index = <0>;
+                       compatible = "fsl-i2c";
+                       reg = <0x3000 0x100>;
+                       interrupts = <43 2>;
+                       interrupt-parent = <&mpic>;
+                       dfsrr;
+               };
+
+               i2c@3100 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       cell-index = <1>;
+                       compatible = "fsl-i2c";
+                       reg = <0x3100 0x100>;
+                       interrupts = <43 2>;
+                       interrupt-parent = <&mpic>;
+                       dfsrr;
+               };
+
+               mdio@24520 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       compatible = "fsl,gianfar-mdio";
+                       reg = <0x24520 0x20>;
+
+                       phy0: ethernet-phy@1f {
+                               interrupt-parent = <&mpic>;
+                               interrupts = <10 1>;
+                               reg = <0x1f>;
+                               device_type = "ethernet-phy";
+                       };
+                       phy1: ethernet-phy@0 {
+                               interrupt-parent = <&mpic>;
+                               interrupts = <10 1>;
+                               reg = <0>;
+                               device_type = "ethernet-phy";
+                       };
+                       phy2: ethernet-phy@1 {
+                               interrupt-parent = <&mpic>;
+                               interrupts = <10 1>;
+                               reg = <1>;
+                               device_type = "ethernet-phy";
+                       };
+                       phy3: ethernet-phy@2 {
+                               interrupt-parent = <&mpic>;
+                               interrupts = <10 1>;
+                               reg = <2>;
+                               device_type = "ethernet-phy";
+                       };
+               };
+
+               enet0: ethernet@24000 {
+                       cell-index = <0>;
+                       device_type = "network";
+                       model = "TSEC";
+                       compatible = "gianfar";
+                       reg = <0x24000 0x1000>;
+                       local-mac-address = [ 00 00 00 00 00 00 ];
+                       interrupts = <29 2 30  2 34 2>;
+                       interrupt-parent = <&mpic>;
+                       phy-handle = <&phy0>;
+                       phy-connection-type = "rgmii-id";
+               };
+
+               enet1: ethernet@25000 {
+                       cell-index = <1>;
+                       device_type = "network";
+                       model = "TSEC";
+                       compatible = "gianfar";
+                       reg = <0x25000 0x1000>;
+                       local-mac-address = [ 00 00 00 00 00 00 ];
+                       interrupts = <35 2 36 2 40 2>;
+                       interrupt-parent = <&mpic>;
+                       phy-handle = <&phy1>;
+                       phy-connection-type = "rgmii-id";
+               };
+
+               enet2: ethernet@26000 {
+                       cell-index = <2>;
+                       device_type = "network";
+                       model = "TSEC";
+                       compatible = "gianfar";
+                       reg = <0x26000 0x1000>;
+                       local-mac-address = [ 00 00 00 00 00 00 ];
+                       interrupts = <31 2 32 2 33 2>;
+                       interrupt-parent = <&mpic>;
+                       phy-handle = <&phy2>;
+                       phy-connection-type = "rgmii-id";
+               };
+
+               enet3: ethernet@27000 {
+                       cell-index = <3>;
+                       device_type = "network";
+                       model = "TSEC";
+                       compatible = "gianfar";
+                       reg = <0x27000 0x1000>;
+                       local-mac-address = [ 00 00 00 00 00 00 ];
+                       interrupts = <37 2 38 2 39 2>;
+                       interrupt-parent = <&mpic>;
+                       phy-handle = <&phy3>;
+                       phy-connection-type = "rgmii-id";
+               };
+
+               serial0: serial@4500 {
+                       cell-index = <0>;
+                       device_type = "serial";
+                       compatible = "ns16550";
+                       reg = <0x4500 0x100>;
+                       clock-frequency = <0>;
+                       interrupts = <42 2>;
+                       interrupt-parent = <&mpic>;
+               };
+
+               serial1: serial@4600 {
+                       cell-index = <1>;
+                       device_type = "serial";
+                       compatible = "ns16550";
+                       reg = <0x4600 0x100>;
+                       clock-frequency = <0>;
+                       interrupts = <28 2>;
+                       interrupt-parent = <&mpic>;
+               };
+
+               mpic: pic@40000 {
+                       clock-frequency = <0>;
+                       interrupt-controller;
+                       #address-cells = <0>;
+                       #interrupt-cells = <2>;
+                       reg = <0x40000 0x40000>;
+                       compatible = "chrp,open-pic";
+                       device_type = "open-pic";
+                       big-endian;
+               };
+
+               global-utilities@e0000 {
+                       compatible = "fsl,mpc8641-guts";
+                       reg = <0xe0000 0x1000>;
+                       fsl,has-rstcr;
+               };
+       };
+
+       pci0: pcie@f8008000 {
+               cell-index = <0>;
+               compatible = "fsl,mpc8641-pcie";
+               device_type = "pci";
+               #interrupt-cells = <1>;
+               #size-cells = <2>;
+               #address-cells = <3>;
+               reg = <0xf8008000 0x1000>;
+               bus-range = <0x0 0xff>;
+               ranges = <0x02000000 0x0 0x80000000 0x80000000 0x0 0x20000000
+                         0x01000000 0x0 0x00000000 0xe2000000 0x0 0x00100000>;
+               clock-frequency = <33333333>;
+               interrupt-parent = <&mpic>;
+               interrupts = <24 2>;
+               interrupt-map-mask = <0xff00 0 0 7>;
+               interrupt-map = <
+                       /* IDSEL 0x0 */
+                       0x0000 0 0 1 &mpic 0 1
+                       0x0000 0 0 2 &mpic 1 1
+                       0x0000 0 0 3 &mpic 2 1
+                       0x0000 0 0 4 &mpic 3 1
+                       >;
+
+               pcie@0 {
+                       reg = <0 0 0 0 0>;
+                       #size-cells = <2>;
+                       #address-cells = <3>;
+                       device_type = "pci";
+                       ranges = <0x02000000 0x0 0x80000000
+                                 0x02000000 0x0 0x80000000
+                                 0x0 0x20000000
+
+                                 0x01000000 0x0 0x00000000
+                                 0x01000000 0x0 0x00000000
+                                 0x0 0x00100000>;
+               };
+
+       };
+
+       pci1: pcie@f8009000 {
+               cell-index = <1>;
+               compatible = "fsl,mpc8641-pcie";
+               device_type = "pci";
+               #interrupt-cells = <1>;
+               #size-cells = <2>;
+               #address-cells = <3>;
+               reg = <0xf8009000 0x1000>;
+               bus-range = <0 0xff>;
+               ranges = <0x02000000 0x0 0xa0000000 0xa0000000 0x0 0x20000000
+                         0x01000000 0x0 0x00000000 0xe3000000 0x0 0x00100000>;
+               clock-frequency = <33333333>;
+               interrupt-parent = <&mpic>;
+               interrupts = <25 2>;
+               interrupt-map-mask = <0xf800 0 0 7>;
+               interrupt-map = <
+                       /* IDSEL 0x0 */
+                       0x0000 0 0 1 &mpic 4 1
+                       0x0000 0 0 2 &mpic 5 1
+                       0x0000 0 0 3 &mpic 6 1
+                       0x0000 0 0 4 &mpic 7 1
+                       >;
+
+               pcie@0 {
+                       reg = <0 0 0 0 0>;
+                       #size-cells = <2>;
+                       #address-cells = <3>;
+                       device_type = "pci";
+                       ranges = <0x02000000 0x0 0xa0000000
+                                 0x02000000 0x0 0xa0000000
+                                 0x0 0x20000000
+
+                                 0x01000000 0x0 0x00000000
+                                 0x01000000 0x0 0x00000000
+                                 0x0 0x00100000>;
+               };
+       };
+};
index 8db9515d7dc3dab3ff486c4357c26a5bbda91ceb..a1ae4d6ec9908c3a86dc1900b39086ec8d08c995 100644 (file)
                        };
 
                        EMAC0: ethernet@ef600e00 {
-                               linux,network-index = <0>;
                                device_type = "network";
                                compatible = "ibm,emac-440epx", "ibm,emac4";
                                interrupt-parent = <&EMAC0>;
                                mal-tx-channel = <0>;
                                mal-rx-channel = <0>;
                                cell-index = <0>;
-                               max-frame-size = <5dc>;
+                               max-frame-size = <2328>;
                                rx-fifo-size = <1000>;
                                tx-fifo-size = <800>;
                                phy-mode = "rgmii";
                        };
 
                        EMAC1: ethernet@ef600f00 {
-                               linux,network-index = <1>;
                                device_type = "network";
                                compatible = "ibm,emac-440epx", "ibm,emac4";
                                interrupt-parent = <&EMAC1>;
                                mal-tx-channel = <1>;
                                mal-rx-channel = <1>;
                                cell-index = <1>;
-                               max-frame-size = <5dc>;
+                               max-frame-size = <2328>;
                                rx-fifo-size = <1000>;
                                tx-fifo-size = <800>;
                                phy-mode = "rgmii";
index 8278068c802c8c0926377a9adfaefdfc401e1937..e808e1c5593a924c24bb8d11f9f2e636da6ee903 100644 (file)
                // FIXME: anything else?
        };
 
+       L2C0: l2c {
+               compatible = "ibm,l2-cache-440gx", "ibm,l2-cache";
+               dcr-reg = <20 8                 /* Internal SRAM DCR's */
+                          30 8>;               /* L2 cache DCR's */
+               cache-line-size = <20>;         /* 32 bytes */
+               cache-size = <40000>;           /* L2, 256K */
+               interrupt-parent = <&UIC2>;
+               interrupts = <17 1>;
+       };
+
        plb {
                compatible = "ibm,plb-440gx", "ibm,plb4";
                #address-cells = <2>;
                                reg = <40000790 8>;
                        };
 
+                       TAH0: emac-tah@40000b50 {
+                               compatible = "ibm,tah-440gx", "ibm,tah";
+                               reg = <40000b50 30>;
+                       };
+
+                       TAH1: emac-tah@40000d50 {
+                               compatible = "ibm,tah-440gx", "ibm,tah";
+                               reg = <40000d50 30>;
+                       };
 
                        EMAC0: ethernet@40000800 {
                                unused = <1>;
-                               linux,network-index = <2>;
                                device_type = "network";
                                compatible = "ibm,emac-440gx", "ibm,emac4";
                                interrupt-parent = <&UIC1>;
                        };
                        EMAC1: ethernet@40000900 {
                                unused = <1>;
-                               linux,network-index = <3>;
                                device_type = "network";
                                compatible = "ibm,emac-440gx", "ibm,emac4";
                                interrupt-parent = <&UIC1>;
                        };
 
                        EMAC2: ethernet@40000c00 {
-                               linux,network-index = <0>;
                                device_type = "network";
                                compatible = "ibm,emac-440gx", "ibm,emac4";
                                interrupt-parent = <&UIC2>;
                                mal-tx-channel = <2>;
                                mal-rx-channel = <2>;
                                cell-index = <2>;
-                               max-frame-size = <5dc>;
+                               max-frame-size = <2328>;
                                rx-fifo-size = <1000>;
                                tx-fifo-size = <800>;
                                phy-mode = "rgmii";
                                rgmii-channel = <0>;
                                zmii-device = <&ZMII0>;
                                zmii-channel = <2>;
+                               tah-device = <&TAH0>;
+                               tah-channel = <0>;
                        };
 
                        EMAC3: ethernet@40000e00 {
-                               linux,network-index = <1>;
                                device_type = "network";
                                compatible = "ibm,emac-440gx", "ibm,emac4";
                                interrupt-parent = <&UIC2>;
                                mal-tx-channel = <3>;
                                mal-rx-channel = <3>;
                                cell-index = <3>;
-                               max-frame-size = <5dc>;
+                               max-frame-size = <2328>;
                                rx-fifo-size = <1000>;
                                tx-fifo-size = <800>;
                                phy-mode = "rgmii";
                                rgmii-channel = <1>;
                                zmii-device = <&ZMII0>;
                                zmii-channel = <3>;
+                               tah-device = <&TAH1>;
+                               tah-channel = <0>;
                        };
 
 
index dcc21b0438e5f4e56d3761f1e2053a5c02ca5554..a328607c8f84d40389776088bc830a27d933498e 100644 (file)
                        };
 
                        EMAC: ethernet@ef600800 {
-                               linux,network-index = <0>;
                                device_type = "network";
                                compatible = "ibm,emac-405gp", "ibm,emac";
                                interrupt-parent = <&UIC0>;
index dc1499d30f43ce3bbfa57cdf7aff76b7335e55a4..b04a52e22bf5b3b6607fbe274fe05b19c044d4cc 100644 (file)
                        };
 
                        EMAC0: ethernet@ef600e00 {
-                               linux,network-index = <0>;
                                device_type = "network";
                                compatible = "ibm,emac-440ep", "ibm,emac-440gp", "ibm,emac";
                                interrupt-parent = <&UIC1>;
diff --git a/arch/powerpc/boot/dts/yosemite.dts b/arch/powerpc/boot/dts/yosemite.dts
new file mode 100644 (file)
index 0000000..0d6d332
--- /dev/null
@@ -0,0 +1,304 @@
+/*
+ * Device Tree Source for AMCC Yosemite
+ *
+ * Copyright 2008 IBM Corp.
+ * Josh Boyer <jwboyer@linux.vnet.ibm.com>
+ *
+ * This file is licensed under the terms of the GNU General Public
+ * License version 2.  This program is licensed "as is" without
+ * any warranty of any kind, whether express or implied.
+ */
+
+/ {
+       #address-cells = <2>;
+       #size-cells = <1>;
+       model = "amcc,yosemite";
+       compatible = "amcc,yosemite","amcc,bamboo";
+       dcr-parent = <&/cpus/cpu@0>;
+
+       aliases {
+               ethernet0 = &EMAC0;
+               ethernet1 = &EMAC1;
+               serial0 = &UART0;
+               serial1 = &UART1;
+               serial2 = &UART2;
+               serial3 = &UART3;
+       };
+
+       cpus {
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               cpu@0 {
+                       device_type = "cpu";
+                       model = "PowerPC,440EP";
+                       reg = <0>;
+                       clock-frequency = <0>; /* Filled in by zImage */
+                       timebase-frequency = <0>; /* Filled in by zImage */
+                       i-cache-line-size = <20>;
+                       d-cache-line-size = <20>;
+                       i-cache-size = <8000>;
+                       d-cache-size = <8000>;
+                       dcr-controller;
+                       dcr-access-method = "native";
+               };
+       };
+
+       memory {
+               device_type = "memory";
+               reg = <0 0 0>; /* Filled in by zImage */
+       };
+
+       UIC0: interrupt-controller0 {
+               compatible = "ibm,uic-440ep","ibm,uic";
+               interrupt-controller;
+               cell-index = <0>;
+               dcr-reg = <0c0 009>;
+               #address-cells = <0>;
+               #size-cells = <0>;
+               #interrupt-cells = <2>;
+       };
+
+       UIC1: interrupt-controller1 {
+               compatible = "ibm,uic-440ep","ibm,uic";
+               interrupt-controller;
+               cell-index = <1>;
+               dcr-reg = <0d0 009>;
+               #address-cells = <0>;
+               #size-cells = <0>;
+               #interrupt-cells = <2>;
+               interrupts = <1e 4 1f 4>; /* cascade */
+               interrupt-parent = <&UIC0>;
+       };
+
+       SDR0: sdr {
+               compatible = "ibm,sdr-440ep";
+               dcr-reg = <00e 002>;
+       };
+
+       CPR0: cpr {
+               compatible = "ibm,cpr-440ep";
+               dcr-reg = <00c 002>;
+       };
+
+       plb {
+               compatible = "ibm,plb-440ep", "ibm,plb-440gp", "ibm,plb4";
+               #address-cells = <2>;
+               #size-cells = <1>;
+               ranges;
+               clock-frequency = <0>; /* Filled in by zImage */
+
+               SDRAM0: sdram {
+                       compatible = "ibm,sdram-440ep", "ibm,sdram-405gp";
+                       dcr-reg = <010 2>;
+               };
+
+               DMA0: dma {
+                       compatible = "ibm,dma-440ep", "ibm,dma-440gp";
+                       dcr-reg = <100 027>;
+               };
+
+               MAL0: mcmal {
+                       compatible = "ibm,mcmal-440ep", "ibm,mcmal-440gp", "ibm,mcmal";
+                       dcr-reg = <180 62>;
+                       num-tx-chans = <4>;
+                       num-rx-chans = <2>;
+                       interrupt-parent = <&MAL0>;
+                       interrupts = <0 1 2 3 4>;
+                       #interrupt-cells = <1>;
+                       #address-cells = <0>;
+                       #size-cells = <0>;
+                       interrupt-map = </*TXEOB*/ 0 &UIC0 a 4
+                                       /*RXEOB*/ 1 &UIC0 b 4
+                                       /*SERR*/  2 &UIC1 0 4
+                                       /*TXDE*/  3 &UIC1 1 4
+                                       /*RXDE*/  4 &UIC1 2 4>;
+               };
+
+               POB0: opb {
+                       compatible = "ibm,opb-440ep", "ibm,opb-440gp", "ibm,opb";
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       /* Bamboo is oddball in the 44x world and doesn't use the ERPN
+                        * bits.
+                        */
+                       ranges = <00000000 0 00000000 80000000
+                                 80000000 0 80000000 80000000>;
+                       interrupt-parent = <&UIC1>;
+                       interrupts = <7 4>;
+                       clock-frequency = <0>; /* Filled in by zImage */
+
+                       EBC0: ebc {
+                               compatible = "ibm,ebc-440ep", "ibm,ebc-440gp", "ibm,ebc";
+                               dcr-reg = <012 2>;
+                               #address-cells = <2>;
+                               #size-cells = <1>;
+                               clock-frequency = <0>; /* Filled in by zImage */
+                               interrupts = <5 1>;
+                               interrupt-parent = <&UIC1>;
+                       };
+
+                       UART0: serial@ef600300 {
+                               device_type = "serial";
+                               compatible = "ns16550";
+                               reg = <ef600300 8>;
+                               virtual-reg = <ef600300>;
+                               clock-frequency = <0>; /* Filled in by zImage */
+                               current-speed = <1c200>;
+                               interrupt-parent = <&UIC0>;
+                               interrupts = <0 4>;
+                       };
+
+                       UART1: serial@ef600400 {
+                               device_type = "serial";
+                               compatible = "ns16550";
+                               reg = <ef600400 8>;
+                               virtual-reg = <ef600400>;
+                               clock-frequency = <0>;
+                               current-speed = <0>;
+                               interrupt-parent = <&UIC0>;
+                               interrupts = <1 4>;
+                       };
+
+                       UART2: serial@ef600500 {
+                               device_type = "serial";
+                               compatible = "ns16550";
+                               reg = <ef600500 8>;
+                               virtual-reg = <ef600500>;
+                               clock-frequency = <0>;
+                               current-speed = <0>;
+                               interrupt-parent = <&UIC0>;
+                               interrupts = <3 4>;
+                               status = "disabled";
+                       };
+
+                       UART3: serial@ef600600 {
+                               device_type = "serial";
+                               compatible = "ns16550";
+                               reg = <ef600600 8>;
+                               virtual-reg = <ef600600>;
+                               clock-frequency = <0>;
+                               current-speed = <0>;
+                               interrupt-parent = <&UIC0>;
+                               interrupts = <4 4>;
+                               status = "disabled";
+                       };
+
+                       IIC0: i2c@ef600700 {
+                               compatible = "ibm,iic-440ep", "ibm,iic-440gp", "ibm,iic";
+                               reg = <ef600700 14>;
+                               interrupt-parent = <&UIC0>;
+                               interrupts = <2 4>;
+                       };
+
+                       IIC1: i2c@ef600800 {
+                               compatible = "ibm,iic-440ep", "ibm,iic-440gp", "ibm,iic";
+                               reg = <ef600800 14>;
+                               interrupt-parent = <&UIC0>;
+                               interrupts = <7 4>;
+                       };
+
+                       spi@ef600900 {
+                               compatible = "amcc,spi-440ep";
+                               reg = <ef600900 6>;
+                               interrupts = <8 4>;
+                               interrupt-parent = <&UIC0>;
+                       };
+
+                       ZMII0: emac-zmii@ef600d00 {
+                               compatible = "ibm,zmii-440ep", "ibm,zmii-440gp", "ibm,zmii";
+                               reg = <ef600d00 c>;
+                       };
+
+                       EMAC0: ethernet@ef600e00 {
+                               device_type = "network";
+                               compatible = "ibm,emac-440ep", "ibm,emac-440gp", "ibm,emac";
+                               interrupt-parent = <&UIC1>;
+                               interrupts = <1c 4 1d 4>;
+                               reg = <ef600e00 70>;
+                               local-mac-address = [000000000000];
+                               mal-device = <&MAL0>;
+                               mal-tx-channel = <0 1>;
+                               mal-rx-channel = <0>;
+                               cell-index = <0>;
+                               max-frame-size = <5dc>;
+                               rx-fifo-size = <1000>;
+                               tx-fifo-size = <800>;
+                               phy-mode = "rmii";
+                               phy-map = <00000000>;
+                               zmii-device = <&ZMII0>;
+                               zmii-channel = <0>;
+                       };
+
+                       EMAC1: ethernet@ef600f00 {
+                               device_type = "network";
+                               compatible = "ibm,emac-440ep", "ibm,emac-440gp", "ibm,emac";
+                               interrupt-parent = <&UIC1>;
+                               interrupts = <1e 4 1f 4>;
+                               reg = <ef600f00 70>;
+                               local-mac-address = [000000000000];
+                               mal-device = <&MAL0>;
+                               mal-tx-channel = <2 3>;
+                               mal-rx-channel = <1>;
+                               cell-index = <1>;
+                               max-frame-size = <5dc>;
+                               rx-fifo-size = <1000>;
+                               tx-fifo-size = <800>;
+                               phy-mode = "rmii";
+                               phy-map = <00000000>;
+                               zmii-device = <&ZMII0>;
+                               zmii-channel = <1>;
+                       };
+
+                       usb@ef601000 {
+                               compatible = "ohci-be";
+                               reg = <ef601000 80>;
+                               interrupts = <8 4 9 4>;
+                               interrupt-parent = < &UIC1 >;
+                       };
+               };
+
+               PCI0: pci@ec000000 {
+                       device_type = "pci";
+                       #interrupt-cells = <1>;
+                       #size-cells = <2>;
+                       #address-cells = <3>;
+                       compatible = "ibm,plb440ep-pci", "ibm,plb-pci";
+                       primary;
+                       reg = <0 eec00000 8     /* Config space access */
+                              0 eed00000 4     /* IACK */
+                              0 eed00000 4     /* Special cycle */
+                              0 ef400000 40>;  /* Internal registers */
+
+                       /* Outbound ranges, one memory and one IO,
+                        * later cannot be changed. Chip supports a second
+                        * IO range but we don't use it for now
+                        */
+                       ranges = <02000000 0 a0000000 0 a0000000 0 20000000
+                                 01000000 0 00000000 0 e8000000 0 00010000>;
+
+                       /* Inbound 2GB range starting at 0 */
+                       dma-ranges = <42000000 0 0 0 0 0 80000000>;
+
+                       /* Bamboo has all 4 IRQ pins tied together per slot */
+                       interrupt-map-mask = <f800 0 0 0>;
+                       interrupt-map = <
+                               /* IDSEL 1 */
+                               0800 0 0 0 &UIC0 1c 8
+
+                               /* IDSEL 2 */
+                               1000 0 0 0 &UIC0 1b 8
+
+                               /* IDSEL 3 */
+                               1800 0 0 0 &UIC0 1a 8
+
+                               /* IDSEL 4 */
+                               2000 0 0 0 &UIC0 19 8
+                       >;
+               };
+       };
+
+       chosen {
+               linux,stdout-path = "/plb/opb/serial@ef600300";
+       };
+};
index f61364c47a763ffe05306c45a7ad24f05570e8d7..5532ab3221dde712c33c58412c601263e2e657f0 100644 (file)
@@ -75,7 +75,8 @@ static void ebony_fixups(void)
 
        ibm440gp_fixup_clocks(sysclk, 6 * 1843200);
        ibm4xx_sdram_fixup_memsize();
-       dt_fixup_mac_addresses(ebony_mac0, ebony_mac1);
+       dt_fixup_mac_address_by_alias("ethernet0", ebony_mac0);
+       dt_fixup_mac_address_by_alias("ethernet1", ebony_mac1);
        ibm4xx_fixup_ebc_ranges("/plb/opb/ebc");
        ebony_flashsel_fixup();
 }
index 59016bef1391bf6078024d3be2207dc1d531dedc..c541fd8a95d4966369aa79fbc3557122fd7a36d8 100644 (file)
@@ -35,7 +35,7 @@
 #define check_err(err) \
        ({ \
                if (BAD_ERROR(err) || ((err < 0) && DEBUG)) \
-                       printf("%s():%d  %s\n\r", __FUNCTION__, __LINE__, \
+                       printf("%s():%d  %s\n\r", __func__, __LINE__, \
                               fdt_strerror(err)); \
                if (BAD_ERROR(err)) \
                        exit(); \
index 1074626e6a37b24e7295e0aceb26486257f9fcdf..d4cb4e4e0938b049a68f4c2ff5ed5aeb1c09316f 100644 (file)
@@ -51,14 +51,9 @@ static unsigned char psc_getc(void)
 
 int mpc5200_psc_console_init(void *devp, struct serial_console_data *scdp)
 {
-       int n;
-
        /* Get the base address of the psc registers */
-       n = getprop(devp, "virtual-reg", &psc, sizeof(psc));
-       if (n != sizeof(psc)) {
-               if (!dt_xlate_reg(devp, 0, (void *)&psc, NULL))
-                       return -1;
-       }
+       if (dt_get_virtual_reg(devp, &psc, 1) < 1)
+               return -1;
 
        scdp->open = psc_open;
        scdp->putc = psc_putc;
index 802ea53790d8ca7ec4373761fcc8440b17e204f4..425ad88cce8d90a435b22a83876c06b0263716f7 100644 (file)
@@ -141,7 +141,7 @@ int mpsc_console_init(void *devp, struct serial_console_data *scdp)
        if (mpscintr_base == NULL)
                goto err_out;
 
-       n = getprop(devp, "block-index", &v, sizeof(v));
+       n = getprop(devp, "cell-index", &v, sizeof(v));
        if (n != sizeof(v))
                goto err_out;
        reg_set = (int)v;
index b43259455d4b075cd56a3099189ddb37f245fde2..d9bb302b91d28bda1fb6d139ac82714e34220e9b 100644 (file)
@@ -535,7 +535,7 @@ u8 *mv64x60_get_bridge_pbase(void)
        u32 v[2];
        void *devp;
 
-       devp = finddevice("/mv64x60");
+       devp = find_node_by_compatible(NULL, "marvell,mv64360");
        if (devp == NULL)
                goto err_out;
        if (getprop(devp, "reg", v, sizeof(v)) != sizeof(v))
@@ -553,7 +553,7 @@ u8 *mv64x60_get_bridge_base(void)
        u32 v;
        void *devp;
 
-       devp = finddevice("/mv64x60");
+       devp = find_node_by_compatible(NULL, "marvell,mv64360");
        if (devp == NULL)
                goto err_out;
        if (getprop(devp, "virtual-reg", &v, sizeof(v)) != sizeof(v))
index d085377be3bc86ae41de8d6ed4b88d42697004ab..52a3212b6638b51e5cfddc6edc350bc9cd11aa06 100644 (file)
@@ -185,7 +185,7 @@ int mv64x60_i2c_open(void)
        u32 v;
        void *devp;
 
-       devp = finddevice("/mv64x60/i2c");
+       devp = find_node_by_compatible(NULL, "marvell,mv64360-i2c");
        if (devp == NULL)
                goto err_out;
        if (getprop(devp, "virtual-reg", &v, sizeof(v)) != sizeof(v))
index f8f1b2f31412accf4bdfded110af68c813b4a7b7..aef3bdc891605d30e664689bec5d7af43fae54d2 100644 (file)
@@ -55,15 +55,9 @@ static u8 ns16550_tstc(void)
 int ns16550_console_init(void *devp, struct serial_console_data *scdp)
 {
        int n;
-       unsigned long reg_phys;
 
-       n = getprop(devp, "virtual-reg", &reg_base, sizeof(reg_base));
-       if (n != sizeof(reg_base)) {
-               if (!dt_xlate_reg(devp, 0, &reg_phys, NULL))
-                       return -1;
-
-               reg_base = (void *)reg_phys;
-       }
+       if (dt_get_virtual_reg(devp, (void **)&reg_base, 1) < 1)
+               return -1;
 
        n = getprop(devp, "reg-shift", &reg_shift, sizeof(reg_shift));
        if (n != sizeof(reg_shift))
index 4b0544b03c640fb45d8f4aef229c7a019dc7a6ee..321e2f5afe714007443e4c8a39bad2f011c7e04e 100644 (file)
@@ -95,6 +95,7 @@ int dt_xlate_reg(void *node, int res, unsigned long *addr, unsigned long *size);
 int dt_xlate_addr(void *node, u32 *buf, int buflen, unsigned long *xlated_addr);
 int dt_is_compatible(void *node, const char *compat);
 void dt_get_reg_format(void *node, u32 *naddr, u32 *nsize);
+int dt_get_virtual_reg(void *node, void **addr, int nres);
 
 static inline void *finddevice(const char *name)
 {
index 05c3245b30d7472aa9e995b4919e06f3b75aabe0..da31d603048261a4fd31717a74b7bea9d9d0c59e 100644 (file)
@@ -344,20 +344,20 @@ static void prpmc2800_bridge_setup(u32 mem_size)
                        acc_bits);
 
        /* Get the cpu -> pci i/o & mem mappings from the device tree */
-       devp = finddevice("/mv64x60/pci@80000000");
+       devp = find_node_by_compatible(NULL, "marvell,mv64360-pci");
        if (devp == NULL)
-               fatal("Error: Missing /mv64x60/pci@80000000"
+               fatal("Error: Missing marvell,mv64360-pci"
                                " device tree node\n\r");
 
        rc = getprop(devp, "ranges", v, sizeof(v));
        if (rc != sizeof(v))
-               fatal("Error: Can't find /mv64x60/pci@80000000/ranges"
+               fatal("Error: Can't find marvell,mv64360-pci ranges"
                                " property\n\r");
 
        /* Get the cpu -> pci i/o & mem mappings from the device tree */
-       devp = finddevice("/mv64x60");
+       devp = find_node_by_compatible(NULL, "marvell,mv64360");
        if (devp == NULL)
-               fatal("Error: Missing /mv64x60 device tree node\n\r");
+               fatal("Error: Missing marvell,mv64360 device tree node\n\r");
 
        enables = in_le32((u32 *)(bridge_base + MV64x60_CPU_BAR_ENABLE));
        enables |= 0x0007fe00; /* Disable all cpu->pci windows */
@@ -429,9 +429,9 @@ static void prpmc2800_fixups(void)
        setprop(devp, "model", model, l);
 
        /* Set /cpus/PowerPC,7447/clock-frequency */
-       devp = finddevice("/cpus/PowerPC,7447");
+       devp = find_node_by_prop_value_str(NULL, "device_type", "cpu");
        if (devp == NULL)
-               fatal("Error: Missing proper /cpus device tree node\n\r");
+               fatal("Error: Missing proper cpu device tree node\n\r");
        v[0] = bip->core_speed;
        setprop(devp, "clock-frequency", &v[0], sizeof(v[0]));
 
@@ -443,16 +443,17 @@ static void prpmc2800_fixups(void)
        v[1] = bip->mem_size;
        setprop(devp, "reg", v, sizeof(v));
 
-       /* Update /mv64x60/model, if this is a mv64362 */
+       /* Update model, if this is a mv64362 */
        if (bip->bridge_type == BRIDGE_TYPE_MV64362) {
-               devp = finddevice("/mv64x60");
+               devp = find_node_by_compatible(NULL, "marvell,mv64360");
                if (devp == NULL)
-                       fatal("Error: Missing /mv64x60 device tree node\n\r");
+                       fatal("Error: Missing marvell,mv64360"
+                                       " device tree node\n\r");
                setprop(devp, "model", "mv64362", strlen("mv64362") + 1);
        }
 
        /* Set User FLASH size */
-       devp = finddevice("/mv64x60/flash@a0000000");
+       devp = find_node_by_compatible(NULL, "direct-mapped");
        if (devp == NULL)
                fatal("Error: Missing User FLASH device tree node\n\r");
        rc = getprop(devp, "reg", v, sizeof(v));
index a55c2735f759040dd713f9fe56d33d280554c892..b6fcbaf5027bedc23c6da663b79453b08f5be4f2 100644 (file)
@@ -27,8 +27,9 @@
 /*
  * __system_reset_overlay - The PS3 first stage entry.
  *
- * The bootwraper build script copies the 0x100 bytes at symbol
- * __system_reset_overlay to offset 0x100 of the rom image.
+ * The bootwraper build script copies the 512 bytes at symbol
+ * __system_reset_overlay to offset 0x100 of the rom image.  This symbol
+ * must occupy 512 or less bytes.
  *
  * The PS3 has a single processor with two threads.
  */
@@ -47,8 +48,6 @@ __system_reset_overlay:
 
        mfspr   r3, 0x88
        cntlzw. r3, r3
-       li      r4, 0
-       li      r5, 0
        beq     1f
 
        /* Secondary goes to __secondary_hold in kernel. */
@@ -57,8 +56,14 @@ __system_reset_overlay:
        mtctr   r4
        bctr
 
-       /* Primary delays then goes to _zimage_start in wrapper. */
 1:
+       /* Save the value at addr zero for a null pointer write check later. */
+
+       li      r4, 0
+       lwz     r3, 0(r4)
+
+       /* Primary delays then goes to _zimage_start in wrapper. */
+
        or      31, 31, 31 /* db16cyc */
        or      31, 31, 31 /* db16cyc */
 
@@ -67,16 +72,18 @@ __system_reset_overlay:
        mtctr   r4
        bctr
 
+       . = __system_reset_overlay + 512
+
 /*
  * __system_reset_kernel - Place holder for the kernel reset vector.
  *
- * The bootwrapper build script copies 0x100 bytes from offset 0x100
+ * The bootwrapper build script copies 512 bytes from offset 0x100
  * of the rom image to the symbol __system_reset_kernel.  At runtime
- * the bootwrapper program copies the 0x100 bytes at __system_reset_kernel
- * to ram address 0x100.  This symbol must occupy 0x100 bytes.
+ * the bootwrapper program copies the 512 bytes at __system_reset_kernel
+ * to ram address 0x100.  This symbol must occupy 512 bytes.
  */
 
        .globl __system_reset_kernel
 __system_reset_kernel:
 
-       . = __system_reset_kernel + 0x100
+       . = __system_reset_kernel + 512
index 3b0ac4d006ec857385e04e873487577b549ac6e5..9954d98871d061dfc9abb8c33fefcbbe00d8d2ea 100644 (file)
 #include "page.h"
 #include "ops.h"
 
-extern s64 lv1_panic(u64 in_1);
-extern s64 lv1_get_logical_partition_id(u64 *out_1);
-extern s64 lv1_get_logical_ppe_id(u64 *out_1);
-extern s64 lv1_get_repository_node_value(u64 in_1, u64 in_2, u64 in_3,
+extern int lv1_panic(u64 in_1);
+extern int lv1_get_logical_partition_id(u64 *out_1);
+extern int lv1_get_logical_ppe_id(u64 *out_1);
+extern int lv1_get_repository_node_value(u64 in_1, u64 in_2, u64 in_3,
        u64 in_4, u64 in_5, u64 *out_1, u64 *out_2);
 
 #ifdef DEBUG
@@ -46,6 +46,7 @@ BSS_STACK(4096);
  * edit the command line passed to vmlinux (by setting /chosen/bootargs).
  * The buffer is put in it's own section so that tools may locate it easier.
  */
+
 static char cmdline[COMMAND_LINE_SIZE]
        __attribute__((__section__("__builtin_cmdline")));
 
@@ -75,7 +76,7 @@ static void ps3_exit(void)
 
 static int ps3_repository_read_rm_size(u64 *rm_size)
 {
-       s64 result;
+       int result;
        u64 lpar_id;
        u64 ppe_id;
        u64 v2;
@@ -114,16 +115,17 @@ void ps3_copy_vectors(void)
 {
        extern char __system_reset_kernel[];
 
-       memcpy((void *)0x100, __system_reset_kernel, 0x100);
-       flush_cache((void *)0x100, 0x100);
+       memcpy((void *)0x100, __system_reset_kernel, 512);
+       flush_cache((void *)0x100, 512);
 }
 
-void platform_init(void)
+void platform_init(unsigned long null_check)
 {
        const u32 heapsize = 0x1000000 - (u32)_end; /* 16MiB */
        void *chosen;
        unsigned long ft_addr;
        u64 rm_size;
+       unsigned long val;
 
        console_ops.write = ps3_console_write;
        platform_ops.exit = ps3_exit;
@@ -151,6 +153,11 @@ void platform_init(void)
 
        printf(" flat tree at 0x%lx\n\r", ft_addr);
 
+       val = *(unsigned long *)0;
+
+       if (val != null_check)
+               printf("null check failed: %lx != %lx\n\r", val, null_check);
+
        ((kernel_entry_t)0)(ft_addr, 0, NULL);
 
        ps3_exit();
index 9960421eb6b9e08b418105b4577846fd49b4adac..8b3607cb53fb158075a41d5af9845eb1b2bc9e32 100644 (file)
@@ -119,7 +119,7 @@ int serial_console_init(void)
 
        if (dt_is_compatible(devp, "ns16550"))
                rc = ns16550_console_init(devp, &serial_cd);
-       else if (dt_is_compatible(devp, "marvell,mpsc"))
+       else if (dt_is_compatible(devp, "marvell,mv64360-mpsc"))
                rc = mpsc_console_init(devp, &serial_cd);
        else if (dt_is_compatible(devp, "fsl,cpm1-scc-uart") ||
                 dt_is_compatible(devp, "fsl,cpm1-smc-uart") ||
diff --git a/arch/powerpc/boot/simpleboot.c b/arch/powerpc/boot/simpleboot.c
new file mode 100644 (file)
index 0000000..86cd285
--- /dev/null
@@ -0,0 +1,84 @@
+/*
+ * The simple platform -- for booting when firmware doesn't supply a device
+ *                        tree or any platform configuration information.
+ *                        All data is extracted from an embedded device tree
+ *                        blob.
+ *
+ * Authors: Scott Wood <scottwood@freescale.com>
+ *          Grant Likely <grant.likely@secretlab.ca>
+ *
+ * Copyright (c) 2007 Freescale Semiconductor, Inc.
+ * Copyright (c) 2008 Secret Lab Technologies Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published
+ * by the Free Software Foundation.
+ */
+
+#include "ops.h"
+#include "types.h"
+#include "io.h"
+#include "stdio.h"
+#include "libfdt/libfdt.h"
+
+BSS_STACK(4*1024);
+
+void platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
+                  unsigned long r6, unsigned long r7)
+{
+       const u32 *na, *ns, *reg, *timebase;
+       u64 memsize64;
+       int node, size, i;
+
+       /* Make sure FDT blob is sane */
+       if (fdt_check_header(_dtb_start) != 0)
+               fatal("Invalid device tree blob\n");
+
+       /* Find the #address-cells and #size-cells properties */
+       node = fdt_path_offset(_dtb_start, "/");
+       if (node < 0)
+               fatal("Cannot find root node\n");
+       na = fdt_getprop(_dtb_start, node, "#address-cells", &size);
+       if (!na || (size != 4))
+               fatal("Cannot find #address-cells property");
+       ns = fdt_getprop(_dtb_start, node, "#size-cells", &size);
+       if (!ns || (size != 4))
+               fatal("Cannot find #size-cells property");
+
+       /* Find the memory range */
+       node = fdt_node_offset_by_prop_value(_dtb_start, -1, "device_type",
+                                            "memory", sizeof("memory"));
+       if (node < 0)
+               fatal("Cannot find memory node\n");
+       reg = fdt_getprop(_dtb_start, node, "reg", &size);
+       if (size < (*na+*ns) * sizeof(u32))
+               fatal("cannot get memory range\n");
+
+       /* Only interested in memory based at 0 */
+       for (i = 0; i < *na; i++)
+               if (*reg++ != 0)
+                       fatal("Memory range is not based at address 0\n");
+
+       /* get the memsize and trucate it to under 4G on 32 bit machines */
+       memsize64 = 0;
+       for (i = 0; i < *ns; i++)
+               memsize64 = (memsize64 << 32) | *reg++;
+       if (sizeof(void *) == 4 && memsize64 >= 0x100000000ULL)
+               memsize64 = 0xffffffff;
+
+       /* finally, setup the timebase */
+       node = fdt_node_offset_by_prop_value(_dtb_start, -1, "device_type",
+                                            "cpu", sizeof("cpu"));
+       if (!node)
+               fatal("Cannot find cpu node\n");
+       timebase = fdt_getprop(_dtb_start, node, "timebase-frequency", &size);
+       if (timebase && (size == 4))
+               timebase_period_ns = 1000000000 / *timebase;
+
+       /* Now we have the memory size; initialize the heap */
+       simple_alloc_init(_end, memsize64 - (unsigned long)_end, 32, 64);
+
+       /* prepare the device tree and find the console */
+       fdt_init(_dtb_start);
+       serial_console_init();
+}
index 472e36605a52672f5ccd03ce4744ef720e276b4d..097974e59faced80a623d24a8eadd001e81c062a 100644 (file)
@@ -68,7 +68,7 @@ static void walnut_fixups(void)
        ibm4xx_quiesce_eth((u32 *)0xef600800, NULL);
        ibm4xx_fixup_ebc_ranges("/plb/ebc");
        walnut_flashsel_fixup();
-       dt_fixup_mac_addresses((u8 *) WALNUT_OPENBIOS_MAC_OFF);
+       dt_fixup_mac_address_by_alias("ethernet0", (u8 *) WALNUT_OPENBIOS_MAC_OFF);
 }
 
 void platform_init(void)
diff --git a/arch/powerpc/boot/virtex405-head.S b/arch/powerpc/boot/virtex405-head.S
new file mode 100644 (file)
index 0000000..3edb13f
--- /dev/null
@@ -0,0 +1,30 @@
+#include "ppc_asm.h"
+
+       .text
+       .global _zimage_start
+_zimage_start:
+
+       /* PPC errata 213: needed by Virtex-4 FX */
+       mfccr0  0
+       oris    0,0,0x50000000@h
+       mtccr0  0
+
+       /*
+        * Invalidate the data cache if the data cache is turned off.
+        * - The 405 core does not invalidate the data cache on power-up
+        *   or reset but does turn off the data cache. We cannot assume
+        *   that the cache contents are valid.
+        * - If the data cache is turned on this must have been done by
+        *   a bootloader and we assume that the cache contents are
+        *   valid.
+        */
+       mfdccr  r9
+       cmplwi  r9,0
+       bne     2f
+       lis     r9,0
+       li      r8,256
+       mtctr   r8
+1:     dccci   r0,r9
+       addi    r9,r9,0x20
+       bdnz    1b
+2:     b       _zimage_start_lib
index 8f8b8494d62f8c6eb4c2a9b17ca16fc22a66f852..d6c96d9ab29177513788e06ead0dddc45e8f3501 100755 (executable)
@@ -174,7 +174,7 @@ cuboot*)
     *-mpc83*)
         platformo=$object/cuboot-83xx.o
         ;;
-    *-tqm8541|*-mpc8560*|*-tqm8560|*-tqm8555)
+    *-tqm8541|*-mpc8560*|*-tqm8560|*-tqm8555|*-ksi8560*)
         platformo=$object/cuboot-85xx-cpm2.o
         ;;
     *-mpc85*|*-tqm8540|*-sbc85*)
@@ -199,6 +199,10 @@ adder875-redboot)
     platformo="$object/fixed-head.o $object/redboot-8xx.o"
     binary=y
     ;;
+simpleboot-virtex405-*)
+    platformo="$object/virtex405-head.o $object/simpleboot.o"
+    binary=y
+    ;;
 esac
 
 vmz="$tmpdir/`basename \"$kernel\"`.$ext"
@@ -226,10 +230,13 @@ if [ -n "$version" ]; then
     uboot_version="-n Linux-$version"
 fi
 
+# physical offset of kernel image
+membase=`${CROSS}objdump -p "$kernel" | grep -m 1 LOAD | awk '{print $7}'`
+
 case "$platform" in
 uboot)
     rm -f "$ofile"
-    mkimage -A ppc -O linux -T kernel -C gzip -a 00000000 -e 00000000 \
+    mkimage -A ppc -O linux -T kernel -C gzip -a $membase -e $membase \
        $uboot_version -d "$vmz" "$ofile"
     if [ -z "$cacheit" ]; then
        rm -f "$vmz"
@@ -298,15 +305,16 @@ treeboot*)
     exit 0
     ;;
 ps3)
-    # The ps3's loader supports loading gzipped binary images from flash
-    # rom to addr zero. The loader enters the image at addr 0x100.  A
-    # bootwrapper overlay is use to arrange for the kernel to be loaded
-    # to addr zero and to have a suitable bootwrapper entry at 0x100.
-    # To construct the rom image, 0x100 bytes from offset 0x100 in the
-    # kernel is copied to the bootwrapper symbol __system_reset_kernel.
-    # The 0x100 bytes at the bootwrapper symbol __system_reset_overlay is
-    # then copied to offset 0x100.  At runtime the bootwrapper program
-    # copies the 0x100 bytes at __system_reset_kernel to addr 0x100.
+    # The ps3's loader supports loading a gzipped binary image from flash
+    # rom to ram addr zero. The loader then enters the system reset
+    # vector at addr 0x100.  A bootwrapper overlay is used to arrange for
+    # a binary image of the kernel to be at addr zero, and yet have a
+    # suitable bootwrapper entry at 0x100.  To construct the final rom
+    # image 512 bytes from offset 0x100 is copied to the bootwrapper
+    # place holder at symbol __system_reset_kernel.  The 512 bytes of the
+    # bootwrapper entry code at symbol __system_reset_overlay is then
+    # copied to offset 0x100.  At runtime the bootwrapper program copies
+    # the data at __system_reset_kernel back to addr 0x100.
 
     system_reset_overlay=0x`${CROSS}nm "$ofile" \
         | grep ' __system_reset_overlay$'       \
@@ -317,7 +325,7 @@ ps3)
         | cut -d' ' -f1`
     system_reset_kernel=`printf "%d" $system_reset_kernel`
     overlay_dest="256"
-    overlay_size="256"
+    overlay_size="512"
 
     ${CROSS}objcopy -O binary "$ofile" "$ofile.bin"
 
diff --git a/arch/powerpc/configs/44x/canyonlands_defconfig b/arch/powerpc/configs/44x/canyonlands_defconfig
new file mode 100644 (file)
index 0000000..a3b763c
--- /dev/null
@@ -0,0 +1,721 @@
+#
+# Automatically generated make config: don't edit
+# Linux kernel version: 2.6.25-rc1
+# Thu Feb 21 14:29:28 2008
+#
+# CONFIG_PPC64 is not set
+
+#
+# Processor support
+#
+# CONFIG_6xx is not set
+# CONFIG_PPC_85xx is not set
+# CONFIG_PPC_8xx is not set
+# CONFIG_40x is not set
+CONFIG_44x=y
+# CONFIG_E200 is not set
+CONFIG_PPC_FPU=y
+CONFIG_4xx=y
+CONFIG_BOOKE=y
+CONFIG_PTE_64BIT=y
+CONFIG_PHYS_64BIT=y
+# CONFIG_PPC_MM_SLICES is not set
+CONFIG_NOT_COHERENT_CACHE=y
+CONFIG_PPC32=y
+CONFIG_WORD_SIZE=32
+CONFIG_PPC_MERGE=y
+CONFIG_MMU=y
+CONFIG_GENERIC_CMOS_UPDATE=y
+CONFIG_GENERIC_TIME=y
+CONFIG_GENERIC_TIME_VSYSCALL=y
+CONFIG_GENERIC_CLOCKEVENTS=y
+CONFIG_GENERIC_HARDIRQS=y
+# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
+CONFIG_IRQ_PER_CPU=y
+CONFIG_RWSEM_XCHGADD_ALGORITHM=y
+CONFIG_ARCH_HAS_ILOG2_U32=y
+CONFIG_GENERIC_HWEIGHT=y
+CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_GENERIC_FIND_NEXT_BIT=y
+# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
+CONFIG_PPC=y
+CONFIG_EARLY_PRINTK=y
+CONFIG_GENERIC_NVRAM=y
+CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
+CONFIG_ARCH_MAY_HAVE_PC_FDC=y
+CONFIG_PPC_OF=y
+CONFIG_OF=y
+CONFIG_PPC_UDBG_16550=y
+# CONFIG_GENERIC_TBSYNC is not set
+CONFIG_AUDIT_ARCH=y
+CONFIG_GENERIC_BUG=y
+# CONFIG_DEFAULT_UIMAGE is not set
+CONFIG_PPC_DCR_NATIVE=y
+# CONFIG_PPC_DCR_MMIO is not set
+CONFIG_PPC_DCR=y
+CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
+
+#
+# General setup
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_BROKEN_ON_SMP=y
+CONFIG_INIT_ENV_ARG_LIMIT=32
+CONFIG_LOCALVERSION=""
+CONFIG_LOCALVERSION_AUTO=y
+CONFIG_SWAP=y
+CONFIG_SYSVIPC=y
+CONFIG_SYSVIPC_SYSCTL=y
+CONFIG_POSIX_MQUEUE=y
+# CONFIG_BSD_PROCESS_ACCT is not set
+# CONFIG_TASKSTATS is not set
+# CONFIG_AUDIT is not set
+# CONFIG_IKCONFIG is not set
+CONFIG_LOG_BUF_SHIFT=14
+# CONFIG_CGROUPS is not set
+# CONFIG_FAIR_GROUP_SCHED is not set
+CONFIG_SYSFS_DEPRECATED=y
+# CONFIG_RELAY is not set
+# CONFIG_NAMESPACES is not set
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_INITRAMFS_SOURCE=""
+# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
+CONFIG_SYSCTL=y
+CONFIG_EMBEDDED=y
+CONFIG_SYSCTL_SYSCALL=y
+CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_ALL is not set
+# CONFIG_KALLSYMS_EXTRA_PASS is not set
+CONFIG_HOTPLUG=y
+CONFIG_PRINTK=y
+# CONFIG_LOGBUFFER is not set
+CONFIG_BUG=y
+CONFIG_ELF_CORE=y
+CONFIG_COMPAT_BRK=y
+CONFIG_BASE_FULL=y
+CONFIG_FUTEX=y
+CONFIG_ANON_INODES=y
+CONFIG_EPOLL=y
+CONFIG_SIGNALFD=y
+CONFIG_TIMERFD=y
+CONFIG_EVENTFD=y
+CONFIG_SHMEM=y
+CONFIG_VM_EVENT_COUNTERS=y
+CONFIG_SLUB_DEBUG=y
+# CONFIG_SLAB is not set
+CONFIG_SLUB=y
+# CONFIG_SLOB is not set
+# CONFIG_PROFILING is not set
+# CONFIG_MARKERS is not set
+CONFIG_HAVE_OPROFILE=y
+# CONFIG_KPROBES is not set
+CONFIG_HAVE_KPROBES=y
+CONFIG_PROC_PAGE_MONITOR=y
+CONFIG_SLABINFO=y
+CONFIG_RT_MUTEXES=y
+# CONFIG_TINY_SHMEM is not set
+CONFIG_BASE_SMALL=0
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+# CONFIG_MODULE_FORCE_UNLOAD is not set
+# CONFIG_MODVERSIONS is not set
+# CONFIG_MODULE_SRCVERSION_ALL is not set
+CONFIG_KMOD=y
+CONFIG_BLOCK=y
+CONFIG_LBD=y
+# CONFIG_BLK_DEV_IO_TRACE is not set
+# CONFIG_LSF is not set
+# CONFIG_BLK_DEV_BSG is not set
+
+#
+# IO Schedulers
+#
+CONFIG_IOSCHED_NOOP=y
+CONFIG_IOSCHED_AS=y
+CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
+CONFIG_DEFAULT_AS=y
+# CONFIG_DEFAULT_DEADLINE is not set
+# CONFIG_DEFAULT_CFQ is not set
+# CONFIG_DEFAULT_NOOP is not set
+CONFIG_DEFAULT_IOSCHED="anticipatory"
+CONFIG_CLASSIC_RCU=y
+# CONFIG_PREEMPT_RCU is not set
+CONFIG_PPC4xx_PCI_EXPRESS=y
+
+#
+# Platform support
+#
+# CONFIG_PPC_MPC512x is not set
+# CONFIG_PPC_MPC5121 is not set
+# CONFIG_PPC_CELL is not set
+# CONFIG_PPC_CELL_NATIVE is not set
+# CONFIG_PQ2ADS is not set
+# CONFIG_BAMBOO is not set
+# CONFIG_EBONY is not set
+# CONFIG_SEQUOIA is not set
+# CONFIG_TAISHAN is not set
+# CONFIG_KATMAI is not set
+# CONFIG_RAINIER is not set
+# CONFIG_WARP is not set
+CONFIG_CANYONLANDS=y
+CONFIG_460EX=y
+# CONFIG_IPIC is not set
+# CONFIG_MPIC is not set
+# CONFIG_MPIC_WEIRD is not set
+# CONFIG_PPC_I8259 is not set
+# CONFIG_PPC_RTAS is not set
+# CONFIG_MMIO_NVRAM is not set
+# CONFIG_PPC_MPC106 is not set
+# CONFIG_PPC_970_NAP is not set
+# CONFIG_PPC_INDIRECT_IO is not set
+# CONFIG_GENERIC_IOMAP is not set
+# CONFIG_CPU_FREQ is not set
+# CONFIG_FSL_ULI1575 is not set
+
+#
+# Kernel options
+#
+# CONFIG_HIGHMEM is not set
+CONFIG_TICK_ONESHOT=y
+CONFIG_NO_HZ=y
+CONFIG_HIGH_RES_TIMERS=y
+CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
+# CONFIG_HZ_100 is not set
+CONFIG_HZ_250=y
+# CONFIG_HZ_300 is not set
+# CONFIG_HZ_1000 is not set
+CONFIG_HZ=250
+# CONFIG_SCHED_HRTICK is not set
+CONFIG_PREEMPT_NONE=y
+# CONFIG_PREEMPT_VOLUNTARY is not set
+# CONFIG_PREEMPT is not set
+CONFIG_RCU_TRACE=y
+CONFIG_BINFMT_ELF=y
+# CONFIG_BINFMT_MISC is not set
+# CONFIG_MATH_EMULATION is not set
+# CONFIG_IOMMU_HELPER is not set
+CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
+CONFIG_ARCH_HAS_WALK_MEMORY=y
+CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
+CONFIG_ARCH_FLATMEM_ENABLE=y
+CONFIG_ARCH_POPULATES_NODE_MAP=y
+CONFIG_SELECT_MEMORY_MODEL=y
+CONFIG_FLATMEM_MANUAL=y
+# CONFIG_DISCONTIGMEM_MANUAL is not set
+# CONFIG_SPARSEMEM_MANUAL is not set
+CONFIG_FLATMEM=y
+CONFIG_FLAT_NODE_MEM_MAP=y
+# CONFIG_SPARSEMEM_STATIC is not set
+# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
+CONFIG_SPLIT_PTLOCK_CPUS=4
+CONFIG_RESOURCES_64BIT=y
+CONFIG_ZONE_DMA_FLAG=1
+CONFIG_BOUNCE=y
+CONFIG_VIRT_TO_BUS=y
+CONFIG_PROC_DEVICETREE=y
+CONFIG_CMDLINE_BOOL=y
+CONFIG_CMDLINE=""
+CONFIG_SECCOMP=y
+CONFIG_WANT_DEVICE_TREE=y
+CONFIG_ISA_DMA_API=y
+
+#
+# Bus options
+#
+CONFIG_ZONE_DMA=y
+CONFIG_PPC_INDIRECT_PCI=y
+CONFIG_PCI=y
+CONFIG_PCI_DOMAINS=y
+CONFIG_PCI_SYSCALL=y
+# CONFIG_PCIEPORTBUS is not set
+CONFIG_ARCH_SUPPORTS_MSI=y
+# CONFIG_PCI_MSI is not set
+CONFIG_PCI_LEGACY=y
+# CONFIG_PCI_DEBUG is not set
+# CONFIG_PCCARD is not set
+# CONFIG_HOTPLUG_PCI is not set
+
+#
+# Advanced setup
+#
+# CONFIG_ADVANCED_OPTIONS is not set
+
+#
+# Default settings for advanced configuration options are used
+#
+CONFIG_HIGHMEM_START=0xfe000000
+CONFIG_LOWMEM_SIZE=0x30000000
+CONFIG_KERNEL_START=0xc0000000
+CONFIG_TASK_SIZE=0xc0000000
+CONFIG_CONSISTENT_START=0xff100000
+CONFIG_CONSISTENT_SIZE=0x00200000
+CONFIG_BOOT_LOAD=0x01000000
+
+#
+# Networking
+#
+CONFIG_NET=y
+
+#
+# Networking options
+#
+CONFIG_PACKET=y
+# CONFIG_PACKET_MMAP is not set
+CONFIG_UNIX=y
+# CONFIG_NET_KEY is not set
+CONFIG_INET=y
+# CONFIG_IP_MULTICAST is not set
+# CONFIG_IP_ADVANCED_ROUTER is not set
+CONFIG_IP_FIB_HASH=y
+CONFIG_IP_PNP=y
+CONFIG_IP_PNP_DHCP=y
+CONFIG_IP_PNP_BOOTP=y
+# CONFIG_IP_PNP_RARP is not set
+# CONFIG_NET_IPIP is not set
+# CONFIG_NET_IPGRE is not set
+# CONFIG_ARPD is not set
+# CONFIG_SYN_COOKIES is not set
+# CONFIG_INET_AH is not set
+# CONFIG_INET_ESP is not set
+# CONFIG_INET_IPCOMP is not set
+# CONFIG_INET_XFRM_TUNNEL is not set
+# CONFIG_INET_TUNNEL is not set
+# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
+# CONFIG_INET_XFRM_MODE_TUNNEL is not set
+# CONFIG_INET_XFRM_MODE_BEET is not set
+# CONFIG_INET_LRO is not set
+CONFIG_INET_DIAG=y
+CONFIG_INET_TCP_DIAG=y
+# CONFIG_TCP_CONG_ADVANCED is not set
+CONFIG_TCP_CONG_CUBIC=y
+CONFIG_DEFAULT_TCP_CONG="cubic"
+# CONFIG_TCP_MD5SIG is not set
+# CONFIG_IPV6 is not set
+# CONFIG_INET6_XFRM_TUNNEL is not set
+# CONFIG_INET6_TUNNEL is not set
+# CONFIG_NETWORK_SECMARK is not set
+# CONFIG_NETFILTER is not set
+# CONFIG_IP_DCCP is not set
+# CONFIG_IP_SCTP is not set
+# CONFIG_TIPC is not set
+# CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
+# CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
+# CONFIG_LLC2 is not set
+# CONFIG_IPX is not set
+# CONFIG_ATALK is not set
+# CONFIG_X25 is not set
+# CONFIG_LAPB is not set
+# CONFIG_ECONET is not set
+# CONFIG_WAN_ROUTER is not set
+# CONFIG_NET_SCHED is not set
+
+#
+# Network testing
+#
+# CONFIG_NET_PKTGEN is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_CAN is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
+# CONFIG_AF_RXRPC is not set
+
+#
+# Wireless
+#
+# CONFIG_CFG80211 is not set
+# CONFIG_WIRELESS_EXT is not set
+# CONFIG_MAC80211 is not set
+# CONFIG_IEEE80211 is not set
+# CONFIG_RFKILL is not set
+# CONFIG_NET_9P is not set
+
+#
+# Device Drivers
+#
+
+#
+# Generic Driver Options
+#
+CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
+CONFIG_STANDALONE=y
+CONFIG_PREVENT_FIRMWARE_BUILD=y
+CONFIG_FW_LOADER=y
+# CONFIG_DEBUG_DRIVER is not set
+# CONFIG_DEBUG_DEVRES is not set
+# CONFIG_SYS_HYPERVISOR is not set
+CONFIG_CONNECTOR=y
+CONFIG_PROC_EVENTS=y
+# CONFIG_MTD is not set
+CONFIG_OF_DEVICE=y
+# CONFIG_PARPORT is not set
+CONFIG_BLK_DEV=y
+# CONFIG_BLK_DEV_FD is not set
+# CONFIG_BLK_CPQ_DA is not set
+# CONFIG_BLK_CPQ_CISS_DA is not set
+# CONFIG_BLK_DEV_DAC960 is not set
+# CONFIG_BLK_DEV_UMEM is not set
+# CONFIG_BLK_DEV_COW_COMMON is not set
+# CONFIG_BLK_DEV_LOOP is not set
+# CONFIG_BLK_DEV_NBD is not set
+# CONFIG_BLK_DEV_SX8 is not set
+CONFIG_BLK_DEV_RAM=y
+CONFIG_BLK_DEV_RAM_COUNT=16
+CONFIG_BLK_DEV_RAM_SIZE=35000
+# CONFIG_BLK_DEV_XIP is not set
+# CONFIG_CDROM_PKTCDVD is not set
+# CONFIG_ATA_OVER_ETH is not set
+# CONFIG_XILINX_SYSACE is not set
+# CONFIG_MISC_DEVICES is not set
+CONFIG_HAVE_IDE=y
+# CONFIG_IDE is not set
+
+#
+# SCSI device support
+#
+# CONFIG_RAID_ATTRS is not set
+# CONFIG_SCSI is not set
+# CONFIG_SCSI_DMA is not set
+# CONFIG_SCSI_NETLINK is not set
+# CONFIG_ATA is not set
+# CONFIG_MD is not set
+# CONFIG_FUSION is not set
+
+#
+# IEEE 1394 (FireWire) support
+#
+# CONFIG_FIREWIRE is not set
+# CONFIG_IEEE1394 is not set
+# CONFIG_I2O is not set
+# CONFIG_MACINTOSH_DRIVERS is not set
+CONFIG_NETDEVICES=y
+# CONFIG_NETDEVICES_MULTIQUEUE is not set
+# CONFIG_DUMMY is not set
+# CONFIG_BONDING is not set
+# CONFIG_MACVLAN is not set
+# CONFIG_EQUALIZER is not set
+# CONFIG_TUN is not set
+# CONFIG_VETH is not set
+# CONFIG_ARCNET is not set
+# CONFIG_PHYLIB is not set
+CONFIG_NET_ETHERNET=y
+# CONFIG_MII is not set
+# CONFIG_HAPPYMEAL is not set
+# CONFIG_SUNGEM is not set
+# CONFIG_CASSINI is not set
+# CONFIG_NET_VENDOR_3COM is not set
+# CONFIG_NET_TULIP is not set
+# CONFIG_HP100 is not set
+CONFIG_IBM_NEW_EMAC=y
+CONFIG_IBM_NEW_EMAC_RXB=256
+CONFIG_IBM_NEW_EMAC_TXB=256
+CONFIG_IBM_NEW_EMAC_POLL_WEIGHT=32
+CONFIG_IBM_NEW_EMAC_RX_COPY_THRESHOLD=256
+CONFIG_IBM_NEW_EMAC_RX_SKB_HEADROOM=0
+# CONFIG_IBM_NEW_EMAC_DEBUG is not set
+CONFIG_IBM_NEW_EMAC_ZMII=y
+CONFIG_IBM_NEW_EMAC_RGMII=y
+CONFIG_IBM_NEW_EMAC_TAH=y
+CONFIG_IBM_NEW_EMAC_EMAC4=y
+# CONFIG_NET_PCI is not set
+# CONFIG_B44 is not set
+# CONFIG_NETDEV_1000 is not set
+# CONFIG_NETDEV_10000 is not set
+# CONFIG_TR is not set
+
+#
+# Wireless LAN
+#
+# CONFIG_WLAN_PRE80211 is not set
+# CONFIG_WLAN_80211 is not set
+# CONFIG_WAN is not set
+# CONFIG_FDDI is not set
+# CONFIG_HIPPI is not set
+# CONFIG_PPP is not set
+# CONFIG_SLIP is not set
+# CONFIG_NETCONSOLE is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_ISDN is not set
+# CONFIG_PHONE is not set
+
+#
+# Input device support
+#
+# CONFIG_INPUT is not set
+
+#
+# Hardware I/O ports
+#
+# CONFIG_SERIO is not set
+# CONFIG_GAMEPORT is not set
+
+#
+# Character devices
+#
+# CONFIG_VT is not set
+# CONFIG_SERIAL_NONSTANDARD is not set
+# CONFIG_NOZOMI is not set
+
+#
+# Serial drivers
+#
+CONFIG_SERIAL_8250=y
+CONFIG_SERIAL_8250_CONSOLE=y
+# CONFIG_SERIAL_8250_PCI is not set
+CONFIG_SERIAL_8250_NR_UARTS=4
+CONFIG_SERIAL_8250_RUNTIME_UARTS=4
+CONFIG_SERIAL_8250_EXTENDED=y
+# CONFIG_SERIAL_8250_MANY_PORTS is not set
+CONFIG_SERIAL_8250_SHARE_IRQ=y
+# CONFIG_SERIAL_8250_DETECT_IRQ is not set
+# CONFIG_SERIAL_8250_RSA is not set
+
+#
+# Non-8250 serial port support
+#
+# CONFIG_SERIAL_UARTLITE is not set
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+# CONFIG_SERIAL_JSM is not set
+CONFIG_SERIAL_OF_PLATFORM=y
+CONFIG_UNIX98_PTYS=y
+CONFIG_LEGACY_PTYS=y
+CONFIG_LEGACY_PTY_COUNT=256
+# CONFIG_IPMI_HANDLER is not set
+# CONFIG_HW_RANDOM is not set
+# CONFIG_NVRAM is not set
+# CONFIG_GEN_RTC is not set
+# CONFIG_R3964 is not set
+# CONFIG_APPLICOM is not set
+# CONFIG_RAW_DRIVER is not set
+# CONFIG_TCG_TPM is not set
+CONFIG_DEVPORT=y
+# CONFIG_I2C is not set
+
+#
+# SPI support
+#
+# CONFIG_SPI is not set
+# CONFIG_SPI_MASTER is not set
+# CONFIG_W1 is not set
+# CONFIG_POWER_SUPPLY is not set
+# CONFIG_HWMON is not set
+# CONFIG_THERMAL is not set
+# CONFIG_WATCHDOG is not set
+
+#
+# Sonics Silicon Backplane
+#
+CONFIG_SSB_POSSIBLE=y
+# CONFIG_SSB is not set
+
+#
+# Multifunction device drivers
+#
+# CONFIG_MFD_SM501 is not set
+
+#
+# Multimedia devices
+#
+# CONFIG_VIDEO_DEV is not set
+# CONFIG_DVB_CORE is not set
+CONFIG_DAB=y
+
+#
+# Graphics support
+#
+# CONFIG_AGP is not set
+# CONFIG_DRM is not set
+# CONFIG_VGASTATE is not set
+CONFIG_VIDEO_OUTPUT_CONTROL=m
+# CONFIG_FB is not set
+# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
+
+#
+# Display device support
+#
+# CONFIG_DISPLAY_SUPPORT is not set
+
+#
+# Sound
+#
+# CONFIG_SOUND is not set
+# CONFIG_USB_SUPPORT is not set
+# CONFIG_MMC is not set
+# CONFIG_MEMSTICK is not set
+# CONFIG_NEW_LEDS is not set
+# CONFIG_INFINIBAND is not set
+# CONFIG_EDAC is not set
+# CONFIG_RTC_CLASS is not set
+
+#
+# Userspace I/O
+#
+# CONFIG_UIO is not set
+
+#
+# File systems
+#
+CONFIG_EXT2_FS=y
+# CONFIG_EXT2_FS_XATTR is not set
+# CONFIG_EXT2_FS_XIP is not set
+# CONFIG_EXT3_FS is not set
+# CONFIG_EXT4DEV_FS is not set
+# CONFIG_REISERFS_FS is not set
+# CONFIG_JFS_FS is not set
+# CONFIG_FS_POSIX_ACL is not set
+# CONFIG_XFS_FS is not set
+# CONFIG_GFS2_FS is not set
+# CONFIG_OCFS2_FS is not set
+CONFIG_DNOTIFY=y
+CONFIG_INOTIFY=y
+CONFIG_INOTIFY_USER=y
+# CONFIG_QUOTA is not set
+# CONFIG_AUTOFS_FS is not set
+# CONFIG_AUTOFS4_FS is not set
+# CONFIG_FUSE_FS is not set
+
+#
+# CD-ROM/DVD Filesystems
+#
+# CONFIG_ISO9660_FS is not set
+# CONFIG_UDF_FS is not set
+
+#
+# DOS/FAT/NT Filesystems
+#
+# CONFIG_MSDOS_FS is not set
+# CONFIG_VFAT_FS is not set
+# CONFIG_NTFS_FS is not set
+
+#
+# Pseudo filesystems
+#
+CONFIG_PROC_FS=y
+CONFIG_PROC_KCORE=y
+CONFIG_PROC_SYSCTL=y
+CONFIG_SYSFS=y
+CONFIG_TMPFS=y
+# CONFIG_TMPFS_POSIX_ACL is not set
+# CONFIG_HUGETLB_PAGE is not set
+# CONFIG_CONFIGFS_FS is not set
+
+#
+# Miscellaneous filesystems
+#
+# CONFIG_ADFS_FS is not set
+# CONFIG_AFFS_FS is not set
+# CONFIG_HFS_FS is not set
+# CONFIG_HFSPLUS_FS is not set
+# CONFIG_BEFS_FS is not set
+# CONFIG_BFS_FS is not set
+# CONFIG_EFS_FS is not set
+CONFIG_CRAMFS=y
+# CONFIG_VXFS_FS is not set
+# CONFIG_MINIX_FS is not set
+# CONFIG_HPFS_FS is not set
+# CONFIG_QNX4FS_FS is not set
+# CONFIG_ROMFS_FS is not set
+# CONFIG_SYSV_FS is not set
+# CONFIG_UFS_FS is not set
+CONFIG_NETWORK_FILESYSTEMS=y
+CONFIG_NFS_FS=y
+CONFIG_NFS_V3=y
+# CONFIG_NFS_V3_ACL is not set
+# CONFIG_NFS_V4 is not set
+# CONFIG_NFS_DIRECTIO is not set
+# CONFIG_NFSD is not set
+CONFIG_ROOT_NFS=y
+CONFIG_LOCKD=y
+CONFIG_LOCKD_V4=y
+CONFIG_NFS_COMMON=y
+CONFIG_SUNRPC=y
+# CONFIG_SUNRPC_BIND34 is not set
+# CONFIG_RPCSEC_GSS_KRB5 is not set
+# CONFIG_RPCSEC_GSS_SPKM3 is not set
+# CONFIG_SMB_FS is not set
+# CONFIG_CIFS is not set
+# CONFIG_NCP_FS is not set
+# CONFIG_CODA_FS is not set
+# CONFIG_AFS_FS is not set
+
+#
+# Partition Types
+#
+# CONFIG_PARTITION_ADVANCED is not set
+CONFIG_MSDOS_PARTITION=y
+# CONFIG_NLS is not set
+# CONFIG_DLM is not set
+
+#
+# Library routines
+#
+CONFIG_BITREVERSE=y
+# CONFIG_CRC_CCITT is not set
+# CONFIG_CRC16 is not set
+# CONFIG_CRC_ITU_T is not set
+CONFIG_CRC32=y
+# CONFIG_CRC7 is not set
+# CONFIG_LIBCRC32C is not set
+CONFIG_ZLIB_INFLATE=y
+CONFIG_PLIST=y
+CONFIG_HAS_IOMEM=y
+CONFIG_HAS_IOPORT=y
+CONFIG_HAS_DMA=y
+
+#
+# Kernel hacking
+#
+# CONFIG_PRINTK_TIME is not set
+CONFIG_ENABLE_WARN_DEPRECATED=y
+CONFIG_ENABLE_MUST_CHECK=y
+CONFIG_MAGIC_SYSRQ=y
+# CONFIG_UNUSED_SYMBOLS is not set
+CONFIG_DEBUG_FS=y
+# CONFIG_HEADERS_CHECK is not set
+CONFIG_DEBUG_KERNEL=y
+# CONFIG_DEBUG_SHIRQ is not set
+CONFIG_DETECT_SOFTLOCKUP=y
+CONFIG_SCHED_DEBUG=y
+# CONFIG_SCHEDSTATS is not set
+# CONFIG_TIMER_STATS is not set
+# CONFIG_SLUB_DEBUG_ON is not set
+# CONFIG_SLUB_STATS is not set
+# CONFIG_DEBUG_RT_MUTEXES is not set
+# CONFIG_RT_MUTEX_TESTER is not set
+# CONFIG_DEBUG_SPINLOCK is not set
+# CONFIG_DEBUG_MUTEXES is not set
+# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
+# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
+# CONFIG_DEBUG_KOBJECT is not set
+# CONFIG_DEBUG_BUGVERBOSE is not set
+# CONFIG_DEBUG_INFO is not set
+# CONFIG_DEBUG_VM is not set
+# CONFIG_DEBUG_LIST is not set
+# CONFIG_DEBUG_SG is not set
+# CONFIG_BOOT_PRINTK_DELAY is not set
+# CONFIG_RCU_TORTURE_TEST is not set
+# CONFIG_BACKTRACE_SELF_TEST is not set
+# CONFIG_FAULT_INJECTION is not set
+# CONFIG_SAMPLES is not set
+# CONFIG_DEBUG_STACKOVERFLOW is not set
+# CONFIG_DEBUG_STACK_USAGE is not set
+# CONFIG_DEBUG_PAGEALLOC is not set
+CONFIG_DEBUGGER=y
+# CONFIG_KGDB is not set
+# CONFIG_XMON is not set
+# CONFIG_VIRQ_DEBUG is not set
+# CONFIG_BDI_SWITCH is not set
+# CONFIG_PPC_EARLY_DEBUG is not set
+
+#
+# Security options
+#
+# CONFIG_KEYS is not set
+# CONFIG_SECURITY is not set
+# CONFIG_SECURITY_FILE_CAPABILITIES is not set
+# CONFIG_CRYPTO is not set
+# CONFIG_PPC_CLOCK is not set
similarity index 99%
rename from arch/powerpc/configs/mpc8313_rdb_defconfig
rename to arch/powerpc/configs/83xx/mpc8313_rdb_defconfig
index 7a862a6e3be88e682f7466fb52606750a5fe2673..7d18440e398f4be1428d83bf90d317bb35eecfdf 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
 # Linux kernel version: 2.6.25-rc6
-# Mon Mar 24 08:48:14 2008
+# Fri Apr 11 11:10:09 2008
 #
 # CONFIG_PPC64 is not set
 
@@ -196,6 +196,7 @@ CONFIG_PREEMPT_NONE=y
 # CONFIG_PREEMPT is not set
 CONFIG_BINFMT_ELF=y
 # CONFIG_BINFMT_MISC is not set
+CONFIG_FORCE_MAX_ZONEORDER=11
 # CONFIG_IOMMU_HELPER is not set
 CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
 CONFIG_ARCH_HAS_WALK_MEMORY=y
@@ -360,7 +361,7 @@ CONFIG_MTD=y
 CONFIG_MTD_PARTITIONS=y
 # CONFIG_MTD_REDBOOT_PARTS is not set
 # CONFIG_MTD_CMDLINE_PARTS is not set
-# CONFIG_MTD_OF_PARTS is not set
+CONFIG_MTD_OF_PARTS=y
 
 #
 # User Modules And Translation Layers
@@ -436,7 +437,7 @@ CONFIG_MTD_NAND_IDS=y
 # CONFIG_MTD_NAND_NANDSIM is not set
 # CONFIG_MTD_NAND_PLATFORM is not set
 # CONFIG_MTD_ALAUDA is not set
-# CONFIG_MTD_NAND_FSL_ELBC is not set
+CONFIG_MTD_NAND_FSL_ELBC=y
 # CONFIG_MTD_ONENAND is not set
 
 #
@@ -1293,6 +1294,7 @@ CONFIG_PLIST=y
 CONFIG_HAS_IOMEM=y
 CONFIG_HAS_IOPORT=y
 CONFIG_HAS_DMA=y
+CONFIG_HAVE_LMB=y
 
 #
 # Kernel hacking
diff --git a/arch/powerpc/configs/85xx/ksi8560_defconfig b/arch/powerpc/configs/85xx/ksi8560_defconfig
new file mode 100644 (file)
index 0000000..2d0debc
--- /dev/null
@@ -0,0 +1,899 @@
+#
+# Automatically generated make config: don't edit
+# Linux kernel version: 2.6.24
+# Mon Feb 11 16:25:19 2008
+#
+# CONFIG_PPC64 is not set
+
+#
+# Processor support
+#
+# CONFIG_6xx is not set
+CONFIG_PPC_85xx=y
+# CONFIG_PPC_8xx is not set
+# CONFIG_40x is not set
+# CONFIG_44x is not set
+# CONFIG_E200 is not set
+CONFIG_E500=y
+CONFIG_BOOKE=y
+CONFIG_FSL_BOOKE=y
+CONFIG_FSL_EMB_PERFMON=y
+# CONFIG_PHYS_64BIT is not set
+CONFIG_SPE=y
+# CONFIG_PPC_MM_SLICES is not set
+CONFIG_PPC32=y
+CONFIG_WORD_SIZE=32
+CONFIG_PPC_MERGE=y
+CONFIG_MMU=y
+CONFIG_GENERIC_CMOS_UPDATE=y
+CONFIG_GENERIC_TIME=y
+CONFIG_GENERIC_TIME_VSYSCALL=y
+CONFIG_GENERIC_CLOCKEVENTS=y
+CONFIG_GENERIC_HARDIRQS=y
+# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
+CONFIG_IRQ_PER_CPU=y
+CONFIG_RWSEM_XCHGADD_ALGORITHM=y
+CONFIG_ARCH_HAS_ILOG2_U32=y
+CONFIG_GENERIC_HWEIGHT=y
+CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_GENERIC_FIND_NEXT_BIT=y
+# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
+CONFIG_PPC=y
+CONFIG_EARLY_PRINTK=y
+CONFIG_GENERIC_NVRAM=y
+CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
+CONFIG_ARCH_MAY_HAVE_PC_FDC=y
+CONFIG_PPC_OF=y
+CONFIG_OF=y
+CONFIG_PPC_UDBG_16550=y
+# CONFIG_GENERIC_TBSYNC is not set
+CONFIG_AUDIT_ARCH=y
+CONFIG_GENERIC_BUG=y
+CONFIG_DEFAULT_UIMAGE=y
+# CONFIG_PPC_DCR_NATIVE is not set
+# CONFIG_PPC_DCR_MMIO is not set
+CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
+
+#
+# General setup
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_BROKEN_ON_SMP=y
+CONFIG_INIT_ENV_ARG_LIMIT=32
+CONFIG_LOCALVERSION=""
+CONFIG_LOCALVERSION_AUTO=y
+CONFIG_SWAP=y
+CONFIG_SYSVIPC=y
+CONFIG_SYSVIPC_SYSCTL=y
+# CONFIG_POSIX_MQUEUE is not set
+# CONFIG_BSD_PROCESS_ACCT is not set
+# CONFIG_TASKSTATS is not set
+# CONFIG_USER_NS is not set
+# CONFIG_PID_NS is not set
+# CONFIG_AUDIT is not set
+# CONFIG_IKCONFIG is not set
+CONFIG_LOG_BUF_SHIFT=14
+# CONFIG_CGROUPS is not set
+CONFIG_FAIR_GROUP_SCHED=y
+CONFIG_FAIR_USER_SCHED=y
+# CONFIG_FAIR_CGROUP_SCHED is not set
+CONFIG_SYSFS_DEPRECATED=y
+# CONFIG_RELAY is not set
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_INITRAMFS_SOURCE=""
+# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
+CONFIG_SYSCTL=y
+CONFIG_EMBEDDED=y
+CONFIG_SYSCTL_SYSCALL=y
+CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_ALL is not set
+# CONFIG_KALLSYMS_EXTRA_PASS is not set
+CONFIG_HOTPLUG=y
+CONFIG_PRINTK=y
+CONFIG_BUG=y
+CONFIG_ELF_CORE=y
+CONFIG_BASE_FULL=y
+CONFIG_FUTEX=y
+CONFIG_ANON_INODES=y
+CONFIG_EPOLL=y
+CONFIG_SIGNALFD=y
+CONFIG_TIMERFD=y
+CONFIG_EVENTFD=y
+CONFIG_SHMEM=y
+CONFIG_VM_EVENT_COUNTERS=y
+CONFIG_SLUB_DEBUG=y
+# CONFIG_SLAB is not set
+CONFIG_SLUB=y
+# CONFIG_SLOB is not set
+# CONFIG_PROFILING is not set
+# CONFIG_MARKERS is not set
+CONFIG_HAVE_OPROFILE=y
+CONFIG_HAVE_KPROBES=y
+CONFIG_PROC_PAGE_MONITOR=y
+CONFIG_SLABINFO=y
+CONFIG_RT_MUTEXES=y
+# CONFIG_TINY_SHMEM is not set
+CONFIG_BASE_SMALL=0
+# CONFIG_MODULES is not set
+CONFIG_BLOCK=y
+# CONFIG_LBD is not set
+# CONFIG_BLK_DEV_IO_TRACE is not set
+# CONFIG_LSF is not set
+# CONFIG_BLK_DEV_BSG is not set
+
+#
+# IO Schedulers
+#
+CONFIG_IOSCHED_NOOP=y
+CONFIG_IOSCHED_AS=y
+CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
+CONFIG_DEFAULT_AS=y
+# CONFIG_DEFAULT_DEADLINE is not set
+# CONFIG_DEFAULT_CFQ is not set
+# CONFIG_DEFAULT_NOOP is not set
+CONFIG_DEFAULT_IOSCHED="anticipatory"
+CONFIG_CLASSIC_RCU=y
+# CONFIG_PREEMPT_RCU is not set
+
+#
+# Platform support
+#
+# CONFIG_PPC_MPC512x is not set
+# CONFIG_PPC_MPC5121 is not set
+# CONFIG_PPC_CELL is not set
+# CONFIG_PPC_CELL_NATIVE is not set
+# CONFIG_PQ2ADS is not set
+CONFIG_MPC85xx=y
+# CONFIG_MPC8540_ADS is not set
+# CONFIG_MPC8560_ADS is not set
+# CONFIG_MPC85xx_CDS is not set
+# CONFIG_MPC85xx_MDS is not set
+# CONFIG_MPC85xx_DS is not set
+CONFIG_KSI8560=y
+# CONFIG_STX_GP3 is not set
+# CONFIG_TQM8540 is not set
+# CONFIG_TQM8541 is not set
+# CONFIG_TQM8555 is not set
+# CONFIG_TQM8560 is not set
+# CONFIG_SBC8548 is not set
+# CONFIG_SBC8560 is not set
+# CONFIG_IPIC is not set
+CONFIG_MPIC=y
+# CONFIG_MPIC_WEIRD is not set
+# CONFIG_PPC_I8259 is not set
+# CONFIG_PPC_RTAS is not set
+# CONFIG_MMIO_NVRAM is not set
+# CONFIG_PPC_MPC106 is not set
+# CONFIG_PPC_970_NAP is not set
+# CONFIG_PPC_INDIRECT_IO is not set
+# CONFIG_GENERIC_IOMAP is not set
+# CONFIG_CPU_FREQ is not set
+CONFIG_CPM2=y
+CONFIG_PPC_CPM_NEW_BINDING=y
+# CONFIG_FSL_ULI1575 is not set
+CONFIG_CPM=y
+
+#
+# Kernel options
+#
+CONFIG_HIGHMEM=y
+# CONFIG_TICK_ONESHOT is not set
+# CONFIG_NO_HZ is not set
+# CONFIG_HIGH_RES_TIMERS is not set
+CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
+# CONFIG_HZ_100 is not set
+CONFIG_HZ_250=y
+# CONFIG_HZ_300 is not set
+# CONFIG_HZ_1000 is not set
+CONFIG_HZ=250
+# CONFIG_SCHED_HRTICK is not set
+CONFIG_PREEMPT_NONE=y
+# CONFIG_PREEMPT_VOLUNTARY is not set
+# CONFIG_PREEMPT is not set
+CONFIG_RCU_TRACE=y
+CONFIG_BINFMT_ELF=y
+CONFIG_BINFMT_MISC=y
+CONFIG_MATH_EMULATION=y
+# CONFIG_IOMMU_HELPER is not set
+CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
+CONFIG_ARCH_FLATMEM_ENABLE=y
+CONFIG_ARCH_POPULATES_NODE_MAP=y
+CONFIG_SELECT_MEMORY_MODEL=y
+CONFIG_FLATMEM_MANUAL=y
+# CONFIG_DISCONTIGMEM_MANUAL is not set
+# CONFIG_SPARSEMEM_MANUAL is not set
+CONFIG_FLATMEM=y
+CONFIG_FLAT_NODE_MEM_MAP=y
+# CONFIG_SPARSEMEM_STATIC is not set
+# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
+CONFIG_SPLIT_PTLOCK_CPUS=4
+# CONFIG_RESOURCES_64BIT is not set
+CONFIG_ZONE_DMA_FLAG=1
+CONFIG_BOUNCE=y
+CONFIG_VIRT_TO_BUS=y
+# CONFIG_PROC_DEVICETREE is not set
+# CONFIG_CMDLINE_BOOL is not set
+# CONFIG_PM is not set
+# CONFIG_SECCOMP is not set
+CONFIG_WANT_DEVICE_TREE=y
+CONFIG_ISA_DMA_API=y
+
+#
+# Bus options
+#
+CONFIG_ZONE_DMA=y
+CONFIG_FSL_SOC=y
+# CONFIG_PCI is not set
+# CONFIG_PCI_DOMAINS is not set
+# CONFIG_PCI_SYSCALL is not set
+# CONFIG_ARCH_SUPPORTS_MSI is not set
+# CONFIG_PCCARD is not set
+
+#
+# Advanced setup
+#
+# CONFIG_ADVANCED_OPTIONS is not set
+
+#
+# Default settings for advanced configuration options are used
+#
+CONFIG_HIGHMEM_START=0xfe000000
+CONFIG_LOWMEM_SIZE=0x30000000
+CONFIG_KERNEL_START=0xc0000000
+CONFIG_TASK_SIZE=0xc0000000
+CONFIG_BOOT_LOAD=0x00800000
+
+#
+# Networking
+#
+CONFIG_NET=y
+
+#
+# Networking options
+#
+CONFIG_PACKET=y
+# CONFIG_PACKET_MMAP is not set
+CONFIG_UNIX=y
+CONFIG_XFRM=y
+# CONFIG_XFRM_USER is not set
+# CONFIG_XFRM_SUB_POLICY is not set
+# CONFIG_XFRM_MIGRATE is not set
+# CONFIG_XFRM_STATISTICS is not set
+# CONFIG_NET_KEY is not set
+CONFIG_INET=y
+CONFIG_IP_MULTICAST=y
+# CONFIG_IP_ADVANCED_ROUTER is not set
+CONFIG_IP_FIB_HASH=y
+CONFIG_IP_PNP=y
+CONFIG_IP_PNP_DHCP=y
+CONFIG_IP_PNP_BOOTP=y
+# CONFIG_IP_PNP_RARP is not set
+# CONFIG_NET_IPIP is not set
+# CONFIG_NET_IPGRE is not set
+# CONFIG_IP_MROUTE is not set
+# CONFIG_ARPD is not set
+CONFIG_SYN_COOKIES=y
+# CONFIG_INET_AH is not set
+# CONFIG_INET_ESP is not set
+# CONFIG_INET_IPCOMP is not set
+# CONFIG_INET_XFRM_TUNNEL is not set
+# CONFIG_INET_TUNNEL is not set
+CONFIG_INET_XFRM_MODE_TRANSPORT=y
+CONFIG_INET_XFRM_MODE_TUNNEL=y
+CONFIG_INET_XFRM_MODE_BEET=y
+# CONFIG_INET_LRO is not set
+CONFIG_INET_DIAG=y
+CONFIG_INET_TCP_DIAG=y
+# CONFIG_TCP_CONG_ADVANCED is not set
+CONFIG_TCP_CONG_CUBIC=y
+CONFIG_DEFAULT_TCP_CONG="cubic"
+# CONFIG_TCP_MD5SIG is not set
+# CONFIG_IPV6 is not set
+# CONFIG_INET6_XFRM_TUNNEL is not set
+# CONFIG_INET6_TUNNEL is not set
+# CONFIG_NETWORK_SECMARK is not set
+# CONFIG_NETFILTER is not set
+# CONFIG_IP_DCCP is not set
+# CONFIG_IP_SCTP is not set
+# CONFIG_TIPC is not set
+# CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
+# CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
+# CONFIG_LLC2 is not set
+# CONFIG_IPX is not set
+# CONFIG_ATALK is not set
+# CONFIG_X25 is not set
+# CONFIG_LAPB is not set
+# CONFIG_ECONET is not set
+# CONFIG_WAN_ROUTER is not set
+# CONFIG_NET_SCHED is not set
+
+#
+# Network testing
+#
+# CONFIG_NET_PKTGEN is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_CAN is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
+# CONFIG_AF_RXRPC is not set
+
+#
+# Wireless
+#
+# CONFIG_CFG80211 is not set
+# CONFIG_WIRELESS_EXT is not set
+# CONFIG_MAC80211 is not set
+# CONFIG_IEEE80211 is not set
+# CONFIG_RFKILL is not set
+# CONFIG_NET_9P is not set
+
+#
+# Device Drivers
+#
+
+#
+# Generic Driver Options
+#
+CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
+CONFIG_STANDALONE=y
+CONFIG_PREVENT_FIRMWARE_BUILD=y
+# CONFIG_FW_LOADER is not set
+# CONFIG_DEBUG_DRIVER is not set
+# CONFIG_DEBUG_DEVRES is not set
+# CONFIG_SYS_HYPERVISOR is not set
+# CONFIG_CONNECTOR is not set
+CONFIG_MTD=y
+# CONFIG_MTD_DEBUG is not set
+CONFIG_MTD_CONCAT=y
+CONFIG_MTD_PARTITIONS=y
+# CONFIG_MTD_REDBOOT_PARTS is not set
+# CONFIG_MTD_CMDLINE_PARTS is not set
+
+#
+# User Modules And Translation Layers
+#
+CONFIG_MTD_CHAR=y
+CONFIG_MTD_BLKDEVS=y
+CONFIG_MTD_BLOCK=y
+# CONFIG_FTL is not set
+# CONFIG_NFTL is not set
+# CONFIG_INFTL is not set
+# CONFIG_RFD_FTL is not set
+# CONFIG_SSFDC is not set
+# CONFIG_MTD_OOPS is not set
+
+#
+# RAM/ROM/Flash chip drivers
+#
+CONFIG_MTD_CFI=y
+CONFIG_MTD_JEDECPROBE=y
+CONFIG_MTD_GEN_PROBE=y
+# CONFIG_MTD_CFI_ADV_OPTIONS is not set
+CONFIG_MTD_MAP_BANK_WIDTH_1=y
+CONFIG_MTD_MAP_BANK_WIDTH_2=y
+CONFIG_MTD_MAP_BANK_WIDTH_4=y
+# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
+CONFIG_MTD_CFI_I1=y
+CONFIG_MTD_CFI_I2=y
+# CONFIG_MTD_CFI_I4 is not set
+# CONFIG_MTD_CFI_I8 is not set
+# CONFIG_MTD_CFI_INTELEXT is not set
+CONFIG_MTD_CFI_AMDSTD=y
+# CONFIG_MTD_CFI_STAA is not set
+CONFIG_MTD_CFI_UTIL=y
+# CONFIG_MTD_RAM is not set
+# CONFIG_MTD_ROM is not set
+# CONFIG_MTD_ABSENT is not set
+
+#
+# Mapping drivers for chip access
+#
+# CONFIG_MTD_COMPLEX_MAPPINGS is not set
+# CONFIG_MTD_PHYSMAP is not set
+CONFIG_MTD_PHYSMAP_OF=y
+# CONFIG_MTD_PLATRAM is not set
+
+#
+# Self-contained MTD device drivers
+#
+# CONFIG_MTD_SLRAM is not set
+# CONFIG_MTD_PHRAM is not set
+# CONFIG_MTD_MTDRAM is not set
+# CONFIG_MTD_BLOCK2MTD is not set
+
+#
+# Disk-On-Chip Device Drivers
+#
+# CONFIG_MTD_DOC2000 is not set
+# CONFIG_MTD_DOC2001 is not set
+# CONFIG_MTD_DOC2001PLUS is not set
+# CONFIG_MTD_NAND is not set
+# CONFIG_MTD_ONENAND is not set
+
+#
+# UBI - Unsorted block images
+#
+# CONFIG_MTD_UBI is not set
+CONFIG_OF_DEVICE=y
+# CONFIG_PARPORT is not set
+CONFIG_BLK_DEV=y
+# CONFIG_BLK_DEV_FD is not set
+# CONFIG_BLK_DEV_COW_COMMON is not set
+CONFIG_BLK_DEV_LOOP=y
+# CONFIG_BLK_DEV_CRYPTOLOOP is not set
+# CONFIG_BLK_DEV_NBD is not set
+CONFIG_BLK_DEV_RAM=y
+CONFIG_BLK_DEV_RAM_COUNT=16
+CONFIG_BLK_DEV_RAM_SIZE=32768
+CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
+# CONFIG_CDROM_PKTCDVD is not set
+# CONFIG_ATA_OVER_ETH is not set
+CONFIG_MISC_DEVICES=y
+# CONFIG_EEPROM_93CX6 is not set
+CONFIG_IDE=y
+CONFIG_IDE_MAX_HWIFS=4
+CONFIG_BLK_DEV_IDE=y
+
+#
+# Please see Documentation/ide.txt for help/info on IDE drives
+#
+# CONFIG_BLK_DEV_IDE_SATA is not set
+# CONFIG_BLK_DEV_IDEDISK is not set
+# CONFIG_IDEDISK_MULTI_MODE is not set
+# CONFIG_BLK_DEV_IDECD is not set
+# CONFIG_BLK_DEV_IDETAPE is not set
+# CONFIG_BLK_DEV_IDEFLOPPY is not set
+# CONFIG_IDE_TASK_IOCTL is not set
+CONFIG_IDE_PROC_FS=y
+
+#
+# IDE chipset support/bugfixes
+#
+CONFIG_IDE_GENERIC=y
+# CONFIG_BLK_DEV_PLATFORM is not set
+# CONFIG_BLK_DEV_IDEDMA is not set
+CONFIG_IDE_ARCH_OBSOLETE_INIT=y
+# CONFIG_BLK_DEV_HD is not set
+
+#
+# SCSI device support
+#
+# CONFIG_RAID_ATTRS is not set
+# CONFIG_SCSI is not set
+# CONFIG_SCSI_DMA is not set
+# CONFIG_SCSI_NETLINK is not set
+# CONFIG_ATA is not set
+# CONFIG_MD is not set
+# CONFIG_MACINTOSH_DRIVERS is not set
+CONFIG_NETDEVICES=y
+# CONFIG_NETDEVICES_MULTIQUEUE is not set
+# CONFIG_DUMMY is not set
+# CONFIG_BONDING is not set
+# CONFIG_MACVLAN is not set
+# CONFIG_EQUALIZER is not set
+# CONFIG_TUN is not set
+# CONFIG_VETH is not set
+CONFIG_PHYLIB=y
+
+#
+# MII PHY device drivers
+#
+CONFIG_MARVELL_PHY=y
+# CONFIG_DAVICOM_PHY is not set
+# CONFIG_QSEMI_PHY is not set
+# CONFIG_LXT_PHY is not set
+# CONFIG_CICADA_PHY is not set
+# CONFIG_VITESSE_PHY is not set
+# CONFIG_SMSC_PHY is not set
+# CONFIG_BROADCOM_PHY is not set
+# CONFIG_ICPLUS_PHY is not set
+# CONFIG_REALTEK_PHY is not set
+# CONFIG_FIXED_PHY is not set
+CONFIG_MDIO_BITBANG=y
+CONFIG_NET_ETHERNET=y
+CONFIG_MII=y
+# CONFIG_IBM_NEW_EMAC_ZMII is not set
+# CONFIG_IBM_NEW_EMAC_RGMII is not set
+# CONFIG_IBM_NEW_EMAC_TAH is not set
+# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
+# CONFIG_B44 is not set
+CONFIG_FS_ENET=y
+# CONFIG_FS_ENET_HAS_SCC is not set
+CONFIG_FS_ENET_HAS_FCC=y
+CONFIG_FS_ENET_MDIO_FCC=y
+CONFIG_NETDEV_1000=y
+# CONFIG_E1000E_ENABLED is not set
+CONFIG_GIANFAR=y
+CONFIG_GFAR_NAPI=y
+CONFIG_NETDEV_10000=y
+
+#
+# Wireless LAN
+#
+# CONFIG_WLAN_PRE80211 is not set
+# CONFIG_WLAN_80211 is not set
+# CONFIG_WAN is not set
+# CONFIG_PPP is not set
+# CONFIG_SLIP is not set
+# CONFIG_NETCONSOLE is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_ISDN is not set
+# CONFIG_PHONE is not set
+
+#
+# Input device support
+#
+CONFIG_INPUT=y
+# CONFIG_INPUT_FF_MEMLESS is not set
+# CONFIG_INPUT_POLLDEV is not set
+
+#
+# Userland interfaces
+#
+# CONFIG_INPUT_MOUSEDEV is not set
+# CONFIG_INPUT_JOYDEV is not set
+# CONFIG_INPUT_EVDEV is not set
+# CONFIG_INPUT_EVBUG is not set
+
+#
+# Input Device Drivers
+#
+# CONFIG_INPUT_KEYBOARD is not set
+# CONFIG_INPUT_MOUSE is not set
+# CONFIG_INPUT_JOYSTICK is not set
+# CONFIG_INPUT_TABLET is not set
+# CONFIG_INPUT_TOUCHSCREEN is not set
+# CONFIG_INPUT_MISC is not set
+
+#
+# Hardware I/O ports
+#
+# CONFIG_SERIO is not set
+# CONFIG_GAMEPORT is not set
+
+#
+# Character devices
+#
+# CONFIG_VT is not set
+# CONFIG_SERIAL_NONSTANDARD is not set
+
+#
+# Serial drivers
+#
+# CONFIG_SERIAL_8250 is not set
+
+#
+# Non-8250 serial port support
+#
+# CONFIG_SERIAL_UARTLITE is not set
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+CONFIG_SERIAL_CPM=y
+CONFIG_SERIAL_CPM_CONSOLE=y
+CONFIG_SERIAL_CPM_SCC1=y
+# CONFIG_SERIAL_CPM_SCC2 is not set
+# CONFIG_SERIAL_CPM_SCC3 is not set
+# CONFIG_SERIAL_CPM_SCC4 is not set
+# CONFIG_SERIAL_CPM_SMC1 is not set
+# CONFIG_SERIAL_CPM_SMC2 is not set
+CONFIG_UNIX98_PTYS=y
+CONFIG_LEGACY_PTYS=y
+CONFIG_LEGACY_PTY_COUNT=256
+# CONFIG_IPMI_HANDLER is not set
+CONFIG_HW_RANDOM=y
+# CONFIG_NVRAM is not set
+CONFIG_GEN_RTC=y
+# CONFIG_GEN_RTC_X is not set
+# CONFIG_R3964 is not set
+# CONFIG_RAW_DRIVER is not set
+# CONFIG_TCG_TPM is not set
+# CONFIG_I2C is not set
+
+#
+# SPI support
+#
+# CONFIG_SPI is not set
+# CONFIG_SPI_MASTER is not set
+# CONFIG_W1 is not set
+# CONFIG_POWER_SUPPLY is not set
+CONFIG_HWMON=y
+# CONFIG_HWMON_VID is not set
+# CONFIG_SENSORS_F71805F is not set
+# CONFIG_SENSORS_F71882FG is not set
+# CONFIG_SENSORS_IT87 is not set
+# CONFIG_SENSORS_PC87360 is not set
+# CONFIG_SENSORS_PC87427 is not set
+# CONFIG_SENSORS_SMSC47M1 is not set
+# CONFIG_SENSORS_SMSC47B397 is not set
+# CONFIG_SENSORS_VT1211 is not set
+# CONFIG_SENSORS_W83627HF is not set
+# CONFIG_SENSORS_W83627EHF is not set
+# CONFIG_HWMON_DEBUG_CHIP is not set
+# CONFIG_WATCHDOG is not set
+
+#
+# Sonics Silicon Backplane
+#
+CONFIG_SSB_POSSIBLE=y
+# CONFIG_SSB is not set
+
+#
+# Multifunction device drivers
+#
+# CONFIG_MFD_SM501 is not set
+
+#
+# Multimedia devices
+#
+# CONFIG_VIDEO_DEV is not set
+# CONFIG_DVB_CORE is not set
+CONFIG_DAB=y
+
+#
+# Graphics support
+#
+# CONFIG_VGASTATE is not set
+CONFIG_VIDEO_OUTPUT_CONTROL=y
+# CONFIG_FB is not set
+# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
+
+#
+# Display device support
+#
+# CONFIG_DISPLAY_SUPPORT is not set
+
+#
+# Sound
+#
+# CONFIG_SOUND is not set
+CONFIG_HID_SUPPORT=y
+CONFIG_HID=y
+# CONFIG_HID_DEBUG is not set
+# CONFIG_HIDRAW is not set
+CONFIG_USB_SUPPORT=y
+# CONFIG_USB_ARCH_HAS_HCD is not set
+# CONFIG_USB_ARCH_HAS_OHCI is not set
+# CONFIG_USB_ARCH_HAS_EHCI is not set
+
+#
+# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
+#
+# CONFIG_USB_GADGET is not set
+# CONFIG_MMC is not set
+# CONFIG_NEW_LEDS is not set
+# CONFIG_EDAC is not set
+# CONFIG_RTC_CLASS is not set
+
+#
+# Userspace I/O
+#
+# CONFIG_UIO is not set
+
+#
+# File systems
+#
+CONFIG_EXT2_FS=y
+# CONFIG_EXT2_FS_XATTR is not set
+# CONFIG_EXT2_FS_XIP is not set
+CONFIG_EXT3_FS=y
+CONFIG_EXT3_FS_XATTR=y
+# CONFIG_EXT3_FS_POSIX_ACL is not set
+# CONFIG_EXT3_FS_SECURITY is not set
+# CONFIG_EXT4DEV_FS is not set
+CONFIG_JBD=y
+# CONFIG_JBD_DEBUG is not set
+CONFIG_FS_MBCACHE=y
+# CONFIG_REISERFS_FS is not set
+# CONFIG_JFS_FS is not set
+# CONFIG_FS_POSIX_ACL is not set
+# CONFIG_XFS_FS is not set
+# CONFIG_GFS2_FS is not set
+# CONFIG_OCFS2_FS is not set
+# CONFIG_MINIX_FS is not set
+# CONFIG_ROMFS_FS is not set
+CONFIG_INOTIFY=y
+CONFIG_INOTIFY_USER=y
+# CONFIG_QUOTA is not set
+CONFIG_DNOTIFY=y
+# CONFIG_AUTOFS_FS is not set
+# CONFIG_AUTOFS4_FS is not set
+# CONFIG_FUSE_FS is not set
+
+#
+# CD-ROM/DVD Filesystems
+#
+# CONFIG_ISO9660_FS is not set
+# CONFIG_UDF_FS is not set
+
+#
+# DOS/FAT/NT Filesystems
+#
+# CONFIG_MSDOS_FS is not set
+# CONFIG_VFAT_FS is not set
+# CONFIG_NTFS_FS is not set
+
+#
+# Pseudo filesystems
+#
+CONFIG_PROC_FS=y
+CONFIG_PROC_KCORE=y
+CONFIG_PROC_SYSCTL=y
+CONFIG_SYSFS=y
+CONFIG_TMPFS=y
+# CONFIG_TMPFS_POSIX_ACL is not set
+# CONFIG_HUGETLB_PAGE is not set
+# CONFIG_CONFIGFS_FS is not set
+
+#
+# Miscellaneous filesystems
+#
+# CONFIG_ADFS_FS is not set
+# CONFIG_AFFS_FS is not set
+# CONFIG_HFS_FS is not set
+# CONFIG_HFSPLUS_FS is not set
+# CONFIG_BEFS_FS is not set
+# CONFIG_BFS_FS is not set
+# CONFIG_EFS_FS is not set
+# CONFIG_JFFS2_FS is not set
+# CONFIG_CRAMFS is not set
+# CONFIG_VXFS_FS is not set
+# CONFIG_HPFS_FS is not set
+# CONFIG_QNX4FS_FS is not set
+# CONFIG_SYSV_FS is not set
+# CONFIG_UFS_FS is not set
+CONFIG_NETWORK_FILESYSTEMS=y
+CONFIG_NFS_FS=y
+# CONFIG_NFS_V3 is not set
+# CONFIG_NFS_V4 is not set
+# CONFIG_NFS_DIRECTIO is not set
+# CONFIG_NFSD is not set
+CONFIG_ROOT_NFS=y
+CONFIG_LOCKD=y
+CONFIG_NFS_COMMON=y
+CONFIG_SUNRPC=y
+# CONFIG_SUNRPC_BIND34 is not set
+# CONFIG_RPCSEC_GSS_KRB5 is not set
+# CONFIG_RPCSEC_GSS_SPKM3 is not set
+# CONFIG_SMB_FS is not set
+# CONFIG_CIFS is not set
+# CONFIG_NCP_FS is not set
+# CONFIG_CODA_FS is not set
+# CONFIG_AFS_FS is not set
+
+#
+# Partition Types
+#
+CONFIG_PARTITION_ADVANCED=y
+# CONFIG_ACORN_PARTITION is not set
+# CONFIG_OSF_PARTITION is not set
+# CONFIG_AMIGA_PARTITION is not set
+# CONFIG_ATARI_PARTITION is not set
+# CONFIG_MAC_PARTITION is not set
+# CONFIG_MSDOS_PARTITION is not set
+# CONFIG_LDM_PARTITION is not set
+# CONFIG_SGI_PARTITION is not set
+# CONFIG_ULTRIX_PARTITION is not set
+# CONFIG_SUN_PARTITION is not set
+# CONFIG_KARMA_PARTITION is not set
+# CONFIG_EFI_PARTITION is not set
+# CONFIG_SYSV68_PARTITION is not set
+# CONFIG_NLS is not set
+# CONFIG_DLM is not set
+
+#
+# Library routines
+#
+CONFIG_BITREVERSE=y
+# CONFIG_CRC_CCITT is not set
+# CONFIG_CRC16 is not set
+# CONFIG_CRC_ITU_T is not set
+CONFIG_CRC32=y
+# CONFIG_CRC7 is not set
+# CONFIG_LIBCRC32C is not set
+CONFIG_PLIST=y
+CONFIG_HAS_IOMEM=y
+CONFIG_HAS_IOPORT=y
+CONFIG_HAS_DMA=y
+
+#
+# Kernel hacking
+#
+# CONFIG_PRINTK_TIME is not set
+CONFIG_ENABLE_WARN_DEPRECATED=y
+CONFIG_ENABLE_MUST_CHECK=y
+# CONFIG_MAGIC_SYSRQ is not set
+# CONFIG_UNUSED_SYMBOLS is not set
+CONFIG_DEBUG_FS=y
+# CONFIG_HEADERS_CHECK is not set
+CONFIG_DEBUG_KERNEL=y
+# CONFIG_DEBUG_SHIRQ is not set
+CONFIG_DETECT_SOFTLOCKUP=y
+CONFIG_SCHED_DEBUG=y
+# CONFIG_SCHEDSTATS is not set
+# CONFIG_TIMER_STATS is not set
+# CONFIG_SLUB_DEBUG_ON is not set
+# CONFIG_DEBUG_RT_MUTEXES is not set
+# CONFIG_RT_MUTEX_TESTER is not set
+# CONFIG_DEBUG_SPINLOCK is not set
+CONFIG_DEBUG_MUTEXES=y
+# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
+# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
+# CONFIG_DEBUG_KOBJECT is not set
+# CONFIG_DEBUG_HIGHMEM is not set
+# CONFIG_DEBUG_BUGVERBOSE is not set
+# CONFIG_DEBUG_INFO is not set
+# CONFIG_DEBUG_VM is not set
+# CONFIG_DEBUG_LIST is not set
+# CONFIG_DEBUG_SG is not set
+CONFIG_FORCED_INLINING=y
+# CONFIG_BOOT_PRINTK_DELAY is not set
+# CONFIG_BACKTRACE_SELF_TEST is not set
+# CONFIG_FAULT_INJECTION is not set
+# CONFIG_SAMPLES is not set
+# CONFIG_DEBUG_STACKOVERFLOW is not set
+# CONFIG_DEBUG_STACK_USAGE is not set
+# CONFIG_DEBUG_PAGEALLOC is not set
+# CONFIG_DEBUGGER is not set
+# CONFIG_KGDB_CONSOLE is not set
+# CONFIG_VIRQ_DEBUG is not set
+# CONFIG_BDI_SWITCH is not set
+# CONFIG_PPC_EARLY_DEBUG is not set
+
+#
+# Security options
+#
+# CONFIG_KEYS is not set
+# CONFIG_SECURITY is not set
+# CONFIG_SECURITY_FILE_CAPABILITIES is not set
+CONFIG_CRYPTO=y
+# CONFIG_CRYPTO_SEQIV is not set
+# CONFIG_CRYPTO_MANAGER is not set
+# CONFIG_CRYPTO_HMAC is not set
+# CONFIG_CRYPTO_XCBC is not set
+# CONFIG_CRYPTO_NULL is not set
+# CONFIG_CRYPTO_MD4 is not set
+# CONFIG_CRYPTO_MD5 is not set
+# CONFIG_CRYPTO_SHA1 is not set
+# CONFIG_CRYPTO_SHA256 is not set
+# CONFIG_CRYPTO_SHA512 is not set
+# CONFIG_CRYPTO_WP512 is not set
+# CONFIG_CRYPTO_TGR192 is not set
+# CONFIG_CRYPTO_GF128MUL is not set
+# CONFIG_CRYPTO_ECB is not set
+# CONFIG_CRYPTO_CBC is not set
+# CONFIG_CRYPTO_PCBC is not set
+# CONFIG_CRYPTO_LRW is not set
+# CONFIG_CRYPTO_XTS is not set
+# CONFIG_CRYPTO_CTR is not set
+# CONFIG_CRYPTO_GCM is not set
+# CONFIG_CRYPTO_CCM is not set
+# CONFIG_CRYPTO_CRYPTD is not set
+# CONFIG_CRYPTO_DES is not set
+# CONFIG_CRYPTO_FCRYPT is not set
+# CONFIG_CRYPTO_BLOWFISH is not set
+# CONFIG_CRYPTO_TWOFISH is not set
+# CONFIG_CRYPTO_SERPENT is not set
+# CONFIG_CRYPTO_AES is not set
+# CONFIG_CRYPTO_CAST5 is not set
+# CONFIG_CRYPTO_CAST6 is not set
+# CONFIG_CRYPTO_TEA is not set
+# CONFIG_CRYPTO_ARC4 is not set
+# CONFIG_CRYPTO_KHAZAD is not set
+# CONFIG_CRYPTO_ANUBIS is not set
+# CONFIG_CRYPTO_SEED is not set
+# CONFIG_CRYPTO_SALSA20 is not set
+# CONFIG_CRYPTO_DEFLATE is not set
+# CONFIG_CRYPTO_MICHAEL_MIC is not set
+# CONFIG_CRYPTO_CRC32C is not set
+# CONFIG_CRYPTO_CAMELLIA is not set
+# CONFIG_CRYPTO_AUTHENC is not set
+# CONFIG_CRYPTO_LZO is not set
+CONFIG_CRYPTO_HW=y
+# CONFIG_PPC_CLOCK is not set
+CONFIG_PPC_LIB_RHEAP=y
similarity index 99%
rename from arch/powerpc/configs/mpc8544_ds_defconfig
rename to arch/powerpc/configs/85xx/mpc8544_ds_defconfig
index 418bcdb5f919be1d5f99832fca6246409c0d1361..a9f113b243ae9acfb27da79ecf9e7e1e1d8a6350 100644 (file)
@@ -162,6 +162,7 @@ CONFIG_MPC85xx=y
 # CONFIG_MPC85xx_CDS is not set
 # CONFIG_MPC85xx_MDS is not set
 CONFIG_MPC85xx_DS=y
+# CONFIG_KSI8560 is not set
 # CONFIG_STX_GP3 is not set
 # CONFIG_TQM8540 is not set
 # CONFIG_TQM8541 is not set
@@ -202,6 +203,7 @@ CONFIG_PREEMPT_NONE=y
 # CONFIG_PREEMPT is not set
 CONFIG_BINFMT_ELF=y
 CONFIG_BINFMT_MISC=m
+CONFIG_FORCE_MAX_ZONEORDER=11
 CONFIG_MATH_EMULATION=y
 # CONFIG_IOMMU_HELPER is not set
 CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
@@ -1255,7 +1257,19 @@ CONFIG_RTC_DRV_CMOS=y
 #
 # on-CPU RTC drivers
 #
-# CONFIG_DMADEVICES is not set
+CONFIG_DMADEVICES=y
+
+#
+# DMA Devices
+#
+CONFIG_FSL_DMA=y
+# CONFIG_FSL_DMA_SELFTEST is not set
+CONFIG_DMA_ENGINE=y
+
+#
+# DMA Clients
+#
+# CONFIG_NET_DMA is not set
 
 #
 # Userspace I/O
@@ -1447,6 +1461,7 @@ CONFIG_PLIST=y
 CONFIG_HAS_IOMEM=y
 CONFIG_HAS_IOPORT=y
 CONFIG_HAS_DMA=y
+CONFIG_HAVE_LMB=y
 
 #
 # Kernel hacking
index 38b85b211c38c25be81b0309e0fa1fc61e2ab3c5..d7fd298bd234aa2cb0c11ab262355274791dd922 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
 # Linux kernel version: 2.6.25-rc6
-# Thu Mar 20 10:33:36 2008
+# Thu Mar 27 13:55:37 2008
 #
 # CONFIG_PPC64 is not set
 
@@ -74,8 +74,6 @@ CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=15
 # CONFIG_CGROUPS is not set
 # CONFIG_GROUP_SCHED is not set
-# CONFIG_USER_SCHED is not set
-# CONFIG_CGROUP_SCHED is not set
 CONFIG_SYSFS_DEPRECATED=y
 CONFIG_SYSFS_DEPRECATED_V2=y
 # CONFIG_RELAY is not set
@@ -243,7 +241,7 @@ CONFIG_PCI_SYSCALL=y
 # CONFIG_PCIEPORTBUS is not set
 CONFIG_ARCH_SUPPORTS_MSI=y
 # CONFIG_PCI_MSI is not set
-CONFIG_PCI_LEGACY=y
+# CONFIG_PCI_LEGACY is not set
 # CONFIG_PCI_DEBUG is not set
 # CONFIG_PCCARD is not set
 # CONFIG_HOTPLUG_PCI is not set
@@ -1328,6 +1326,7 @@ CONFIG_PLIST=y
 CONFIG_HAS_IOMEM=y
 CONFIG_HAS_IOPORT=y
 CONFIG_HAS_DMA=y
+CONFIG_HAVE_LMB=y
 
 #
 # Kernel hacking
index 0f82f66a60f89b64960774c7e2868aae630eebf3..a20501f89474a009cfed6420a0dbaad570ff4f4d 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
 # Linux kernel version: 2.6.25-rc6
-# Thu Mar 20 10:36:41 2008
+# Thu Mar 27 13:55:43 2008
 #
 CONFIG_PPC64=y
 
@@ -77,8 +77,6 @@ CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=17
 # CONFIG_CGROUPS is not set
 # CONFIG_GROUP_SCHED is not set
-# CONFIG_USER_SCHED is not set
-# CONFIG_CGROUP_SCHED is not set
 CONFIG_SYSFS_DEPRECATED=y
 CONFIG_SYSFS_DEPRECATED_V2=y
 # CONFIG_RELAY is not set
@@ -276,7 +274,7 @@ CONFIG_PCI_SYSCALL=y
 # CONFIG_PCIEPORTBUS is not set
 CONFIG_ARCH_SUPPORTS_MSI=y
 CONFIG_PCI_MSI=y
-CONFIG_PCI_LEGACY=y
+# CONFIG_PCI_LEGACY is not set
 # CONFIG_PCI_DEBUG is not set
 # CONFIG_PCCARD is not set
 # CONFIG_HOTPLUG_PCI is not set
@@ -1596,6 +1594,7 @@ CONFIG_PLIST=y
 CONFIG_HAS_IOMEM=y
 CONFIG_HAS_IOPORT=y
 CONFIG_HAS_DMA=y
+CONFIG_HAVE_LMB=y
 
 #
 # Kernel hacking
index 8d9a84f50157b1982355cd77dceaac95296b0475..b3128fb7ce7e037a430a24c7cb25428b8cd10d07 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
 # Linux kernel version: 2.6.25-rc6
-# Thu Mar 20 10:43:46 2008
+# Thu Mar 27 13:55:45 2008
 #
 CONFIG_PPC64=y
 
@@ -77,8 +77,6 @@ CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=17
 # CONFIG_CGROUPS is not set
 # CONFIG_GROUP_SCHED is not set
-# CONFIG_USER_SCHED is not set
-# CONFIG_CGROUP_SCHED is not set
 CONFIG_SYSFS_DEPRECATED=y
 CONFIG_SYSFS_DEPRECATED_V2=y
 # CONFIG_RELAY is not set
@@ -261,7 +259,7 @@ CONFIG_PCI_SYSCALL=y
 # CONFIG_PCIEPORTBUS is not set
 CONFIG_ARCH_SUPPORTS_MSI=y
 # CONFIG_PCI_MSI is not set
-CONFIG_PCI_LEGACY=y
+# CONFIG_PCI_LEGACY is not set
 # CONFIG_PCI_DEBUG is not set
 # CONFIG_PCCARD is not set
 # CONFIG_HOTPLUG_PCI is not set
@@ -1065,6 +1063,7 @@ CONFIG_PLIST=y
 CONFIG_HAS_IOMEM=y
 CONFIG_HAS_IOPORT=y
 CONFIG_HAS_DMA=y
+CONFIG_HAVE_LMB=y
 
 #
 # Kernel hacking
index 8b810d056440b2c15bb29205f15a14ed341ecda5..7a166a39d92d624e3dcdbb36bcd7b8c8d921f648 100644 (file)
@@ -333,7 +333,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
 CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
 CONFIG_STANDALONE=y
 CONFIG_PREVENT_FIRMWARE_BUILD=y
-# CONFIG_FW_LOADER is not set
+CONFIG_FW_LOADER=y
 # CONFIG_DEBUG_DRIVER is not set
 # CONFIG_DEBUG_DEVRES is not set
 # CONFIG_SYS_HYPERVISOR is not set
@@ -374,6 +374,7 @@ CONFIG_BLK_DEV_IDEDISK=y
 CONFIG_BLK_DEV_IDECD=y
 # CONFIG_BLK_DEV_IDETAPE is not set
 # CONFIG_BLK_DEV_IDEFLOPPY is not set
+# CONFIG_BLK_DEV_IDESCSI is not set
 CONFIG_IDE_TASK_IOCTL=y
 CONFIG_IDE_PROC_FS=y
 
@@ -427,10 +428,129 @@ CONFIG_IDE_ARCH_OBSOLETE_INIT=y
 # SCSI device support
 #
 # CONFIG_RAID_ATTRS is not set
-# CONFIG_SCSI is not set
-# CONFIG_SCSI_DMA is not set
+CONFIG_SCSI=y
+CONFIG_SCSI_DMA=y
+# CONFIG_SCSI_TGT is not set
 # CONFIG_SCSI_NETLINK is not set
-# CONFIG_ATA is not set
+# CONFIG_SCSI_PROC_FS is not set
+
+#
+# SCSI support type (disk, tape, CD-ROM)
+#
+CONFIG_BLK_DEV_SD=y
+# CONFIG_CHR_DEV_ST is not set
+# CONFIG_CHR_DEV_OSST is not set
+# CONFIG_BLK_DEV_SR is not set
+CONFIG_CHR_DEV_SG=y
+# CONFIG_CHR_DEV_SCH is not set
+
+#
+# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
+#
+# CONFIG_SCSI_MULTI_LUN is not set
+# CONFIG_SCSI_CONSTANTS is not set
+# CONFIG_SCSI_LOGGING is not set
+# CONFIG_SCSI_SCAN_ASYNC is not set
+CONFIG_SCSI_WAIT_SCAN=m
+
+#
+# SCSI Transports
+#
+# CONFIG_SCSI_SPI_ATTRS is not set
+# CONFIG_SCSI_FC_ATTRS is not set
+# CONFIG_SCSI_ISCSI_ATTRS is not set
+# CONFIG_SCSI_SAS_LIBSAS is not set
+# CONFIG_SCSI_SRP_ATTRS is not set
+CONFIG_SCSI_LOWLEVEL=y
+# CONFIG_ISCSI_TCP is not set
+# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
+# CONFIG_SCSI_3W_9XXX is not set
+# CONFIG_SCSI_ACARD is not set
+# CONFIG_SCSI_AACRAID is not set
+# CONFIG_SCSI_AIC7XXX is not set
+# CONFIG_SCSI_AIC7XXX_OLD is not set
+# CONFIG_SCSI_AIC79XX is not set
+# CONFIG_SCSI_AIC94XX is not set
+# CONFIG_SCSI_ARCMSR is not set
+# CONFIG_MEGARAID_NEWGEN is not set
+# CONFIG_MEGARAID_LEGACY is not set
+# CONFIG_MEGARAID_SAS is not set
+# CONFIG_SCSI_HPTIOP is not set
+# CONFIG_SCSI_DMX3191D is not set
+# CONFIG_SCSI_EATA is not set
+# CONFIG_SCSI_FUTURE_DOMAIN is not set
+# CONFIG_SCSI_GDTH is not set
+# CONFIG_SCSI_IPS is not set
+# CONFIG_SCSI_INITIO is not set
+# CONFIG_SCSI_INIA100 is not set
+# CONFIG_SCSI_STEX is not set
+# CONFIG_SCSI_SYM53C8XX_2 is not set
+CONFIG_SCSI_IPR=y
+CONFIG_SCSI_IPR_TRACE=y
+CONFIG_SCSI_IPR_DUMP=y
+# CONFIG_SCSI_QLOGIC_1280 is not set
+# CONFIG_SCSI_QLA_FC is not set
+# CONFIG_SCSI_QLA_ISCSI is not set
+# CONFIG_SCSI_LPFC is not set
+# CONFIG_SCSI_DC395x is not set
+# CONFIG_SCSI_DC390T is not set
+# CONFIG_SCSI_DEBUG is not set
+# CONFIG_SCSI_SRP is not set
+CONFIG_ATA=y
+CONFIG_ATA_NONSTANDARD=y
+# CONFIG_SATA_AHCI is not set
+# CONFIG_SATA_SVW is not set
+# CONFIG_ATA_PIIX is not set
+# CONFIG_SATA_MV is not set
+# CONFIG_SATA_NV is not set
+# CONFIG_PDC_ADMA is not set
+# CONFIG_SATA_QSTOR is not set
+# CONFIG_SATA_PROMISE is not set
+# CONFIG_SATA_SX4 is not set
+# CONFIG_SATA_SIL is not set
+# CONFIG_SATA_SIL24 is not set
+# CONFIG_SATA_SIS is not set
+# CONFIG_SATA_ULI is not set
+# CONFIG_SATA_VIA is not set
+# CONFIG_SATA_VITESSE is not set
+# CONFIG_SATA_INIC162X is not set
+# CONFIG_PATA_ALI is not set
+# CONFIG_PATA_AMD is not set
+# CONFIG_PATA_ARTOP is not set
+# CONFIG_PATA_ATIIXP is not set
+# CONFIG_PATA_CMD640_PCI is not set
+# CONFIG_PATA_CMD64X is not set
+# CONFIG_PATA_CS5520 is not set
+# CONFIG_PATA_CS5530 is not set
+# CONFIG_PATA_CYPRESS is not set
+# CONFIG_PATA_EFAR is not set
+# CONFIG_ATA_GENERIC is not set
+# CONFIG_PATA_HPT366 is not set
+# CONFIG_PATA_HPT37X is not set
+# CONFIG_PATA_HPT3X2N is not set
+# CONFIG_PATA_HPT3X3 is not set
+# CONFIG_PATA_IT821X is not set
+# CONFIG_PATA_IT8213 is not set
+# CONFIG_PATA_JMICRON is not set
+# CONFIG_PATA_TRIFLEX is not set
+# CONFIG_PATA_MARVELL is not set
+# CONFIG_PATA_MPIIX is not set
+# CONFIG_PATA_OLDPIIX is not set
+# CONFIG_PATA_NETCELL is not set
+# CONFIG_PATA_NS87410 is not set
+# CONFIG_PATA_NS87415 is not set
+# CONFIG_PATA_OPTI is not set
+# CONFIG_PATA_OPTIDMA is not set
+# CONFIG_PATA_PDC_OLD is not set
+# CONFIG_PATA_RADISYS is not set
+# CONFIG_PATA_RZ1000 is not set
+# CONFIG_PATA_SC1200 is not set
+# CONFIG_PATA_SERVERWORKS is not set
+# CONFIG_PATA_PDC2027X is not set
+# CONFIG_PATA_SIL680 is not set
+# CONFIG_PATA_SIS is not set
+# CONFIG_PATA_VIA is not set
+# CONFIG_PATA_WINBOND is not set
 # CONFIG_MD is not set
 # CONFIG_FUSION is not set
 
@@ -536,6 +656,7 @@ CONFIG_USB_PEGASUS=y
 # CONFIG_HIPPI is not set
 # CONFIG_PPP is not set
 # CONFIG_SLIP is not set
+# CONFIG_NET_FC is not set
 # CONFIG_SHAPER is not set
 # CONFIG_NETCONSOLE is not set
 # CONFIG_NETPOLL is not set
@@ -783,12 +904,14 @@ CONFIG_USB_UHCI_HCD=y
 #
 # may also be needed; see USB_STORAGE Help for more information
 #
+# CONFIG_USB_STORAGE is not set
 # CONFIG_USB_LIBUSUAL is not set
 
 #
 # USB Imaging devices
 #
 # CONFIG_USB_MDC800 is not set
+# CONFIG_USB_MICROTEK is not set
 CONFIG_USB_MON=y
 
 #
index 029d2dab7debc2ad59bb6d0369e14ca53b236c42..9e0dd82016910710305cbc8606e61d9af975c578 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.25-rc6
-# Mon Mar 24 08:48:25 2008
+# Linux kernel version: 2.6.25-rc9
+# Tue Apr 15 18:07:36 2008
 #
 # CONFIG_PPC64 is not set
 
@@ -201,6 +201,7 @@ CONFIG_PREEMPT_NONE=y
 # CONFIG_PREEMPT is not set
 CONFIG_BINFMT_ELF=y
 # CONFIG_BINFMT_MISC is not set
+CONFIG_FORCE_MAX_ZONEORDER=11
 CONFIG_MATH_EMULATION=y
 # CONFIG_IOMMU_HELPER is not set
 CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
@@ -353,7 +354,90 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
 # CONFIG_FW_LOADER is not set
 # CONFIG_SYS_HYPERVISOR is not set
 # CONFIG_CONNECTOR is not set
-# CONFIG_MTD is not set
+CONFIG_MTD=y
+# CONFIG_MTD_DEBUG is not set
+# CONFIG_MTD_CONCAT is not set
+CONFIG_MTD_PARTITIONS=y
+# CONFIG_MTD_REDBOOT_PARTS is not set
+# CONFIG_MTD_CMDLINE_PARTS is not set
+CONFIG_MTD_OF_PARTS=y
+
+#
+# User Modules And Translation Layers
+#
+CONFIG_MTD_CHAR=y
+CONFIG_MTD_BLKDEVS=y
+CONFIG_MTD_BLOCK=y
+# CONFIG_FTL is not set
+# CONFIG_NFTL is not set
+# CONFIG_INFTL is not set
+# CONFIG_RFD_FTL is not set
+# CONFIG_SSFDC is not set
+# CONFIG_MTD_OOPS is not set
+
+#
+# RAM/ROM/Flash chip drivers
+#
+CONFIG_MTD_CFI=y
+# CONFIG_MTD_JEDECPROBE is not set
+CONFIG_MTD_GEN_PROBE=y
+# CONFIG_MTD_CFI_ADV_OPTIONS is not set
+CONFIG_MTD_MAP_BANK_WIDTH_1=y
+CONFIG_MTD_MAP_BANK_WIDTH_2=y
+CONFIG_MTD_MAP_BANK_WIDTH_4=y
+# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
+CONFIG_MTD_CFI_I1=y
+CONFIG_MTD_CFI_I2=y
+# CONFIG_MTD_CFI_I4 is not set
+# CONFIG_MTD_CFI_I8 is not set
+# CONFIG_MTD_CFI_INTELEXT is not set
+CONFIG_MTD_CFI_AMDSTD=y
+# CONFIG_MTD_CFI_STAA is not set
+CONFIG_MTD_CFI_UTIL=y
+# CONFIG_MTD_RAM is not set
+# CONFIG_MTD_ROM is not set
+# CONFIG_MTD_ABSENT is not set
+
+#
+# Mapping drivers for chip access
+#
+# CONFIG_MTD_COMPLEX_MAPPINGS is not set
+# CONFIG_MTD_PHYSMAP is not set
+CONFIG_MTD_PHYSMAP_OF=y
+# CONFIG_MTD_PLATRAM is not set
+
+#
+# Self-contained MTD device drivers
+#
+# CONFIG_MTD_SLRAM is not set
+# CONFIG_MTD_PHRAM is not set
+# CONFIG_MTD_MTDRAM is not set
+# CONFIG_MTD_BLOCK2MTD is not set
+
+#
+# Disk-On-Chip Device Drivers
+#
+# CONFIG_MTD_DOC2000 is not set
+# CONFIG_MTD_DOC2001 is not set
+# CONFIG_MTD_DOC2001PLUS is not set
+CONFIG_MTD_NAND=y
+CONFIG_MTD_NAND_VERIFY_WRITE=y
+# CONFIG_MTD_NAND_ECC_SMC is not set
+# CONFIG_MTD_NAND_MUSEUM_IDS is not set
+CONFIG_MTD_NAND_IDS=y
+# CONFIG_MTD_NAND_DISKONCHIP is not set
+# CONFIG_MTD_NAND_NANDSIM is not set
+# CONFIG_MTD_NAND_PLATFORM is not set
+# CONFIG_MTD_ALAUDA is not set
+CONFIG_MTD_NAND_FSL_ELBC=y
+# CONFIG_MTD_ONENAND is not set
+
+#
+# UBI - Unsorted block images
+#
+# CONFIG_MTD_UBI is not set
 CONFIG_OF_DEVICE=y
 # CONFIG_PARPORT is not set
 CONFIG_BLK_DEV=y
@@ -362,6 +446,7 @@ CONFIG_BLK_DEV=y
 CONFIG_BLK_DEV_LOOP=y
 # CONFIG_BLK_DEV_CRYPTOLOOP is not set
 # CONFIG_BLK_DEV_NBD is not set
+# CONFIG_BLK_DEV_UB is not set
 CONFIG_BLK_DEV_RAM=y
 CONFIG_BLK_DEV_RAM_COUNT=16
 CONFIG_BLK_DEV_RAM_SIZE=32768
@@ -469,6 +554,15 @@ CONFIG_NETDEV_10000=y
 #
 # CONFIG_WLAN_PRE80211 is not set
 # CONFIG_WLAN_80211 is not set
+
+#
+# USB Network Adapters
+#
+# CONFIG_USB_CATC is not set
+# CONFIG_USB_KAWETH is not set
+# CONFIG_USB_PEGASUS is not set
+# CONFIG_USB_RTL8150 is not set
+# CONFIG_USB_USBNET is not set
 # CONFIG_WAN is not set
 # CONFIG_PPP is not set
 # CONFIG_SLIP is not set
@@ -563,6 +657,7 @@ CONFIG_I2C_MPC=y
 # CONFIG_I2C_SIMTEC is not set
 # CONFIG_I2C_TAOS_EVM is not set
 # CONFIG_I2C_STUB is not set
+# CONFIG_I2C_TINY_USB is not set
 
 #
 # Miscellaneous I2C Chip support
@@ -647,6 +742,11 @@ CONFIG_WATCHDOG=y
 # CONFIG_SOFT_WATCHDOG is not set
 CONFIG_83xx_WDT=y
 
+#
+# USB-based Watchdog Cards
+#
+# CONFIG_USBPCWATCHDOG is not set
+
 #
 # Sonics Silicon Backplane
 #
@@ -664,6 +764,7 @@ CONFIG_SSB_POSSIBLE=y
 # CONFIG_VIDEO_DEV is not set
 # CONFIG_DVB_CORE is not set
 CONFIG_DAB=y
+# CONFIG_USB_DABUSB is not set
 
 #
 # Graphics support
@@ -686,6 +787,14 @@ CONFIG_HID_SUPPORT=y
 CONFIG_HID=y
 # CONFIG_HID_DEBUG is not set
 # CONFIG_HIDRAW is not set
+
+#
+# USB Input Devices
+#
+CONFIG_USB_HID=y
+# CONFIG_USB_HIDINPUT_POWERBOOK is not set
+# CONFIG_HID_FF is not set
+# CONFIG_USB_HIDDEV is not set
 CONFIG_USB_SUPPORT=y
 CONFIG_USB_ARCH_HAS_HCD=y
 # CONFIG_USB_ARCH_HAS_OHCI is not set
@@ -714,9 +823,56 @@ CONFIG_USB_EHCI_HCD_PPC_OF=y
 # CONFIG_USB_SL811_HCD is not set
 # CONFIG_USB_R8A66597_HCD is not set
 
+#
+# USB Device Class drivers
+#
+# CONFIG_USB_ACM is not set
+# CONFIG_USB_PRINTER is not set
+
 #
 # NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
 #
+
+#
+# may also be needed; see USB_STORAGE Help for more information
+#
+# CONFIG_USB_STORAGE is not set
+# CONFIG_USB_LIBUSUAL is not set
+
+#
+# USB Imaging devices
+#
+# CONFIG_USB_MDC800 is not set
+# CONFIG_USB_MICROTEK is not set
+CONFIG_USB_MON=y
+
+#
+# USB port drivers
+#
+# CONFIG_USB_SERIAL is not set
+
+#
+# USB Miscellaneous drivers
+#
+# CONFIG_USB_EMI62 is not set
+# CONFIG_USB_EMI26 is not set
+# CONFIG_USB_ADUTUX is not set
+# CONFIG_USB_AUERSWALD is not set
+# CONFIG_USB_RIO500 is not set
+# CONFIG_USB_LEGOTOWER is not set
+# CONFIG_USB_LCD is not set
+# CONFIG_USB_BERRY_CHARGE is not set
+# CONFIG_USB_LED is not set
+# CONFIG_USB_CYPRESS_CY7C63 is not set
+# CONFIG_USB_CYTHERM is not set
+# CONFIG_USB_PHIDGET is not set
+# CONFIG_USB_IDMOUSE is not set
+# CONFIG_USB_FTDI_ELAN is not set
+# CONFIG_USB_APPLEDISPLAY is not set
+# CONFIG_USB_SISUSBVGA is not set
+# CONFIG_USB_LD is not set
+# CONFIG_USB_TRANCEVIBRATOR is not set
+# CONFIG_USB_IOWARRIOR is not set
 # CONFIG_USB_GADGET is not set
 # CONFIG_MMC is not set
 # CONFIG_MEMSTICK is not set
@@ -792,6 +948,7 @@ CONFIG_TMPFS=y
 # CONFIG_BEFS_FS is not set
 # CONFIG_BFS_FS is not set
 # CONFIG_EFS_FS is not set
+# CONFIG_JFFS2_FS is not set
 # CONFIG_CRAMFS is not set
 # CONFIG_VXFS_FS is not set
 # CONFIG_MINIX_FS is not set
@@ -862,6 +1019,7 @@ CONFIG_PLIST=y
 CONFIG_HAS_IOMEM=y
 CONFIG_HAS_IOPORT=y
 CONFIG_HAS_DMA=y
+CONFIG_HAVE_LMB=y
 
 #
 # Kernel hacking
index 558b0d348d4f4e34363299262057ca5ed08df08c..fca114252ac71b4a3081729dfca305986e65fd03 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
 # Linux kernel version: 2.6.25-rc6
-# Thu Mar 20 11:05:14 2008
+# Thu Mar 27 13:56:21 2008
 #
 # CONFIG_PPC64 is not set
 
@@ -77,8 +77,6 @@ CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_CGROUPS is not set
 # CONFIG_GROUP_SCHED is not set
-# CONFIG_USER_SCHED is not set
-# CONFIG_CGROUP_SCHED is not set
 CONFIG_SYSFS_DEPRECATED=y
 CONFIG_SYSFS_DEPRECATED_V2=y
 # CONFIG_RELAY is not set
@@ -272,7 +270,7 @@ CONFIG_PCI_SYSCALL=y
 # CONFIG_PCIEPORTBUS is not set
 CONFIG_ARCH_SUPPORTS_MSI=y
 # CONFIG_PCI_MSI is not set
-CONFIG_PCI_LEGACY=y
+# CONFIG_PCI_LEGACY is not set
 # CONFIG_PCI_DEBUG is not set
 CONFIG_PCCARD=m
 # CONFIG_PCMCIA_DEBUG is not set
@@ -1895,6 +1893,7 @@ CONFIG_PLIST=y
 CONFIG_HAS_IOMEM=y
 CONFIG_HAS_IOPORT=y
 CONFIG_HAS_DMA=y
+CONFIG_HAVE_LMB=y
 
 #
 # Kernel hacking
diff --git a/arch/powerpc/configs/ppc40x_defconfig b/arch/powerpc/configs/ppc40x_defconfig
new file mode 100644 (file)
index 0000000..9d0140e
--- /dev/null
@@ -0,0 +1,896 @@
+#
+# Automatically generated make config: don't edit
+# Linux kernel version: 2.6.25-rc9
+# Tue Apr 15 08:46:44 2008
+#
+# CONFIG_PPC64 is not set
+
+#
+# Processor support
+#
+# CONFIG_6xx is not set
+# CONFIG_PPC_85xx is not set
+# CONFIG_PPC_8xx is not set
+CONFIG_40x=y
+# CONFIG_44x is not set
+# CONFIG_E200 is not set
+CONFIG_4xx=y
+# CONFIG_PPC_MM_SLICES is not set
+CONFIG_NOT_COHERENT_CACHE=y
+CONFIG_PPC32=y
+CONFIG_WORD_SIZE=32
+CONFIG_PPC_MERGE=y
+CONFIG_MMU=y
+CONFIG_GENERIC_CMOS_UPDATE=y
+CONFIG_GENERIC_TIME=y
+CONFIG_GENERIC_TIME_VSYSCALL=y
+CONFIG_GENERIC_CLOCKEVENTS=y
+CONFIG_GENERIC_HARDIRQS=y
+# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
+CONFIG_IRQ_PER_CPU=y
+CONFIG_RWSEM_XCHGADD_ALGORITHM=y
+CONFIG_ARCH_HAS_ILOG2_U32=y
+CONFIG_GENERIC_HWEIGHT=y
+CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_GENERIC_FIND_NEXT_BIT=y
+# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
+CONFIG_PPC=y
+CONFIG_EARLY_PRINTK=y
+CONFIG_GENERIC_NVRAM=y
+CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
+CONFIG_ARCH_MAY_HAVE_PC_FDC=y
+CONFIG_PPC_OF=y
+CONFIG_OF=y
+CONFIG_PPC_UDBG_16550=y
+# CONFIG_GENERIC_TBSYNC is not set
+CONFIG_AUDIT_ARCH=y
+CONFIG_GENERIC_BUG=y
+# CONFIG_DEFAULT_UIMAGE is not set
+CONFIG_PPC_DCR_NATIVE=y
+# CONFIG_PPC_DCR_MMIO is not set
+CONFIG_PPC_DCR=y
+CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
+
+#
+# General setup
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_BROKEN_ON_SMP=y
+CONFIG_INIT_ENV_ARG_LIMIT=32
+CONFIG_LOCALVERSION=""
+CONFIG_LOCALVERSION_AUTO=y
+CONFIG_SWAP=y
+CONFIG_SYSVIPC=y
+CONFIG_SYSVIPC_SYSCTL=y
+CONFIG_POSIX_MQUEUE=y
+# CONFIG_BSD_PROCESS_ACCT is not set
+# CONFIG_TASKSTATS is not set
+# CONFIG_AUDIT is not set
+# CONFIG_IKCONFIG is not set
+CONFIG_LOG_BUF_SHIFT=14
+# CONFIG_CGROUPS is not set
+CONFIG_GROUP_SCHED=y
+CONFIG_FAIR_GROUP_SCHED=y
+# CONFIG_RT_GROUP_SCHED is not set
+CONFIG_USER_SCHED=y
+# CONFIG_CGROUP_SCHED is not set
+CONFIG_SYSFS_DEPRECATED=y
+CONFIG_SYSFS_DEPRECATED_V2=y
+# CONFIG_RELAY is not set
+# CONFIG_NAMESPACES is not set
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_INITRAMFS_SOURCE=""
+# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
+CONFIG_SYSCTL=y
+CONFIG_EMBEDDED=y
+CONFIG_SYSCTL_SYSCALL=y
+CONFIG_KALLSYMS=y
+CONFIG_KALLSYMS_ALL=y
+CONFIG_KALLSYMS_EXTRA_PASS=y
+CONFIG_HOTPLUG=y
+CONFIG_PRINTK=y
+CONFIG_BUG=y
+CONFIG_ELF_CORE=y
+CONFIG_COMPAT_BRK=y
+CONFIG_BASE_FULL=y
+CONFIG_FUTEX=y
+CONFIG_ANON_INODES=y
+CONFIG_EPOLL=y
+CONFIG_SIGNALFD=y
+CONFIG_TIMERFD=y
+CONFIG_EVENTFD=y
+CONFIG_SHMEM=y
+CONFIG_VM_EVENT_COUNTERS=y
+CONFIG_SLUB_DEBUG=y
+# CONFIG_SLAB is not set
+CONFIG_SLUB=y
+# CONFIG_SLOB is not set
+# CONFIG_PROFILING is not set
+# CONFIG_MARKERS is not set
+CONFIG_HAVE_OPROFILE=y
+# CONFIG_KPROBES is not set
+CONFIG_HAVE_KPROBES=y
+CONFIG_HAVE_KRETPROBES=y
+CONFIG_PROC_PAGE_MONITOR=y
+CONFIG_SLABINFO=y
+CONFIG_RT_MUTEXES=y
+# CONFIG_TINY_SHMEM is not set
+CONFIG_BASE_SMALL=0
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+# CONFIG_MODULE_FORCE_UNLOAD is not set
+# CONFIG_MODVERSIONS is not set
+# CONFIG_MODULE_SRCVERSION_ALL is not set
+CONFIG_KMOD=y
+CONFIG_BLOCK=y
+CONFIG_LBD=y
+# CONFIG_BLK_DEV_IO_TRACE is not set
+# CONFIG_LSF is not set
+# CONFIG_BLK_DEV_BSG is not set
+
+#
+# IO Schedulers
+#
+CONFIG_IOSCHED_NOOP=y
+CONFIG_IOSCHED_AS=y
+CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
+CONFIG_DEFAULT_AS=y
+# CONFIG_DEFAULT_DEADLINE is not set
+# CONFIG_DEFAULT_CFQ is not set
+# CONFIG_DEFAULT_NOOP is not set
+CONFIG_DEFAULT_IOSCHED="anticipatory"
+CONFIG_CLASSIC_RCU=y
+CONFIG_PPC4xx_PCI_EXPRESS=y
+
+#
+# Platform support
+#
+# CONFIG_PPC_MPC512x is not set
+# CONFIG_PPC_MPC5121 is not set
+# CONFIG_PPC_CELL is not set
+# CONFIG_PPC_CELL_NATIVE is not set
+# CONFIG_PQ2ADS is not set
+CONFIG_EP405=y
+CONFIG_KILAUEA=y
+CONFIG_MAKALU=y
+CONFIG_WALNUT=y
+CONFIG_XILINX_VIRTEX_GENERIC_BOARD=y
+CONFIG_405GP=y
+CONFIG_405EX=y
+CONFIG_XILINX_VIRTEX=y
+CONFIG_XILINX_VIRTEX_II_PRO=y
+CONFIG_XILINX_VIRTEX_4_FX=y
+CONFIG_IBM405_ERR77=y
+CONFIG_IBM405_ERR51=y
+# CONFIG_IPIC is not set
+# CONFIG_MPIC is not set
+# CONFIG_MPIC_WEIRD is not set
+# CONFIG_PPC_I8259 is not set
+# CONFIG_PPC_RTAS is not set
+# CONFIG_MMIO_NVRAM is not set
+# CONFIG_PPC_MPC106 is not set
+# CONFIG_PPC_970_NAP is not set
+# CONFIG_PPC_INDIRECT_IO is not set
+# CONFIG_GENERIC_IOMAP is not set
+# CONFIG_CPU_FREQ is not set
+# CONFIG_FSL_ULI1575 is not set
+CONFIG_OF_RTC=y
+
+#
+# Kernel options
+#
+# CONFIG_HIGHMEM is not set
+# CONFIG_TICK_ONESHOT is not set
+# CONFIG_NO_HZ is not set
+# CONFIG_HIGH_RES_TIMERS is not set
+CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
+# CONFIG_HZ_100 is not set
+CONFIG_HZ_250=y
+# CONFIG_HZ_300 is not set
+# CONFIG_HZ_1000 is not set
+CONFIG_HZ=250
+# CONFIG_SCHED_HRTICK is not set
+CONFIG_PREEMPT_NONE=y
+# CONFIG_PREEMPT_VOLUNTARY is not set
+# CONFIG_PREEMPT is not set
+CONFIG_BINFMT_ELF=y
+# CONFIG_BINFMT_MISC is not set
+# CONFIG_MATH_EMULATION is not set
+# CONFIG_IOMMU_HELPER is not set
+CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
+CONFIG_ARCH_HAS_WALK_MEMORY=y
+CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
+CONFIG_ARCH_FLATMEM_ENABLE=y
+CONFIG_ARCH_POPULATES_NODE_MAP=y
+CONFIG_SELECT_MEMORY_MODEL=y
+CONFIG_FLATMEM_MANUAL=y
+# CONFIG_DISCONTIGMEM_MANUAL is not set
+# CONFIG_SPARSEMEM_MANUAL is not set
+CONFIG_FLATMEM=y
+CONFIG_FLAT_NODE_MEM_MAP=y
+# CONFIG_SPARSEMEM_STATIC is not set
+# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
+CONFIG_SPLIT_PTLOCK_CPUS=4
+CONFIG_RESOURCES_64BIT=y
+CONFIG_ZONE_DMA_FLAG=1
+CONFIG_BOUNCE=y
+CONFIG_VIRT_TO_BUS=y
+CONFIG_FORCE_MAX_ZONEORDER=11
+CONFIG_PROC_DEVICETREE=y
+# CONFIG_CMDLINE_BOOL is not set
+# CONFIG_PM is not set
+CONFIG_SECCOMP=y
+CONFIG_ISA_DMA_API=y
+
+#
+# Bus options
+#
+CONFIG_ZONE_DMA=y
+CONFIG_PPC_INDIRECT_PCI=y
+CONFIG_4xx_SOC=y
+CONFIG_PCI=y
+CONFIG_PCI_DOMAINS=y
+CONFIG_PCI_SYSCALL=y
+# CONFIG_PCIEPORTBUS is not set
+CONFIG_ARCH_SUPPORTS_MSI=y
+# CONFIG_PCI_MSI is not set
+# CONFIG_PCI_LEGACY is not set
+# CONFIG_PCI_DEBUG is not set
+# CONFIG_PCCARD is not set
+# CONFIG_HOTPLUG_PCI is not set
+
+#
+# Advanced setup
+#
+# CONFIG_ADVANCED_OPTIONS is not set
+
+#
+# Default settings for advanced configuration options are used
+#
+CONFIG_HIGHMEM_START=0xfe000000
+CONFIG_LOWMEM_SIZE=0x30000000
+CONFIG_KERNEL_START=0xc0000000
+CONFIG_TASK_SIZE=0xc0000000
+CONFIG_CONSISTENT_START=0xff100000
+CONFIG_CONSISTENT_SIZE=0x00200000
+CONFIG_BOOT_LOAD=0x00400000
+
+#
+# Networking
+#
+CONFIG_NET=y
+
+#
+# Networking options
+#
+CONFIG_PACKET=y
+# CONFIG_PACKET_MMAP is not set
+CONFIG_UNIX=y
+# CONFIG_NET_KEY is not set
+CONFIG_INET=y
+# CONFIG_IP_MULTICAST is not set
+# CONFIG_IP_ADVANCED_ROUTER is not set
+CONFIG_IP_FIB_HASH=y
+CONFIG_IP_PNP=y
+CONFIG_IP_PNP_DHCP=y
+CONFIG_IP_PNP_BOOTP=y
+# CONFIG_IP_PNP_RARP is not set
+# CONFIG_NET_IPIP is not set
+# CONFIG_NET_IPGRE is not set
+# CONFIG_ARPD is not set
+# CONFIG_SYN_COOKIES is not set
+# CONFIG_INET_AH is not set
+# CONFIG_INET_ESP is not set
+# CONFIG_INET_IPCOMP is not set
+# CONFIG_INET_XFRM_TUNNEL is not set
+# CONFIG_INET_TUNNEL is not set
+# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
+# CONFIG_INET_XFRM_MODE_TUNNEL is not set
+# CONFIG_INET_XFRM_MODE_BEET is not set
+# CONFIG_INET_LRO is not set
+CONFIG_INET_DIAG=y
+CONFIG_INET_TCP_DIAG=y
+# CONFIG_TCP_CONG_ADVANCED is not set
+CONFIG_TCP_CONG_CUBIC=y
+CONFIG_DEFAULT_TCP_CONG="cubic"
+# CONFIG_TCP_MD5SIG is not set
+# CONFIG_IPV6 is not set
+# CONFIG_INET6_XFRM_TUNNEL is not set
+# CONFIG_INET6_TUNNEL is not set
+# CONFIG_NETWORK_SECMARK is not set
+# CONFIG_NETFILTER is not set
+# CONFIG_IP_DCCP is not set
+# CONFIG_IP_SCTP is not set
+# CONFIG_TIPC is not set
+# CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
+# CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
+# CONFIG_LLC2 is not set
+# CONFIG_IPX is not set
+# CONFIG_ATALK is not set
+# CONFIG_X25 is not set
+# CONFIG_LAPB is not set
+# CONFIG_ECONET is not set
+# CONFIG_WAN_ROUTER is not set
+# CONFIG_NET_SCHED is not set
+
+#
+# Network testing
+#
+# CONFIG_NET_PKTGEN is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_CAN is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
+# CONFIG_AF_RXRPC is not set
+
+#
+# Wireless
+#
+# CONFIG_CFG80211 is not set
+# CONFIG_WIRELESS_EXT is not set
+# CONFIG_MAC80211 is not set
+# CONFIG_IEEE80211 is not set
+# CONFIG_RFKILL is not set
+# CONFIG_NET_9P is not set
+
+#
+# Device Drivers
+#
+
+#
+# Generic Driver Options
+#
+CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
+CONFIG_STANDALONE=y
+CONFIG_PREVENT_FIRMWARE_BUILD=y
+CONFIG_FW_LOADER=y
+# CONFIG_DEBUG_DRIVER is not set
+# CONFIG_DEBUG_DEVRES is not set
+# CONFIG_SYS_HYPERVISOR is not set
+CONFIG_CONNECTOR=y
+CONFIG_PROC_EVENTS=y
+CONFIG_MTD=y
+# CONFIG_MTD_DEBUG is not set
+# CONFIG_MTD_CONCAT is not set
+CONFIG_MTD_PARTITIONS=y
+# CONFIG_MTD_REDBOOT_PARTS is not set
+CONFIG_MTD_CMDLINE_PARTS=y
+CONFIG_MTD_OF_PARTS=y
+
+#
+# User Modules And Translation Layers
+#
+CONFIG_MTD_CHAR=y
+CONFIG_MTD_BLKDEVS=m
+CONFIG_MTD_BLOCK=m
+# CONFIG_MTD_BLOCK_RO is not set
+# CONFIG_FTL is not set
+# CONFIG_NFTL is not set
+# CONFIG_INFTL is not set
+# CONFIG_RFD_FTL is not set
+# CONFIG_SSFDC is not set
+# CONFIG_MTD_OOPS is not set
+
+#
+# RAM/ROM/Flash chip drivers
+#
+CONFIG_MTD_CFI=y
+CONFIG_MTD_JEDECPROBE=y
+CONFIG_MTD_GEN_PROBE=y
+# CONFIG_MTD_CFI_ADV_OPTIONS is not set
+CONFIG_MTD_MAP_BANK_WIDTH_1=y
+CONFIG_MTD_MAP_BANK_WIDTH_2=y
+CONFIG_MTD_MAP_BANK_WIDTH_4=y
+# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
+CONFIG_MTD_CFI_I1=y
+CONFIG_MTD_CFI_I2=y
+# CONFIG_MTD_CFI_I4 is not set
+# CONFIG_MTD_CFI_I8 is not set
+# CONFIG_MTD_CFI_INTELEXT is not set
+CONFIG_MTD_CFI_AMDSTD=y
+# CONFIG_MTD_CFI_STAA is not set
+CONFIG_MTD_CFI_UTIL=y
+# CONFIG_MTD_RAM is not set
+# CONFIG_MTD_ROM is not set
+# CONFIG_MTD_ABSENT is not set
+
+#
+# Mapping drivers for chip access
+#
+# CONFIG_MTD_COMPLEX_MAPPINGS is not set
+# CONFIG_MTD_PHYSMAP is not set
+CONFIG_MTD_PHYSMAP_OF=y
+# CONFIG_MTD_INTEL_VR_NOR is not set
+# CONFIG_MTD_PLATRAM is not set
+
+#
+# Self-contained MTD device drivers
+#
+# CONFIG_MTD_PMC551 is not set
+# CONFIG_MTD_SLRAM is not set
+# CONFIG_MTD_PHRAM is not set
+# CONFIG_MTD_MTDRAM is not set
+# CONFIG_MTD_BLOCK2MTD is not set
+
+#
+# Disk-On-Chip Device Drivers
+#
+# CONFIG_MTD_DOC2000 is not set
+# CONFIG_MTD_DOC2001 is not set
+# CONFIG_MTD_DOC2001PLUS is not set
+# CONFIG_MTD_NAND is not set
+# CONFIG_MTD_ONENAND is not set
+
+#
+# UBI - Unsorted block images
+#
+# CONFIG_MTD_UBI is not set
+CONFIG_OF_DEVICE=y
+# CONFIG_PARPORT is not set
+CONFIG_BLK_DEV=y
+# CONFIG_BLK_DEV_FD is not set
+# CONFIG_BLK_CPQ_DA is not set
+# CONFIG_BLK_CPQ_CISS_DA is not set
+# CONFIG_BLK_DEV_DAC960 is not set
+# CONFIG_BLK_DEV_UMEM is not set
+# CONFIG_BLK_DEV_COW_COMMON is not set
+# CONFIG_BLK_DEV_LOOP is not set
+# CONFIG_BLK_DEV_NBD is not set
+# CONFIG_BLK_DEV_SX8 is not set
+CONFIG_BLK_DEV_RAM=y
+CONFIG_BLK_DEV_RAM_COUNT=16
+CONFIG_BLK_DEV_RAM_SIZE=35000
+# CONFIG_BLK_DEV_XIP is not set
+# CONFIG_CDROM_PKTCDVD is not set
+# CONFIG_ATA_OVER_ETH is not set
+# CONFIG_XILINX_SYSACE is not set
+CONFIG_MISC_DEVICES=y
+# CONFIG_PHANTOM is not set
+# CONFIG_EEPROM_93CX6 is not set
+# CONFIG_SGI_IOC4 is not set
+# CONFIG_TIFM_CORE is not set
+# CONFIG_ENCLOSURE_SERVICES is not set
+CONFIG_HAVE_IDE=y
+# CONFIG_IDE is not set
+
+#
+# SCSI device support
+#
+# CONFIG_RAID_ATTRS is not set
+# CONFIG_SCSI is not set
+# CONFIG_SCSI_DMA is not set
+# CONFIG_SCSI_NETLINK is not set
+# CONFIG_ATA is not set
+# CONFIG_MD is not set
+# CONFIG_FUSION is not set
+
+#
+# IEEE 1394 (FireWire) support
+#
+# CONFIG_FIREWIRE is not set
+# CONFIG_IEEE1394 is not set
+# CONFIG_I2O is not set
+# CONFIG_MACINTOSH_DRIVERS is not set
+CONFIG_NETDEVICES=y
+# CONFIG_NETDEVICES_MULTIQUEUE is not set
+# CONFIG_DUMMY is not set
+# CONFIG_BONDING is not set
+# CONFIG_MACVLAN is not set
+# CONFIG_EQUALIZER is not set
+# CONFIG_TUN is not set
+# CONFIG_VETH is not set
+# CONFIG_ARCNET is not set
+# CONFIG_PHYLIB is not set
+CONFIG_NET_ETHERNET=y
+# CONFIG_MII is not set
+# CONFIG_HAPPYMEAL is not set
+# CONFIG_SUNGEM is not set
+# CONFIG_CASSINI is not set
+# CONFIG_NET_VENDOR_3COM is not set
+# CONFIG_NET_TULIP is not set
+# CONFIG_HP100 is not set
+CONFIG_IBM_NEW_EMAC=y
+CONFIG_IBM_NEW_EMAC_RXB=128
+CONFIG_IBM_NEW_EMAC_TXB=64
+CONFIG_IBM_NEW_EMAC_POLL_WEIGHT=32
+CONFIG_IBM_NEW_EMAC_RX_COPY_THRESHOLD=256
+CONFIG_IBM_NEW_EMAC_RX_SKB_HEADROOM=0
+# CONFIG_IBM_NEW_EMAC_DEBUG is not set
+CONFIG_IBM_NEW_EMAC_ZMII=y
+CONFIG_IBM_NEW_EMAC_RGMII=y
+# CONFIG_IBM_NEW_EMAC_TAH is not set
+CONFIG_IBM_NEW_EMAC_EMAC4=y
+# CONFIG_NET_PCI is not set
+# CONFIG_B44 is not set
+CONFIG_NETDEV_1000=y
+# CONFIG_ACENIC is not set
+# CONFIG_DL2K is not set
+# CONFIG_E1000 is not set
+# CONFIG_E1000E is not set
+# CONFIG_E1000E_ENABLED is not set
+# CONFIG_IP1000 is not set
+# CONFIG_IGB is not set
+# CONFIG_NS83820 is not set
+# CONFIG_HAMACHI is not set
+# CONFIG_YELLOWFIN is not set
+# CONFIG_R8169 is not set
+# CONFIG_SIS190 is not set
+# CONFIG_SKGE is not set
+# CONFIG_SKY2 is not set
+# CONFIG_SK98LIN is not set
+# CONFIG_VIA_VELOCITY is not set
+# CONFIG_TIGON3 is not set
+# CONFIG_BNX2 is not set
+# CONFIG_QLA3XXX is not set
+# CONFIG_ATL1 is not set
+CONFIG_NETDEV_10000=y
+# CONFIG_CHELSIO_T1 is not set
+# CONFIG_CHELSIO_T3 is not set
+# CONFIG_IXGBE is not set
+# CONFIG_IXGB is not set
+# CONFIG_S2IO is not set
+# CONFIG_MYRI10GE is not set
+# CONFIG_NETXEN_NIC is not set
+# CONFIG_NIU is not set
+# CONFIG_MLX4_CORE is not set
+# CONFIG_TEHUTI is not set
+# CONFIG_BNX2X is not set
+# CONFIG_TR is not set
+
+#
+# Wireless LAN
+#
+# CONFIG_WLAN_PRE80211 is not set
+# CONFIG_WLAN_80211 is not set
+# CONFIG_WAN is not set
+# CONFIG_FDDI is not set
+# CONFIG_HIPPI is not set
+# CONFIG_PPP is not set
+# CONFIG_SLIP is not set
+# CONFIG_NETCONSOLE is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_ISDN is not set
+# CONFIG_PHONE is not set
+
+#
+# Input device support
+#
+# CONFIG_INPUT is not set
+
+#
+# Hardware I/O ports
+#
+# CONFIG_SERIO is not set
+# CONFIG_GAMEPORT is not set
+
+#
+# Character devices
+#
+# CONFIG_VT is not set
+# CONFIG_SERIAL_NONSTANDARD is not set
+# CONFIG_NOZOMI is not set
+
+#
+# Serial drivers
+#
+CONFIG_SERIAL_8250=y
+CONFIG_SERIAL_8250_CONSOLE=y
+CONFIG_SERIAL_8250_PCI=y
+CONFIG_SERIAL_8250_NR_UARTS=4
+CONFIG_SERIAL_8250_RUNTIME_UARTS=4
+CONFIG_SERIAL_8250_EXTENDED=y
+# CONFIG_SERIAL_8250_MANY_PORTS is not set
+CONFIG_SERIAL_8250_SHARE_IRQ=y
+# CONFIG_SERIAL_8250_DETECT_IRQ is not set
+# CONFIG_SERIAL_8250_RSA is not set
+
+#
+# Non-8250 serial port support
+#
+# CONFIG_SERIAL_UARTLITE is not set
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+# CONFIG_SERIAL_JSM is not set
+CONFIG_SERIAL_OF_PLATFORM=y
+CONFIG_UNIX98_PTYS=y
+CONFIG_LEGACY_PTYS=y
+CONFIG_LEGACY_PTY_COUNT=256
+# CONFIG_IPMI_HANDLER is not set
+# CONFIG_HW_RANDOM is not set
+# CONFIG_NVRAM is not set
+# CONFIG_GEN_RTC is not set
+CONFIG_XILINX_HWICAP=m
+# CONFIG_R3964 is not set
+# CONFIG_APPLICOM is not set
+# CONFIG_RAW_DRIVER is not set
+# CONFIG_TCG_TPM is not set
+CONFIG_DEVPORT=y
+# CONFIG_I2C is not set
+
+#
+# SPI support
+#
+# CONFIG_SPI is not set
+# CONFIG_SPI_MASTER is not set
+# CONFIG_W1 is not set
+# CONFIG_POWER_SUPPLY is not set
+# CONFIG_HWMON is not set
+CONFIG_THERMAL=y
+# CONFIG_WATCHDOG is not set
+
+#
+# Sonics Silicon Backplane
+#
+CONFIG_SSB_POSSIBLE=y
+# CONFIG_SSB is not set
+
+#
+# Multifunction device drivers
+#
+# CONFIG_MFD_SM501 is not set
+
+#
+# Multimedia devices
+#
+# CONFIG_VIDEO_DEV is not set
+# CONFIG_DVB_CORE is not set
+# CONFIG_DAB is not set
+
+#
+# Graphics support
+#
+# CONFIG_AGP is not set
+# CONFIG_DRM is not set
+# CONFIG_VGASTATE is not set
+CONFIG_VIDEO_OUTPUT_CONTROL=m
+# CONFIG_FB is not set
+# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
+
+#
+# Display device support
+#
+# CONFIG_DISPLAY_SUPPORT is not set
+
+#
+# Sound
+#
+# CONFIG_SOUND is not set
+CONFIG_USB_SUPPORT=y
+CONFIG_USB_ARCH_HAS_HCD=y
+CONFIG_USB_ARCH_HAS_OHCI=y
+CONFIG_USB_ARCH_HAS_EHCI=y
+# CONFIG_USB is not set
+
+#
+# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
+#
+# CONFIG_USB_GADGET is not set
+# CONFIG_MMC is not set
+# CONFIG_MEMSTICK is not set
+# CONFIG_NEW_LEDS is not set
+# CONFIG_INFINIBAND is not set
+# CONFIG_EDAC is not set
+# CONFIG_RTC_CLASS is not set
+# CONFIG_DMADEVICES is not set
+
+#
+# Userspace I/O
+#
+# CONFIG_UIO is not set
+
+#
+# File systems
+#
+CONFIG_EXT2_FS=y
+# CONFIG_EXT2_FS_XATTR is not set
+# CONFIG_EXT2_FS_XIP is not set
+# CONFIG_EXT3_FS is not set
+# CONFIG_EXT4DEV_FS is not set
+# CONFIG_REISERFS_FS is not set
+# CONFIG_JFS_FS is not set
+# CONFIG_FS_POSIX_ACL is not set
+# CONFIG_XFS_FS is not set
+# CONFIG_GFS2_FS is not set
+# CONFIG_OCFS2_FS is not set
+CONFIG_DNOTIFY=y
+CONFIG_INOTIFY=y
+CONFIG_INOTIFY_USER=y
+# CONFIG_QUOTA is not set
+# CONFIG_AUTOFS_FS is not set
+# CONFIG_AUTOFS4_FS is not set
+# CONFIG_FUSE_FS is not set
+
+#
+# CD-ROM/DVD Filesystems
+#
+# CONFIG_ISO9660_FS is not set
+# CONFIG_UDF_FS is not set
+
+#
+# DOS/FAT/NT Filesystems
+#
+# CONFIG_MSDOS_FS is not set
+# CONFIG_VFAT_FS is not set
+# CONFIG_NTFS_FS is not set
+
+#
+# Pseudo filesystems
+#
+CONFIG_PROC_FS=y
+CONFIG_PROC_KCORE=y
+CONFIG_PROC_SYSCTL=y
+CONFIG_SYSFS=y
+CONFIG_TMPFS=y
+# CONFIG_TMPFS_POSIX_ACL is not set
+# CONFIG_HUGETLB_PAGE is not set
+# CONFIG_CONFIGFS_FS is not set
+
+#
+# Miscellaneous filesystems
+#
+# CONFIG_ADFS_FS is not set
+# CONFIG_AFFS_FS is not set
+# CONFIG_HFS_FS is not set
+# CONFIG_HFSPLUS_FS is not set
+# CONFIG_BEFS_FS is not set
+# CONFIG_BFS_FS is not set
+# CONFIG_EFS_FS is not set
+# CONFIG_JFFS2_FS is not set
+CONFIG_CRAMFS=y
+# CONFIG_VXFS_FS is not set
+# CONFIG_MINIX_FS is not set
+# CONFIG_HPFS_FS is not set
+# CONFIG_QNX4FS_FS is not set
+# CONFIG_ROMFS_FS is not set
+# CONFIG_SYSV_FS is not set
+# CONFIG_UFS_FS is not set
+CONFIG_NETWORK_FILESYSTEMS=y
+CONFIG_NFS_FS=y
+CONFIG_NFS_V3=y
+# CONFIG_NFS_V3_ACL is not set
+# CONFIG_NFS_V4 is not set
+# CONFIG_NFS_DIRECTIO is not set
+# CONFIG_NFSD is not set
+CONFIG_ROOT_NFS=y
+CONFIG_LOCKD=y
+CONFIG_LOCKD_V4=y
+CONFIG_NFS_COMMON=y
+CONFIG_SUNRPC=y
+# CONFIG_SUNRPC_BIND34 is not set
+# CONFIG_RPCSEC_GSS_KRB5 is not set
+# CONFIG_RPCSEC_GSS_SPKM3 is not set
+# CONFIG_SMB_FS is not set
+# CONFIG_CIFS is not set
+# CONFIG_NCP_FS is not set
+# CONFIG_CODA_FS is not set
+# CONFIG_AFS_FS is not set
+
+#
+# Partition Types
+#
+# CONFIG_PARTITION_ADVANCED is not set
+CONFIG_MSDOS_PARTITION=y
+# CONFIG_NLS is not set
+# CONFIG_DLM is not set
+
+#
+# Library routines
+#
+CONFIG_BITREVERSE=y
+# CONFIG_CRC_CCITT is not set
+# CONFIG_CRC16 is not set
+# CONFIG_CRC_ITU_T is not set
+CONFIG_CRC32=y
+# CONFIG_CRC7 is not set
+# CONFIG_LIBCRC32C is not set
+CONFIG_ZLIB_INFLATE=y
+CONFIG_PLIST=y
+CONFIG_HAS_IOMEM=y
+CONFIG_HAS_IOPORT=y
+CONFIG_HAS_DMA=y
+CONFIG_HAVE_LMB=y
+
+#
+# Kernel hacking
+#
+# CONFIG_PRINTK_TIME is not set
+CONFIG_ENABLE_WARN_DEPRECATED=y
+CONFIG_ENABLE_MUST_CHECK=y
+CONFIG_MAGIC_SYSRQ=y
+# CONFIG_UNUSED_SYMBOLS is not set
+CONFIG_DEBUG_FS=y
+# CONFIG_HEADERS_CHECK is not set
+CONFIG_DEBUG_KERNEL=y
+# CONFIG_DEBUG_SHIRQ is not set
+CONFIG_DETECT_SOFTLOCKUP=y
+CONFIG_SCHED_DEBUG=y
+# CONFIG_SCHEDSTATS is not set
+# CONFIG_TIMER_STATS is not set
+# CONFIG_SLUB_DEBUG_ON is not set
+# CONFIG_SLUB_STATS is not set
+# CONFIG_DEBUG_RT_MUTEXES is not set
+# CONFIG_RT_MUTEX_TESTER is not set
+# CONFIG_DEBUG_SPINLOCK is not set
+# CONFIG_DEBUG_MUTEXES is not set
+# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
+# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
+# CONFIG_DEBUG_KOBJECT is not set
+CONFIG_DEBUG_BUGVERBOSE=y
+# CONFIG_DEBUG_INFO is not set
+# CONFIG_DEBUG_VM is not set
+# CONFIG_DEBUG_LIST is not set
+# CONFIG_DEBUG_SG is not set
+# CONFIG_BOOT_PRINTK_DELAY is not set
+# CONFIG_RCU_TORTURE_TEST is not set
+# CONFIG_BACKTRACE_SELF_TEST is not set
+# CONFIG_FAULT_INJECTION is not set
+# CONFIG_SAMPLES is not set
+# CONFIG_DEBUG_STACKOVERFLOW is not set
+# CONFIG_DEBUG_STACK_USAGE is not set
+# CONFIG_DEBUG_PAGEALLOC is not set
+# CONFIG_DEBUGGER is not set
+# CONFIG_VIRQ_DEBUG is not set
+# CONFIG_BDI_SWITCH is not set
+# CONFIG_PPC_EARLY_DEBUG is not set
+
+#
+# Security options
+#
+# CONFIG_KEYS is not set
+# CONFIG_SECURITY is not set
+# CONFIG_SECURITY_FILE_CAPABILITIES is not set
+CONFIG_CRYPTO=y
+CONFIG_CRYPTO_ALGAPI=y
+CONFIG_CRYPTO_BLKCIPHER=y
+# CONFIG_CRYPTO_SEQIV is not set
+CONFIG_CRYPTO_MANAGER=y
+# CONFIG_CRYPTO_HMAC is not set
+# CONFIG_CRYPTO_XCBC is not set
+# CONFIG_CRYPTO_NULL is not set
+# CONFIG_CRYPTO_MD4 is not set
+CONFIG_CRYPTO_MD5=y
+# CONFIG_CRYPTO_SHA1 is not set
+# CONFIG_CRYPTO_SHA256 is not set
+# CONFIG_CRYPTO_SHA512 is not set
+# CONFIG_CRYPTO_WP512 is not set
+# CONFIG_CRYPTO_TGR192 is not set
+# CONFIG_CRYPTO_GF128MUL is not set
+CONFIG_CRYPTO_ECB=y
+CONFIG_CRYPTO_CBC=y
+CONFIG_CRYPTO_PCBC=y
+# CONFIG_CRYPTO_LRW is not set
+# CONFIG_CRYPTO_XTS is not set
+# CONFIG_CRYPTO_CTR is not set
+# CONFIG_CRYPTO_GCM is not set
+# CONFIG_CRYPTO_CCM is not set
+# CONFIG_CRYPTO_CRYPTD is not set
+CONFIG_CRYPTO_DES=y
+# CONFIG_CRYPTO_FCRYPT is not set
+# CONFIG_CRYPTO_BLOWFISH is not set
+# CONFIG_CRYPTO_TWOFISH is not set
+# CONFIG_CRYPTO_SERPENT is not set
+# CONFIG_CRYPTO_AES is not set
+# CONFIG_CRYPTO_CAST5 is not set
+# CONFIG_CRYPTO_CAST6 is not set
+# CONFIG_CRYPTO_TEA is not set
+# CONFIG_CRYPTO_ARC4 is not set
+# CONFIG_CRYPTO_KHAZAD is not set
+# CONFIG_CRYPTO_ANUBIS is not set
+# CONFIG_CRYPTO_SEED is not set
+# CONFIG_CRYPTO_SALSA20 is not set
+# CONFIG_CRYPTO_DEFLATE is not set
+# CONFIG_CRYPTO_MICHAEL_MIC is not set
+# CONFIG_CRYPTO_CRC32C is not set
+# CONFIG_CRYPTO_CAMELLIA is not set
+# CONFIG_CRYPTO_TEST is not set
+# CONFIG_CRYPTO_AUTHENC is not set
+# CONFIG_CRYPTO_LZO is not set
+CONFIG_CRYPTO_HW=y
+# CONFIG_CRYPTO_DEV_HIFN_795X is not set
+# CONFIG_PPC_CLOCK is not set
index 57bd775ef77745baf6bdb3d8d53082744eb73203..12f9b5a80220885be932c66ba70353a24cf3b0f0 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.25-rc2
-# Fri Feb 15 21:57:35 2008
+# Linux kernel version: 2.6.25-rc6
+# Sat Apr  5 09:35:48 2008
 #
 # CONFIG_PPC64 is not set
 
@@ -79,6 +79,7 @@ CONFIG_FAIR_GROUP_SCHED=y
 CONFIG_USER_SCHED=y
 # CONFIG_CGROUP_SCHED is not set
 CONFIG_SYSFS_DEPRECATED=y
+CONFIG_SYSFS_DEPRECATED_V2=y
 # CONFIG_RELAY is not set
 # CONFIG_NAMESPACES is not set
 CONFIG_BLK_DEV_INITRD=y
@@ -113,6 +114,7 @@ CONFIG_SLUB=y
 CONFIG_HAVE_OPROFILE=y
 # CONFIG_KPROBES is not set
 CONFIG_HAVE_KPROBES=y
+CONFIG_HAVE_KRETPROBES=y
 CONFIG_PROC_PAGE_MONITOR=y
 CONFIG_SLABINFO=y
 CONFIG_RT_MUTEXES=y
@@ -143,7 +145,6 @@ CONFIG_DEFAULT_AS=y
 # CONFIG_DEFAULT_NOOP is not set
 CONFIG_DEFAULT_IOSCHED="anticipatory"
 CONFIG_CLASSIC_RCU=y
-# CONFIG_PREEMPT_RCU is not set
 CONFIG_PPC4xx_PCI_EXPRESS=y
 
 #
@@ -161,12 +162,15 @@ CONFIG_TAISHAN=y
 CONFIG_KATMAI=y
 CONFIG_RAINIER=y
 CONFIG_WARP=y
+CONFIG_CANYONLANDS=y
+CONFIG_YOSEMITE=y
 CONFIG_440EP=y
 CONFIG_440EPX=y
 CONFIG_440GRX=y
 CONFIG_440GP=y
 CONFIG_440GX=y
 CONFIG_440SPe=y
+CONFIG_460EX=y
 CONFIG_IBM440EP_ERR42=y
 # CONFIG_IPIC is not set
 # CONFIG_MPIC is not set
@@ -199,7 +203,6 @@ CONFIG_HZ=250
 CONFIG_PREEMPT_NONE=y
 # CONFIG_PREEMPT_VOLUNTARY is not set
 # CONFIG_PREEMPT is not set
-# CONFIG_RCU_TRACE is not set
 CONFIG_BINFMT_ELF=y
 # CONFIG_BINFMT_MISC is not set
 CONFIG_MATH_EMULATION=y
@@ -232,6 +235,7 @@ CONFIG_ISA_DMA_API=y
 #
 CONFIG_ZONE_DMA=y
 CONFIG_PPC_INDIRECT_PCI=y
+CONFIG_4xx_SOC=y
 CONFIG_PCI=y
 CONFIG_PCI_DOMAINS=y
 CONFIG_PCI_SYSCALL=y
@@ -678,6 +682,7 @@ CONFIG_USB_ARCH_HAS_EHCI=y
 # CONFIG_INFINIBAND is not set
 # CONFIG_EDAC is not set
 # CONFIG_RTC_CLASS is not set
+# CONFIG_DMADEVICES is not set
 
 #
 # Userspace I/O
@@ -805,6 +810,7 @@ CONFIG_PLIST=y
 CONFIG_HAS_IOMEM=y
 CONFIG_HAS_IOPORT=y
 CONFIG_HAS_DMA=y
+CONFIG_HAVE_LMB=y
 
 #
 # Kernel hacking
index 880ab7ad10c1d547974ec8fae4c74f35d8c3474e..970282b1a004d5ce8ad9add2943eaccf9a76ca87 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
 # Linux kernel version: 2.6.25-rc6
-# Thu Mar 20 11:06:28 2008
+# Thu Mar 27 13:56:24 2008
 #
 CONFIG_PPC64=y
 
@@ -84,8 +84,6 @@ CONFIG_CGROUPS=y
 # CONFIG_CGROUP_NS is not set
 CONFIG_CPUSETS=y
 # CONFIG_GROUP_SCHED is not set
-# CONFIG_USER_SCHED is not set
-# CONFIG_CGROUP_SCHED is not set
 # CONFIG_CGROUP_CPUACCT is not set
 # CONFIG_RESOURCE_COUNTERS is not set
 CONFIG_SYSFS_DEPRECATED=y
@@ -289,6 +287,7 @@ CONFIG_ARCH_HAS_WALK_MEMORY=y
 CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
 CONFIG_KEXEC=y
 # CONFIG_CRASH_DUMP is not set
+# CONFIG_PHYP_DUMP is not set
 CONFIG_IRQ_ALL_CPUS=y
 # CONFIG_NUMA is not set
 CONFIG_ARCH_SELECT_MEMORY_MODEL=y
@@ -335,7 +334,7 @@ CONFIG_PCI_SYSCALL=y
 # CONFIG_PCIEPORTBUS is not set
 CONFIG_ARCH_SUPPORTS_MSI=y
 CONFIG_PCI_MSI=y
-CONFIG_PCI_LEGACY=y
+# CONFIG_PCI_LEGACY is not set
 # CONFIG_PCI_DEBUG is not set
 CONFIG_PCCARD=y
 # CONFIG_PCMCIA_DEBUG is not set
@@ -1881,6 +1880,7 @@ CONFIG_PLIST=y
 CONFIG_HAS_IOMEM=y
 CONFIG_HAS_IOPORT=y
 CONFIG_HAS_DMA=y
+CONFIG_HAVE_LMB=y
 
 #
 # Kernel hacking
index 755aca72b522593eeef3cea2a72d02dba54e78a1..3e2593c60b1226a87ac35518d4372e69ed16b04b 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
 # Linux kernel version: 2.6.25-rc6
-# Thu Mar 20 11:08:01 2008
+# Thu Mar 27 13:56:28 2008
 #
 CONFIG_PPC64=y
 
@@ -83,8 +83,6 @@ CONFIG_CGROUPS=y
 CONFIG_CGROUP_NS=y
 CONFIG_CPUSETS=y
 # CONFIG_GROUP_SCHED is not set
-# CONFIG_USER_SCHED is not set
-# CONFIG_CGROUP_SCHED is not set
 CONFIG_CGROUP_CPUACCT=y
 # CONFIG_RESOURCE_COUNTERS is not set
 CONFIG_SYSFS_DEPRECATED=y
@@ -237,6 +235,7 @@ CONFIG_ARCH_HAS_WALK_MEMORY=y
 CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
 CONFIG_KEXEC=y
 # CONFIG_CRASH_DUMP is not set
+# CONFIG_PHYP_DUMP is not set
 CONFIG_IRQ_ALL_CPUS=y
 CONFIG_NUMA=y
 CONFIG_NODES_SHIFT=4
@@ -283,7 +282,7 @@ CONFIG_PCI_SYSCALL=y
 # CONFIG_PCIEPORTBUS is not set
 CONFIG_ARCH_SUPPORTS_MSI=y
 CONFIG_PCI_MSI=y
-CONFIG_PCI_LEGACY=y
+# CONFIG_PCI_LEGACY is not set
 # CONFIG_PCI_DEBUG is not set
 # CONFIG_PCCARD is not set
 CONFIG_HOTPLUG_PCI=m
@@ -1519,6 +1518,7 @@ CONFIG_PLIST=y
 CONFIG_HAS_IOMEM=y
 CONFIG_HAS_IOPORT=y
 CONFIG_HAS_DMA=y
+CONFIG_HAVE_LMB=y
 
 #
 # Kernel hacking
diff --git a/arch/powerpc/configs/sbc8641d_defconfig b/arch/powerpc/configs/sbc8641d_defconfig
new file mode 100644 (file)
index 0000000..3180125
--- /dev/null
@@ -0,0 +1,1342 @@
+#
+# Automatically generated make config: don't edit
+# Linux kernel version: 2.6.25-rc6
+# Thu Apr 10 18:03:25 2008
+#
+# CONFIG_PPC64 is not set
+
+#
+# Processor support
+#
+CONFIG_6xx=y
+# CONFIG_PPC_85xx is not set
+# CONFIG_PPC_8xx is not set
+# CONFIG_40x is not set
+# CONFIG_44x is not set
+# CONFIG_E200 is not set
+CONFIG_PPC_FPU=y
+CONFIG_ALTIVEC=y
+CONFIG_PPC_STD_MMU=y
+CONFIG_PPC_STD_MMU_32=y
+# CONFIG_PPC_MM_SLICES is not set
+CONFIG_SMP=y
+CONFIG_NR_CPUS=2
+CONFIG_PPC32=y
+CONFIG_WORD_SIZE=32
+CONFIG_PPC_MERGE=y
+CONFIG_MMU=y
+CONFIG_GENERIC_CMOS_UPDATE=y
+CONFIG_GENERIC_TIME=y
+CONFIG_GENERIC_TIME_VSYSCALL=y
+CONFIG_GENERIC_CLOCKEVENTS=y
+CONFIG_GENERIC_HARDIRQS=y
+# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
+CONFIG_IRQ_PER_CPU=y
+CONFIG_RWSEM_XCHGADD_ALGORITHM=y
+CONFIG_GENERIC_LOCKBREAK=y
+CONFIG_ARCH_HAS_ILOG2_U32=y
+CONFIG_GENERIC_HWEIGHT=y
+CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_GENERIC_FIND_NEXT_BIT=y
+# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
+CONFIG_PPC=y
+CONFIG_EARLY_PRINTK=y
+CONFIG_GENERIC_NVRAM=y
+CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
+CONFIG_ARCH_MAY_HAVE_PC_FDC=y
+CONFIG_PPC_OF=y
+CONFIG_OF=y
+CONFIG_PPC_UDBG_16550=y
+CONFIG_GENERIC_TBSYNC=y
+CONFIG_AUDIT_ARCH=y
+CONFIG_GENERIC_BUG=y
+CONFIG_DEFAULT_UIMAGE=y
+# CONFIG_PPC_DCR_NATIVE is not set
+# CONFIG_PPC_DCR_MMIO is not set
+CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
+
+#
+# General setup
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_LOCK_KERNEL=y
+CONFIG_INIT_ENV_ARG_LIMIT=32
+CONFIG_LOCALVERSION=""
+CONFIG_LOCALVERSION_AUTO=y
+CONFIG_SWAP=y
+CONFIG_SYSVIPC=y
+CONFIG_SYSVIPC_SYSCTL=y
+CONFIG_POSIX_MQUEUE=y
+CONFIG_BSD_PROCESS_ACCT=y
+CONFIG_BSD_PROCESS_ACCT_V3=y
+# CONFIG_TASKSTATS is not set
+# CONFIG_AUDIT is not set
+CONFIG_IKCONFIG=y
+CONFIG_IKCONFIG_PROC=y
+CONFIG_LOG_BUF_SHIFT=14
+# CONFIG_CGROUPS is not set
+CONFIG_GROUP_SCHED=y
+CONFIG_FAIR_GROUP_SCHED=y
+# CONFIG_RT_GROUP_SCHED is not set
+CONFIG_USER_SCHED=y
+# CONFIG_CGROUP_SCHED is not set
+CONFIG_SYSFS_DEPRECATED=y
+CONFIG_SYSFS_DEPRECATED_V2=y
+CONFIG_RELAY=y
+# CONFIG_NAMESPACES is not set
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_INITRAMFS_SOURCE=""
+# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
+CONFIG_SYSCTL=y
+CONFIG_EMBEDDED=y
+CONFIG_SYSCTL_SYSCALL=y
+CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_ALL is not set
+# CONFIG_KALLSYMS_EXTRA_PASS is not set
+CONFIG_HOTPLUG=y
+CONFIG_PRINTK=y
+CONFIG_BUG=y
+CONFIG_ELF_CORE=y
+CONFIG_COMPAT_BRK=y
+CONFIG_BASE_FULL=y
+CONFIG_FUTEX=y
+CONFIG_ANON_INODES=y
+CONFIG_EPOLL=y
+CONFIG_SIGNALFD=y
+CONFIG_TIMERFD=y
+CONFIG_EVENTFD=y
+CONFIG_SHMEM=y
+CONFIG_VM_EVENT_COUNTERS=y
+CONFIG_SLAB=y
+# CONFIG_SLUB is not set
+# CONFIG_SLOB is not set
+# CONFIG_PROFILING is not set
+# CONFIG_MARKERS is not set
+CONFIG_HAVE_OPROFILE=y
+# CONFIG_KPROBES is not set
+CONFIG_HAVE_KPROBES=y
+CONFIG_HAVE_KRETPROBES=y
+CONFIG_PROC_PAGE_MONITOR=y
+CONFIG_SLABINFO=y
+CONFIG_RT_MUTEXES=y
+# CONFIG_TINY_SHMEM is not set
+CONFIG_BASE_SMALL=0
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+# CONFIG_MODULE_FORCE_UNLOAD is not set
+# CONFIG_MODVERSIONS is not set
+# CONFIG_MODULE_SRCVERSION_ALL is not set
+CONFIG_KMOD=y
+CONFIG_STOP_MACHINE=y
+CONFIG_BLOCK=y
+# CONFIG_LBD is not set
+# CONFIG_BLK_DEV_IO_TRACE is not set
+# CONFIG_LSF is not set
+# CONFIG_BLK_DEV_BSG is not set
+
+#
+# IO Schedulers
+#
+CONFIG_IOSCHED_NOOP=y
+CONFIG_IOSCHED_AS=y
+CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
+# CONFIG_DEFAULT_AS is not set
+# CONFIG_DEFAULT_DEADLINE is not set
+CONFIG_DEFAULT_CFQ=y
+# CONFIG_DEFAULT_NOOP is not set
+CONFIG_DEFAULT_IOSCHED="cfq"
+CONFIG_CLASSIC_RCU=y
+
+#
+# Platform support
+#
+# CONFIG_PPC_MULTIPLATFORM is not set
+# CONFIG_PPC_82xx is not set
+# CONFIG_PPC_83xx is not set
+CONFIG_PPC_86xx=y
+# CONFIG_PPC_MPC512x is not set
+# CONFIG_PPC_MPC5121 is not set
+# CONFIG_PPC_CELL is not set
+# CONFIG_PPC_CELL_NATIVE is not set
+# CONFIG_PQ2ADS is not set
+# CONFIG_MPC8641_HPCN is not set
+CONFIG_SBC8641D=y
+# CONFIG_MPC8610_HPCD is not set
+CONFIG_MPC8641=y
+# CONFIG_IPIC is not set
+CONFIG_MPIC=y
+# CONFIG_MPIC_WEIRD is not set
+# CONFIG_PPC_I8259 is not set
+# CONFIG_PPC_RTAS is not set
+# CONFIG_MMIO_NVRAM is not set
+# CONFIG_PPC_MPC106 is not set
+# CONFIG_PPC_970_NAP is not set
+# CONFIG_PPC_INDIRECT_IO is not set
+# CONFIG_GENERIC_IOMAP is not set
+# CONFIG_CPU_FREQ is not set
+# CONFIG_FSL_ULI1575 is not set
+
+#
+# Kernel options
+#
+# CONFIG_HIGHMEM is not set
+CONFIG_TICK_ONESHOT=y
+# CONFIG_NO_HZ is not set
+CONFIG_HIGH_RES_TIMERS=y
+CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
+# CONFIG_HZ_100 is not set
+CONFIG_HZ_250=y
+# CONFIG_HZ_300 is not set
+# CONFIG_HZ_1000 is not set
+CONFIG_HZ=250
+# CONFIG_SCHED_HRTICK is not set
+# CONFIG_PREEMPT_NONE is not set
+# CONFIG_PREEMPT_VOLUNTARY is not set
+CONFIG_PREEMPT=y
+# CONFIG_PREEMPT_RCU is not set
+CONFIG_BINFMT_ELF=y
+CONFIG_BINFMT_MISC=m
+CONFIG_FORCE_MAX_ZONEORDER=11
+# CONFIG_IOMMU_HELPER is not set
+CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
+CONFIG_ARCH_HAS_WALK_MEMORY=y
+CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
+CONFIG_IRQ_ALL_CPUS=y
+CONFIG_ARCH_FLATMEM_ENABLE=y
+CONFIG_ARCH_POPULATES_NODE_MAP=y
+CONFIG_SELECT_MEMORY_MODEL=y
+CONFIG_FLATMEM_MANUAL=y
+# CONFIG_DISCONTIGMEM_MANUAL is not set
+# CONFIG_SPARSEMEM_MANUAL is not set
+CONFIG_FLATMEM=y
+CONFIG_FLAT_NODE_MEM_MAP=y
+# CONFIG_SPARSEMEM_STATIC is not set
+# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
+CONFIG_SPLIT_PTLOCK_CPUS=4
+# CONFIG_RESOURCES_64BIT is not set
+CONFIG_ZONE_DMA_FLAG=1
+CONFIG_BOUNCE=y
+CONFIG_VIRT_TO_BUS=y
+# CONFIG_PROC_DEVICETREE is not set
+# CONFIG_CMDLINE_BOOL is not set
+# CONFIG_PM is not set
+CONFIG_SECCOMP=y
+CONFIG_ISA_DMA_API=y
+
+#
+# Bus options
+#
+CONFIG_ZONE_DMA=y
+CONFIG_GENERIC_ISA_DMA=y
+CONFIG_PPC_INDIRECT_PCI=y
+CONFIG_FSL_SOC=y
+CONFIG_FSL_PCI=y
+CONFIG_PCI=y
+CONFIG_PCI_DOMAINS=y
+CONFIG_PCI_SYSCALL=y
+CONFIG_PCIEPORTBUS=y
+CONFIG_PCIEAER=y
+CONFIG_ARCH_SUPPORTS_MSI=y
+# CONFIG_PCI_MSI is not set
+CONFIG_PCI_LEGACY=y
+# CONFIG_PCI_DEBUG is not set
+# CONFIG_PCCARD is not set
+# CONFIG_HOTPLUG_PCI is not set
+
+#
+# Advanced setup
+#
+# CONFIG_ADVANCED_OPTIONS is not set
+
+#
+# Default settings for advanced configuration options are used
+#
+CONFIG_HIGHMEM_START=0xfe000000
+CONFIG_LOWMEM_SIZE=0x30000000
+CONFIG_KERNEL_START=0xc0000000
+CONFIG_TASK_SIZE=0xc0000000
+CONFIG_BOOT_LOAD=0x00800000
+
+#
+# Networking
+#
+CONFIG_NET=y
+
+#
+# Networking options
+#
+CONFIG_PACKET=y
+CONFIG_PACKET_MMAP=y
+CONFIG_UNIX=y
+CONFIG_XFRM=y
+CONFIG_XFRM_USER=m
+# CONFIG_XFRM_SUB_POLICY is not set
+# CONFIG_XFRM_MIGRATE is not set
+# CONFIG_XFRM_STATISTICS is not set
+CONFIG_NET_KEY=m
+# CONFIG_NET_KEY_MIGRATE is not set
+CONFIG_INET=y
+CONFIG_IP_MULTICAST=y
+CONFIG_IP_ADVANCED_ROUTER=y
+CONFIG_ASK_IP_FIB_HASH=y
+# CONFIG_IP_FIB_TRIE is not set
+CONFIG_IP_FIB_HASH=y
+CONFIG_IP_MULTIPLE_TABLES=y
+CONFIG_IP_ROUTE_MULTIPATH=y
+CONFIG_IP_ROUTE_VERBOSE=y
+CONFIG_IP_PNP=y
+CONFIG_IP_PNP_DHCP=y
+CONFIG_IP_PNP_BOOTP=y
+CONFIG_IP_PNP_RARP=y
+CONFIG_NET_IPIP=m
+CONFIG_NET_IPGRE=m
+CONFIG_NET_IPGRE_BROADCAST=y
+CONFIG_IP_MROUTE=y
+CONFIG_IP_PIMSM_V1=y
+CONFIG_IP_PIMSM_V2=y
+# CONFIG_ARPD is not set
+CONFIG_SYN_COOKIES=y
+CONFIG_INET_AH=m
+CONFIG_INET_ESP=m
+CONFIG_INET_IPCOMP=m
+CONFIG_INET_XFRM_TUNNEL=m
+CONFIG_INET_TUNNEL=m
+CONFIG_INET_XFRM_MODE_TRANSPORT=y
+CONFIG_INET_XFRM_MODE_TUNNEL=y
+CONFIG_INET_XFRM_MODE_BEET=y
+# CONFIG_INET_LRO is not set
+CONFIG_INET_DIAG=y
+CONFIG_INET_TCP_DIAG=y
+# CONFIG_TCP_CONG_ADVANCED is not set
+CONFIG_TCP_CONG_CUBIC=y
+CONFIG_DEFAULT_TCP_CONG="cubic"
+# CONFIG_TCP_MD5SIG is not set
+# CONFIG_IP_VS is not set
+CONFIG_IPV6=m
+# CONFIG_IPV6_PRIVACY is not set
+# CONFIG_IPV6_ROUTER_PREF is not set
+# CONFIG_IPV6_OPTIMISTIC_DAD is not set
+CONFIG_INET6_AH=m
+CONFIG_INET6_ESP=m
+CONFIG_INET6_IPCOMP=m
+# CONFIG_IPV6_MIP6 is not set
+CONFIG_INET6_XFRM_TUNNEL=m
+CONFIG_INET6_TUNNEL=m
+CONFIG_INET6_XFRM_MODE_TRANSPORT=m
+CONFIG_INET6_XFRM_MODE_TUNNEL=m
+CONFIG_INET6_XFRM_MODE_BEET=m
+# CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION is not set
+CONFIG_IPV6_SIT=m
+CONFIG_IPV6_TUNNEL=m
+# CONFIG_IPV6_MULTIPLE_TABLES is not set
+# CONFIG_NETLABEL is not set
+# CONFIG_NETWORK_SECMARK is not set
+CONFIG_NETFILTER=y
+# CONFIG_NETFILTER_DEBUG is not set
+CONFIG_NETFILTER_ADVANCED=y
+CONFIG_BRIDGE_NETFILTER=y
+
+#
+# Core Netfilter Configuration
+#
+# CONFIG_NETFILTER_NETLINK_QUEUE is not set
+# CONFIG_NETFILTER_NETLINK_LOG is not set
+# CONFIG_NF_CONNTRACK is not set
+CONFIG_NETFILTER_XTABLES=m
+# CONFIG_NETFILTER_XT_TARGET_CLASSIFY is not set
+# CONFIG_NETFILTER_XT_TARGET_DSCP is not set
+# CONFIG_NETFILTER_XT_TARGET_MARK is not set
+# CONFIG_NETFILTER_XT_TARGET_NFQUEUE is not set
+# CONFIG_NETFILTER_XT_TARGET_NFLOG is not set
+# CONFIG_NETFILTER_XT_TARGET_RATEEST is not set
+# CONFIG_NETFILTER_XT_TARGET_TRACE is not set
+# CONFIG_NETFILTER_XT_TARGET_TCPMSS is not set
+# CONFIG_NETFILTER_XT_TARGET_TCPOPTSTRIP is not set
+# CONFIG_NETFILTER_XT_MATCH_COMMENT is not set
+# CONFIG_NETFILTER_XT_MATCH_DCCP is not set
+# CONFIG_NETFILTER_XT_MATCH_DSCP is not set
+# CONFIG_NETFILTER_XT_MATCH_ESP is not set
+# CONFIG_NETFILTER_XT_MATCH_IPRANGE is not set
+# CONFIG_NETFILTER_XT_MATCH_LENGTH is not set
+# CONFIG_NETFILTER_XT_MATCH_LIMIT is not set
+# CONFIG_NETFILTER_XT_MATCH_MAC is not set
+# CONFIG_NETFILTER_XT_MATCH_MARK is not set
+# CONFIG_NETFILTER_XT_MATCH_OWNER is not set
+# CONFIG_NETFILTER_XT_MATCH_POLICY is not set
+# CONFIG_NETFILTER_XT_MATCH_MULTIPORT is not set
+# CONFIG_NETFILTER_XT_MATCH_PHYSDEV is not set
+# CONFIG_NETFILTER_XT_MATCH_PKTTYPE is not set
+# CONFIG_NETFILTER_XT_MATCH_QUOTA is not set
+# CONFIG_NETFILTER_XT_MATCH_RATEEST is not set
+# CONFIG_NETFILTER_XT_MATCH_REALM is not set
+# CONFIG_NETFILTER_XT_MATCH_SCTP is not set
+# CONFIG_NETFILTER_XT_MATCH_STATISTIC is not set
+# CONFIG_NETFILTER_XT_MATCH_STRING is not set
+# CONFIG_NETFILTER_XT_MATCH_TCPMSS is not set
+# CONFIG_NETFILTER_XT_MATCH_TIME is not set
+# CONFIG_NETFILTER_XT_MATCH_U32 is not set
+# CONFIG_NETFILTER_XT_MATCH_HASHLIMIT is not set
+
+#
+# IP: Netfilter Configuration
+#
+CONFIG_IP_NF_QUEUE=m
+CONFIG_IP_NF_IPTABLES=m
+CONFIG_IP_NF_MATCH_RECENT=m
+CONFIG_IP_NF_MATCH_ECN=m
+# CONFIG_IP_NF_MATCH_AH is not set
+CONFIG_IP_NF_MATCH_TTL=m
+CONFIG_IP_NF_MATCH_ADDRTYPE=m
+CONFIG_IP_NF_FILTER=m
+CONFIG_IP_NF_TARGET_REJECT=m
+CONFIG_IP_NF_TARGET_LOG=m
+CONFIG_IP_NF_TARGET_ULOG=m
+CONFIG_IP_NF_MANGLE=m
+CONFIG_IP_NF_TARGET_ECN=m
+# CONFIG_IP_NF_TARGET_TTL is not set
+CONFIG_IP_NF_RAW=m
+CONFIG_IP_NF_ARPTABLES=m
+CONFIG_IP_NF_ARPFILTER=m
+CONFIG_IP_NF_ARP_MANGLE=m
+
+#
+# IPv6: Netfilter Configuration
+#
+CONFIG_IP6_NF_QUEUE=m
+CONFIG_IP6_NF_IPTABLES=m
+CONFIG_IP6_NF_MATCH_RT=m
+CONFIG_IP6_NF_MATCH_OPTS=m
+CONFIG_IP6_NF_MATCH_FRAG=m
+CONFIG_IP6_NF_MATCH_HL=m
+CONFIG_IP6_NF_MATCH_IPV6HEADER=m
+# CONFIG_IP6_NF_MATCH_AH is not set
+# CONFIG_IP6_NF_MATCH_MH is not set
+CONFIG_IP6_NF_MATCH_EUI64=m
+CONFIG_IP6_NF_FILTER=m
+CONFIG_IP6_NF_TARGET_LOG=m
+# CONFIG_IP6_NF_TARGET_REJECT is not set
+CONFIG_IP6_NF_MANGLE=m
+# CONFIG_IP6_NF_TARGET_HL is not set
+CONFIG_IP6_NF_RAW=m
+
+#
+# Bridge: Netfilter Configuration
+#
+# CONFIG_BRIDGE_NF_EBTABLES is not set
+# CONFIG_IP_DCCP is not set
+CONFIG_IP_SCTP=m
+# CONFIG_SCTP_DBG_MSG is not set
+# CONFIG_SCTP_DBG_OBJCNT is not set
+# CONFIG_SCTP_HMAC_NONE is not set
+# CONFIG_SCTP_HMAC_SHA1 is not set
+CONFIG_SCTP_HMAC_MD5=y
+CONFIG_TIPC=m
+# CONFIG_TIPC_ADVANCED is not set
+# CONFIG_TIPC_DEBUG is not set
+CONFIG_ATM=m
+CONFIG_ATM_CLIP=m
+# CONFIG_ATM_CLIP_NO_ICMP is not set
+CONFIG_ATM_LANE=m
+CONFIG_ATM_MPOA=m
+CONFIG_ATM_BR2684=m
+# CONFIG_ATM_BR2684_IPFILTER is not set
+CONFIG_BRIDGE=m
+CONFIG_VLAN_8021Q=m
+# CONFIG_DECNET is not set
+CONFIG_LLC=m
+# CONFIG_LLC2 is not set
+# CONFIG_IPX is not set
+# CONFIG_ATALK is not set
+# CONFIG_X25 is not set
+# CONFIG_LAPB is not set
+# CONFIG_ECONET is not set
+CONFIG_WAN_ROUTER=m
+CONFIG_NET_SCHED=y
+
+#
+# Queueing/Scheduling
+#
+CONFIG_NET_SCH_CBQ=m
+CONFIG_NET_SCH_HTB=m
+CONFIG_NET_SCH_HFSC=m
+CONFIG_NET_SCH_ATM=m
+CONFIG_NET_SCH_PRIO=m
+# CONFIG_NET_SCH_RR is not set
+CONFIG_NET_SCH_RED=m
+CONFIG_NET_SCH_SFQ=m
+CONFIG_NET_SCH_TEQL=m
+CONFIG_NET_SCH_TBF=m
+CONFIG_NET_SCH_GRED=m
+CONFIG_NET_SCH_DSMARK=m
+CONFIG_NET_SCH_NETEM=m
+
+#
+# Classification
+#
+CONFIG_NET_CLS=y
+# CONFIG_NET_CLS_BASIC is not set
+CONFIG_NET_CLS_TCINDEX=m
+CONFIG_NET_CLS_ROUTE4=m
+CONFIG_NET_CLS_ROUTE=y
+CONFIG_NET_CLS_FW=m
+CONFIG_NET_CLS_U32=m
+# CONFIG_CLS_U32_PERF is not set
+# CONFIG_CLS_U32_MARK is not set
+CONFIG_NET_CLS_RSVP=m
+CONFIG_NET_CLS_RSVP6=m
+# CONFIG_NET_CLS_FLOW is not set
+# CONFIG_NET_EMATCH is not set
+# CONFIG_NET_CLS_ACT is not set
+# CONFIG_NET_CLS_IND is not set
+CONFIG_NET_SCH_FIFO=y
+
+#
+# Network testing
+#
+CONFIG_NET_PKTGEN=m
+# CONFIG_HAMRADIO is not set
+# CONFIG_CAN is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
+# CONFIG_AF_RXRPC is not set
+CONFIG_FIB_RULES=y
+
+#
+# Wireless
+#
+# CONFIG_CFG80211 is not set
+# CONFIG_WIRELESS_EXT is not set
+# CONFIG_MAC80211 is not set
+# CONFIG_IEEE80211 is not set
+# CONFIG_RFKILL is not set
+# CONFIG_NET_9P is not set
+
+#
+# Device Drivers
+#
+
+#
+# Generic Driver Options
+#
+CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
+CONFIG_STANDALONE=y
+CONFIG_PREVENT_FIRMWARE_BUILD=y
+# CONFIG_FW_LOADER is not set
+# CONFIG_DEBUG_DRIVER is not set
+# CONFIG_DEBUG_DEVRES is not set
+# CONFIG_SYS_HYPERVISOR is not set
+# CONFIG_CONNECTOR is not set
+CONFIG_MTD=y
+# CONFIG_MTD_DEBUG is not set
+CONFIG_MTD_CONCAT=y
+CONFIG_MTD_PARTITIONS=y
+# CONFIG_MTD_REDBOOT_PARTS is not set
+# CONFIG_MTD_CMDLINE_PARTS is not set
+# CONFIG_MTD_OF_PARTS is not set
+
+#
+# User Modules And Translation Layers
+#
+CONFIG_MTD_CHAR=y
+CONFIG_MTD_BLKDEVS=y
+CONFIG_MTD_BLOCK=y
+# CONFIG_FTL is not set
+# CONFIG_NFTL is not set
+# CONFIG_INFTL is not set
+# CONFIG_RFD_FTL is not set
+# CONFIG_SSFDC is not set
+# CONFIG_MTD_OOPS is not set
+
+#
+# RAM/ROM/Flash chip drivers
+#
+CONFIG_MTD_CFI=y
+# CONFIG_MTD_JEDECPROBE is not set
+CONFIG_MTD_GEN_PROBE=y
+CONFIG_MTD_CFI_ADV_OPTIONS=y
+# CONFIG_MTD_CFI_NOSWAP is not set
+# CONFIG_MTD_CFI_BE_BYTE_SWAP is not set
+CONFIG_MTD_CFI_LE_BYTE_SWAP=y
+# CONFIG_MTD_CFI_GEOMETRY is not set
+CONFIG_MTD_MAP_BANK_WIDTH_1=y
+CONFIG_MTD_MAP_BANK_WIDTH_2=y
+CONFIG_MTD_MAP_BANK_WIDTH_4=y
+# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
+CONFIG_MTD_CFI_I1=y
+CONFIG_MTD_CFI_I2=y
+# CONFIG_MTD_CFI_I4 is not set
+# CONFIG_MTD_CFI_I8 is not set
+# CONFIG_MTD_OTP is not set
+CONFIG_MTD_CFI_INTELEXT=y
+# CONFIG_MTD_CFI_AMDSTD is not set
+# CONFIG_MTD_CFI_STAA is not set
+CONFIG_MTD_CFI_UTIL=y
+# CONFIG_MTD_RAM is not set
+# CONFIG_MTD_ROM is not set
+# CONFIG_MTD_ABSENT is not set
+
+#
+# Mapping drivers for chip access
+#
+# CONFIG_MTD_COMPLEX_MAPPINGS is not set
+# CONFIG_MTD_PHYSMAP is not set
+CONFIG_MTD_PHYSMAP_OF=y
+# CONFIG_MTD_INTEL_VR_NOR is not set
+# CONFIG_MTD_PLATRAM is not set
+
+#
+# Self-contained MTD device drivers
+#
+# CONFIG_MTD_PMC551 is not set
+# CONFIG_MTD_SLRAM is not set
+# CONFIG_MTD_PHRAM is not set
+# CONFIG_MTD_MTDRAM is not set
+# CONFIG_MTD_BLOCK2MTD is not set
+
+#
+# Disk-On-Chip Device Drivers
+#
+# CONFIG_MTD_DOC2000 is not set
+# CONFIG_MTD_DOC2001 is not set
+# CONFIG_MTD_DOC2001PLUS is not set
+# CONFIG_MTD_NAND is not set
+# CONFIG_MTD_ONENAND is not set
+
+#
+# UBI - Unsorted block images
+#
+# CONFIG_MTD_UBI is not set
+CONFIG_OF_DEVICE=y
+# CONFIG_PARPORT is not set
+CONFIG_BLK_DEV=y
+# CONFIG_BLK_DEV_FD is not set
+# CONFIG_BLK_CPQ_DA is not set
+# CONFIG_BLK_CPQ_CISS_DA is not set
+# CONFIG_BLK_DEV_DAC960 is not set
+# CONFIG_BLK_DEV_UMEM is not set
+# CONFIG_BLK_DEV_COW_COMMON is not set
+CONFIG_BLK_DEV_LOOP=m
+CONFIG_BLK_DEV_CRYPTOLOOP=m
+CONFIG_BLK_DEV_NBD=m
+# CONFIG_BLK_DEV_SX8 is not set
+CONFIG_BLK_DEV_RAM=y
+CONFIG_BLK_DEV_RAM_COUNT=16
+CONFIG_BLK_DEV_RAM_SIZE=4096
+# CONFIG_BLK_DEV_XIP is not set
+# CONFIG_CDROM_PKTCDVD is not set
+# CONFIG_ATA_OVER_ETH is not set
+CONFIG_MISC_DEVICES=y
+# CONFIG_PHANTOM is not set
+# CONFIG_EEPROM_93CX6 is not set
+# CONFIG_SGI_IOC4 is not set
+# CONFIG_TIFM_CORE is not set
+# CONFIG_ENCLOSURE_SERVICES is not set
+CONFIG_HAVE_IDE=y
+# CONFIG_IDE is not set
+
+#
+# SCSI device support
+#
+# CONFIG_RAID_ATTRS is not set
+# CONFIG_SCSI is not set
+# CONFIG_SCSI_DMA is not set
+# CONFIG_SCSI_NETLINK is not set
+# CONFIG_ATA is not set
+CONFIG_MD=y
+CONFIG_BLK_DEV_MD=y
+CONFIG_MD_LINEAR=y
+CONFIG_MD_RAID0=y
+CONFIG_MD_RAID1=y
+CONFIG_MD_RAID10=y
+# CONFIG_MD_RAID456 is not set
+CONFIG_MD_MULTIPATH=y
+CONFIG_MD_FAULTY=y
+CONFIG_BLK_DEV_DM=y
+# CONFIG_DM_DEBUG is not set
+CONFIG_DM_CRYPT=y
+CONFIG_DM_SNAPSHOT=y
+CONFIG_DM_MIRROR=y
+CONFIG_DM_ZERO=y
+# CONFIG_DM_MULTIPATH is not set
+# CONFIG_DM_DELAY is not set
+# CONFIG_DM_UEVENT is not set
+# CONFIG_FUSION is not set
+
+#
+# IEEE 1394 (FireWire) support
+#
+# CONFIG_FIREWIRE is not set
+# CONFIG_IEEE1394 is not set
+# CONFIG_I2O is not set
+# CONFIG_MACINTOSH_DRIVERS is not set
+CONFIG_NETDEVICES=y
+# CONFIG_NETDEVICES_MULTIQUEUE is not set
+CONFIG_DUMMY=m
+CONFIG_BONDING=m
+# CONFIG_MACVLAN is not set
+# CONFIG_EQUALIZER is not set
+CONFIG_TUN=m
+# CONFIG_VETH is not set
+# CONFIG_ARCNET is not set
+CONFIG_PHYLIB=y
+
+#
+# MII PHY device drivers
+#
+# CONFIG_MARVELL_PHY is not set
+# CONFIG_DAVICOM_PHY is not set
+# CONFIG_QSEMI_PHY is not set
+# CONFIG_LXT_PHY is not set
+# CONFIG_CICADA_PHY is not set
+# CONFIG_VITESSE_PHY is not set
+# CONFIG_SMSC_PHY is not set
+CONFIG_BROADCOM_PHY=y
+# CONFIG_ICPLUS_PHY is not set
+# CONFIG_REALTEK_PHY is not set
+# CONFIG_FIXED_PHY is not set
+# CONFIG_MDIO_BITBANG is not set
+CONFIG_NET_ETHERNET=y
+CONFIG_MII=y
+# CONFIG_HAPPYMEAL is not set
+# CONFIG_SUNGEM is not set
+# CONFIG_CASSINI is not set
+# CONFIG_NET_VENDOR_3COM is not set
+# CONFIG_NET_TULIP is not set
+# CONFIG_HP100 is not set
+# CONFIG_IBM_NEW_EMAC_ZMII is not set
+# CONFIG_IBM_NEW_EMAC_RGMII is not set
+# CONFIG_IBM_NEW_EMAC_TAH is not set
+# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
+# CONFIG_NET_PCI is not set
+# CONFIG_B44 is not set
+CONFIG_NETDEV_1000=y
+# CONFIG_ACENIC is not set
+# CONFIG_DL2K is not set
+# CONFIG_E1000 is not set
+# CONFIG_E1000E is not set
+# CONFIG_E1000E_ENABLED is not set
+# CONFIG_IP1000 is not set
+# CONFIG_IGB is not set
+# CONFIG_NS83820 is not set
+# CONFIG_HAMACHI is not set
+# CONFIG_YELLOWFIN is not set
+# CONFIG_R8169 is not set
+# CONFIG_SIS190 is not set
+# CONFIG_SKGE is not set
+# CONFIG_SKY2 is not set
+# CONFIG_SK98LIN is not set
+# CONFIG_VIA_VELOCITY is not set
+# CONFIG_TIGON3 is not set
+# CONFIG_BNX2 is not set
+CONFIG_GIANFAR=y
+# CONFIG_GFAR_NAPI is not set
+# CONFIG_QLA3XXX is not set
+# CONFIG_ATL1 is not set
+# CONFIG_NETDEV_10000 is not set
+# CONFIG_TR is not set
+
+#
+# Wireless LAN
+#
+# CONFIG_WLAN_PRE80211 is not set
+# CONFIG_WLAN_80211 is not set
+# CONFIG_WAN is not set
+CONFIG_ATM_DRIVERS=y
+# CONFIG_ATM_DUMMY is not set
+# CONFIG_ATM_TCP is not set
+# CONFIG_ATM_LANAI is not set
+# CONFIG_ATM_ENI is not set
+# CONFIG_ATM_FIRESTREAM is not set
+# CONFIG_ATM_ZATM is not set
+# CONFIG_ATM_NICSTAR is not set
+# CONFIG_ATM_IDT77252 is not set
+# CONFIG_ATM_AMBASSADOR is not set
+# CONFIG_ATM_HORIZON is not set
+# CONFIG_ATM_IA is not set
+# CONFIG_ATM_FORE200E_MAYBE is not set
+# CONFIG_ATM_HE is not set
+# CONFIG_FDDI is not set
+# CONFIG_HIPPI is not set
+CONFIG_PPP=m
+CONFIG_PPP_MULTILINK=y
+CONFIG_PPP_FILTER=y
+CONFIG_PPP_ASYNC=m
+CONFIG_PPP_SYNC_TTY=m
+CONFIG_PPP_DEFLATE=m
+CONFIG_PPP_BSDCOMP=m
+# CONFIG_PPP_MPPE is not set
+CONFIG_PPPOE=m
+CONFIG_PPPOATM=m
+# CONFIG_PPPOL2TP is not set
+CONFIG_SLIP=m
+CONFIG_SLIP_COMPRESSED=y
+CONFIG_SLHC=m
+CONFIG_SLIP_SMART=y
+CONFIG_SLIP_MODE_SLIP6=y
+CONFIG_NETCONSOLE=y
+# CONFIG_NETCONSOLE_DYNAMIC is not set
+CONFIG_NETPOLL=y
+CONFIG_NETPOLL_TRAP=y
+CONFIG_NET_POLL_CONTROLLER=y
+# CONFIG_ISDN is not set
+# CONFIG_PHONE is not set
+
+#
+# Input device support
+#
+CONFIG_INPUT=y
+# CONFIG_INPUT_FF_MEMLESS is not set
+# CONFIG_INPUT_POLLDEV is not set
+
+#
+# Userland interfaces
+#
+CONFIG_INPUT_MOUSEDEV=y
+CONFIG_INPUT_MOUSEDEV_PSAUX=y
+CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
+CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
+# CONFIG_INPUT_JOYDEV is not set
+# CONFIG_INPUT_EVDEV is not set
+# CONFIG_INPUT_EVBUG is not set
+
+#
+# Input Device Drivers
+#
+# CONFIG_INPUT_KEYBOARD is not set
+# CONFIG_INPUT_MOUSE is not set
+# CONFIG_INPUT_JOYSTICK is not set
+# CONFIG_INPUT_TABLET is not set
+# CONFIG_INPUT_TOUCHSCREEN is not set
+# CONFIG_INPUT_MISC is not set
+
+#
+# Hardware I/O ports
+#
+# CONFIG_SERIO is not set
+# CONFIG_GAMEPORT is not set
+
+#
+# Character devices
+#
+CONFIG_VT=y
+CONFIG_VT_CONSOLE=y
+CONFIG_HW_CONSOLE=y
+# CONFIG_VT_HW_CONSOLE_BINDING is not set
+# CONFIG_SERIAL_NONSTANDARD is not set
+# CONFIG_NOZOMI is not set
+
+#
+# Serial drivers
+#
+CONFIG_SERIAL_8250=y
+CONFIG_SERIAL_8250_CONSOLE=y
+# CONFIG_SERIAL_8250_PCI is not set
+CONFIG_SERIAL_8250_NR_UARTS=2
+CONFIG_SERIAL_8250_RUNTIME_UARTS=2
+# CONFIG_SERIAL_8250_EXTENDED is not set
+
+#
+# Non-8250 serial port support
+#
+# CONFIG_SERIAL_UARTLITE is not set
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+# CONFIG_SERIAL_JSM is not set
+# CONFIG_SERIAL_OF_PLATFORM is not set
+CONFIG_UNIX98_PTYS=y
+CONFIG_LEGACY_PTYS=y
+CONFIG_LEGACY_PTY_COUNT=256
+# CONFIG_IPMI_HANDLER is not set
+CONFIG_HW_RANDOM=m
+# CONFIG_NVRAM is not set
+# CONFIG_GEN_RTC is not set
+# CONFIG_R3964 is not set
+# CONFIG_APPLICOM is not set
+# CONFIG_RAW_DRIVER is not set
+# CONFIG_TCG_TPM is not set
+CONFIG_DEVPORT=y
+CONFIG_I2C=y
+CONFIG_I2C_BOARDINFO=y
+CONFIG_I2C_CHARDEV=y
+
+#
+# I2C Algorithms
+#
+# CONFIG_I2C_ALGOBIT is not set
+# CONFIG_I2C_ALGOPCF is not set
+# CONFIG_I2C_ALGOPCA is not set
+
+#
+# I2C Hardware Bus support
+#
+# CONFIG_I2C_ALI1535 is not set
+# CONFIG_I2C_ALI1563 is not set
+# CONFIG_I2C_ALI15X3 is not set
+# CONFIG_I2C_AMD756 is not set
+# CONFIG_I2C_AMD8111 is not set
+# CONFIG_I2C_I801 is not set
+# CONFIG_I2C_I810 is not set
+# CONFIG_I2C_PIIX4 is not set
+CONFIG_I2C_MPC=y
+# CONFIG_I2C_NFORCE2 is not set
+# CONFIG_I2C_OCORES is not set
+# CONFIG_I2C_PARPORT_LIGHT is not set
+# CONFIG_I2C_PROSAVAGE is not set
+# CONFIG_I2C_SAVAGE4 is not set
+# CONFIG_I2C_SIMTEC is not set
+# CONFIG_I2C_SIS5595 is not set
+# CONFIG_I2C_SIS630 is not set
+# CONFIG_I2C_SIS96X is not set
+# CONFIG_I2C_TAOS_EVM is not set
+# CONFIG_I2C_STUB is not set
+# CONFIG_I2C_VIA is not set
+# CONFIG_I2C_VIAPRO is not set
+# CONFIG_I2C_VOODOO3 is not set
+
+#
+# Miscellaneous I2C Chip support
+#
+# CONFIG_DS1682 is not set
+# CONFIG_SENSORS_EEPROM is not set
+# CONFIG_SENSORS_PCF8574 is not set
+# CONFIG_PCF8575 is not set
+# CONFIG_SENSORS_PCF8591 is not set
+# CONFIG_TPS65010 is not set
+# CONFIG_SENSORS_MAX6875 is not set
+# CONFIG_SENSORS_TSL2550 is not set
+# CONFIG_I2C_DEBUG_CORE is not set
+# CONFIG_I2C_DEBUG_ALGO is not set
+# CONFIG_I2C_DEBUG_BUS is not set
+# CONFIG_I2C_DEBUG_CHIP is not set
+
+#
+# SPI support
+#
+# CONFIG_SPI is not set
+# CONFIG_SPI_MASTER is not set
+# CONFIG_W1 is not set
+# CONFIG_POWER_SUPPLY is not set
+CONFIG_HWMON=y
+# CONFIG_HWMON_VID is not set
+# CONFIG_SENSORS_AD7418 is not set
+# CONFIG_SENSORS_ADM1021 is not set
+# CONFIG_SENSORS_ADM1025 is not set
+# CONFIG_SENSORS_ADM1026 is not set
+# CONFIG_SENSORS_ADM1029 is not set
+# CONFIG_SENSORS_ADM1031 is not set
+# CONFIG_SENSORS_ADM9240 is not set
+# CONFIG_SENSORS_ADT7470 is not set
+# CONFIG_SENSORS_ADT7473 is not set
+# CONFIG_SENSORS_ATXP1 is not set
+# CONFIG_SENSORS_DS1621 is not set
+# CONFIG_SENSORS_I5K_AMB is not set
+# CONFIG_SENSORS_F71805F is not set
+# CONFIG_SENSORS_F71882FG is not set
+# CONFIG_SENSORS_F75375S is not set
+# CONFIG_SENSORS_GL518SM is not set
+# CONFIG_SENSORS_GL520SM is not set
+# CONFIG_SENSORS_IT87 is not set
+# CONFIG_SENSORS_LM63 is not set
+# CONFIG_SENSORS_LM75 is not set
+# CONFIG_SENSORS_LM77 is not set
+# CONFIG_SENSORS_LM78 is not set
+# CONFIG_SENSORS_LM80 is not set
+# CONFIG_SENSORS_LM83 is not set
+# CONFIG_SENSORS_LM85 is not set
+# CONFIG_SENSORS_LM87 is not set
+# CONFIG_SENSORS_LM90 is not set
+# CONFIG_SENSORS_LM92 is not set
+# CONFIG_SENSORS_LM93 is not set
+# CONFIG_SENSORS_MAX1619 is not set
+# CONFIG_SENSORS_MAX6650 is not set
+# CONFIG_SENSORS_PC87360 is not set
+# CONFIG_SENSORS_PC87427 is not set
+# CONFIG_SENSORS_SIS5595 is not set
+# CONFIG_SENSORS_DME1737 is not set
+# CONFIG_SENSORS_SMSC47M1 is not set
+# CONFIG_SENSORS_SMSC47M192 is not set
+# CONFIG_SENSORS_SMSC47B397 is not set
+# CONFIG_SENSORS_ADS7828 is not set
+# CONFIG_SENSORS_THMC50 is not set
+# CONFIG_SENSORS_VIA686A is not set
+# CONFIG_SENSORS_VT1211 is not set
+# CONFIG_SENSORS_VT8231 is not set
+# CONFIG_SENSORS_W83781D is not set
+# CONFIG_SENSORS_W83791D is not set
+# CONFIG_SENSORS_W83792D is not set
+# CONFIG_SENSORS_W83793 is not set
+# CONFIG_SENSORS_W83L785TS is not set
+# CONFIG_SENSORS_W83L786NG is not set
+# CONFIG_SENSORS_W83627HF is not set
+# CONFIG_SENSORS_W83627EHF is not set
+# CONFIG_HWMON_DEBUG_CHIP is not set
+# CONFIG_THERMAL is not set
+CONFIG_WATCHDOG=y
+# CONFIG_WATCHDOG_NOWAYOUT is not set
+
+#
+# Watchdog Device Drivers
+#
+CONFIG_SOFT_WATCHDOG=m
+
+#
+# PCI-based Watchdog Cards
+#
+# CONFIG_PCIPCWATCHDOG is not set
+# CONFIG_WDTPCI is not set
+
+#
+# Sonics Silicon Backplane
+#
+CONFIG_SSB_POSSIBLE=y
+# CONFIG_SSB is not set
+
+#
+# Multifunction device drivers
+#
+# CONFIG_MFD_SM501 is not set
+
+#
+# Multimedia devices
+#
+# CONFIG_VIDEO_DEV is not set
+# CONFIG_DVB_CORE is not set
+CONFIG_DAB=y
+
+#
+# Graphics support
+#
+# CONFIG_AGP is not set
+# CONFIG_DRM is not set
+# CONFIG_VGASTATE is not set
+CONFIG_VIDEO_OUTPUT_CONTROL=m
+# CONFIG_FB is not set
+# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
+
+#
+# Display device support
+#
+# CONFIG_DISPLAY_SUPPORT is not set
+
+#
+# Console display driver support
+#
+CONFIG_VGA_CONSOLE=y
+# CONFIG_VGACON_SOFT_SCROLLBACK is not set
+CONFIG_DUMMY_CONSOLE=y
+
+#
+# Sound
+#
+# CONFIG_SOUND is not set
+CONFIG_HID_SUPPORT=y
+CONFIG_HID=y
+# CONFIG_HID_DEBUG is not set
+# CONFIG_HIDRAW is not set
+CONFIG_USB_SUPPORT=y
+CONFIG_USB_ARCH_HAS_HCD=y
+CONFIG_USB_ARCH_HAS_OHCI=y
+CONFIG_USB_ARCH_HAS_EHCI=y
+# CONFIG_USB is not set
+
+#
+# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
+#
+# CONFIG_USB_GADGET is not set
+# CONFIG_MMC is not set
+# CONFIG_MEMSTICK is not set
+# CONFIG_NEW_LEDS is not set
+# CONFIG_INFINIBAND is not set
+# CONFIG_EDAC is not set
+# CONFIG_RTC_CLASS is not set
+# CONFIG_DMADEVICES is not set
+
+#
+# Userspace I/O
+#
+# CONFIG_UIO is not set
+
+#
+# File systems
+#
+CONFIG_EXT2_FS=y
+CONFIG_EXT2_FS_XATTR=y
+CONFIG_EXT2_FS_POSIX_ACL=y
+# CONFIG_EXT2_FS_SECURITY is not set
+# CONFIG_EXT2_FS_XIP is not set
+CONFIG_EXT3_FS=y
+CONFIG_EXT3_FS_XATTR=y
+CONFIG_EXT3_FS_POSIX_ACL=y
+# CONFIG_EXT3_FS_SECURITY is not set
+# CONFIG_EXT4DEV_FS is not set
+CONFIG_JBD=y
+# CONFIG_JBD_DEBUG is not set
+CONFIG_FS_MBCACHE=y
+CONFIG_REISERFS_FS=m
+# CONFIG_REISERFS_CHECK is not set
+# CONFIG_REISERFS_PROC_INFO is not set
+CONFIG_REISERFS_FS_XATTR=y
+CONFIG_REISERFS_FS_POSIX_ACL=y
+# CONFIG_REISERFS_FS_SECURITY is not set
+# CONFIG_JFS_FS is not set
+CONFIG_FS_POSIX_ACL=y
+# CONFIG_XFS_FS is not set
+# CONFIG_GFS2_FS is not set
+CONFIG_OCFS2_FS=m
+CONFIG_OCFS2_DEBUG_MASKLOG=y
+# CONFIG_OCFS2_DEBUG_FS is not set
+CONFIG_DNOTIFY=y
+CONFIG_INOTIFY=y
+CONFIG_INOTIFY_USER=y
+# CONFIG_QUOTA is not set
+CONFIG_AUTOFS_FS=m
+CONFIG_AUTOFS4_FS=m
+# CONFIG_FUSE_FS is not set
+
+#
+# CD-ROM/DVD Filesystems
+#
+# CONFIG_ISO9660_FS is not set
+# CONFIG_UDF_FS is not set
+
+#
+# DOS/FAT/NT Filesystems
+#
+# CONFIG_MSDOS_FS is not set
+# CONFIG_VFAT_FS is not set
+# CONFIG_NTFS_FS is not set
+
+#
+# Pseudo filesystems
+#
+CONFIG_PROC_FS=y
+CONFIG_PROC_KCORE=y
+CONFIG_PROC_SYSCTL=y
+CONFIG_SYSFS=y
+CONFIG_TMPFS=y
+# CONFIG_TMPFS_POSIX_ACL is not set
+# CONFIG_HUGETLB_PAGE is not set
+CONFIG_CONFIGFS_FS=m
+
+#
+# Miscellaneous filesystems
+#
+# CONFIG_ADFS_FS is not set
+# CONFIG_AFFS_FS is not set
+# CONFIG_HFS_FS is not set
+# CONFIG_HFSPLUS_FS is not set
+# CONFIG_BEFS_FS is not set
+# CONFIG_BFS_FS is not set
+# CONFIG_EFS_FS is not set
+# CONFIG_JFFS2_FS is not set
+# CONFIG_CRAMFS is not set
+# CONFIG_VXFS_FS is not set
+CONFIG_MINIX_FS=m
+# CONFIG_HPFS_FS is not set
+# CONFIG_QNX4FS_FS is not set
+CONFIG_ROMFS_FS=m
+# CONFIG_SYSV_FS is not set
+# CONFIG_UFS_FS is not set
+CONFIG_NETWORK_FILESYSTEMS=y
+CONFIG_NFS_FS=y
+CONFIG_NFS_V3=y
+# CONFIG_NFS_V3_ACL is not set
+CONFIG_NFS_V4=y
+CONFIG_NFS_DIRECTIO=y
+# CONFIG_NFSD is not set
+CONFIG_ROOT_NFS=y
+CONFIG_LOCKD=y
+CONFIG_LOCKD_V4=y
+CONFIG_NFS_COMMON=y
+CONFIG_SUNRPC=y
+CONFIG_SUNRPC_GSS=y
+# CONFIG_SUNRPC_BIND34 is not set
+CONFIG_RPCSEC_GSS_KRB5=y
+# CONFIG_RPCSEC_GSS_SPKM3 is not set
+CONFIG_SMB_FS=m
+CONFIG_SMB_NLS_DEFAULT=y
+CONFIG_SMB_NLS_REMOTE="cp437"
+CONFIG_CIFS=m
+# CONFIG_CIFS_STATS is not set
+# CONFIG_CIFS_WEAK_PW_HASH is not set
+CONFIG_CIFS_XATTR=y
+CONFIG_CIFS_POSIX=y
+# CONFIG_CIFS_DEBUG2 is not set
+# CONFIG_CIFS_EXPERIMENTAL is not set
+# CONFIG_NCP_FS is not set
+# CONFIG_CODA_FS is not set
+# CONFIG_AFS_FS is not set
+
+#
+# Partition Types
+#
+# CONFIG_PARTITION_ADVANCED is not set
+CONFIG_MSDOS_PARTITION=y
+CONFIG_NLS=m
+CONFIG_NLS_DEFAULT="iso8859-1"
+CONFIG_NLS_CODEPAGE_437=m
+CONFIG_NLS_CODEPAGE_737=m
+CONFIG_NLS_CODEPAGE_775=m
+CONFIG_NLS_CODEPAGE_850=m
+CONFIG_NLS_CODEPAGE_852=m
+CONFIG_NLS_CODEPAGE_855=m
+CONFIG_NLS_CODEPAGE_857=m
+CONFIG_NLS_CODEPAGE_860=m
+CONFIG_NLS_CODEPAGE_861=m
+CONFIG_NLS_CODEPAGE_862=m
+CONFIG_NLS_CODEPAGE_863=m
+CONFIG_NLS_CODEPAGE_864=m
+CONFIG_NLS_CODEPAGE_865=m
+CONFIG_NLS_CODEPAGE_866=m
+CONFIG_NLS_CODEPAGE_869=m
+CONFIG_NLS_CODEPAGE_936=m
+CONFIG_NLS_CODEPAGE_950=m
+CONFIG_NLS_CODEPAGE_932=m
+CONFIG_NLS_CODEPAGE_949=m
+CONFIG_NLS_CODEPAGE_874=m
+CONFIG_NLS_ISO8859_8=m
+CONFIG_NLS_CODEPAGE_1250=m
+CONFIG_NLS_CODEPAGE_1251=m
+CONFIG_NLS_ASCII=m
+CONFIG_NLS_ISO8859_1=m
+CONFIG_NLS_ISO8859_2=m
+CONFIG_NLS_ISO8859_3=m
+CONFIG_NLS_ISO8859_4=m
+CONFIG_NLS_ISO8859_5=m
+CONFIG_NLS_ISO8859_6=m
+CONFIG_NLS_ISO8859_7=m
+CONFIG_NLS_ISO8859_9=m
+CONFIG_NLS_ISO8859_13=m
+CONFIG_NLS_ISO8859_14=m
+CONFIG_NLS_ISO8859_15=m
+CONFIG_NLS_KOI8_R=m
+CONFIG_NLS_KOI8_U=m
+CONFIG_NLS_UTF8=m
+# CONFIG_DLM is not set
+
+#
+# Library routines
+#
+CONFIG_BITREVERSE=y
+CONFIG_CRC_CCITT=m
+# CONFIG_CRC16 is not set
+# CONFIG_CRC_ITU_T is not set
+CONFIG_CRC32=y
+# CONFIG_CRC7 is not set
+CONFIG_LIBCRC32C=m
+CONFIG_ZLIB_INFLATE=m
+CONFIG_ZLIB_DEFLATE=m
+CONFIG_PLIST=y
+CONFIG_HAS_IOMEM=y
+CONFIG_HAS_IOPORT=y
+CONFIG_HAS_DMA=y
+CONFIG_HAVE_LMB=y
+
+#
+# Kernel hacking
+#
+# CONFIG_PRINTK_TIME is not set
+CONFIG_ENABLE_WARN_DEPRECATED=y
+CONFIG_ENABLE_MUST_CHECK=y
+CONFIG_MAGIC_SYSRQ=y
+# CONFIG_UNUSED_SYMBOLS is not set
+CONFIG_DEBUG_FS=y
+# CONFIG_HEADERS_CHECK is not set
+CONFIG_DEBUG_KERNEL=y
+# CONFIG_DEBUG_SHIRQ is not set
+CONFIG_DETECT_SOFTLOCKUP=y
+CONFIG_SCHED_DEBUG=y
+# CONFIG_SCHEDSTATS is not set
+# CONFIG_TIMER_STATS is not set
+# CONFIG_DEBUG_SLAB is not set
+# CONFIG_DEBUG_RT_MUTEXES is not set
+# CONFIG_RT_MUTEX_TESTER is not set
+# CONFIG_DEBUG_SPINLOCK is not set
+# CONFIG_DEBUG_MUTEXES is not set
+# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
+# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
+# CONFIG_DEBUG_KOBJECT is not set
+# CONFIG_DEBUG_BUGVERBOSE is not set
+CONFIG_DEBUG_INFO=y
+# CONFIG_DEBUG_VM is not set
+# CONFIG_DEBUG_LIST is not set
+# CONFIG_DEBUG_SG is not set
+# CONFIG_BOOT_PRINTK_DELAY is not set
+# CONFIG_RCU_TORTURE_TEST is not set
+# CONFIG_BACKTRACE_SELF_TEST is not set
+# CONFIG_FAULT_INJECTION is not set
+# CONFIG_SAMPLES is not set
+# CONFIG_DEBUG_STACKOVERFLOW is not set
+# CONFIG_DEBUG_STACK_USAGE is not set
+# CONFIG_DEBUG_PAGEALLOC is not set
+CONFIG_DEBUGGER=y
+# CONFIG_XMON is not set
+# CONFIG_VIRQ_DEBUG is not set
+# CONFIG_BDI_SWITCH is not set
+# CONFIG_PPC_EARLY_DEBUG is not set
+
+#
+# Security options
+#
+# CONFIG_KEYS is not set
+CONFIG_SECURITY=y
+CONFIG_SECURITY_NETWORK=y
+# CONFIG_SECURITY_NETWORK_XFRM is not set
+CONFIG_SECURITY_CAPABILITIES=y
+# CONFIG_SECURITY_FILE_CAPABILITIES is not set
+CONFIG_SECURITY_DEFAULT_MMAP_MIN_ADDR=0
+CONFIG_CRYPTO=y
+CONFIG_CRYPTO_ALGAPI=y
+CONFIG_CRYPTO_AEAD=m
+CONFIG_CRYPTO_BLKCIPHER=y
+# CONFIG_CRYPTO_SEQIV is not set
+CONFIG_CRYPTO_HASH=y
+CONFIG_CRYPTO_MANAGER=y
+CONFIG_CRYPTO_HMAC=y
+# CONFIG_CRYPTO_XCBC is not set
+CONFIG_CRYPTO_NULL=m
+CONFIG_CRYPTO_MD4=m
+CONFIG_CRYPTO_MD5=y
+CONFIG_CRYPTO_SHA1=m
+CONFIG_CRYPTO_SHA256=m
+CONFIG_CRYPTO_SHA512=m
+CONFIG_CRYPTO_WP512=m
+# CONFIG_CRYPTO_TGR192 is not set
+# CONFIG_CRYPTO_GF128MUL is not set
+CONFIG_CRYPTO_ECB=m
+CONFIG_CRYPTO_CBC=y
+CONFIG_CRYPTO_PCBC=m
+# CONFIG_CRYPTO_LRW is not set
+# CONFIG_CRYPTO_XTS is not set
+# CONFIG_CRYPTO_CTR is not set
+# CONFIG_CRYPTO_GCM is not set
+# CONFIG_CRYPTO_CCM is not set
+# CONFIG_CRYPTO_CRYPTD is not set
+CONFIG_CRYPTO_DES=y
+# CONFIG_CRYPTO_FCRYPT is not set
+CONFIG_CRYPTO_BLOWFISH=m
+CONFIG_CRYPTO_TWOFISH=m
+CONFIG_CRYPTO_TWOFISH_COMMON=m
+CONFIG_CRYPTO_SERPENT=m
+CONFIG_CRYPTO_AES=m
+CONFIG_CRYPTO_CAST5=m
+CONFIG_CRYPTO_CAST6=m
+CONFIG_CRYPTO_TEA=m
+CONFIG_CRYPTO_ARC4=m
+CONFIG_CRYPTO_KHAZAD=m
+CONFIG_CRYPTO_ANUBIS=m
+# CONFIG_CRYPTO_SEED is not set
+# CONFIG_CRYPTO_SALSA20 is not set
+CONFIG_CRYPTO_DEFLATE=m
+CONFIG_CRYPTO_MICHAEL_MIC=m
+CONFIG_CRYPTO_CRC32C=m
+# CONFIG_CRYPTO_CAMELLIA is not set
+CONFIG_CRYPTO_TEST=m
+CONFIG_CRYPTO_AUTHENC=m
+# CONFIG_CRYPTO_LZO is not set
+CONFIG_CRYPTO_HW=y
+# CONFIG_CRYPTO_DEV_HIFN_795X is not set
+# CONFIG_PPC_CLOCK is not set
index b9dbfff9afe9359ec188b86733fdc9cf1aaa04e7..ce1e8d24e747c3ee56c19793700a5721df64c8b0 100644 (file)
@@ -67,6 +67,7 @@ obj-$(CONFIG_BOOTX_TEXT)      += btext.o
 obj-$(CONFIG_SMP)              += smp.o
 obj-$(CONFIG_KPROBES)          += kprobes.o
 obj-$(CONFIG_PPC_UDBG_16550)   += legacy_serial.o udbg_16550.o
+obj-$(CONFIG_STACKTRACE)       += stacktrace.o
 
 pci64-$(CONFIG_PPC64)          += pci_dn.o isa-bridge.o
 obj-$(CONFIG_PCI)              += pci_$(CONFIG_WORD_SIZE).o $(pci64-y) \
index 4b749c41646441b70b0216beddfeab7409a661ce..292c6d8db0e1af76d5d0b8af7bca83385c0b05e1 100644 (file)
@@ -26,8 +26,6 @@
 #ifdef CONFIG_PPC64
 #include <linux/time.h>
 #include <linux/hardirq.h>
-#else
-#include <linux/ptrace.h>
 #endif
 
 #include <asm/io.h>
@@ -46,6 +44,9 @@
 #include <asm/mmu.h>
 #include <asm/hvcall.h>
 #endif
+#ifdef CONFIG_PPC_ISERIES
+#include <asm/iseries/alpaca.h>
+#endif
 
 #define DEFINE(sym, val) \
        asm volatile("\n->" #sym " %0 " #val : : "i" (val))
@@ -60,7 +61,6 @@ int main(void)
        DEFINE(AUDITCONTEXT, offsetof(struct task_struct, audit_context));
 #else
        DEFINE(THREAD_INFO, offsetof(struct task_struct, stack));
-       DEFINE(PTRACE, offsetof(struct task_struct, ptrace));
 #endif /* CONFIG_PPC64 */
 
        DEFINE(KSP, offsetof(struct thread_struct, ksp));
@@ -80,7 +80,6 @@ int main(void)
        DEFINE(PGDIR, offsetof(struct thread_struct, pgdir));
 #if defined(CONFIG_4xx) || defined(CONFIG_BOOKE)
        DEFINE(THREAD_DBCR0, offsetof(struct thread_struct, dbcr0));
-       DEFINE(PT_PTRACED, PT_PTRACED);
 #endif
 #ifdef CONFIG_SPE
        DEFINE(THREAD_EVR0, offsetof(struct thread_struct, evr[0]));
@@ -325,6 +324,9 @@ int main(void)
        DEFINE(PAGE_OFFSET_VSID, KERNEL_VSID(PAGE_OFFSET));
        DEFINE(VMALLOC_START_ESID, GET_ESID(VMALLOC_START));
        DEFINE(VMALLOC_START_VSID, KERNEL_VSID(VMALLOC_START));
+
+       /* alpaca */
+       DEFINE(ALPACA_SIZE, sizeof(struct alpaca));
 #endif
 
        DEFINE(PGD_TABLE_SIZE, PGD_TABLE_SIZE);
index 80e2eef05b2e6c5fd6e8fed925b8761e28a27d4d..9f9377745490d966ff434f728bc1e15581c3dace 100644 (file)
@@ -7,6 +7,7 @@
 #include <linux/string.h>
 #include <linux/init.h>
 #include <linux/module.h>
+#include <linux/lmb.h>
 
 #include <asm/sections.h>
 #include <asm/prom.h>
@@ -15,7 +16,7 @@
 #include <asm/mmu.h>
 #include <asm/pgtable.h>
 #include <asm/io.h>
-#include <asm/lmb.h>
+#include <asm/prom.h>
 #include <asm/processor.h>
 #include <asm/udbg.h>
 
index 6250443ab9c999775e431ac4fa9325ba73534b22..5465e8de0e61a547fed18f14222199b311b0dfee 100644 (file)
@@ -3,7 +3,7 @@
  * Valentine Barshak <vbarshak@ru.mvista.com>
  * MontaVista Software, Inc (c) 2007
  *
- * Based on cpu_setup_6xx code by 
+ * Based on cpu_setup_6xx code by
  * Benjamin Herrenschmidt <benh@kernel.crashing.org>
  *
  * This program is free software; you can redistribute it and/or
@@ -32,6 +32,9 @@ _GLOBAL(__setup_cpu_440grx)
        bl      __fixup_440A_mcheck
        mtlr    r4
        blr
+_GLOBAL(__setup_cpu_460ex)
+_GLOBAL(__setup_cpu_460gt)
+       b       __init_fpu_44x
 _GLOBAL(__setup_cpu_440gx)
 _GLOBAL(__setup_cpu_440spe)
        b       __fixup_440A_mcheck
index 2a8f5cc5184f0c02641b7ba78aad7ba3c95367c4..26ffb44e2701ec5500ca1543e1169a2a9edd35ae 100644 (file)
@@ -36,6 +36,8 @@ extern void __setup_cpu_440epx(unsigned long offset, struct cpu_spec* spec);
 extern void __setup_cpu_440gx(unsigned long offset, struct cpu_spec* spec);
 extern void __setup_cpu_440grx(unsigned long offset, struct cpu_spec* spec);
 extern void __setup_cpu_440spe(unsigned long offset, struct cpu_spec* spec);
+extern void __setup_cpu_460ex(unsigned long offset, struct cpu_spec* spec);
+extern void __setup_cpu_460gt(unsigned long offset, struct cpu_spec* spec);
 extern void __setup_cpu_603(unsigned long offset, struct cpu_spec* spec);
 extern void __setup_cpu_604(unsigned long offset, struct cpu_spec* spec);
 extern void __setup_cpu_750(unsigned long offset, struct cpu_spec* spec);
@@ -1397,6 +1399,30 @@ static struct cpu_spec __initdata cpu_specs[] = {
                .machine_check          = machine_check_440A,
                .platform               = "ppc440",
        },
+       { /* 460EX */
+               .pvr_mask               = 0xffff0002,
+               .pvr_value              = 0x13020002,
+               .cpu_name               = "460EX",
+               .cpu_features           = CPU_FTRS_44X,
+               .cpu_user_features      = COMMON_USER_BOOKE | PPC_FEATURE_HAS_FPU,
+               .icache_bsize           = 32,
+               .dcache_bsize           = 32,
+               .cpu_setup              = __setup_cpu_460ex,
+               .machine_check          = machine_check_440A,
+               .platform               = "ppc440",
+       },
+       { /* 460GT */
+               .pvr_mask               = 0xffff0002,
+               .pvr_value              = 0x13020000,
+               .cpu_name               = "460GT",
+               .cpu_features           = CPU_FTRS_44X,
+               .cpu_user_features      = COMMON_USER_BOOKE | PPC_FEATURE_HAS_FPU,
+               .icache_bsize           = 32,
+               .dcache_bsize           = 32,
+               .cpu_setup              = __setup_cpu_460gt,
+               .machine_check          = machine_check_440A,
+               .platform               = "ppc440",
+       },
 #endif /* CONFIG_44x */
 #ifdef CONFIG_FSL_BOOKE
 #ifdef CONFIG_E200
@@ -1512,7 +1538,7 @@ struct cpu_spec * __init identify_cpu(unsigned long offset, unsigned int pvr)
                                *t = *s;
                        *PTRRELOC(&cur_cpu_spec) = &the_cpu_spec;
 #if defined(CONFIG_PPC64) || defined(CONFIG_BOOKE)
-                       /* ppc64 and booke expect identify_cpu to also call 
+                       /* ppc64 and booke expect identify_cpu to also call
                         * setup_cpu for that processor. I will consolidate
                         * that at a later time, for now, just use #ifdef.
                         * we also don't need to PTRRELOC the function pointer
index 571132ed12c1e4f74961eef16815533fa78c8351..eae401de3f769f08176838d9456a2e84c9ba786d 100644 (file)
 #include <linux/init.h>
 #include <linux/irq.h>
 #include <linux/types.h>
+#include <linux/lmb.h>
 
 #include <asm/processor.h>
 #include <asm/machdep.h>
 #include <asm/kexec.h>
 #include <asm/kdump.h>
-#include <asm/lmb.h>
+#include <asm/prom.h>
 #include <asm/firmware.h>
 #include <asm/smp.h>
 #include <asm/system.h>
index 29ff77c468ac77a3f8d3afdf81722aa46054673e..9ee3c5278db0a955425b4b1206a8e200ae01e6cc 100644 (file)
@@ -13,8 +13,9 @@
 
 #include <linux/crash_dump.h>
 #include <linux/bootmem.h>
+#include <linux/lmb.h>
 #include <asm/kdump.h>
-#include <asm/lmb.h>
+#include <asm/prom.h>
 #include <asm/firmware.h>
 #include <asm/uaccess.h>
 
index 69a91bd46115e171bb73cf76282db673ce5d054e..84c8686330681761ea173c2a11d56e74f4f6848a 100644 (file)
@@ -110,9 +110,9 @@ transfer_to_handler:
        stw     r11,PT_REGS(r12)
 #if defined(CONFIG_40x) || defined(CONFIG_BOOKE)
        /* Check to see if the dbcr0 register is set up to debug.  Use the
-          single-step bit to do this. */
+          internal debug mode bit to do this. */
        lwz     r12,THREAD_DBCR0(r12)
-       andis.  r12,r12,DBCR0_IC@h
+       andis.  r12,r12,DBCR0_IDM@h
        beq+    3f
        /* From user and task is ptraced - load up global dbcr0 */
        li      r12,-1                  /* clear all pending debug events */
@@ -120,6 +120,12 @@ transfer_to_handler:
        lis     r11,global_dbcr0@ha
        tophys(r11,r11)
        addi    r11,r11,global_dbcr0@l
+#ifdef CONFIG_SMP
+       rlwinm  r9,r1,0,0,(31-THREAD_SHIFT)
+       lwz     r9,TI_CPU(r9)
+       slwi    r9,r9,3
+       add     r11,r11,r9
+#endif
        lwz     r12,0(r11)
        mtspr   SPRN_DBCR0,r12
        lwz     r12,4(r11)
@@ -238,10 +244,10 @@ ret_from_syscall:
        stw     r11,_CCR(r1)
 syscall_exit_cont:
 #if defined(CONFIG_4xx) || defined(CONFIG_BOOKE)
-       /* If the process has its own DBCR0 value, load it up.  The single
-          step bit tells us that dbcr0 should be loaded. */
+       /* If the process has its own DBCR0 value, load it up.  The internal
+          debug mode bit tells us that dbcr0 should be loaded. */
        lwz     r0,THREAD+THREAD_DBCR0(r2)
-       andis.  r10,r0,DBCR0_IC@h
+       andis.  r10,r0,DBCR0_IDM@h
        bnel-   load_dbcr0
 #endif
 #ifdef CONFIG_44x
@@ -666,10 +672,10 @@ user_exc_return:          /* r10 contains MSR_KERNEL here */
 
 restore_user:
 #if defined(CONFIG_4xx) || defined(CONFIG_BOOKE)
-       /* Check whether this process has its own DBCR0 value.  The single
-          step bit tells us that dbcr0 should be loaded. */
+       /* Check whether this process has its own DBCR0 value.  The internal
+          debug mode bit tells us that dbcr0 should be loaded. */
        lwz     r0,THREAD+THREAD_DBCR0(r2)
-       andis.  r10,r0,DBCR0_IC@h
+       andis.  r10,r0,DBCR0_IDM@h
        bnel-   load_dbcr0
 #endif
 
@@ -879,6 +885,12 @@ load_dbcr0:
        mfspr   r10,SPRN_DBCR0
        lis     r11,global_dbcr0@ha
        addi    r11,r11,global_dbcr0@l
+#ifdef CONFIG_SMP
+       rlwinm  r9,r1,0,0,(31-THREAD_SHIFT)
+       lwz     r9,TI_CPU(r9)
+       slwi    r9,r9,3
+       add     r11,r11,r9
+#endif
        stw     r10,0(r11)
        mtspr   SPRN_DBCR0,r0
        lwz     r10,4(r11)
@@ -891,7 +903,7 @@ load_dbcr0:
        .section .bss
        .align  4
 global_dbcr0:
-       .space  8
+       .space  8*NR_CPUS
        .previous
 #endif /* !(CONFIG_4xx || CONFIG_BOOKE) */
 
index 148a3547c9aabbb04dc29a8f74a8a0cfd46bdf06..c0db5b769e55ee601e0d11e428cb6acc2c90d4bc 100644 (file)
@@ -29,6 +29,8 @@
 #include <asm/cputable.h>
 #include <asm/firmware.h>
 #include <asm/bug.h>
+#include <asm/ptrace.h>
+#include <asm/irqflags.h>
 
 /*
  * System calls.
@@ -39,7 +41,7 @@
 
 /* This value is used to mark exception frames on the stack. */
 exception_marker:
-       .tc     ID_72656773_68657265[TC],0x7265677368657265
+       .tc     ID_EXC_MARKER[TC],STACK_FRAME_REGS_MARKER
 
        .section        ".text"
        .align 7
@@ -88,6 +90,14 @@ system_call_common:
        addi    r9,r1,STACK_FRAME_OVERHEAD
        ld      r11,exception_marker@toc(r2)
        std     r11,-16(r9)             /* "regshere" marker */
+#ifdef CONFIG_TRACE_IRQFLAGS
+       bl      .trace_hardirqs_on
+       REST_GPR(0,r1)
+       REST_4GPRS(3,r1)
+       REST_2GPRS(7,r1)
+       addi    r9,r1,STACK_FRAME_OVERHEAD
+       ld      r12,_MSR(r1)
+#endif /* CONFIG_TRACE_IRQFLAGS */
        li      r10,1
        stb     r10,PACASOFTIRQEN(r13)
        stb     r10,PACAHARDIRQEN(r13)
@@ -102,7 +112,7 @@ BEGIN_FW_FTR_SECTION
        b       hardware_interrupt_entry
 2:
 END_FW_FTR_SECTION_IFSET(FW_FEATURE_ISERIES)
-#endif
+#endif /* CONFIG_PPC_ISERIES */
        mfmsr   r11
        ori     r11,r11,MSR_EE
        mtmsrd  r11,1
@@ -504,6 +514,10 @@ BEGIN_FW_FTR_SECTION
 
        li      r3,0
        stb     r3,PACASOFTIRQEN(r13)   /* ensure we are soft-disabled */
+#ifdef CONFIG_TRACE_IRQFLAGS
+       bl      .trace_hardirqs_off
+       mfmsr   r10
+#endif
        ori     r10,r10,MSR_EE
        mtmsrd  r10                     /* hard-enable again */
        addi    r3,r1,STACK_FRAME_OVERHEAD
@@ -512,7 +526,7 @@ BEGIN_FW_FTR_SECTION
 4:
 END_FW_FTR_SECTION_IFSET(FW_FEATURE_ISERIES)
 #endif
-       stb     r5,PACASOFTIRQEN(r13)
+       TRACE_AND_RESTORE_IRQ(r5);
 
        /* extract EE bit and use it to restore paca->hard_enabled */
        ld      r3,_MSR(r1)
@@ -580,6 +594,16 @@ do_work:
        bne     restore
        /* here we are preempting the current task */
 1:
+#ifdef CONFIG_TRACE_IRQFLAGS
+       bl      .trace_hardirqs_on
+       /* Note: we just clobbered r10 which used to contain the previous
+        * MSR before the hard-disabling done by the caller of do_work.
+        * We don't have that value anymore, but it doesn't matter as
+        * we will hard-enable unconditionally, we can just reload the
+        * current MSR into r10
+        */
+       mfmsr   r10
+#endif /* CONFIG_TRACE_IRQFLAGS */
        li      r0,1
        stb     r0,PACASOFTIRQEN(r13)
        stb     r0,PACAHARDIRQEN(r13)
index 0f4fac51202007492fdc219e99533d119bcc3339..785af9b56591550d2947bf211e28901ab9981e48 100644 (file)
@@ -30,6 +30,7 @@
 #include <asm/thread_info.h>
 #include <asm/ppc_asm.h>
 #include <asm/asm-offsets.h>
+#include <asm/ptrace.h>
 
 /* 601 only have IBAT; cr0.eq is set on 601 when using this macro */
 #define LOAD_BAT(n, reg, RA, RB)       \
@@ -268,8 +269,8 @@ __secondary_hold_acknowledge:
        li      r10,MSR_KERNEL & ~(MSR_IR|MSR_DR); /* can take exceptions */ \
        MTMSRD(r10);                    /* (except for mach check in rtas) */ \
        stw     r0,GPR0(r11);   \
-       lis     r10,0x7265;             /* put exception frame marker */ \
-       addi    r10,r10,0x6773; \
+       lis     r10,STACK_FRAME_REGS_MARKER@ha; /* exception frame marker */ \
+       addi    r10,r10,STACK_FRAME_REGS_MARKER@l; \
        stw     r10,8(r11);     \
        SAVE_4GPRS(3, r11);     \
        SAVE_2GPRS(7, r11)
@@ -762,23 +763,6 @@ load_up_altivec:
        /* we haven't used ctr or xer or lr */
        b       fast_exception_return
 
-/*
- * AltiVec unavailable trap from kernel - print a message, but let
- * the task use AltiVec in the kernel until it returns to user mode.
- */
-KernelAltiVec:
-       lwz     r3,_MSR(r1)
-       oris    r3,r3,MSR_VEC@h
-       stw     r3,_MSR(r1)     /* enable use of AltiVec after return */
-       lis     r3,87f@h
-       ori     r3,r3,87f@l
-       mr      r4,r2           /* current */
-       lwz     r5,_NIP(r1)
-       bl      printk
-       b       ret_from_except
-87:    .string "AltiVec used in kernel  (task=%p, pc=%x)  \n"
-       .align  4,0
-
 /*
  * giveup_altivec(tsk)
  * Disable AltiVec for the task given as the argument,
index ad071a146a8df66596376133114f64e50178e001..b84ec6a2fc94c06a4374647344e0c4ce6c87e01c 100644 (file)
@@ -211,7 +211,7 @@ skpinv:     addi    r4,r4,1                         /* Increment */
        SET_IVOR(12, WatchdogTimer);
        SET_IVOR(13, DataTLBError);
        SET_IVOR(14, InstructionTLBError);
-       SET_IVOR(15, Debug);
+       SET_IVOR(15, DebugCrit);
 
        /* Establish the interrupt vector base */
        lis     r4,interrupt_base@h     /* IVPR only uses the high 16-bits */
@@ -578,7 +578,7 @@ interrupt_base:
        b       InstructionStorage
 
        /* Debug Interrupt */
-       DEBUG_EXCEPTION
+       DEBUG_CRIT_EXCEPTION
 
 /*
  * Local functions
index d3aee08e6814130fc1c9f75441c42a5890819d2a..215973a2c8d5971fd8431505d1c58b62a4bd5bf7 100644 (file)
@@ -36,8 +36,7 @@
 #include <asm/firmware.h>
 #include <asm/page_64.h>
 #include <asm/exception.h>
-
-#define DO_SOFT_DISABLE
+#include <asm/irqflags.h>
 
 /*
  * We layout physical memory as follows:
@@ -450,8 +449,8 @@ bad_stack:
  */
 fast_exc_return_irq:                   /* restores irq state too */
        ld      r3,SOFTE(r1)
+       TRACE_AND_RESTORE_IRQ(r3);
        ld      r12,_MSR(r1)
-       stb     r3,PACASOFTIRQEN(r13)   /* restore paca->soft_enabled */
        rldicl  r4,r12,49,63            /* get MSR_EE to LSB */
        stb     r4,PACAHARDIRQEN(r13)   /* restore paca->hard_enabled */
        b       1f
@@ -621,7 +620,7 @@ END_FW_FTR_SECTION_IFSET(FW_FEATURE_ISERIES)
        mtlr    r10
 
        andi.   r10,r12,MSR_RI  /* check for unrecoverable exception */
-       beq-    unrecov_slb
+       beq-    2f
 
 .machine       push
 .machine       "power4"
@@ -643,6 +642,22 @@ END_FW_FTR_SECTION_IFSET(FW_FEATURE_ISERIES)
        rfid
        b       .       /* prevent speculative execution */
 
+2:
+#ifdef CONFIG_PPC_ISERIES
+BEGIN_FW_FTR_SECTION
+       b       unrecov_slb
+END_FW_FTR_SECTION_IFSET(FW_FEATURE_ISERIES)
+#endif /* CONFIG_PPC_ISERIES */
+       mfspr   r11,SPRN_SRR0
+       clrrdi  r10,r13,32
+       LOAD_HANDLER(r10,unrecov_slb)
+       mtspr   SPRN_SRR0,r10
+       mfmsr   r10
+       ori     r10,r10,MSR_IR|MSR_DR|MSR_RI
+       mtspr   SPRN_SRR1,r10
+       rfid
+       b       .
+
 unrecov_slb:
        EXCEPTION_PROLOG_COMMON(0x4100, PACA_EXSLB)
        DISABLE_INTS
@@ -808,7 +823,7 @@ _STATIC(load_up_altivec)
  * Hash table stuff
  */
        .align  7
-_GLOBAL(do_hash_page)
+_STATIC(do_hash_page)
        std     r3,_DAR(r1)
        std     r4,_DSISR(r1)
 
@@ -819,6 +834,27 @@ BEGIN_FTR_SECTION
        bne-    do_ste_alloc            /* If so handle it */
 END_FTR_SECTION_IFCLR(CPU_FTR_SLB)
 
+       /*
+        * On iSeries, we soft-disable interrupts here, then
+        * hard-enable interrupts so that the hash_page code can spin on
+        * the hash_table_lock without problems on a shared processor.
+        */
+       DISABLE_INTS
+
+       /*
+        * Currently, trace_hardirqs_off() will be called by DISABLE_INTS
+        * and will clobber volatile registers when irq tracing is enabled
+        * so we need to reload them. It may be possible to be smarter here
+        * and move the irq tracing elsewhere but let's keep it simple for
+        * now
+        */
+#ifdef CONFIG_TRACE_IRQFLAGS
+       ld      r3,_DAR(r1)
+       ld      r4,_DSISR(r1)
+       ld      r5,_TRAP(r1)
+       ld      r12,_MSR(r1)
+       clrrdi  r5,r5,4
+#endif /* CONFIG_TRACE_IRQFLAGS */
        /*
         * We need to set the _PAGE_USER bit if MSR_PR is set or if we are
         * accessing a userspace segment (even from the kernel). We assume
@@ -831,13 +867,6 @@ END_FTR_SECTION_IFCLR(CPU_FTR_SLB)
        ori     r4,r4,1                 /* add _PAGE_PRESENT */
        rlwimi  r4,r5,22+2,31-2,31-2    /* Set _PAGE_EXEC if trap is 0x400 */
 
-       /*
-        * On iSeries, we soft-disable interrupts here, then
-        * hard-enable interrupts so that the hash_page code can spin on
-        * the hash_table_lock without problems on a shared processor.
-        */
-       DISABLE_INTS
-
        /*
         * r3 contains the faulting address
         * r4 contains the required access permissions
@@ -848,7 +877,6 @@ END_FTR_SECTION_IFCLR(CPU_FTR_SLB)
        bl      .hash_page              /* build HPTE if possible */
        cmpdi   r3,0                    /* see if hash_page succeeded */
 
-#ifdef DO_SOFT_DISABLE
 BEGIN_FW_FTR_SECTION
        /*
         * If we had interrupts soft-enabled at the point where the
@@ -860,7 +888,7 @@ BEGIN_FW_FTR_SECTION
         */
        beq     13f
 END_FW_FTR_SECTION_IFSET(FW_FEATURE_ISERIES)
-#endif
+
 BEGIN_FW_FTR_SECTION
        /*
         * Here we have interrupts hard-disabled, so it is sufficient
@@ -874,11 +902,12 @@ END_FW_FTR_SECTION_IFCLR(FW_FEATURE_ISERIES)
 
        /*
         * hash_page couldn't handle it, set soft interrupt enable back
-        * to what it was before the trap.  Note that .local_irq_restore
+        * to what it was before the trap.  Note that .raw_local_irq_restore
         * handles any interrupts pending at this point.
         */
        ld      r3,SOFTE(r1)
-       bl      .local_irq_restore
+       TRACE_AND_RESTORE_IRQ_PARTIAL(r3, 11f)
+       bl      .raw_local_irq_restore
        b       11f
 
 /* Here we have a page fault that hash_page can't handle. */
@@ -1477,6 +1506,10 @@ _INIT_STATIC(start_here_multiplatform)
        addi    r2,r2,0x4000
        add     r2,r2,r26
 
+       /* Set initial ptr to current */
+       LOAD_REG_IMMEDIATE(r4, init_task)
+       std     r4,PACACURRENT(r13)
+
        /* Do very early kernel initializations, including initial hash table,
         * stab and slb setup before we turn on relocation.     */
 
@@ -1505,10 +1538,6 @@ _INIT_GLOBAL(start_here_common)
        li      r0,0
        stdu    r0,-STACK_FRAME_OVERHEAD(r1)
 
-       /* ptr to current */
-       LOAD_REG_IMMEDIATE(r4, init_task)
-       std     r4,PACACURRENT(r13)
-
        /* Load the TOC */
        ld      r2,PACATOC(r13)
        std     r1,PACAKSAVE(r13)
index ba9393f8e77a0c1e350c1e58950256539bf45873..aefafc6330c9497be4d7c8c8b2cf9f5e63b51749 100644 (file)
  * is necessary since the MMU is always on, for Book-E parts, and the stacks
  * are offset from KERNELBASE.
  *
+ * There is some space optimization to be had here if desired.  However
+ * to allow for a common kernel with support for debug exceptions either
+ * going to critical or their own debug level we aren't currently
+ * providing configurations that micro-optimize space usage.
  */
-#define BOOKE_EXCEPTION_STACK_SIZE     (8192)
+#ifdef CONFIG_44x
+#define NUM_EXCEPTION_LVLS     2
+#else
+#define NUM_EXCEPTION_LVLS     3
+#endif
+#define BOOKE_EXCEPTION_STACK_SIZE     (4096 * NUM_EXCEPTION_LVLS)
 
 /* CRIT_SPRG only used in critical exception handling */
 #define CRIT_SPRG      SPRN_SPRG2
@@ -68,7 +77,7 @@
 #define CRIT_STACK_TOP         (exception_stack_top)
 
 /* only on e200 for now */
-#define DEBUG_STACK_TOP                (exception_stack_top - 4096)
+#define DEBUG_STACK_TOP                (exception_stack_top - 8192)
 #define DEBUG_SPRG             SPRN_SPRG6W
 
 #ifdef CONFIG_SMP
@@ -212,9 +221,8 @@ label:
  * save (and later restore) the MSR via SPRN_CSRR1, which will still have
  * the MSR_DE bit set.
  */
-#ifdef CONFIG_E200
-#define DEBUG_EXCEPTION                                                              \
-       START_EXCEPTION(Debug);                                               \
+#define DEBUG_DEBUG_EXCEPTION                                                \
+       START_EXCEPTION(DebugDebug);                                          \
        DEBUG_EXCEPTION_PROLOG;                                               \
                                                                              \
        /*                                                                    \
@@ -234,8 +242,8 @@ label:
        cmplw   r12,r10;                                                      \
        blt+    2f;                     /* addr below exception vectors */    \
                                                                              \
-       lis     r10,Debug@h;                                                  \
-       ori     r10,r10,Debug@l;                                              \
+       lis     r10,DebugDebug@h;                                             \
+       ori     r10,r10,DebugDebug@l;                                         \
        cmplw   r12,r10;                                                      \
        bgt+    2f;                     /* addr above exception vectors */    \
                                                                              \
@@ -265,9 +273,9 @@ label:
 2:     mfspr   r4,SPRN_DBSR;                                                 \
        addi    r3,r1,STACK_FRAME_OVERHEAD;                                   \
        EXC_XFER_TEMPLATE(DebugException, 0x2002, (MSR_KERNEL & ~(MSR_ME|MSR_DE|MSR_CE)), NOCOPY, debug_transfer_to_handler, ret_from_debug_exc)
-#else
-#define DEBUG_EXCEPTION                                                              \
-       START_EXCEPTION(Debug);                                               \
+
+#define DEBUG_CRIT_EXCEPTION                                                 \
+       START_EXCEPTION(DebugCrit);                                           \
        CRITICAL_EXCEPTION_PROLOG;                                            \
                                                                              \
        /*                                                                    \
@@ -287,8 +295,8 @@ label:
        cmplw   r12,r10;                                                      \
        blt+    2f;                     /* addr below exception vectors */    \
                                                                              \
-       lis     r10,Debug@h;                                                  \
-       ori     r10,r10,Debug@l;                                              \
+       lis     r10,DebugCrit@h;                                                      \
+       ori     r10,r10,DebugCrit@l;                                          \
        cmplw   r12,r10;                                                      \
        bgt+    2f;                     /* addr above exception vectors */    \
                                                                              \
@@ -318,7 +326,6 @@ label:
 2:     mfspr   r4,SPRN_DBSR;                                                 \
        addi    r3,r1,STACK_FRAME_OVERHEAD;                                   \
        EXC_XFER_TEMPLATE(DebugException, 0x2002, (MSR_KERNEL & ~(MSR_ME|MSR_DE|MSR_CE)), NOCOPY, crit_transfer_to_handler, ret_from_crit_exc)
-#endif
 
 #define INSTRUCTION_STORAGE_EXCEPTION                                        \
        START_EXCEPTION(InstructionStorage)                                   \
index d9cc2c288d9ec247fdaa1f281ab1073022007a01..4ff7441435660631f5b5bad2359ebcc0af07003f 100644 (file)
@@ -68,7 +68,9 @@ _ENTRY(_start);
        mr      r29,r5
        mr      r28,r6
        mr      r27,r7
+       li      r25,0           /* phys kernel start (low) */
        li      r24,0           /* CPU number */
+       li      r23,0           /* phys kernel start (high) */
 
 /* We try to not make any assumptions about how the boot loader
  * setup or used the TLBs.  We invalidate all mappings from the
@@ -167,7 +169,28 @@ skpinv:    addi    r6,r6,1                         /* Increment */
        mtspr   SPRN_MAS0,r7
        tlbre
 
-       /* Just modify the entry ID, EPN and RPN for the temp mapping */
+       /* grab and fixup the RPN */
+       mfspr   r6,SPRN_MAS1    /* extract MAS1[SIZE] */
+       rlwinm  r6,r6,25,27,30
+       li      r8,-1
+       addi    r6,r6,10
+       slw     r6,r8,r6        /* convert to mask */
+
+       bl      1f              /* Find our address */
+1:     mflr    r7
+
+       mfspr   r8,SPRN_MAS3
+#ifdef CONFIG_PHYS_64BIT
+       mfspr   r23,SPRN_MAS7
+#endif
+       and     r8,r6,r8
+       subfic  r9,r6,-4096
+       and     r9,r9,r7
+
+       or      r25,r8,r9
+       ori     r8,r25,(MAS3_SX|MAS3_SW|MAS3_SR)
+
+       /* Just modify the entry ID and EPN for the temp mapping */
        lis     r7,0x1000       /* Set MAS0(TLBSEL) = 1 */
        rlwimi  r7,r5,16,4,15   /* Setup MAS0 = TLBSEL | ESEL(r5) */
        mtspr   SPRN_MAS0,r7
@@ -177,12 +200,10 @@ skpinv:   addi    r6,r6,1                         /* Increment */
        ori     r6,r6,(MAS1_TSIZE(BOOKE_PAGESZ_4K))@l
        mtspr   SPRN_MAS1,r6
        mfspr   r6,SPRN_MAS2
-       lis     r7,PHYSICAL_START@h
+       li      r7,0            /* temp EPN = 0 */
        rlwimi  r7,r6,0,20,31
        mtspr   SPRN_MAS2,r7
-       mfspr   r6,SPRN_MAS3
-       rlwimi  r7,r6,0,20,31
-       mtspr   SPRN_MAS3,r7
+       mtspr   SPRN_MAS3,r8
        tlbwe
 
        xori    r6,r4,1
@@ -232,8 +253,7 @@ skpinv:     addi    r6,r6,1                         /* Increment */
        ori     r6,r6,PAGE_OFFSET@l
        rlwimi  r6,r7,0,20,31
        mtspr   SPRN_MAS2,r6
-       li      r7,(MAS3_SX|MAS3_SW|MAS3_SR)
-       mtspr   SPRN_MAS3,r7
+       mtspr   SPRN_MAS3,r8
        tlbwe
 
 /* 7. Jump to KERNELBASE mapping */
@@ -283,7 +303,10 @@ skpinv:    addi    r6,r6,1                         /* Increment */
        SET_IVOR(12, WatchdogTimer);
        SET_IVOR(13, DataTLBError);
        SET_IVOR(14, InstructionTLBError);
-       SET_IVOR(15, Debug);
+       SET_IVOR(15, DebugDebug);
+#if defined(CONFIG_E500)
+       SET_IVOR(15, DebugCrit);
+#endif
        SET_IVOR(32, SPEUnavailable);
        SET_IVOR(33, SPEFloatingPointData);
        SET_IVOR(34, SPEFloatingPointRound);
@@ -718,7 +741,10 @@ interrupt_base:
 
 
        /* Debug Interrupt */
-       DEBUG_EXCEPTION
+       DEBUG_DEBUG_EXCEPTION
+#if defined(CONFIG_E500)
+       DEBUG_CRIT_EXCEPTION
+#endif
 
 /*
  * Local functions
index 2f50bb5d00f936e6f55c4dc5c41b10b0182a9c19..9971159c80406d72e4f3b9806fcd7d6d60f5cec3 100644 (file)
@@ -183,7 +183,7 @@ static int ibmebus_create_devices(const struct of_device_id *matches)
                ret = ibmebus_create_device(child);
                if (ret) {
                        printk(KERN_ERR "%s: failed to create device (%i)",
-                              __FUNCTION__, ret);
+                              __func__, ret);
                        of_node_put(child);
                        break;
                }
@@ -269,7 +269,7 @@ static ssize_t ibmebus_store_probe(struct bus_type *bus,
        if (bus_find_device(&ibmebus_bus_type, NULL, path,
                            ibmebus_match_path)) {
                printk(KERN_WARNING "%s: %s has already been probed\n",
-                      __FUNCTION__, path);
+                      __func__, path);
                rc = -EEXIST;
                goto out;
        }
@@ -279,7 +279,7 @@ static ssize_t ibmebus_store_probe(struct bus_type *bus,
                of_node_put(dn);
        } else {
                printk(KERN_WARNING "%s: no such device node: %s\n",
-                      __FUNCTION__, path);
+                      __func__, path);
                rc = -ENODEV;
        }
 
@@ -308,7 +308,7 @@ static ssize_t ibmebus_store_remove(struct bus_type *bus,
                return count;
        } else {
                printk(KERN_WARNING "%s: %s not on the bus\n",
-                      __FUNCTION__, path);
+                      __func__, path);
 
                kfree(path);
                return -ENODEV;
@@ -337,14 +337,14 @@ static int __init ibmebus_bus_init(void)
        err = of_bus_type_init(&ibmebus_bus_type, "ibmebus");
        if (err) {
                printk(KERN_ERR "%s: failed to register IBM eBus.\n",
-                      __FUNCTION__);
+                      __func__);
                return err;
        }
 
        err = device_register(&ibmebus_bus_device);
        if (err) {
                printk(KERN_WARNING "%s: device_register returned %i\n",
-                      __FUNCTION__, err);
+                      __func__, err);
                bus_unregister(&ibmebus_bus_type);
 
                return err;
index 8f1f4e539c4bdfe57d9c5a1c1fe2232f9370062f..0c663669bc32cc0dd3bc183368f2225bd5b4d0dc 100644 (file)
@@ -520,7 +520,7 @@ void iommu_free_table(struct iommu_table *tbl, const char *node_name)
        unsigned int order;
 
        if (!tbl || !tbl->it_map) {
-               printk(KERN_ERR "%s: expected TCE map for %s\n", __FUNCTION__,
+               printk(KERN_ERR "%s: expected TCE map for %s\n", __func__,
                                node_name);
                return;
        }
@@ -530,7 +530,7 @@ void iommu_free_table(struct iommu_table *tbl, const char *node_name)
        for (i = 0; i < (tbl->it_size/64); i++) {
                if (tbl->it_map[i] != 0) {
                        printk(KERN_WARNING "%s: Unexpected TCEs for %s\n",
-                               __FUNCTION__, node_name);
+                               __func__, node_name);
                        break;
                }
        }
index 292163f5b39a9f7afbe1a86abda736d28bbdb4ba..425616f92d18a6b94ab94aad0f22634a043b0cb6 100644 (file)
@@ -114,7 +114,7 @@ static inline void set_soft_enabled(unsigned long enable)
        : : "r" (enable), "i" (offsetof(struct paca_struct, soft_enabled)));
 }
 
-void local_irq_restore(unsigned long en)
+void raw_local_irq_restore(unsigned long en)
 {
        /*
         * get_paca()->soft_enabled = en;
@@ -174,6 +174,7 @@ void local_irq_restore(unsigned long en)
 
        __hard_irq_enable();
 }
+EXPORT_SYMBOL(raw_local_irq_restore);
 #endif /* CONFIG_PPC64 */
 
 int show_interrupts(struct seq_file *p, void *v)
@@ -310,8 +311,21 @@ void do_IRQ(struct pt_regs *regs)
                                handler = &__do_IRQ;
                        irqtp->task = curtp->task;
                        irqtp->flags = 0;
+
+                       /* Copy the softirq bits in preempt_count so that the
+                        * softirq checks work in the hardirq context.
+                        */
+                       irqtp->preempt_count =
+                               (irqtp->preempt_count & ~SOFTIRQ_MASK) |
+                               (curtp->preempt_count & SOFTIRQ_MASK);
+
                        call_handle_irq(irq, desc, irqtp, handler);
                        irqtp->task = NULL;
+
+
+                       /* Set any flag that may have been set on the
+                        * alternate stack
+                        */
                        if (irqtp->flags)
                                set_bits(irqtp->flags, &curtp->flags);
                } else
@@ -357,7 +371,7 @@ void irq_ctx_init(void)
                memset((void *)softirq_ctx[i], 0, THREAD_SIZE);
                tp = softirq_ctx[i];
                tp->cpu = i;
-               tp->preempt_count = SOFTIRQ_OFFSET;
+               tp->preempt_count = 0;
 
                memset((void *)hardirq_ctx[i], 0, THREAD_SIZE);
                tp = hardirq_ctx[i];
index ee172aa42aa7713abba98220903b826ab5d8cadf..289af348978dac142638703e630bdaf367001068 100644 (file)
@@ -80,13 +80,13 @@ static void __devinit pci_process_ISA_OF_ranges(struct device_node *isa_node,
         *                      (size depending on dev->n_addr_cells)
         *   cell 5:            the size of the range
         */
-       if ((range->isa_addr.a_hi && ISA_SPACE_MASK) != ISA_SPACE_IO) {
+       if ((range->isa_addr.a_hi & ISA_SPACE_MASK) != ISA_SPACE_IO) {
                range++;
                rlen -= sizeof(struct isa_range);
                if (rlen < sizeof(struct isa_range))
                        goto inval_range;
        }
-       if ((range->isa_addr.a_hi && ISA_SPACE_MASK) != ISA_SPACE_IO)
+       if ((range->isa_addr.a_hi & ISA_SPACE_MASK) != ISA_SPACE_IO)
                goto inval_range;
 
        isa_addr = range->isa_addr.a_lo;
@@ -99,7 +99,7 @@ static void __devinit pci_process_ISA_OF_ranges(struct device_node *isa_node,
         */
        if ((pci_addr != 0) || (isa_addr != 0)) {
                printk(KERN_ERR "unexpected isa to pci mapping: %s\n",
-                      __FUNCTION__);
+                      __func__);
                return;
        }
 
index dcb89a88df46d75102c2aaa23bc6641aa34a041c..1ffacc698ffb613b3614d666e5f41f15511743bd 100644 (file)
@@ -226,7 +226,7 @@ static void parse_system_parameter_string(struct seq_file *m)
        unsigned char *local_buffer = kmalloc(SPLPAR_MAXLENGTH, GFP_KERNEL);
        if (!local_buffer) {
                printk(KERN_ERR "%s %s kmalloc failure at line %d \n",
-                      __FILE__, __FUNCTION__, __LINE__);
+                      __FILE__, __func__, __LINE__);
                return;
        }
 
@@ -243,14 +243,14 @@ static void parse_system_parameter_string(struct seq_file *m)
        if (call_status != 0) {
                printk(KERN_INFO
                       "%s %s Error calling get-system-parameter (0x%x)\n",
-                      __FILE__, __FUNCTION__, call_status);
+                      __FILE__, __func__, call_status);
        } else {
                int splpar_strlen;
                int idx, w_idx;
                char *workbuffer = kzalloc(SPLPAR_MAXLENGTH, GFP_KERNEL);
                if (!workbuffer) {
                        printk(KERN_ERR "%s %s kmalloc failure at line %d \n",
-                              __FILE__, __FUNCTION__, __LINE__);
+                              __FILE__, __func__, __LINE__);
                        kfree(local_buffer);
                        return;
                }
@@ -484,10 +484,10 @@ static ssize_t lparcfg_write(struct file *file, const char __user * buf,
        current_weight = (resource >> 5 * 8) & 0xFF;
 
        pr_debug("%s: current_entitled = %lu, current_weight = %u\n",
-                __FUNCTION__, current_entitled, current_weight);
+                __func__, current_entitled, current_weight);
 
        pr_debug("%s: new_entitled = %lu, new_weight = %u\n",
-                __FUNCTION__, *new_entitled_ptr, *new_weight_ptr);
+                __func__, *new_entitled_ptr, *new_weight_ptr);
 
        retval = plpar_hcall_norets(H_SET_PPP, *new_entitled_ptr,
                                    *new_weight_ptr);
@@ -502,7 +502,7 @@ static ssize_t lparcfg_write(struct file *file, const char __user * buf,
                retval = -EINVAL;
        } else {
                printk(KERN_WARNING "%s: received unknown hv return code %ld",
-                      __FUNCTION__, retval);
+                      __func__, retval);
                retval = -EIO;
        }
 
index c0c8e8c3ced90a62b8c5996dcd75bb1a6bae0001..2d202f274e7384722a0584a224b415420ee5ed11 100644 (file)
@@ -12,8 +12,9 @@
 #include <linux/kexec.h>
 #include <linux/reboot.h>
 #include <linux/threads.h>
+#include <linux/lmb.h>
 #include <asm/machdep.h>
-#include <asm/lmb.h>
+#include <asm/prom.h>
 
 void machine_crash_shutdown(struct pt_regs *regs)
 {
index 55f1a25085cd8ee2c60494c68978b872315622e9..ac163bd46cfdaf99d7a5da904d9f455cf6a220dc 100644 (file)
@@ -15,7 +15,6 @@
 #include <asm/ptrace.h>
 #include <asm/page.h>
 #include <asm/lppaca.h>
-#include <asm/iseries/it_lp_reg_save.h>
 #include <asm/paca.h>
 #include <asm/mmu.h>
 
 extern unsigned long __toc_start;
 
 /*
- * iSeries structure which the hypervisor knows about - this structure
+ * The structure which the hypervisor knows about - this structure
  * should not cross a page boundary.  The vpa_init/register_vpa call
  * is now known to fail if the lppaca structure crosses a page
- * boundary.  The lppaca is also used on POWER5 pSeries boxes.  The
- * lppaca is 640 bytes long, and cannot readily change since the
- * hypervisor knows its layout, so a 1kB alignment will suffice to
- * ensure that it doesn't cross a page boundary.
+ * boundary.  The lppaca is also used on legacy iSeries and POWER5
+ * pSeries boxes.  The lppaca is 640 bytes long, and cannot readily
+ * change since the hypervisor knows its layout, so a 1kB alignment
+ * will suffice to ensure that it doesn't cross a page boundary.
  */
 struct lppaca lppaca[] = {
        [0 ... (NR_CPUS-1)] = {
@@ -66,32 +65,17 @@ struct slb_shadow slb_shadow[] __cacheline_aligned = {
  * processors.  The processor VPD array needs one entry per physical
  * processor (not thread).
  */
-#define PACA_INIT_COMMON(number)                                           \
+#define PACA_INIT(number)                                                  \
+{                                                                          \
        .lppaca_ptr = &lppaca[number],                                      \
        .lock_token = 0x8000,                                               \
        .paca_index = (number),         /* Paca Index */                    \
        .kernel_toc = (unsigned long)(&__toc_start) + 0x8000UL,             \
        .hw_cpu_id = 0xffff,                                                \
-       .slb_shadow_ptr = &slb_shadow[number],
-
-#ifdef CONFIG_PPC_ISERIES
-#define PACA_INIT_ISERIES(number)                                          \
-       .reg_save_ptr = &iseries_reg_save[number],
-
-#define PACA_INIT(number)                                                  \
-{                                                                          \
-       PACA_INIT_COMMON(number)                                            \
-       PACA_INIT_ISERIES(number)                                           \
+       .slb_shadow_ptr = &slb_shadow[number],                              \
+       .__current = &init_task,                                            \
 }
 
-#else
-#define PACA_INIT(number)                                                  \
-{                                                                          \
-       PACA_INIT_COMMON(number)                                            \
-}
-
-#endif
-
 struct paca_struct paca[] = {
        PACA_INIT(0),
 #if NR_CPUS > 1
index 90e5627717911a6bdb80c761d71183a4d7ec61e6..fda05e2211d69765820dce45dc0affc89d1bf68b 100644 (file)
@@ -135,4 +135,6 @@ struct ucontext32 {
        struct mcontext32       uc_mcontext;
 };
 
+extern int copy_siginfo_to_user32(struct compat_siginfo __user *d, siginfo_t *s);
+
 #endif  /* _PPC64_PPC32_H */
index 65d14e6ddc3cacc68f8fb2fde2b88a0d51c6faa0..09fcb50c45aec30647df4eb6650b4ec380f43d2a 100644 (file)
 #include <asm/signal.h>
 #include <asm/dcr.h>
 
-#ifdef CONFIG_PPC64
-EXPORT_SYMBOL(local_irq_restore);
-#endif
-
 #ifdef CONFIG_PPC32
 extern void transfer_to_handler(void);
 extern void do_IRQ(struct pt_regs *regs);
@@ -57,7 +53,6 @@ extern void program_check_exception(struct pt_regs *regs);
 extern void single_step_exception(struct pt_regs *regs);
 extern int sys_sigreturn(struct pt_regs *regs);
 
-EXPORT_SYMBOL(empty_zero_page);
 EXPORT_SYMBOL(clear_pages);
 EXPORT_SYMBOL(copy_page);
 EXPORT_SYMBOL(ISA_DMA_THRESHOLD);
@@ -78,6 +73,7 @@ EXPORT_SYMBOL(strncpy);
 EXPORT_SYMBOL(strcat);
 EXPORT_SYMBOL(strlen);
 EXPORT_SYMBOL(strcmp);
+EXPORT_SYMBOL(strncmp);
 
 EXPORT_SYMBOL(csum_partial);
 EXPORT_SYMBOL(csum_partial_copy_generic);
@@ -191,3 +187,4 @@ EXPORT_SYMBOL(intercept_table);
 EXPORT_SYMBOL(__mtdcr);
 EXPORT_SYMBOL(__mfdcr);
 #endif
+EXPORT_SYMBOL(empty_zero_page);
index 4ec605521504d0e4ef8a01bc9902504d57908e7f..703100d5e4589c4e1f7566d0b720e05c560bf07d 100644 (file)
@@ -868,11 +868,6 @@ int sys_execve(unsigned long a0, unsigned long a1, unsigned long a2,
        flush_spe_to_thread(current);
        error = do_execve(filename, (char __user * __user *) a1,
                          (char __user * __user *) a2, regs);
-       if (error == 0) {
-               task_lock(current);
-               current->ptrace &= ~PT_DTRACE;
-               task_unlock(current);
-       }
        putname(filename);
 out:
        return error;
@@ -919,20 +914,6 @@ int validate_sp(unsigned long sp, struct task_struct *p,
        return valid_irq_stack(sp, p, nbytes);
 }
 
-#ifdef CONFIG_PPC64
-#define MIN_STACK_FRAME        112     /* same as STACK_FRAME_OVERHEAD, in fact */
-#define FRAME_LR_SAVE  2
-#define INT_FRAME_SIZE (sizeof(struct pt_regs) + STACK_FRAME_OVERHEAD + 288)
-#define REGS_MARKER    0x7265677368657265ul
-#define FRAME_MARKER   12
-#else
-#define MIN_STACK_FRAME        16
-#define FRAME_LR_SAVE  1
-#define INT_FRAME_SIZE (sizeof(struct pt_regs) + STACK_FRAME_OVERHEAD)
-#define REGS_MARKER    0x72656773ul
-#define FRAME_MARKER   2
-#endif
-
 EXPORT_SYMBOL(validate_sp);
 
 unsigned long get_wchan(struct task_struct *p)
@@ -944,15 +925,15 @@ unsigned long get_wchan(struct task_struct *p)
                return 0;
 
        sp = p->thread.ksp;
-       if (!validate_sp(sp, p, MIN_STACK_FRAME))
+       if (!validate_sp(sp, p, STACK_FRAME_OVERHEAD))
                return 0;
 
        do {
                sp = *(unsigned long *)sp;
-               if (!validate_sp(sp, p, MIN_STACK_FRAME))
+               if (!validate_sp(sp, p, STACK_FRAME_OVERHEAD))
                        return 0;
                if (count > 0) {
-                       ip = ((unsigned long *)sp)[FRAME_LR_SAVE];
+                       ip = ((unsigned long *)sp)[STACK_FRAME_LR_SAVE];
                        if (!in_sched_functions(ip))
                                return ip;
                }
@@ -981,12 +962,12 @@ void show_stack(struct task_struct *tsk, unsigned long *stack)
        lr = 0;
        printk("Call Trace:\n");
        do {
-               if (!validate_sp(sp, tsk, MIN_STACK_FRAME))
+               if (!validate_sp(sp, tsk, STACK_FRAME_OVERHEAD))
                        return;
 
                stack = (unsigned long *) sp;
                newsp = stack[0];
-               ip = stack[FRAME_LR_SAVE];
+               ip = stack[STACK_FRAME_LR_SAVE];
                if (!firstframe || ip != lr) {
                        printk("["REG"] ["REG"] ", sp, ip);
                        print_symbol("%s", ip);
@@ -1000,8 +981,8 @@ void show_stack(struct task_struct *tsk, unsigned long *stack)
                 * See if this is an exception frame.
                 * We look for the "regshere" marker in the current frame.
                 */
-               if (validate_sp(sp, tsk, INT_FRAME_SIZE)
-                   && stack[FRAME_MARKER] == REGS_MARKER) {
+               if (validate_sp(sp, tsk, STACK_INT_FRAME_SIZE)
+                   && stack[STACK_FRAME_MARKER] == STACK_FRAME_REGS_MARKER) {
                        struct pt_regs *regs = (struct pt_regs *)
                                (sp + STACK_FRAME_OVERHEAD);
                        printk("--- Exception: %lx", regs->trap);
index eac97f48b9b8df29171e59476a95b50f01a6ef67..3bfe7837e8207978062b0d8426a0f50b04b6c448 100644 (file)
 #include <linux/kexec.h>
 #include <linux/debugfs.h>
 #include <linux/irq.h>
+#include <linux/lmb.h>
 
 #include <asm/prom.h>
 #include <asm/rtas.h>
-#include <asm/lmb.h>
 #include <asm/page.h>
 #include <asm/processor.h>
 #include <asm/irq.h>
@@ -51,6 +51,7 @@
 #include <asm/machdep.h>
 #include <asm/pSeries_reconfig.h>
 #include <asm/pci-bridge.h>
+#include <asm/phyp_dump.h>
 #include <asm/kexec.h>
 
 #ifdef DEBUG
@@ -436,7 +437,7 @@ early_param("mem", early_parse_mem);
  * The device tree may be allocated beyond our memory limit, or inside the
  * crash kernel region for kdump. If so, move it out of the way.
  */
-static void move_device_tree(void)
+static void __init move_device_tree(void)
 {
        unsigned long start, size;
        void *p;
@@ -1040,6 +1041,87 @@ static void __init early_reserve_mem(void)
 #endif
 }
 
+#ifdef CONFIG_PHYP_DUMP
+/**
+ * phyp_dump_calculate_reserve_size() - reserve variable boot area 5% or arg
+ *
+ * Function to find the largest size we need to reserve
+ * during early boot process.
+ *
+ * It either looks for boot param and returns that OR
+ * returns larger of 256 or 5% rounded down to multiples of 256MB.
+ *
+ */
+static inline unsigned long phyp_dump_calculate_reserve_size(void)
+{
+       unsigned long tmp;
+
+       if (phyp_dump_info->reserve_bootvar)
+               return phyp_dump_info->reserve_bootvar;
+
+       /* divide by 20 to get 5% of value */
+       tmp = lmb_end_of_DRAM();
+       do_div(tmp, 20);
+
+       /* round it down in multiples of 256 */
+       tmp = tmp & ~0x0FFFFFFFUL;
+
+       return (tmp > PHYP_DUMP_RMR_END ? tmp : PHYP_DUMP_RMR_END);
+}
+
+/**
+ * phyp_dump_reserve_mem() - reserve all not-yet-dumped mmemory
+ *
+ * This routine may reserve memory regions in the kernel only
+ * if the system is supported and a dump was taken in last
+ * boot instance or if the hardware is supported and the
+ * scratch area needs to be setup. In other instances it returns
+ * without reserving anything. The memory in case of dump being
+ * active is freed when the dump is collected (by userland tools).
+ */
+static void __init phyp_dump_reserve_mem(void)
+{
+       unsigned long base, size;
+       unsigned long variable_reserve_size;
+
+       if (!phyp_dump_info->phyp_dump_configured) {
+               printk(KERN_ERR "Phyp-dump not supported on this hardware\n");
+               return;
+       }
+
+       if (!phyp_dump_info->phyp_dump_at_boot) {
+               printk(KERN_INFO "Phyp-dump disabled at boot time\n");
+               return;
+       }
+
+       variable_reserve_size = phyp_dump_calculate_reserve_size();
+
+       if (phyp_dump_info->phyp_dump_is_active) {
+               /* Reserve *everything* above RMR.Area freed by userland tools*/
+               base = variable_reserve_size;
+               size = lmb_end_of_DRAM() - base;
+
+               /* XXX crashed_ram_end is wrong, since it may be beyond
+                * the memory_limit, it will need to be adjusted. */
+               lmb_reserve(base, size);
+
+               phyp_dump_info->init_reserve_start = base;
+               phyp_dump_info->init_reserve_size = size;
+       } else {
+               size = phyp_dump_info->cpu_state_size +
+                       phyp_dump_info->hpte_region_size +
+                       variable_reserve_size;
+               base = lmb_end_of_DRAM() - size;
+               lmb_reserve(base, size);
+               phyp_dump_info->init_reserve_start = base;
+               phyp_dump_info->init_reserve_size = size;
+       }
+}
+#else
+static inline void __init phyp_dump_reserve_mem(void) {}
+#endif /* CONFIG_PHYP_DUMP  && CONFIG_PPC_RTAS */
+
+
 void __init early_init_devtree(void *params)
 {
        DBG(" -> early_init_devtree(%p)\n", params);
@@ -1052,6 +1134,11 @@ void __init early_init_devtree(void *params)
        of_scan_flat_dt(early_init_dt_scan_rtas, NULL);
 #endif
 
+#ifdef CONFIG_PHYP_DUMP
+       /* scan tree to see if dump occured during last boot */
+       of_scan_flat_dt(early_init_dt_scan_phyp_dump, NULL);
+#endif
+
        /* Retrieve various informations from the /chosen node of the
         * device-tree, including the platform type, initrd location and
         * size, TCE reserve, and more ...
@@ -1072,6 +1159,7 @@ void __init early_init_devtree(void *params)
        reserve_kdump_trampoline();
        reserve_crashkernel();
        early_reserve_mem();
+       phyp_dump_reserve_mem();
 
        lmb_enforce_memory_limit(memory_limit);
        lmb_analyze();
@@ -1244,12 +1332,14 @@ EXPORT_SYMBOL(of_node_put);
  */
 void of_attach_node(struct device_node *np)
 {
-       write_lock(&devtree_lock);
+       unsigned long flags;
+
+       write_lock_irqsave(&devtree_lock, flags);
        np->sibling = np->parent->child;
        np->allnext = allnodes;
        np->parent->child = np;
        allnodes = np;
-       write_unlock(&devtree_lock);
+       write_unlock_irqrestore(&devtree_lock, flags);
 }
 
 /*
@@ -1260,8 +1350,9 @@ void of_attach_node(struct device_node *np)
 void of_detach_node(struct device_node *np)
 {
        struct device_node *parent;
+       unsigned long flags;
 
-       write_lock(&devtree_lock);
+       write_lock_irqsave(&devtree_lock, flags);
 
        parent = np->parent;
        if (!parent)
@@ -1292,7 +1383,7 @@ void of_detach_node(struct device_node *np)
        of_node_set_flag(np, OF_DETACHED);
 
 out_unlock:
-       write_unlock(&devtree_lock);
+       write_unlock_irqrestore(&devtree_lock, flags);
 }
 
 #ifdef CONFIG_PPC_PSERIES
@@ -1373,20 +1464,21 @@ __initcall(prom_reconfig_setup);
 int prom_add_property(struct device_node* np, struct property* prop)
 {
        struct property **next;
+       unsigned long flags;
 
        prop->next = NULL;      
-       write_lock(&devtree_lock);
+       write_lock_irqsave(&devtree_lock, flags);
        next = &np->properties;
        while (*next) {
                if (strcmp(prop->name, (*next)->name) == 0) {
                        /* duplicate ! don't insert it */
-                       write_unlock(&devtree_lock);
+                       write_unlock_irqrestore(&devtree_lock, flags);
                        return -1;
                }
                next = &(*next)->next;
        }
        *next = prop;
-       write_unlock(&devtree_lock);
+       write_unlock_irqrestore(&devtree_lock, flags);
 
 #ifdef CONFIG_PROC_DEVICETREE
        /* try to add to proc as well if it was initialized */
@@ -1406,9 +1498,10 @@ int prom_add_property(struct device_node* np, struct property* prop)
 int prom_remove_property(struct device_node *np, struct property *prop)
 {
        struct property **next;
+       unsigned long flags;
        int found = 0;
 
-       write_lock(&devtree_lock);
+       write_lock_irqsave(&devtree_lock, flags);
        next = &np->properties;
        while (*next) {
                if (*next == prop) {
@@ -1421,7 +1514,7 @@ int prom_remove_property(struct device_node *np, struct property *prop)
                }
                next = &(*next)->next;
        }
-       write_unlock(&devtree_lock);
+       write_unlock_irqrestore(&devtree_lock, flags);
 
        if (!found)
                return -ENODEV;
@@ -1447,9 +1540,10 @@ int prom_update_property(struct device_node *np,
                         struct property *oldprop)
 {
        struct property **next;
+       unsigned long flags;
        int found = 0;
 
-       write_lock(&devtree_lock);
+       write_lock_irqsave(&devtree_lock, flags);
        next = &np->properties;
        while (*next) {
                if (*next == oldprop) {
@@ -1463,7 +1557,7 @@ int prom_update_property(struct device_node *np,
                }
                next = &(*next)->next;
        }
-       write_unlock(&devtree_lock);
+       write_unlock_irqrestore(&devtree_lock, flags);
 
        if (!found)
                return -ENODEV;
index 5ab4c8466cc94f56c645d5193eae9ffca00e0ad3..6d6df1e6032558713e1a734452ecc10e0ec48e6f 100644 (file)
@@ -2240,6 +2240,14 @@ static void __init fixup_device_tree_efika(void)
        if (rv != PROM_ERROR && (strcmp(prop, "chrp") == 0))
                prom_setprop(node, "/", "device_type", "efika", sizeof("efika"));
 
+       /* CODEGEN,description is exposed in /proc/cpuinfo so
+          fix that too */
+       rv = prom_getprop(node, "CODEGEN,description", prop, sizeof(prop));
+       if (rv != PROM_ERROR && (strstr(prop, "CHRP")))
+               prom_setprop(node, "/", "CODEGEN,description",
+                            "Efika 5200B PowerPC System",
+                            sizeof("Efika 5200B PowerPC System"));
+
        /* Fixup bestcomm interrupts property */
        node = call_prom("finddevice", 1, 1, ADDR("/builtin/bestcomm"));
        if (PHANDLE_VALID(node)) {
index 4c1de6af4c092da35128e6ae553af27a3dcb9baf..9d30e10970ac5b12d522fe30834f270ddf560571 100644 (file)
 #include <linux/security.h>
 #include <linux/signal.h>
 #include <linux/compat.h>
+#include <linux/elf.h>
 
 #include <asm/uaccess.h>
 #include <asm/page.h>
 #include <asm/pgtable.h>
 #include <asm/system.h>
 
+#include "ppc32.h"
+
 /*
  * does not yet catch signals sent when the child dies.
  * in exit.c or in signal.c.
@@ -64,6 +67,27 @@ static long compat_ptrace_old(struct task_struct *child, long request,
        return -EPERM;
 }
 
+static int compat_ptrace_getsiginfo(struct task_struct *child, compat_siginfo_t __user *data)
+{
+       siginfo_t lastinfo;
+       int error = -ESRCH;
+
+       read_lock(&tasklist_lock);
+       if (likely(child->sighand != NULL)) {
+               error = -EINVAL;
+               spin_lock_irq(&child->sighand->siglock);
+               if (likely(child->last_siginfo != NULL)) {
+                       lastinfo = *child->last_siginfo;
+                       error = 0;
+               }
+               spin_unlock_irq(&child->sighand->siglock);
+       }
+       read_unlock(&tasklist_lock);
+       if (!error)
+               return copy_siginfo_to_user32(data, &lastinfo);
+       return error;
+}
+
 long compat_arch_ptrace(struct task_struct *child, compat_long_t request,
                        compat_ulong_t caddr, compat_ulong_t cdata)
 {
@@ -282,6 +306,9 @@ long compat_arch_ptrace(struct task_struct *child, compat_long_t request,
                        0, PT_REGS_COUNT * sizeof(compat_long_t),
                        compat_ptr(data));
 
+       case PTRACE_GETSIGINFO:
+               return compat_ptrace_getsiginfo(child, compat_ptr(data));
+
        case PTRACE_GETFPREGS:
        case PTRACE_SETFPREGS:
        case PTRACE_GETVRREGS:
index 52e95c2158c02418789d3e238b96b31ee42aa9d1..34843c318419012e73195b8837345b232e4dca85 100644 (file)
 #include <linux/smp.h>
 #include <linux/completion.h>
 #include <linux/cpumask.h>
+#include <linux/lmb.h>
 
 #include <asm/prom.h>
 #include <asm/rtas.h>
 #include <asm/hvcall.h>
-#include <asm/semaphore.h>
 #include <asm/machdep.h>
 #include <asm/firmware.h>
 #include <asm/page.h>
@@ -34,7 +34,6 @@
 #include <asm/system.h>
 #include <asm/delay.h>
 #include <asm/uaccess.h>
-#include <asm/lmb.h>
 #include <asm/udbg.h>
 #include <asm/syscalls.h>
 #include <asm/smp.h>
@@ -507,7 +506,7 @@ int rtas_error_rc(int rtas_rc)
                        break;
                default:
                        printk(KERN_ERR "%s: unexpected RTAS error %d\n",
-                                       __FUNCTION__, rtas_rc);
+                                       __func__, rtas_rc);
                        rc = -ERANGE;
                        break;
        }
index 538baf46f15f9471e8b9d8490399d9fbf1760be3..627f126d1848b4ec1f5e0eb2e2d8c5870bda93c5 100644 (file)
@@ -807,7 +807,7 @@ int __init rtas_flash_init(void)
                                rtas_block_ctor);
        if (!flash_block_cache) {
                printk(KERN_ERR "%s: failed to create block cache\n",
-                               __FUNCTION__);
+                               __func__);
                rc = -ENOMEM;
                goto cleanup;
        }
index 433a0a0949fb2341b61384d553520e19fcdf4a38..3ab88a9dc70dd0686c3d7c29d125fb42b753f6f7 100644 (file)
@@ -56,21 +56,6 @@ static inline int config_access_valid(struct pci_dn *dn, int where)
        return 0;
 }
 
-static int of_device_available(struct device_node * dn)
-{
-        const char *status;
-
-        status = of_get_property(dn, "status", NULL);
-
-        if (!status)
-                return 1;
-
-        if (!strcmp(status, "okay"))
-                return 1;
-
-        return 0;
-}
-
 int rtas_read_config(struct pci_dn *pdn, int where, int size, u32 *val)
 {
        int returnval = -1;
@@ -117,7 +102,7 @@ static int rtas_pci_read_config(struct pci_bus *bus,
        for (dn = busdn->child; dn; dn = dn->sibling) {
                struct pci_dn *pdn = PCI_DN(dn);
                if (pdn && pdn->devfn == devfn
-                   && of_device_available(dn))
+                   && of_device_is_available(dn))
                        return rtas_read_config(pdn, where, size, val);
        }
 
@@ -164,7 +149,7 @@ static int rtas_pci_write_config(struct pci_bus *bus,
        for (dn = busdn->child; dn; dn = dn->sibling) {
                struct pci_dn *pdn = PCI_DN(dn);
                if (pdn && pdn->devfn == devfn
-                   && of_device_available(dn))
+                   && of_device_is_available(dn))
                        return rtas_write_config(pdn, where, size, val);
        }
        return PCIBIOS_DEVICE_NOT_FOUND;
@@ -326,7 +311,7 @@ int pcibios_remove_root_bus(struct pci_controller *phb)
 
        res = b->resource[0];
        if (!res->flags) {
-               printk(KERN_ERR "%s: no IO resource for PHB %s\n", __FUNCTION__,
+               printk(KERN_ERR "%s: no IO resource for PHB %s\n", __func__,
                                b->name);
                return 1;
        }
@@ -334,13 +319,13 @@ int pcibios_remove_root_bus(struct pci_controller *phb)
        rc = pcibios_unmap_io_space(b);
        if (rc) {
                printk(KERN_ERR "%s: failed to unmap IO on bus %s\n",
-                       __FUNCTION__, b->name);
+                       __func__, b->name);
                return 1;
        }
 
        if (release_resource(res)) {
                printk(KERN_ERR "%s: failed to release IO on bus %s\n",
-                               __FUNCTION__, b->name);
+                               __func__, b->name);
                return 1;
        }
 
@@ -348,13 +333,13 @@ int pcibios_remove_root_bus(struct pci_controller *phb)
                res = b->resource[i];
                if (!res->flags && i == 0) {
                        printk(KERN_ERR "%s: no MEM resource for PHB %s\n",
-                               __FUNCTION__, b->name);
+                               __func__, b->name);
                        return 1;
                }
                if (res->flags && release_resource(res)) {
                        printk(KERN_ERR
                               "%s: failed to release IO %d on bus %s\n",
-                               __FUNCTION__, i, b->name);
+                               __func__, i, b->name);
                        return 1;
                }
        }
index 6adb5a1e98bb8f2a46eac766b03288ac8e4b1f7e..db540eab09f45befe7ebfbcd64984b5c76d528ea 100644 (file)
@@ -34,6 +34,7 @@
 #include <linux/serial_8250.h>
 #include <linux/debugfs.h>
 #include <linux/percpu.h>
+#include <linux/lmb.h>
 #include <asm/io.h>
 #include <asm/prom.h>
 #include <asm/processor.h>
@@ -56,7 +57,6 @@
 #include <asm/cache.h>
 #include <asm/page.h>
 #include <asm/mmu.h>
-#include <asm/lmb.h>
 #include <asm/xmon.h>
 #include <asm/cputhreads.h>
 
@@ -167,6 +167,8 @@ static int show_cpuinfo(struct seq_file *m, void *v)
        unsigned short min;
 
        if (cpu_id == NR_CPUS) {
+               struct device_node *root;
+               const char *model = NULL;
 #if defined(CONFIG_SMP) && defined(CONFIG_PPC32)
                unsigned long bogosum = 0;
                int i;
@@ -178,6 +180,13 @@ static int show_cpuinfo(struct seq_file *m, void *v)
                seq_printf(m, "timebase\t: %lu\n", ppc_tb_freq);
                if (ppc_md.name)
                        seq_printf(m, "platform\t: %s\n", ppc_md.name);
+               root = of_find_node_by_path("/");
+               if (root)
+                       model = of_get_property(root, "model", NULL);
+               if (model)
+                       seq_printf(m, "model\t\t: %s\n", model);
+               of_node_put(root);
+
                if (ppc_md.show_cpuinfo != NULL)
                        ppc_md.show_cpuinfo(m);
 
index 06d918d94dd1e2455de4dd224627f5fe309cbe38..36f6779c88d4e3b9d61a6d6896958b8706299c58 100644 (file)
@@ -164,6 +164,18 @@ int __init ppc_setup_l2cr(char *str)
 }
 __setup("l2cr=", ppc_setup_l2cr);
 
+/* Checks "l3cr=xxxx" command-line option */
+int __init ppc_setup_l3cr(char *str)
+{
+       if (cpu_has_feature(CPU_FTR_L3CR)) {
+               unsigned long val = simple_strtoul(str, NULL, 0);
+               printk(KERN_INFO "l3cr set to %lx\n", val);
+               _set_L3CR(val);         /* and enable it */
+       }
+       return 1;
+}
+__setup("l3cr=", ppc_setup_l3cr);
+
 #ifdef CONFIG_GENERIC_NVRAM
 
 /* Generic nvram hooks used by drivers/char/gen_nvram.c */
@@ -269,7 +281,7 @@ void __init setup_arch(char **cmdline_p)
        if (ppc_md.panic)
                setup_panic();
 
-       init_mm.start_code = PAGE_OFFSET;
+       init_mm.start_code = (unsigned long)_stext;
        init_mm.end_code = (unsigned long) _etext;
        init_mm.end_data = (unsigned long) _edata;
        init_mm.brk = klimit;
index 3b1529c103ef4a545da877bfe4d2de81cf41abe7..31ada9fdfc5c960a01d331f47574ad3ffcf5df96 100644 (file)
@@ -33,6 +33,8 @@
 #include <linux/serial_8250.h>
 #include <linux/bootmem.h>
 #include <linux/pci.h>
+#include <linux/lockdep.h>
+#include <linux/lmb.h>
 #include <asm/io.h>
 #include <asm/kdump.h>
 #include <asm/prom.h>
@@ -55,7 +57,6 @@
 #include <asm/cache.h>
 #include <asm/page.h>
 #include <asm/mmu.h>
-#include <asm/lmb.h>
 #include <asm/firmware.h>
 #include <asm/xmon.h>
 #include <asm/udbg.h>
@@ -178,6 +179,9 @@ void __init early_setup(unsigned long dt_ptr)
        /* Enable early debugging if any specified (see udbg.h) */
        udbg_early_init();
 
+       /* Initialize lockdep early or else spinlocks will blow */
+       lockdep_init();
+
        DBG(" -> early_setup(), dt_ptr: 0x%lx\n", dt_ptr);
 
        /*
@@ -510,7 +514,7 @@ void __init setup_arch(char **cmdline_p)
        if (ppc_md.panic)
                setup_panic();
 
-       init_mm.start_code = PAGE_OFFSET;
+       init_mm.start_code = (unsigned long)_stext;
        init_mm.end_code = (unsigned long) _etext;
        init_mm.end_data = (unsigned long) _edata;
        init_mm.brk = klimit;
index d840bc772fd346cffc8bd261726c850c4975cced..ad6943468ee9f25aee853a3ded8f99271f1c3d72 100644 (file)
@@ -621,6 +621,18 @@ int copy_siginfo_to_user32(struct compat_siginfo __user *d, siginfo_t *s)
 
 #define copy_siginfo_to_user   copy_siginfo_to_user32
 
+int copy_siginfo_from_user32(siginfo_t *to, struct compat_siginfo __user *from)
+{
+       memset(to, 0, sizeof *to);
+
+       if (copy_from_user(to, from, 3*sizeof(int)) ||
+           copy_from_user(to->_sifields._pad,
+                          from->_sifields._pad, SI_PAD_SIZE32))
+               return -EFAULT;
+
+       return 0;
+}
+
 /*
  * Note: it is necessary to treat pid and sig as unsigned ints, with the
  * corresponding cast to a signed int to insure that the proper conversion
@@ -634,9 +646,10 @@ long compat_sys_rt_sigqueueinfo(u32 pid, u32 sig, compat_siginfo_t __user *uinfo
        int ret;
        mm_segment_t old_fs = get_fs();
 
-       if (copy_from_user (&info, uinfo, 3*sizeof(int)) ||
-           copy_from_user (info._sifields._pad, uinfo->_sifields._pad, SI_PAD_SIZE32))
-               return -EFAULT;
+       ret = copy_siginfo_from_user32(&info, uinfo);
+       if (unlikely(ret))
+               return ret;
+
        set_fs (KERNEL_DS);
        /* The __user pointer cast is valid becasuse of the set_fs() */
        ret = sys_rt_sigqueueinfo((int)pid, (int)sig, (siginfo_t __user *) &info);
diff --git a/arch/powerpc/kernel/stacktrace.c b/arch/powerpc/kernel/stacktrace.c
new file mode 100644 (file)
index 0000000..e3638ee
--- /dev/null
@@ -0,0 +1,47 @@
+/*
+ * Stack trace utility
+ *
+ * Copyright 2008 Christoph Hellwig, IBM Corp.
+ *
+ *
+ *      This program is free software; you can redistribute it and/or
+ *      modify it under the terms of the GNU General Public License
+ *      as published by the Free Software Foundation; either version
+ *      2 of the License, or (at your option) any later version.
+ */
+
+#include <linux/sched.h>
+#include <linux/stacktrace.h>
+#include <asm/ptrace.h>
+#include <asm/asm-offsets.h>
+
+/*
+ * Save stack-backtrace addresses into a stack_trace buffer.
+ */
+void save_stack_trace(struct stack_trace *trace)
+{
+       unsigned long sp;
+
+       asm("mr %0,1" : "=r" (sp));
+
+       for (;;) {
+               unsigned long *stack = (unsigned long *) sp;
+               unsigned long newsp, ip;
+
+               if (!validate_sp(sp, current, STACK_FRAME_OVERHEAD))
+                       return;
+
+               newsp = stack[0];
+               ip = stack[STACK_FRAME_LR_SAVE];
+
+               if (!trace->skip)
+                       trace->entries[trace->nr_entries++] = ip;
+               else
+                       trace->skip--;
+
+               if (trace->nr_entries >= trace->max_entries)
+                       return;
+
+               sp = newsp;
+       }
+}
index 4a4f5c6b560bb6608cd133e6387929b056990570..709f8cb8bfca1475e2157420bc3092d8d2893186 100644 (file)
@@ -47,7 +47,6 @@
 #include <asm/types.h>
 #include <asm/uaccess.h>
 #include <asm/unistd.h>
-#include <asm/semaphore.h>
 #include <asm/time.h>
 #include <asm/mmu_context.h>
 #include <asm/ppc-pci.h>
@@ -368,11 +367,6 @@ long compat_sys_execve(unsigned long a0, unsigned long a1, unsigned long a2,
 
        error = compat_do_execve(filename, compat_ptr(a1), compat_ptr(a2), regs);
 
-       if (error == 0) {
-               task_lock(current);
-               current->ptrace &= ~PT_DTRACE;
-               task_unlock(current);
-       }
        putname(filename);
 
 out:
index 3b1d5dd65643a0530c2503330a0b88fe48853cfa..e722a4eeb5d0fc4a0a8150900b378fe38969e2bb 100644 (file)
@@ -38,7 +38,6 @@
 #include <linux/personality.h>
 
 #include <asm/uaccess.h>
-#include <asm/semaphore.h>
 #include <asm/syscalls.h>
 #include <asm/time.h>
 #include <asm/unistd.h>
index d3437c4c4a6f9b81f99020353dceaff248a54a06..c21a626af676fde938922c25e110c203e892a24f 100644 (file)
 #include <linux/elf.h>
 #include <linux/security.h>
 #include <linux/bootmem.h>
+#include <linux/lmb.h>
 
 #include <asm/pgtable.h>
 #include <asm/system.h>
 #include <asm/processor.h>
 #include <asm/mmu.h>
 #include <asm/mmu_context.h>
-#include <asm/lmb.h>
+#include <asm/prom.h>
 #include <asm/machdep.h>
 #include <asm/cputable.h>
 #include <asm/sections.h>
index f98867252ee269afac74dba19e04a5c0a629a07f..b77f8af7ddde7e5a4b2228065eddbae361fc05a5 100644 (file)
@@ -139,7 +139,7 @@ static int vio_bus_remove(struct device *dev)
  */
 int vio_register_driver(struct vio_driver *viodrv)
 {
-       printk(KERN_DEBUG "%s: driver %s registering\n", __FUNCTION__,
+       printk(KERN_DEBUG "%s: driver %s registering\n", __func__,
                viodrv->driver.name);
 
        /* fill in 'struct driver' fields */
@@ -184,7 +184,7 @@ struct vio_dev *vio_register_device_node(struct device_node *of_node)
        /* we need the 'device_type' property, in order to match with drivers */
        if (of_node->type == NULL) {
                printk(KERN_WARNING "%s: node %s missing 'device_type'\n",
-                               __FUNCTION__,
+                               __func__,
                                of_node->name ? of_node->name : "<unknown>");
                return NULL;
        }
@@ -192,7 +192,7 @@ struct vio_dev *vio_register_device_node(struct device_node *of_node)
        unit_address = of_get_property(of_node, "reg", NULL);
        if (unit_address == NULL) {
                printk(KERN_WARNING "%s: node %s missing 'reg'\n",
-                               __FUNCTION__,
+                               __func__,
                                of_node->name ? of_node->name : "<unknown>");
                return NULL;
        }
@@ -227,7 +227,7 @@ struct vio_dev *vio_register_device_node(struct device_node *of_node)
        /* register with generic device framework */
        if (device_register(&viodev->dev)) {
                printk(KERN_ERR "%s: failed to register device %s\n",
-                               __FUNCTION__, viodev->dev.bus_id);
+                               __func__, viodev->dev.bus_id);
                /* XXX free TCE table */
                kfree(viodev);
                return NULL;
@@ -258,7 +258,7 @@ static int __init vio_bus_init(void)
        err = device_register(&vio_bus_device.dev);
        if (err) {
                printk(KERN_WARNING "%s: device_register returned %i\n",
-                               __FUNCTION__, err);
+                               __func__, err);
                return err;
        }
 
index 0afb9e31d2a008a79f1b5a4d2ff70d8dc798a458..0c3000bf8d75d8919e20df3e44ba9a99d7bb7d14 100644 (file)
@@ -1,11 +1,9 @@
 #ifdef CONFIG_PPC64
-#include <asm/page.h>
 #define PROVIDE32(x)   PROVIDE(__unused__##x)
 #else
-#define PAGE_SIZE      4096
-#define KERNELBASE     CONFIG_KERNEL_START
 #define PROVIDE32(x)   PROVIDE(x)
 #endif
+#include <asm/page.h>
 #include <asm-generic/vmlinux.lds.h>
 #include <asm/cache.h>
 
@@ -33,7 +31,7 @@ SECTIONS
  */
 
        /* Text and gots */
-       .text : {
+       .text : AT(ADDR(.text) - LOAD_OFFSET) {
                ALIGN_FUNCTION();
                *(.text.head)
                _text = .;
@@ -58,7 +56,7 @@ SECTIONS
        RODATA
 
        /* Exception & bug tables */
-       __ex_table : {
+       __ex_table : AT(ADDR(__ex_table) - LOAD_OFFSET) {
                __start___ex_table = .;
                *(__ex_table)
                __stop___ex_table = .;
@@ -74,7 +72,7 @@ SECTIONS
        . = ALIGN(PAGE_SIZE);
        __init_begin = .;
 
-       .init.text : {
+       .init.text : AT(ADDR(.init.text) - LOAD_OFFSET) {
                _sinittext = .;
                INIT_TEXT
                _einittext = .;
@@ -83,11 +81,11 @@ SECTIONS
        /* .exit.text is discarded at runtime, not link time,
         * to deal with references from __bug_table
         */
-       .exit.text : {
+       .exit.text : AT(ADDR(.exit.text) - LOAD_OFFSET) {
                EXIT_TEXT
        }
 
-       .init.data : {
+       .init.data : AT(ADDR(.init.data) - LOAD_OFFSET) {
                INIT_DATA
                __vtop_table_begin = .;
                *(.vtop_fixup);
@@ -103,19 +101,19 @@ SECTIONS
        }
 
        . = ALIGN(16);
-       .init.setup : {
+       .init.setup : AT(ADDR(.init.setup) - LOAD_OFFSET) {
                __setup_start = .;
                *(.init.setup)
                __setup_end = .;
        }
 
-       .initcall.init : {
+       .initcall.init : AT(ADDR(.initcall.init) - LOAD_OFFSET) {
                __initcall_start = .;
                INITCALLS
                __initcall_end = .;
                }
 
-       .con_initcall.init : {
+       .con_initcall.init : AT(ADDR(.con_initcall.init) - LOAD_OFFSET) {
                __con_initcall_start = .;
                *(.con_initcall.init)
                __con_initcall_end = .;
@@ -124,14 +122,14 @@ SECTIONS
        SECURITY_INIT
 
        . = ALIGN(8);
-       __ftr_fixup : {
+       __ftr_fixup : AT(ADDR(__ftr_fixup) - LOAD_OFFSET) {
                __start___ftr_fixup = .;
                *(__ftr_fixup)
                __stop___ftr_fixup = .;
        }
 #ifdef CONFIG_PPC64
        . = ALIGN(8);
-       __fw_ftr_fixup : {
+       __fw_ftr_fixup : AT(ADDR(__fw_ftr_fixup) - LOAD_OFFSET) {
                __start___fw_ftr_fixup = .;
                *(__fw_ftr_fixup)
                __stop___fw_ftr_fixup = .;
@@ -139,14 +137,14 @@ SECTIONS
 #endif
 #ifdef CONFIG_BLK_DEV_INITRD
        . = ALIGN(PAGE_SIZE);
-       .init.ramfs : {
+       .init.ramfs : AT(ADDR(.init.ramfs) - LOAD_OFFSET) {
                __initramfs_start = .;
                *(.init.ramfs)
                __initramfs_end = .;
        }
 #endif
        . = ALIGN(PAGE_SIZE);
-       .data.percpu : {
+       .data.percpu  : AT(ADDR(.data.percpu) - LOAD_OFFSET) {
                __per_cpu_start = .;
                *(.data.percpu)
                *(.data.percpu.shared_aligned)
@@ -154,7 +152,7 @@ SECTIONS
        }
 
        . = ALIGN(8);
-       .machine.desc : {
+       .machine.desc : AT(ADDR(.machine.desc) - LOAD_OFFSET) {
                __machine_desc_start = . ;
                *(.machine.desc)
                __machine_desc_end = . ;
@@ -172,25 +170,24 @@ SECTIONS
        _sdata = .;
 
 #ifdef CONFIG_PPC32
-       .data    :
-       {
+       .data : AT(ADDR(.data) - LOAD_OFFSET) {
                DATA_DATA
                *(.sdata)
                *(.got.plt) *(.got)
        }
 #else
-       .data : {
+       .data : AT(ADDR(.data) - LOAD_OFFSET) {
                DATA_DATA
                *(.data.rel*)
                *(.toc1)
                *(.branch_lt)
        }
 
-       .opd : {
+       .opd : AT(ADDR(.opd) - LOAD_OFFSET) {
                *(.opd)
        }
 
-       .got : {
+       .got : AT(ADDR(.got) - LOAD_OFFSET) {
                __toc_start = .;
                *(.got)
                *(.toc)
@@ -207,26 +204,26 @@ SECTIONS
 #else
        . = ALIGN(16384);
 #endif
-       .data.init_task : {
+       .data.init_task : AT(ADDR(.data.init_task) - LOAD_OFFSET) {
                *(.data.init_task)
        }
 
        . = ALIGN(PAGE_SIZE);
-       .data.page_aligned : {
+       .data.page_aligned : AT(ADDR(.data.page_aligned) - LOAD_OFFSET) {
                *(.data.page_aligned)
        }
 
-       .data.cacheline_aligned : {
+       .data.cacheline_aligned : AT(ADDR(.data.cacheline_aligned) - LOAD_OFFSET) {
                *(.data.cacheline_aligned)
        }
 
        . = ALIGN(L1_CACHE_BYTES);
-       .data.read_mostly : {
+       .data.read_mostly : AT(ADDR(.data.read_mostly) - LOAD_OFFSET) {
                *(.data.read_mostly)
        }
 
        . = ALIGN(PAGE_SIZE);
-       __data_nosave : {
+       .data_nosave : AT(ADDR(.data_nosave) - LOAD_OFFSET) {
                __nosave_begin = .;
                *(.data.nosave)
                . = ALIGN(PAGE_SIZE);
@@ -237,7 +234,7 @@ SECTIONS
  * And finally the bss
  */
 
-       .bss : {
+       .bss : AT(ADDR(.bss) - LOAD_OFFSET) {
                __bss_start = .;
                *(.sbss) *(.scommon)
                *(.dynbss)
index 22c3b4f53de793e9c58b7cbab10e0f2623813c1c..29b2941cada0b67ac5be0248c2a1321179bf19a6 100644 (file)
@@ -54,7 +54,7 @@ static int grow(rh_info_t * info, int max_blocks)
 
        new_blocks = max_blocks - info->max_blocks;
 
-       block = kmalloc(sizeof(rh_block_t) * max_blocks, GFP_KERNEL);
+       block = kmalloc(sizeof(rh_block_t) * max_blocks, GFP_ATOMIC);
        if (block == NULL)
                return -ENOMEM;
 
@@ -258,7 +258,7 @@ rh_info_t *rh_create(unsigned int alignment)
        if ((alignment & (alignment - 1)) != 0)
                return ERR_PTR(-EINVAL);
 
-       info = kmalloc(sizeof(*info), GFP_KERNEL);
+       info = kmalloc(sizeof(*info), GFP_ATOMIC);
        if (info == NULL)
                return ERR_PTR(-ENOMEM);
 
index c4c622d8e6ac253cbda0dffe6098401e7fa3fab5..49eb1f1a2bb4f5a240ff45a0d807bae129718155 100644 (file)
@@ -75,6 +75,20 @@ _GLOBAL(strcmp)
        beq     1b
        blr
 
+_GLOBAL(strncmp)
+       PPC_LCMPI r5,0
+       beqlr
+       mtctr   r5
+       addi    r5,r3,-1
+       addi    r4,r4,-1
+1:     lbzu    r3,1(r5)
+       cmpwi   1,r3,0
+       lbzu    r0,1(r4)
+       subf.   r3,r0,r3
+       beqlr   1
+       bdnzt   eq,1b
+       blr
+
 _GLOBAL(strlen)
        addi    r4,r3,-1
 1:     lbzu    r0,1(r4)
index 41f0617f3d3abe57b93b60b1d01a0b6dbb042263..549baba5948fbc9d82961cbf044f5768d367745d 100644 (file)
@@ -9,7 +9,7 @@ fabs(u32 *frD, u32 *frB)
        frD[1] = frB[1];
 
 #ifdef DEBUG
-       printk("%s: D %p, B %p: ", __FUNCTION__, frD, frB);
+       printk("%s: D %p, B %p: ", __func__, frD, frB);
        dump_double(frD);
        printk("\n");
 #endif
index fc8836488b64c13baf9d38a401b70a6f88b420c2..7befbbf2c3323c5803bbaa6d5da5ac3d3ad6f433 100644 (file)
@@ -14,7 +14,7 @@ fadd(void *frD, void *frA, void *frB)
        int ret = 0;
 
 #ifdef DEBUG
-       printk("%s: %p %p %p\n", __FUNCTION__, frD, frA, frB);
+       printk("%s: %p %p %p\n", __func__, frD, frA, frB);
 #endif
 
        __FP_UNPACK_D(A, frA);
index 93025b6c8f3c165119008ed6cd342bf6227413f3..2b346b38b4805298d12c74edb7e63d77d9ecb68c 100644 (file)
@@ -15,7 +15,7 @@ fadds(void *frD, void *frA, void *frB)
        int ret = 0;
 
 #ifdef DEBUG
-       printk("%s: %p %p %p\n", __FUNCTION__, frD, frA, frB);
+       printk("%s: %p %p %p\n", __func__, frD, frA, frB);
 #endif
 
        __FP_UNPACK_D(A, frA);
index 4efac394b4cb075cd41fb635710ec28c10fd21c6..36d689044c63ad4e0a42a5084241017dfbfd50c9 100644 (file)
@@ -15,7 +15,7 @@ fcmpo(u32 *ccr, int crfD, void *frA, void *frB)
        int ret = 0;
 
 #ifdef DEBUG
-       printk("%s: %p (%08x) %d %p %p\n", __FUNCTION__, ccr, *ccr, crfD, frA, frB);
+       printk("%s: %p (%08x) %d %p %p\n", __func__, ccr, *ccr, crfD, frA, frB);
 #endif
 
        __FP_UNPACK_D(A, frA);
index b7e33176e618815ff02125f18f9b7539668960a2..53d93894f2a692d00ebaac71d4014bb8e0fc4356 100644 (file)
@@ -14,7 +14,7 @@ fcmpu(u32 *ccr, int crfD, void *frA, void *frB)
        long cmp;
 
 #ifdef DEBUG
-       printk("%s: %p (%08x) %d %p %p\n", __FUNCTION__, ccr, *ccr, crfD, frA, frB);
+       printk("%s: %p (%08x) %d %p %p\n", __func__, ccr, *ccr, crfD, frA, frB);
 #endif
 
        __FP_UNPACK_D(A, frA);
index 3b3c98b840cf139a48a8f05880a093f2617a2c0b..fcd7a95e021dcb5b9711115c57830ceeefaeefef 100644 (file)
@@ -16,7 +16,7 @@ fctiw(u32 *frD, void *frB)
        frD[1] = r;
 
 #ifdef DEBUG
-       printk("%s: D %p, B %p: ", __FUNCTION__, frD, frB);
+       printk("%s: D %p, B %p: ", __func__, frD, frB);
        dump_double(frD);
        printk("\n");
 #endif
index 7717eb6fcfb68d05025df1da0b0532f5ccf6c781..1514d59e146ea77bf103d37539da4c435bd4fcb8 100644 (file)
@@ -23,7 +23,7 @@ fctiwz(u32 *frD, void *frB)
        __FPU_FPSCR = fpscr;
 
 #ifdef DEBUG
-       printk("%s: D %p, B %p: ", __FUNCTION__, frD, frB);
+       printk("%s: D %p, B %p: ", __func__, frD, frB);
        dump_double(frD);
        printk("\n");
 #endif
index f2fba825b2d023e4437c48a47f1fb604e2bc40ca..18a20fe396b09f4d660ccb61ae2d6869fac15eeb 100644 (file)
@@ -14,7 +14,7 @@ fdiv(void *frD, void *frA, void *frB)
        int ret = 0;
 
 #ifdef DEBUG
-       printk("%s: %p %p %p\n", __FUNCTION__, frD, frA, frB);
+       printk("%s: %p %p %p\n", __func__, frD, frA, frB);
 #endif
 
        __FP_UNPACK_D(A, frA);
@@ -28,13 +28,13 @@ fdiv(void *frD, void *frA, void *frB)
        if (A_c == FP_CLS_ZERO && B_c == FP_CLS_ZERO) {
                ret |= EFLAG_VXZDZ;
 #ifdef DEBUG
-               printk("%s: FPSCR_VXZDZ raised\n", __FUNCTION__);
+               printk("%s: FPSCR_VXZDZ raised\n", __func__);
 #endif
        }
        if (A_c == FP_CLS_INF && B_c == FP_CLS_INF) {
                ret |= EFLAG_VXIDI;
 #ifdef DEBUG
-               printk("%s: FPSCR_VXIDI raised\n", __FUNCTION__);
+               printk("%s: FPSCR_VXIDI raised\n", __func__);
 #endif
        }
 
index b971196e3175831097f4a1a3dd3b05a3b41ea433..24feed689c3581665796b6577eae5d9f988324a0 100644 (file)
@@ -15,7 +15,7 @@ fdivs(void *frD, void *frA, void *frB)
        int ret = 0;
 
 #ifdef DEBUG
-       printk("%s: %p %p %p\n", __FUNCTION__, frD, frA, frB);
+       printk("%s: %p %p %p\n", __func__, frD, frA, frB);
 #endif
 
        __FP_UNPACK_D(A, frA);
@@ -29,13 +29,13 @@ fdivs(void *frD, void *frA, void *frB)
        if (A_c == FP_CLS_ZERO && B_c == FP_CLS_ZERO) {
                ret |= EFLAG_VXZDZ;
 #ifdef DEBUG
-               printk("%s: FPSCR_VXZDZ raised\n", __FUNCTION__);
+               printk("%s: FPSCR_VXZDZ raised\n", __func__);
 #endif
        }
        if (A_c == FP_CLS_INF && B_c == FP_CLS_INF) {
                ret |= EFLAG_VXIDI;
 #ifdef DEBUG
-               printk("%s: FPSCR_VXIDI raised\n", __FUNCTION__);
+               printk("%s: FPSCR_VXIDI raised\n", __func__);
 #endif
        }
 
index 0a1dbce793e91ec2d7a97be75765e6528d25c572..dedb465fdc68b5baa1fdc772286a37745fa2cc15 100644 (file)
@@ -16,7 +16,7 @@ fmadd(void *frD, void *frA, void *frB, void *frC)
        int ret = 0;
 
 #ifdef DEBUG
-       printk("%s: %p %p %p %p\n", __FUNCTION__, frD, frA, frB, frC);
+       printk("%s: %p %p %p %p\n", __func__, frD, frA, frB, frC);
 #endif
 
        __FP_UNPACK_D(A, frA);
index 0f70bba9445ef861b5b4131bbf495a1abc2ece8c..6bbb56d5502cb53c073fc3dea8e0f6ee0148bd1c 100644 (file)
@@ -17,7 +17,7 @@ fmadds(void *frD, void *frA, void *frB, void *frC)
        int ret = 0;
 
 #ifdef DEBUG
-       printk("%s: %p %p %p %p\n", __FUNCTION__, frD, frA, frB, frC);
+       printk("%s: %p %p %p %p\n", __func__, frD, frA, frB, frC);
 #endif
 
        __FP_UNPACK_D(A, frA);
index 28df700c0c7e6008b1360fa80aeadfd562f3f4d7..bd55384b8196e38a816e440c92c52b28fe0394aa 100644 (file)
@@ -9,7 +9,7 @@ fmr(u32 *frD, u32 *frB)
        frD[1] = frB[1];
 
 #ifdef DEBUG
-       printk("%s: D %p, B %p: ", __FUNCTION__, frD, frB);
+       printk("%s: D %p, B %p: ", __func__, frD, frB);
        dump_double(frD);
        printk("\n");
 #endif
index 203fd48a6fec7e02dc02b79c8066f2481210d2fa..f311e2c7e67e50fcc6a54f13a3534b68bf2f9ff9 100644 (file)
@@ -16,7 +16,7 @@ fmsub(void *frD, void *frA, void *frB, void *frC)
        int ret = 0;
 
 #ifdef DEBUG
-       printk("%s: %p %p %p %p\n", __FUNCTION__, frD, frA, frB, frC);
+       printk("%s: %p %p %p %p\n", __func__, frD, frA, frB, frC);
 #endif
 
        __FP_UNPACK_D(A, frA);
index 8ce68624c189e8331f2f5793b3a31f7e7103d0cc..81a716d3ee2e6859c1ed7435dc8ca23cfed9368e 100644 (file)
@@ -17,7 +17,7 @@ fmsubs(void *frD, void *frA, void *frB, void *frC)
        int ret = 0;
 
 #ifdef DEBUG
-       printk("%s: %p %p %p %p\n", __FUNCTION__, frD, frA, frB, frC);
+       printk("%s: %p %p %p %p\n", __func__, frD, frA, frB, frC);
 #endif
 
        __FP_UNPACK_D(A, frA);
index 66c7e79aae2efa2c55c33ed57ea7980c4d6c9cfa..2f3d32784a04ac69e7fc5e8a13a97f0a163bbede 100644 (file)
@@ -14,7 +14,7 @@ fmul(void *frD, void *frA, void *frB)
        int ret = 0;
 
 #ifdef DEBUG
-       printk("%s: %p %p %p\n", __FUNCTION__, frD, frA, frB);
+       printk("%s: %p %p %p\n", __func__, frD, frA, frB);
 #endif
 
        __FP_UNPACK_D(A, frA);
index 26bc4278271cd9bb4a9393884a92f6c699005ebd..962b5883f784b0bb460f0f5448d4edcf737c42c9 100644 (file)
@@ -15,7 +15,7 @@ fmuls(void *frD, void *frA, void *frB)
        int ret = 0;
 
 #ifdef DEBUG
-       printk("%s: %p %p %p\n", __FUNCTION__, frD, frA, frB);
+       printk("%s: %p %p %p\n", __func__, frD, frA, frB);
 #endif
 
        __FP_UNPACK_D(A, frA);
index c6b913d179e0c0e76453188f35709c51214c3885..a7d34f3d9499c0419c578d80d1cd03bb38e1591a 100644 (file)
@@ -9,7 +9,7 @@ fnabs(u32 *frD, u32 *frB)
        frD[1] = frB[1];
 
 #ifdef DEBUG
-       printk("%s: D %p, B %p: ", __FUNCTION__, frD, frB);
+       printk("%s: D %p, B %p: ", __func__, frD, frB);
        dump_double(frD);
        printk("\n");
 #endif
index fe9a98deff696130baf936f90f2c6e50920ec3cd..1e988cd9c6ccab8034cfb824e78800d4599d2a85 100644 (file)
@@ -9,7 +9,7 @@ fneg(u32 *frD, u32 *frB)
        frD[1] = frB[1];
 
 #ifdef DEBUG
-       printk("%s: D %p, B %p: ", __FUNCTION__, frD, frB);
+       printk("%s: D %p, B %p: ", __func__, frD, frB);
        dump_double(frD);
        printk("\n");
 #endif
index 7f312276d9200a9486a3b5f646bd21ba2e11faac..8cf7827c4fb5949b142e9e7a5ab086bc7dd8cf01 100644 (file)
@@ -16,7 +16,7 @@ fnmadd(void *frD, void *frA, void *frB, void *frC)
        int ret = 0;
 
 #ifdef DEBUG
-       printk("%s: %p %p %p %p\n", __FUNCTION__, frD, frA, frB, frC);
+       printk("%s: %p %p %p %p\n", __func__, frD, frA, frB, frC);
 #endif
 
        __FP_UNPACK_D(A, frA);
index 65454c9c70bceb809b78c8b027d904dfa0938732..f1c4f0f0d807cf10db3e826b827a026d64a5b6a5 100644 (file)
@@ -17,7 +17,7 @@ fnmadds(void *frD, void *frA, void *frB, void *frC)
        int ret = 0;
 
 #ifdef DEBUG
-       printk("%s: %p %p %p %p\n", __FUNCTION__, frD, frA, frB, frC);
+       printk("%s: %p %p %p %p\n", __func__, frD, frA, frB, frC);
 #endif
 
        __FP_UNPACK_D(A, frA);
index f1ca7482b5f03376292d9832521cea257a058841..98944e6e260181ca8c52ceaba4ebcb2df7ce2eff 100644 (file)
@@ -16,7 +16,7 @@ fnmsub(void *frD, void *frA, void *frB, void *frC)
        int ret = 0;
 
 #ifdef DEBUG
-       printk("%s: %p %p %p %p\n", __FUNCTION__, frD, frA, frB, frC);
+       printk("%s: %p %p %p %p\n", __func__, frD, frA, frB, frC);
 #endif
 
        __FP_UNPACK_D(A, frA);
index 5c9a09a87dc74235e70e7840b682641c817c80b3..b20f4eb63fb96ae7bd5fe156e4f41cd4fbe5a881 100644 (file)
@@ -17,7 +17,7 @@ fnmsubs(void *frD, void *frA, void *frB, void *frC)
        int ret = 0;
 
 #ifdef DEBUG
-       printk("%s: %p %p %p %p\n", __FUNCTION__, frD, frA, frB, frC);
+       printk("%s: %p %p %p %p\n", __func__, frD, frA, frB, frC);
 #endif
 
        __FP_UNPACK_D(A, frA);
index ec11e46d20afe7facb4178f053a1f77c362b8ed4..10ecbd08b79e4f562aa53158e0d53fb1f47f66b5 100644 (file)
@@ -6,7 +6,7 @@ int
 fres(void *frD, void *frB)
 {
 #ifdef DEBUG
-       printk("%s: %p %p\n", __FUNCTION__, frD, frB);
+       printk("%s: %p %p\n", __func__, frD, frB);
 #endif
        return -ENOSYS;
 }
index d879b2a3d0c9a2d0716a88bf4e46de025f2bec11..724ccbc0468e03332218be05b3f67093626e1cfb 100644 (file)
@@ -12,7 +12,7 @@ frsp(void *frD, void *frB)
        FP_DECL_D(B);
 
 #ifdef DEBUG
-       printk("%s: D %p, B %p\n", __FUNCTION__, frD, frB);
+       printk("%s: D %p, B %p\n", __func__, frD, frB);
 #endif
 
        __FP_UNPACK_D(B, frB);
index a11ae18298507cc2c738801d9fe2ef863a15f1f7..1d0a3a0fd0e6d42f7117e3295ddd5de2e98d7c3f 100644 (file)
@@ -6,7 +6,7 @@ int
 frsqrte(void *frD, void *frB)
 {
 #ifdef DEBUG
-       printk("%s: %p %p\n", __FUNCTION__, frD, frB);
+       printk("%s: %p %p\n", __func__, frD, frB);
 #endif
        return 0;
 }
index e36e6e72819a47ca7078b350d23afe865e9d3fe8..ecb5f28eb1f3f0f2701e8eac842202d216889362 100644 (file)
@@ -11,7 +11,7 @@ fsel(u32 *frD, void *frA, u32 *frB, u32 *frC)
        FP_DECL_D(A);
 
 #ifdef DEBUG
-       printk("%s: %p %p %p %p\n", __FUNCTION__, frD, frA, frB, frC);
+       printk("%s: %p %p %p %p\n", __func__, frD, frA, frB, frC);
 #endif
 
        __FP_UNPACK_D(A, frA);
index 6f8319f64a8a5f1b2a7d425ed8d5c9ecdb4d1972..38ec2b752e9d1d65e7f7af874ee2c984e9d7caa7 100644 (file)
@@ -13,7 +13,7 @@ fsqrt(void *frD, void *frB)
        int ret = 0;
 
 #ifdef DEBUG
-       printk("%s: %p %p %p %p\n", __FUNCTION__, frD, frB);
+       printk("%s: %p %p %p %p\n", __func__, frD, frB);
 #endif
 
        __FP_UNPACK_D(B, frB);
index 3b2b1cf55c12cd0679e6f2985c8ecdacee1a1d61..335263e06ee54d56cbe2cd7d296e9a9695cff846 100644 (file)
@@ -14,7 +14,7 @@ fsqrts(void *frD, void *frB)
        int ret = 0;
 
 #ifdef DEBUG
-       printk("%s: %p %p %p %p\n", __FUNCTION__, frD, frB);
+       printk("%s: %p %p %p %p\n", __func__, frD, frB);
 #endif
 
        __FP_UNPACK_D(B, frB);
index 956679042bb28cce94d5d3a29799e25063b904ad..208d20fc52a51bb6656203e70b8e8ef38313c8e9 100644 (file)
@@ -14,7 +14,7 @@ fsub(void *frD, void *frA, void *frB)
        int ret = 0;
 
 #ifdef DEBUG
-       printk("%s: %p %p %p\n", __FUNCTION__, frD, frA, frB);
+       printk("%s: %p %p %p\n", __func__, frD, frA, frB);
 #endif
 
        __FP_UNPACK_D(A, frA);
index 3428117dfe8c55f90e44de0611c8001e40f1e33c..0e61b808c44b88df221e6ca16fb49d6e5c3827e6 100644 (file)
@@ -15,7 +15,7 @@ fsubs(void *frD, void *frA, void *frB)
        int ret = 0;
 
 #ifdef DEBUG
-       printk("%s: %p %p %p\n", __FUNCTION__, frD, frA, frB);
+       printk("%s: %p %p %p\n", __func__, frD, frA, frB);
 #endif
 
        __FP_UNPACK_D(A, frA);
index 7d38101c329bfd0abaf0149383a91fbd7c43f81e..6ec90b57c61a5c3a11d1e4d5735852138860dcd6 100644 (file)
@@ -11,7 +11,7 @@ lfd(void *frD, void *ea)
        if (copy_from_user(frD, ea, sizeof(double)))
                return -EFAULT;
 #ifdef DEBUG
-       printk("%s: D %p, ea %p: ", __FUNCTION__, frD, ea);
+       printk("%s: D %p, ea %p: ", __func__, frD, ea);
        dump_double(frD);
        printk("\n");
 #endif
index c86dee3d76552d66ca2ab2abd385eeda7b9d4e13..6f18ebe3a7ff510ec6aa7a8edd72fbc474e179ab 100644 (file)
@@ -14,7 +14,7 @@ lfs(void *frD, void *ea)
        float f;
 
 #ifdef DEBUG
-       printk("%s: D %p, ea %p\n", __FUNCTION__, frD, ea);
+       printk("%s: D %p, ea %p\n", __func__, frD, ea);
 #endif
 
        if (copy_from_user(&f, ea, sizeof(float)))
index 106dd912914b811fbc1e117840a0357ce4167379..41ba247faf897e1d35dad1728c144b89f7e18573 100644 (file)
@@ -10,7 +10,7 @@ mcrfs(u32 *ccr, u32 crfD, u32 crfS)
        u32 value, clear;
 
 #ifdef DEBUG
-       printk("%s: %p (%08x) %d %d\n", __FUNCTION__, ccr, *ccr, crfD, crfS);
+       printk("%s: %p (%08x) %d %d\n", __func__, ccr, *ccr, crfD, crfS);
 #endif
 
        clear = 15 << ((7 - crfS) << 2);
@@ -24,7 +24,7 @@ mcrfs(u32 *ccr, u32 crfD, u32 crfS)
        *ccr |= (value << ((7 - crfD) << 2));
 
 #ifdef DEBUG
-       printk("CR: %08x\n", __FUNCTION__, *ccr);
+       printk("CR: %08x\n", __func__, *ccr);
 #endif
 
        return 0;
index f477c9170e750d49a75813dbf5f6f40a4eec1679..b0e2106e6eb6d71e10a8bf678b8f97e72248b274 100644 (file)
@@ -10,7 +10,7 @@ mffs(u32 *frD)
        frD[1] = __FPU_FPSCR;
 
 #ifdef DEBUG
-       printk("%s: frD %p: %08x.%08x\n", __FUNCTION__, frD, frD[0], frD[1]);
+       printk("%s: frD %p: %08x.%08x\n", __func__, frD, frD[0], frD[1]);
 #endif
 
        return 0;
index 99bfd80f4af3a1d5ffcb0599441c40352f25e8a8..d3062350ea215535cf60d999ff181e95197be6ed 100644 (file)
@@ -11,7 +11,7 @@ mtfsb0(int crbD)
                __FPU_FPSCR &= ~(1 << (31 - crbD));
 
 #ifdef DEBUG
-       printk("%s: %d %08lx\n", __FUNCTION__, crbD, __FPU_FPSCR);
+       printk("%s: %d %08lx\n", __func__, crbD, __FPU_FPSCR);
 #endif
 
        return 0;
index 3d9e7ed92d2bdab8ae9f818cc97c344ecfd95717..2e948704b56ea0259aa00ba8b6619d97f923c545 100644 (file)
@@ -11,7 +11,7 @@ mtfsb1(int crbD)
                __FPU_FPSCR |= (1 << (31 - crbD));
 
 #ifdef DEBUG
-       printk("%s: %d %08lx\n", __FUNCTION__, crbD, __FPU_FPSCR);
+       printk("%s: %d %08lx\n", __func__, crbD, __FPU_FPSCR);
 #endif
 
        return 0;
index d70cf714994c78e388a0843458a671128227ddab..48014d8e3af1efa9e7c701c59140ec75f658180f 100644 (file)
@@ -38,7 +38,7 @@ mtfsf(unsigned int FM, u32 *frB)
        __FPU_FPSCR |= (frB[1] & mask);
 
 #ifdef DEBUG
-       printk("%s: %02x %p: %08lx\n", __FUNCTION__, FM, frB, __FPU_FPSCR);
+       printk("%s: %02x %p: %08lx\n", __func__, FM, frB, __FPU_FPSCR);
 #endif
 
        return 0;
index 71df854baa7ea499b0ec91576c2ab1fa0e354efd..031e200935493c49be352a410127a57476853faf 100644 (file)
@@ -16,7 +16,7 @@ mtfsfi(unsigned int crfD, unsigned int IMM)
        __FPU_FPSCR |= (IMM & 0xf) << ((7 - crfD) << 2);
 
 #ifdef DEBUG
-       printk("%s: %d %x: %08lx\n", __FUNCTION__, crfD, IMM, __FPU_FPSCR);
+       printk("%s: %d %x: %08lx\n", __func__, crfD, IMM, __FPU_FPSCR);
 #endif
 
        return 0;
index 3f8c2558a9e88c9881f9392cf591b294ab48b742..33a165c8df0fe1e16eff1f682b5194871abcadb6 100644 (file)
@@ -7,7 +7,7 @@ stfd(void *frS, void *ea)
 {
 #if 0
 #ifdef DEBUG
-       printk("%s: S %p, ea %p: ", __FUNCTION__, frS, ea);
+       printk("%s: S %p, ea %p: ", __func__, frS, ea);
        dump_double(frS);
        printk("\n");
 #endif
index 95caaeec6a08d534a6370cb266162d59d8ddfbb6..f15a35f67e2c08d18c312562e07dd7da624c8d34 100644 (file)
@@ -6,7 +6,7 @@ int
 stfiwx(u32 *frS, void *ea)
 {
 #ifdef DEBUG
-       printk("%s: %p %p\n", __FUNCTION__, frS, ea);
+       printk("%s: %p %p\n", __func__, frS, ea);
 #endif
 
        if (copy_to_user(ea, &frS[1], sizeof(frS[1])))
index e87ca23c6dc37fbdd0081f9d5898b0c01de82d9a..8689aa48ef6952b8d45d9e3218d8bd97f7f8f71d 100644 (file)
@@ -15,7 +15,7 @@ stfs(void *frS, void *ea)
        int err;
 
 #ifdef DEBUG
-       printk("%s: S %p, ea %p\n", __FUNCTION__, frS, ea);
+       printk("%s: S %p, ea %p\n", __func__, frS, ea);
 #endif
 
        __FP_UNPACK_D(A, frS);
index 3899ea97fbdff935b23869fbe8c8db9c6de78283..cecbbc76f62425da81edc80529e4a65164d42435 100644 (file)
@@ -97,7 +97,7 @@ unsigned long __init mmu_mapin_ram(void)
        phys_addr_t p;
 
        v = KERNELBASE;
-       p = PPC_MEMSTART;
+       p = 0;
        s = total_lowmem;
 
        if (__map_without_ltlbs)
index 04dc08798d3d1ff9c4bdbc2da09f9fbc8ce49c02..953fb919eb06da65f004f18943490028cd93538a 100644 (file)
@@ -67,7 +67,7 @@ unsigned long __init mmu_mapin_ram(void)
 
        /* Pin in enough TLBs to cover any lowmem not covered by the
         * initial 256M mapping established in head_44x.S */
-       for (addr = PPC_PIN_SIZE; addr < total_lowmem;
+       for (addr = PPC_PIN_SIZE; addr < lowmem_end_addr;
             addr += PPC_PIN_SIZE)
                ppc44x_pin_tlb(addr + PAGE_OFFSET, addr);
 
index 41649a5d3602c97201021ff8ff35ec408d0e7515..1c00e0196f6c25bc99452ecdd6f04e47ee412b66 100644 (file)
@@ -6,7 +6,7 @@ ifeq ($(CONFIG_PPC64),y)
 EXTRA_CFLAGS   += -mno-minimal-toc
 endif
 
-obj-y                          := fault.o mem.o lmb.o \
+obj-y                          := fault.o mem.o \
                                   init_$(CONFIG_WORD_SIZE).o \
                                   pgtable_$(CONFIG_WORD_SIZE).o \
                                   mmu_context_$(CONFIG_WORD_SIZE).o
index c93a966b7e4b01c87f3131e8f2986eabee80f85e..ada249bf97794b82584d1b27f1f8837f8757c49c 100644 (file)
 #include <asm/mmu.h>
 #include <asm/uaccess.h>
 #include <asm/smp.h>
-#include <asm/bootx.h>
 #include <asm/machdep.h>
 #include <asm/setup.h>
 
+#include "mmu_decl.h"
+
 extern void loadcam_entry(unsigned int index);
 unsigned int tlbcam_index;
 unsigned int num_tlbcam_entries;
 static unsigned long __cam0, __cam1, __cam2;
-extern unsigned long total_lowmem;
-extern unsigned long __max_low_memory;
-extern unsigned long __initial_memory_limit;
-#define MAX_LOW_MEM    CONFIG_LOWMEM_SIZE
 
 #define NUM_TLBCAMS    (16)
 
@@ -165,15 +162,15 @@ void invalidate_tlbcam_entry(int index)
 void __init cam_mapin_ram(unsigned long cam0, unsigned long cam1,
                unsigned long cam2)
 {
-       settlbcam(0, PAGE_OFFSET, PPC_MEMSTART, cam0, _PAGE_KERNEL, 0);
+       settlbcam(0, PAGE_OFFSET, memstart_addr, cam0, _PAGE_KERNEL, 0);
        tlbcam_index++;
        if (cam1) {
                tlbcam_index++;
-               settlbcam(1, PAGE_OFFSET+cam0, PPC_MEMSTART+cam0, cam1, _PAGE_KERNEL, 0);
+               settlbcam(1, PAGE_OFFSET+cam0, memstart_addr+cam0, cam1, _PAGE_KERNEL, 0);
        }
        if (cam2) {
                tlbcam_index++;
-               settlbcam(2, PAGE_OFFSET+cam0+cam1, PPC_MEMSTART+cam0+cam1, cam2, _PAGE_KERNEL, 0);
+               settlbcam(2, PAGE_OFFSET+cam0+cam1, memstart_addr+cam0+cam1, cam2, _PAGE_KERNEL, 0);
        }
 }
 
@@ -196,35 +193,32 @@ unsigned long __init mmu_mapin_ram(void)
 void __init
 adjust_total_lowmem(void)
 {
-       unsigned long max_low_mem = MAX_LOW_MEM;
-       unsigned long cam_max = 0x10000000;
-       unsigned long ram;
+       phys_addr_t max_lowmem_size = __max_low_memory;
+       phys_addr_t cam_max_size = 0x10000000;
+       phys_addr_t ram;
 
-       /* adjust CAM size to max_low_mem */
-       if (max_low_mem < cam_max)
-               cam_max = max_low_mem;
+       /* adjust CAM size to max_lowmem_size */
+       if (max_lowmem_size < cam_max_size)
+               cam_max_size = max_lowmem_size;
 
-       /* adjust lowmem size to max_low_mem */
-       if (max_low_mem < total_lowmem)
-               ram = max_low_mem;
-       else
-               ram = total_lowmem;
+       /* adjust lowmem size to max_lowmem_size */
+       ram = min(max_lowmem_size, total_lowmem);
 
        /* Calculate CAM values */
        __cam0 = 1UL << 2 * (__ilog2(ram) / 2);
-       if (__cam0 > cam_max)
-               __cam0 = cam_max;
+       if (__cam0 > cam_max_size)
+               __cam0 = cam_max_size;
        ram -= __cam0;
        if (ram) {
                __cam1 = 1UL << 2 * (__ilog2(ram) / 2);
-               if (__cam1 > cam_max)
-                       __cam1 = cam_max;
+               if (__cam1 > cam_max_size)
+                       __cam1 = cam_max_size;
                ram -= __cam1;
        }
        if (ram) {
                __cam2 = 1UL << 2 * (__ilog2(ram) / 2);
-               if (__cam2 > cam_max)
-                       __cam2 = cam_max;
+               if (__cam2 > cam_max_size)
+                       __cam2 = cam_max_size;
                ram -= __cam2;
        }
 
@@ -232,6 +226,6 @@ adjust_total_lowmem(void)
                        " CAM2=%ldMb residual: %ldMb\n",
                        __cam0 >> 20, __cam1 >> 20, __cam2 >> 20,
                        (total_lowmem - __cam0 - __cam1 - __cam2) >> 20);
-       __max_low_memory = max_low_mem = __cam0 + __cam1 + __cam2;
-       __initial_memory_limit = __max_low_memory;
+       __max_low_memory = __cam0 + __cam1 + __cam2;
+       __initial_memory_limit_addr = memstart_addr + __max_low_memory;
 }
index a83dfa3cf40c562cd8d0218c0efb903d60303a47..2b5a399f6fa644763866440916e73658d14e3ed9 100644 (file)
@@ -31,6 +31,7 @@
 #include <linux/cache.h>
 #include <linux/init.h>
 #include <linux/signal.h>
+#include <linux/lmb.h>
 
 #include <asm/processor.h>
 #include <asm/pgtable.h>
@@ -41,7 +42,7 @@
 #include <asm/system.h>
 #include <asm/uaccess.h>
 #include <asm/machdep.h>
-#include <asm/lmb.h>
+#include <asm/prom.h>
 #include <asm/abs_addr.h>
 #include <asm/tlbflush.h>
 #include <asm/io.h>
@@ -191,6 +192,29 @@ int htab_bolt_mapping(unsigned long vstart, unsigned long vend,
        return ret < 0 ? ret : 0;
 }
 
+#ifdef CONFIG_MEMORY_HOTPLUG
+static int htab_remove_mapping(unsigned long vstart, unsigned long vend,
+                     int psize, int ssize)
+{
+       unsigned long vaddr;
+       unsigned int step, shift;
+
+       shift = mmu_psize_defs[psize].shift;
+       step = 1 << shift;
+
+       if (!ppc_md.hpte_removebolted) {
+               printk(KERN_WARNING "Platform doesn't implement "
+                               "hpte_removebolted\n");
+               return -EINVAL;
+       }
+
+       for (vaddr = vstart; vaddr < vend; vaddr += step)
+               ppc_md.hpte_removebolted(vaddr, psize, ssize);
+
+       return 0;
+}
+#endif /* CONFIG_MEMORY_HOTPLUG */
+
 static int __init htab_dt_scan_seg_sizes(unsigned long node,
                                         const char *uname, int depth,
                                         void *data)
@@ -434,6 +458,12 @@ void create_section_mapping(unsigned long start, unsigned long end)
                        _PAGE_ACCESSED | _PAGE_DIRTY | _PAGE_COHERENT | PP_RWXX,
                        mmu_linear_psize, mmu_kernel_ssize));
 }
+
+int remove_section_mapping(unsigned long start, unsigned long end)
+{
+       return htab_remove_mapping(start, end, mmu_linear_psize,
+                       mmu_kernel_ssize);
+}
 #endif /* CONFIG_MEMORY_HOTPLUG */
 
 static inline void make_bl(unsigned int *insn_addr, void *func)
index 977cb1ee5e7269e353755c190cf945931a51413c..47325f23c51f2b325ba30fd8cd89d972ed2a0318 100644 (file)
@@ -30,6 +30,7 @@
 #include <linux/highmem.h>
 #include <linux/initrd.h>
 #include <linux/pagemap.h>
+#include <linux/lmb.h>
 
 #include <asm/pgalloc.h>
 #include <asm/prom.h>
@@ -41,7 +42,6 @@
 #include <asm/machdep.h>
 #include <asm/btext.h>
 #include <asm/tlb.h>
-#include <asm/lmb.h>
 #include <asm/sections.h>
 
 #include "mmu_decl.h"
@@ -59,8 +59,8 @@ DEFINE_PER_CPU(struct mmu_gather, mmu_gathers);
 unsigned long total_memory;
 unsigned long total_lowmem;
 
-unsigned long ppc_memstart;
-unsigned long ppc_memoffset = PAGE_OFFSET;
+phys_addr_t memstart_addr;
+phys_addr_t lowmem_end_addr;
 
 int boot_mapsize;
 #ifdef CONFIG_PPC_PMAC
@@ -95,10 +95,10 @@ int __map_without_ltlbs;
 unsigned long __max_low_memory = MAX_LOW_MEM;
 
 /*
- * limit of what is accessible with initial MMU setup -
+ * address of the limit of what is accessible with initial MMU setup -
  * 256MB usually, but only 16MB on 601.
  */
-unsigned long __initial_memory_limit = 0x10000000;
+phys_addr_t __initial_memory_limit_addr = (phys_addr_t)0x10000000;
 
 /*
  * Check for command-line options that affect what MMU_init will do.
@@ -131,10 +131,10 @@ void __init MMU_init(void)
 
        /* 601 can only access 16MB at the moment */
        if (PVR_VER(mfspr(SPRN_PVR)) == 1)
-               __initial_memory_limit = 0x01000000;
+               __initial_memory_limit_addr = 0x01000000;
        /* 8xx can only access 8MB at the moment */
        if (PVR_VER(mfspr(SPRN_PVR)) == 0x50)
-               __initial_memory_limit = 0x00800000;
+               __initial_memory_limit_addr = 0x00800000;
 
        /* parse args from command line */
        MMU_setup();
@@ -145,8 +145,8 @@ void __init MMU_init(void)
                printk(KERN_WARNING "Only using first contiguous memory region");
        }
 
-       total_memory = lmb_end_of_DRAM();
-       total_lowmem = total_memory;
+       total_lowmem = total_memory = lmb_end_of_DRAM() - memstart_addr;
+       lowmem_end_addr = memstart_addr + total_lowmem;
 
 #ifdef CONFIG_FSL_BOOKE
        /* Freescale Book-E parts expect lowmem to be mapped by fixed TLB
@@ -157,9 +157,10 @@ void __init MMU_init(void)
 
        if (total_lowmem > __max_low_memory) {
                total_lowmem = __max_low_memory;
+               lowmem_end_addr = memstart_addr + total_lowmem;
 #ifndef CONFIG_HIGHMEM
                total_memory = total_lowmem;
-               lmb_enforce_memory_limit(total_lowmem);
+               lmb_enforce_memory_limit(lowmem_end_addr);
                lmb_analyze();
 #endif /* CONFIG_HIGHMEM */
        }
@@ -184,8 +185,6 @@ void __init MMU_init(void)
        /* Map in I/O resources */
        if (ppc_md.progress)
                ppc_md.progress("MMU:setio", 0x302);
-       if (ppc_md.setup_io_mappings)
-               ppc_md.setup_io_mappings();
 
        /* Initialize the context management stuff */
        mmu_context_init();
@@ -208,7 +207,7 @@ void __init *early_get_page(void)
                p = alloc_bootmem_pages(PAGE_SIZE);
        } else {
                p = __va(lmb_alloc_base(PAGE_SIZE, PAGE_SIZE,
-                                       __initial_memory_limit));
+                                       __initial_memory_limit_addr));
        }
        return p;
 }
@@ -276,7 +275,7 @@ static int __init setup_kcore(void)
 
                kcore_mem = kmalloc(sizeof(struct kcore_list), GFP_ATOMIC);
                if (!kcore_mem)
-                       panic("%s: kmalloc failed\n", __FUNCTION__);
+                       panic("%s: kmalloc failed\n", __func__);
 
                /* must stay under 32 bits */
                if ( 0xfffffffful - (unsigned long)__va(base) < size) {
index c0f5cff77035e8d1abae6fe746e96af2cbcd6dd2..698bd000f98bcba9a01da4ae7993c855877be057 100644 (file)
 #include <linux/nodemask.h>
 #include <linux/module.h>
 #include <linux/poison.h>
+#include <linux/lmb.h>
 
 #include <asm/pgalloc.h>
 #include <asm/page.h>
 #include <asm/prom.h>
-#include <asm/lmb.h>
 #include <asm/rtas.h>
 #include <asm/io.h>
 #include <asm/mmu_context.h>
@@ -72,8 +72,7 @@
 #warning TASK_SIZE is smaller than it needs to be.
 #endif
 
-/* max amount of RAM to use */
-unsigned long __max_memory;
+phys_addr_t memstart_addr;
 
 void free_initmem(void)
 {
@@ -122,7 +121,7 @@ static int __init setup_kcore(void)
                /* GFP_ATOMIC to avoid might_sleep warnings during boot */
                kcore_mem = kmalloc(sizeof(struct kcore_list), GFP_ATOMIC);
                if (!kcore_mem)
-                       panic("%s: kmalloc failed\n", __FUNCTION__);
+                       panic("%s: kmalloc failed\n", __func__);
 
                kclist_add(kcore_mem, __va(base), size);
        }
diff --git a/arch/powerpc/mm/lmb.c b/arch/powerpc/mm/lmb.c
deleted file mode 100644 (file)
index 4ce23bc..0000000
+++ /dev/null
@@ -1,357 +0,0 @@
-/*
- * Procedures for maintaining information about logical memory blocks.
- *
- * Peter Bergner, IBM Corp.    June 2001.
- * Copyright (C) 2001 Peter Bergner.
- * 
- *      This program is free software; you can redistribute it and/or
- *      modify it under the terms of the GNU General Public License
- *      as published by the Free Software Foundation; either version
- *      2 of the License, or (at your option) any later version.
- */
-
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/bitops.h>
-#include <asm/types.h>
-#include <asm/page.h>
-#include <asm/prom.h>
-#include <asm/lmb.h>
-#ifdef CONFIG_PPC32
-#include "mmu_decl.h"          /* for __max_low_memory */
-#endif
-
-#undef DEBUG
-
-#ifdef DEBUG
-#include <asm/udbg.h>
-#define DBG(fmt...) udbg_printf(fmt)
-#else
-#define DBG(fmt...)
-#endif
-
-#define LMB_ALLOC_ANYWHERE     0
-
-struct lmb lmb;
-
-void lmb_dump_all(void)
-{
-#ifdef DEBUG
-       unsigned long i;
-
-       DBG("lmb_dump_all:\n");
-       DBG("    memory.cnt               = 0x%lx\n", lmb.memory.cnt);
-       DBG("    memory.size              = 0x%lx\n", lmb.memory.size);
-       for (i=0; i < lmb.memory.cnt ;i++) {
-               DBG("    memory.region[0x%x].base       = 0x%lx\n",
-                           i, lmb.memory.region[i].base);
-               DBG("                 .size     = 0x%lx\n",
-                           lmb.memory.region[i].size);
-       }
-
-       DBG("\n    reserved.cnt   = 0x%lx\n", lmb.reserved.cnt);
-       DBG("    reserved.size    = 0x%lx\n", lmb.reserved.size);
-       for (i=0; i < lmb.reserved.cnt ;i++) {
-               DBG("    reserved.region[0x%x].base       = 0x%lx\n",
-                           i, lmb.reserved.region[i].base);
-               DBG("                 .size     = 0x%lx\n",
-                           lmb.reserved.region[i].size);
-       }
-#endif /* DEBUG */
-}
-
-static unsigned long __init lmb_addrs_overlap(unsigned long base1,
-               unsigned long size1, unsigned long base2, unsigned long size2)
-{
-       return ((base1 < (base2+size2)) && (base2 < (base1+size1)));
-}
-
-static long __init lmb_addrs_adjacent(unsigned long base1, unsigned long size1,
-               unsigned long base2, unsigned long size2)
-{
-       if (base2 == base1 + size1)
-               return 1;
-       else if (base1 == base2 + size2)
-               return -1;
-
-       return 0;
-}
-
-static long __init lmb_regions_adjacent(struct lmb_region *rgn,
-               unsigned long r1, unsigned long r2)
-{
-       unsigned long base1 = rgn->region[r1].base;
-       unsigned long size1 = rgn->region[r1].size;
-       unsigned long base2 = rgn->region[r2].base;
-       unsigned long size2 = rgn->region[r2].size;
-
-       return lmb_addrs_adjacent(base1, size1, base2, size2);
-}
-
-static void __init lmb_remove_region(struct lmb_region *rgn, unsigned long r)
-{
-       unsigned long i;
-
-       for (i = r; i < rgn->cnt - 1; i++) {
-               rgn->region[i].base = rgn->region[i + 1].base;
-               rgn->region[i].size = rgn->region[i + 1].size;
-       }
-       rgn->cnt--;
-}
-
-/* Assumption: base addr of region 1 < base addr of region 2 */
-static void __init lmb_coalesce_regions(struct lmb_region *rgn,
-               unsigned long r1, unsigned long r2)
-{
-       rgn->region[r1].size += rgn->region[r2].size;
-       lmb_remove_region(rgn, r2);
-}
-
-/* This routine called with relocation disabled. */
-void __init lmb_init(void)
-{
-       /* Create a dummy zero size LMB which will get coalesced away later.
-        * This simplifies the lmb_add() code below...
-        */
-       lmb.memory.region[0].base = 0;
-       lmb.memory.region[0].size = 0;
-       lmb.memory.cnt = 1;
-
-       /* Ditto. */
-       lmb.reserved.region[0].base = 0;
-       lmb.reserved.region[0].size = 0;
-       lmb.reserved.cnt = 1;
-}
-
-/* This routine may be called with relocation disabled. */
-void __init lmb_analyze(void)
-{
-       int i;
-
-       lmb.memory.size = 0;
-
-       for (i = 0; i < lmb.memory.cnt; i++)
-               lmb.memory.size += lmb.memory.region[i].size;
-}
-
-/* This routine called with relocation disabled. */
-static long __init lmb_add_region(struct lmb_region *rgn, unsigned long base,
-                                 unsigned long size)
-{
-       unsigned long coalesced = 0;
-       long adjacent, i;
-
-       /* First try and coalesce this LMB with another. */
-       for (i=0; i < rgn->cnt; i++) {
-               unsigned long rgnbase = rgn->region[i].base;
-               unsigned long rgnsize = rgn->region[i].size;
-
-               if ((rgnbase == base) && (rgnsize == size))
-                       /* Already have this region, so we're done */
-                       return 0;
-
-               adjacent = lmb_addrs_adjacent(base,size,rgnbase,rgnsize);
-               if ( adjacent > 0 ) {
-                       rgn->region[i].base -= size;
-                       rgn->region[i].size += size;
-                       coalesced++;
-                       break;
-               }
-               else if ( adjacent < 0 ) {
-                       rgn->region[i].size += size;
-                       coalesced++;
-                       break;
-               }
-       }
-
-       if ((i < rgn->cnt-1) && lmb_regions_adjacent(rgn, i, i+1) ) {
-               lmb_coalesce_regions(rgn, i, i+1);
-               coalesced++;
-       }
-
-       if (coalesced)
-               return coalesced;
-       if (rgn->cnt >= MAX_LMB_REGIONS)
-               return -1;
-
-       /* Couldn't coalesce the LMB, so add it to the sorted table. */
-       for (i = rgn->cnt-1; i >= 0; i--) {
-               if (base < rgn->region[i].base) {
-                       rgn->region[i+1].base = rgn->region[i].base;
-                       rgn->region[i+1].size = rgn->region[i].size;
-               } else {
-                       rgn->region[i+1].base = base;
-                       rgn->region[i+1].size = size;
-                       break;
-               }
-       }
-       rgn->cnt++;
-
-       return 0;
-}
-
-/* This routine may be called with relocation disabled. */
-long __init lmb_add(unsigned long base, unsigned long size)
-{
-       struct lmb_region *_rgn = &(lmb.memory);
-
-       /* On pSeries LPAR systems, the first LMB is our RMO region. */
-       if (base == 0)
-               lmb.rmo_size = size;
-
-       return lmb_add_region(_rgn, base, size);
-
-}
-
-long __init lmb_reserve(unsigned long base, unsigned long size)
-{
-       struct lmb_region *_rgn = &(lmb.reserved);
-
-       BUG_ON(0 == size);
-
-       return lmb_add_region(_rgn, base, size);
-}
-
-long __init lmb_overlaps_region(struct lmb_region *rgn, unsigned long base,
-                               unsigned long size)
-{
-       unsigned long i;
-
-       for (i=0; i < rgn->cnt; i++) {
-               unsigned long rgnbase = rgn->region[i].base;
-               unsigned long rgnsize = rgn->region[i].size;
-               if ( lmb_addrs_overlap(base,size,rgnbase,rgnsize) ) {
-                       break;
-               }
-       }
-
-       return (i < rgn->cnt) ? i : -1;
-}
-
-unsigned long __init lmb_alloc(unsigned long size, unsigned long align)
-{
-       return lmb_alloc_base(size, align, LMB_ALLOC_ANYWHERE);
-}
-
-unsigned long __init lmb_alloc_base(unsigned long size, unsigned long align,
-                                   unsigned long max_addr)
-{
-       unsigned long alloc;
-
-       alloc = __lmb_alloc_base(size, align, max_addr);
-
-       if (alloc == 0)
-               panic("ERROR: Failed to allocate 0x%lx bytes below 0x%lx.\n",
-                               size, max_addr);
-
-       return alloc;
-}
-
-unsigned long __init __lmb_alloc_base(unsigned long size, unsigned long align,
-                                   unsigned long max_addr)
-{
-       long i, j;
-       unsigned long base = 0;
-
-       BUG_ON(0 == size);
-
-#ifdef CONFIG_PPC32
-       /* On 32-bit, make sure we allocate lowmem */
-       if (max_addr == LMB_ALLOC_ANYWHERE)
-               max_addr = __max_low_memory;
-#endif
-       for (i = lmb.memory.cnt-1; i >= 0; i--) {
-               unsigned long lmbbase = lmb.memory.region[i].base;
-               unsigned long lmbsize = lmb.memory.region[i].size;
-
-               if (max_addr == LMB_ALLOC_ANYWHERE)
-                       base = _ALIGN_DOWN(lmbbase + lmbsize - size, align);
-               else if (lmbbase < max_addr) {
-                       base = min(lmbbase + lmbsize, max_addr);
-                       base = _ALIGN_DOWN(base - size, align);
-               } else
-                       continue;
-
-               while ((lmbbase <= base) &&
-                      ((j = lmb_overlaps_region(&lmb.reserved, base, size)) >= 0) )
-                       base = _ALIGN_DOWN(lmb.reserved.region[j].base - size,
-                                          align);
-
-               if ((base != 0) && (lmbbase <= base))
-                       break;
-       }
-
-       if (i < 0)
-               return 0;
-
-       lmb_add_region(&lmb.reserved, base, size);
-
-       return base;
-}
-
-/* You must call lmb_analyze() before this. */
-unsigned long __init lmb_phys_mem_size(void)
-{
-       return lmb.memory.size;
-}
-
-unsigned long __init lmb_end_of_DRAM(void)
-{
-       int idx = lmb.memory.cnt - 1;
-
-       return (lmb.memory.region[idx].base + lmb.memory.region[idx].size);
-}
-
-/* You must call lmb_analyze() after this. */
-void __init lmb_enforce_memory_limit(unsigned long memory_limit)
-{
-       unsigned long i, limit;
-       struct lmb_property *p;
-
-       if (! memory_limit)
-               return;
-
-       /* Truncate the lmb regions to satisfy the memory limit. */
-       limit = memory_limit;
-       for (i = 0; i < lmb.memory.cnt; i++) {
-               if (limit > lmb.memory.region[i].size) {
-                       limit -= lmb.memory.region[i].size;
-                       continue;
-               }
-
-               lmb.memory.region[i].size = limit;
-               lmb.memory.cnt = i + 1;
-               break;
-       }
-
-       if (lmb.memory.region[0].size < lmb.rmo_size)
-               lmb.rmo_size = lmb.memory.region[0].size;
-
-       /* And truncate any reserves above the limit also. */
-       for (i = 0; i < lmb.reserved.cnt; i++) {
-               p = &lmb.reserved.region[i];
-
-               if (p->base > memory_limit)
-                       p->size = 0;
-               else if ((p->base + p->size) > memory_limit)
-                       p->size = memory_limit - p->base;
-
-               if (p->size == 0) {
-                       lmb_remove_region(&lmb.reserved, i);
-                       i--;
-               }
-       }
-}
-
-int __init lmb_is_reserved(unsigned long addr)
-{
-       int i;
-
-       for (i = 0; i < lmb.reserved.cnt; i++) {
-               unsigned long upper = lmb.reserved.region[i].base +
-                                     lmb.reserved.region[i].size - 1;
-               if ((addr >= lmb.reserved.region[i].base) && (addr <= upper))
-                       return 1;
-       }
-       return 0;
-}
index be5c506779a74595d8950cfece610f9a378ce220..16def4dcff6d33ccadcf2b2b53c65628519fa901 100644 (file)
@@ -31,6 +31,7 @@
 #include <linux/initrd.h>
 #include <linux/pagemap.h>
 #include <linux/suspend.h>
+#include <linux/lmb.h>
 
 #include <asm/pgalloc.h>
 #include <asm/prom.h>
@@ -42,7 +43,6 @@
 #include <asm/machdep.h>
 #include <asm/btext.h>
 #include <asm/tlb.h>
-#include <asm/lmb.h>
 #include <asm/sections.h>
 #include <asm/vdso.h>
 
@@ -111,7 +111,7 @@ int memory_add_physaddr_to_nid(u64 start)
 }
 #endif
 
-int __devinit arch_add_memory(int nid, u64 start, u64 size)
+int arch_add_memory(int nid, u64 start, u64 size)
 {
        struct pglist_data *pgdata;
        struct zone *zone;
@@ -175,7 +175,6 @@ void show_mem(void)
 
        printk("Mem-info:\n");
        show_free_areas();
-       printk("Free swap:       %6ldkB\n", nr_swap_pages<<(PAGE_SHIFT-10));
        for_each_online_pgdat(pgdat) {
                unsigned long flags;
                pgdat_resize_lock(pgdat, &flags);
@@ -217,9 +216,11 @@ void __init do_init_bootmem(void)
        unsigned long total_pages;
        int boot_mapsize;
 
-       max_pfn = total_pages = lmb_end_of_DRAM() >> PAGE_SHIFT;
+       max_pfn = lmb_end_of_DRAM() >> PAGE_SHIFT;
+       total_pages = (lmb_end_of_DRAM() - memstart_addr) >> PAGE_SHIFT;
 #ifdef CONFIG_HIGHMEM
        total_pages = total_lowmem >> PAGE_SHIFT;
+       max_low_pfn = lowmem_end_addr >> PAGE_SHIFT;
 #endif
 
        /*
@@ -245,18 +246,18 @@ void __init do_init_bootmem(void)
         * present.
         */
 #ifdef CONFIG_HIGHMEM
-       free_bootmem_with_active_regions(0, total_lowmem >> PAGE_SHIFT);
+       free_bootmem_with_active_regions(0, lowmem_end_addr >> PAGE_SHIFT);
 
        /* reserve the sections we're already using */
        for (i = 0; i < lmb.reserved.cnt; i++) {
                unsigned long addr = lmb.reserved.region[i].base +
                                     lmb_size_bytes(&lmb.reserved, i) - 1;
-               if (addr < total_lowmem)
+               if (addr < lowmem_end_addr)
                        reserve_bootmem(lmb.reserved.region[i].base,
                                        lmb_size_bytes(&lmb.reserved, i),
                                        BOOTMEM_DEFAULT);
-               else if (lmb.reserved.region[i].base < total_lowmem) {
-                       unsigned long adjusted_size = total_lowmem -
+               else if (lmb.reserved.region[i].base < lowmem_end_addr) {
+                       unsigned long adjusted_size = lowmem_end_addr -
                                      lmb.reserved.region[i].base;
                        reserve_bootmem(lmb.reserved.region[i].base,
                                        adjusted_size, BOOTMEM_DEFAULT);
@@ -326,7 +327,7 @@ void __init paging_init(void)
               (top_of_ram - total_ram) >> 20);
        memset(max_zone_pfns, 0, sizeof(max_zone_pfns));
 #ifdef CONFIG_HIGHMEM
-       max_zone_pfns[ZONE_DMA] = total_lowmem >> PAGE_SHIFT;
+       max_zone_pfns[ZONE_DMA] = lowmem_end_addr >> PAGE_SHIFT;
        max_zone_pfns[ZONE_HIGHMEM] = top_of_ram >> PAGE_SHIFT;
 #else
        max_zone_pfns[ZONE_DMA] = top_of_ram >> PAGE_SHIFT;
@@ -381,7 +382,7 @@ void __init mem_init(void)
        {
                unsigned long pfn, highmem_mapnr;
 
-               highmem_mapnr = total_lowmem >> PAGE_SHIFT;
+               highmem_mapnr = lowmem_end_addr >> PAGE_SHIFT;
                for (pfn = highmem_mapnr; pfn < max_mapnr; ++pfn) {
                        struct page *page = pfn_to_page(pfn);
                        if (lmb_is_reserved(pfn << PAGE_SHIFT))
index ebfd13dc9d19f1a8d437d12adb06269a385855b4..04802252a64fceec63820c6d7bd581f7ba430e83 100644 (file)
@@ -48,9 +48,11 @@ extern unsigned int num_tlbcam_entries;
 
 extern unsigned long ioremap_bot;
 extern unsigned long __max_low_memory;
-extern unsigned long __initial_memory_limit;
+extern phys_addr_t __initial_memory_limit_addr;
 extern unsigned long total_memory;
 extern unsigned long total_lowmem;
+extern phys_addr_t memstart_addr;
+extern phys_addr_t lowmem_end_addr;
 
 /* ...and now those things that may be slightly different between processor
  * architectures.  -- Dan
index a300d254aac6518dc473ecf405bebf6943b6bfeb..1efd631211ef3772532430129176286bb182fbbc 100644 (file)
@@ -17,8 +17,9 @@
 #include <linux/nodemask.h>
 #include <linux/cpu.h>
 #include <linux/notifier.h>
+#include <linux/lmb.h>
 #include <asm/sparsemem.h>
-#include <asm/lmb.h>
+#include <asm/prom.h>
 #include <asm/system.h>
 #include <asm/smp.h>
 
index ac3390f81900c64192c70a14e1a10258201c7090..64c44bcc68de03f926ca67c74cac4a8db80a5239 100644 (file)
@@ -281,12 +281,13 @@ int map_page(unsigned long va, phys_addr_t pa, int flags)
  */
 void __init mapin_ram(void)
 {
-       unsigned long v, p, s, f;
+       unsigned long v, s, f;
+       phys_addr_t p;
        int ktext;
 
        s = mmu_mapin_ram();
        v = KERNELBASE + s;
-       p = PPC_MEMSTART + s;
+       p = memstart_addr + s;
        for (; s < total_lowmem; s += PAGE_SIZE) {
                ktext = ((char *) v >= _stext && (char *) v < etext);
                f = ktext ?_PAGE_RAM_TEXT : _PAGE_RAM;
index 5c45d474cfcc91d2b09211974fad4508e3de3af0..cef9f156874befc8716003c046edb4c9c53c7334 100644 (file)
 #include <linux/mm.h>
 #include <linux/init.h>
 #include <linux/highmem.h>
+#include <linux/lmb.h>
 
 #include <asm/prom.h>
 #include <asm/mmu.h>
 #include <asm/machdep.h>
-#include <asm/lmb.h>
 
 #include "mmu_decl.h"
 
@@ -82,7 +82,6 @@ unsigned long __init mmu_mapin_ram(void)
 #else
        unsigned long tot, bl, done;
        unsigned long max_size = (256<<20);
-       unsigned long align;
 
        if (__map_without_bats) {
                printk(KERN_DEBUG "RAM mapped without BATs\n");
@@ -93,19 +92,13 @@ unsigned long __init mmu_mapin_ram(void)
 
        /* Make sure we don't map a block larger than the
           smallest alignment of the physical address. */
-       /* alignment of PPC_MEMSTART */
-       align = ~(PPC_MEMSTART-1) & PPC_MEMSTART;
-       /* set BAT block size to MIN(max_size, align) */
-       if (align && align < max_size)
-               max_size = align;
-
        tot = total_lowmem;
        for (bl = 128<<10; bl < max_size; bl <<= 1) {
                if (bl * 2 > tot)
                        break;
        }
 
-       setbat(2, KERNELBASE, PPC_MEMSTART, bl, _PAGE_RAM);
+       setbat(2, KERNELBASE, 0, bl, _PAGE_RAM);
        done = (unsigned long)bat_addrs[2].limit - KERNELBASE + 1;
        if ((done < tot) && !bat_addrs[3].limit) {
                /* use BAT3 to cover a bit more */
@@ -113,7 +106,7 @@ unsigned long __init mmu_mapin_ram(void)
                for (bl = 128<<10; bl < max_size; bl <<= 1)
                        if (bl * 2 > tot)
                                break;
-               setbat(3, KERNELBASE+done, PPC_MEMSTART+done, bl, _PAGE_RAM);
+               setbat(3, KERNELBASE+done, done, bl, _PAGE_RAM);
                done = (unsigned long)bat_addrs[3].limit - KERNELBASE + 1;
        }
 
@@ -240,7 +233,7 @@ void __init MMU_init_hw(void)
         */
        if ( ppc_md.progress ) ppc_md.progress("hash:find piece", 0x322);
        Hash = __va(lmb_alloc_base(Hash_size, Hash_size,
-                                  __initial_memory_limit));
+                                  __initial_memory_limit_addr));
        cacheable_memzero(Hash, Hash_size);
        _SDR1 = __pa(Hash) | SDR1_LOW_BITS;
 
index 50448d5de9d247c9657c66a85e76f225483fc4f4..efbbd13d93e519bcfd30ebb5da48f0f87b2672f0 100644 (file)
  *      2 of the License, or (at your option) any later version.
  */
 
+#include <linux/lmb.h>
+
 #include <asm/pgtable.h>
 #include <asm/mmu.h>
 #include <asm/mmu_context.h>
 #include <asm/paca.h>
 #include <asm/cputable.h>
-#include <asm/lmb.h>
+#include <asm/prom.h>
 #include <asm/abs_addr.h>
 #include <asm/firmware.h>
 #include <asm/iseries/hv_call.h>
index 257b13cb18af8f67bd10e75c876a360807aaed14..2a9b4a0493294b881ae75c0d9e7b4bf2a7823528 100644 (file)
@@ -68,7 +68,7 @@ static struct cached_info *get_cached_info(struct spu *the_spu, int spu_num)
        if (spu_num >= num_spu_nodes) {
                printk(KERN_ERR "SPU_PROF: "
                       "%s, line %d: Invalid index %d into spu info cache\n",
-                      __FUNCTION__, __LINE__, spu_num);
+                      __func__, __LINE__, spu_num);
                ret_info = NULL;
                goto out;
        }
@@ -115,7 +115,7 @@ prepare_cached_spu_info(struct spu *spu, unsigned long objectId)
        if (!info) {
                printk(KERN_ERR "SPU_PROF: "
                       "%s, line %d: create vma_map failed\n",
-                      __FUNCTION__, __LINE__);
+                      __func__, __LINE__);
                retval = -ENOMEM;
                goto err_alloc;
        }
@@ -123,7 +123,7 @@ prepare_cached_spu_info(struct spu *spu, unsigned long objectId)
        if (!new_map) {
                printk(KERN_ERR "SPU_PROF: "
                       "%s, line %d: create vma_map failed\n",
-                      __FUNCTION__, __LINE__);
+                      __func__, __LINE__);
                retval = -ENOMEM;
                goto err_alloc;
        }
@@ -171,7 +171,7 @@ static int release_cached_info(int spu_index)
                        printk(KERN_ERR "SPU_PROF: "
                                "%s, line %d: "
                                "Invalid index %d into spu info cache\n",
-                               __FUNCTION__, __LINE__, spu_index);
+                               __func__, __LINE__, spu_index);
                        goto out;
                }
                end = spu_index + 1;
@@ -273,7 +273,7 @@ fail_no_image_cookie:
 
        printk(KERN_ERR "SPU_PROF: "
                "%s, line %d: Cannot find dcookie for SPU binary\n",
-               __FUNCTION__, __LINE__);
+               __func__, __LINE__);
        goto out;
 }
 
@@ -467,7 +467,7 @@ int spu_sync_stop(void)
        if (ret) {
                printk(KERN_ERR "SPU_PROF: "
                        "%s, line %d: spu_switch_event_unregister returned %d\n",
-                       __FUNCTION__, __LINE__, ret);
+                       __func__, __LINE__, ret);
                goto out;
        }
 
index 9a932177e70eca3efca0c06b88ce9a28f9ca9c98..fff66662d021ed152c1e17601cb319bd3f4c6ec8 100644 (file)
@@ -72,7 +72,7 @@ vma_map_add(struct vma_to_fileoffset_map *map, unsigned int vma,
                kzalloc(sizeof(struct vma_to_fileoffset_map), GFP_KERNEL);
        if (!new) {
                printk(KERN_ERR "SPU_PROF: %s, line %d: malloc failed\n",
-                      __FUNCTION__, __LINE__);
+                      __func__, __LINE__);
                vma_map_free(map);
                return NULL;
        }
@@ -134,19 +134,19 @@ struct vma_to_fileoffset_map *create_vma_map(const struct spu *aSpu,
        if (memcmp(ehdr.e_ident, expected, EI_PAD) != 0) {
                printk(KERN_ERR "SPU_PROF: "
                       "%s, line %d: Unexpected e_ident parsing SPU ELF\n",
-                      __FUNCTION__, __LINE__);
+                      __func__, __LINE__);
                goto fail;
        }
        if (ehdr.e_machine != EM_SPU) {
                printk(KERN_ERR "SPU_PROF: "
                       "%s, line %d: Unexpected e_machine parsing SPU ELF\n",
-                      __FUNCTION__,  __LINE__);
+                      __func__,  __LINE__);
                goto fail;
        }
        if (ehdr.e_type != ET_EXEC) {
                printk(KERN_ERR "SPU_PROF: "
                       "%s, line %d: Unexpected e_type parsing SPU ELF\n",
-                      __FUNCTION__, __LINE__);
+                      __func__, __LINE__);
                goto fail;
        }
        phdr_start = spu_elf_start + ehdr.e_phoff;
@@ -232,7 +232,7 @@ struct vma_to_fileoffset_map *create_vma_map(const struct spu *aSpu,
        if (overlay_tbl_offset < 0) {
                printk(KERN_ERR "SPU_PROF: "
                       "%s, line %d: Error finding SPU overlay table\n",
-                      __FUNCTION__, __LINE__);
+                      __func__, __LINE__);
                goto fail;
        }
        ovly_table = spu_elf_start + overlay_tbl_offset;
index 9eed1f68fcab3495981b72f40375e26ed9be4d7d..5ff4de3eb3be335ccdad62f4c208415c25a4bf88 100644 (file)
@@ -216,7 +216,7 @@ static void pm_rtas_reset_signals(u32 node)
                 * failure to stop OProfile.
                 */
                printk(KERN_WARNING "%s: rtas returned: %d\n",
-                      __FUNCTION__, ret);
+                      __func__, ret);
 }
 
 static int pm_rtas_activate_signals(u32 node, u32 count)
@@ -255,7 +255,7 @@ static int pm_rtas_activate_signals(u32 node, u32 count)
 
                if (unlikely(ret)) {
                        printk(KERN_WARNING "%s: rtas returned: %d\n",
-                              __FUNCTION__, ret);
+                              __func__, ret);
                        return -EIO;
                }
        }
@@ -560,7 +560,7 @@ static int cell_reg_setup(struct op_counter_config *ctr,
                if (unlikely(spu_rtas_token == RTAS_UNKNOWN_SERVICE)) {
                        printk(KERN_ERR
                               "%s: rtas token ibm,cbe-spu-perftools unknown\n",
-                              __FUNCTION__);
+                              __func__);
                        return -EIO;
                }
        }
@@ -576,7 +576,7 @@ static int cell_reg_setup(struct op_counter_config *ctr,
        if (unlikely(pm_rtas_token == RTAS_UNKNOWN_SERVICE)) {
                printk(KERN_ERR
                       "%s: rtas token ibm,cbe-perftools unknown\n",
-                      __FUNCTION__);
+                      __func__);
                return -EIO;
        }
 
@@ -853,7 +853,7 @@ static int pm_rtas_activate_spu_profiling(u32 node)
 
        if (unlikely(ret)) {
                printk(KERN_WARNING "%s: rtas returned: %d\n",
-                      __FUNCTION__, ret);
+                      __func__, ret);
                return -EIO;
        }
 
@@ -949,7 +949,7 @@ static int cell_global_start_spu(struct op_counter_config *ctr)
                if (unlikely(ret != 0)) {
                        printk(KERN_ERR
                               "%s: rtas call ibm,cbe-spu-perftools failed, return = %d\n",
-                              __FUNCTION__, ret);
+                              __func__, ret);
                        rtas_error = -EIO;
                        goto out;
                }
@@ -1061,7 +1061,7 @@ static void cell_global_stop_spu(void)
                if (unlikely(rtn_value != 0)) {
                        printk(KERN_ERR
                               "%s: rtas call ibm,cbe-spu-perftools failed, return = %d\n",
-                              __FUNCTION__, rtn_value);
+                              __func__, rtn_value);
                }
 
                /* Deactivate the signals */
index 13d1345026daebff6f8e1eb55662157d93aee9f0..ae2e7f67c18ecc794af053472fa208000ebed328 100644 (file)
@@ -29,6 +29,7 @@
 #include <asm/time.h>
 #include <asm/uic.h>
 #include <asm/pci-bridge.h>
+#include <asm/ppc4xx.h>
 
 static struct device_node *bcsr_node;
 static void __iomem *bcsr_regs;
@@ -119,5 +120,6 @@ define_machine(ep405) {
        .progress               = udbg_progress,
        .init_IRQ               = uic_init_tree,
        .get_irq                = uic_get_irq,
+       .restart                = ppc4xx_reset_system,
        .calibrate_decr         = generic_calibrate_decr,
 };
index f9206a7fede08f51b1e5823245379564869ed931..1dd24ffc0dc1d07496ac4898f748adc0b6e4ceb6 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Kilauea board specific routines
  *
- * Copyright 2007 DENX Software Engineering, Stefan Roese <sr@denx.de>
+ * Copyright 2007-2008 DENX Software Engineering, Stefan Roese <sr@denx.de>
  *
  * Based on the Walnut code by
  * Josh Boyer <jwboyer@linux.vnet.ibm.com>
@@ -20,6 +20,7 @@
 #include <asm/time.h>
 #include <asm/uic.h>
 #include <asm/pci-bridge.h>
+#include <asm/ppc4xx.h>
 
 static __initdata struct of_device_id kilauea_of_bus[] = {
        { .compatible = "ibm,plb4", },
@@ -54,5 +55,6 @@ define_machine(kilauea) {
        .progress                       = udbg_progress,
        .init_IRQ                       = uic_init_tree,
        .get_irq                        = uic_get_irq,
+       .restart                        = ppc4xx_reset_system,
        .calibrate_decr                 = generic_calibrate_decr,
 };
index 4e4df72fc9cd79ea3a5fec664cdd4c84aef46161..a6a1d6017b7191497e0c6e94a3e124e35b820786 100644 (file)
@@ -20,6 +20,7 @@
 #include <asm/time.h>
 #include <asm/uic.h>
 #include <asm/pci-bridge.h>
+#include <asm/ppc4xx.h>
 
 static __initdata struct of_device_id makalu_of_bus[] = {
        { .compatible = "ibm,plb4", },
@@ -54,5 +55,6 @@ define_machine(makalu) {
        .progress                       = udbg_progress,
        .init_IRQ                       = uic_init_tree,
        .get_irq                        = uic_get_irq,
+       .restart                        = ppc4xx_reset_system,
        .calibrate_decr                 = generic_calibrate_decr,
 };
index 0422590040db5dbf12468db78624dab41f69adb5..fc7fb001276ce6ae6606440a34ed216eab0a91ec 100644 (file)
@@ -14,6 +14,7 @@
 #include <asm/prom.h>
 #include <asm/time.h>
 #include <asm/xilinx_intc.h>
+#include <asm/ppc4xx.h>
 
 static struct of_device_id xilinx_of_bus_ids[] __initdata = {
        { .compatible = "xlnx,plb-v46-1.00.a", },
@@ -48,5 +49,6 @@ define_machine(virtex) {
        .probe                  = virtex_probe,
        .init_IRQ               = xilinx_intc_init_tree,
        .get_irq                = xilinx_intc_get_irq,
+       .restart                = ppc4xx_reset_system,
        .calibrate_decr         = generic_calibrate_decr,
 };
index b8b257efeb773aaa0c3ee8b642088670c82db7e0..335df91fbee58e9e0430fe54649d3810ff70ae85 100644 (file)
@@ -26,6 +26,7 @@
 #include <asm/time.h>
 #include <asm/uic.h>
 #include <asm/pci-bridge.h>
+#include <asm/ppc4xx.h>
 
 static __initdata struct of_device_id walnut_of_bus[] = {
        { .compatible = "ibm,plb3", },
@@ -61,5 +62,6 @@ define_machine(walnut) {
        .progress               = udbg_progress,
        .init_IRQ               = uic_init_tree,
        .get_irq                = uic_get_irq,
-       .calibrate_decr = generic_calibrate_decr,
+       .restart                = ppc4xx_reset_system,
+       .calibrate_decr         = generic_calibrate_decr,
 };
index 42eabf87fea3e65d833f715b55c9f808e544289a..dbc4d2b4301abef2791c646f8a597689361fda6f 100644 (file)
@@ -3,6 +3,5 @@
 
 extern u8 as1_readb(volatile u8 __iomem  *addr);
 extern void as1_writeb(u8 data, volatile u8 __iomem *addr);
-extern void ppc44x_reset_system(char *cmd);
 
 #endif /* __POWERPC_PLATFORMS_44X_44X_H */
index 1bfb2191010a57dc87277d5d5d376f403bcd1f5c..6abe91357eee742afbeb5efc32472064339c7aff 100644 (file)
@@ -67,6 +67,25 @@ config WARP
          See http://www.pikatechnologies.com/ and follow the "PIKA for Computer
          Telephony Developers" link for more information.
 
+config CANYONLANDS
+       bool "Canyonlands"
+       depends on 44x
+       default n
+       select 460EX
+       select PCI
+       select PPC4xx_PCI_EXPRESS
+       help
+         This option enables support for the AMCC PPC460EX evaluation board.
+
+config YOSEMITE
+       bool "Yosemite"
+       depends on 44x
+       default n
+       select 440EP
+       select PCI
+       help
+         This option enables support for the AMCC PPC440EP evaluation board.
+
 #config LUAN
 #      bool "Luan"
 #      depends on 44x
@@ -122,6 +141,14 @@ config 440SPe
        bool
        select IBM_NEW_EMAC_EMAC4
 
+config 460EX
+       bool
+       select PPC_FPU
+       select IBM_NEW_EMAC_EMAC4
+       select IBM_NEW_EMAC_RGMII
+       select IBM_NEW_EMAC_ZMII
+       select IBM_NEW_EMAC_TAH
+
 # 44x errata/workaround config symbols, selected by the CPU models above
 config IBM440EP_ERR42
        bool
index 0864d4f1cbc230ef00c8007be296d10568a31425..774165f9acdde26378651c0afb6daf0466fb0031 100644 (file)
@@ -1,9 +1,11 @@
-obj-$(CONFIG_44x)      := misc_44x.o
+obj-$(CONFIG_44x)      := misc_44x.o idle.o
 obj-$(CONFIG_EBONY)    += ebony.o
 obj-$(CONFIG_TAISHAN)  += taishan.o
 obj-$(CONFIG_BAMBOO)   += bamboo.o
+obj-$(CONFIG_YOSEMITE) += bamboo.o
 obj-$(CONFIG_SEQUOIA)  += sequoia.o
 obj-$(CONFIG_KATMAI)   += katmai.o
 obj-$(CONFIG_RAINIER)  += rainier.o
 obj-$(CONFIG_WARP)     += warp.o
 obj-$(CONFIG_WARP)     += warp-nand.o
+obj-$(CONFIG_CANYONLANDS) += canyonlands.o
index fb9a22a7e8d085c18dc5ada58067207541947b57..cef169e9515612d78a94884380084f3dc824e088 100644 (file)
@@ -22,8 +22,7 @@
 #include <asm/time.h>
 #include <asm/uic.h>
 #include <asm/pci-bridge.h>
-
-#include "44x.h"
+#include <asm/ppc4xx.h>
 
 static __initdata struct of_device_id bamboo_of_bus[] = {
        { .compatible = "ibm,plb4", },
@@ -53,11 +52,11 @@ static int __init bamboo_probe(void)
 }
 
 define_machine(bamboo) {
-       .name                           = "Bamboo",
-       .probe                          = bamboo_probe,
-       .progress                       = udbg_progress,
-       .init_IRQ                       = uic_init_tree,
-       .get_irq                        = uic_get_irq,
-       .restart                        = ppc44x_reset_system,
+       .name                   = "Bamboo",
+       .probe                  = bamboo_probe,
+       .progress               = udbg_progress,
+       .init_IRQ               = uic_init_tree,
+       .get_irq                = uic_get_irq,
+       .restart                = ppc4xx_reset_system,
        .calibrate_decr         = generic_calibrate_decr,
 };
diff --git a/arch/powerpc/platforms/44x/canyonlands.c b/arch/powerpc/platforms/44x/canyonlands.c
new file mode 100644 (file)
index 0000000..3949289
--- /dev/null
@@ -0,0 +1,63 @@
+/*
+ * Canyonlands board specific routines
+ *
+ * Copyright 2008 DENX Software Engineering, Stefan Roese <sr@denx.de>
+ *
+ * Based on the Katmai code by
+ * Benjamin Herrenschmidt <benh@kernel.crashing.org>
+ * Copyright 2007 IBM Corp.
+ * Josh Boyer <jwboyer@linux.vnet.ibm.com>
+ * Copyright 2007 IBM Corporation
+ *
+ * This program is free software; you can redistribute  it and/or modify it
+ * under  the terms of  the GNU General  Public License as published by the
+ * Free Software Foundation;  either version 2 of the  License, or (at your
+ * option) any later version.
+ */
+#include <linux/init.h>
+#include <linux/of_platform.h>
+
+#include <asm/machdep.h>
+#include <asm/prom.h>
+#include <asm/udbg.h>
+#include <asm/time.h>
+#include <asm/uic.h>
+#include <asm/pci-bridge.h>
+#include <asm/ppc4xx.h>
+
+static __initdata struct of_device_id canyonlands_of_bus[] = {
+       { .compatible = "ibm,plb4", },
+       { .compatible = "ibm,opb", },
+       { .compatible = "ibm,ebc", },
+       {},
+};
+
+static int __init canyonlands_device_probe(void)
+{
+       of_platform_bus_probe(NULL, canyonlands_of_bus, NULL);
+
+       return 0;
+}
+machine_device_initcall(canyonlands, canyonlands_device_probe);
+
+static int __init canyonlands_probe(void)
+{
+       unsigned long root = of_get_flat_dt_root();
+
+       if (!of_flat_dt_is_compatible(root, "amcc,canyonlands"))
+               return 0;
+
+       ppc_pci_flags = PPC_PCI_REASSIGN_ALL_RSRC;
+
+       return 1;
+}
+
+define_machine(canyonlands) {
+       .name                           = "Canyonlands",
+       .probe                          = canyonlands_probe,
+       .progress                       = udbg_progress,
+       .init_IRQ                       = uic_init_tree,
+       .get_irq                        = uic_get_irq,
+       .restart                        = ppc4xx_reset_system,
+       .calibrate_decr                 = generic_calibrate_decr,
+};
index 1a8d467bff8522fd1db5d8c3c5f2d10bb40bd0df..a0e8fe4662f61246ab02f8d7c668453d5ca2a676 100644 (file)
@@ -26,8 +26,7 @@
 #include <asm/time.h>
 #include <asm/uic.h>
 #include <asm/pci-bridge.h>
-
-#include "44x.h"
+#include <asm/ppc4xx.h>
 
 static __initdata struct of_device_id ebony_of_bus[] = {
        { .compatible = "ibm,plb4", },
@@ -66,6 +65,6 @@ define_machine(ebony) {
        .progress               = udbg_progress,
        .init_IRQ               = uic_init_tree,
        .get_irq                = uic_get_irq,
-       .restart                = ppc44x_reset_system,
+       .restart                = ppc4xx_reset_system,
        .calibrate_decr         = generic_calibrate_decr,
 };
diff --git a/arch/powerpc/platforms/44x/idle.c b/arch/powerpc/platforms/44x/idle.c
new file mode 100644 (file)
index 0000000..7a81f92
--- /dev/null
@@ -0,0 +1,67 @@
+/*
+ * Copyright 2008 IBM Corp. 
+ *
+ * Based on arch/powerpc/platforms/pasemi/idle.c: 
+ * Copyright (C) 2006-2007 PA Semi, Inc
+ *
+ * Added by: Jerone Young <jyoung5@us.ibm.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+ *
+ */
+
+#include <linux/of.h>
+#include <linux/kernel.h>
+#include <asm/machdep.h>
+
+static int mode_spin;
+
+static void ppc44x_idle(void)
+{
+       unsigned long msr_save;
+
+       msr_save = mfmsr();
+       /* set wait state MSR */
+       mtmsr(msr_save|MSR_WE|MSR_EE|MSR_CE|MSR_DE);
+       isync();
+       /* return to initial state */
+       mtmsr(msr_save);
+       isync();
+}
+
+int __init ppc44x_idle_init(void)
+{
+       if (!mode_spin) {
+               /* If we are not setting spin mode 
+                   then we set to wait mode */
+               ppc_md.power_save = &ppc44x_idle;
+       }
+
+       return 0;
+}
+
+arch_initcall(ppc44x_idle_init);
+
+static int __init idle_param(char *p)
+{ 
+
+       if (!strcmp("spin", p)) {
+               mode_spin = 1;
+               ppc_md.power_save = NULL;
+       }
+
+       return 0;
+}
+
+early_param("idle", idle_param);
index 11134121f272d36f33687d84091cadb0bc078017..44f4b3a00cedee98206e2e1ec563a31de564d590 100644 (file)
@@ -22,8 +22,7 @@
 #include <asm/time.h>
 #include <asm/uic.h>
 #include <asm/pci-bridge.h>
-
-#include "44x.h"
+#include <asm/ppc4xx.h>
 
 static __initdata struct of_device_id katmai_of_bus[] = {
        { .compatible = "ibm,plb4", },
@@ -58,6 +57,6 @@ define_machine(katmai) {
        .progress                       = udbg_progress,
        .init_IRQ                       = uic_init_tree,
        .get_irq                        = uic_get_irq,
-       .restart                        = ppc44x_reset_system,
+       .restart                        = ppc4xx_reset_system,
        .calibrate_decr                 = generic_calibrate_decr,
 };
index 3bce71d5d75632b6e96bad53922a6af5cf00168d..dc12b8009e48f49e7f6114bfeacaba4533fc4a99 100644 (file)
@@ -44,14 +44,3 @@ _GLOBAL(as1_writeb)
        sync
        isync
        blr
-
-/*
- * void ppc44x_reset_system(char *cmd)
- *
- * At present, this routine just applies a system reset.
- */
-_GLOBAL(ppc44x_reset_system)
-       mfspr   r13,SPRN_DBCR0
-       oris    r13,r13,DBCR0_RST_SYSTEM@h
-       mtspr   SPRN_DBCR0,r13
-       b       .                       /* Just in case the reset doesn't work */
index a7fae1cf69c1cdd76cf116543c51a4136c2d8b65..4f1ff84c4b6366e2ceb291c56284dc014a243d42 100644 (file)
@@ -22,7 +22,7 @@
 #include <asm/time.h>
 #include <asm/uic.h>
 #include <asm/pci-bridge.h>
-#include "44x.h"
+#include <asm/ppc4xx.h>
 
 static __initdata struct of_device_id rainier_of_bus[] = {
        { .compatible = "ibm,plb4", },
@@ -57,6 +57,6 @@ define_machine(rainier) {
        .progress                       = udbg_progress,
        .init_IRQ                       = uic_init_tree,
        .get_irq                        = uic_get_irq,
-       .restart                        = ppc44x_reset_system,
+       .restart                        = ppc4xx_reset_system,
        .calibrate_decr                 = generic_calibrate_decr,
 };
index d279db42c896d1f0c0532f38abd611d2131b96d8..49eb73daacdfbdb8e89773371a2fa71b33482772 100644 (file)
@@ -23,7 +23,7 @@
 #include <asm/uic.h>
 #include <asm/pci-bridge.h>
 
-#include "44x.h"
+#include <asm/ppc4xx.h>
 
 static __initdata struct of_device_id sequoia_of_bus[] = {
        { .compatible = "ibm,plb4", },
@@ -58,6 +58,6 @@ define_machine(sequoia) {
        .progress                       = udbg_progress,
        .init_IRQ                       = uic_init_tree,
        .get_irq                        = uic_get_irq,
-       .restart                        = ppc44x_reset_system,
+       .restart                        = ppc4xx_reset_system,
        .calibrate_decr                 = generic_calibrate_decr,
 };
index 28ab7e2e02c391b024292b560180bd060aef5116..49c78b2098b428579ad09f9e98a4f572eadd516c 100644 (file)
@@ -29,8 +29,7 @@
 #include <asm/time.h>
 #include <asm/uic.h>
 #include <asm/pci-bridge.h>
-
-#include "44x.h"
+#include <asm/ppc4xx.h>
 
 static __initdata struct of_device_id taishan_of_bus[] = {
        { .compatible = "ibm,plb4", },
@@ -68,6 +67,6 @@ define_machine(taishan) {
        .progress               = udbg_progress,
        .init_IRQ               = uic_init_tree,
        .get_irq                = uic_get_irq,
-       .restart                = ppc44x_reset_system,
+       .restart                = ppc4xx_reset_system,
        .calibrate_decr         = generic_calibrate_decr,
 };
index 84ab78ff8c0301cd92a6500e53fea1719c65663e..9150318cfc5668fa4cd7c8597bb699389065d777 100644 (file)
@@ -11,6 +11,7 @@
 #include <linux/mtd/partitions.h>
 #include <linux/mtd/nand.h>
 #include <linux/mtd/ndfc.h>
+#include <asm/machdep.h>
 
 #ifdef CONFIG_MTD_NAND_NDFC
 
@@ -100,6 +101,6 @@ static int warp_setup_nand_flash(void)
 
        return 0;
 }
-device_initcall(warp_setup_nand_flash);
+machine_device_initcall(warp, warp_setup_nand_flash);
 
 #endif
index da5b7b7599dbc3d0a19b649630d8e2d6fcc739ae..39cf6150a72b2701af6eb62348ce364b3d88ce26 100644 (file)
@@ -18,9 +18,7 @@
 #include <asm/udbg.h>
 #include <asm/time.h>
 #include <asm/uic.h>
-
-#include "44x.h"
-
+#include <asm/ppc4xx.h>
 
 static __initdata struct of_device_id warp_of_bus[] = {
        { .compatible = "ibm,plb4", },
@@ -49,7 +47,7 @@ define_machine(warp) {
        .progress       = udbg_progress,
        .init_IRQ       = uic_init_tree,
        .get_irq        = uic_get_irq,
-       .restart        = ppc44x_reset_system,
+       .restart        = ppc4xx_reset_system,
        .calibrate_decr = generic_calibrate_decr,
 };
 
index 956f459e175ceed080cd2d1f4bf2b70945e409fe..6d584f4e3c9a1032b98e22e8f96cb91900158edf 100644 (file)
@@ -63,7 +63,7 @@ lite5200_fix_clock_config(void)
        of_node_put(np);
        if (!cdm) {
                printk(KERN_ERR "%s() failed; expect abnormal behaviour\n",
-                      __FUNCTION__);
+                      __func__);
                return;
        }
 
@@ -98,7 +98,7 @@ lite5200_fix_port_config(void)
        of_node_put(np);
        if (!gpio) {
                printk(KERN_ERR "%s() failed. expect abnormal behavior\n",
-                      __FUNCTION__);
+                      __func__);
                return;
        }
 
index 4fad6c7bf9f1db3a3c017533ac3eb01e50ac8e28..917ac889155531eae452b8f39d20ece1385b6154 100644 (file)
@@ -11,7 +11,6 @@ config MPC8272_ADS
        select 8260
        select FSL_SOC
        select PQ2_ADS_PCI_PIC if PCI
-       select PPC_CPM_NEW_BINDING
        help
          This option enables support for the MPC8272 ADS board
 
@@ -22,7 +21,6 @@ config PQ2FADS
        select 8260
        select FSL_SOC
        select PQ2_ADS_PCI_PIC if PCI
-       select PPC_CPM_NEW_BINDING
        help
          This option enables support for the PQ2FADS board
 
@@ -31,7 +29,6 @@ config EP8248E
        select 8272
        select 8260
        select FSL_SOC
-       select PPC_CPM_NEW_BINDING
        select MDIO_BITBANG
        help
          This enables support for the Embedded Planet EP8248E board.
index 2293ae51383d05e42978a4a57c9948c37fac1147..c00356bdb1dda4d293d3dc57d97e8eaba0c2773f 100644 (file)
@@ -46,6 +46,7 @@ static void __init mpc837x_rdb_setup_arch(void)
 static struct of_device_id mpc837x_ids[] = {
        { .type = "soc", },
        { .compatible = "soc", },
+       { .compatible = "simple-bus", },
        {},
 };
 
index 68065e62fc3d35faa42e69974ead970f13e154ed..88a3b5cabb18c5f18834110d62aa99952d940c78 100644 (file)
@@ -16,6 +16,7 @@
 #define MPC83XX_SCCR_USB_DRCM_10   0x00200000
 #define MPC8315_SCCR_USB_MASK      0x00c00000
 #define MPC8315_SCCR_USB_DRCM_11   0x00c00000
+#define MPC8315_SCCR_USB_DRCM_01   0x00400000
 #define MPC837X_SCCR_USB_DRCM_11   0x00c00000
 
 /* system i/o configuration register low */
@@ -37,6 +38,7 @@
 /* USB Control Register */
 #define FSL_USB2_CONTROL_OFFS      0x500
 #define CONTROL_UTMI_PHY_EN        0x00000200
+#define CONTROL_REFSEL_24MHZ       0x00000040
 #define CONTROL_REFSEL_48MHZ       0x00000080
 #define CONTROL_PHY_CLK_SEL_ULPI   0x00000400
 #define CONTROL_OTG_PORT           0x00000020
index 471fdd8f41084b629bc962534bc58dce2fadee93..64bcf0a33c71903fa3978de2c28d9b4df8c4bbba 100644 (file)
@@ -129,7 +129,7 @@ int mpc831x_usb_cfg(void)
        if (immr_node && of_device_is_compatible(immr_node, "fsl,mpc8315-immr"))
                clrsetbits_be32(immap + MPC83XX_SCCR_OFFS,
                                MPC8315_SCCR_USB_MASK,
-                               MPC8315_SCCR_USB_DRCM_11);
+                               MPC8315_SCCR_USB_DRCM_01);
        else
                clrsetbits_be32(immap + MPC83XX_SCCR_OFFS,
                                MPC83XX_SCCR_USB_MASK,
@@ -164,9 +164,15 @@ int mpc831x_usb_cfg(void)
        /* Using on-chip PHY */
        if (prop && (!strcmp(prop, "utmi_wide") ||
                     !strcmp(prop, "utmi"))) {
-               /* Set UTMI_PHY_EN, REFSEL to 48MHZ */
+               u32 refsel;
+
+               if (of_device_is_compatible(immr_node, "fsl,mpc8315-immr"))
+                       refsel = CONTROL_REFSEL_24MHZ;
+               else
+                       refsel = CONTROL_REFSEL_48MHZ;
+               /* Set UTMI_PHY_EN and REFSEL */
                out_be32(usb_regs + FSL_USB2_CONTROL_OFFS,
-                               CONTROL_UTMI_PHY_EN | CONTROL_REFSEL_48MHZ);
+                               CONTROL_UTMI_PHY_EN | refsel);
        /* Using external UPLI PHY */
        } else if (prop && !strcmp(prop, "ulpi")) {
                /* Set PHY_CLK_SEL to ULPI */
index 7e76ddbd5821f6e88bdd5b4748bf60c28b86a760..7ff29d53dc2d92cb959871f9c7b33aa51791c6e0 100644 (file)
@@ -19,7 +19,6 @@ config MPC8540_ADS
 config MPC8560_ADS
        bool "Freescale MPC8560 ADS"
        select DEFAULT_UIMAGE
-       select PPC_CPM_NEW_BINDING
        select CPM2
        help
          This option enables support for the MPC 8560 ADS board
@@ -46,6 +45,12 @@ config MPC85xx_DS
        help
          This option enables support for the MPC85xx DS (MPC8544 DS) board
 
+config KSI8560
+        bool "Emerson KSI8560"
+        select DEFAULT_UIMAGE
+        help
+          This option enables support for the Emerson KSI8560 board
+
 config STX_GP3
        bool "Silicon Turnkey Express GP3"
        help
@@ -53,14 +58,12 @@ config STX_GP3
          board.
        select CPM2
        select DEFAULT_UIMAGE
-       select PPC_CPM_NEW_BINDING
 
 config TQM8540
        bool "TQ Components TQM8540"
        help
          This option enables support for the TQ Components TQM8540 board.
        select DEFAULT_UIMAGE
-       select PPC_CPM_NEW_BINDING
        select TQM85xx
 
 config TQM8541
@@ -68,7 +71,6 @@ config TQM8541
        help
          This option enables support for the TQ Components TQM8541 board.
        select DEFAULT_UIMAGE
-       select PPC_CPM_NEW_BINDING
        select TQM85xx
        select CPM2
 
@@ -77,7 +79,6 @@ config TQM8555
        help
          This option enables support for the TQ Components TQM8555 board.
        select DEFAULT_UIMAGE
-       select PPC_CPM_NEW_BINDING
        select TQM85xx
        select CPM2
 
@@ -86,7 +87,6 @@ config TQM8560
        help
          This option enables support for the TQ Components TQM8560 board.
        select DEFAULT_UIMAGE
-       select PPC_CPM_NEW_BINDING
        select TQM85xx
        select CPM2
 
@@ -99,7 +99,6 @@ config SBC8548
 config SBC8560
        bool "Wind River SBC8560"
        select DEFAULT_UIMAGE
-       select PPC_CPM_NEW_BINDING if CPM2
        help
          This option enables support for the Wind River SBC8560 board
 
index cb7af4ebd75f78d44b6a2bf3237a9097a2d256e3..6cea185f62b29fb5252a69fc14e6b7f52842f600 100644 (file)
@@ -10,3 +10,4 @@ obj-$(CONFIG_STX_GP3)   += stx_gp3.o
 obj-$(CONFIG_TQM85xx)    += tqm85xx.o
 obj-$(CONFIG_SBC8560)     += sbc8560.o
 obj-$(CONFIG_SBC8548)     += sbc8548.o
+obj-$(CONFIG_KSI8560)    += ksi8560.o
diff --git a/arch/powerpc/platforms/85xx/ksi8560.c b/arch/powerpc/platforms/85xx/ksi8560.c
new file mode 100644 (file)
index 0000000..2145ade
--- /dev/null
@@ -0,0 +1,257 @@
+/*
+ * Board setup routines for the Emerson KSI8560
+ *
+ * Author: Alexandr Smirnov <asmirnov@ru.mvista.com>
+ *
+ * Based on mpc85xx_ads.c maintained by Kumar Gala
+ *
+ * 2008 (c) MontaVista, Software, Inc.  This file is licensed under
+ * the terms of the GNU General Public License version 2.  This program
+ * is licensed "as is" without any warranty of any kind, whether express
+ * or implied.
+ *
+ */
+
+#include <linux/stddef.h>
+#include <linux/kernel.h>
+#include <linux/pci.h>
+#include <linux/kdev_t.h>
+#include <linux/delay.h>
+#include <linux/seq_file.h>
+#include <linux/of_platform.h>
+
+#include <asm/system.h>
+#include <asm/time.h>
+#include <asm/machdep.h>
+#include <asm/pci-bridge.h>
+#include <asm/mpic.h>
+#include <mm/mmu_decl.h>
+#include <asm/udbg.h>
+#include <asm/prom.h>
+
+#include <sysdev/fsl_soc.h>
+#include <sysdev/fsl_pci.h>
+
+#include <asm/cpm2.h>
+#include <sysdev/cpm2_pic.h>
+
+
+#define KSI8560_CPLD_HVR               0x04 /* Hardware Version Register */
+#define KSI8560_CPLD_PVR               0x08 /* PLD Version Register */
+#define KSI8560_CPLD_RCR1              0x30 /* Reset Command Register 1 */
+
+#define KSI8560_CPLD_RCR1_CPUHR                0x80 /* CPU Hard Reset */
+
+static void __iomem *cpld_base = NULL;
+
+static void machine_restart(char *cmd)
+{
+       if (cpld_base)
+               out_8(cpld_base + KSI8560_CPLD_RCR1, KSI8560_CPLD_RCR1_CPUHR);
+       else
+               printk(KERN_ERR "Can't find CPLD base, hang forever\n");
+
+       for (;;);
+}
+
+static void cpm2_cascade(unsigned int irq, struct irq_desc *desc)
+{
+       int cascade_irq;
+
+       while ((cascade_irq = cpm2_get_irq()) >= 0)
+               generic_handle_irq(cascade_irq);
+
+       desc->chip->eoi(irq);
+}
+
+static void __init ksi8560_pic_init(void)
+{
+       struct mpic *mpic;
+       struct resource r;
+       struct device_node *np;
+#ifdef CONFIG_CPM2
+       int irq;
+#endif
+
+       np = of_find_node_by_type(NULL, "open-pic");
+
+       if (np == NULL) {
+               printk(KERN_ERR "Could not find open-pic node\n");
+               return;
+       }
+
+       if (of_address_to_resource(np, 0, &r)) {
+               printk(KERN_ERR "Could not map mpic register space\n");
+               of_node_put(np);
+               return;
+       }
+
+       mpic = mpic_alloc(np, r.start,
+                       MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN,
+                       0, 256, " OpenPIC  ");
+       BUG_ON(mpic == NULL);
+       of_node_put(np);
+
+       mpic_init(mpic);
+
+#ifdef CONFIG_CPM2
+       /* Setup CPM2 PIC */
+       np = of_find_compatible_node(NULL, NULL, "fsl,cpm2-pic");
+       if (np == NULL) {
+               printk(KERN_ERR "PIC init: can not find fsl,cpm2-pic node\n");
+               return;
+       }
+       irq = irq_of_parse_and_map(np, 0);
+
+       cpm2_pic_init(np);
+       of_node_put(np);
+       set_irq_chained_handler(irq, cpm2_cascade);
+
+       setup_irq(0, NULL);
+#endif
+}
+
+#ifdef CONFIG_CPM2
+/*
+ * Setup I/O ports
+ */
+struct cpm_pin {
+       int port, pin, flags;
+};
+
+static struct cpm_pin __initdata ksi8560_pins[] = {
+       /* SCC1 */
+       {3, 29, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
+       {3, 30, CPM_PIN_OUTPUT | CPM_PIN_SECONDARY},
+       {3, 31, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
+
+       /* SCC2 */
+       {3, 26, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
+       {3, 27, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
+       {3, 28, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
+
+       /* FCC1 */
+       {0, 14, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
+       {0, 15, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
+       {0, 16, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
+       {0, 17, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
+       {0, 18, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
+       {0, 19, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
+       {0, 20, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
+       {0, 21, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
+       {0, 26, CPM_PIN_INPUT | CPM_PIN_SECONDARY},
+       {0, 27, CPM_PIN_INPUT | CPM_PIN_SECONDARY},
+       {0, 28, CPM_PIN_OUTPUT | CPM_PIN_SECONDARY},
+       {0, 29, CPM_PIN_OUTPUT | CPM_PIN_SECONDARY},
+       {0, 30, CPM_PIN_INPUT | CPM_PIN_SECONDARY},
+       {0, 31, CPM_PIN_INPUT | CPM_PIN_SECONDARY},
+       {2, 23, CPM_PIN_INPUT | CPM_PIN_PRIMARY}, /* CLK9 */
+       {2, 22, CPM_PIN_INPUT | CPM_PIN_PRIMARY}, /* CLK10 */
+
+};
+
+static void __init init_ioports(void)
+{
+       int i;
+
+       for (i = 0; i < ARRAY_SIZE(ksi8560_pins); i++) {
+               struct cpm_pin *pin = &ksi8560_pins[i];
+               cpm2_set_pin(pin->port, pin->pin, pin->flags);
+       }
+
+       cpm2_clk_setup(CPM_CLK_SCC1, CPM_BRG1, CPM_CLK_RX);
+       cpm2_clk_setup(CPM_CLK_SCC1, CPM_BRG1, CPM_CLK_TX);
+       cpm2_clk_setup(CPM_CLK_SCC2, CPM_BRG2, CPM_CLK_RX);
+       cpm2_clk_setup(CPM_CLK_SCC2, CPM_BRG2, CPM_CLK_TX);
+       cpm2_clk_setup(CPM_CLK_FCC1, CPM_CLK9, CPM_CLK_RX);
+       cpm2_clk_setup(CPM_CLK_FCC1, CPM_CLK10, CPM_CLK_TX);
+}
+#endif
+
+/*
+ * Setup the architecture
+ */
+static void __init ksi8560_setup_arch(void)
+{
+       struct device_node *cpld;
+
+       cpld = of_find_compatible_node(NULL, NULL, "emerson,KSI8560-cpld");
+       if (cpld)
+               cpld_base = of_iomap(cpld, 0);
+       else
+               printk(KERN_ERR "Can't find CPLD in device tree\n");
+
+       if (ppc_md.progress)
+               ppc_md.progress("ksi8560_setup_arch()", 0);
+
+#ifdef CONFIG_CPM2
+       cpm2_reset();
+       init_ioports();
+#endif
+}
+
+static void ksi8560_show_cpuinfo(struct seq_file *m)
+{
+       uint pvid, svid, phid1;
+       uint memsize = total_memory;
+
+       pvid = mfspr(SPRN_PVR);
+       svid = mfspr(SPRN_SVR);
+
+       seq_printf(m, "Vendor\t\t: Emerson Network Power\n");
+       seq_printf(m, "Board\t\t: KSI8560\n");
+
+       if (cpld_base) {
+               seq_printf(m, "Hardware rev\t: %d\n",
+                                       in_8(cpld_base + KSI8560_CPLD_HVR));
+               seq_printf(m, "CPLD rev\t: %d\n",
+                                       in_8(cpld_base + KSI8560_CPLD_PVR));
+       } else
+               seq_printf(m, "Unknown Hardware and CPLD revs\n");
+
+       seq_printf(m, "PVR\t\t: 0x%x\n", pvid);
+       seq_printf(m, "SVR\t\t: 0x%x\n", svid);
+
+       /* Display cpu Pll setting */
+       phid1 = mfspr(SPRN_HID1);
+       seq_printf(m, "PLL setting\t: 0x%x\n", ((phid1 >> 24) & 0x3f));
+
+       /* Display the amount of memory */
+       seq_printf(m, "Memory\t\t: %d MB\n", memsize / (1024 * 1024));
+}
+
+static struct of_device_id __initdata of_bus_ids[] = {
+       { .type = "soc", },
+       { .name = "cpm", },
+       { .name = "localbus", },
+       {},
+};
+
+static int __init declare_of_platform_devices(void)
+{
+       of_platform_bus_probe(NULL, of_bus_ids, NULL);
+
+       return 0;
+}
+machine_device_initcall(ksi8560, declare_of_platform_devices);
+
+/*
+ * Called very early, device-tree isn't unflattened
+ */
+static int __init ksi8560_probe(void)
+{
+       unsigned long root = of_get_flat_dt_root();
+
+       return of_flat_dt_is_compatible(root, "emerson,KSI8560");
+}
+
+define_machine(ksi8560) {
+       .name                   = "KSI8560",
+       .probe                  = ksi8560_probe,
+       .setup_arch             = ksi8560_setup_arch,
+       .init_IRQ               = ksi8560_pic_init,
+       .show_cpuinfo           = ksi8560_show_cpuinfo,
+       .get_irq                = mpic_get_irq,
+       .restart                = machine_restart,
+       .calibrate_decr         = generic_calibrate_decr,
+};
index 4e03050961148304d9f357409bdbceeb43665cd7..3582c841844b377c76a1e55d53a4a10df6920080 100644 (file)
@@ -165,7 +165,7 @@ static void __init init_ioports(void)
        int i;
 
        for (i = 0; i < ARRAY_SIZE(mpc8560_ads_pins); i++) {
-               struct cpm_pin *pin = &mpc8560_ads_pins[i];
+               const struct cpm_pin *pin = &mpc8560_ads_pins[i];
                cpm2_set_pin(pin->port, pin->pin, pin->flags);
        }
 
index bdb3d0b38cd2789b1cde4d63f7ffcad2a9af6336..dfd8b4ad9b2854835ad27b9fe794a60b20537a81 100644 (file)
@@ -19,6 +19,7 @@
 #include <linux/delay.h>
 #include <linux/seq_file.h>
 #include <linux/interrupt.h>
+#include <linux/of_platform.h>
 
 #include <asm/system.h>
 #include <asm/time.h>
@@ -36,7 +37,7 @@
 #undef DEBUG
 
 #ifdef DEBUG
-#define DBG(fmt, args...) printk(KERN_ERR "%s: " fmt, __FUNCTION__, ## args)
+#define DBG(fmt, args...) printk(KERN_ERR "%s: " fmt, __func__, ## args)
 #else
 #define DBG(fmt, args...)
 #endif
@@ -183,6 +184,18 @@ static int __init mpc8544_ds_probe(void)
        }
 }
 
+static struct of_device_id mpc85xxds_ids[] = {
+       { .type = "soc", },
+       { .compatible = "soc", },
+       {},
+};
+
+static int __init mpc85xxds_publish_devices(void)
+{
+       return of_platform_bus_probe(NULL, mpc85xxds_ids, NULL);
+}
+machine_device_initcall(mpc8544_ds, mpc85xxds_publish_devices);
+
 /*
  * Called very early, device-tree isn't unflattened
  */
index 21d113536b86bc2a723109982f05b3c04212af83..7442c58d44f5d233a9a3dfc059a6b5af86f51523 100644 (file)
@@ -11,6 +11,12 @@ config MPC8641_HPCN
        help
          This option enables support for the MPC8641 HPCN board.
 
+config SBC8641D
+       bool "Wind River SBC8641D"
+       select DEFAULT_UIMAGE
+       help
+         This option enables support for the WRS SBC8641D board.
+
 config MPC8610_HPCD
        bool "Freescale MPC8610 HPCD"
        select DEFAULT_UIMAGE
@@ -24,7 +30,7 @@ config MPC8641
        select FSL_PCI if PCI
        select PPC_UDBG_16550
        select MPIC
-       default y if MPC8641_HPCN
+       default y if MPC8641_HPCN || SBC8641D
 
 config MPC8610
        bool
index c96706327eaa27777de9be39a163c8fe52e64546..1b9b4a9b2525cd3a7bd0ae2117d9fba50c03fb81 100644 (file)
@@ -4,4 +4,5 @@
 
 obj-$(CONFIG_SMP)              += mpc86xx_smp.o
 obj-$(CONFIG_MPC8641_HPCN)     += mpc86xx_hpcn.o
+obj-$(CONFIG_SBC8641D)         += sbc8641d.o
 obj-$(CONFIG_MPC8610_HPCD)     += mpc8610_hpcd.o
index 0b07485641feb16bedab26e59e392d2bef111d27..18b8ebe930d5b62833261ce2fa5e491a675eed5e 100644 (file)
@@ -52,7 +52,7 @@ static int __init mpc8610_declare_of_platform_devices(void)
 }
 machine_device_initcall(mpc86xx_hpcd, mpc8610_declare_of_platform_devices);
 
-void __init
+static void __init
 mpc86xx_hpcd_init_irq(void)
 {
        struct mpic *mpic1;
@@ -200,7 +200,7 @@ static int __init mpc86xx_hpcd_probe(void)
        return 0;
 }
 
-long __init
+static long __init
 mpc86xx_time_init(void)
 {
        unsigned int temp;
index cfbe8c52e26328520fc88d7e96fec7aed60897d6..f947f555fd463458d17b617bee015878a2e632f2 100644 (file)
@@ -55,7 +55,7 @@ static void mpc86xx_8259_cascade(unsigned int irq, struct irq_desc *desc)
 }
 #endif /* CONFIG_PCI */
 
-void __init
+static void __init
 mpc86xx_hpcn_init_irq(void)
 {
        struct mpic *mpic1;
@@ -162,7 +162,7 @@ mpc86xx_hpcn_setup_arch(void)
 }
 
 
-void
+static void
 mpc86xx_hpcn_show_cpuinfo(struct seq_file *m)
 {
        struct device_node *root;
@@ -190,13 +190,19 @@ static int __init mpc86xx_hpcn_probe(void)
 {
        unsigned long root = of_get_flat_dt_root();
 
-       if (of_flat_dt_is_compatible(root, "mpc86xx"))
+       if (of_flat_dt_is_compatible(root, "fsl,mpc8641hpcn"))
                return 1;       /* Looks good */
 
+       /* Be nice and don't give silent boot death.  Delete this in 2.6.27 */
+       if (of_flat_dt_is_compatible(root, "mpc86xx")) {
+               pr_warning("WARNING: your dts/dtb is old. You must update before the next kernel release\n");
+               return 1;
+       }
+
        return 0;
 }
 
-long __init
+static long __init
 mpc86xx_time_init(void)
 {
        unsigned int temp;
diff --git a/arch/powerpc/platforms/86xx/sbc8641d.c b/arch/powerpc/platforms/86xx/sbc8641d.c
new file mode 100644 (file)
index 0000000..510a06e
--- /dev/null
@@ -0,0 +1,164 @@
+/*
+ * SBC8641D board specific routines
+ *
+ * Copyright 2008 Wind River Systems Inc.
+ *
+ * By Paul Gortmaker (see MAINTAINERS for contact information)
+ *
+ * Based largely on the 8641 HPCN support by Freescale Semiconductor Inc.
+ *
+ * This program is free software; you can redistribute  it and/or modify it
+ * under  the terms of  the GNU General  Public License as published by the
+ * Free Software Foundation;  either version 2 of the  License, or (at your
+ * option) any later version.
+ */
+
+#include <linux/stddef.h>
+#include <linux/kernel.h>
+#include <linux/pci.h>
+#include <linux/kdev_t.h>
+#include <linux/delay.h>
+#include <linux/seq_file.h>
+#include <linux/of_platform.h>
+
+#include <asm/system.h>
+#include <asm/time.h>
+#include <asm/machdep.h>
+#include <asm/pci-bridge.h>
+#include <asm/mpc86xx.h>
+#include <asm/prom.h>
+#include <mm/mmu_decl.h>
+#include <asm/udbg.h>
+
+#include <asm/mpic.h>
+
+#include <sysdev/fsl_pci.h>
+#include <sysdev/fsl_soc.h>
+
+#include "mpc86xx.h"
+
+static void __init
+sbc8641_init_irq(void)
+{
+       struct mpic *mpic1;
+       struct device_node *np;
+       struct resource res;
+
+       /* Determine PIC address. */
+       np = of_find_node_by_type(NULL, "open-pic");
+       if (np == NULL)
+               return;
+       of_address_to_resource(np, 0, &res);
+
+       /* Alloc mpic structure and per isu has 16 INT entries. */
+       mpic1 = mpic_alloc(np, res.start,
+                       MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN,
+                       0, 256, " MPIC     ");
+       of_node_put(np);
+       BUG_ON(mpic1 == NULL);
+
+       mpic_init(mpic1);
+}
+
+static void __init
+sbc8641_setup_arch(void)
+{
+#ifdef CONFIG_PCI
+       struct device_node *np;
+#endif
+
+       if (ppc_md.progress)
+               ppc_md.progress("sbc8641_setup_arch()", 0);
+
+#ifdef CONFIG_PCI
+       for_each_compatible_node(np, "pci", "fsl,mpc8641-pcie")
+               fsl_add_bridge(np, 0);
+#endif
+
+       printk("SBC8641 board from Wind River\n");
+
+#ifdef CONFIG_SMP
+       mpc86xx_smp_init();
+#endif
+}
+
+
+static void
+sbc8641_show_cpuinfo(struct seq_file *m)
+{
+       struct device_node *root;
+       uint memsize = total_memory;
+       const char *model = "";
+       uint svid = mfspr(SPRN_SVR);
+
+       seq_printf(m, "Vendor\t\t: Wind River Systems\n");
+
+       root = of_find_node_by_path("/");
+       if (root)
+               model = of_get_property(root, "model", NULL);
+       seq_printf(m, "Machine\t\t: %s\n", model);
+       of_node_put(root);
+
+       seq_printf(m, "SVR\t\t: 0x%x\n", svid);
+       seq_printf(m, "Memory\t\t: %d MB\n", memsize / (1024 * 1024));
+}
+
+
+/*
+ * Called very early, device-tree isn't unflattened
+ */
+static int __init sbc8641_probe(void)
+{
+       unsigned long root = of_get_flat_dt_root();
+
+       if (of_flat_dt_is_compatible(root, "wind,sbc8641"))
+               return 1;       /* Looks good */
+
+       return 0;
+}
+
+static long __init
+mpc86xx_time_init(void)
+{
+       unsigned int temp;
+
+       /* Set the time base to zero */
+       mtspr(SPRN_TBWL, 0);
+       mtspr(SPRN_TBWU, 0);
+
+       temp = mfspr(SPRN_HID0);
+       temp |= HID0_TBEN;
+       mtspr(SPRN_HID0, temp);
+       asm volatile("isync");
+
+       return 0;
+}
+
+static __initdata struct of_device_id of_bus_ids[] = {
+       { .compatible = "simple-bus", },
+       {},
+};
+
+static int __init declare_of_platform_devices(void)
+{
+       of_platform_bus_probe(NULL, of_bus_ids, NULL);
+
+       return 0;
+}
+machine_device_initcall(sbc8641, declare_of_platform_devices);
+
+define_machine(sbc8641) {
+       .name                   = "SBC8641D",
+       .probe                  = sbc8641_probe,
+       .setup_arch             = sbc8641_setup_arch,
+       .init_IRQ               = sbc8641_init_irq,
+       .show_cpuinfo           = sbc8641_show_cpuinfo,
+       .get_irq                = mpic_get_irq,
+       .restart                = fsl_rstcr_restart,
+       .time_init              = mpc86xx_time_init,
+       .calibrate_decr         = generic_calibrate_decr,
+       .progress               = udbg_progress,
+#ifdef CONFIG_PCI
+       .pcibios_fixup_bus      = fsl_pcibios_fixup_bus,
+#endif
+};
index 7fd224ca233dab76e0f87400136e0a1f87eb3557..6fc849e51e480a5646d4db23b1b7bd2cb6a85828 100644 (file)
@@ -18,7 +18,6 @@ config MPC8XXFADS
 config MPC86XADS
        bool "MPC86XADS"
        select CPM1
-       select PPC_CPM_NEW_BINDING
        help
          MPC86x Application Development System by Freescale Semiconductor.
          The MPC86xADS is meant to serve as a platform for s/w and h/w
@@ -27,7 +26,6 @@ config MPC86XADS
 config MPC885ADS
        bool "MPC885ADS"
        select CPM1
-       select PPC_CPM_NEW_BINDING
        help
          Freescale Semiconductor MPC885 Application Development System (ADS).
          Also known as DUET.
@@ -37,7 +35,6 @@ config MPC885ADS
 config PPC_EP88XC
        bool "Embedded Planet EP88xC (a.k.a. CWH-PPC-885XN-VE)"
        select CPM1
-       select PPC_CPM_NEW_BINDING
        help
          This enables support for the Embedded Planet EP88xC board.
 
@@ -47,7 +44,6 @@ config PPC_EP88XC
 config PPC_ADDER875
        bool "Analogue & Micro Adder 875"
        select CPM1
-       select PPC_CPM_NEW_BINDING
        select REDBOOT
        help
          This enables support for the Analogue & Micro Adder 875
index 184f998d1be2e25da5f3d09c2d526683ded8741c..0d9f75c74f8cdf22e83f13ba342c45f5b12a0d66 100644 (file)
@@ -111,17 +111,12 @@ void __init mpc8xx_calibrate_decr(void)
 
        /* Processor frequency is MHz.
         */
-       ppc_tb_freq = 50000000;
-       if (!get_freq("bus-frequency", &ppc_tb_freq)) {
-               printk(KERN_ERR "WARNING: Estimating decrementer frequency "
-                               "(not found)\n");
-       }
-       ppc_tb_freq /= 16;
        ppc_proc_freq = 50000000;
        if (!get_freq("clock-frequency", &ppc_proc_freq))
                printk(KERN_ERR "WARNING: Estimating processor frequency "
                                "(not found)\n");
 
+       ppc_tb_freq = ppc_proc_freq / 16;
        printk("Decrementer Frequency = 0x%lx\n", ppc_tb_freq);
 
        /* Perform some more timer/timebase initialization.  This used
index a578b966ecbc1da6452ff0160f07e5e0349d80eb..f38c50b4ce56ab4d609488fcc0644800a3001313 100644 (file)
@@ -290,13 +290,7 @@ config CPM2
 config PPC_CPM_NEW_BINDING
        bool
        depends on CPM1 || CPM2
-       help
-         Select this if your board has been converted to use the new
-         device tree bindings for CPM, and no longer needs the
-         ioport callbacks or the platform device glue code.
-
-         The fs_enet and cpm_uart drivers will be built as
-         of_platform devices.
+       default y
 
 config AXON_RAM
        tristate "Axon DDR2 memory device driver"
index 0c3face0ddbb4d78010e1efcbd12569e8343e25c..5fc7fac10e938515c24c6cb157a6944b746ccf2b 100644 (file)
@@ -41,11 +41,13 @@ config 40x
        bool "AMCC 40x"
        select PPC_DCR_NATIVE
        select PPC_UDBG_16550
+       select 4xx_SOC
 
 config 44x
        bool "AMCC 44x"
        select PPC_DCR_NATIVE
        select PPC_UDBG_16550
+       select 4xx_SOC
 
 config E200
        bool "Freescale e200"
index d75ccded7f104b7e4f7d00577fa4aed26ce7659d..45646b2b4af468b794931548f922bf435f0975df 100644 (file)
 #include <linux/notifier.h>
 #include <linux/of.h>
 #include <linux/of_platform.h>
+#include <linux/lmb.h>
 
 #include <asm/prom.h>
 #include <asm/iommu.h>
 #include <asm/machdep.h>
 #include <asm/pci-bridge.h>
 #include <asm/udbg.h>
-#include <asm/lmb.h>
 #include <asm/firmware.h>
 #include <asm/cell-regs.h>
 
@@ -316,7 +316,7 @@ static void cell_iommu_setup_stab(struct cbe_iommu *iommu,
        segments = max(dbase + dsize, fbase + fsize) >> IO_SEGMENT_SHIFT;
 
        pr_debug("%s: iommu[%d]: segments: %lu\n",
-                       __FUNCTION__, iommu->nid, segments);
+                       __func__, iommu->nid, segments);
 
        /* set up the segment table */
        stab_size = segments * sizeof(unsigned long);
@@ -343,7 +343,7 @@ static unsigned long *cell_iommu_alloc_ptab(struct cbe_iommu *iommu,
                                (1 << 12) / sizeof(unsigned long));
 
        ptab_size = segments * pages_per_segment * sizeof(unsigned long);
-       pr_debug("%s: iommu[%d]: ptab_size: %lu, order: %d\n", __FUNCTION__,
+       pr_debug("%s: iommu[%d]: ptab_size: %lu, order: %d\n", __func__,
                        iommu->nid, ptab_size, get_order(ptab_size));
        page = alloc_pages_node(iommu->nid, GFP_KERNEL, get_order(ptab_size));
        BUG_ON(!page);
@@ -355,7 +355,7 @@ static unsigned long *cell_iommu_alloc_ptab(struct cbe_iommu *iommu,
        n_pte_pages = (pages_per_segment * sizeof(unsigned long)) >> 12;
 
        pr_debug("%s: iommu[%d]: stab at %p, ptab at %p, n_pte_pages: %lu\n",
-                       __FUNCTION__, iommu->nid, iommu->stab, ptab,
+                       __func__, iommu->nid, iommu->stab, ptab,
                        n_pte_pages);
 
        /* initialise the STEs */
@@ -394,7 +394,7 @@ static void cell_iommu_enable_hardware(struct cbe_iommu *iommu)
 
        if (cell_iommu_find_ioc(iommu->nid, &xlate_base))
                panic("%s: missing IOC register mappings for node %d\n",
-                     __FUNCTION__, iommu->nid);
+                     __func__, iommu->nid);
 
        iommu->xlate_regs = ioremap(xlate_base, IOC_Reg_Size);
        iommu->cmd_regs = iommu->xlate_regs + IOC_IOCmd_Offset;
index 0304589c0a80550e07be726c6557538f7ee8ae03..8a3631ce912ba52782640bd41b41e7f20e8c56f6 100644 (file)
@@ -65,7 +65,7 @@ static void cbe_power_save(void)
                break;
        default:
                printk(KERN_WARNING "%s: unknown configuration\n",
-                       __FUNCTION__);
+                       __func__);
                break;
        }
        mtspr(SPRN_TSC_CELL, thread_switch_control);
index e43024c0392e2802ced8f5a5af9c8695f25891d8..655704ad03cf84d3e2a21eeb927e20ea87a836bc 100644 (file)
@@ -132,7 +132,7 @@ static int __init cbe_ptcal_enable_on_node(int nid, int order)
                                (unsigned int)(addr >> 32),
                                (unsigned int)(addr & 0xffffffff))) {
                printk(KERN_ERR "%s: error enabling PTCAL on node %d!\n",
-                               __FUNCTION__, nid);
+                               __func__, nid);
                goto out_free_pages;
        }
 
@@ -162,7 +162,7 @@ static int __init cbe_ptcal_enable(void)
        if (!size)
                return -ENODEV;
 
-       pr_debug("%s: enabling PTCAL, size = 0x%x\n", __FUNCTION__, *size);
+       pr_debug("%s: enabling PTCAL, size = 0x%x\n", __func__, *size);
        order = get_order(*size);
        of_node_put(np);
 
@@ -180,7 +180,7 @@ static int __init cbe_ptcal_enable(void)
                const u32 *nid = of_get_property(np, "node-id", NULL);
                if (!nid) {
                        printk(KERN_ERR "%s: node %s is missing node-id?\n",
-                                       __FUNCTION__, np->full_name);
+                                       __func__, np->full_name);
                        continue;
                }
                cbe_ptcal_enable_on_node(*nid, order);
@@ -195,13 +195,13 @@ static int cbe_ptcal_disable(void)
        struct ptcal_area *area, *tmp;
        int ret = 0;
 
-       pr_debug("%s: disabling PTCAL\n", __FUNCTION__);
+       pr_debug("%s: disabling PTCAL\n", __func__);
 
        list_for_each_entry_safe(area, tmp, &ptcal_list, list) {
                /* disable ptcal on this node */
                if (rtas_call(ptcal_stop_tok, 1, 1, NULL, area->nid)) {
                        printk(KERN_ERR "%s: error disabling PTCAL "
-                                       "on node %d!\n", __FUNCTION__,
+                                       "on node %d!\n", __func__,
                                        area->nid);
                        ret = -EIO;
                        continue;
index 712001f6b7dad366cd1b2ab78107811cf6f485fb..6bab44b7716b2d525bff0720c0c6a0f436a55acb 100644 (file)
@@ -165,7 +165,7 @@ static int __spu_trap_data_seg(struct spu *spu, unsigned long ea)
        struct spu_slb slb;
        int psize;
 
-       pr_debug("%s\n", __FUNCTION__);
+       pr_debug("%s\n", __func__);
 
        slb.esid = (ea & ESID_MASK) | SLB_ESID_V;
 
@@ -215,7 +215,7 @@ static int __spu_trap_data_seg(struct spu *spu, unsigned long ea)
 extern int hash_page(unsigned long ea, unsigned long access, unsigned long trap); //XXX
 static int __spu_trap_data_map(struct spu *spu, unsigned long ea, u64 dsisr)
 {
-       pr_debug("%s, %lx, %lx\n", __FUNCTION__, dsisr, ea);
+       pr_debug("%s, %lx, %lx\n", __func__, dsisr, ea);
 
        /* Handle kernel space hash faults immediately.
           User hash faults need to be deferred to process context. */
@@ -351,7 +351,7 @@ spu_irq_class_1(int irq, void *data)
                __spu_trap_data_seg(spu, dar);
 
        spin_unlock(&spu->register_lock);
-       pr_debug("%s: %lx %lx %lx %lx\n", __FUNCTION__, mask, stat,
+       pr_debug("%s: %lx %lx %lx %lx\n", __func__, mask, stat,
                        dar, dsisr);
 
        if (stat & CLASS1_STORAGE_FAULT_INTR)
@@ -726,7 +726,7 @@ static int __init init_spu_base(void)
 
        if (ret < 0) {
                printk(KERN_WARNING "%s: Error initializing spus\n",
-                       __FUNCTION__);
+                       __func__);
                goto out_unregister_sysdev_class;
        }
 
index dceb8b6a9382e9ac1a65f1987f9953c087df81d1..19f6bfdbb933b889771c952700e46ae3e48960d2 100644 (file)
@@ -54,7 +54,7 @@ long spu_sys_callback(struct spu_syscall_block *s)
        long (*syscall)(u64 a1, u64 a2, u64 a3, u64 a4, u64 a5, u64 a6);
 
        if (s->nr_ret >= ARRAY_SIZE(spu_syscall_table)) {
-               pr_debug("%s: invalid syscall #%ld", __FUNCTION__, s->nr_ret);
+               pr_debug("%s: invalid syscall #%ld", __func__, s->nr_ret);
                return -ENOSYS;
        }
 
index d351bdebf5f1e350c8144855b41c37e4545c6d83..4c506c1463cd28a1bc5c8e3604f0738ea36df688 100644 (file)
@@ -92,7 +92,7 @@ static int __init spu_map_interrupts_old(struct spu *spu,
 
        tmp = of_get_property(np->parent->parent, "node-id", NULL);
        if (!tmp) {
-               printk(KERN_WARNING "%s: can't find node-id\n", __FUNCTION__);
+               printk(KERN_WARNING "%s: can't find node-id\n", __func__);
                nid = spu->node;
        } else
                nid = tmp[0];
@@ -296,7 +296,7 @@ static int __init of_enumerate_spus(int (*fn)(void *data))
                ret = fn(node);
                if (ret) {
                        printk(KERN_WARNING "%s: Error initializing %s\n",
-                               __FUNCTION__, node->name);
+                               __func__, node->name);
                        break;
                }
                n++;
@@ -327,7 +327,7 @@ static int __init of_create_spu(struct spu *spu, void *data)
                if (!legacy_map) {
                        legacy_map = 1;
                        printk(KERN_WARNING "%s: Legacy device tree found, "
-                               "trying to map old style\n", __FUNCTION__);
+                               "trying to map old style\n", __func__);
                }
                ret = spu_map_device_old(spu);
                if (ret) {
@@ -342,7 +342,7 @@ static int __init of_create_spu(struct spu *spu, void *data)
                if (!legacy_irq) {
                        legacy_irq = 1;
                        printk(KERN_WARNING "%s: Legacy device tree found, "
-                               "trying old style irq\n", __FUNCTION__);
+                               "trying old style irq\n", __func__);
                }
                ret = spu_map_interrupts_old(spu, spe);
                if (ret) {
index 0c6a96b82b2db9d22bfcd49c0e5df08a182e15f4..b962c3ab470cbe01f2f5a5d6e510866bd8a60e5a 100644 (file)
@@ -133,8 +133,6 @@ static struct spu_context *coredump_next_context(int *fd)
                if (ctx->flags & SPU_CREATE_NOSCHED)
                        continue;
 
-               /* start searching the next fd next time we're called */
-               (*fd)++;
                break;
        }
 
@@ -157,6 +155,9 @@ int spufs_coredump_extra_notes_size(void)
                        break;
 
                size += rc;
+
+               /* start searching the next fd next time */
+               fd++;
        }
 
        return size;
@@ -239,6 +240,9 @@ int spufs_coredump_extra_notes_write(struct file *file, loff_t *foffset)
                }
 
                spu_release_saved(ctx);
+
+               /* start searching the next fd next time */
+               fd++;
        }
 
        return 0;
index f7a7e8635fb6f98d11ab8aa5bf5cf3d2d6f49bf8..08f44d1971ac42cd952f055c6d9f4c96779c5883 100644 (file)
@@ -32,7 +32,6 @@
 #include <linux/marker.h>
 
 #include <asm/io.h>
-#include <asm/semaphore.h>
 #include <asm/spu.h>
 #include <asm/spu_info.h>
 #include <asm/uaccess.h>
@@ -1337,7 +1336,7 @@ static u64 spufs_signal1_type_get(struct spu_context *ctx)
        return ctx->ops->signal1_type_get(ctx);
 }
 DEFINE_SPUFS_ATTRIBUTE(spufs_signal1_type, spufs_signal1_type_get,
-                      spufs_signal1_type_set, "%llu", SPU_ATTR_ACQUIRE);
+                      spufs_signal1_type_set, "%llu\n", SPU_ATTR_ACQUIRE);
 
 
 static int spufs_signal2_type_set(void *data, u64 val)
@@ -1359,7 +1358,7 @@ static u64 spufs_signal2_type_get(struct spu_context *ctx)
        return ctx->ops->signal2_type_get(ctx);
 }
 DEFINE_SPUFS_ATTRIBUTE(spufs_signal2_type, spufs_signal2_type_get,
-                      spufs_signal2_type_set, "%llu", SPU_ATTR_ACQUIRE);
+                      spufs_signal2_type_set, "%llu\n", SPU_ATTR_ACQUIRE);
 
 #if SPUFS_MMAP_4K
 static unsigned long spufs_mss_mmap_nopfn(struct vm_area_struct *vma,
@@ -1556,7 +1555,7 @@ void spufs_mfc_callback(struct spu *spu)
 
        wake_up_all(&ctx->mfc_wq);
 
-       pr_debug("%s %s\n", __FUNCTION__, spu->name);
+       pr_debug("%s %s\n", __func__, spu->name);
        if (ctx->mfc_fasync) {
                u32 free_elements, tagstatus;
                unsigned int mask;
@@ -1790,7 +1789,7 @@ static unsigned int spufs_mfc_poll(struct file *file,poll_table *wait)
        if (tagstatus & ctx->tagwait)
                mask |= POLLIN | POLLRDNORM;
 
-       pr_debug("%s: free %d tagstatus %d tagwait %d\n", __FUNCTION__,
+       pr_debug("%s: free %d tagstatus %d tagwait %d\n", __func__,
                free_elements, tagstatus, ctx->tagwait);
 
        return mask;
index 6d1228c66c5e59bbff35e1abcc75b94f23e0740d..0c32a05ab068a1487485d8871ce26a847d50a784 100644 (file)
@@ -35,7 +35,6 @@
 #include <linux/parser.h>
 
 #include <asm/prom.h>
-#include <asm/semaphore.h>
 #include <asm/spu.h>
 #include <asm/spu_priv1.h>
 #include <asm/uaccess.h>
index cac69e116776bd6bc5e91553057b3f2e4526ac79..96bf7c2b86fcf61ca6d241e9d222853ed7ba883b 100644 (file)
@@ -98,7 +98,7 @@ static int spu_setup_isolated(struct spu_context *ctx)
                        != MFC_CNTL_PURGE_DMA_COMPLETE) {
                if (time_after(jiffies, timeout)) {
                        printk(KERN_ERR "%s: timeout flushing MFC DMA queue\n",
-                                       __FUNCTION__);
+                                       __func__);
                        ret = -EIO;
                        goto out;
                }
@@ -124,7 +124,7 @@ static int spu_setup_isolated(struct spu_context *ctx)
                                status_loading) {
                if (time_after(jiffies, timeout)) {
                        printk(KERN_ERR "%s: timeout waiting for loader\n",
-                                       __FUNCTION__);
+                                       __func__);
                        ret = -EIO;
                        goto out_drop_priv;
                }
@@ -134,7 +134,7 @@ static int spu_setup_isolated(struct spu_context *ctx)
        if (!(status & SPU_STATUS_RUNNING)) {
                /* If isolated LOAD has failed: run SPU, we will get a stop-and
                 * signal later. */
-               pr_debug("%s: isolated LOAD failed\n", __FUNCTION__);
+               pr_debug("%s: isolated LOAD failed\n", __func__);
                ctx->ops->runcntl_write(ctx, SPU_RUNCNTL_RUNNABLE);
                ret = -EACCES;
                goto out_drop_priv;
@@ -142,7 +142,7 @@ static int spu_setup_isolated(struct spu_context *ctx)
 
        if (!(status & SPU_STATUS_ISOLATED_STATE)) {
                /* This isn't allowed by the CBEA, but check anyway */
-               pr_debug("%s: SPU fell out of isolated mode?\n", __FUNCTION__);
+               pr_debug("%s: SPU fell out of isolated mode?\n", __func__);
                ctx->ops->runcntl_write(ctx, SPU_RUNCNTL_STOP);
                ret = -EINVAL;
                goto out_drop_priv;
@@ -282,7 +282,7 @@ static int spu_handle_restartsys(struct spu_context *ctx, long *spu_ret,
                break;
        default:
                printk(KERN_WARNING "%s: unexpected return code %ld\n",
-                       __FUNCTION__, *spu_ret);
+                       __func__, *spu_ret);
                ret = 0;
        }
        return ret;
@@ -323,6 +323,10 @@ static int spu_process_callback(struct spu_context *ctx)
                        return -EINTR;
        }
 
+       /* need to re-get the ls, as it may have changed when we released the
+        * spu */
+       ls = (void __iomem *)ctx->ops->get_ls(ctx);
+
        /* write result, jump over indirect pointer */
        memcpy_toio(ls + ls_pointer, &spu_ret, sizeof(spu_ret));
        ctx->ops->npc_write(ctx, npc);
index e9dc7a55d1b9466d5f5e5597371a79789b46ed30..d2a1249d36dd2a7bc018727e09c3b7c57b88cf1c 100644 (file)
@@ -1815,6 +1815,7 @@ static void save_csa(struct spu_state *prev, struct spu *spu)
        save_mfc_csr_ato(prev, spu);    /* Step 24. */
        save_mfc_tclass_id(prev, spu);  /* Step 25. */
        set_mfc_tclass_id(prev, spu);   /* Step 26. */
+       save_mfc_cmd(prev, spu);        /* Step 26a - moved from 44. */
        purge_mfc_queue(prev, spu);     /* Step 27. */
        wait_purge_complete(prev, spu); /* Step 28. */
        setup_mfc_sr1(prev, spu);       /* Step 30. */
@@ -1831,7 +1832,6 @@ static void save_csa(struct spu_state *prev, struct spu *spu)
        save_ppuint_mb(prev, spu);      /* Step 41. */
        save_ch_part1(prev, spu);       /* Step 42. */
        save_spu_mb(prev, spu);         /* Step 43. */
-       save_mfc_cmd(prev, spu);        /* Step 44. */
        reset_ch(prev, spu);            /* Step 45. */
 }
 
index 93ebb7d85120fe7172f83c67e717410b61f92fdd..b64b171f245b513e57ca5d7174c05384aecccf30 100644 (file)
@@ -48,6 +48,7 @@ void beat_power_off(void)
 }
 
 u64 beat_halt_code = 0x1000000000000000UL;
+EXPORT_SYMBOL(beat_halt_code);
 
 void beat_halt(void)
 {
@@ -94,9 +95,8 @@ ssize_t beat_nvram_read(char *buf, size_t count, loff_t *index)
                len = count;
                if (len > BEAT_NVRW_CNT)
                        len = BEAT_NVRW_CNT;
-               if (beat_eeprom_read(i, len, p)) {
+               if (beat_eeprom_read(i, len, p))
                        return -EIO;
-               }
 
                p += len;
                i += len;
@@ -121,9 +121,8 @@ ssize_t beat_nvram_write(char *buf, size_t count, loff_t *index)
                len = count;
                if (len > BEAT_NVRW_CNT)
                        len = BEAT_NVRW_CNT;
-               if (beat_eeprom_write(i, len, p)) {
+               if (beat_eeprom_write(i, len, p))
                        return -EIO;
-               }
 
                p += len;
                i += len;
@@ -149,13 +148,14 @@ int64_t beat_get_term_char(u64 vterm, u64 *len, u64 *t1, u64 *t2)
        u64 db[2];
        s64 ret;
 
-       ret = beat_get_characters_from_console(vterm, len, (u8*)db);
+       ret = beat_get_characters_from_console(vterm, len, (u8 *)db);
        if (ret == 0) {
                *t1 = db[0];
                *t2 = db[1];
        }
        return ret;
 }
+EXPORT_SYMBOL(beat_get_term_char);
 
 int64_t beat_put_term_char(u64 vterm, u64 len, u64 t1, u64 t2)
 {
@@ -163,8 +163,9 @@ int64_t beat_put_term_char(u64 vterm, u64 len, u64 t1, u64 t2)
 
        db[0] = t1;
        db[1] = t2;
-       return beat_put_characters_to_console(vterm, len, (u8*)db);
+       return beat_put_characters_to_console(vterm, len, (u8 *)db);
 }
+EXPORT_SYMBOL(beat_put_term_char);
 
 void beat_power_save(void)
 {
@@ -261,7 +262,3 @@ static int __init beat_event_init(void)
 }
 
 device_initcall(beat_event_init);
-
-EXPORT_SYMBOL(beat_get_term_char);
-EXPORT_SYMBOL(beat_put_term_char);
-EXPORT_SYMBOL(beat_halt_code);
index ac82ac35b9918a98bff6ec5d4fcc8918e5796689..32c8efcedc8091ed673592456a2249d73dbd3c83 100644 (file)
@@ -21,8 +21,8 @@
 #ifndef _CELLEB_BEAT_H
 #define _CELLEB_BEAT_H
 
-int64_t beat_get_term_char(uint64_t,uint64_t*,uint64_t*,uint64_t*);
-int64_t beat_put_term_char(uint64_t,uint64_t,uint64_t,uint64_t);
+int64_t beat_get_term_char(uint64_t, uint64_t *, uint64_t *, uint64_t *);
+int64_t beat_put_term_char(uint64_t, uint64_t, uint64_t, uint64_t);
 int64_t beat_repository_encode(int, const char *, uint64_t[4]);
 void beat_restart(char *);
 void beat_power_off(void);
index cbc1487df7def6cbb44d62d29462757eae35163f..b47dfda48d0672442b212d41dd93cbaa0833e437 100644 (file)
@@ -197,7 +197,8 @@ static inline s64 beat_put_characters_to_console(u64 termno, u64 len,
        u64 b[2];
 
        memcpy(b, buffer, len);
-       return beat_hcall_norets(HV_put_characters_to_console, termno, len,                                      b[0], b[1]);
+       return beat_hcall_norets(HV_put_characters_to_console, termno, len,
+               b[0], b[1]);
 }
 
 static inline s64 beat_get_spe_privileged_state_1_registers(
index fbf27c74ebda04c3b0cfecd8bebfd322836699ce..81467ff055c8313152862f02eb8d828d3f349951 100644 (file)
@@ -35,9 +35,9 @@
 #include "beat_wrapper.h"
 
 #ifdef DEBUG_LOW
-#define DBG_LOW(fmt...) do { udbg_printf(fmt); } while(0)
+#define DBG_LOW(fmt...) do { udbg_printf(fmt); } while (0)
 #else
-#define DBG_LOW(fmt...) do { } while(0)
+#define DBG_LOW(fmt...) do { } while (0)
 #endif
 
 static DEFINE_SPINLOCK(beat_htab_lock);
@@ -116,7 +116,8 @@ static long beat_lpar_hpte_insert(unsigned long hpte_group,
                hpte_r &= ~_PAGE_COHERENT;
 
        spin_lock(&beat_htab_lock);
-       if ((lpar_rc = beat_read_mask(hpte_group)) == 0) {
+       lpar_rc = beat_read_mask(hpte_group);
+       if (lpar_rc == 0) {
                if (!(vflags & HPTE_V_BOLTED))
                        DBG_LOW(" full\n");
                spin_unlock(&beat_htab_lock);
index c7c68ca70c82a321b3eaba1175ab0cb22a12eb8d..69562a867876ebd54dbdd7e3f4ac85f2b34fd377 100644 (file)
@@ -34,7 +34,7 @@ static DEFINE_SPINLOCK(beatic_irq_mask_lock);
 static uint64_t        beatic_irq_mask_enable[(MAX_IRQS+255)/64];
 static uint64_t        beatic_irq_mask_ack[(MAX_IRQS+255)/64];
 
-static struct irq_host *beatic_host = NULL;
+static struct irq_host *beatic_host;
 
 /*
  * In this implementation, "virq" == "IRQ plug number",
@@ -49,13 +49,13 @@ static inline void beatic_update_irq_mask(unsigned int irq_plug)
 
        off = (irq_plug / 256) * 4;
        masks[0] = beatic_irq_mask_enable[off + 0]
-                  & beatic_irq_mask_ack[off + 0];
+               & beatic_irq_mask_ack[off + 0];
        masks[1] = beatic_irq_mask_enable[off + 1]
-                  & beatic_irq_mask_ack[off + 1];
+               & beatic_irq_mask_ack[off + 1];
        masks[2] = beatic_irq_mask_enable[off + 2]
-                  & beatic_irq_mask_ack[off + 2];
+               & beatic_irq_mask_ack[off + 2];
        masks[3] = beatic_irq_mask_enable[off + 3]
-                  & beatic_irq_mask_ack[off + 3];
+               & beatic_irq_mask_ack[off + 3];
        if (beat_set_interrupt_mask(irq_plug&~255UL,
                masks[0], masks[1], masks[2], masks[3]) != 0)
                panic("Failed to set mask IRQ!");
@@ -96,7 +96,8 @@ static void beatic_end_irq(unsigned int irq_plug)
        s64 err;
        unsigned long flags;
 
-       if ((err = beat_downcount_of_interrupt(irq_plug)) != 0) {
+       err = beat_downcount_of_interrupt(irq_plug);
+       if (err != 0) {
                if ((err & 0xFFFFFFFF) != 0xFFFFFFF5) /* -11: wrong state */
                        panic("Failed to downcount IRQ! Error = %16lx", err);
 
@@ -138,7 +139,8 @@ static int beatic_pic_host_map(struct irq_host *h, unsigned int virq,
        struct irq_desc *desc = get_irq_desc(virq);
        int64_t err;
 
-       if ((err = beat_construct_and_connect_irq_plug(virq, hw)) < 0)
+       err = beat_construct_and_connect_irq_plug(virq, hw);
+       if (err < 0)
                return -EIO;
 
        desc->status |= IRQ_LEVEL;
@@ -202,22 +204,22 @@ static inline unsigned int beatic_get_irq_plug(void)
                beat_detect_pending_interrupts(i, pending);
                __asm__ ("cntlzd %0,%1":"=r"(ub):
                        "r"(pending[0] & beatic_irq_mask_enable[i/64+0]
-                                      & beatic_irq_mask_ack[i/64+0]));
+                                      & beatic_irq_mask_ack[i/64+0]));
                if (ub != 64)
                        return i + ub + 0;
                __asm__ ("cntlzd %0,%1":"=r"(ub):
                        "r"(pending[1] & beatic_irq_mask_enable[i/64+1]
-                                      & beatic_irq_mask_ack[i/64+1]));
+                                      & beatic_irq_mask_ack[i/64+1]));
                if (ub != 64)
                        return i + ub + 64;
                __asm__ ("cntlzd %0,%1":"=r"(ub):
                        "r"(pending[2] & beatic_irq_mask_enable[i/64+2]
-                                      & beatic_irq_mask_ack[i/64+2]));
+                                      & beatic_irq_mask_ack[i/64+2]));
                if (ub != 64)
                        return i + ub + 128;
                __asm__ ("cntlzd %0,%1":"=r"(ub):
                        "r"(pending[3] & beatic_irq_mask_enable[i/64+3]
-                                      & beatic_irq_mask_ack[i/64+3]));
+                                      & beatic_irq_mask_ack[i/64+3]));
                if (ub != 64)
                        return i + ub + 192;
        }
@@ -250,7 +252,7 @@ void __init beatic_init_IRQ(void)
 
        /* Allocate an irq host */
        beatic_host = irq_alloc_host(NULL, IRQ_HOST_MAP_NOMAP, 0,
-                                        &beatic_pic_host_ops,
+                                    &beatic_pic_host_ops,
                                         0);
        BUG_ON(beatic_host == NULL);
        irq_set_default_host(beatic_host);
index a3c7cfbcb323049da70590529d8e20dea251fda5..a999b393f6f6e81a0f2e72a2e52cbad49aa7d4bb 100644 (file)
@@ -161,9 +161,9 @@ static PCI_IO_ADDR celleb_epci_make_config_addr(
        if (bus != hose->bus)
                addr = celleb_epci_get_epci_cfg(hose) +
                       (((bus->number & 0xff) << 16)
-                       | ((devfn & 0xff) << 8)
-                       | (where & 0xff)
-                       | 0x01000000);
+                       | ((devfn & 0xff) << 8)
+                       | (where & 0xff)
+                       | 0x01000000);
        else
                addr = celleb_epci_get_epci_cfg(hose) +
                       (((devfn & 0xff) << 8) | (where & 0xff));
@@ -174,7 +174,7 @@ static PCI_IO_ADDR celleb_epci_make_config_addr(
 }
 
 static int celleb_epci_read_config(struct pci_bus *bus,
-                       unsigned int devfn, int where, int size, u32 * val)
+                       unsigned int devfn, int where, int size, u32 *val)
 {
        PCI_IO_ADDR epci_base;
        PCI_IO_ADDR addr;
index 610008211ca1018e8ad882fd9b3abd85a30c1233..3a16c5b3c46449fed01aa4db4678b25d902a7540 100644 (file)
@@ -28,7 +28,7 @@
 
 /* sio irq0=0xb00010022 irq0=0xb00010023 irq2=0xb00010024
     mmio=0xfff000-0x1000,0xff2000-0x1000 */
-static int txx9_serial_bitmap __initdata = 0;
+static int txx9_serial_bitmap __initdata;
 
 static struct {
        uint32_t offset;
@@ -84,7 +84,7 @@ static int __init txx9_serial_config(char *ptr)
        int     i;
 
        for (;;) {
-               switch(get_option(&ptr, &i)) {
+               switch (get_option(&ptr, &i)) {
                default:
                        return 0;
                case 2:
index 2bf6700f747a006f63f53e52f4fe3f37f1df7207..bcc17f7fe8adfaba96ba7763ae675af31fb27c15 100644 (file)
@@ -183,8 +183,7 @@ static u64 resource_allocation_enable_get(struct spu *spu)
        return enable;
 }
 
-const struct spu_priv1_ops spu_priv1_beat_ops =
-{
+const struct spu_priv1_ops spu_priv1_beat_ops = {
        .int_mask_and = int_mask_and,
        .int_mask_or = int_mask_or,
        .int_mask_set = int_mask_set,
index d888c4674c62d7c495933632dbbae5cf9ddd33d4..6b418f6b61750ec6f94e8f4fc89606696f6ab1f9 100644 (file)
@@ -54,7 +54,8 @@ static int udbg_getc_poll_beat(void)
        if (inbuflen == 0) {
                /* get some more chars. */
                inbuflen = 0;
-               rc = beat_get_term_char(celleb_vtermno, &inbuflen, inbuf+0, inbuf+1);
+               rc = beat_get_term_char(celleb_vtermno, &inbuflen,
+                                       inbuf+0, inbuf+1);
                if (rc != 0)
                        inbuflen = 0;   /* otherwise inbuflen is garbage */
        }
@@ -78,7 +79,7 @@ static int udbg_getc_beat(void)
                if (ch == -1) {
                        /* This shouldn't be needed...but... */
                        volatile unsigned long delay;
-                       for (delay=0; delay < 2000000; delay++)
+                       for (delay = 0; delay < 2000000; delay++)
                                ;
                } else {
                        return ch;
index d4f8bf581e3a5facf1bdfa9dd736fc1dad3f08db..84e2d78b9a627020848a9b1c8264b8a06d0c4b47 100644 (file)
@@ -117,11 +117,11 @@ static void __init mpc7448_hpc2_init_IRQ(void)
        }
 
        if (mpic_paddr == 0) {
-               printk("%s: No tsi108 PIC found !\n", __FUNCTION__);
+               printk("%s: No tsi108 PIC found !\n", __func__);
                return;
        }
 
-       DBG("%s: tsi108 pic phys_addr = 0x%x\n", __FUNCTION__,
+       DBG("%s: tsi108 pic phys_addr = 0x%x\n", __func__,
            (u32) mpic_paddr);
 
        mpic = mpic_alloc(tsi_pic, mpic_paddr,
@@ -140,17 +140,17 @@ static void __init mpc7448_hpc2_init_IRQ(void)
 #ifdef CONFIG_PCI
        tsi_pci = of_find_node_by_type(NULL, "pci");
        if (tsi_pci == NULL) {
-               printk("%s: No tsi108 pci node found !\n", __FUNCTION__);
+               printk("%s: No tsi108 pci node found !\n", __func__);
                return;
        }
        cascade_node = of_find_node_by_type(NULL, "pic-router");
        if (cascade_node == NULL) {
-               printk("%s: No tsi108 pci cascade node found !\n", __FUNCTION__);
+               printk("%s: No tsi108 pci cascade node found !\n", __func__);
                return;
        }
 
        cascade_pci_irq = irq_of_parse_and_map(tsi_pci, 0);
-       DBG("%s: tsi108 cascade_pci_irq = 0x%x\n", __FUNCTION__,
+       DBG("%s: tsi108 cascade_pci_irq = 0x%x\n", __func__,
            (u32) cascade_pci_irq);
        tsi108_pci_int_init(cascade_node);
        set_irq_data(cascade_pci_irq, mpic);
index 653a5eb91c905049610d7168044c26da5f9e642e..5a19b9a1457ca3829070faae3d29786fdc0a7067 100644 (file)
@@ -49,13 +49,13 @@ static void __init prpmc2800_setup_arch(void)
         * ioremap mpp and gpp registers in case they are later
         * needed by prpmc2800_reset_board().
         */
-       np = of_find_compatible_node(NULL, NULL, "marvell,mv64x60-mpp");
+       np = of_find_compatible_node(NULL, NULL, "marvell,mv64360-mpp");
        reg = of_get_property(np, "reg", NULL);
        paddr = of_translate_address(np, reg);
        of_node_put(np);
        mv64x60_mpp_reg_base = ioremap(paddr, reg[1]);
 
-       np = of_find_compatible_node(NULL, NULL, "marvell,mv64x60-gpp");
+       np = of_find_compatible_node(NULL, NULL, "marvell,mv64360-gpp");
        reg = of_get_property(np, "reg", NULL);
        paddr = of_translate_address(np, reg);
        of_node_put(np);
index 5381038f088141c7c4ecd972369c463dc7d393d6..c775cd4b3d6eee44f9b5dc44ed80a309e80ed5f7 100644 (file)
 
        .globl system_reset_iSeries
 system_reset_iSeries:
-       mfspr   r13,SPRN_SPRG3          /* Get paca address */
+       mfspr   r13,SPRN_SPRG3          /* Get alpaca address */
+       LOAD_REG_IMMEDIATE(r23, alpaca)
+       li      r0,ALPACA_SIZE
+       sub     r23,r13,r23
+       divdu   r23,r23,r0              /* r23 has cpu number */
+       LOAD_REG_IMMEDIATE(r13, paca)
+       mulli   r0,r23,PACA_SIZE
+       add     r13,r13,r0
+       mtspr   SPRN_SPRG3,r13          /* Save it away for the future */
        mfmsr   r24
        ori     r24,r24,MSR_RI
        mtmsrd  r24                     /* RI on */
-       lhz     r24,PACAPACAINDEX(r13)  /* Get processor # */
+       mr      r24,r23
        cmpwi   0,r24,0                 /* Are we processor 0? */
        bne     1f
        b       .__start_initialization_iSeries /* Start up the first processor */
index 77c135ddbf1b8e5135c66735a28734205a69b15c..83e4ca42fc575a2c6e73cf1d07860f881f6a90e8 100644 (file)
@@ -65,6 +65,4 @@ struct ItIplParmsReal {
        u64     xRsvd13;                // Reserved                     x38-x3F
 };
 
-extern struct ItIplParmsReal   xItIplParmsReal;
-
 #endif /* _ISERIES_IPL_PARMS_H */
index 8162049bb04dc49a3062f059585f6bd975e7bd98..98bd2d37038ad57475d0c6e14a5069bef66e801d 100644 (file)
 #include <asm/ptrace.h>
 #include <asm/abs_addr.h>
 #include <asm/lppaca.h>
-#include <asm/iseries/it_lp_reg_save.h>
 #include <asm/paca.h>
 #include <asm/iseries/lpar_map.h>
 #include <asm/iseries/it_lp_queue.h>
+#include <asm/iseries/alpaca.h>
 
 #include "naca.h"
 #include "vpd_areas.h"
@@ -31,7 +31,7 @@
 /* The HvReleaseData is the root of the information shared between
  * the hypervisor and Linux.
  */
-struct HvReleaseData hvReleaseData = {
+const struct HvReleaseData hvReleaseData = {
        .xDesc = 0xc8a5d9c4,    /* "HvRD" ebcdic */
        .xSize = sizeof(struct HvReleaseData),
        .xVpdAreasPtrOffset = offsetof(struct naca_struct, xItVpdAreas),
@@ -61,6 +61,63 @@ struct naca_struct naca = {
        .xRamDiskSize = 0,
 };
 
+struct ItLpRegSave {
+       u32     xDesc;          // Eye catcher  "LpRS" ebcdic   000-003
+       u16     xSize;          // Size of this class           004-005
+       u8      xInUse;         // Area is live                 006-007
+       u8      xRsvd1[9];      // Reserved                     007-00F
+
+       u8      xFixedRegSave[352]; // Fixed Register Save Area 010-16F
+       u32     xCTRL;          // Control Register             170-173
+       u32     xDEC;           // Decrementer                  174-177
+       u32     xFPSCR;         // FP Status and Control Reg    178-17B
+       u32     xPVR;           // Processor Version Number     17C-17F
+
+       u64     xMMCR0;         // Monitor Mode Control Reg 0   180-187
+       u32     xPMC1;          // Perf Monitor Counter 1       188-18B
+       u32     xPMC2;          // Perf Monitor Counter 2       18C-18F
+       u32     xPMC3;          // Perf Monitor Counter 3       190-193
+       u32     xPMC4;          // Perf Monitor Counter 4       194-197
+       u32     xPIR;           // Processor ID Reg             198-19B
+
+       u32     xMMCR1;         // Monitor Mode Control Reg 1   19C-19F
+       u32     xMMCRA;         // Monitor Mode Control Reg A   1A0-1A3
+       u32     xPMC5;          // Perf Monitor Counter 5       1A4-1A7
+       u32     xPMC6;          // Perf Monitor Counter 6       1A8-1AB
+       u32     xPMC7;          // Perf Monitor Counter 7       1AC-1AF
+       u32     xPMC8;          // Perf Monitor Counter 8       1B0-1B3
+       u32     xTSC;           // Thread Switch Control        1B4-1B7
+       u32     xTST;           // Thread Switch Timeout        1B8-1BB
+       u32     xRsvd;          // Reserved                     1BC-1BF
+
+       u64     xACCR;          // Address Compare Control Reg  1C0-1C7
+       u64     xIMR;           // Instruction Match Register   1C8-1CF
+       u64     xSDR1;          // Storage Description Reg 1    1D0-1D7
+       u64     xSPRG0;         // Special Purpose Reg General0 1D8-1DF
+       u64     xSPRG1;         // Special Purpose Reg General1 1E0-1E7
+       u64     xSPRG2;         // Special Purpose Reg General2 1E8-1EF
+       u64     xSPRG3;         // Special Purpose Reg General3 1F0-1F7
+       u64     xTB;            // Time Base Register           1F8-1FF
+
+       u64     xFPR[32];       // Floating Point Registers     200-2FF
+
+       u64     xMSR;           // Machine State Register       300-307
+       u64     xNIA;           // Next Instruction Address     308-30F
+
+       u64     xDABR;          // Data Address Breakpoint Reg  310-317
+       u64     xIABR;          // Inst Address Breakpoint Reg  318-31F
+
+       u64     xHID0;          // HW Implementation Dependent0 320-327
+
+       u64     xHID4;          // HW Implementation Dependent4 328-32F
+       u64     xSCOMd;         // SCON Data Reg (SPRG4)        330-337
+       u64     xSCOMc;         // SCON Command Reg (SPRG5)     338-33F
+       u64     xSDAR;          // Sample Data Address Register 340-347
+       u64     xSIAR;          // Sample Inst Address Register 348-34F
+
+       u8      xRsvd3[176];    // Reserved                     350-3FF
+};
+
 extern void system_reset_iSeries(void);
 extern void machine_check_iSeries(void);
 extern void data_access_iSeries(void);
@@ -129,7 +186,7 @@ struct ItLpNaca itLpNaca = {
 };
 
 /* May be filled in by the hypervisor so cannot end up in the BSS */
-struct ItIplParmsReal xItIplParmsReal __attribute__((__section__(".data")));
+static struct ItIplParmsReal xItIplParmsReal __attribute__((__section__(".data")));
 
 /* May be filled in by the hypervisor so cannot end up in the BSS */
 struct ItExtVpdPanel xItExtVpdPanel __attribute__((__section__(".data")));
@@ -152,13 +209,54 @@ u64    xMsVpd[3400] __attribute__((__section__(".data")));
 
 /* Space for Recovery Log Buffer */
 /* May be filled in by the hypervisor so cannot end up in the BSS */
-u64    xRecoveryLogBuffer[32] __attribute__((__section__(".data")));
+static u64    xRecoveryLogBuffer[32] __attribute__((__section__(".data")));
 
-struct SpCommArea xSpCommArea = {
+static const struct SpCommArea xSpCommArea = {
        .xDesc = 0xE2D7C3C2,
        .xFormat = 1,
 };
 
+static const struct ItLpRegSave iseries_reg_save[] = {
+       [0 ... (NR_CPUS-1)] = {
+               .xDesc = 0xd397d9e2,    /* "LpRS" */
+               .xSize = sizeof(struct ItLpRegSave),
+       },
+};
+
+#define ALPACA_INIT(number)                                            \
+{                                                                      \
+       .lppaca_ptr = &lppaca[number],                                  \
+       .reg_save_ptr = &iseries_reg_save[number],                      \
+}
+
+const struct alpaca alpaca[] = {
+       ALPACA_INIT( 0),
+#if NR_CPUS > 1
+       ALPACA_INIT( 1), ALPACA_INIT( 2), ALPACA_INIT( 3),
+#if NR_CPUS > 4
+       ALPACA_INIT( 4), ALPACA_INIT( 5), ALPACA_INIT( 6), ALPACA_INIT( 7),
+#if NR_CPUS > 8
+       ALPACA_INIT( 8), ALPACA_INIT( 9), ALPACA_INIT(10), ALPACA_INIT(11),
+       ALPACA_INIT(12), ALPACA_INIT(13), ALPACA_INIT(14), ALPACA_INIT(15),
+       ALPACA_INIT(16), ALPACA_INIT(17), ALPACA_INIT(18), ALPACA_INIT(19),
+       ALPACA_INIT(20), ALPACA_INIT(21), ALPACA_INIT(22), ALPACA_INIT(23),
+       ALPACA_INIT(24), ALPACA_INIT(25), ALPACA_INIT(26), ALPACA_INIT(27),
+       ALPACA_INIT(28), ALPACA_INIT(29), ALPACA_INIT(30), ALPACA_INIT(31),
+#if NR_CPUS > 32
+       ALPACA_INIT(32), ALPACA_INIT(33), ALPACA_INIT(34), ALPACA_INIT(35),
+       ALPACA_INIT(36), ALPACA_INIT(37), ALPACA_INIT(38), ALPACA_INIT(39),
+       ALPACA_INIT(40), ALPACA_INIT(41), ALPACA_INIT(42), ALPACA_INIT(43),
+       ALPACA_INIT(44), ALPACA_INIT(45), ALPACA_INIT(46), ALPACA_INIT(47),
+       ALPACA_INIT(48), ALPACA_INIT(49), ALPACA_INIT(50), ALPACA_INIT(51),
+       ALPACA_INIT(52), ALPACA_INIT(53), ALPACA_INIT(54), ALPACA_INIT(55),
+       ALPACA_INIT(56), ALPACA_INIT(57), ALPACA_INIT(58), ALPACA_INIT(59),
+       ALPACA_INIT(60), ALPACA_INIT(61), ALPACA_INIT(62), ALPACA_INIT(63),
+#endif
+#endif
+#endif
+#endif
+};
+
 /* The LparMap data is now located at offset 0x6000 in head.S
  * It was put there so that the HvReleaseData could address it
  * with a 32-bit offset as required by the iSeries hypervisor
@@ -167,7 +265,7 @@ struct SpCommArea xSpCommArea = {
  * the Naca via the HvReleaseData area.  The HvReleaseData has the
  * offset into the Naca of the pointer to the ItVpdAreas.
  */
-struct ItVpdAreas itVpdAreas = {
+const struct ItVpdAreas itVpdAreas = {
        .xSlicDesc = 0xc9a3e5c1,                /* "ItVA" */
        .xSlicSize = sizeof(struct ItVpdAreas),
        .xSlicVpdEntries = ItVpdMaxEntries,     /* # VPD array entries */
@@ -185,7 +283,7 @@ struct ItVpdAreas itVpdAreas = {
        .xSlicVpdLens = {                       /* VPD lengths */
                0,0,0,                  /*  0 - 2 */
                sizeof(xItExtVpdPanel), /*       3 Extended VPD   */
-               sizeof(struct paca_struct),     /*       4 length of Paca  */
+               sizeof(struct alpaca),  /*       4 length of (fake) Paca  */
                0,                      /*       5 */
                sizeof(struct ItIplParmsReal),/* 6 length of IPL parms */
                26992,                  /*       7 length of MS VPD */
@@ -203,7 +301,7 @@ struct ItVpdAreas itVpdAreas = {
        .xSlicVpdAdrs = {                       /* VPD addresses */
                0,0,0,                  /*       0 -  2 */
                &xItExtVpdPanel,        /*       3 Extended VPD */
-               &paca[0],               /*       4 first Paca */
+               &alpaca[0],             /*       4 first (fake) Paca */
                0,                      /*       5 */
                &xItIplParmsReal,       /*       6 IPL parms */
                &xMsVpd,                /*       7 MS Vpd */
@@ -219,10 +317,3 @@ struct ItVpdAreas itVpdAreas = {
                0,0
        }
 };
-
-struct ItLpRegSave iseries_reg_save[] = {
-       [0 ... (NR_CPUS-1)] = {
-               .xDesc = 0xd397d9e2,    /* "LpRS" */
-               .xSize = sizeof(struct ItLpRegSave),
-       },
-};
index ab2372eb8d2ea08f72c2f06ed731db076c10ad2d..f01708e12862e9d1626eee23de0409145315b7b8 100644 (file)
@@ -14,7 +14,7 @@
 
 struct naca_struct {
        /* Kernel only data - undefined for user space */
-       void *xItVpdAreas;              /* VPD Data                  0x00 */
+       const void *xItVpdAreas;        /* VPD Data                  0x00 */
        void *xRamDisk;                 /* iSeries ramdisk           0x08 */
        u64   xRamDiskSize;             /* In pages                  0x10 */
 };
index cc562e4c2f3269828f314d92af1b3f91248cb466..02a634faedbeb23007488513c4a51d98150edd9f 100644 (file)
@@ -23,6 +23,7 @@
 
 #undef DEBUG
 
+#include <linux/jiffies.h>
 #include <linux/kernel.h>
 #include <linux/list.h>
 #include <linux/string.h>
@@ -586,7 +587,7 @@ static inline struct device_node *xlate_iomm_address(
                static unsigned long last_jiffies;
                static int num_printed;
 
-               if ((jiffies - last_jiffies) > 60 * HZ) {
+               if (time_after(jiffies, last_jiffies + 60 * HZ)) {
                        last_jiffies = jiffies;
                        num_printed = 0;
                }
index 66189fd2e32dfac18de86785311c91839896de0f..6ad7d843e8fc9fc0998ee411227696768579d9bc 100644 (file)
@@ -58,6 +58,6 @@ struct HvReleaseData {
        char    xRsvd3[20];     /* Reserved                     x2C-x3F */
 };
 
-extern struct HvReleaseData    hvReleaseData;
+extern const struct HvReleaseData      hvReleaseData;
 
 #endif /* _ISERIES_RELEASE_DATA_H */
index 6e3b685115c99fb6301cf1c17a269152a1d04485..598b7c14573a0200e872e786d5275bfa810880c6 100644 (file)
@@ -31,6 +31,4 @@ struct SpCommArea {
        u8      xRsvd2[80];             // Reserved                             030-07F
 };
 
-extern struct SpCommArea xSpCommArea;
-
 #endif /* _ISERIES_SPCOMM_AREA_H */
index 601e6dd860ed340a33fe298a024be1b5b89061dc..feb001f3a5feee9cecc7b90352185d2740ba7ae2 100644 (file)
@@ -80,9 +80,9 @@ struct ItVpdAreas {
        u32     xPlicDmaLens[ItDmaMaxEntries];// Array of DMA lengths   080-0A7
        u32     xPlicDmaToks[ItDmaMaxEntries];// Array of DMA tokens    0A8-0CF
        u32     xSlicVpdLens[ItVpdMaxEntries];// Array of VPD lengths   0D0-12F
-       void    *xSlicVpdAdrs[ItVpdMaxEntries];// Array of VPD buffers  130-1EF
+       const void *xSlicVpdAdrs[ItVpdMaxEntries];// Array of VPD buffers 130-1EF
 };
 
-extern struct ItVpdAreas       itVpdAreas;
+extern const struct ItVpdAreas itVpdAreas;
 
 #endif /* _ISERIES_VPD_AREAS_H */
index 3ffa0ac170eeefc84ff28bba853b485156ebc66e..301855263b8157cbf9c7fd75228a44a01044137e 100644 (file)
@@ -592,50 +592,3 @@ int maple_pci_get_legacy_ide_irq(struct pci_dev *pdev, int channel)
        }
        return irq;
 }
-
-/* XXX: To remove once all firmwares are ok */
-static void fixup_maple_ide(struct pci_dev* dev)
-{
-       if (!machine_is(maple))
-               return;
-
-#if 0 /* Enable this to enable IDE port 0 */
-       {
-               u8 v;
-
-               pci_read_config_byte(dev, 0x40, &v);
-               v |= 2;
-               pci_write_config_byte(dev, 0x40, v);
-       }
-#endif
-#if 0 /* fix bus master base */
-       pci_write_config_dword(dev, 0x20, 0xcc01);
-       printk("old ide resource: %lx -> %lx \n",
-              dev->resource[4].start, dev->resource[4].end);
-       dev->resource[4].start = 0xcc00;
-       dev->resource[4].end = 0xcc10;
-#endif
-#if 0 /* Enable this to fixup IDE sense/polarity of irqs in IO-APICs */
-       {
-               struct pci_dev *apicdev;
-               u32 v;
-
-               apicdev = pci_get_slot (dev->bus, PCI_DEVFN(5,0));
-               if (apicdev == NULL)
-                       printk("IDE Fixup IRQ: Can't find IO-APIC !\n");
-               else {
-                       pci_write_config_byte(apicdev, 0xf2, 0x10 + 2*14);
-                       pci_read_config_dword(apicdev, 0xf4, &v);
-                       v &= ~0x00000022;
-                       pci_write_config_dword(apicdev, 0xf4, v);
-                       pci_write_config_byte(apicdev, 0xf2, 0x10 + 2*15);
-                       pci_read_config_dword(apicdev, 0xf4, &v);
-                       v &= ~0x00000022;
-                       pci_write_config_dword(apicdev, 0xf4, v);
-                       pci_dev_put(apicdev);
-               }
-       }
-#endif
-}
-DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_8111_IDE,
-                        fixup_maple_ide);
index 3ce2d73b4177791c1a61a7643bd6e1ff7def86aa..364714757cf1a633093a30ef935ca4f4ae5fd762 100644 (file)
@@ -43,6 +43,7 @@
 #include <linux/smp.h>
 #include <linux/bitops.h>
 #include <linux/of_device.h>
+#include <linux/lmb.h>
 
 #include <asm/processor.h>
 #include <asm/sections.h>
@@ -57,7 +58,6 @@
 #include <asm/dma.h>
 #include <asm/cputable.h>
 #include <asm/time.h>
-#include <asm/lmb.h>
 #include <asm/mpic.h>
 #include <asm/rtas.h>
 #include <asm/udbg.h>
@@ -319,7 +319,7 @@ static int __init maple_probe(void)
        return 1;
 }
 
-define_machine(maple_md) {
+define_machine(maple) {
        .name                   = "Maple",
        .probe                  = maple_probe,
        .setup_arch             = maple_setup_arch,
index c529d8dff395bdd5a6f3cfb316dbaafcb674ab1a..217af321b0ca4d95b1c9aa2a9a39afbe68d98c7f 100644 (file)
@@ -17,6 +17,7 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
  */
 
+#include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/pci.h>
@@ -26,6 +27,8 @@
 
 #define MAX_TXCH 64
 #define MAX_RXCH 64
+#define MAX_FLAGS 64
+#define MAX_FUN 8
 
 static struct pasdma_status *dma_status;
 
@@ -43,6 +46,8 @@ static struct pci_dev *dma_pdev;
 
 static DECLARE_BITMAP(txch_free, MAX_TXCH);
 static DECLARE_BITMAP(rxch_free, MAX_RXCH);
+static DECLARE_BITMAP(flags_free, MAX_FLAGS);
+static DECLARE_BITMAP(fun_free, MAX_FUN);
 
 /* pasemi_read_iob_reg - read IOB register
  * @reg: Register to read (offset into PCI CFG space)
@@ -373,6 +378,106 @@ void pasemi_dma_free_buf(struct pasemi_dmachan *chan, int size,
 }
 EXPORT_SYMBOL(pasemi_dma_free_buf);
 
+/* pasemi_dma_alloc_flag - Allocate a flag (event) for channel syncronization
+ *
+ * Allocates a flag for use with channel syncronization (event descriptors).
+ * Returns allocated flag (0-63), < 0 on error.
+ */
+int pasemi_dma_alloc_flag(void)
+{
+       int bit;
+
+retry:
+       bit = find_next_bit(flags_free, MAX_FLAGS, 0);
+       if (bit >= MAX_FLAGS)
+               return -ENOSPC;
+       if (!test_and_clear_bit(bit, flags_free))
+               goto retry;
+
+       return bit;
+}
+EXPORT_SYMBOL(pasemi_dma_alloc_flag);
+
+
+/* pasemi_dma_free_flag - Deallocates a flag (event)
+ * @flag: Flag number to deallocate
+ *
+ * Frees up a flag so it can be reused for other purposes.
+ */
+void pasemi_dma_free_flag(int flag)
+{
+       BUG_ON(test_bit(flag, flags_free));
+       BUG_ON(flag >= MAX_FLAGS);
+       set_bit(flag, flags_free);
+}
+EXPORT_SYMBOL(pasemi_dma_free_flag);
+
+
+/* pasemi_dma_set_flag - Sets a flag (event) to 1
+ * @flag: Flag number to set active
+ *
+ * Sets the flag provided to 1.
+ */
+void pasemi_dma_set_flag(int flag)
+{
+       BUG_ON(flag >= MAX_FLAGS);
+       if (flag < 32)
+               pasemi_write_dma_reg(PAS_DMA_TXF_SFLG0, 1 << flag);
+       else
+               pasemi_write_dma_reg(PAS_DMA_TXF_SFLG1, 1 << flag);
+}
+EXPORT_SYMBOL(pasemi_dma_set_flag);
+
+/* pasemi_dma_clear_flag - Sets a flag (event) to 0
+ * @flag: Flag number to set inactive
+ *
+ * Sets the flag provided to 0.
+ */
+void pasemi_dma_clear_flag(int flag)
+{
+       BUG_ON(flag >= MAX_FLAGS);
+       if (flag < 32)
+               pasemi_write_dma_reg(PAS_DMA_TXF_CFLG0, 1 << flag);
+       else
+               pasemi_write_dma_reg(PAS_DMA_TXF_CFLG1, 1 << flag);
+}
+EXPORT_SYMBOL(pasemi_dma_clear_flag);
+
+/* pasemi_dma_alloc_fun - Allocate a function engine
+ *
+ * Allocates a function engine to use for crypto/checksum offload
+ * Returns allocated engine (0-8), < 0 on error.
+ */
+int pasemi_dma_alloc_fun(void)
+{
+       int bit;
+
+retry:
+       bit = find_next_bit(fun_free, MAX_FLAGS, 0);
+       if (bit >= MAX_FLAGS)
+               return -ENOSPC;
+       if (!test_and_clear_bit(bit, fun_free))
+               goto retry;
+
+       return bit;
+}
+EXPORT_SYMBOL(pasemi_dma_alloc_fun);
+
+
+/* pasemi_dma_free_fun - Deallocates a function engine
+ * @flag: Engine number to deallocate
+ *
+ * Frees up a function engine so it can be used for other purposes.
+ */
+void pasemi_dma_free_fun(int fun)
+{
+       BUG_ON(test_bit(fun, fun_free));
+       BUG_ON(fun >= MAX_FLAGS);
+       set_bit(fun, fun_free);
+}
+EXPORT_SYMBOL(pasemi_dma_free_fun);
+
+
 static void *map_onedev(struct pci_dev *p, int index)
 {
        struct device_node *dn;
@@ -410,6 +515,7 @@ int pasemi_dma_init(void)
        struct resource res;
        struct device_node *dn;
        int i, intf, err = 0;
+       unsigned long timeout;
        u32 tmp;
 
        if (!machine_is(pasemi))
@@ -478,6 +584,44 @@ int pasemi_dma_init(void)
        for (i = 0; i < MAX_RXCH; i++)
                __set_bit(i, rxch_free);
 
+       timeout = jiffies + HZ;
+       pasemi_write_dma_reg(PAS_DMA_COM_RXCMD, 0);
+       while (pasemi_read_dma_reg(PAS_DMA_COM_RXSTA) & 1) {
+               if (time_after(jiffies, timeout)) {
+                       pr_warning("Warning: Could not disable RX section\n");
+                       break;
+               }
+       }
+
+       timeout = jiffies + HZ;
+       pasemi_write_dma_reg(PAS_DMA_COM_TXCMD, 0);
+       while (pasemi_read_dma_reg(PAS_DMA_COM_TXSTA) & 1) {
+               if (time_after(jiffies, timeout)) {
+                       pr_warning("Warning: Could not disable TX section\n");
+                       break;
+               }
+       }
+
+       /* setup resource allocations for the different DMA sections */
+       tmp = pasemi_read_dma_reg(PAS_DMA_COM_CFG);
+       pasemi_write_dma_reg(PAS_DMA_COM_CFG, tmp | 0x18000000);
+
+       /* enable tx section */
+       pasemi_write_dma_reg(PAS_DMA_COM_TXCMD, PAS_DMA_COM_TXCMD_EN);
+
+       /* enable rx section */
+       pasemi_write_dma_reg(PAS_DMA_COM_RXCMD, PAS_DMA_COM_RXCMD_EN);
+
+       for (i = 0; i < MAX_FLAGS; i++)
+               __set_bit(i, flags_free);
+
+       for (i = 0; i < MAX_FUN; i++)
+               __set_bit(i, fun_free);
+
+       /* clear all status flags */
+       pasemi_write_dma_reg(PAS_DMA_TXF_CFLG0, 0xffffffff);
+       pasemi_write_dma_reg(PAS_DMA_TXF_CFLG1, 0xffffffff);
+
        printk(KERN_INFO "PA Semi PWRficient DMA library initialized "
                "(%d tx, %d rx channels)\n", num_txch, num_rxch);
 
index 5803f11c77fc07cc961f2610a9f0ec1b9f7aeef7..86967bdd8774db20ae04d13fb7f4b65c80482192 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2005-2007, PA Semi, Inc
+ * Copyright (C) 2005-2008, PA Semi, Inc
  *
  * Maintained by: Olof Johansson <olof@lixom.net>
  *
@@ -27,7 +27,6 @@
 #include <asm/abs_addr.h>
 #include <asm/firmware.h>
 
-
 #define IOBMAP_PAGE_SHIFT      12
 #define IOBMAP_PAGE_SIZE       (1 << IOBMAP_PAGE_SHIFT)
 #define IOBMAP_PAGE_MASK       (IOBMAP_PAGE_SIZE - 1)
 #define IOB_BASE               0xe0000000
 #define IOB_SIZE               0x3000
 /* Configuration registers */
-#define IOBCAP_REG             0x10
-#define IOBCOM_REG             0x40
+#define IOBCAP_REG             0x40
+#define IOBCOM_REG             0x100
 /* Enable IOB address translation */
 #define IOBCOM_ATEN            0x00000100
 
 /* Address decode configuration register */
-#define IOB_AD_REG             0x53
+#define IOB_AD_REG             0x14c
 /* IOBCOM_AD_REG fields */
 #define IOB_AD_VGPRT           0x00000e00
 #define IOB_AD_VGAEN           0x00000100
 #define IOB_AD_TRNG_2G         0x00000001
 #define IOB_AD_TRNG_128G       0x00000003
 
-#define IOB_TABLEBASE_REG      0x55
+#define IOB_TABLEBASE_REG      0x154
 
 /* Base of the 64 4-byte L1 registers */
-#define IOB_XLT_L1_REGBASE     0xac0
+#define IOB_XLT_L1_REGBASE     0x2b00
 
 /* Register to invalidate TLB entries */
-#define IOB_AT_INVAL_TLB_REG   0xb40
+#define IOB_AT_INVAL_TLB_REG   0x2d00
 
 /* The top two bits of the level 1 entry contains valid and type flags */
 #define IOBMAP_L1E_V           0x40000000
@@ -76,7 +75,7 @@
 #define IOBMAP_L2E_V           0x80000000
 #define IOBMAP_L2E_V_CACHED    0xc0000000
 
-static u32 __iomem *iob;
+static void __iomem *iob;
 static u32 iob_l1_emptyval;
 static u32 iob_l2_emptyval;
 static u32 *iob_l2_base;
@@ -219,7 +218,7 @@ int __init iob_init(struct device_node *dn)
        for (i = 0; i < 64; i++) {
                /* Each L1 covers 32MB, i.e. 8K entries = 32K of ram */
                regword = IOBMAP_L1E_V | (__pa(iob_l2_base + i*0x2000) >> 12);
-               out_le32(iob+IOB_XLT_L1_REGBASE+i, regword);
+               out_le32(iob+IOB_XLT_L1_REGBASE+i*4, regword);
        }
 
        /* set 2GB translation window, based at 0 */
index 85434231ae14d5658be4d6c122d8ab78d8f27ed1..96d5ce50364eab840571b216c10819e71834408d 100644 (file)
@@ -12,7 +12,6 @@
 #include <linux/module.h>
 #include <linux/mutex.h>
 
-#include <asm/semaphore.h>
 #include <asm/prom.h>
 #include <asm/pmac_pfunc.h>
 
index 2693fc371eab10e86a7b01f0a34291aa20ef89c4..bf44c5441a365a0a148bdac23dd255c5a5b747b1 100644 (file)
@@ -53,6 +53,7 @@
 #include <linux/suspend.h>
 #include <linux/of_device.h>
 #include <linux/of_platform.h>
+#include <linux/lmb.h>
 
 #include <asm/reg.h>
 #include <asm/sections.h>
@@ -74,7 +75,6 @@
 #include <asm/iommu.h>
 #include <asm/smu.h>
 #include <asm/pmc.h>
-#include <asm/lmb.h>
 #include <asm/udbg.h>
 
 #include "pmac.h"
index 9d251d0ca8c6786673a5ed0be141288b9dbf9c2d..3866debfa3c41d0062851f0fcfdbb47ab7cc7c8e 100644 (file)
@@ -499,41 +499,14 @@ static int __init ps3_register_graphics_devices(void)
 }
 
 /**
- * ps3_register_repository_device - Register a device from the repositiory info.
- *
+ * ps3_setup_dynamic_device - Setup a dynamic device from the repository
  */
 
-static int ps3_register_repository_device(
-       const struct ps3_repository_device *repo)
+static int ps3_setup_dynamic_device(const struct ps3_repository_device *repo)
 {
        int result;
 
        switch (repo->dev_type) {
-       case PS3_DEV_TYPE_SB_GELIC:
-               result = ps3_setup_gelic_device(repo);
-               if (result) {
-                       pr_debug("%s:%d ps3_setup_gelic_device failed\n",
-                               __func__, __LINE__);
-               }
-               break;
-       case PS3_DEV_TYPE_SB_USB:
-
-               /* Each USB device has both an EHCI and an OHCI HC */
-
-               result = ps3_setup_ehci_device(repo);
-
-               if (result) {
-                       pr_debug("%s:%d ps3_setup_ehci_device failed\n",
-                               __func__, __LINE__);
-               }
-
-               result = ps3_setup_ohci_device(repo);
-
-               if (result) {
-                       pr_debug("%s:%d ps3_setup_ohci_device failed\n",
-                               __func__, __LINE__);
-               }
-               break;
        case PS3_DEV_TYPE_STOR_DISK:
                result = ps3_setup_storage_dev(repo, PS3_MATCH_ID_STOR_DISK);
 
@@ -572,6 +545,48 @@ static int ps3_register_repository_device(
        return result;
 }
 
+/**
+ * ps3_setup_static_device - Setup a static device from the repository
+ */
+
+static int __init ps3_setup_static_device(const struct ps3_repository_device *repo)
+{
+       int result;
+
+       switch (repo->dev_type) {
+       case PS3_DEV_TYPE_SB_GELIC:
+               result = ps3_setup_gelic_device(repo);
+               if (result) {
+                       pr_debug("%s:%d ps3_setup_gelic_device failed\n",
+                               __func__, __LINE__);
+               }
+               break;
+       case PS3_DEV_TYPE_SB_USB:
+
+               /* Each USB device has both an EHCI and an OHCI HC */
+
+               result = ps3_setup_ehci_device(repo);
+
+               if (result) {
+                       pr_debug("%s:%d ps3_setup_ehci_device failed\n",
+                               __func__, __LINE__);
+               }
+
+               result = ps3_setup_ohci_device(repo);
+
+               if (result) {
+                       pr_debug("%s:%d ps3_setup_ohci_device failed\n",
+                               __func__, __LINE__);
+               }
+               break;
+
+       default:
+               return ps3_setup_dynamic_device(repo);
+       }
+
+       return result;
+}
+
 static void ps3_find_and_add_device(u64 bus_id, u64 dev_id)
 {
        struct ps3_repository_device repo;
@@ -601,7 +616,7 @@ found:
                pr_debug("%s:%u: device %lu:%lu found after %u retries\n",
                         __func__, __LINE__, bus_id, dev_id, retries);
 
-       ps3_register_repository_device(&repo);
+       ps3_setup_dynamic_device(&repo);
        return;
 }
 
@@ -905,8 +920,7 @@ static int __init ps3_register_devices(void)
 
        ps3_register_graphics_devices();
 
-       ps3_repository_find_devices(PS3_BUS_TYPE_SB,
-               ps3_register_repository_device);
+       ps3_repository_find_devices(PS3_BUS_TYPE_SB, ps3_setup_static_device);
 
        ps3_register_sound_devices();
 
index 7382f195c4f87689aac7f1e858e98c16e0dd687d..1cf901fa9031d51a86c97ed33b6b70b9bae196b6 100644 (file)
  */
 
 #include <linux/kernel.h>
+#include <linux/lmb.h>
 
 #include <asm/machdep.h>
-#include <asm/lmb.h>
+#include <asm/prom.h>
 #include <asm/udbg.h>
 #include <asm/lv1call.h>
 #include <asm/ps3fb.h>
index 3a6db04aa9405a87d7098a41c945a77ba950f143..a14e5cdc2fed758862ef2e5de522831955b16810 100644 (file)
@@ -709,7 +709,7 @@ static unsigned int ps3_get_irq(void)
        asm volatile("cntlzd %0,%1" : "=r" (plug) : "r" (x));
        plug &= 0x3f;
 
-       if (unlikely(plug) == NO_IRQ) {
+       if (unlikely(plug == NO_IRQ)) {
                pr_debug("%s:%d: no plug found: thread_id %lu\n", __func__,
                        __LINE__, pd->thread_id);
                dump_bmp(&per_cpu(ps3_private, 0));
index 68900476c8425881b0514f0f077e302ea4b10e88..5b3fb2b321abeffa98811e8570100ea49eb1f3da 100644 (file)
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/memory_hotplug.h>
+#include <linux/lmb.h>
 
 #include <asm/firmware.h>
-#include <asm/lmb.h>
+#include <asm/prom.h>
 #include <asm/udbg.h>
 #include <asm/lv1call.h>
 
index b9ea09d9d2fb130056f59d59640eec8554623fa0..c73379ec9141038c5a68e14f0233a64c9fb2601f 100644 (file)
@@ -24,8 +24,9 @@
 #include <linux/fs.h>
 #include <linux/syscalls.h>
 #include <linux/ctype.h>
+#include <linux/lmb.h>
 
-#include <asm/lmb.h>
+#include <asm/prom.h>
 
 #include "platform.h"
 
index 5c2cbb08eb52f82a212503137ebae0cf5d8dca55..a413abbd41230c4d1808f2300890e241fb2eb775 100644 (file)
@@ -95,6 +95,14 @@ static void ps3_power_off(void)
        ps3_sys_manager_power_off(); /* never returns */
 }
 
+static void ps3_halt(void)
+{
+       DBG("%s:%d\n", __func__, __LINE__);
+
+       smp_send_stop();
+       ps3_sys_manager_halt(); /* never returns */
+}
+
 static void ps3_panic(char *str)
 {
        DBG("%s:%d %s\n", __func__, __LINE__, str);
@@ -105,7 +113,8 @@ static void ps3_panic(char *str)
        printk("   Please press POWER button.\n");
        printk("\n");
 
-       while(1);
+       while(1)
+               lv1_pause(1);
 }
 
 #if defined(CONFIG_FB_PS3) || defined(CONFIG_FB_PS3_MODULE) || \
@@ -117,7 +126,7 @@ static void __init prealloc(struct ps3_prealloc *p)
 
        p->address = __alloc_bootmem(p->size, p->align, __pa(MAX_DMA_ADDRESS));
        if (!p->address) {
-               printk(KERN_ERR "%s: Cannot allocate %s\n", __FUNCTION__,
+               printk(KERN_ERR "%s: Cannot allocate %s\n", __func__,
                       p->name);
                return;
        }
@@ -266,6 +275,7 @@ define_machine(ps3) {
        .progress                       = ps3_progress,
        .restart                        = ps3_restart,
        .power_off                      = ps3_power_off,
+       .halt                           = ps3_halt,
 #if defined(CONFIG_KEXEC)
        .kexec_cpu_down                 = ps3_kexec_cpu_down,
        .machine_kexec                  = default_machine_kexec,
index 5ad41189b494e030e9a6e943f81bb0653cabb40f..d135cef9ed6a91d97eba9a0500213cb8d460df86 100644 (file)
@@ -27,6 +27,7 @@
 #include <asm/spu.h>
 #include <asm/spu_priv1.h>
 #include <asm/lv1call.h>
+#include <asm/ps3.h>
 
 #include "../cell/spufs/spufs.h"
 #include "platform.h"
@@ -140,6 +141,12 @@ static void _dump_areas(unsigned int spe_id, unsigned long priv2,
        pr_debug("%s:%d: shadow:  %lxh\n", func, line, shadow);
 }
 
+inline u64 ps3_get_spe_id(void *arg)
+{
+       return spu_pdata(arg)->spe_id;
+}
+EXPORT_SYMBOL_GPL(ps3_get_spe_id);
+
 static unsigned long get_vas_id(void)
 {
        unsigned long id;
index 992ba6753cf238710bb89c2b74f9bcb394c53c77..bdae04bb7a0157048b24f64ff3f1f05a883976e6 100644 (file)
@@ -18,3 +18,4 @@ obj-$(CONFIG_HOTPLUG_CPU)     += hotplug-cpu.o
 obj-$(CONFIG_HVC_CONSOLE)      += hvconsole.o
 obj-$(CONFIG_HVCS)             += hvcserver.o
 obj-$(CONFIG_HCALL_STATS)      += hvCall_inst.o
+obj-$(CONFIG_PHYP_DUMP)        += phyp_dump.o
index 9eb539ee5f9a1c05b7262637fe764736431ab0d7..550b2f7d2cc1ee8ed59b5a91f0a334f3402be80e 100644 (file)
@@ -945,7 +945,6 @@ static void *early_enable_eeh(struct device_node *dn, void *data)
        unsigned int rets[3];
        struct eeh_early_enable_info *info = data;
        int ret;
-       const char *status = of_get_property(dn, "status", NULL);
        const u32 *class_code = of_get_property(dn, "class-code", NULL);
        const u32 *vendor_id = of_get_property(dn, "vendor-id", NULL);
        const u32 *device_id = of_get_property(dn, "device-id", NULL);
@@ -959,8 +958,8 @@ static void *early_enable_eeh(struct device_node *dn, void *data)
        pdn->eeh_freeze_count = 0;
        pdn->eeh_false_positives = 0;
 
-       if (status && strncmp(status, "ok", 2) != 0)
-               return NULL;    /* ignore devices with bad status */
+       if (!of_device_is_available(dn))
+               return NULL;
 
        /* Ignore bad nodes. */
        if (!class_code || !vendor_id || !device_id)
index 9a455d46379d525181a4278714e22304f72028db..9235c469449e06890e474c52af8fe11b21c96e2d 100644 (file)
@@ -40,6 +40,7 @@
 #include <asm/smp.h>
 
 #include "plpar_wrappers.h"
+#include "pseries.h"
 
 #ifdef DEBUG_LOW
 #define DBG_LOW(fmt...) do { udbg_printf(fmt); } while(0)
@@ -203,7 +204,6 @@ void __init find_udbg_vterm(void)
        struct device_node *stdout_node;
        const u32 *termno;
        const char *name;
-       int add_console;
 
        /* find the boot console from /chosen/stdout */
        if (!of_chosen)
@@ -219,8 +219,6 @@ void __init find_udbg_vterm(void)
                printk(KERN_WARNING "stdout node missing 'name' property!\n");
                goto out;
        }
-       /* The user has requested a console so this is already set up. */
-       add_console = !strstr(cmd_line, "console=");
 
        /* Check if it's a virtual terminal */
        if (strncmp(name, "vty", 3) != 0)
@@ -234,15 +232,13 @@ void __init find_udbg_vterm(void)
                udbg_putc = udbg_putcLP;
                udbg_getc = udbg_getcLP;
                udbg_getc_poll = udbg_getc_pollLP;
-               if (add_console)
-                       add_preferred_console("hvc", termno[0] & 0xff, NULL);
+               add_preferred_console("hvc", termno[0] & 0xff, NULL);
        } else if (of_device_is_compatible(stdout_node, "hvterm-protocol")) {
                vtermno = termno[0];
                udbg_putc = udbg_hvsi_putc;
                udbg_getc = udbg_hvsi_getc;
                udbg_getc_poll = udbg_hvsi_getc_poll;
-               if (add_console)
-                       add_preferred_console("hvsi", termno[0] & 0xff, NULL);
+               add_preferred_console("hvsi", termno[0] & 0xff, NULL);
        }
 out:
        of_node_put(stdout_node);
@@ -520,6 +516,20 @@ static void pSeries_lpar_hpte_invalidate(unsigned long slot, unsigned long va,
        BUG_ON(lpar_rc != H_SUCCESS);
 }
 
+static void pSeries_lpar_hpte_removebolted(unsigned long ea,
+                                          int psize, int ssize)
+{
+       unsigned long slot, vsid, va;
+
+       vsid = get_kernel_vsid(ea, ssize);
+       va = hpt_va(ea, vsid, ssize);
+
+       slot = pSeries_lpar_hpte_find(va, psize, ssize);
+       BUG_ON(slot == -1);
+
+       pSeries_lpar_hpte_invalidate(slot, va, psize, ssize, 0);
+}
+
 /* Flag bits for H_BULK_REMOVE */
 #define HBR_REQUEST    0x4000000000000000UL
 #define HBR_RESPONSE   0x8000000000000000UL
@@ -597,6 +607,7 @@ void __init hpte_init_lpar(void)
        ppc_md.hpte_updateboltedpp = pSeries_lpar_hpte_updateboltedpp;
        ppc_md.hpte_insert      = pSeries_lpar_hpte_insert;
        ppc_md.hpte_remove      = pSeries_lpar_hpte_remove;
+       ppc_md.hpte_removebolted = pSeries_lpar_hpte_removebolted;
        ppc_md.flush_hash_range = pSeries_lpar_flush_hash_range;
        ppc_md.hpte_clear_all   = pSeries_lpar_hptab_clear;
 }
index 5a5a19e40bb4587e80943991e8ebfc9621bbfd7b..0d7229cde0e9985de53d55f2be794b07e121aea2 100644 (file)
@@ -123,7 +123,7 @@ pcibios_pci_config_bridge(struct pci_dev *dev)
        /* Add to children of PCI bridge dev->bus */
        child_bus = pci_add_new_bus(dev->bus, dev, sec_busno);
        if (!child_bus) {
-               printk (KERN_ERR "%s: could not add second bus\n", __FUNCTION__);
+               printk (KERN_ERR "%s: could not add second bus\n", __func__);
                return -EIO;
        }
        sprintf(child_bus->name, "PCI Bus #%02x", child_bus->number);
diff --git a/arch/powerpc/platforms/pseries/phyp_dump.c b/arch/powerpc/platforms/pseries/phyp_dump.c
new file mode 100644 (file)
index 0000000..edbc012
--- /dev/null
@@ -0,0 +1,507 @@
+/*
+ * Hypervisor-assisted dump
+ *
+ * Linas Vepstas, Manish Ahuja 2008
+ * Copyright 2008 IBM Corp.
+ *
+ *      This program is free software; you can redistribute it and/or
+ *      modify it under the terms of the GNU General Public License
+ *      as published by the Free Software Foundation; either version
+ *      2 of the License, or (at your option) any later version.
+ *
+ */
+
+#include <linux/init.h>
+#include <linux/kobject.h>
+#include <linux/mm.h>
+#include <linux/of.h>
+#include <linux/pfn.h>
+#include <linux/swap.h>
+#include <linux/sysfs.h>
+
+#include <asm/page.h>
+#include <asm/phyp_dump.h>
+#include <asm/machdep.h>
+#include <asm/prom.h>
+#include <asm/rtas.h>
+
+/* Variables, used to communicate data between early boot and late boot */
+static struct phyp_dump phyp_dump_vars;
+struct phyp_dump *phyp_dump_info = &phyp_dump_vars;
+
+static int ibm_configure_kernel_dump;
+/* ------------------------------------------------- */
+/* RTAS interfaces to declare the dump regions */
+
+struct dump_section {
+       u32 dump_flags;
+       u16 source_type;
+       u16 error_flags;
+       u64 source_address;
+       u64 source_length;
+       u64 length_copied;
+       u64 destination_address;
+};
+
+struct phyp_dump_header {
+       u32 version;
+       u16 num_of_sections;
+       u16 status;
+
+       u32 first_offset_section;
+       u32 dump_disk_section;
+       u64 block_num_dd;
+       u64 num_of_blocks_dd;
+       u32 offset_dd;
+       u32 maxtime_to_auto;
+       /* No dump disk path string used */
+
+       struct dump_section cpu_data;
+       struct dump_section hpte_data;
+       struct dump_section kernel_data;
+};
+
+/* The dump header *must be* in low memory, so .bss it */
+static struct phyp_dump_header phdr;
+
+#define NUM_DUMP_SECTIONS      3
+#define DUMP_HEADER_VERSION    0x1
+#define DUMP_REQUEST_FLAG      0x1
+#define DUMP_SOURCE_CPU                0x0001
+#define DUMP_SOURCE_HPTE       0x0002
+#define DUMP_SOURCE_RMO                0x0011
+#define DUMP_ERROR_FLAG                0x2000
+#define DUMP_TRIGGERED         0x4000
+#define DUMP_PERFORMED         0x8000
+
+
+/**
+ * init_dump_header() - initialize the header declaring a dump
+ * Returns: length of dump save area.
+ *
+ * When the hypervisor saves crashed state, it needs to put
+ * it somewhere. The dump header tells the hypervisor where
+ * the data can be saved.
+ */
+static unsigned long init_dump_header(struct phyp_dump_header *ph)
+{
+       unsigned long addr_offset = 0;
+
+       /* Set up the dump header */
+       ph->version = DUMP_HEADER_VERSION;
+       ph->num_of_sections = NUM_DUMP_SECTIONS;
+       ph->status = 0;
+
+       ph->first_offset_section =
+               (u32)offsetof(struct phyp_dump_header, cpu_data);
+       ph->dump_disk_section = 0;
+       ph->block_num_dd = 0;
+       ph->num_of_blocks_dd = 0;
+       ph->offset_dd = 0;
+
+       ph->maxtime_to_auto = 0; /* disabled */
+
+       /* The first two sections are mandatory */
+       ph->cpu_data.dump_flags = DUMP_REQUEST_FLAG;
+       ph->cpu_data.source_type = DUMP_SOURCE_CPU;
+       ph->cpu_data.source_address = 0;
+       ph->cpu_data.source_length = phyp_dump_info->cpu_state_size;
+       ph->cpu_data.destination_address = addr_offset;
+       addr_offset += phyp_dump_info->cpu_state_size;
+
+       ph->hpte_data.dump_flags = DUMP_REQUEST_FLAG;
+       ph->hpte_data.source_type = DUMP_SOURCE_HPTE;
+       ph->hpte_data.source_address = 0;
+       ph->hpte_data.source_length = phyp_dump_info->hpte_region_size;
+       ph->hpte_data.destination_address = addr_offset;
+       addr_offset += phyp_dump_info->hpte_region_size;
+
+       /* This section describes the low kernel region */
+       ph->kernel_data.dump_flags = DUMP_REQUEST_FLAG;
+       ph->kernel_data.source_type = DUMP_SOURCE_RMO;
+       ph->kernel_data.source_address = PHYP_DUMP_RMR_START;
+       ph->kernel_data.source_length = PHYP_DUMP_RMR_END;
+       ph->kernel_data.destination_address = addr_offset;
+       addr_offset += ph->kernel_data.source_length;
+
+       return addr_offset;
+}
+
+static void print_dump_header(const struct phyp_dump_header *ph)
+{
+#ifdef DEBUG
+       printk(KERN_INFO "dump header:\n");
+       /* setup some ph->sections required */
+       printk(KERN_INFO "version = %d\n", ph->version);
+       printk(KERN_INFO "Sections = %d\n", ph->num_of_sections);
+       printk(KERN_INFO "Status = 0x%x\n", ph->status);
+
+       /* No ph->disk, so all should be set to 0 */
+       printk(KERN_INFO "Offset to first section 0x%x\n",
+               ph->first_offset_section);
+       printk(KERN_INFO "dump disk sections should be zero\n");
+       printk(KERN_INFO "dump disk section = %d\n", ph->dump_disk_section);
+       printk(KERN_INFO "block num = %ld\n", ph->block_num_dd);
+       printk(KERN_INFO "number of blocks = %ld\n", ph->num_of_blocks_dd);
+       printk(KERN_INFO "dump disk offset = %d\n", ph->offset_dd);
+       printk(KERN_INFO "Max auto time= %d\n", ph->maxtime_to_auto);
+
+       /*set cpu state and hpte states as well scratch pad area */
+       printk(KERN_INFO " CPU AREA \n");
+       printk(KERN_INFO "cpu dump_flags =%d\n", ph->cpu_data.dump_flags);
+       printk(KERN_INFO "cpu source_type =%d\n", ph->cpu_data.source_type);
+       printk(KERN_INFO "cpu error_flags =%d\n", ph->cpu_data.error_flags);
+       printk(KERN_INFO "cpu source_address =%lx\n",
+               ph->cpu_data.source_address);
+       printk(KERN_INFO "cpu source_length =%lx\n",
+               ph->cpu_data.source_length);
+       printk(KERN_INFO "cpu length_copied =%lx\n",
+               ph->cpu_data.length_copied);
+
+       printk(KERN_INFO " HPTE AREA \n");
+       printk(KERN_INFO "HPTE dump_flags =%d\n", ph->hpte_data.dump_flags);
+       printk(KERN_INFO "HPTE source_type =%d\n", ph->hpte_data.source_type);
+       printk(KERN_INFO "HPTE error_flags =%d\n", ph->hpte_data.error_flags);
+       printk(KERN_INFO "HPTE source_address =%lx\n",
+               ph->hpte_data.source_address);
+       printk(KERN_INFO "HPTE source_length =%lx\n",
+               ph->hpte_data.source_length);
+       printk(KERN_INFO "HPTE length_copied =%lx\n",
+               ph->hpte_data.length_copied);
+
+       printk(KERN_INFO " SRSD AREA \n");
+       printk(KERN_INFO "SRSD dump_flags =%d\n", ph->kernel_data.dump_flags);
+       printk(KERN_INFO "SRSD source_type =%d\n", ph->kernel_data.source_type);
+       printk(KERN_INFO "SRSD error_flags =%d\n", ph->kernel_data.error_flags);
+       printk(KERN_INFO "SRSD source_address =%lx\n",
+               ph->kernel_data.source_address);
+       printk(KERN_INFO "SRSD source_length =%lx\n",
+               ph->kernel_data.source_length);
+       printk(KERN_INFO "SRSD length_copied =%lx\n",
+               ph->kernel_data.length_copied);
+#endif
+}
+
+static ssize_t show_phyp_dump_active(struct kobject *kobj,
+                       struct kobj_attribute *attr, char *buf)
+{
+
+       /* create filesystem entry so kdump is phyp-dump aware */
+       return sprintf(buf, "%lx\n", phyp_dump_info->phyp_dump_at_boot);
+}
+
+static struct kobj_attribute pdl = __ATTR(phyp_dump_active, 0600,
+                                       show_phyp_dump_active,
+                                       NULL);
+
+static void register_dump_area(struct phyp_dump_header *ph, unsigned long addr)
+{
+       int rc;
+
+       /* Add addr value if not initialized before */
+       if (ph->cpu_data.destination_address == 0) {
+               ph->cpu_data.destination_address += addr;
+               ph->hpte_data.destination_address += addr;
+               ph->kernel_data.destination_address += addr;
+       }
+
+       /* ToDo Invalidate kdump and free memory range. */
+
+       do {
+               rc = rtas_call(ibm_configure_kernel_dump, 3, 1, NULL,
+                               1, ph, sizeof(struct phyp_dump_header));
+       } while (rtas_busy_delay(rc));
+
+       if (rc) {
+               printk(KERN_ERR "phyp-dump: unexpected error (%d) on "
+                                               "register\n", rc);
+               print_dump_header(ph);
+               return;
+       }
+
+       rc = sysfs_create_file(kernel_kobj, &pdl.attr);
+       if (rc)
+               printk(KERN_ERR "phyp-dump: unable to create sysfs"
+                               " file (%d)\n", rc);
+}
+
+static
+void invalidate_last_dump(struct phyp_dump_header *ph, unsigned long addr)
+{
+       int rc;
+
+       /* Add addr value if not initialized before */
+       if (ph->cpu_data.destination_address == 0) {
+               ph->cpu_data.destination_address += addr;
+               ph->hpte_data.destination_address += addr;
+               ph->kernel_data.destination_address += addr;
+       }
+
+       do {
+               rc = rtas_call(ibm_configure_kernel_dump, 3, 1, NULL,
+                               2, ph, sizeof(struct phyp_dump_header));
+       } while (rtas_busy_delay(rc));
+
+       if (rc) {
+               printk(KERN_ERR "phyp-dump: unexpected error (%d) "
+                                               "on invalidate\n", rc);
+               print_dump_header(ph);
+       }
+}
+
+/* ------------------------------------------------- */
+/**
+ * release_memory_range -- release memory previously lmb_reserved
+ * @start_pfn: starting physical frame number
+ * @nr_pages: number of pages to free.
+ *
+ * This routine will release memory that had been previously
+ * lmb_reserved in early boot. The released memory becomes
+ * available for genreal use.
+ */
+static void release_memory_range(unsigned long start_pfn,
+                       unsigned long nr_pages)
+{
+       struct page *rpage;
+       unsigned long end_pfn;
+       long i;
+
+       end_pfn = start_pfn + nr_pages;
+
+       for (i = start_pfn; i <= end_pfn; i++) {
+               rpage = pfn_to_page(i);
+               if (PageReserved(rpage)) {
+                       ClearPageReserved(rpage);
+                       init_page_count(rpage);
+                       __free_page(rpage);
+                       totalram_pages++;
+               }
+       }
+}
+
+/**
+ * track_freed_range -- Counts the range being freed.
+ * Once the counter goes to zero, it re-registers dump for
+ * future use.
+ */
+static void
+track_freed_range(unsigned long addr, unsigned long length)
+{
+       static unsigned long scratch_area_size, reserved_area_size;
+
+       if (addr < phyp_dump_info->init_reserve_start)
+               return;
+
+       if ((addr >= phyp_dump_info->init_reserve_start) &&
+           (addr <= phyp_dump_info->init_reserve_start +
+            phyp_dump_info->init_reserve_size))
+               reserved_area_size += length;
+
+       if ((addr >= phyp_dump_info->reserved_scratch_addr) &&
+           (addr <= phyp_dump_info->reserved_scratch_addr +
+            phyp_dump_info->reserved_scratch_size))
+               scratch_area_size += length;
+
+       if ((reserved_area_size == phyp_dump_info->init_reserve_size) &&
+           (scratch_area_size == phyp_dump_info->reserved_scratch_size)) {
+
+               invalidate_last_dump(&phdr,
+                               phyp_dump_info->reserved_scratch_addr);
+               register_dump_area(&phdr,
+                               phyp_dump_info->reserved_scratch_addr);
+       }
+}
+
+/* ------------------------------------------------- */
+/**
+ * sysfs_release_region -- sysfs interface to release memory range.
+ *
+ * Usage:
+ *   "echo <start addr> <length> > /sys/kernel/release_region"
+ *
+ * Example:
+ *   "echo 0x40000000 0x10000000 > /sys/kernel/release_region"
+ *
+ * will release 256MB starting at 1GB.
+ */
+static ssize_t store_release_region(struct kobject *kobj,
+                               struct kobj_attribute *attr,
+                               const char *buf, size_t count)
+{
+       unsigned long start_addr, length, end_addr;
+       unsigned long start_pfn, nr_pages;
+       ssize_t ret;
+
+       ret = sscanf(buf, "%lx %lx", &start_addr, &length);
+       if (ret != 2)
+               return -EINVAL;
+
+       track_freed_range(start_addr, length);
+
+       /* Range-check - don't free any reserved memory that
+        * wasn't reserved for phyp-dump */
+       if (start_addr < phyp_dump_info->init_reserve_start)
+               start_addr = phyp_dump_info->init_reserve_start;
+
+       end_addr = phyp_dump_info->init_reserve_start +
+                       phyp_dump_info->init_reserve_size;
+       if (start_addr+length > end_addr)
+               length = end_addr - start_addr;
+
+       /* Release the region of memory assed in by user */
+       start_pfn = PFN_DOWN(start_addr);
+       nr_pages = PFN_DOWN(length);
+       release_memory_range(start_pfn, nr_pages);
+
+       return count;
+}
+
+static ssize_t show_release_region(struct kobject *kobj,
+                       struct kobj_attribute *attr, char *buf)
+{
+       u64 second_addr_range;
+
+       /* total reserved size - start of scratch area */
+       second_addr_range = phyp_dump_info->init_reserve_size -
+                               phyp_dump_info->reserved_scratch_size;
+       return sprintf(buf, "CPU:0x%lx-0x%lx: HPTE:0x%lx-0x%lx:"
+                           " DUMP:0x%lx-0x%lx, 0x%lx-0x%lx:\n",
+               phdr.cpu_data.destination_address,
+               phdr.cpu_data.length_copied,
+               phdr.hpte_data.destination_address,
+               phdr.hpte_data.length_copied,
+               phdr.kernel_data.destination_address,
+               phdr.kernel_data.length_copied,
+               phyp_dump_info->init_reserve_start,
+               second_addr_range);
+}
+
+static struct kobj_attribute rr = __ATTR(release_region, 0600,
+                                       show_release_region,
+                                       store_release_region);
+
+static int __init phyp_dump_setup(void)
+{
+       struct device_node *rtas;
+       const struct phyp_dump_header *dump_header = NULL;
+       unsigned long dump_area_start;
+       unsigned long dump_area_length;
+       int header_len = 0;
+       int rc;
+
+       /* If no memory was reserved in early boot, there is nothing to do */
+       if (phyp_dump_info->init_reserve_size == 0)
+               return 0;
+
+       /* Return if phyp dump not supported */
+       if (!phyp_dump_info->phyp_dump_configured)
+               return -ENOSYS;
+
+       /* Is there dump data waiting for us? If there isn't,
+        * then register a new dump area, and release all of
+        * the rest of the reserved ram.
+        *
+        * The /rtas/ibm,kernel-dump rtas node is present only
+        * if there is dump data waiting for us.
+        */
+       rtas = of_find_node_by_path("/rtas");
+       if (rtas) {
+               dump_header = of_get_property(rtas, "ibm,kernel-dump",
+                                               &header_len);
+               of_node_put(rtas);
+       }
+
+       print_dump_header(dump_header);
+       dump_area_length = init_dump_header(&phdr);
+       /* align down */
+       dump_area_start = phyp_dump_info->init_reserve_start & PAGE_MASK;
+
+       if (dump_header == NULL) {
+               register_dump_area(&phdr, dump_area_start);
+               return 0;
+       }
+
+       /* re-register the dump area, if old dump was invalid */
+       if ((dump_header) && (dump_header->status & DUMP_ERROR_FLAG)) {
+               invalidate_last_dump(&phdr, dump_area_start);
+               register_dump_area(&phdr, dump_area_start);
+               return 0;
+       }
+
+       if (dump_header) {
+               phyp_dump_info->reserved_scratch_addr =
+                               dump_header->cpu_data.destination_address;
+               phyp_dump_info->reserved_scratch_size =
+                               dump_header->cpu_data.source_length +
+                               dump_header->hpte_data.source_length +
+                               dump_header->kernel_data.source_length;
+       }
+
+       /* Should we create a dump_subsys, analogous to s390/ipl.c ? */
+       rc = sysfs_create_file(kernel_kobj, &rr.attr);
+       if (rc)
+               printk(KERN_ERR "phyp-dump: unable to create sysfs file (%d)\n",
+                                                                       rc);
+
+       /* ToDo: re-register the dump area, for next time. */
+       return 0;
+}
+machine_subsys_initcall(pseries, phyp_dump_setup);
+
+int __init early_init_dt_scan_phyp_dump(unsigned long node,
+               const char *uname, int depth, void *data)
+{
+       const unsigned int *sizes;
+
+       phyp_dump_info->phyp_dump_configured = 0;
+       phyp_dump_info->phyp_dump_is_active = 0;
+
+       if (depth != 1 || strcmp(uname, "rtas") != 0)
+               return 0;
+
+       if (of_get_flat_dt_prop(node, "ibm,configure-kernel-dump", NULL))
+               phyp_dump_info->phyp_dump_configured++;
+
+       if (of_get_flat_dt_prop(node, "ibm,dump-kernel", NULL))
+               phyp_dump_info->phyp_dump_is_active++;
+
+       sizes = of_get_flat_dt_prop(node, "ibm,configure-kernel-dump-sizes",
+                                   NULL);
+       if (!sizes)
+               return 0;
+
+       if (sizes[0] == 1)
+               phyp_dump_info->cpu_state_size = *((unsigned long *)&sizes[1]);
+
+       if (sizes[3] == 2)
+               phyp_dump_info->hpte_region_size =
+                                               *((unsigned long *)&sizes[4]);
+       return 1;
+}
+
+/* Look for phyp_dump= cmdline option */
+static int __init early_phyp_dump_enabled(char *p)
+{
+       phyp_dump_info->phyp_dump_at_boot = 1;
+
+        if (!p)
+                return 0;
+
+        if (strncmp(p, "1", 1) == 0)
+               phyp_dump_info->phyp_dump_at_boot = 1;
+        else if (strncmp(p, "0", 1) == 0)
+               phyp_dump_info->phyp_dump_at_boot = 0;
+
+        return 0;
+}
+early_param("phyp_dump", early_phyp_dump_enabled);
+
+/* Look for phyp_dump_reserve_size= cmdline option */
+static int __init early_phyp_dump_reserve_size(char *p)
+{
+        if (p)
+               phyp_dump_info->reserve_bootvar = memparse(p, &p);
+
+        return 0;
+}
+early_param("phyp_dump_reserve_size", early_phyp_dump_reserve_size);
index 61136d019554944e1c681da0b191504a6a7b94ca..9e17c0d2a0c89186e71390d02a5f19b6659993b3 100644 (file)
@@ -38,4 +38,6 @@ extern void pSeries_final_fixup(void);
 /* Poweron flag used for enabling auto ups restart */
 extern unsigned long rtas_poweron_auto;
 
+extern void find_udbg_vterm(void);
+
 #endif /* _PSERIES_PSERIES_H */
index 2800fced8c7c2952425620f3e6d32373608b4757..ac75c10de27842a967cfc3bc4d9333840d055e2f 100644 (file)
@@ -222,14 +222,14 @@ static char * parse_next_property(char *buf, char *end, char **name, int *length
        tmp = strchr(buf, ' ');
        if (!tmp) {
                printk(KERN_ERR "property parse failed in %s at line %d\n",
-                      __FUNCTION__, __LINE__);
+                      __func__, __LINE__);
                return NULL;
        }
        *tmp = '\0';
 
        if (++tmp >= end) {
                printk(KERN_ERR "property parse failed in %s at line %d\n",
-                      __FUNCTION__, __LINE__);
+                      __func__, __LINE__);
                return NULL;
        }
 
@@ -238,12 +238,12 @@ static char * parse_next_property(char *buf, char *end, char **name, int *length
        *length = simple_strtoul(tmp, &tmp, 10);
        if (*length == -1) {
                printk(KERN_ERR "property parse failed in %s at line %d\n",
-                      __FUNCTION__, __LINE__);
+                      __func__, __LINE__);
                return NULL;
        }
        if (*tmp != ' ' || ++tmp >= end) {
                printk(KERN_ERR "property parse failed in %s at line %d\n",
-                      __FUNCTION__, __LINE__);
+                      __func__, __LINE__);
                return NULL;
        }
 
@@ -252,12 +252,12 @@ static char * parse_next_property(char *buf, char *end, char **name, int *length
        tmp += *length;
        if (tmp > end) {
                printk(KERN_ERR "property parse failed in %s at line %d\n",
-                      __FUNCTION__, __LINE__);
+                      __func__, __LINE__);
                return NULL;
        }
        else if (tmp < end && *tmp != ' ' && *tmp != '\0') {
                printk(KERN_ERR "property parse failed in %s at line %d\n",
-                      __FUNCTION__, __LINE__);
+                      __func__, __LINE__);
                return NULL;
        }
        tmp++;
index 8e1ef168e2ddfd67c111b0059e994f640ef17b57..e5b0ea87016495743f6dac0856da16d277a8fc03 100644 (file)
@@ -195,31 +195,30 @@ const struct file_operations scanlog_fops = {
 static int __init scanlog_init(void)
 {
        struct proc_dir_entry *ent;
+       void *data;
+       int err = -ENOMEM;
 
        ibm_scan_log_dump = rtas_token("ibm,scan-log-dump");
-       if (ibm_scan_log_dump == RTAS_UNKNOWN_SERVICE) {
-               printk(KERN_ERR "scan-log-dump not implemented on this system\n");
-               return -EIO;
-       }
+       if (ibm_scan_log_dump == RTAS_UNKNOWN_SERVICE)
+               return -ENODEV;
 
-        ent = create_proc_entry("ppc64/rtas/scan-log-dump",  S_IRUSR, NULL);
-       if (ent) {
-               ent->proc_fops = &scanlog_fops;
-               /* Ideally we could allocate a buffer < 4G */
-               ent->data = kmalloc(RTAS_DATA_BUF_SIZE, GFP_KERNEL);
-               if (!ent->data) {
-                       printk(KERN_ERR "Failed to allocate a buffer\n");
-                       remove_proc_entry("scan-log-dump", ent->parent);
-                       return -ENOMEM;
-               }
-               ((unsigned int *)ent->data)[0] = 0;
-       } else {
-               printk(KERN_ERR "Failed to create ppc64/scan-log-dump proc entry\n");
-               return -EIO;
-       }
+       /* Ideally we could allocate a buffer < 4G */
+       data = kzalloc(RTAS_DATA_BUF_SIZE, GFP_KERNEL);
+       if (!data)
+               goto err;
+
+       ent = proc_create("ppc64/rtas/scan-log-dump", S_IRUSR, NULL,
+                         &scanlog_fops);
+       if (!ent)
+               goto err;
+
+       ent->data = data;
        proc_ppc64_scan_log_dump = ent;
 
        return 0;
+err:
+       kfree(data);
+       return err;
 }
 
 static void __exit scanlog_cleanup(void)
index fdb9b1c8f977e06704c714ff5d0c54366923fef4..f66aa9c3b13563dff365a0ae60c53c58011145eb 100644 (file)
@@ -76,9 +76,6 @@
 #define DBG(fmt...)
 #endif
 
-/* move those away to a .h */
-extern void find_udbg_vterm(void);
-
 int fwnmi_active;  /* TRUE if an FWNMI handler is present */
 
 static void pseries_shared_idle_sleep(void);
@@ -127,14 +124,60 @@ void pseries_8259_cascade(unsigned int irq, struct irq_desc *desc)
        desc->chip->eoi(irq);
 }
 
-static void __init pseries_mpic_init_IRQ(void)
+static void __init pseries_setup_i8259_cascade(void)
 {
-       struct device_node *np, *old, *cascade = NULL;
-        const unsigned int *addrp;
+       struct device_node *np, *old, *found = NULL;
+       unsigned int cascade;
+       const u32 *addrp;
        unsigned long intack = 0;
+       int naddr;
+
+       for_each_node_by_type(np, "interrupt-controller") {
+               if (of_device_is_compatible(np, "chrp,iic")) {
+                       found = np;
+                       break;
+               }
+       }
+
+       if (found == NULL) {
+               printk(KERN_DEBUG "pic: no ISA interrupt controller\n");
+               return;
+       }
+
+       cascade = irq_of_parse_and_map(found, 0);
+       if (cascade == NO_IRQ) {
+               printk(KERN_ERR "pic: failed to map cascade interrupt");
+               return;
+       }
+       pr_debug("pic: cascade mapped to irq %d\n", cascade);
+
+       for (old = of_node_get(found); old != NULL ; old = np) {
+               np = of_get_parent(old);
+               of_node_put(old);
+               if (np == NULL)
+                       break;
+               if (strcmp(np->name, "pci") != 0)
+                       continue;
+               addrp = of_get_property(np, "8259-interrupt-acknowledge", NULL);
+               if (addrp == NULL)
+                       continue;
+               naddr = of_n_addr_cells(np);
+               intack = addrp[naddr-1];
+               if (naddr > 1)
+                       intack |= ((unsigned long)addrp[naddr-2]) << 32;
+       }
+       if (intack)
+               printk(KERN_DEBUG "pic: PCI 8259 intack at 0x%016lx\n", intack);
+       i8259_init(found, intack);
+       of_node_put(found);
+       set_irq_chained_handler(cascade, pseries_8259_cascade);
+}
+
+static void __init pseries_mpic_init_IRQ(void)
+{
+       struct device_node *np;
        const unsigned int *opprop;
        unsigned long openpic_addr = 0;
-       unsigned int cascade_irq;
        int naddr, n, i, opplen;
        struct mpic *mpic;
 
@@ -167,43 +210,13 @@ static void __init pseries_mpic_init_IRQ(void)
        mpic_init(mpic);
 
        /* Look for cascade */
-       for_each_node_by_type(np, "interrupt-controller")
-               if (of_device_is_compatible(np, "chrp,iic")) {
-                       cascade = np;
-                       break;
-               }
-       if (cascade == NULL)
-               return;
-
-       cascade_irq = irq_of_parse_and_map(cascade, 0);
-       if (cascade_irq == NO_IRQ) {
-               printk(KERN_ERR "mpic: failed to map cascade interrupt");
-               return;
-       }
+       pseries_setup_i8259_cascade();
+}
 
-       /* Check ACK type */
-       for (old = of_node_get(cascade); old != NULL ; old = np) {
-               np = of_get_parent(old);
-               of_node_put(old);
-               if (np == NULL)
-                       break;
-               if (strcmp(np->name, "pci") != 0)
-                       continue;
-               addrp = of_get_property(np, "8259-interrupt-acknowledge",
-                                           NULL);
-               if (addrp == NULL)
-                       continue;
-               naddr = of_n_addr_cells(np);
-               intack = addrp[naddr-1];
-               if (naddr > 1)
-                       intack |= ((unsigned long)addrp[naddr-2]) << 32;
-       }
-       if (intack)
-               printk(KERN_DEBUG "mpic: PCI 8259 intack at 0x%016lx\n",
-                      intack);
-       i8259_init(cascade, intack);
-       of_node_put(cascade);
-       set_irq_chained_handler(cascade_irq, pseries_8259_cascade);
+static void __init pseries_xics_init_IRQ(void)
+{
+       xics_init_IRQ();
+       pseries_setup_i8259_cascade();
 }
 
 static void pseries_lpar_enable_pmcs(void)
@@ -235,7 +248,7 @@ static void __init pseries_discover_pic(void)
                        smp_init_pseries_mpic();
                        return;
                } else if (strstr(typep, "ppc-xicp")) {
-                       ppc_md.init_IRQ       = xics_init_IRQ;
+                       ppc_md.init_IRQ       = pseries_xics_init_IRQ;
                        setup_kexec_cpu_down_xics();
                        smp_init_pseries_xics();
                        return;
@@ -393,6 +406,7 @@ static void pseries_dedicated_idle_sleep(void)
 { 
        unsigned int cpu = smp_processor_id();
        unsigned long start_snooze;
+       unsigned long in_purr, out_purr;
 
        /*
         * Indicate to the HV that we are idle. Now would be
@@ -400,6 +414,7 @@ static void pseries_dedicated_idle_sleep(void)
         */
        get_lppaca()->idle = 1;
        get_lppaca()->donate_dedicated_cpu = 1;
+       in_purr = mfspr(SPRN_PURR);
 
        /*
         * We come in with interrupts disabled, and need_resched()
@@ -432,6 +447,8 @@ static void pseries_dedicated_idle_sleep(void)
 
 out:
        HMT_medium();
+       out_purr = mfspr(SPRN_PURR);
+       get_lppaca()->wait_state_cycles += out_purr - in_purr;
        get_lppaca()->donate_dedicated_cpu = 0;
        get_lppaca()->idle = 0;
 }
index a977f200db895c6bbdfd4f98cc60a69af65912df..43df53c30aa079cd390f6dd06ac9ccd47d9f0a10 100644 (file)
@@ -516,6 +516,8 @@ static struct irq_chip xics_pic_lpar = {
        .set_affinity = xics_set_affinity
 };
 
+/* Points to the irq_chip we're actually using */
+static struct irq_chip *xics_irq_chip;
 
 static int xics_host_match(struct irq_host *h, struct device_node *node)
 {
@@ -526,23 +528,13 @@ static int xics_host_match(struct irq_host *h, struct device_node *node)
        return !of_device_is_compatible(node, "chrp,iic");
 }
 
-static int xics_host_map_direct(struct irq_host *h, unsigned int virq,
-                               irq_hw_number_t hw)
+static int xics_host_map(struct irq_host *h, unsigned int virq,
+                        irq_hw_number_t hw)
 {
-       pr_debug("xics: map_direct virq %d, hwirq 0x%lx\n", virq, hw);
+       pr_debug("xics: map virq %d, hwirq 0x%lx\n", virq, hw);
 
        get_irq_desc(virq)->status |= IRQ_LEVEL;
-       set_irq_chip_and_handler(virq, &xics_pic_direct, handle_fasteoi_irq);
-       return 0;
-}
-
-static int xics_host_map_lpar(struct irq_host *h, unsigned int virq,
-                             irq_hw_number_t hw)
-{
-       pr_debug("xics: map_direct virq %d, hwirq 0x%lx\n", virq, hw);
-
-       get_irq_desc(virq)->status |= IRQ_LEVEL;
-       set_irq_chip_and_handler(virq, &xics_pic_lpar, handle_fasteoi_irq);
+       set_irq_chip_and_handler(virq, xics_irq_chip, handle_fasteoi_irq);
        return 0;
 }
 
@@ -561,27 +553,20 @@ static int xics_host_xlate(struct irq_host *h, struct device_node *ct,
        return 0;
 }
 
-static struct irq_host_ops xics_host_direct_ops = {
+static struct irq_host_ops xics_host_ops = {
        .match = xics_host_match,
-       .map = xics_host_map_direct,
-       .xlate = xics_host_xlate,
-};
-
-static struct irq_host_ops xics_host_lpar_ops = {
-       .match = xics_host_match,
-       .map = xics_host_map_lpar,
+       .map = xics_host_map,
        .xlate = xics_host_xlate,
 };
 
 static void __init xics_init_host(void)
 {
-       struct irq_host_ops *ops;
-
        if (firmware_has_feature(FW_FEATURE_LPAR))
-               ops = &xics_host_lpar_ops;
+               xics_irq_chip = &xics_pic_lpar;
        else
-               ops = &xics_host_direct_ops;
-       xics_host = irq_alloc_host(NULL, IRQ_HOST_MAP_TREE, 0, ops,
+               xics_irq_chip = &xics_pic_direct;
+
+       xics_host = irq_alloc_host(NULL, IRQ_HOST_MAP_TREE, 0, &xics_host_ops,
                                   XICS_IRQ_SPURIOUS);
        BUG_ON(xics_host == NULL);
        irq_set_default_host(xics_host);
@@ -655,52 +640,6 @@ static void __init xics_init_one_node(struct device_node *np,
        }
 }
 
-
-static void __init xics_setup_8259_cascade(void)
-{
-       struct device_node *np, *old, *found = NULL;
-       int cascade, naddr;
-       const u32 *addrp;
-       unsigned long intack = 0;
-
-       for_each_node_by_type(np, "interrupt-controller")
-               if (of_device_is_compatible(np, "chrp,iic")) {
-                       found = np;
-                       break;
-               }
-       if (found == NULL) {
-               printk(KERN_DEBUG "xics: no ISA interrupt controller\n");
-               return;
-       }
-       cascade = irq_of_parse_and_map(found, 0);
-       if (cascade == NO_IRQ) {
-               printk(KERN_ERR "xics: failed to map cascade interrupt");
-               return;
-       }
-       pr_debug("xics: cascade mapped to irq %d\n", cascade);
-
-       for (old = of_node_get(found); old != NULL ; old = np) {
-               np = of_get_parent(old);
-               of_node_put(old);
-               if (np == NULL)
-                       break;
-               if (strcmp(np->name, "pci") != 0)
-                       continue;
-               addrp = of_get_property(np, "8259-interrupt-acknowledge", NULL);
-               if (addrp == NULL)
-                       continue;
-               naddr = of_n_addr_cells(np);
-               intack = addrp[naddr-1];
-               if (naddr > 1)
-                       intack |= ((unsigned long)addrp[naddr-2]) << 32;
-       }
-       if (intack)
-               printk(KERN_DEBUG "xics: PCI 8259 intack at 0x%016lx\n", intack);
-       i8259_init(found, intack);
-       of_node_put(found);
-       set_irq_chained_handler(cascade, pseries_8259_cascade);
-}
-
 void __init xics_init_IRQ(void)
 {
        struct device_node *np;
@@ -733,8 +672,6 @@ void __init xics_init_IRQ(void)
 
        xics_setup_cpu();
 
-       xics_setup_8259_cascade();
-
        ppc64_boot_msg(0x21, "XICS Done");
 }
 
index c26bcff47b6dbbb9912cf3fc895da24bfd288444..1c5321ae8f2f06a507a7ecbdccfd076077c00144 100644 (file)
@@ -28,7 +28,4 @@ struct xics_ipi_struct {
 
 extern struct xics_ipi_struct xics_ipi_message[NR_CPUS] __cacheline_aligned;
 
-struct irq_desc;
-extern void pseries_8259_cascade(unsigned int irq, struct irq_desc *desc);
-
 #endif /* _POWERPC_KERNEL_XICS_H */
index 15f3e8527d770b3fda725e9b5cd84339b04893fc..6d386d0071a07e5bb59571d57b8a46e9793ae3ed 100644 (file)
@@ -12,6 +12,7 @@ obj-$(CONFIG_U3_DART)         += dart_iommu.o
 obj-$(CONFIG_MMIO_NVRAM)       += mmio_nvram.o
 obj-$(CONFIG_FSL_SOC)          += fsl_soc.o
 obj-$(CONFIG_FSL_PCI)          += fsl_pci.o
+obj-$(CONFIG_FSL_LBC)          += fsl_lbc.o
 obj-$(CONFIG_RAPIDIO)          += fsl_rio.o
 obj-$(CONFIG_TSI108_BRIDGE)    += tsi108_pci.o tsi108_dev.o
 obj-$(CONFIG_QUICC_ENGINE)     += qe_lib/
@@ -27,6 +28,7 @@ obj-$(CONFIG_PPC_INDIRECT_PCI)        += indirect_pci.o
 obj-$(CONFIG_PPC_I8259)                += i8259.o
 obj-$(CONFIG_IPIC)             += ipic.o
 obj-$(CONFIG_4xx)              += uic.o
+obj-$(CONFIG_4xx_SOC)          += ppc4xx_soc.o
 obj-$(CONFIG_XILINX_VIRTEX)    += xilinx_intc.o
 obj-$(CONFIG_OF_RTC)           += of_rtc.o
 ifeq ($(CONFIG_PCI),y)
index df8bd2b6479665ee9e56c8e163e20ebe912bcf7f..58292a086c164059e5d37a7de347003d436c7230 100644 (file)
@@ -44,9 +44,6 @@
 
 #define CPM_MAP_SIZE    (0x4000)
 
-#ifndef CONFIG_PPC_CPM_NEW_BINDING
-static void m8xx_cpm_dpinit(void);
-#endif
 cpm8xx_t __iomem *cpmp;  /* Pointer to comm processor space */
 immap_t __iomem *mpc8xx_immr;
 static cpic8xx_t __iomem *cpic_reg;
@@ -229,12 +226,7 @@ void __init cpm_reset(void)
        out_be32(&siu_conf->sc_sdcr, 1);
        immr_unmap(siu_conf);
 
-#ifdef CONFIG_PPC_CPM_NEW_BINDING
        cpm_muram_init();
-#else
-       /* Reclaim the DP memory for our use. */
-       m8xx_cpm_dpinit();
-#endif
 }
 
 static DEFINE_SPINLOCK(cmd_lock);
@@ -257,7 +249,7 @@ int cpm_command(u32 command, u8 opcode)
                if ((in_be16(&cpmp->cp_cpcr) & CPM_CR_FLG) == 0)
                        goto out;
 
-       printk(KERN_ERR "%s(): Not able to issue CPM command\n", __FUNCTION__);
+       printk(KERN_ERR "%s(): Not able to issue CPM command\n", __func__);
        ret = -EIO;
 out:
        spin_unlock_irqrestore(&cmd_lock, flags);
@@ -293,110 +285,6 @@ cpm_setbrg(uint brg, uint rate)
                              CPM_BRG_EN | CPM_BRG_DIV16);
 }
 
-#ifndef CONFIG_PPC_CPM_NEW_BINDING
-/*
- * dpalloc / dpfree bits.
- */
-static spinlock_t cpm_dpmem_lock;
-/*
- * 16 blocks should be enough to satisfy all requests
- * until the memory subsystem goes up...
- */
-static rh_block_t cpm_boot_dpmem_rh_block[16];
-static rh_info_t cpm_dpmem_info;
-
-#define CPM_DPMEM_ALIGNMENT    8
-static u8 __iomem *dpram_vbase;
-static phys_addr_t dpram_pbase;
-
-static void m8xx_cpm_dpinit(void)
-{
-       spin_lock_init(&cpm_dpmem_lock);
-
-       dpram_vbase = cpmp->cp_dpmem;
-       dpram_pbase = get_immrbase() + offsetof(immap_t, im_cpm.cp_dpmem);
-
-       /* Initialize the info header */
-       rh_init(&cpm_dpmem_info, CPM_DPMEM_ALIGNMENT,
-                       sizeof(cpm_boot_dpmem_rh_block) /
-                       sizeof(cpm_boot_dpmem_rh_block[0]),
-                       cpm_boot_dpmem_rh_block);
-
-       /*
-        * Attach the usable dpmem area.
-        * XXX: This is actually crap.  CPM_DATAONLY_BASE and
-        * CPM_DATAONLY_SIZE are a subset of the available dparm.  It varies
-        * with the processor and the microcode patches applied / activated.
-        * But the following should be at least safe.
-        */
-       rh_attach_region(&cpm_dpmem_info, CPM_DATAONLY_BASE, CPM_DATAONLY_SIZE);
-}
-
-/*
- * Allocate the requested size worth of DP memory.
- * This function returns an offset into the DPRAM area.
- * Use cpm_dpram_addr() to get the virtual address of the area.
- */
-unsigned long cpm_dpalloc(uint size, uint align)
-{
-       unsigned long start;
-       unsigned long flags;
-
-       spin_lock_irqsave(&cpm_dpmem_lock, flags);
-       cpm_dpmem_info.alignment = align;
-       start = rh_alloc(&cpm_dpmem_info, size, "commproc");
-       spin_unlock_irqrestore(&cpm_dpmem_lock, flags);
-
-       return (uint)start;
-}
-EXPORT_SYMBOL(cpm_dpalloc);
-
-int cpm_dpfree(unsigned long offset)
-{
-       int ret;
-       unsigned long flags;
-
-       spin_lock_irqsave(&cpm_dpmem_lock, flags);
-       ret = rh_free(&cpm_dpmem_info, offset);
-       spin_unlock_irqrestore(&cpm_dpmem_lock, flags);
-
-       return ret;
-}
-EXPORT_SYMBOL(cpm_dpfree);
-
-unsigned long cpm_dpalloc_fixed(unsigned long offset, uint size, uint align)
-{
-       unsigned long start;
-       unsigned long flags;
-
-       spin_lock_irqsave(&cpm_dpmem_lock, flags);
-       cpm_dpmem_info.alignment = align;
-       start = rh_alloc_fixed(&cpm_dpmem_info, offset, size, "commproc");
-       spin_unlock_irqrestore(&cpm_dpmem_lock, flags);
-
-       return start;
-}
-EXPORT_SYMBOL(cpm_dpalloc_fixed);
-
-void cpm_dpdump(void)
-{
-       rh_dump(&cpm_dpmem_info);
-}
-EXPORT_SYMBOL(cpm_dpdump);
-
-void *cpm_dpram_addr(unsigned long offset)
-{
-       return (void *)(dpram_vbase + offset);
-}
-EXPORT_SYMBOL(cpm_dpram_addr);
-
-uint cpm_dpram_phys(u8 *addr)
-{
-       return (dpram_pbase + (uint)(addr - dpram_vbase));
-}
-EXPORT_SYMBOL(cpm_dpram_phys);
-#endif /* !CONFIG_PPC_CPM_NEW_BINDING */
-
 struct cpm_ioport16 {
        __be16 dir, par, odr_sor, dat, intr;
        __be16 res[3];
index dd066bb1d562534fe54dc38a0dd0db9e8d1deb80..5a6c5dfc53ef1e0a3096aadc77a3d43958ae804b 100644 (file)
 
 #include <sysdev/fsl_soc.h>
 
-#ifndef CONFIG_PPC_CPM_NEW_BINDING
-static void cpm2_dpinit(void);
-#endif
-
 cpm_cpm2_t __iomem *cpmp; /* Pointer to comm processor space */
 
 /* We allocate this here because it is used almost exclusively for
@@ -71,15 +67,17 @@ void __init cpm2_reset(void)
 
        /* Reclaim the DP memory for our use.
         */
-#ifdef CONFIG_PPC_CPM_NEW_BINDING
        cpm_muram_init();
-#else
-       cpm2_dpinit();
-#endif
 
        /* Tell everyone where the comm processor resides.
         */
        cpmp = &cpm2_immr->im_cpm;
+
+#ifndef CONFIG_PPC_EARLY_DEBUG_CPM
+       /* Reset the CPM.
+        */
+       cpm_command(CPM_CR_RST, 0);
+#endif
 }
 
 static DEFINE_SPINLOCK(cmd_lock);
@@ -99,7 +97,7 @@ int cpm_command(u32 command, u8 opcode)
                if ((in_be32(&cpmp->cp_cpcr) & CPM_CR_FLG) == 0)
                        goto out;
 
-       printk(KERN_ERR "%s(): Not able to issue CPM command\n", __FUNCTION__);
+       printk(KERN_ERR "%s(): Not able to issue CPM command\n", __func__);
        ret = -EIO;
 out:
        spin_unlock_irqrestore(&cmd_lock, flags);
@@ -347,95 +345,6 @@ int cpm2_smc_clk_setup(enum cpm_clk_target target, int clock)
        return ret;
 }
 
-#ifndef CONFIG_PPC_CPM_NEW_BINDING
-/*
- * dpalloc / dpfree bits.
- */
-static spinlock_t cpm_dpmem_lock;
-/* 16 blocks should be enough to satisfy all requests
- * until the memory subsystem goes up... */
-static rh_block_t cpm_boot_dpmem_rh_block[16];
-static rh_info_t cpm_dpmem_info;
-static u8 __iomem *im_dprambase;
-
-static void cpm2_dpinit(void)
-{
-       spin_lock_init(&cpm_dpmem_lock);
-
-       /* initialize the info header */
-       rh_init(&cpm_dpmem_info, 1,
-                       sizeof(cpm_boot_dpmem_rh_block) /
-                       sizeof(cpm_boot_dpmem_rh_block[0]),
-                       cpm_boot_dpmem_rh_block);
-
-       im_dprambase = cpm2_immr;
-
-       /* Attach the usable dpmem area */
-       /* XXX: This is actually crap. CPM_DATAONLY_BASE and
-        * CPM_DATAONLY_SIZE is only a subset of the available dpram. It
-        * varies with the processor and the microcode patches activated.
-        * But the following should be at least safe.
-        */
-       rh_attach_region(&cpm_dpmem_info, CPM_DATAONLY_BASE, CPM_DATAONLY_SIZE);
-}
-
-/* This function returns an index into the DPRAM area.
- */
-unsigned long cpm_dpalloc(uint size, uint align)
-{
-       unsigned long start;
-       unsigned long flags;
-
-       spin_lock_irqsave(&cpm_dpmem_lock, flags);
-       cpm_dpmem_info.alignment = align;
-       start = rh_alloc(&cpm_dpmem_info, size, "commproc");
-       spin_unlock_irqrestore(&cpm_dpmem_lock, flags);
-
-       return (uint)start;
-}
-EXPORT_SYMBOL(cpm_dpalloc);
-
-int cpm_dpfree(unsigned long offset)
-{
-       int ret;
-       unsigned long flags;
-
-       spin_lock_irqsave(&cpm_dpmem_lock, flags);
-       ret = rh_free(&cpm_dpmem_info, offset);
-       spin_unlock_irqrestore(&cpm_dpmem_lock, flags);
-
-       return ret;
-}
-EXPORT_SYMBOL(cpm_dpfree);
-
-/* not sure if this is ever needed */
-unsigned long cpm_dpalloc_fixed(unsigned long offset, uint size, uint align)
-{
-       unsigned long start;
-       unsigned long flags;
-
-       spin_lock_irqsave(&cpm_dpmem_lock, flags);
-       cpm_dpmem_info.alignment = align;
-       start = rh_alloc_fixed(&cpm_dpmem_info, offset, size, "commproc");
-       spin_unlock_irqrestore(&cpm_dpmem_lock, flags);
-
-       return start;
-}
-EXPORT_SYMBOL(cpm_dpalloc_fixed);
-
-void cpm_dpdump(void)
-{
-       rh_dump(&cpm_dpmem_info);
-}
-EXPORT_SYMBOL(cpm_dpdump);
-
-void *cpm_dpram_addr(unsigned long offset)
-{
-       return (void *)(im_dprambase + offset);
-}
-EXPORT_SYMBOL(cpm_dpram_addr);
-#endif /* !CONFIG_PPC_CPM_NEW_BINDING */
-
 struct cpm2_ioports {
        u32 dir, par, sor, odr, dat;
        u32 res[3];
index 165981c87786bc2832e2f7bef8436a69663c88de..cb7df2dce44fd2a1467a123fde6480fa3a9c90ea 100644 (file)
@@ -58,7 +58,6 @@ void __init udbg_init_cpm(void)
 }
 #endif
 
-#ifdef CONFIG_PPC_CPM_NEW_BINDING
 static spinlock_t cpm_muram_lock;
 static rh_block_t cpm_boot_muram_rh_block[16];
 static rh_info_t cpm_muram_info;
@@ -199,5 +198,3 @@ dma_addr_t cpm_muram_dma(void __iomem *addr)
        return muram_pbase + ((u8 __iomem *)addr - muram_vbase);
 }
 EXPORT_SYMBOL(cpm_muram_dma);
-
-#endif /* CONFIG_PPC_CPM_NEW_BINDING */
index e0e24b01e3a61c5138ff110e40c3a66c219ffa36..005c2ecf976fe810f2f02ddee3f78200d8d3f010 100644 (file)
@@ -37,6 +37,7 @@
 #include <linux/dma-mapping.h>
 #include <linux/vmalloc.h>
 #include <linux/suspend.h>
+#include <linux/lmb.h>
 #include <asm/io.h>
 #include <asm/prom.h>
 #include <asm/iommu.h>
@@ -44,7 +45,6 @@
 #include <asm/machdep.h>
 #include <asm/abs_addr.h>
 #include <asm/cacheflush.h>
-#include <asm/lmb.h>
 #include <asm/ppc-pci.h>
 
 #include "dart.h"
diff --git a/arch/powerpc/sysdev/fsl_lbc.c b/arch/powerpc/sysdev/fsl_lbc.c
new file mode 100644 (file)
index 0000000..422c8fa
--- /dev/null
@@ -0,0 +1,129 @@
+/*
+ * Freescale LBC and UPM routines.
+ *
+ * Copyright (c) 2007-2008  MontaVista Software, Inc.
+ *
+ * Author: Anton Vorontsov <avorontsov@ru.mvista.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ */
+
+#include <linux/kernel.h>
+#include <linux/of.h>
+#include <asm/fsl_lbc.h>
+
+spinlock_t fsl_lbc_lock = __SPIN_LOCK_UNLOCKED(fsl_lbc_lock);
+
+struct fsl_lbc_regs __iomem *fsl_lbc_regs;
+EXPORT_SYMBOL(fsl_lbc_regs);
+
+static char __initdata *compat_lbc[] = {
+       "fsl,pq2-localbus",
+       "fsl,pq2pro-localbus",
+       "fsl,pq3-localbus",
+       "fsl,elbc",
+};
+
+static int __init fsl_lbc_init(void)
+{
+       struct device_node *lbus;
+       int i;
+
+       for (i = 0; i < ARRAY_SIZE(compat_lbc); i++) {
+               lbus = of_find_compatible_node(NULL, NULL, compat_lbc[i]);
+               if (lbus)
+                       goto found;
+       }
+       return -ENODEV;
+
+found:
+       fsl_lbc_regs = of_iomap(lbus, 0);
+       of_node_put(lbus);
+       if (!fsl_lbc_regs)
+               return -ENOMEM;
+       return 0;
+}
+arch_initcall(fsl_lbc_init);
+
+/**
+ * fsl_lbc_find - find Localbus bank
+ * @addr_base: base address of the memory bank
+ *
+ * This function walks LBC banks comparing "Base address" field of the BR
+ * registers with the supplied addr_base argument. When bases match this
+ * function returns bank number (starting with 0), otherwise it returns
+ * appropriate errno value.
+ */
+int fsl_lbc_find(phys_addr_t addr_base)
+{
+       int i;
+
+       if (!fsl_lbc_regs)
+               return -ENODEV;
+
+       for (i = 0; i < ARRAY_SIZE(fsl_lbc_regs->bank); i++) {
+               __be32 br = in_be32(&fsl_lbc_regs->bank[i].br);
+               __be32 or = in_be32(&fsl_lbc_regs->bank[i].or);
+
+               if (br & BR_V && (br & or & BR_BA) == addr_base)
+                       return i;
+       }
+
+       return -ENOENT;
+}
+EXPORT_SYMBOL(fsl_lbc_find);
+
+/**
+ * fsl_upm_find - find pre-programmed UPM via base address
+ * @addr_base: base address of the memory bank controlled by the UPM
+ * @upm:       pointer to the allocated fsl_upm structure
+ *
+ * This function fills fsl_upm structure so you can use it with the rest of
+ * UPM API. On success this function returns 0, otherwise it returns
+ * appropriate errno value.
+ */
+int fsl_upm_find(phys_addr_t addr_base, struct fsl_upm *upm)
+{
+       int bank;
+       __be32 br;
+
+       bank = fsl_lbc_find(addr_base);
+       if (bank < 0)
+               return bank;
+
+       br = in_be32(&fsl_lbc_regs->bank[bank].br);
+
+       switch (br & BR_MSEL) {
+       case BR_MS_UPMA:
+               upm->mxmr = &fsl_lbc_regs->mamr;
+               break;
+       case BR_MS_UPMB:
+               upm->mxmr = &fsl_lbc_regs->mbmr;
+               break;
+       case BR_MS_UPMC:
+               upm->mxmr = &fsl_lbc_regs->mcmr;
+               break;
+       default:
+               return -EINVAL;
+       }
+
+       switch (br & BR_PS) {
+       case BR_PS_8:
+               upm->width = 8;
+               break;
+       case BR_PS_16:
+               upm->width = 16;
+               break;
+       case BR_PS_32:
+               upm->width = 32;
+               break;
+       default:
+               return -EINVAL;
+       }
+
+       return 0;
+}
+EXPORT_SYMBOL(fsl_upm_find);
index 3581416905eaca520485af0cdd13e5b8b7c6935d..5c1b246aacccbd37d55027b1087150bdc8f2f9ec 100644 (file)
@@ -75,6 +75,33 @@ phys_addr_t get_immrbase(void)
 
 EXPORT_SYMBOL(get_immrbase);
 
+static u32 sysfreq = -1;
+
+u32 fsl_get_sys_freq(void)
+{
+       struct device_node *soc;
+       const u32 *prop;
+       int size;
+
+       if (sysfreq != -1)
+               return sysfreq;
+
+       soc = of_find_node_by_type(NULL, "soc");
+       if (!soc)
+               return -1;
+
+       prop = of_get_property(soc, "clock-frequency", &size);
+       if (!prop || size != sizeof(*prop) || *prop == 0)
+               prop = of_get_property(soc, "bus-frequency", &size);
+
+       if (prop && size == sizeof(*prop))
+               sysfreq = *prop;
+
+       of_node_put(soc);
+       return sysfreq;
+}
+EXPORT_SYMBOL(fsl_get_sys_freq);
+
 #if defined(CONFIG_CPM2) || defined(CONFIG_QUICC_ENGINE) || defined(CONFIG_8xx)
 
 static u32 brgfreq = -1;
@@ -517,9 +544,9 @@ arch_initcall(fsl_i2c_of_init);
 static int __init mpc83xx_wdt_init(void)
 {
        struct resource r;
-       struct device_node *soc, *np;
+       struct device_node *np;
        struct platform_device *dev;
-       const unsigned int *freq;
+       u32 freq = fsl_get_sys_freq();
        int ret;
 
        np = of_find_compatible_node(NULL, "watchdog", "mpc83xx_wdt");
@@ -529,19 +556,6 @@ static int __init mpc83xx_wdt_init(void)
                goto nodev;
        }
 
-       soc = of_find_node_by_type(NULL, "soc");
-
-       if (!soc) {
-               ret = -ENODEV;
-               goto nosoc;
-       }
-
-       freq = of_get_property(soc, "bus-frequency", NULL);
-       if (!freq) {
-               ret = -ENODEV;
-               goto err;
-       }
-
        memset(&r, 0, sizeof(r));
 
        ret = of_address_to_resource(np, 0, &r);
@@ -554,20 +568,16 @@ static int __init mpc83xx_wdt_init(void)
                goto err;
        }
 
-       ret = platform_device_add_data(dev, freq, sizeof(int));
+       ret = platform_device_add_data(dev, &freq, sizeof(freq));
        if (ret)
                goto unreg;
 
-       of_node_put(soc);
        of_node_put(np);
-
        return 0;
 
 unreg:
        platform_device_unregister(dev);
 err:
-       of_node_put(soc);
-nosoc:
        of_node_put(np);
 nodev:
        return ret;
@@ -736,547 +746,6 @@ err:
 
 arch_initcall(fsl_usb_of_init);
 
-#ifndef CONFIG_PPC_CPM_NEW_BINDING
-#ifdef CONFIG_CPM2
-
-extern void init_scc_ioports(struct fs_uart_platform_info*);
-
-static const char fcc_regs[] = "fcc_regs";
-static const char fcc_regs_c[] = "fcc_regs_c";
-static const char fcc_pram[] = "fcc_pram";
-static char bus_id[9][BUS_ID_SIZE];
-
-static int __init fs_enet_of_init(void)
-{
-       struct device_node *np;
-       unsigned int i;
-       struct platform_device *fs_enet_dev;
-       struct resource res;
-       int ret;
-
-       for (np = NULL, i = 0;
-            (np = of_find_compatible_node(np, "network", "fs_enet")) != NULL;
-            i++) {
-               struct resource r[4];
-               struct device_node *phy, *mdio;
-               struct fs_platform_info fs_enet_data;
-               const unsigned int *id, *phy_addr, *phy_irq;
-               const void *mac_addr;
-               const phandle *ph;
-               const char *model;
-
-               memset(r, 0, sizeof(r));
-               memset(&fs_enet_data, 0, sizeof(fs_enet_data));
-
-               ret = of_address_to_resource(np, 0, &r[0]);
-               if (ret)
-                       goto err;
-               r[0].name = fcc_regs;
-
-               ret = of_address_to_resource(np, 1, &r[1]);
-               if (ret)
-                       goto err;
-               r[1].name = fcc_pram;
-
-               ret = of_address_to_resource(np, 2, &r[2]);
-               if (ret)
-                       goto err;
-               r[2].name = fcc_regs_c;
-               fs_enet_data.fcc_regs_c = r[2].start;
-
-               of_irq_to_resource(np, 0, &r[3]);
-
-               fs_enet_dev =
-                   platform_device_register_simple("fsl-cpm-fcc", i, &r[0], 4);
-
-               if (IS_ERR(fs_enet_dev)) {
-                       ret = PTR_ERR(fs_enet_dev);
-                       goto err;
-               }
-
-               model = of_get_property(np, "model", NULL);
-               if (model == NULL) {
-                       ret = -ENODEV;
-                       goto unreg;
-               }
-
-               mac_addr = of_get_mac_address(np);
-               if (mac_addr)
-                       memcpy(fs_enet_data.macaddr, mac_addr, 6);
-
-               ph = of_get_property(np, "phy-handle", NULL);
-               phy = of_find_node_by_phandle(*ph);
-
-               if (phy == NULL) {
-                       ret = -ENODEV;
-                       goto unreg;
-               }
-
-               phy_addr = of_get_property(phy, "reg", NULL);
-               fs_enet_data.phy_addr = *phy_addr;
-
-               phy_irq = of_get_property(phy, "interrupts", NULL);
-
-               id = of_get_property(np, "device-id", NULL);
-               fs_enet_data.fs_no = *id;
-               strcpy(fs_enet_data.fs_type, model);
-
-               mdio = of_get_parent(phy);
-                ret = of_address_to_resource(mdio, 0, &res);
-                if (ret) {
-                        of_node_put(phy);
-                        of_node_put(mdio);
-                        goto unreg;
-                }
-
-               fs_enet_data.clk_rx = *((u32 *)of_get_property(np,
-                                               "rx-clock", NULL));
-               fs_enet_data.clk_tx = *((u32 *)of_get_property(np,
-                                               "tx-clock", NULL));
-
-               if (strstr(model, "FCC")) {
-                       int fcc_index = *id - 1;
-                       const unsigned char *mdio_bb_prop;
-
-                       fs_enet_data.dpram_offset = (u32)cpm_dpram_addr(0);
-                       fs_enet_data.rx_ring = 32;
-                       fs_enet_data.tx_ring = 32;
-                       fs_enet_data.rx_copybreak = 240;
-                       fs_enet_data.use_napi = 0;
-                       fs_enet_data.napi_weight = 17;
-                       fs_enet_data.mem_offset = FCC_MEM_OFFSET(fcc_index);
-                       fs_enet_data.cp_page = CPM_CR_FCC_PAGE(fcc_index);
-                       fs_enet_data.cp_block = CPM_CR_FCC_SBLOCK(fcc_index);
-
-                       snprintf((char*)&bus_id[(*id)], BUS_ID_SIZE, "%x:%02x",
-                                                       (u32)res.start, fs_enet_data.phy_addr);
-                       fs_enet_data.bus_id = (char*)&bus_id[(*id)];
-                       fs_enet_data.init_ioports = init_fcc_ioports;
-
-                       mdio_bb_prop = of_get_property(phy, "bitbang", NULL);
-                       if (mdio_bb_prop) {
-                               struct platform_device *fs_enet_mdio_bb_dev;
-                               struct fs_mii_bb_platform_info fs_enet_mdio_bb_data;
-
-                               fs_enet_mdio_bb_dev =
-                                       platform_device_register_simple("fsl-bb-mdio",
-                                                       i, NULL, 0);
-                               memset(&fs_enet_mdio_bb_data, 0,
-                                               sizeof(struct fs_mii_bb_platform_info));
-                               fs_enet_mdio_bb_data.mdio_dat.bit =
-                                       mdio_bb_prop[0];
-                               fs_enet_mdio_bb_data.mdio_dir.bit =
-                                       mdio_bb_prop[1];
-                               fs_enet_mdio_bb_data.mdc_dat.bit =
-                                       mdio_bb_prop[2];
-                               fs_enet_mdio_bb_data.mdio_port =
-                                       mdio_bb_prop[3];
-                               fs_enet_mdio_bb_data.mdc_port =
-                                       mdio_bb_prop[4];
-                               fs_enet_mdio_bb_data.delay =
-                                       mdio_bb_prop[5];
-
-                               fs_enet_mdio_bb_data.irq[0] = phy_irq[0];
-                               fs_enet_mdio_bb_data.irq[1] = -1;
-                               fs_enet_mdio_bb_data.irq[2] = -1;
-                               fs_enet_mdio_bb_data.irq[3] = phy_irq[0];
-                               fs_enet_mdio_bb_data.irq[31] = -1;
-
-                               fs_enet_mdio_bb_data.mdio_dat.offset =
-                                       (u32)&cpm2_immr->im_ioport.iop_pdatc;
-                               fs_enet_mdio_bb_data.mdio_dir.offset =
-                                       (u32)&cpm2_immr->im_ioport.iop_pdirc;
-                               fs_enet_mdio_bb_data.mdc_dat.offset =
-                                       (u32)&cpm2_immr->im_ioport.iop_pdatc;
-
-                               ret = platform_device_add_data(
-                                               fs_enet_mdio_bb_dev,
-                                               &fs_enet_mdio_bb_data,
-                                               sizeof(struct fs_mii_bb_platform_info));
-                               if (ret)
-                                       goto unreg;
-                       }
-
-                       of_node_put(phy);
-                       of_node_put(mdio);
-
-                       ret = platform_device_add_data(fs_enet_dev, &fs_enet_data,
-                                                    sizeof(struct
-                                                           fs_platform_info));
-                       if (ret)
-                               goto unreg;
-               }
-       }
-       return 0;
-
-unreg:
-       platform_device_unregister(fs_enet_dev);
-err:
-       return ret;
-}
-
-arch_initcall(fs_enet_of_init);
-
-static const char scc_regs[] = "regs";
-static const char scc_pram[] = "pram";
-
-static int __init cpm_uart_of_init(void)
-{
-       struct device_node *np;
-       unsigned int i;
-       struct platform_device *cpm_uart_dev;
-       int ret;
-
-       for (np = NULL, i = 0;
-            (np = of_find_compatible_node(np, "serial", "cpm_uart")) != NULL;
-            i++) {
-               struct resource r[3];
-               struct fs_uart_platform_info cpm_uart_data;
-               const int *id;
-               const char *model;
-
-               memset(r, 0, sizeof(r));
-               memset(&cpm_uart_data, 0, sizeof(cpm_uart_data));
-
-               ret = of_address_to_resource(np, 0, &r[0]);
-               if (ret)
-                       goto err;
-
-               r[0].name = scc_regs;
-
-               ret = of_address_to_resource(np, 1, &r[1]);
-               if (ret)
-                       goto err;
-               r[1].name = scc_pram;
-
-               of_irq_to_resource(np, 0, &r[2]);
-
-               cpm_uart_dev =
-                   platform_device_register_simple("fsl-cpm-scc:uart", i, &r[0], 3);
-
-               if (IS_ERR(cpm_uart_dev)) {
-                       ret = PTR_ERR(cpm_uart_dev);
-                       goto err;
-               }
-
-               id = of_get_property(np, "device-id", NULL);
-               cpm_uart_data.fs_no = *id;
-
-               model = of_get_property(np, "model", NULL);
-               strcpy(cpm_uart_data.fs_type, model);
-
-               cpm_uart_data.uart_clk = ppc_proc_freq;
-
-               cpm_uart_data.tx_num_fifo = 4;
-               cpm_uart_data.tx_buf_size = 32;
-               cpm_uart_data.rx_num_fifo = 4;
-               cpm_uart_data.rx_buf_size = 32;
-               cpm_uart_data.clk_rx = *((u32 *)of_get_property(np,
-                                               "rx-clock", NULL));
-               cpm_uart_data.clk_tx = *((u32 *)of_get_property(np,
-                                               "tx-clock", NULL));
-
-               ret =
-                   platform_device_add_data(cpm_uart_dev, &cpm_uart_data,
-                                            sizeof(struct
-                                                   fs_uart_platform_info));
-               if (ret)
-                       goto unreg;
-       }
-
-       return 0;
-
-unreg:
-       platform_device_unregister(cpm_uart_dev);
-err:
-       return ret;
-}
-
-arch_initcall(cpm_uart_of_init);
-#endif /* CONFIG_CPM2 */
-
-#ifdef CONFIG_8xx
-
-extern void init_scc_ioports(struct fs_platform_info*);
-extern int platform_device_skip(const char *model, int id);
-
-static int __init fs_enet_mdio_of_init(void)
-{
-       struct device_node *np;
-       unsigned int i;
-       struct platform_device *mdio_dev;
-       struct resource res;
-       int ret;
-
-       for (np = NULL, i = 0;
-            (np = of_find_compatible_node(np, "mdio", "fs_enet")) != NULL;
-            i++) {
-               struct fs_mii_fec_platform_info mdio_data;
-
-               memset(&res, 0, sizeof(res));
-               memset(&mdio_data, 0, sizeof(mdio_data));
-
-               ret = of_address_to_resource(np, 0, &res);
-               if (ret)
-                       goto err;
-
-               mdio_dev =
-                   platform_device_register_simple("fsl-cpm-fec-mdio",
-                                                   res.start, &res, 1);
-               if (IS_ERR(mdio_dev)) {
-                       ret = PTR_ERR(mdio_dev);
-                       goto err;
-               }
-
-               mdio_data.mii_speed = ((((ppc_proc_freq + 4999999) / 2500000) / 2) & 0x3F) << 1;
-
-               ret =
-                   platform_device_add_data(mdio_dev, &mdio_data,
-                                            sizeof(struct fs_mii_fec_platform_info));
-               if (ret)
-                       goto unreg;
-       }
-       return 0;
-
-unreg:
-       platform_device_unregister(mdio_dev);
-err:
-       return ret;
-}
-
-arch_initcall(fs_enet_mdio_of_init);
-
-static const char *enet_regs = "regs";
-static const char *enet_pram = "pram";
-static const char *enet_irq = "interrupt";
-static char bus_id[9][BUS_ID_SIZE];
-
-static int __init fs_enet_of_init(void)
-{
-       struct device_node *np;
-       unsigned int i;
-       struct platform_device *fs_enet_dev = NULL;
-       struct resource res;
-       int ret;
-
-       for (np = NULL, i = 0;
-            (np = of_find_compatible_node(np, "network", "fs_enet")) != NULL;
-            i++) {
-               struct resource r[4];
-               struct device_node *phy = NULL, *mdio = NULL;
-               struct fs_platform_info fs_enet_data;
-               const unsigned int *id;
-               const unsigned int *phy_addr;
-               const void *mac_addr;
-               const phandle *ph;
-               const char *model;
-
-               memset(r, 0, sizeof(r));
-               memset(&fs_enet_data, 0, sizeof(fs_enet_data));
-
-               model = of_get_property(np, "model", NULL);
-               if (model == NULL) {
-                       ret = -ENODEV;
-                       goto unreg;
-               }
-
-               id = of_get_property(np, "device-id", NULL);
-               fs_enet_data.fs_no = *id;
-
-               if (platform_device_skip(model, *id))
-                       continue;
-
-               ret = of_address_to_resource(np, 0, &r[0]);
-               if (ret)
-                       goto err;
-               r[0].name = enet_regs;
-
-               mac_addr = of_get_mac_address(np);
-               if (mac_addr)
-                       memcpy(fs_enet_data.macaddr, mac_addr, 6);
-
-               ph = of_get_property(np, "phy-handle", NULL);
-               if (ph != NULL)
-                       phy = of_find_node_by_phandle(*ph);
-
-               if (phy != NULL) {
-                       phy_addr = of_get_property(phy, "reg", NULL);
-                       fs_enet_data.phy_addr = *phy_addr;
-                       fs_enet_data.has_phy = 1;
-
-                       mdio = of_get_parent(phy);
-                       ret = of_address_to_resource(mdio, 0, &res);
-                       if (ret) {
-                               of_node_put(phy);
-                               of_node_put(mdio);
-                                goto unreg;
-                       }
-               }
-
-               model = of_get_property(np, "model", NULL);
-               strcpy(fs_enet_data.fs_type, model);
-
-               if (strstr(model, "FEC")) {
-                       r[1].start = r[1].end = irq_of_parse_and_map(np, 0);
-                       r[1].flags = IORESOURCE_IRQ;
-                       r[1].name = enet_irq;
-
-                       fs_enet_dev =
-                                   platform_device_register_simple("fsl-cpm-fec", i, &r[0], 2);
-
-                       if (IS_ERR(fs_enet_dev)) {
-                               ret = PTR_ERR(fs_enet_dev);
-                               goto err;
-                       }
-
-                       fs_enet_data.rx_ring = 128;
-                       fs_enet_data.tx_ring = 16;
-                       fs_enet_data.rx_copybreak = 240;
-                       fs_enet_data.use_napi = 1;
-                       fs_enet_data.napi_weight = 17;
-
-                       snprintf((char*)&bus_id[i], BUS_ID_SIZE, "%x:%02x",
-                                                       (u32)res.start, fs_enet_data.phy_addr);
-                       fs_enet_data.bus_id = (char*)&bus_id[i];
-                       fs_enet_data.init_ioports = init_fec_ioports;
-               }
-               if (strstr(model, "SCC")) {
-                       ret = of_address_to_resource(np, 1, &r[1]);
-                       if (ret)
-                               goto err;
-                       r[1].name = enet_pram;
-
-                       r[2].start = r[2].end = irq_of_parse_and_map(np, 0);
-                       r[2].flags = IORESOURCE_IRQ;
-                       r[2].name = enet_irq;
-
-                       fs_enet_dev =
-                                   platform_device_register_simple("fsl-cpm-scc", i, &r[0], 3);
-
-                       if (IS_ERR(fs_enet_dev)) {
-                               ret = PTR_ERR(fs_enet_dev);
-                               goto err;
-                       }
-
-                       fs_enet_data.rx_ring = 64;
-                       fs_enet_data.tx_ring = 8;
-                       fs_enet_data.rx_copybreak = 240;
-                       fs_enet_data.use_napi = 1;
-                       fs_enet_data.napi_weight = 17;
-
-                       snprintf((char*)&bus_id[i], BUS_ID_SIZE, "%s", "fixed@10:1");
-                        fs_enet_data.bus_id = (char*)&bus_id[i];
-                       fs_enet_data.init_ioports = init_scc_ioports;
-               }
-
-               of_node_put(phy);
-               of_node_put(mdio);
-
-               ret = platform_device_add_data(fs_enet_dev, &fs_enet_data,
-                                            sizeof(struct
-                                                   fs_platform_info));
-               if (ret)
-                       goto unreg;
-       }
-       return 0;
-
-unreg:
-       platform_device_unregister(fs_enet_dev);
-err:
-       return ret;
-}
-
-arch_initcall(fs_enet_of_init);
-
-static int __init fsl_pcmcia_of_init(void)
-{
-       struct device_node *np;
-       /*
-        * Register all the devices which type is "pcmcia"
-        */
-       for_each_compatible_node(np, "pcmcia", "fsl,pq-pcmcia")
-               of_platform_device_create(np, "m8xx-pcmcia", NULL);
-       return 0;
-}
-
-arch_initcall(fsl_pcmcia_of_init);
-
-static const char *smc_regs = "regs";
-static const char *smc_pram = "pram";
-
-static int __init cpm_smc_uart_of_init(void)
-{
-       struct device_node *np;
-       unsigned int i;
-       struct platform_device *cpm_uart_dev;
-       int ret;
-
-       for (np = NULL, i = 0;
-            (np = of_find_compatible_node(np, "serial", "cpm_uart")) != NULL;
-            i++) {
-               struct resource r[3];
-               struct fs_uart_platform_info cpm_uart_data;
-               const int *id;
-               const char *model;
-
-               memset(r, 0, sizeof(r));
-               memset(&cpm_uart_data, 0, sizeof(cpm_uart_data));
-
-               ret = of_address_to_resource(np, 0, &r[0]);
-               if (ret)
-                       goto err;
-
-               r[0].name = smc_regs;
-
-               ret = of_address_to_resource(np, 1, &r[1]);
-               if (ret)
-                       goto err;
-               r[1].name = smc_pram;
-
-               r[2].start = r[2].end = irq_of_parse_and_map(np, 0);
-               r[2].flags = IORESOURCE_IRQ;
-
-               cpm_uart_dev =
-                   platform_device_register_simple("fsl-cpm-smc:uart", i, &r[0], 3);
-
-               if (IS_ERR(cpm_uart_dev)) {
-                       ret = PTR_ERR(cpm_uart_dev);
-                       goto err;
-               }
-
-               model = of_get_property(np, "model", NULL);
-               strcpy(cpm_uart_data.fs_type, model);
-
-               id = of_get_property(np, "device-id", NULL);
-               cpm_uart_data.fs_no = *id;
-               cpm_uart_data.uart_clk = ppc_proc_freq;
-
-               cpm_uart_data.tx_num_fifo = 4;
-               cpm_uart_data.tx_buf_size = 32;
-               cpm_uart_data.rx_num_fifo = 4;
-               cpm_uart_data.rx_buf_size = 32;
-
-               ret =
-                   platform_device_add_data(cpm_uart_dev, &cpm_uart_data,
-                                            sizeof(struct
-                                                   fs_uart_platform_info));
-               if (ret)
-                       goto unreg;
-       }
-
-       return 0;
-
-unreg:
-       platform_device_unregister(cpm_uart_dev);
-err:
-       return ret;
-}
-
-arch_initcall(cpm_smc_uart_of_init);
-
-#endif /* CONFIG_8xx */
-#endif /* CONFIG_PPC_CPM_NEW_BINDING */
-
 static int __init of_fsl_spi_probe(char *type, char *compatible, u32 sysclk,
                                   struct spi_board_info *board_infos,
                                   unsigned int num_board_infos,
@@ -1372,25 +841,9 @@ int __init fsl_spi_init(struct spi_board_info *board_infos,
        sysclk = get_brgfreq();
 #endif
        if (sysclk == -1) {
-               struct device_node *np;
-               const u32 *freq;
-               int size;
-
-               np = of_find_node_by_type(NULL, "soc");
-               if (!np)
+               sysclk = fsl_get_sys_freq();
+               if (sysclk == -1)
                        return -ENODEV;
-
-               freq = of_get_property(np, "clock-frequency", &size);
-               if (!freq || size != sizeof(*freq) || *freq == 0) {
-                       freq = of_get_property(np, "bus-frequency", &size);
-                       if (!freq || size != sizeof(*freq) || *freq == 0) {
-                               of_node_put(np);
-                               return -ENODEV;
-                       }
-               }
-
-               sysclk = *freq;
-               of_node_put(np);
        }
 
        ret = of_fsl_spi_probe(NULL, "fsl,spi", sysclk, board_infos,
index 63e7db30a4cd5b547f6041589fcf43b88ee6568d..74c4a9657b3376b18a0fbd478d31a161469c1d42 100644 (file)
@@ -7,6 +7,7 @@
 extern phys_addr_t get_immrbase(void);
 extern u32 get_brgfreq(void);
 extern u32 get_baudrate(void);
+extern u32 fsl_get_sys_freq(void);
 
 struct spi_board_info;
 
index 6ffdda244bb1525f2fcd64413385997cb85e1954..8619f2a3f1f637d685cf71d257fb47efd2f29f85 100644 (file)
@@ -175,13 +175,16 @@ static inline void _mpic_write(enum mpic_reg_type type,
        switch(type) {
 #ifdef CONFIG_PPC_DCR
        case mpic_access_dcr:
-               return dcr_write(rb->dhost, reg, value);
+               dcr_write(rb->dhost, reg, value);
+               break;
 #endif
        case mpic_access_mmio_be:
-               return out_be32(rb->base + (reg >> 2), value);
+               out_be32(rb->base + (reg >> 2), value);
+               break;
        case mpic_access_mmio_le:
        default:
-               return out_le32(rb->base + (reg >> 2), value);
+               out_le32(rb->base + (reg >> 2), value);
+               break;
        }
 }
 
@@ -1000,7 +1003,7 @@ struct mpic * __init mpic_alloc(struct device_node *node,
                                const char *name)
 {
        struct mpic     *mpic;
-       u32             reg;
+       u32             greg_feature;
        const char      *vers;
        int             i;
        int             intvec_top;
@@ -1064,7 +1067,8 @@ struct mpic * __init mpic_alloc(struct device_node *node,
 
        /* Look for protected sources */
        if (node) {
-               unsigned int psize, bits, mapsize;
+               int psize;
+               unsigned int bits, mapsize;
                const u32 *psrc =
                        of_get_property(node, "protected-sources", &psize);
                if (psrc) {
@@ -1107,8 +1111,7 @@ struct mpic * __init mpic_alloc(struct device_node *node,
         * in, try to obtain one
         */
        if (paddr == 0 && !(mpic->flags & MPIC_USES_DCR)) {
-               const u32 *reg;
-               reg = of_get_property(node, "reg", NULL);
+               const u32 *reg = of_get_property(node, "reg", NULL);
                BUG_ON(reg == NULL);
                paddr = of_translate_address(node, reg);
                BUG_ON(paddr == OF_BAD_ADDR);
@@ -1137,12 +1140,13 @@ struct mpic * __init mpic_alloc(struct device_node *node,
         * MPICs, num sources as well. On ISU MPICs, sources are counted
         * as ISUs are added
         */
-       reg = mpic_read(mpic->gregs, MPIC_INFO(GREG_FEATURE_0));
-       mpic->num_cpus = ((reg & MPIC_GREG_FEATURE_LAST_CPU_MASK)
+       greg_feature = mpic_read(mpic->gregs, MPIC_INFO(GREG_FEATURE_0));
+       mpic->num_cpus = ((greg_feature & MPIC_GREG_FEATURE_LAST_CPU_MASK)
                          >> MPIC_GREG_FEATURE_LAST_CPU_SHIFT) + 1;
        if (isu_size == 0)
-               mpic->num_sources = ((reg & MPIC_GREG_FEATURE_LAST_SRC_MASK)
-                                    >> MPIC_GREG_FEATURE_LAST_SRC_SHIFT) + 1;
+               mpic->num_sources =
+                       ((greg_feature & MPIC_GREG_FEATURE_LAST_SRC_MASK)
+                        >> MPIC_GREG_FEATURE_LAST_SRC_SHIFT) + 1;
 
        /* Map the per-CPU registers */
        for (i = 0; i < mpic->num_cpus; i++) {
@@ -1161,7 +1165,7 @@ struct mpic * __init mpic_alloc(struct device_node *node,
        mpic->isu_mask = (1 << mpic->isu_shift) - 1;
 
        /* Display version */
-       switch (reg & MPIC_GREG_FEATURE_VERSION_MASK) {
+       switch (greg_feature & MPIC_GREG_FEATURE_VERSION_MASK) {
        case 1:
                vers = "1.0";
                break;
@@ -1321,7 +1325,7 @@ void __init mpic_set_serial_int(struct mpic *mpic, int enable)
 
 void mpic_irq_set_priority(unsigned int irq, unsigned int pri)
 {
-       int is_ipi;
+       unsigned int is_ipi;
        struct mpic *mpic = mpic_find(irq, &is_ipi);
        unsigned int src = mpic_irq_to_hw(irq);
        unsigned long flags;
@@ -1344,7 +1348,7 @@ void mpic_irq_set_priority(unsigned int irq, unsigned int pri)
 
 unsigned int mpic_irq_get_priority(unsigned int irq)
 {
-       int is_ipi;
+       unsigned int is_ipi;
        struct mpic *mpic = mpic_find(irq, &is_ipi);
        unsigned int src = mpic_irq_to_hw(irq);
        unsigned long flags;
@@ -1406,11 +1410,6 @@ void mpic_cpu_set_priority(int prio)
        mpic_cpu_write(MPIC_INFO(CPU_CURRENT_TASK_PRI), prio);
 }
 
-/*
- * XXX: someone who knows mpic should check this.
- * do we need to eoi the ipi including for kexec cpu here (see xics comments)?
- * or can we reset the mpic in the new kernel?
- */
 void mpic_teardown_this_cpu(int secondary)
 {
        struct mpic *mpic = mpic_primary;
@@ -1430,6 +1429,10 @@ void mpic_teardown_this_cpu(int secondary)
 
        /* Set current processor priority to max */
        mpic_cpu_write(MPIC_INFO(CPU_CURRENT_TASK_PRI), 0xf);
+       /* We need to EOI the IPI since not all platforms reset the MPIC
+        * on boot and new interrupts wouldn't get delivered otherwise.
+        */
+       mpic_eoi(mpic);
 
        spin_unlock_irqrestore(&mpic_lock, flags);
 }
index efda0028909dbec17e7a58adf8945a41f4f6615b..047b31027fa6500ec03ba55727da52d6b1fc58ad 100644 (file)
@@ -127,7 +127,7 @@ static int __init mv64x60_mpsc_device_setup(struct device_node *np, int id)
        if (err)
                return err;
 
-       prop = of_get_property(np, "block-index", NULL);
+       prop = of_get_property(np, "cell-index", NULL);
        if (!prop)
                return -ENODEV;
        port_number = *(int *)prop;
@@ -136,6 +136,7 @@ static int __init mv64x60_mpsc_device_setup(struct device_node *np, int id)
 
        pdata.cache_mgmt = 1; /* All current revs need this set */
 
+       pdata.max_idle = 40; /* default */
        prop = of_get_property(np, "max_idle", NULL);
        if (prop)
                pdata.max_idle = *prop;
@@ -205,30 +206,24 @@ error:
 /*
  * Create mv64x60_eth platform devices
  */
-static int __init eth_register_shared_pdev(struct device_node *np)
+static struct platform_device * __init mv64x60_eth_register_shared_pdev(
+                                               struct device_node *np, int id)
 {
        struct platform_device *pdev;
        struct resource r[1];
        int err;
 
-       np = of_get_parent(np);
-       if (!np)
-               return -ENODEV;
-
        err = of_address_to_resource(np, 0, &r[0]);
-       of_node_put(np);
        if (err)
-               return err;
+               return ERR_PTR(err);
 
-       pdev = platform_device_register_simple(MV643XX_ETH_SHARED_NAME, 0,
+       pdev = platform_device_register_simple(MV643XX_ETH_SHARED_NAME, id,
                                               r, 1);
-       if (IS_ERR(pdev))
-               return PTR_ERR(pdev);
-
-       return 0;
+       return pdev;
 }
 
-static int __init mv64x60_eth_device_setup(struct device_node *np, int id)
+static int __init mv64x60_eth_device_setup(struct device_node *np, int id,
+                                          struct platform_device *shared_pdev)
 {
        struct resource r[1];
        struct mv643xx_eth_platform_data pdata;
@@ -239,16 +234,12 @@ static int __init mv64x60_eth_device_setup(struct device_node *np, int id)
        const phandle *ph;
        int err;
 
-       /* only register the shared platform device the first time through */
-       if (id == 0 && (err = eth_register_shared_pdev(np)))
-               return err;
-
        memset(r, 0, sizeof(r));
        of_irq_to_resource(np, 0, &r[0]);
 
        memset(&pdata, 0, sizeof(pdata));
 
-       prop = of_get_property(np, "block-index", NULL);
+       prop = of_get_property(np, "reg", NULL);
        if (!prop)
                return -ENODEV;
        pdata.port_number = *prop;
@@ -301,7 +292,7 @@ static int __init mv64x60_eth_device_setup(struct device_node *np, int id)
 
        of_node_put(phy);
 
-       pdev = platform_device_alloc(MV643XX_ETH_NAME, pdata.port_number);
+       pdev = platform_device_alloc(MV643XX_ETH_NAME, id);
        if (!pdev)
                return -ENOMEM;
 
@@ -345,21 +336,19 @@ static int __init mv64x60_i2c_device_setup(struct device_node *np, int id)
 
        memset(&pdata, 0, sizeof(pdata));
 
+       pdata.freq_m = 8;       /* default */
        prop = of_get_property(np, "freq_m", NULL);
        if (!prop)
                return -ENODEV;
        pdata.freq_m = *prop;
 
+       pdata.freq_m = 3;       /* default */
        prop = of_get_property(np, "freq_n", NULL);
        if (!prop)
                return -ENODEV;
        pdata.freq_n = *prop;
 
-       prop = of_get_property(np, "timeout", NULL);
-       if (prop)
-               pdata.timeout = *prop;
-       else
-               pdata.timeout = 1000;   /* 1 second */
+       pdata.timeout = 1000;                           /* default: 1 second */
 
        pdev = platform_device_alloc(MV64XXX_I2C_CTLR_NAME, id);
        if (!pdev)
@@ -401,10 +390,7 @@ static int __init mv64x60_wdt_device_setup(struct device_node *np, int id)
 
        memset(&pdata, 0, sizeof(pdata));
 
-       prop = of_get_property(np, "timeout", NULL);
-       if (!prop)
-               return -ENODEV;
-       pdata.timeout = *prop;
+       pdata.timeout = 10;                     /* Default: 10 seconds */
 
        np = of_get_parent(np);
        if (!np)
@@ -441,27 +427,43 @@ error:
 
 static int __init mv64x60_device_setup(void)
 {
-       struct device_node *np = NULL;
-       int id;
+       struct device_node *np, *np2;
+       struct platform_device *pdev;
+       int id, id2;
        int err;
 
        id = 0;
-       for_each_compatible_node(np, "serial", "marvell,mpsc")
+       for_each_compatible_node(np, "serial", "marvell,mv64360-mpsc")
                if ((err = mv64x60_mpsc_device_setup(np, id++)))
                        goto error;
 
        id = 0;
-       for_each_compatible_node(np, "network", "marvell,mv64x60-eth")
-               if ((err = mv64x60_eth_device_setup(np, id++)))
+       id2 = 0;
+       for_each_compatible_node(np, NULL, "marvell,mv64360-eth-group") {
+               pdev = mv64x60_eth_register_shared_pdev(np, id++);
+               if (IS_ERR(pdev)) {
+                       err = PTR_ERR(pdev);
                        goto error;
+               }
+               for_each_child_of_node(np, np2) {
+                       if (!of_device_is_compatible(np2,
+                                       "marvell,mv64360-eth"))
+                               continue;
+                       err = mv64x60_eth_device_setup(np2, id2++, pdev);
+                       if (err) {
+                               of_node_put(np2);
+                               goto error;
+                       }
+               }
+       }
 
        id = 0;
-       for_each_compatible_node(np, "i2c", "marvell,mv64x60-i2c")
+       for_each_compatible_node(np, "i2c", "marvell,mv64360-i2c")
                if ((err = mv64x60_i2c_device_setup(np, id++)))
                        goto error;
 
        /* support up to one watchdog timer */
-       np = of_find_compatible_node(np, NULL, "marvell,mv64x60-wdt");
+       np = of_find_compatible_node(np, NULL, "marvell,mv64360-wdt");
        if (np) {
                if ((err = mv64x60_wdt_device_setup(np, id)))
                        goto error;
@@ -489,10 +491,10 @@ static int __init mv64x60_add_mpsc_console(void)
        if (!np)
                goto not_mpsc;
 
-       if (!of_device_is_compatible(np, "marvell,mpsc"))
+       if (!of_device_is_compatible(np, "marvell,mv64360-mpsc"))
                goto not_mpsc;
 
-       prop = of_get_property(np, "block-index", NULL);
+       prop = of_get_property(np, "cell-index", NULL);
        if (!prop)
                goto not_mpsc;
 
index d21ab8fa4993c87d464c0c81a6fcb56d3dfc01f3..1456015a22d88613c7fdca9c5e6e9948fde3c54d 100644 (file)
@@ -86,14 +86,14 @@ static int __init mv64x60_sysfs_init(void)
        struct platform_device *pdev;
        const unsigned int *prop;
 
-       np = of_find_compatible_node(NULL, NULL, "marvell,mv64x60");
+       np = of_find_compatible_node(NULL, NULL, "marvell,mv64360");
        if (!np)
                return 0;
 
        prop = of_get_property(np, "hs_reg_valid", NULL);
        of_node_put(np);
 
-       pdev = platform_device_register_simple("marvell,mv64x60", 0, NULL, 0);
+       pdev = platform_device_register_simple("marvell,mv64360", 0, NULL, 0);
        if (IS_ERR(pdev))
                return PTR_ERR(pdev);
 
@@ -166,6 +166,6 @@ void __init mv64x60_pci_init(void)
 {
        struct device_node *np;
 
-       for_each_compatible_node(np, "pci", "marvell,mv64x60-pci")
+       for_each_compatible_node(np, "pci", "marvell,mv64360-pci")
                mv64x60_add_bridge(np);
 }
index 19e6ef26379751b6cafa9848dc6a4fdfc8ad9277..2aa4ed066db11bcec9bcfa7127b3b7c50eb9b8d9 100644 (file)
@@ -238,13 +238,13 @@ void __init mv64x60_init_irq(void)
        const unsigned int *reg;
        unsigned long flags;
 
-       np = of_find_compatible_node(NULL, NULL, "marvell,mv64x60-gpp");
+       np = of_find_compatible_node(NULL, NULL, "marvell,mv64360-gpp");
        reg = of_get_property(np, "reg", &size);
        paddr = of_translate_address(np, reg);
        mv64x60_gpp_reg_base = ioremap(paddr, reg[1]);
        of_node_put(np);
 
-       np = of_find_compatible_node(NULL, NULL, "marvell,mv64x60-pic");
+       np = of_find_compatible_node(NULL, NULL, "marvell,mv64360-pic");
        reg = of_get_property(np, "reg", &size);
        paddr = of_translate_address(np, reg);
        mv64x60_irq_reg_base = ioremap(paddr, reg[1]);
index 35c77c7d06168482ec27db5405228468a9c3a0ab..ccdb3b0418fce024d86df3e8fb372e36da4249f0 100644 (file)
@@ -85,7 +85,7 @@ static void mv64x60_udbg_init(void)
        if (!stdout)
                return;
 
-       for_each_compatible_node(np, "serial", "marvell,mpsc") {
+       for_each_compatible_node(np, "serial", "marvell,mv64360-mpsc") {
                if (np == stdout)
                        break;
        }
index 5abfcd157483b509e0f1c99ad0eacd693e05fb72..1814adbd22363c13f79f8e2744f41cf9f14e1f5d 100644 (file)
@@ -527,6 +527,7 @@ static void __init ppc4xx_probe_pcix_bridge(struct device_node *np)
  *
  * ibm,plb-pciex-440spe
  * ibm,plb-pciex-405ex
+ * ibm,plb-pciex-460ex
  *
  * Anything else will be rejected for now as they are all subtly
  * different unfortunately.
@@ -645,7 +646,7 @@ static int __init ppc440spe_pciex_core_init(struct device_node *np)
        int time_out = 20;
 
        /* Set PLL clock receiver to LVPECL */
-       mtdcri(SDR0, PESDR0_PLLLCT1, mfdcri(SDR0, PESDR0_PLLLCT1) | 1 << 28);
+       dcri_clrset(SDR0, PESDR0_PLLLCT1, 0, 1 << 28);
 
        /* Shouldn't we do all the calibration stuff etc... here ? */
        if (ppc440spe_pciex_check_reset(np))
@@ -659,8 +660,7 @@ static int __init ppc440spe_pciex_core_init(struct device_node *np)
        }
 
        /* De-assert reset of PCIe PLL, wait for lock */
-       mtdcri(SDR0, PESDR0_PLLLCT1,
-              mfdcri(SDR0, PESDR0_PLLLCT1) & ~(1 << 24));
+       dcri_clrset(SDR0, PESDR0_PLLLCT1, 1 << 24, 0);
        udelay(3);
 
        while (time_out) {
@@ -712,9 +712,8 @@ static int ppc440spe_pciex_init_port_hw(struct ppc4xx_pciex_port *port)
                mtdcri(SDR0, port->sdr_base + PESDRn_440SPE_HSSL7SET1,
                       0x35000000);
        }
-       val = mfdcri(SDR0, port->sdr_base + PESDRn_RCSSET);
-       mtdcri(SDR0, port->sdr_base + PESDRn_RCSSET,
-              (val & ~(1 << 24 | 1 << 16)) | 1 << 12);
+       dcri_clrset(SDR0, port->sdr_base + PESDRn_RCSSET,
+                       (1 << 24) | (1 << 16), 1 << 12);
 
        return 0;
 }
@@ -775,6 +774,115 @@ static struct ppc4xx_pciex_hwops ppc440speB_pcie_hwops __initdata =
        .setup_utl      = ppc440speB_pciex_init_utl,
 };
 
+static int __init ppc460ex_pciex_core_init(struct device_node *np)
+{
+       /* Nothing to do, return 2 ports */
+       return 2;
+}
+
+static int ppc460ex_pciex_init_port_hw(struct ppc4xx_pciex_port *port)
+{
+       u32 val;
+       u32 utlset1;
+
+       if (port->endpoint)
+               val = PTYPE_LEGACY_ENDPOINT << 20;
+       else
+               val = PTYPE_ROOT_PORT << 20;
+
+       if (port->index == 0) {
+               val |= LNKW_X1 << 12;
+               utlset1 = 0x20000000;
+       } else {
+               val |= LNKW_X4 << 12;
+               utlset1 = 0x20101101;
+       }
+
+       mtdcri(SDR0, port->sdr_base + PESDRn_DLPSET, val);
+       mtdcri(SDR0, port->sdr_base + PESDRn_UTLSET1, utlset1);
+       mtdcri(SDR0, port->sdr_base + PESDRn_UTLSET2, 0x01210000);
+
+       switch (port->index) {
+       case 0:
+               mtdcri(SDR0, PESDR0_460EX_L0CDRCTL, 0x00003230);
+               mtdcri(SDR0, PESDR0_460EX_L0DRV, 0x00000136);
+               mtdcri(SDR0, PESDR0_460EX_L0CLK, 0x00000006);
+
+               mtdcri(SDR0, PESDR0_460EX_PHY_CTL_RST,0x10000000);
+               break;
+
+       case 1:
+               mtdcri(SDR0, PESDR1_460EX_L0CDRCTL, 0x00003230);
+               mtdcri(SDR0, PESDR1_460EX_L1CDRCTL, 0x00003230);
+               mtdcri(SDR0, PESDR1_460EX_L2CDRCTL, 0x00003230);
+               mtdcri(SDR0, PESDR1_460EX_L3CDRCTL, 0x00003230);
+               mtdcri(SDR0, PESDR1_460EX_L0DRV, 0x00000136);
+               mtdcri(SDR0, PESDR1_460EX_L1DRV, 0x00000136);
+               mtdcri(SDR0, PESDR1_460EX_L2DRV, 0x00000136);
+               mtdcri(SDR0, PESDR1_460EX_L3DRV, 0x00000136);
+               mtdcri(SDR0, PESDR1_460EX_L0CLK, 0x00000006);
+               mtdcri(SDR0, PESDR1_460EX_L1CLK, 0x00000006);
+               mtdcri(SDR0, PESDR1_460EX_L2CLK, 0x00000006);
+               mtdcri(SDR0, PESDR1_460EX_L3CLK, 0x00000006);
+
+               mtdcri(SDR0, PESDR1_460EX_PHY_CTL_RST,0x10000000);
+               break;
+       }
+
+       mtdcri(SDR0, port->sdr_base + PESDRn_RCSSET,
+              mfdcri(SDR0, port->sdr_base + PESDRn_RCSSET) |
+              (PESDRx_RCSSET_RSTGU | PESDRx_RCSSET_RSTPYN));
+
+       /* Poll for PHY reset */
+       /* XXX FIXME add timeout */
+       switch (port->index) {
+       case 0:
+               while (!(mfdcri(SDR0, PESDR0_460EX_RSTSTA) & 0x1))
+                       udelay(10);
+               break;
+       case 1:
+               while (!(mfdcri(SDR0, PESDR1_460EX_RSTSTA) & 0x1))
+                       udelay(10);
+               break;
+       }
+
+       mtdcri(SDR0, port->sdr_base + PESDRn_RCSSET,
+              (mfdcri(SDR0, port->sdr_base + PESDRn_RCSSET) &
+               ~(PESDRx_RCSSET_RSTGU | PESDRx_RCSSET_RSTDL)) |
+              PESDRx_RCSSET_RSTPYN);
+
+       port->has_ibpre = 1;
+
+       return 0;
+}
+
+static int ppc460ex_pciex_init_utl(struct ppc4xx_pciex_port *port)
+{
+       dcr_write(port->dcrs, DCRO_PEGPL_SPECIAL, 0x0);
+
+       /*
+        * Set buffer allocations and then assert VRB and TXE.
+        */
+       out_be32(port->utl_base + PEUTL_PBCTL,  0x0800000c);
+       out_be32(port->utl_base + PEUTL_OUTTR,  0x08000000);
+       out_be32(port->utl_base + PEUTL_INTR,   0x02000000);
+       out_be32(port->utl_base + PEUTL_OPDBSZ, 0x04000000);
+       out_be32(port->utl_base + PEUTL_PBBSZ,  0x00000000);
+       out_be32(port->utl_base + PEUTL_IPHBSZ, 0x02000000);
+       out_be32(port->utl_base + PEUTL_IPDBSZ, 0x04000000);
+       out_be32(port->utl_base + PEUTL_RCIRQEN,0x00f00000);
+       out_be32(port->utl_base + PEUTL_PCTL,   0x80800066);
+
+       return 0;
+}
+
+static struct ppc4xx_pciex_hwops ppc460ex_pcie_hwops __initdata =
+{
+       .core_init      = ppc460ex_pciex_core_init,
+       .port_init_hw   = ppc460ex_pciex_init_port_hw,
+       .setup_utl      = ppc460ex_pciex_init_utl,
+};
+
 #endif /* CONFIG_44x */
 
 #ifdef CONFIG_40x
@@ -830,17 +938,9 @@ static int ppc405ex_pciex_init_port_hw(struct ppc4xx_pciex_port *port)
         * PCIe boards don't show this problem.
         * This has to be re-tested and fixed in a later release!
         */
-#if 0 /* XXX FIXME: Not resetting the PHY will leave all resources
-       * configured as done previously by U-Boot. Then Linux will currently
-       * not reassign them. So the PHY reset is now done always. This will
-       * lead to problems with the Atheros PCIe board again.
-       */
        val = mfdcri(SDR0, port->sdr_base + PESDRn_LOOP);
        if (!(val & 0x00001000))
                ppc405ex_pcie_phy_reset(port);
-#else
-       ppc405ex_pcie_phy_reset(port);
-#endif
 
        dcr_write(port->dcrs, DCRO_PEGPL_CFG, 0x10000000);  /* guarded on */
 
@@ -896,6 +996,8 @@ static int __init ppc4xx_pciex_check_core_init(struct device_node *np)
                else
                        ppc4xx_pciex_hwops = &ppc440speB_pcie_hwops;
        }
+       if (of_device_is_compatible(np, "ibm,plb-pciex-460ex"))
+               ppc4xx_pciex_hwops = &ppc460ex_pcie_hwops;
 #endif /* CONFIG_44x    */
 #ifdef CONFIG_40x
        if (of_device_is_compatible(np, "ibm,plb-pciex-405ex"))
@@ -1042,8 +1144,7 @@ static int __init ppc4xx_pciex_port_init(struct ppc4xx_pciex_port *port)
                port->link = 0;
        }
 
-       mtdcri(SDR0, port->sdr_base + PESDRn_RCSSET,
-              mfdcri(SDR0, port->sdr_base + PESDRn_RCSSET) | 1 << 20);
+       dcri_clrset(SDR0, port->sdr_base + PESDRn_RCSSET, 0, 1 << 20);
        msleep(100);
 
        return 0;
index 1c07908dc6ef1a2b219e60cb4e8bef2016bab707..d04e40b306fbdfdaf254a16993f4eb79431e3c96 100644 (file)
 #define PESDR1_405EX_LPB               0x044B
 #define PESDR1_405EX_PHYSTA            0x044C
 
+/*
+ * 460EX additional DCRs
+ */
+#define PESDR0_460EX_L0BIST            0x0308
+#define PESDR0_460EX_L0BISTSTS         0x0309
+#define PESDR0_460EX_L0CDRCTL          0x030A
+#define PESDR0_460EX_L0DRV             0x030B
+#define PESDR0_460EX_L0REC             0x030C
+#define PESDR0_460EX_L0LPB             0x030D
+#define PESDR0_460EX_L0CLK             0x030E
+#define PESDR0_460EX_PHY_CTL_RST       0x030F
+#define PESDR0_460EX_RSTSTA            0x0310
+#define PESDR0_460EX_OBS               0x0311
+#define PESDR0_460EX_L0ERRC            0x0320
+
+#define PESDR1_460EX_L0BIST            0x0348
+#define PESDR1_460EX_L1BIST            0x0349
+#define PESDR1_460EX_L2BIST            0x034A
+#define PESDR1_460EX_L3BIST            0x034B
+#define PESDR1_460EX_L0BISTSTS         0x034C
+#define PESDR1_460EX_L1BISTSTS         0x034D
+#define PESDR1_460EX_L2BISTSTS         0x034E
+#define PESDR1_460EX_L3BISTSTS         0x034F
+#define PESDR1_460EX_L0CDRCTL          0x0350
+#define PESDR1_460EX_L1CDRCTL          0x0351
+#define PESDR1_460EX_L2CDRCTL          0x0352
+#define PESDR1_460EX_L3CDRCTL          0x0353
+#define PESDR1_460EX_L0DRV             0x0354
+#define PESDR1_460EX_L1DRV             0x0355
+#define PESDR1_460EX_L2DRV             0x0356
+#define PESDR1_460EX_L3DRV             0x0357
+#define PESDR1_460EX_L0REC             0x0358
+#define PESDR1_460EX_L1REC             0x0359
+#define PESDR1_460EX_L2REC             0x035A
+#define PESDR1_460EX_L3REC             0x035B
+#define PESDR1_460EX_L0LPB             0x035C
+#define PESDR1_460EX_L1LPB             0x035D
+#define PESDR1_460EX_L2LPB             0x035E
+#define PESDR1_460EX_L3LPB             0x035F
+#define PESDR1_460EX_L0CLK             0x0360
+#define PESDR1_460EX_L1CLK             0x0361
+#define PESDR1_460EX_L2CLK             0x0362
+#define PESDR1_460EX_L3CLK             0x0363
+#define PESDR1_460EX_PHY_CTL_RST       0x0364
+#define PESDR1_460EX_RSTSTA            0x0365
+#define PESDR1_460EX_OBS               0x0366
+#define PESDR1_460EX_L0ERRC            0x0368
+#define PESDR1_460EX_L1ERRC            0x0369
+#define PESDR1_460EX_L2ERRC            0x036A
+#define PESDR1_460EX_L3ERRC            0x036B
+#define PESDR0_460EX_IHS1              0x036C
+#define PESDR0_460EX_IHS2              0x036D
+
 /*
  * Of the above, some are common offsets from the base
  */
 #define PECFG_POM2LAL          0x390
 #define PECFG_POM2LAH          0x394
 
+/* SDR Bit Mappings */
+#define PESDRx_RCSSET_HLDPLB   0x10000000
+#define PESDRx_RCSSET_RSTGU    0x01000000
+#define PESDRx_RCSSET_RDY       0x00100000
+#define PESDRx_RCSSET_RSTDL     0x00010000
+#define PESDRx_RCSSET_RSTPYN    0x00001000
 
 enum
 {
diff --git a/arch/powerpc/sysdev/ppc4xx_soc.c b/arch/powerpc/sysdev/ppc4xx_soc.c
new file mode 100644 (file)
index 0000000..5b32adc
--- /dev/null
@@ -0,0 +1,200 @@
+/*
+ * IBM/AMCC PPC4xx SoC setup code
+ *
+ * Copyright 2008 DENX Software Engineering, Stefan Roese <sr@denx.de>
+ *
+ * L2 cache routines cloned from arch/ppc/syslib/ibm440gx_common.c which is:
+ *   Eugene Surovegin <eugene.surovegin@zultys.com> or <ebs@ebshome.net>
+ *   Copyright (c) 2003 - 2006 Zultys Technologies
+ *
+ * This program is free software; you can redistribute  it and/or modify it
+ * under  the terms of  the GNU General  Public License as published by the
+ * Free Software Foundation;  either version 2 of the  License, or (at your
+ * option) any later version.
+ */
+
+#include <linux/stddef.h>
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/errno.h>
+#include <linux/interrupt.h>
+#include <linux/irq.h>
+#include <linux/of_platform.h>
+
+#include <asm/dcr.h>
+#include <asm/dcr-regs.h>
+#include <asm/reg.h>
+
+static u32 dcrbase_l2c;
+
+/*
+ * L2-cache
+ */
+
+/* Issue L2C diagnostic command */
+static inline u32 l2c_diag(u32 addr)
+{
+       mtdcr(dcrbase_l2c + DCRN_L2C0_ADDR, addr);
+       mtdcr(dcrbase_l2c + DCRN_L2C0_CMD, L2C_CMD_DIAG);
+       while (!(mfdcr(dcrbase_l2c + DCRN_L2C0_SR) & L2C_SR_CC))
+               ;
+
+       return mfdcr(dcrbase_l2c + DCRN_L2C0_DATA);
+}
+
+static irqreturn_t l2c_error_handler(int irq, void *dev)
+{
+       u32 sr = mfdcr(dcrbase_l2c + DCRN_L2C0_SR);
+
+       if (sr & L2C_SR_CPE) {
+               /* Read cache trapped address */
+               u32 addr = l2c_diag(0x42000000);
+               printk(KERN_EMERG "L2C: Cache Parity Error, addr[16:26] = 0x%08x\n",
+                      addr);
+       }
+       if (sr & L2C_SR_TPE) {
+               /* Read tag trapped address */
+               u32 addr = l2c_diag(0x82000000) >> 16;
+               printk(KERN_EMERG "L2C: Tag Parity Error, addr[16:26] = 0x%08x\n",
+                      addr);
+       }
+
+       /* Clear parity errors */
+       if (sr & (L2C_SR_CPE | L2C_SR_TPE)){
+               mtdcr(dcrbase_l2c + DCRN_L2C0_ADDR, 0);
+               mtdcr(dcrbase_l2c + DCRN_L2C0_CMD, L2C_CMD_CCP | L2C_CMD_CTE);
+       } else {
+               printk(KERN_EMERG "L2C: LRU error\n");
+       }
+
+       return IRQ_HANDLED;
+}
+
+static int __init ppc4xx_l2c_probe(void)
+{
+       struct device_node *np;
+       u32 r;
+       unsigned long flags;
+       int irq;
+       const u32 *dcrreg;
+       u32 dcrbase_isram;
+       int len;
+       const u32 *prop;
+       u32 l2_size;
+
+       np = of_find_compatible_node(NULL, NULL, "ibm,l2-cache");
+       if (!np)
+               return 0;
+
+       /* Get l2 cache size */
+       prop = of_get_property(np, "cache-size", NULL);
+       if (prop == NULL) {
+               printk(KERN_ERR "%s: Can't get cache-size!\n", np->full_name);
+               of_node_put(np);
+               return -ENODEV;
+       }
+       l2_size = prop[0];
+
+       /* Map DCRs */
+       dcrreg = of_get_property(np, "dcr-reg", &len);
+       if (!dcrreg || (len != 4 * sizeof(u32))) {
+               printk(KERN_ERR "%s: Can't get DCR register base !",
+                      np->full_name);
+               of_node_put(np);
+               return -ENODEV;
+       }
+       dcrbase_isram = dcrreg[0];
+       dcrbase_l2c = dcrreg[2];
+
+       /* Get and map irq number from device tree */
+       irq = irq_of_parse_and_map(np, 0);
+       if (irq == NO_IRQ) {
+               printk(KERN_ERR "irq_of_parse_and_map failed\n");
+               of_node_put(np);
+               return -ENODEV;
+       }
+
+       /* Install error handler */
+       if (request_irq(irq, l2c_error_handler, IRQF_DISABLED, "L2C", 0) < 0) {
+               printk(KERN_ERR "Cannot install L2C error handler"
+                      ", cache is not enabled\n");
+               of_node_put(np);
+               return -ENODEV;
+       }
+
+       local_irq_save(flags);
+       asm volatile ("sync" ::: "memory");
+
+       /* Disable SRAM */
+       mtdcr(dcrbase_isram + DCRN_SRAM0_DPC,
+             mfdcr(dcrbase_isram + DCRN_SRAM0_DPC) & ~SRAM_DPC_ENABLE);
+       mtdcr(dcrbase_isram + DCRN_SRAM0_SB0CR,
+             mfdcr(dcrbase_isram + DCRN_SRAM0_SB0CR) & ~SRAM_SBCR_BU_MASK);
+       mtdcr(dcrbase_isram + DCRN_SRAM0_SB1CR,
+             mfdcr(dcrbase_isram + DCRN_SRAM0_SB1CR) & ~SRAM_SBCR_BU_MASK);
+       mtdcr(dcrbase_isram + DCRN_SRAM0_SB2CR,
+             mfdcr(dcrbase_isram + DCRN_SRAM0_SB2CR) & ~SRAM_SBCR_BU_MASK);
+       mtdcr(dcrbase_isram + DCRN_SRAM0_SB3CR,
+             mfdcr(dcrbase_isram + DCRN_SRAM0_SB3CR) & ~SRAM_SBCR_BU_MASK);
+
+       /* Enable L2_MODE without ICU/DCU */
+       r = mfdcr(dcrbase_l2c + DCRN_L2C0_CFG) &
+               ~(L2C_CFG_ICU | L2C_CFG_DCU | L2C_CFG_SS_MASK);
+       r |= L2C_CFG_L2M | L2C_CFG_SS_256;
+       mtdcr(dcrbase_l2c + DCRN_L2C0_CFG, r);
+
+       mtdcr(dcrbase_l2c + DCRN_L2C0_ADDR, 0);
+
+       /* Hardware Clear Command */
+       mtdcr(dcrbase_l2c + DCRN_L2C0_CMD, L2C_CMD_HCC);
+       while (!(mfdcr(dcrbase_l2c + DCRN_L2C0_SR) & L2C_SR_CC))
+               ;
+
+       /* Clear Cache Parity and Tag Errors */
+       mtdcr(dcrbase_l2c + DCRN_L2C0_CMD, L2C_CMD_CCP | L2C_CMD_CTE);
+
+       /* Enable 64G snoop region starting at 0 */
+       r = mfdcr(dcrbase_l2c + DCRN_L2C0_SNP0) &
+               ~(L2C_SNP_BA_MASK | L2C_SNP_SSR_MASK);
+       r |= L2C_SNP_SSR_32G | L2C_SNP_ESR;
+       mtdcr(dcrbase_l2c + DCRN_L2C0_SNP0, r);
+
+       r = mfdcr(dcrbase_l2c + DCRN_L2C0_SNP1) &
+               ~(L2C_SNP_BA_MASK | L2C_SNP_SSR_MASK);
+       r |= 0x80000000 | L2C_SNP_SSR_32G | L2C_SNP_ESR;
+       mtdcr(dcrbase_l2c + DCRN_L2C0_SNP1, r);
+
+       asm volatile ("sync" ::: "memory");
+
+       /* Enable ICU/DCU ports */
+       r = mfdcr(dcrbase_l2c + DCRN_L2C0_CFG);
+       r &= ~(L2C_CFG_DCW_MASK | L2C_CFG_PMUX_MASK | L2C_CFG_PMIM
+              | L2C_CFG_TPEI | L2C_CFG_CPEI | L2C_CFG_NAM | L2C_CFG_NBRM);
+       r |= L2C_CFG_ICU | L2C_CFG_DCU | L2C_CFG_TPC | L2C_CFG_CPC | L2C_CFG_FRAN
+               | L2C_CFG_CPIM | L2C_CFG_TPIM | L2C_CFG_LIM | L2C_CFG_SMCM;
+
+       /* Check for 460EX/GT special handling */
+       if (of_device_is_compatible(np, "ibm,l2-cache-460ex"))
+               r |= L2C_CFG_RDBW;
+
+       mtdcr(dcrbase_l2c + DCRN_L2C0_CFG, r);
+
+       asm volatile ("sync; isync" ::: "memory");
+       local_irq_restore(flags);
+
+       printk(KERN_INFO "%dk L2-cache enabled\n", l2_size >> 10);
+
+       of_node_put(np);
+       return 0;
+}
+arch_initcall(ppc4xx_l2c_probe);
+
+/*
+ * At present, this routine just applies a system reset.
+ */
+void ppc4xx_reset_system(char *cmd)
+{
+       mtspr(SPRN_DBCR0, mfspr(SPRN_DBCR0) | DBCR0_RST_SYSTEM);
+       while (1)
+               ;       /* Just in case the reset doesn't work */
+}
index cc81fd1141b031ffe476a12f033a7c925aff8f79..cff550eec7e8d3054659d608c89405b0c1d658d4 100644 (file)
@@ -55,7 +55,7 @@ struct qe_snum {
 /* We allocate this here because it is used almost exclusively for
  * the communication processor devices.
  */
-struct qe_immap *qe_immr = NULL;
+struct qe_immap __iomem *qe_immr;
 EXPORT_SYMBOL(qe_immr);
 
 static struct qe_snum snums[QE_NUM_OF_SNUM];   /* Dynamically allocated SNUMs */
@@ -156,7 +156,7 @@ EXPORT_SYMBOL(qe_issue_cmd);
  */
 static unsigned int brg_clk = 0;
 
-unsigned int get_brg_clk(void)
+unsigned int qe_get_brg_clk(void)
 {
        struct device_node *qe;
        unsigned int size;
@@ -180,6 +180,7 @@ unsigned int get_brg_clk(void)
 
        return brg_clk;
 }
+EXPORT_SYMBOL(qe_get_brg_clk);
 
 /* Program the BRG to the given sampling rate and multiplier
  *
@@ -197,7 +198,7 @@ int qe_setbrg(enum qe_clock brg, unsigned int rate, unsigned int multiplier)
        if ((brg < QE_BRG1) || (brg > QE_BRG16))
                return -EINVAL;
 
-       divisor = get_brg_clk() / (rate * multiplier);
+       divisor = qe_get_brg_clk() / (rate * multiplier);
 
        if (divisor > QE_BRGC_DIVISOR_MAX + 1) {
                div16 = QE_BRGC_DIV16;
@@ -415,12 +416,6 @@ void qe_muram_dump(void)
 }
 EXPORT_SYMBOL(qe_muram_dump);
 
-void *qe_muram_addr(unsigned long offset)
-{
-       return (void *)&qe_immr->muram[offset];
-}
-EXPORT_SYMBOL(qe_muram_addr);
-
 /* The maximum number of RISCs we support */
 #define MAX_QE_RISC     2
 
index e53ea4d374a03f52f57c6e9c5e036275fb207c0b..93916a48afec56578acb3f403fe1034b0d0846e4 100644 (file)
@@ -22,6 +22,7 @@
 #include <linux/ioport.h>
 
 #include <asm/io.h>
+#include <asm/qe.h>
 #include <asm/prom.h>
 #include <sysdev/fsl_soc.h>
 
@@ -41,7 +42,7 @@ struct port_regs {
 #endif
 };
 
-static struct port_regs *par_io = NULL;
+static struct port_regs __iomem *par_io;
 static int num_par_io_ports = 0;
 
 int par_io_init(struct device_node *np)
@@ -165,7 +166,7 @@ int par_io_of_config(struct device_node *np)
        }
 
        ph = of_get_property(np, "pio-handle", NULL);
-       if (ph == 0) {
+       if (ph == NULL) {
                printk(KERN_ERR "pio-handle not available \n");
                return -1;
        }
@@ -200,7 +201,7 @@ static void dump_par_io(void)
 {
        unsigned int i;
 
-       printk(KERN_INFO "%s: par_io=%p\n", __FUNCTION__, par_io);
+       printk(KERN_INFO "%s: par_io=%p\n", __func__, par_io);
        for (i = 0; i < num_par_io_ports; i++) {
                printk(KERN_INFO "      cpodr[%u]=%08x\n", i,
                        in_be32(&par_io[i].cpodr));
index 3223acbc39e55af7199cb10148914d164acc8d6a..bcf88e6ce962c872819d86cde1cfd22fb76f0953 100644 (file)
@@ -148,57 +148,57 @@ int ucc_fast_init(struct ucc_fast_info * uf_info, struct ucc_fast_private ** ucc
 
        /* check if the UCC port number is in range. */
        if ((uf_info->ucc_num < 0) || (uf_info->ucc_num > UCC_MAX_NUM - 1)) {
-               printk(KERN_ERR "%s: illegal UCC number\n", __FUNCTION__);
+               printk(KERN_ERR "%s: illegal UCC number\n", __func__);
                return -EINVAL;
        }
 
        /* Check that 'max_rx_buf_length' is properly aligned (4). */
        if (uf_info->max_rx_buf_length & (UCC_FAST_MRBLR_ALIGNMENT - 1)) {
                printk(KERN_ERR "%s: max_rx_buf_length not aligned\n",
-                       __FUNCTION__);
+                       __func__);
                return -EINVAL;
        }
 
        /* Validate Virtual Fifo register values */
        if (uf_info->urfs < UCC_FAST_URFS_MIN_VAL) {
-               printk(KERN_ERR "%s: urfs is too small\n", __FUNCTION__);
+               printk(KERN_ERR "%s: urfs is too small\n", __func__);
                return -EINVAL;
        }
 
        if (uf_info->urfs & (UCC_FAST_VIRT_FIFO_REGS_ALIGNMENT - 1)) {
-               printk(KERN_ERR "%s: urfs is not aligned\n", __FUNCTION__);
+               printk(KERN_ERR "%s: urfs is not aligned\n", __func__);
                return -EINVAL;
        }
 
        if (uf_info->urfet & (UCC_FAST_VIRT_FIFO_REGS_ALIGNMENT - 1)) {
-               printk(KERN_ERR "%s: urfet is not aligned.\n", __FUNCTION__);
+               printk(KERN_ERR "%s: urfet is not aligned.\n", __func__);
                return -EINVAL;
        }
 
        if (uf_info->urfset & (UCC_FAST_VIRT_FIFO_REGS_ALIGNMENT - 1)) {
-               printk(KERN_ERR "%s: urfset is not aligned\n", __FUNCTION__);
+               printk(KERN_ERR "%s: urfset is not aligned\n", __func__);
                return -EINVAL;
        }
 
        if (uf_info->utfs & (UCC_FAST_VIRT_FIFO_REGS_ALIGNMENT - 1)) {
-               printk(KERN_ERR "%s: utfs is not aligned\n", __FUNCTION__);
+               printk(KERN_ERR "%s: utfs is not aligned\n", __func__);
                return -EINVAL;
        }
 
        if (uf_info->utfet & (UCC_FAST_VIRT_FIFO_REGS_ALIGNMENT - 1)) {
-               printk(KERN_ERR "%s: utfet is not aligned\n", __FUNCTION__);
+               printk(KERN_ERR "%s: utfet is not aligned\n", __func__);
                return -EINVAL;
        }
 
        if (uf_info->utftt & (UCC_FAST_VIRT_FIFO_REGS_ALIGNMENT - 1)) {
-               printk(KERN_ERR "%s: utftt is not aligned\n", __FUNCTION__);
+               printk(KERN_ERR "%s: utftt is not aligned\n", __func__);
                return -EINVAL;
        }
 
        uccf = kzalloc(sizeof(struct ucc_fast_private), GFP_KERNEL);
        if (!uccf) {
                printk(KERN_ERR "%s: Cannot allocate private data\n",
-                       __FUNCTION__);
+                       __func__);
                return -ENOMEM;
        }
 
@@ -207,7 +207,7 @@ int ucc_fast_init(struct ucc_fast_info * uf_info, struct ucc_fast_private ** ucc
        /* Set the PHY base address */
        uccf->uf_regs = ioremap(uf_info->regs, sizeof(struct ucc_fast));
        if (uccf->uf_regs == NULL) {
-               printk(KERN_ERR "%s: Cannot map UCC registers\n", __FUNCTION__);
+               printk(KERN_ERR "%s: Cannot map UCC registers\n", __func__);
                return -ENOMEM;
        }
 
@@ -230,7 +230,7 @@ int ucc_fast_init(struct ucc_fast_info * uf_info, struct ucc_fast_private ** ucc
        /* Set UCC to fast type */
        ret = ucc_set_type(uf_info->ucc_num, UCC_SPEED_TYPE_FAST);
        if (ret) {
-               printk(KERN_ERR "%s: cannot set UCC type\n", __FUNCTION__);
+               printk(KERN_ERR "%s: cannot set UCC type\n", __func__);
                ucc_fast_free(uccf);
                return ret;
        }
@@ -270,7 +270,7 @@ int ucc_fast_init(struct ucc_fast_info * uf_info, struct ucc_fast_private ** ucc
            qe_muram_alloc(uf_info->utfs, UCC_FAST_VIRT_FIFO_REGS_ALIGNMENT);
        if (IS_ERR_VALUE(uccf->ucc_fast_tx_virtual_fifo_base_offset)) {
                printk(KERN_ERR "%s: cannot allocate MURAM for TX FIFO\n",
-                       __FUNCTION__);
+                       __func__);
                uccf->ucc_fast_tx_virtual_fifo_base_offset = 0;
                ucc_fast_free(uccf);
                return -ENOMEM;
@@ -283,7 +283,7 @@ int ucc_fast_init(struct ucc_fast_info * uf_info, struct ucc_fast_private ** ucc
                           UCC_FAST_VIRT_FIFO_REGS_ALIGNMENT);
        if (IS_ERR_VALUE(uccf->ucc_fast_rx_virtual_fifo_base_offset)) {
                printk(KERN_ERR "%s: cannot allocate MURAM for RX FIFO\n",
-                       __FUNCTION__);
+                       __func__);
                uccf->ucc_fast_rx_virtual_fifo_base_offset = 0;
                ucc_fast_free(uccf);
                return -ENOMEM;
@@ -314,7 +314,7 @@ int ucc_fast_init(struct ucc_fast_info * uf_info, struct ucc_fast_private ** ucc
                    ucc_set_qe_mux_rxtx(uf_info->ucc_num, uf_info->rx_clock,
                                        COMM_DIR_RX)) {
                        printk(KERN_ERR "%s: illegal value for RX clock\n",
-                              __FUNCTION__);
+                              __func__);
                        ucc_fast_free(uccf);
                        return -EINVAL;
                }
@@ -323,7 +323,7 @@ int ucc_fast_init(struct ucc_fast_info * uf_info, struct ucc_fast_private ** ucc
                    ucc_set_qe_mux_rxtx(uf_info->ucc_num, uf_info->tx_clock,
                                        COMM_DIR_TX)) {
                        printk(KERN_ERR "%s: illegal value for TX clock\n",
-                              __FUNCTION__);
+                              __func__);
                        ucc_fast_free(uccf);
                        return -EINVAL;
                }
index b2870b208ddbd8081806cdb2a54ba661c05c45d3..a578bc77b9d5f284d0d602e67bf300f501ae7654 100644 (file)
@@ -142,7 +142,7 @@ int ucc_slow_init(struct ucc_slow_info * us_info, struct ucc_slow_private ** ucc
 
        /* check if the UCC port number is in range. */
        if ((us_info->ucc_num < 0) || (us_info->ucc_num > UCC_MAX_NUM - 1)) {
-               printk(KERN_ERR "%s: illegal UCC number\n", __FUNCTION__);
+               printk(KERN_ERR "%s: illegal UCC number\n", __func__);
                return -EINVAL;
        }
 
@@ -161,7 +161,7 @@ int ucc_slow_init(struct ucc_slow_info * us_info, struct ucc_slow_private ** ucc
        uccs = kzalloc(sizeof(struct ucc_slow_private), GFP_KERNEL);
        if (!uccs) {
                printk(KERN_ERR "%s: Cannot allocate private data\n",
-                       __FUNCTION__);
+                       __func__);
                return -ENOMEM;
        }
 
@@ -170,7 +170,7 @@ int ucc_slow_init(struct ucc_slow_info * us_info, struct ucc_slow_private ** ucc
        /* Set the PHY base address */
        uccs->us_regs = ioremap(us_info->regs, sizeof(struct ucc_slow));
        if (uccs->us_regs == NULL) {
-               printk(KERN_ERR "%s: Cannot map UCC registers\n", __FUNCTION__);
+               printk(KERN_ERR "%s: Cannot map UCC registers\n", __func__);
                return -ENOMEM;
        }
 
@@ -189,7 +189,7 @@ int ucc_slow_init(struct ucc_slow_info * us_info, struct ucc_slow_private ** ucc
        uccs->us_pram_offset =
                qe_muram_alloc(UCC_SLOW_PRAM_SIZE, ALIGNMENT_OF_UCC_SLOW_PRAM);
        if (IS_ERR_VALUE(uccs->us_pram_offset)) {
-               printk(KERN_ERR "%s: cannot allocate MURAM for PRAM", __FUNCTION__);
+               printk(KERN_ERR "%s: cannot allocate MURAM for PRAM", __func__);
                ucc_slow_free(uccs);
                return -ENOMEM;
        }
@@ -202,7 +202,7 @@ int ucc_slow_init(struct ucc_slow_info * us_info, struct ucc_slow_private ** ucc
        /* Set UCC to slow type */
        ret = ucc_set_type(us_info->ucc_num, UCC_SPEED_TYPE_SLOW);
        if (ret) {
-               printk(KERN_ERR "%s: cannot set UCC type", __FUNCTION__);
+               printk(KERN_ERR "%s: cannot set UCC type", __func__);
                ucc_slow_free(uccs);
                return ret;
        }
@@ -216,7 +216,7 @@ int ucc_slow_init(struct ucc_slow_info * us_info, struct ucc_slow_private ** ucc
                qe_muram_alloc(us_info->rx_bd_ring_len * sizeof(struct qe_bd),
                                QE_ALIGNMENT_OF_BD);
        if (IS_ERR_VALUE(uccs->rx_base_offset)) {
-               printk(KERN_ERR "%s: cannot allocate %u RX BDs\n", __FUNCTION__,
+               printk(KERN_ERR "%s: cannot allocate %u RX BDs\n", __func__,
                        us_info->rx_bd_ring_len);
                uccs->rx_base_offset = 0;
                ucc_slow_free(uccs);
@@ -227,7 +227,7 @@ int ucc_slow_init(struct ucc_slow_info * us_info, struct ucc_slow_private ** ucc
                qe_muram_alloc(us_info->tx_bd_ring_len * sizeof(struct qe_bd),
                        QE_ALIGNMENT_OF_BD);
        if (IS_ERR_VALUE(uccs->tx_base_offset)) {
-               printk(KERN_ERR "%s: cannot allocate TX BDs", __FUNCTION__);
+               printk(KERN_ERR "%s: cannot allocate TX BDs", __func__);
                uccs->tx_base_offset = 0;
                ucc_slow_free(uccs);
                return -ENOMEM;
@@ -317,7 +317,7 @@ int ucc_slow_init(struct ucc_slow_info * us_info, struct ucc_slow_private ** ucc
                if (ucc_set_qe_mux_rxtx(us_info->ucc_num, us_info->rx_clock,
                                        COMM_DIR_RX)) {
                        printk(KERN_ERR "%s: illegal value for RX clock\n",
-                              __FUNCTION__);
+                              __func__);
                        ucc_slow_free(uccs);
                        return -EINVAL;
                }
@@ -325,7 +325,7 @@ int ucc_slow_init(struct ucc_slow_info * us_info, struct ucc_slow_private ** ucc
                if (ucc_set_qe_mux_rxtx(us_info->ucc_num, us_info->tx_clock,
                                        COMM_DIR_TX)) {
                        printk(KERN_ERR "%s: illegal value for TX clock\n",
-                              __FUNCTION__);
+                              __func__);
                        ucc_slow_free(uccs);
                        return -EINVAL;
                }
index 0c9ac7ee08fbf98e00ae592884a5b85411907575..c09ddc0dbeb32f4a153f67bf3095c0020e096d30 100644 (file)
@@ -56,3 +56,5 @@ static int  __init add_rtc(void)
        return 0;
 }
 fs_initcall(add_rtc);
+
+MODULE_LICENSE("GPL");
index be2808a292f7521315b2a03b7e82a269cb8633b7..d4d15aaf18fabaeef8f13dc2f1b790b0c96458aa 100644 (file)
@@ -84,7 +84,7 @@ static int __init tsi108_eth_of_init(void)
 
                ret = of_address_to_resource(np, 0, &r[0]);
                DBG("%s: name:start->end = %s:0x%lx-> 0x%lx\n",
-                       __FUNCTION__,r[0].name, r[0].start, r[0].end);
+                       __func__,r[0].name, r[0].start, r[0].end);
                if (ret)
                        goto err;
 
@@ -93,7 +93,7 @@ static int __init tsi108_eth_of_init(void)
                r[1].end = irq_of_parse_and_map(np, 0);
                r[1].flags = IORESOURCE_IRQ;
                DBG("%s: name:start->end = %s:0x%lx-> 0x%lx\n",
-                       __FUNCTION__,r[1].name, r[1].start, r[1].end);
+                       __func__,r[1].name, r[1].start, r[1].end);
 
                tsi_eth_dev =
                    platform_device_register_simple("tsi-ethernet", i++, &r[0],
index 31d3d33d91fc63ae001c32c3d90e6dcddbc65594..ac1a72dc21e576b51a849aa540fad165568481b2 100644 (file)
@@ -207,7 +207,7 @@ int __init tsi108_setup_pci(struct device_node *dev, u32 cfg_phys, int primary)
        /* PCI Config mapping */
        tsi108_pci_cfg_base = (u32)ioremap(cfg_phys, TSI108_PCI_CFG_SIZE);
        tsi108_pci_cfg_phys = cfg_phys;
-       DBG("TSI_PCI: %s tsi108_pci_cfg_base=0x%x\n", __FUNCTION__,
+       DBG("TSI_PCI: %s tsi108_pci_cfg_base=0x%x\n", __func__,
            tsi108_pci_cfg_base);
 
        /* Fetch host bridge registers address */
@@ -395,7 +395,7 @@ static int pci_irq_host_xlate(struct irq_host *h, struct device_node *ct,
 static int pci_irq_host_map(struct irq_host *h, unsigned int virq,
                          irq_hw_number_t hw)
 {      unsigned int irq;
-       DBG("%s(%d, 0x%lx)\n", __FUNCTION__, virq, hw);
+       DBG("%s(%d, 0x%lx)\n", __func__, virq, hw);
        if ((virq >= 1) && (virq <= 4)){
                irq = virq + IRQ_PCI_INTAD_BASE - 1;
                get_irq_desc(irq)->status |= IRQ_LEVEL;
index a34172ddc4683064c818608b86fb506ba59e4c2f..52c74780f403c420c47bbcf13640173b6992852e 100644 (file)
@@ -45,7 +45,6 @@
 #ifdef CONFIG_PPC64
 #include <asm/hvcall.h>
 #include <asm/paca.h>
-#include <asm/iseries/it_lp_reg_save.h>
 #endif
 
 #include "nonstdio.h"
@@ -1244,15 +1243,12 @@ static void get_function_bounds(unsigned long pc, unsigned long *startp,
 
 static int xmon_depth_to_print = 64;
 
-#ifdef CONFIG_PPC64
-#define LRSAVE_OFFSET          0x10
-#define REG_FRAME_MARKER       0x7265677368657265ul    /* "regshere" */
-#define MARKER_OFFSET          0x60
+#define LRSAVE_OFFSET          (STACK_FRAME_LR_SAVE * sizeof(unsigned long))
+#define MARKER_OFFSET          (STACK_FRAME_MARKER * sizeof(unsigned long))
+
+#ifdef __powerpc64__
 #define REGS_OFFSET            0x70
 #else
-#define LRSAVE_OFFSET          4
-#define REG_FRAME_MARKER       0x72656773
-#define MARKER_OFFSET          8
 #define REGS_OFFSET            16
 #endif
 
@@ -1318,7 +1314,7 @@ static void xmon_show_stack(unsigned long sp, unsigned long lr,
                /* Look for "regshere" marker to see if this is
                   an exception frame. */
                if (mread(sp + MARKER_OFFSET, &marker, sizeof(unsigned long))
-                   && marker == REG_FRAME_MARKER) {
+                   && marker == STACK_FRAME_REGS_MARKER) {
                        if (mread(sp + REGS_OFFSET, &regs, sizeof(regs))
                            != sizeof(regs)) {
                                printf("Couldn't read registers at %lx\n",
@@ -1598,7 +1594,6 @@ void super_regs(void)
                if (firmware_has_feature(FW_FEATURE_ISERIES)) {
                        struct paca_struct *ptrPaca;
                        struct lppaca *ptrLpPaca;
-                       struct ItLpRegSave *ptrLpRegSave;
 
                        /* Dump out relevant Paca data areas. */
                        printf("Paca: \n");
@@ -1611,15 +1606,6 @@ void super_regs(void)
                        printf("    Saved Gpr3=%.16lx  Saved Gpr4=%.16lx \n",
                               ptrLpPaca->saved_gpr3, ptrLpPaca->saved_gpr4);
                        printf("    Saved Gpr5=%.16lx \n", ptrLpPaca->saved_gpr5);
-
-                       printf("  Local Processor Register Save Area (LpRegSave): \n");
-                       ptrLpRegSave = ptrPaca->reg_save_ptr;
-                       printf("    Saved Sprg0=%.16lx  Saved Sprg1=%.16lx \n",
-                              ptrLpRegSave->xSPRG0, ptrLpRegSave->xSPRG0);
-                       printf("    Saved Sprg2=%.16lx  Saved Sprg3=%.16lx \n",
-                              ptrLpRegSave->xSPRG2, ptrLpRegSave->xSPRG3);
-                       printf("    Saved Msr  =%.16lx  Saved Nia  =%.16lx \n",
-                              ptrLpRegSave->xMSR, ptrLpRegSave->xNIA);
                }
 #endif
 
index 9d656de0f0f19357d7f48724743bb6945ef7ba93..752443df5ecf270ea67ca0e3c44dafd22d62a678 100644 (file)
@@ -43,7 +43,7 @@
 ({                                                                     \
        u32 offset = offsetof(immap_t, member);                         \
        void *addr = ioremap (IMAP_ADDR + offset,                       \
-                             sizeof( ((immap_t*)0)->member));          \
+                             FIELD_SIZEOF(immap_t, member));           \
        addr;                                                           \
 })
 
index 11b0aa6ca97ecece995babf498fff580fabe1975..2c604d4f6e8b40f56c26767fcd5c2275b608b2ca 100644 (file)
@@ -199,7 +199,6 @@ static int fec_enet_start_xmit(struct sk_buff *skb, struct net_device *dev);
 #ifdef CONFIG_USE_MDIO
 static void fec_enet_mii(struct net_device *dev);
 #endif /* CONFIG_USE_MDIO */
-static irqreturn_t fec_enet_interrupt(int irq, void * dev_id);
 #ifdef CONFIG_FEC_PACKETHOOK
 static void  fec_enet_tx(struct net_device *dev, __u32 regval);
 static void  fec_enet_rx(struct net_device *dev, __u32 regval);
@@ -472,7 +471,7 @@ fec_timeout(struct net_device *dev)
  * This is called from the MPC core interrupt.
  */
 static irqreturn_t
-fec_enet_interrupt(int irq, void * dev_id)
+fec_enet_interrupt(int irq, void *dev_id)
 {
        struct  net_device *dev = dev_id;
        volatile fec_t  *fecp;
@@ -520,7 +519,7 @@ fec_enet_interrupt(int irq, void * dev_id)
 #ifdef CONFIG_USE_MDIO
                        fec_enet_mii(dev);
 #else
-printk("%s[%d] %s: unexpected FEC_ENET_MII event\n", __FILE__,__LINE__,__FUNCTION__);
+printk("%s[%d] %s: unexpected FEC_ENET_MII event\n", __FILE__, __LINE__, __func__);
 #endif /* CONFIG_USE_MDIO */
                }
 
@@ -1441,7 +1440,7 @@ irqreturn_t mii_link_interrupt(int irq, void * dev_id)
                fecp->fec_ecntrl = ecntrl;      /* restore old settings */
        }
 #else
-printk("%s[%d] %s: unexpected Link interrupt\n", __FILE__,__LINE__,__FUNCTION__);
+printk("%s[%d] %s: unexpected Link interrupt\n", __FILE__, __LINE__, __func__);
 #endif /* CONFIG_USE_MDIO */
 
 #ifndef CONFIG_RPXCLASSIC
index 1b0ec7202dd5470a939b7c9d933618f8c2c425a4..e7e642b95138c32e796c18720027893497a86376 100644 (file)
@@ -700,23 +700,6 @@ load_up_altivec:
        /* we haven't used ctr or xer or lr */
        b       fast_exception_return
 
-/*
- * AltiVec unavailable trap from kernel - print a message, but let
- * the task use AltiVec in the kernel until it returns to user mode.
- */
-KernelAltiVec:
-       lwz     r3,_MSR(r1)
-       oris    r3,r3,MSR_VEC@h
-       stw     r3,_MSR(r1)     /* enable use of AltiVec after return */
-       lis     r3,87f@h
-       ori     r3,r3,87f@l
-       mr      r4,r2           /* current */
-       lwz     r5,_NIP(r1)
-       bl      printk
-       b       ret_from_except
-87:    .string "AltiVec used in kernel  (task=%p, pc=%x)  \n"
-       .align  4,0
-
 /*
  * giveup_altivec(tsk)
  * Disable AltiVec for the task given as the argument,
index 7444df3889c5ef1da02f21e665531104df95b33f..1a63711081b5f96443433f61dae2b71321d1b4ed 100644 (file)
@@ -109,7 +109,6 @@ void show_mem(void)
 
        printk("Mem-info:\n");
        show_free_areas();
-       printk("Free swap:       %6ldkB\n", nr_swap_pages<<(PAGE_SHIFT-10));
        i = max_mapnr;
        while (i-- > 0) {
                total++;
index 179b4a99b5b54780baa0c8ce50d243911b7dc9f2..f1dee1e878096b2a80f80c36cfe64fcf91a0606b 100644 (file)
@@ -511,7 +511,7 @@ static void __init ppc7d_init_irq(void)
 {
        int irq;
 
-       pr_debug("%s\n", __FUNCTION__);
+       pr_debug("%s\n", __func__);
        i8259_init(0, 0);
        mv64360_init_irq();
 
@@ -568,7 +568,7 @@ static int __init ppc7d_map_irq(struct pci_dev *dev, unsigned char idsel,
        };
        const long min_idsel = 10, max_idsel = 14, irqs_per_slot = 4;
 
-       pr_debug("%s: %04x/%04x/%x: idsel=%hx pin=%hu\n", __FUNCTION__,
+       pr_debug("%s: %04x/%04x/%x: idsel=%hx pin=%hu\n", __func__,
                 dev->vendor, dev->device, PCI_FUNC(dev->devfn), idsel, pin);
 
        return PCI_IRQ_TABLE_LOOKUP;
@@ -1299,7 +1299,7 @@ static void ppc7d_init2(void)
        u32 data;
        u8 data8;
 
-       pr_debug("%s: enter\n", __FUNCTION__);
+       pr_debug("%s: enter\n", __func__);
 
        /* Wait for debugger? */
        if (ppc7d_wait_debugger) {
@@ -1332,7 +1332,7 @@ static void ppc7d_init2(void)
         ppc_md.set_rtc_time = ppc7d_set_rtc_time;
         ppc_md.get_rtc_time = ppc7d_get_rtc_time;
 
-       pr_debug("%s: exit\n", __FUNCTION__);
+       pr_debug("%s: exit\n", __func__);
 }
 
 /* Called from machine_init(), early, before any of the __init functions
index cc0935ccab7a49f3770707c8ca23d7fde0c5050e..0df6aacb8237e5429e1af92ba0e06284d25181cd 100644 (file)
@@ -121,8 +121,10 @@ struct hw_interrupt_type sbc82xx_i8259_ic = {
        .end = sbc82xx_i8259_end_irq,
 };
 
-static irqreturn_t sbc82xx_i8259_demux(int irq, void *dev_id)
+static irqreturn_t sbc82xx_i8259_demux(int dummy, void *dev_id)
 {
+       int irq;
+
        spin_lock(&sbc82xx_i8259_lock);
 
        sbc82xx_i8259_map[0] = 0x0c;    /* OCW3: Read IR register on RD# pulse */
index 9f504fc7693ed4980215ae58c710fecbd78462ee..ab0cf4ced9e5043e10cec56061058a8b0ca2c42a 100644 (file)
@@ -279,7 +279,7 @@ int mpc52xx_match_psc_function(int psc_idx, const char *func)
 
 int mpc52xx_set_psc_clkdiv(int psc_id, int clkdiv)
 {
-       static spinlock_t lock = SPIN_LOCK_UNLOCKED;
+       static DEFINE_SPINLOCK(lock);
        struct mpc52xx_cdm __iomem *cdm;
        unsigned long flags;
        u16 mclken_div;
index ac80370ed2f75fddac17e09eff6f633d289ffe14..a6fb7dcfa7381d0d1fa28099724f557803e3f357 100644 (file)
@@ -49,7 +49,6 @@
 #include <asm/io.h>
 #include <asm/ocp.h>
 #include <asm/errno.h>
-#include <asm/semaphore.h>
 
 //#define DBG(x)       printk x
 #define DBG(x)
index 50b85d07ddd250ce81a1104ae59793b76a7ec507..d7f22226fc4ec61a569f258c2e0903bbd0c121f3 100644 (file)
@@ -62,7 +62,6 @@
 
 #include <asm/types.h>
 #include <asm/uaccess.h>
-#include <asm/semaphore.h>
 
 #include <net/scm.h>
 #include <net/sock.h>
index 1e7d4ac7068bbfbd9b89d7823ac5ee085e2bf80d..dff0568e67ec8869fa427b7769b0ca329b561650 100644 (file)
@@ -17,7 +17,6 @@
 #include <linux/ctype.h>
 #include <linux/sysctl.h>
 #include <asm/uaccess.h>
-#include <asm/semaphore.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/fs.h>
index 8d2cd1de57265c947a340396613dd2b83ff1e5a7..6a679c3e15e817d14adcee8d6771c9e3c89e5b30 100644 (file)
@@ -167,6 +167,12 @@ config CPU_SUBTYPE_SH7263
        select CPU_SH2A
        select CPU_HAS_FPU
 
+config CPU_SUBTYPE_MXG
+       bool "Support MX-G processor"
+       select CPU_SH2A
+       help
+         Select MX-G if running on an R8A03022BG part.
+
 # SH-3 Processor Support
 
 config CPU_SUBTYPE_SH7705
@@ -270,6 +276,15 @@ config CPU_SUBTYPE_SH4_202
 
 # SH-4A Processor Support
 
+config CPU_SUBTYPE_SH7723
+       bool "Support SH7723 processor"
+       select CPU_SH4A
+       select CPU_SHX2
+       select ARCH_SPARSEMEM_ENABLE
+       select SYS_SUPPORTS_NUMA
+       help
+         Select SH7723 if you have an SH-MobileR2 CPU.
+
 config CPU_SUBTYPE_SH7763
        bool "Support SH7763 processor"
        select CPU_SH4A
@@ -366,6 +381,14 @@ config SH_7619_SOLUTION_ENGINE
          Select 7619 SolutionEngine if configuring for a Hitachi SH7619
          evaluation board.
        
+config SH_7721_SOLUTION_ENGINE
+       bool "SolutionEngine7721"
+       select SOLUTION_ENGINE
+       depends on CPU_SUBTYPE_SH7721
+       help
+         Select 7721 SolutionEngine if configuring for a Hitachi SH7721
+         evaluation board.
+
 config SH_7722_SOLUTION_ENGINE
        bool "SolutionEngine7722"
        select SOLUTION_ENGINE
@@ -560,7 +583,7 @@ config SH_TMU
 config SH_CMT
        def_bool y
        prompt "CMT timer support"
-       depends on CPU_SH2
+       depends on CPU_SH2 && !CPU_SUBTYPE_MXG
        help
          This enables the use of the CMT as the system timer.
 
@@ -578,6 +601,7 @@ config SH_TIMER_IRQ
        default "86" if CPU_SUBTYPE_SH7619
        default "140" if CPU_SUBTYPE_SH7206
        default "142" if CPU_SUBTYPE_SH7203
+       default "238" if CPU_SUBTYPE_MXG
        default "16"
 
 config SH_PCLK_FREQ
@@ -585,10 +609,10 @@ config SH_PCLK_FREQ
        default "27000000" if CPU_SUBTYPE_SH7343
        default "31250000" if CPU_SUBTYPE_SH7619
        default "32000000" if CPU_SUBTYPE_SH7722
-       default "33333333" if CPU_SUBTYPE_SH7770 || \
+       default "33333333" if CPU_SUBTYPE_SH7770 || CPU_SUBTYPE_SH7723 || \
                              CPU_SUBTYPE_SH7760 || CPU_SUBTYPE_SH7705 || \
                              CPU_SUBTYPE_SH7203 || CPU_SUBTYPE_SH7206 || \
-                             CPU_SUBTYPE_SH7263
+                             CPU_SUBTYPE_SH7263 || CPU_SUBTYPE_MXG
        default "60000000" if CPU_SUBTYPE_SH7751 || CPU_SUBTYPE_SH7751R
        default "66000000" if CPU_SUBTYPE_SH4_202
        default "50000000"
index 5dcb74b947a968ca0b18ddfbf7e1da8ed7958209..d9d28f9dd0db5fbd990a1262d07898017e73cc04 100644 (file)
@@ -29,16 +29,17 @@ config EARLY_SCIF_CONSOLE
 config EARLY_SCIF_CONSOLE_PORT
        hex
        depends on EARLY_SCIF_CONSOLE
-       default "0xffe00000" if CPU_SUBTYPE_SH7780 || CPU_SUBTYPE_SH7763
-       default "0xffe00000" if CPU_SUBTYPE_SH7722 || CPU_SUBTYPE_SH7366
-       default "0xffea0000" if CPU_SUBTYPE_SH7785
-       default "0xfffe8000" if CPU_SUBTYPE_SH7203
-       default "0xfffe9800" if CPU_SUBTYPE_SH7206 || CPU_SUBTYPE_SH7263
-       default "0xf8420000" if CPU_SUBTYPE_SH7619
        default "0xa4400000" if CPU_SUBTYPE_SH7712 || CPU_SUBTYPE_SH7705
        default "0xa4430000" if CPU_SUBTYPE_SH7720 || CPU_SUBTYPE_SH7721
+       default "0xf8420000" if CPU_SUBTYPE_SH7619
+       default "0xff804000" if CPU_SUBTYPE_MXG
        default "0xffc30000" if CPU_SUBTYPE_SHX3
+       default "0xffe00000" if CPU_SUBTYPE_SH7780 || CPU_SUBTYPE_SH7763 || \
+                               CPU_SUBTYPE_SH7722 || CPU_SUBTYPE_SH7366
        default "0xffe80000" if CPU_SH4
+       default "0xffea0000" if CPU_SUBTYPE_SH7785
+       default "0xfffe8000" if CPU_SUBTYPE_SH7203
+       default "0xfffe9800" if CPU_SUBTYPE_SH7206 || CPU_SUBTYPE_SH7263
        default "0x00000000"
 
 config EARLY_PRINTK
index cffc92b1bf2e8d7236d29cdf599bd7ee07ecf553..bb06f83e6239c648e138a1d820f0d3e6dab7fa51 100644 (file)
@@ -107,6 +107,7 @@ machdir-$(CONFIG_SH_7722_SOLUTION_ENGINE)   += se/7722
 machdir-$(CONFIG_SH_7751_SOLUTION_ENGINE)      += se/7751
 machdir-$(CONFIG_SH_7780_SOLUTION_ENGINE)      += se/7780
 machdir-$(CONFIG_SH_7343_SOLUTION_ENGINE)      += se/7343
+machdir-$(CONFIG_SH_7721_SOLUTION_ENGINE)      += se/7721
 machdir-$(CONFIG_SH_HP6XX)                     += hp6xx
 machdir-$(CONFIG_SH_DREAMCAST)                 += dreamcast
 machdir-$(CONFIG_SH_MPC1211)                   += mpc1211
index 21ab8c8fb590a9d2c7f41429895b2aa952e834ff..00d52a20d8a59425105f0307aa227d66b4871308 100644 (file)
 #include <linux/init.h>
 #include <linux/platform_device.h>
 #include <linux/interrupt.h>
+#include <linux/input.h>
+#include <linux/mtd/physmap.h>
+#include <linux/mtd/nand.h>
+#include <linux/i2c.h>
 #include <asm/machvec.h>
 #include <asm/io.h>
+#include <asm/sh_keysc.h>
+#include <asm/migor.h>
 
 /* Address     IRQ  Size  Bus  Description
  * 0x00000000       64MB  16   NOR Flash (SP29PL256N)
@@ -23,9 +29,9 @@
 
 static struct resource smc91x_eth_resources[] = {
        [0] = {
-               .name   = "smc91x-regs" ,
-               .start  = P2SEGADDR(0x10000300),
-               .end    = P2SEGADDR(0x1000030f),
+               .name   = "SMC91C111" ,
+               .start  = 0x10000300,
+               .end    = 0x1000030f,
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
@@ -40,19 +46,202 @@ static struct platform_device smc91x_eth_device = {
        .resource       = smc91x_eth_resources,
 };
 
+static struct sh_keysc_info sh_keysc_info = {
+       .mode = SH_KEYSC_MODE_2, /* KEYOUT0->4, KEYIN1->5 */
+       .scan_timing = 3,
+       .delay = 5,
+       .keycodes = {
+               0, KEY_UP, KEY_DOWN, KEY_LEFT, KEY_RIGHT, KEY_ENTER,
+               0, KEY_F, KEY_C, KEY_D, KEY_H, KEY_1,
+               0, KEY_2, KEY_3, KEY_4, KEY_5, KEY_6,
+               0, KEY_7, KEY_8, KEY_9, KEY_S, KEY_0,
+               0, KEY_P, KEY_STOP, KEY_REWIND, KEY_PLAY, KEY_FASTFORWARD,
+       },
+};
+
+static struct resource sh_keysc_resources[] = {
+       [0] = {
+               .start  = 0x044b0000,
+               .end    = 0x044b000f,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = 79,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device sh_keysc_device = {
+       .name           = "sh_keysc",
+       .num_resources  = ARRAY_SIZE(sh_keysc_resources),
+       .resource       = sh_keysc_resources,
+       .dev    = {
+               .platform_data  = &sh_keysc_info,
+       },
+};
+
+static struct mtd_partition migor_nor_flash_partitions[] =
+{
+       {
+               .name = "uboot",
+               .offset = 0,
+               .size = (1 * 1024 * 1024),
+               .mask_flags = MTD_WRITEABLE,    /* Read-only */
+       },
+       {
+               .name = "rootfs",
+               .offset = MTDPART_OFS_APPEND,
+               .size = (15 * 1024 * 1024),
+       },
+       {
+               .name = "other",
+               .offset = MTDPART_OFS_APPEND,
+               .size = MTDPART_SIZ_FULL,
+       },
+};
+
+static struct physmap_flash_data migor_nor_flash_data = {
+       .width          = 2,
+       .parts          = migor_nor_flash_partitions,
+       .nr_parts       = ARRAY_SIZE(migor_nor_flash_partitions),
+};
+
+static struct resource migor_nor_flash_resources[] = {
+       [0] = {
+               .name           = "NOR Flash",
+               .start          = 0x00000000,
+               .end            = 0x03ffffff,
+               .flags          = IORESOURCE_MEM,
+       }
+};
+
+static struct platform_device migor_nor_flash_device = {
+       .name           = "physmap-flash",
+       .resource       = migor_nor_flash_resources,
+       .num_resources  = ARRAY_SIZE(migor_nor_flash_resources),
+       .dev            = {
+               .platform_data = &migor_nor_flash_data,
+       },
+};
+
+static struct mtd_partition migor_nand_flash_partitions[] = {
+       {
+               .name           = "nanddata1",
+               .offset         = 0x0,
+               .size           = 512 * 1024 * 1024,
+       },
+       {
+               .name           = "nanddata2",
+               .offset         = MTDPART_OFS_APPEND,
+               .size           = 512 * 1024 * 1024,
+       },
+};
+
+static void migor_nand_flash_cmd_ctl(struct mtd_info *mtd, int cmd,
+                                    unsigned int ctrl)
+{
+       struct nand_chip *chip = mtd->priv;
+
+       if (cmd == NAND_CMD_NONE)
+               return;
+
+       if (ctrl & NAND_CLE)
+               writeb(cmd, chip->IO_ADDR_W + 0x00400000);
+       else if (ctrl & NAND_ALE)
+               writeb(cmd, chip->IO_ADDR_W + 0x00800000);
+       else
+               writeb(cmd, chip->IO_ADDR_W);
+}
+
+static int migor_nand_flash_ready(struct mtd_info *mtd)
+{
+       return ctrl_inb(PORT_PADR) & 0x02; /* PTA1 */
+}
+
+struct platform_nand_data migor_nand_flash_data = {
+       .chip = {
+               .nr_chips = 1,
+               .partitions = migor_nand_flash_partitions,
+               .nr_partitions = ARRAY_SIZE(migor_nand_flash_partitions),
+               .chip_delay = 20,
+               .part_probe_types = (const char *[]) { "cmdlinepart", NULL },
+       },
+       .ctrl = {
+               .dev_ready = migor_nand_flash_ready,
+               .cmd_ctrl = migor_nand_flash_cmd_ctl,
+       },
+};
+
+static struct resource migor_nand_flash_resources[] = {
+       [0] = {
+               .name           = "NAND Flash",
+               .start          = 0x18000000,
+               .end            = 0x18ffffff,
+               .flags          = IORESOURCE_MEM,
+       },
+};
+
+static struct platform_device migor_nand_flash_device = {
+       .name           = "gen_nand",
+       .resource       = migor_nand_flash_resources,
+       .num_resources  = ARRAY_SIZE(migor_nand_flash_resources),
+       .dev            = {
+               .platform_data = &migor_nand_flash_data,
+       }
+};
+
 static struct platform_device *migor_devices[] __initdata = {
        &smc91x_eth_device,
+       &sh_keysc_device,
+       &migor_nor_flash_device,
+       &migor_nand_flash_device,
+};
+
+static struct i2c_board_info __initdata migor_i2c_devices[] = {
+       {
+               I2C_BOARD_INFO("rtc-rs5c372", 0x32),
+               .type   = "rs5c372b",
+       },
+       {
+               I2C_BOARD_INFO("migor_ts", 0x51),
+               .irq = 38, /* IRQ6 */
+       },
 };
 
 static int __init migor_devices_setup(void)
 {
+       i2c_register_board_info(0, migor_i2c_devices,
+                               ARRAY_SIZE(migor_i2c_devices));
        return platform_add_devices(migor_devices, ARRAY_SIZE(migor_devices));
 }
 __initcall(migor_devices_setup);
 
 static void __init migor_setup(char **cmdline_p)
 {
-       ctrl_outw(0x1000, 0xa4050110); /* Enable IRQ0 in PJCR */
+       /* SMC91C111 - Enable IRQ0 */
+       ctrl_outw(ctrl_inw(PORT_PJCR) & ~0x0003, PORT_PJCR);
+
+       /* KEYSC */
+       ctrl_outw(ctrl_inw(PORT_PYCR) & ~0x0fff, PORT_PYCR);
+       ctrl_outw(ctrl_inw(PORT_PZCR) & ~0x0ff0, PORT_PZCR);
+       ctrl_outw(ctrl_inw(PORT_PSELA) & ~0x4100, PORT_PSELA);
+       ctrl_outw(ctrl_inw(PORT_HIZCRA) & ~0x4000, PORT_HIZCRA);
+       ctrl_outw(ctrl_inw(PORT_HIZCRC) & ~0xc000, PORT_HIZCRC);
+       ctrl_outl(ctrl_inl(MSTPCR2) & ~0x00004000, MSTPCR2);
+
+       /* NAND Flash */
+       ctrl_outw(ctrl_inw(PORT_PXCR) & 0x0fff, PORT_PXCR);
+       ctrl_outl((ctrl_inl(BSC_CS6ABCR) & ~0x00000600) | 0x00000200,
+                 BSC_CS6ABCR);
+
+       /* I2C */
+       ctrl_outl(ctrl_inl(MSTPCR1) & ~0x00000200, MSTPCR1);
+
+       /* Touch Panel - Enable IRQ6 */
+       ctrl_outw(ctrl_inw(PORT_PZCR) & ~0xc, PORT_PZCR);
+       ctrl_outw((ctrl_inw(PORT_PSELA) | 0x8000), PORT_PSELA);
+       ctrl_outw((ctrl_inw(PORT_HIZCRC) & ~0x4000), PORT_HIZCRC);
 }
 
 static struct sh_machine_vector mv_migor __initmv = {
index 1f8f073f27be94c85d6e3202e97c3391615e45e2..68f0ad1b637dd3335243e7e101761fe34cd08688 100644 (file)
@@ -18,31 +18,44 @@ enum {
        UNUSED = 0,
 
        /* board specific interrupt sources */
-       AX88796,          /* Ethernet controller */
-       CF,               /* Compact Flash */
-       PSW,              /* Push Switch */
-       EXT1,             /* EXT1n IRQ */
-       EXT4,             /* EXT4n IRQ */
+       CF,             /* Compact Flash */
+       TP,             /* Touch panel */
+       SCIF1,          /* FPGA SCIF1 */
+       SCIF0,          /* FPGA SCIF0 */
+       SMBUS,          /* SMBUS */
+       RTC,            /* RTC Alarm */
+       AX88796,        /* Ethernet controller */
+       PSW,            /* Push Switch */
+
+       /* external bus connector */
+       EXT1, EXT2, EXT4, EXT5, EXT6,
 };
 
 static struct intc_vect vectors[] __initdata = {
        INTC_IRQ(CF, IRQ_CF),
-       INTC_IRQ(PSW, IRQ_PSW),
+       INTC_IRQ(TP, IRQ_TP),
+       INTC_IRQ(SCIF1, IRQ_SCIF1),
+       INTC_IRQ(SCIF0, IRQ_SCIF0),
+       INTC_IRQ(SMBUS, IRQ_SMBUS),
+       INTC_IRQ(RTC, IRQ_RTC),
        INTC_IRQ(AX88796, IRQ_AX88796),
-       INTC_IRQ(EXT1, IRQ_EXT1),
-       INTC_IRQ(EXT4, IRQ_EXT4),
+       INTC_IRQ(PSW, IRQ_PSW),
+
+       INTC_IRQ(EXT1, IRQ_EXT1), INTC_IRQ(EXT2, IRQ_EXT2),
+       INTC_IRQ(EXT4, IRQ_EXT4), INTC_IRQ(EXT5, IRQ_EXT5),
+       INTC_IRQ(EXT6, IRQ_EXT6),
 };
 
 static struct intc_mask_reg mask_registers[] __initdata = {
        { 0xa4000000, 0, 16, /* IRLMSK */
-         { 0, 0, 0, 0, CF, 0, 0, 0,
-           0, 0, 0, EXT4, 0, EXT1, PSW, AX88796 } },
+         { SCIF0, SCIF1, RTC, 0, CF, 0, TP, SMBUS,
+           0, EXT6, EXT5, EXT4, EXT2, EXT1, PSW, AX88796 } },
 };
 
 static unsigned char irl2irq[HL_NR_IRL] __initdata = {
-       0, IRQ_CF, 0, 0,
-       0, 0, 0, 0,
-       0, IRQ_EXT4, 0, IRQ_EXT1,
+       0, IRQ_CF, IRQ_TP, IRQ_SCIF1,
+       IRQ_SCIF0, IRQ_SMBUS, IRQ_RTC, IRQ_EXT6,
+       IRQ_EXT5, IRQ_EXT4, IRQ_EXT2, IRQ_EXT1,
        0, IRQ_AX88796, IRQ_PSW,
 };
 
index 2f68bea7890c64f6ac0ae3883b91ca9b6e72d6d3..a5c5e92365011bfd7f1ba4594b0fb26f1c116540 100644 (file)
@@ -4,7 +4,7 @@
  * Renesas Solutions Highlander Support.
  *
  * Copyright (C) 2002 Atom Create Engineering Co., Ltd.
- * Copyright (C) 2005 - 2007 Paul Mundt
+ * Copyright (C) 2005 - 2008 Paul Mundt
  *
  * This contains support for the R7780RP-1, R7780MP, and R7785RP
  * Highlander modules.
@@ -17,6 +17,7 @@
 #include <linux/platform_device.h>
 #include <linux/ata_platform.h>
 #include <linux/types.h>
+#include <linux/i2c.h>
 #include <net/ax88796.h>
 #include <asm/machvec.h>
 #include <asm/r7780rp.h>
@@ -176,11 +177,38 @@ static struct platform_device ax88796_device = {
        .resource       = ax88796_resources,
 };
 
+static struct resource smbus_resources[] = {
+       [0] = {
+               .start  = PA_SMCR,
+               .end    = PA_SMCR + 0x100 - 1,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = IRQ_SMBUS,
+               .end    = IRQ_SMBUS,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device smbus_device = {
+       .name           = "i2c-highlander",
+       .id             = 0,
+       .num_resources  = ARRAY_SIZE(smbus_resources),
+       .resource       = smbus_resources,
+};
+
+static struct i2c_board_info __initdata highlander_i2c_devices[] = {
+       {
+               I2C_BOARD_INFO("rtc-rs5c372", 0x32),
+               .type   = "r2025sd",
+       },
+};
 
 static struct platform_device *r7780rp_devices[] __initdata = {
        &r8a66597_usb_host_device,
        &m66592_usb_peripheral_device,
        &heartbeat_device,
+       &smbus_device,
 #ifndef CONFIG_SH_R7780RP
        &ax88796_device,
 #endif
@@ -199,12 +227,20 @@ static struct trapped_io cf_trapped_io = {
 
 static int __init r7780rp_devices_setup(void)
 {
+       int ret = 0;
+
 #ifndef CONFIG_SH_R7780RP
        if (register_trapped_io(&cf_trapped_io) == 0)
-               platform_device_register(&cf_ide_device);
+               ret |= platform_device_register(&cf_ide_device);
 #endif
-       return platform_add_devices(r7780rp_devices,
+
+       ret |= platform_add_devices(r7780rp_devices,
                                    ARRAY_SIZE(r7780rp_devices));
+
+       ret |= i2c_register_board_info(0, highlander_i2c_devices,
+                                      ARRAY_SIZE(highlander_i2c_devices));
+
+       return ret;
 }
 device_initcall(r7780rp_devices_setup);
 
diff --git a/arch/sh/boards/se/7721/Makefile b/arch/sh/boards/se/7721/Makefile
new file mode 100644 (file)
index 0000000..7f09030
--- /dev/null
@@ -0,0 +1 @@
+obj-y   := setup.o irq.o
diff --git a/arch/sh/boards/se/7721/irq.c b/arch/sh/boards/se/7721/irq.c
new file mode 100644 (file)
index 0000000..c4fdd62
--- /dev/null
@@ -0,0 +1,45 @@
+/*
+ * linux/arch/sh/boards/se/7721/irq.c
+ *
+ * Copyright (C) 2008  Renesas Solutions Corp.
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ */
+#include <linux/init.h>
+#include <linux/irq.h>
+#include <linux/interrupt.h>
+#include <linux/io.h>
+#include <asm/se7721.h>
+
+enum {
+       UNUSED = 0,
+
+       /* board specific interrupt sources */
+       MRSHPC,
+};
+
+static struct intc_vect vectors[] __initdata = {
+       INTC_IRQ(MRSHPC, MRSHPC_IRQ0),
+};
+
+static struct intc_prio_reg prio_registers[] __initdata = {
+       { FPGA_ILSR6, 0, 8, 4, /* IRLMSK */
+         { 0, MRSHPC } },
+};
+
+static DECLARE_INTC_DESC(intc_desc, "SE7721", vectors,
+                        NULL, NULL, prio_registers, NULL);
+
+/*
+ * Initialize IRQ setting
+ */
+void __init init_se7721_IRQ(void)
+{
+       /* PPCR */
+       ctrl_outw(ctrl_inw(0xa4050118) & ~0x00ff, 0xa4050118);
+
+       register_intc_controller(&intc_desc);
+       intc_set_priority(MRSHPC_IRQ0, 0xf - MRSHPC_IRQ0);
+}
diff --git a/arch/sh/boards/se/7721/setup.c b/arch/sh/boards/se/7721/setup.c
new file mode 100644 (file)
index 0000000..1be3e92
--- /dev/null
@@ -0,0 +1,99 @@
+/*
+ * linux/arch/sh/boards/se/7721/setup.c
+ *
+ * Copyright (C) 2008 Renesas Solutions Corp.
+ *
+ * Hitachi UL SolutionEngine 7721 Support.
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+ */
+#include <linux/init.h>
+#include <linux/platform_device.h>
+#include <asm/machvec.h>
+#include <asm/se7721.h>
+#include <asm/io.h>
+#include <asm/heartbeat.h>
+
+static unsigned char heartbeat_bit_pos[] = { 8, 9, 10, 11, 12, 13, 14, 15 };
+
+static struct heartbeat_data heartbeat_data = {
+       .bit_pos        = heartbeat_bit_pos,
+       .nr_bits        = ARRAY_SIZE(heartbeat_bit_pos),
+       .regsize        = 16,
+};
+
+static struct resource heartbeat_resources[] = {
+       [0] = {
+               .start  = PA_LED,
+               .end    = PA_LED,
+               .flags  = IORESOURCE_MEM,
+       },
+};
+
+static struct platform_device heartbeat_device = {
+       .name           = "heartbeat",
+       .id             = -1,
+       .dev    = {
+               .platform_data  = &heartbeat_data,
+       },
+       .num_resources  = ARRAY_SIZE(heartbeat_resources),
+       .resource       = heartbeat_resources,
+};
+
+static struct resource cf_ide_resources[] = {
+       [0] = {
+               .start  = PA_MRSHPC_IO + 0x1f0,
+               .end    = PA_MRSHPC_IO + 0x1f0 + 8 ,
+               .flags  = IORESOURCE_IO,
+       },
+       [1] = {
+               .start  = PA_MRSHPC_IO + 0x1f0 + 0x206,
+               .end    = PA_MRSHPC_IO + 0x1f0 + 8 + 0x206 + 8,
+               .flags  = IORESOURCE_IO,
+       },
+       [2] = {
+               .start  = MRSHPC_IRQ0,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device cf_ide_device = {
+       .name           = "pata_platform",
+       .id             = -1,
+       .num_resources  = ARRAY_SIZE(cf_ide_resources),
+       .resource       = cf_ide_resources,
+};
+
+static struct platform_device *se7721_devices[] __initdata = {
+       &cf_ide_device,
+       &heartbeat_device
+};
+
+static int __init se7721_devices_setup(void)
+{
+       return platform_add_devices(se7721_devices,
+               ARRAY_SIZE(se7721_devices));
+}
+device_initcall(se7721_devices_setup);
+
+static void __init se7721_setup(char **cmdline_p)
+{
+       /* for USB */
+       ctrl_outw(0x0000, 0xA405010C);  /* PGCR */
+       ctrl_outw(0x0000, 0xA405010E);  /* PHCR */
+       ctrl_outw(0x00AA, 0xA4050118);  /* PPCR */
+       ctrl_outw(0x0000, 0xA4050124);  /* PSELA */
+}
+
+/*
+ * The Machine Vector
+ */
+struct sh_machine_vector mv_se7721 __initmv = {
+       .mv_name                = "Solution Engine 7721",
+       .mv_setup               = se7721_setup,
+       .mv_nr_irqs             = 109,
+       .mv_init_irq            = init_se7721_IRQ,
+};
index b1a3d9d0172f50678c5add2c1388bb5094afbcf2..33f6ee71f8483f9c58dd736ed93c9237d54f2e33 100644 (file)
 #include <linux/init.h>
 #include <linux/platform_device.h>
 #include <linux/ata_platform.h>
+#include <linux/input.h>
 #include <asm/machvec.h>
 #include <asm/se7722.h>
 #include <asm/io.h>
 #include <asm/heartbeat.h>
+#include <asm/sh_keysc.h>
 
 /* Heartbeat */
 static struct heartbeat_data heartbeat_data = {
@@ -92,10 +94,47 @@ static struct platform_device cf_ide_device  = {
        .resource       = cf_ide_resources,
 };
 
+static struct sh_keysc_info sh_keysc_info = {
+       .mode = SH_KEYSC_MODE_1, /* KEYOUT0->5, KEYIN0->4 */
+       .scan_timing = 3,
+       .delay = 5,
+       .keycodes = { /* SW1 -> SW30 */
+               KEY_A, KEY_B, KEY_C, KEY_D, KEY_E,
+               KEY_F, KEY_G, KEY_H, KEY_I, KEY_J,
+               KEY_K, KEY_L, KEY_M, KEY_N, KEY_O,
+               KEY_P, KEY_Q, KEY_R, KEY_S, KEY_T,
+               KEY_U, KEY_V, KEY_W, KEY_X, KEY_Y,
+               KEY_Z,
+               KEY_HOME, KEY_SLEEP, KEY_WAKEUP, KEY_COFFEE, /* life */
+       },
+};
+
+static struct resource sh_keysc_resources[] = {
+       [0] = {
+               .start  = 0x044b0000,
+               .end    = 0x044b000f,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = 79,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device sh_keysc_device = {
+       .name           = "sh_keysc",
+       .num_resources  = ARRAY_SIZE(sh_keysc_resources),
+       .resource       = sh_keysc_resources,
+       .dev    = {
+               .platform_data  = &sh_keysc_info,
+       },
+};
+
 static struct platform_device *se7722_devices[] __initdata = {
        &heartbeat_device,
        &smc91x_eth_device,
        &cf_ide_device,
+       &sh_keysc_device,
 };
 
 static int __init se7722_devices_setup(void)
@@ -136,6 +175,8 @@ static void __init se7722_setup(char **cmdline_p)
        ctrl_outw(0x0A10, PORT_PSELA); /* BS,SHHID2 */
        ctrl_outw(0x0000, PORT_PYCR);
        ctrl_outw(0x0000, PORT_PZCR);
+       ctrl_outw(ctrl_inw(PORT_HIZCRA) & ~0x4000, PORT_HIZCRA);
+       ctrl_outw(ctrl_inw(PORT_HIZCRC) & ~0xc000, PORT_HIZCRC);
 }
 
 /*
diff --git a/arch/sh/configs/se7721_defconfig b/arch/sh/configs/se7721_defconfig
new file mode 100644 (file)
index 0000000..f3d4ca0
--- /dev/null
@@ -0,0 +1,1085 @@
+#
+# Automatically generated make config: don't edit
+# Linux kernel version: 2.6.25-rc5
+# Fri Mar 21 12:05:31 2008
+#
+CONFIG_SUPERH=y
+CONFIG_SUPERH32=y
+CONFIG_RWSEM_GENERIC_SPINLOCK=y
+CONFIG_GENERIC_FIND_NEXT_BIT=y
+CONFIG_GENERIC_HWEIGHT=y
+CONFIG_GENERIC_HARDIRQS=y
+CONFIG_GENERIC_IRQ_PROBE=y
+CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_GENERIC_TIME=y
+CONFIG_GENERIC_CLOCKEVENTS=y
+CONFIG_STACKTRACE_SUPPORT=y
+CONFIG_LOCKDEP_SUPPORT=y
+# CONFIG_ARCH_HAS_ILOG2_U32 is not set
+# CONFIG_ARCH_HAS_ILOG2_U64 is not set
+CONFIG_ARCH_NO_VIRT_TO_BUS=y
+CONFIG_ARCH_SUPPORTS_AOUT=y
+CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
+
+#
+# General setup
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_BROKEN_ON_SMP=y
+CONFIG_INIT_ENV_ARG_LIMIT=32
+CONFIG_LOCALVERSION=""
+# CONFIG_LOCALVERSION_AUTO is not set
+# CONFIG_SWAP is not set
+CONFIG_SYSVIPC=y
+CONFIG_SYSVIPC_SYSCTL=y
+CONFIG_POSIX_MQUEUE=y
+CONFIG_BSD_PROCESS_ACCT=y
+# CONFIG_BSD_PROCESS_ACCT_V3 is not set
+# CONFIG_TASKSTATS is not set
+# CONFIG_AUDIT is not set
+# CONFIG_IKCONFIG is not set
+CONFIG_LOG_BUF_SHIFT=14
+# CONFIG_CGROUPS is not set
+CONFIG_GROUP_SCHED=y
+CONFIG_FAIR_GROUP_SCHED=y
+# CONFIG_RT_GROUP_SCHED is not set
+CONFIG_USER_SCHED=y
+# CONFIG_CGROUP_SCHED is not set
+CONFIG_SYSFS_DEPRECATED=y
+CONFIG_SYSFS_DEPRECATED_V2=y
+# CONFIG_RELAY is not set
+# CONFIG_NAMESPACES is not set
+# CONFIG_BLK_DEV_INITRD is not set
+# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
+CONFIG_SYSCTL=y
+CONFIG_EMBEDDED=y
+CONFIG_UID16=y
+CONFIG_SYSCTL_SYSCALL=y
+CONFIG_KALLSYMS=y
+CONFIG_KALLSYMS_ALL=y
+# CONFIG_KALLSYMS_EXTRA_PASS is not set
+CONFIG_HOTPLUG=y
+CONFIG_PRINTK=y
+# CONFIG_BUG is not set
+CONFIG_ELF_CORE=y
+CONFIG_COMPAT_BRK=y
+# CONFIG_BASE_FULL is not set
+CONFIG_FUTEX=y
+CONFIG_ANON_INODES=y
+CONFIG_EPOLL=y
+CONFIG_SIGNALFD=y
+CONFIG_TIMERFD=y
+CONFIG_EVENTFD=y
+# CONFIG_SHMEM is not set
+CONFIG_VM_EVENT_COUNTERS=y
+CONFIG_SLAB=y
+# CONFIG_SLUB is not set
+# CONFIG_SLOB is not set
+# CONFIG_PROFILING is not set
+# CONFIG_MARKERS is not set
+CONFIG_HAVE_OPROFILE=y
+# CONFIG_HAVE_KPROBES is not set
+# CONFIG_HAVE_KRETPROBES is not set
+CONFIG_PROC_PAGE_MONITOR=y
+CONFIG_SLABINFO=y
+CONFIG_RT_MUTEXES=y
+CONFIG_TINY_SHMEM=y
+CONFIG_BASE_SMALL=1
+CONFIG_MODULES=y
+# CONFIG_MODULE_UNLOAD is not set
+# CONFIG_MODVERSIONS is not set
+# CONFIG_MODULE_SRCVERSION_ALL is not set
+# CONFIG_KMOD is not set
+CONFIG_BLOCK=y
+# CONFIG_LBD is not set
+# CONFIG_BLK_DEV_IO_TRACE is not set
+# CONFIG_LSF is not set
+# CONFIG_BLK_DEV_BSG is not set
+
+#
+# IO Schedulers
+#
+CONFIG_IOSCHED_NOOP=y
+# CONFIG_IOSCHED_AS is not set
+# CONFIG_IOSCHED_DEADLINE is not set
+# CONFIG_IOSCHED_CFQ is not set
+# CONFIG_DEFAULT_AS is not set
+# CONFIG_DEFAULT_DEADLINE is not set
+# CONFIG_DEFAULT_CFQ is not set
+CONFIG_DEFAULT_NOOP=y
+CONFIG_DEFAULT_IOSCHED="noop"
+CONFIG_CLASSIC_RCU=y
+
+#
+# System type
+#
+CONFIG_CPU_SH3=y
+# CONFIG_CPU_SUBTYPE_SH7619 is not set
+# CONFIG_CPU_SUBTYPE_SH7203 is not set
+# CONFIG_CPU_SUBTYPE_SH7206 is not set
+# CONFIG_CPU_SUBTYPE_SH7263 is not set
+# CONFIG_CPU_SUBTYPE_MXG is not set
+# CONFIG_CPU_SUBTYPE_SH7705 is not set
+# CONFIG_CPU_SUBTYPE_SH7706 is not set
+# CONFIG_CPU_SUBTYPE_SH7707 is not set
+# CONFIG_CPU_SUBTYPE_SH7708 is not set
+# CONFIG_CPU_SUBTYPE_SH7709 is not set
+# CONFIG_CPU_SUBTYPE_SH7710 is not set
+# CONFIG_CPU_SUBTYPE_SH7712 is not set
+# CONFIG_CPU_SUBTYPE_SH7720 is not set
+CONFIG_CPU_SUBTYPE_SH7721=y
+# CONFIG_CPU_SUBTYPE_SH7750 is not set
+# CONFIG_CPU_SUBTYPE_SH7091 is not set
+# CONFIG_CPU_SUBTYPE_SH7750R is not set
+# CONFIG_CPU_SUBTYPE_SH7750S is not set
+# CONFIG_CPU_SUBTYPE_SH7751 is not set
+# CONFIG_CPU_SUBTYPE_SH7751R is not set
+# CONFIG_CPU_SUBTYPE_SH7760 is not set
+# CONFIG_CPU_SUBTYPE_SH4_202 is not set
+# CONFIG_CPU_SUBTYPE_SH7763 is not set
+# CONFIG_CPU_SUBTYPE_SH7770 is not set
+# CONFIG_CPU_SUBTYPE_SH7780 is not set
+# CONFIG_CPU_SUBTYPE_SH7785 is not set
+# CONFIG_CPU_SUBTYPE_SHX3 is not set
+# CONFIG_CPU_SUBTYPE_SH7343 is not set
+# CONFIG_CPU_SUBTYPE_SH7722 is not set
+# CONFIG_CPU_SUBTYPE_SH7366 is not set
+# CONFIG_CPU_SUBTYPE_SH5_101 is not set
+# CONFIG_CPU_SUBTYPE_SH5_103 is not set
+
+#
+# Memory management options
+#
+CONFIG_QUICKLIST=y
+CONFIG_MMU=y
+CONFIG_PAGE_OFFSET=0x80000000
+CONFIG_MEMORY_START=0x0c000000
+CONFIG_MEMORY_SIZE=0x02000000
+CONFIG_29BIT=y
+CONFIG_VSYSCALL=y
+CONFIG_ARCH_FLATMEM_ENABLE=y
+CONFIG_ARCH_SPARSEMEM_ENABLE=y
+CONFIG_ARCH_SPARSEMEM_DEFAULT=y
+CONFIG_MAX_ACTIVE_REGIONS=1
+CONFIG_ARCH_POPULATES_NODE_MAP=y
+CONFIG_ARCH_SELECT_MEMORY_MODEL=y
+CONFIG_PAGE_SIZE_4KB=y
+# CONFIG_PAGE_SIZE_8KB is not set
+# CONFIG_PAGE_SIZE_64KB is not set
+CONFIG_SELECT_MEMORY_MODEL=y
+CONFIG_FLATMEM_MANUAL=y
+# CONFIG_DISCONTIGMEM_MANUAL is not set
+# CONFIG_SPARSEMEM_MANUAL is not set
+CONFIG_FLATMEM=y
+CONFIG_FLAT_NODE_MEM_MAP=y
+CONFIG_SPARSEMEM_STATIC=y
+# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
+CONFIG_SPLIT_PTLOCK_CPUS=4
+# CONFIG_RESOURCES_64BIT is not set
+CONFIG_ZONE_DMA_FLAG=0
+CONFIG_NR_QUICK=2
+
+#
+# Cache configuration
+#
+# CONFIG_SH_DIRECT_MAPPED is not set
+CONFIG_CACHE_WRITEBACK=y
+# CONFIG_CACHE_WRITETHROUGH is not set
+# CONFIG_CACHE_OFF is not set
+
+#
+# Processor features
+#
+CONFIG_CPU_LITTLE_ENDIAN=y
+# CONFIG_CPU_BIG_ENDIAN is not set
+# CONFIG_SH_FPU_EMU is not set
+# CONFIG_SH_DSP is not set
+# CONFIG_SH_ADC is not set
+CONFIG_CPU_HAS_INTEVT=y
+CONFIG_CPU_HAS_SR_RB=y
+CONFIG_CPU_HAS_DSP=y
+
+#
+# Board support
+#
+CONFIG_SOLUTION_ENGINE=y
+CONFIG_SH_7721_SOLUTION_ENGINE=y
+
+#
+# Timer and clock configuration
+#
+CONFIG_SH_TMU=y
+CONFIG_SH_TIMER_IRQ=16
+CONFIG_SH_PCLK_FREQ=33333333
+# CONFIG_TICK_ONESHOT is not set
+# CONFIG_NO_HZ is not set
+# CONFIG_HIGH_RES_TIMERS is not set
+CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
+
+#
+# CPU Frequency scaling
+#
+# CONFIG_CPU_FREQ is not set
+
+#
+# DMA support
+#
+# CONFIG_SH_DMA is not set
+
+#
+# Companion Chips
+#
+
+#
+# Additional SuperH Device Drivers
+#
+CONFIG_HEARTBEAT=y
+# CONFIG_PUSH_SWITCH is not set
+
+#
+# Kernel features
+#
+# CONFIG_HZ_100 is not set
+CONFIG_HZ_250=y
+# CONFIG_HZ_300 is not set
+# CONFIG_HZ_1000 is not set
+CONFIG_HZ=250
+# CONFIG_SCHED_HRTICK is not set
+# CONFIG_KEXEC is not set
+# CONFIG_CRASH_DUMP is not set
+# CONFIG_PREEMPT_NONE is not set
+CONFIG_PREEMPT_VOLUNTARY=y
+# CONFIG_PREEMPT is not set
+CONFIG_GUSA=y
+# CONFIG_GUSA_RB is not set
+
+#
+# Boot options
+#
+CONFIG_ZERO_PAGE_OFFSET=0x00001000
+CONFIG_BOOT_LINK_OFFSET=0x00800000
+CONFIG_CMDLINE_BOOL=y
+CONFIG_CMDLINE="console=ttySC0,115200 root=/dev/sda2"
+
+#
+# Bus options
+#
+CONFIG_CF_ENABLER=y
+# CONFIG_CF_AREA5 is not set
+CONFIG_CF_AREA6=y
+CONFIG_CF_BASE_ADDR=0xb8000000
+# CONFIG_ARCH_SUPPORTS_MSI is not set
+# CONFIG_PCCARD is not set
+
+#
+# Executable file formats
+#
+CONFIG_BINFMT_ELF=y
+# CONFIG_BINFMT_MISC is not set
+
+#
+# Networking
+#
+CONFIG_NET=y
+
+#
+# Networking options
+#
+CONFIG_PACKET=y
+CONFIG_PACKET_MMAP=y
+CONFIG_UNIX=y
+CONFIG_XFRM=y
+# CONFIG_XFRM_USER is not set
+# CONFIG_XFRM_SUB_POLICY is not set
+# CONFIG_XFRM_MIGRATE is not set
+# CONFIG_XFRM_STATISTICS is not set
+CONFIG_NET_KEY=y
+# CONFIG_NET_KEY_MIGRATE is not set
+CONFIG_INET=y
+CONFIG_IP_MULTICAST=y
+CONFIG_IP_ADVANCED_ROUTER=y
+CONFIG_ASK_IP_FIB_HASH=y
+# CONFIG_IP_FIB_TRIE is not set
+CONFIG_IP_FIB_HASH=y
+CONFIG_IP_MULTIPLE_TABLES=y
+CONFIG_IP_ROUTE_MULTIPATH=y
+CONFIG_IP_ROUTE_VERBOSE=y
+CONFIG_IP_PNP=y
+CONFIG_IP_PNP_DHCP=y
+# CONFIG_IP_PNP_BOOTP is not set
+# CONFIG_IP_PNP_RARP is not set
+# CONFIG_NET_IPIP is not set
+# CONFIG_NET_IPGRE is not set
+CONFIG_IP_MROUTE=y
+CONFIG_IP_PIMSM_V1=y
+CONFIG_IP_PIMSM_V2=y
+# CONFIG_ARPD is not set
+CONFIG_SYN_COOKIES=y
+CONFIG_INET_AH=y
+CONFIG_INET_ESP=y
+CONFIG_INET_IPCOMP=y
+CONFIG_INET_XFRM_TUNNEL=y
+CONFIG_INET_TUNNEL=y
+CONFIG_INET_XFRM_MODE_TRANSPORT=y
+CONFIG_INET_XFRM_MODE_TUNNEL=y
+CONFIG_INET_XFRM_MODE_BEET=y
+# CONFIG_INET_LRO is not set
+# CONFIG_INET_DIAG is not set
+# CONFIG_TCP_CONG_ADVANCED is not set
+CONFIG_TCP_CONG_CUBIC=y
+CONFIG_DEFAULT_TCP_CONG="cubic"
+# CONFIG_TCP_MD5SIG is not set
+# CONFIG_IPV6 is not set
+# CONFIG_INET6_XFRM_TUNNEL is not set
+# CONFIG_INET6_TUNNEL is not set
+# CONFIG_NETWORK_SECMARK is not set
+# CONFIG_NETFILTER is not set
+# CONFIG_IP_DCCP is not set
+# CONFIG_IP_SCTP is not set
+# CONFIG_TIPC is not set
+# CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
+# CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
+# CONFIG_LLC2 is not set
+# CONFIG_IPX is not set
+# CONFIG_ATALK is not set
+# CONFIG_X25 is not set
+# CONFIG_LAPB is not set
+# CONFIG_ECONET is not set
+# CONFIG_WAN_ROUTER is not set
+CONFIG_NET_SCHED=y
+
+#
+# Queueing/Scheduling
+#
+CONFIG_NET_SCH_CBQ=y
+CONFIG_NET_SCH_HTB=y
+CONFIG_NET_SCH_HFSC=y
+CONFIG_NET_SCH_PRIO=y
+# CONFIG_NET_SCH_RR is not set
+CONFIG_NET_SCH_RED=y
+CONFIG_NET_SCH_SFQ=y
+CONFIG_NET_SCH_TEQL=y
+CONFIG_NET_SCH_TBF=y
+CONFIG_NET_SCH_GRED=y
+CONFIG_NET_SCH_DSMARK=y
+CONFIG_NET_SCH_NETEM=y
+
+#
+# Classification
+#
+CONFIG_NET_CLS=y
+# CONFIG_NET_CLS_BASIC is not set
+CONFIG_NET_CLS_TCINDEX=y
+CONFIG_NET_CLS_ROUTE4=y
+CONFIG_NET_CLS_ROUTE=y
+CONFIG_NET_CLS_FW=y
+# CONFIG_NET_CLS_U32 is not set
+# CONFIG_NET_CLS_RSVP is not set
+# CONFIG_NET_CLS_RSVP6 is not set
+# CONFIG_NET_CLS_FLOW is not set
+# CONFIG_NET_EMATCH is not set
+# CONFIG_NET_CLS_ACT is not set
+CONFIG_NET_CLS_IND=y
+CONFIG_NET_SCH_FIFO=y
+
+#
+# Network testing
+#
+# CONFIG_NET_PKTGEN is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_CAN is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
+# CONFIG_AF_RXRPC is not set
+CONFIG_FIB_RULES=y
+
+#
+# Wireless
+#
+# CONFIG_CFG80211 is not set
+# CONFIG_WIRELESS_EXT is not set
+# CONFIG_MAC80211 is not set
+# CONFIG_IEEE80211 is not set
+# CONFIG_RFKILL is not set
+# CONFIG_NET_9P is not set
+
+#
+# Device Drivers
+#
+
+#
+# Generic Driver Options
+#
+CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
+CONFIG_STANDALONE=y
+CONFIG_PREVENT_FIRMWARE_BUILD=y
+CONFIG_FW_LOADER=y
+# CONFIG_DEBUG_DRIVER is not set
+# CONFIG_DEBUG_DEVRES is not set
+# CONFIG_SYS_HYPERVISOR is not set
+# CONFIG_CONNECTOR is not set
+CONFIG_MTD=y
+# CONFIG_MTD_DEBUG is not set
+CONFIG_MTD_CONCAT=y
+CONFIG_MTD_PARTITIONS=y
+# CONFIG_MTD_REDBOOT_PARTS is not set
+# CONFIG_MTD_CMDLINE_PARTS is not set
+
+#
+# User Modules And Translation Layers
+#
+CONFIG_MTD_CHAR=y
+CONFIG_MTD_BLKDEVS=y
+CONFIG_MTD_BLOCK=y
+# CONFIG_FTL is not set
+# CONFIG_NFTL is not set
+# CONFIG_INFTL is not set
+# CONFIG_RFD_FTL is not set
+# CONFIG_SSFDC is not set
+# CONFIG_MTD_OOPS is not set
+
+#
+# RAM/ROM/Flash chip drivers
+#
+CONFIG_MTD_CFI=y
+# CONFIG_MTD_JEDECPROBE is not set
+CONFIG_MTD_GEN_PROBE=y
+# CONFIG_MTD_CFI_ADV_OPTIONS is not set
+CONFIG_MTD_MAP_BANK_WIDTH_1=y
+CONFIG_MTD_MAP_BANK_WIDTH_2=y
+CONFIG_MTD_MAP_BANK_WIDTH_4=y
+# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
+CONFIG_MTD_CFI_I1=y
+CONFIG_MTD_CFI_I2=y
+# CONFIG_MTD_CFI_I4 is not set
+# CONFIG_MTD_CFI_I8 is not set
+# CONFIG_MTD_CFI_INTELEXT is not set
+CONFIG_MTD_CFI_AMDSTD=y
+# CONFIG_MTD_CFI_STAA is not set
+CONFIG_MTD_CFI_UTIL=y
+# CONFIG_MTD_RAM is not set
+# CONFIG_MTD_ROM is not set
+# CONFIG_MTD_ABSENT is not set
+
+#
+# Mapping drivers for chip access
+#
+# CONFIG_MTD_COMPLEX_MAPPINGS is not set
+# CONFIG_MTD_PHYSMAP is not set
+# CONFIG_MTD_PLATRAM is not set
+
+#
+# Self-contained MTD device drivers
+#
+# CONFIG_MTD_SLRAM is not set
+# CONFIG_MTD_PHRAM is not set
+# CONFIG_MTD_MTDRAM is not set
+# CONFIG_MTD_BLOCK2MTD is not set
+
+#
+# Disk-On-Chip Device Drivers
+#
+# CONFIG_MTD_DOC2000 is not set
+# CONFIG_MTD_DOC2001 is not set
+# CONFIG_MTD_DOC2001PLUS is not set
+# CONFIG_MTD_NAND is not set
+# CONFIG_MTD_ONENAND is not set
+
+#
+# UBI - Unsorted block images
+#
+# CONFIG_MTD_UBI is not set
+# CONFIG_PARPORT is not set
+CONFIG_BLK_DEV=y
+# CONFIG_BLK_DEV_COW_COMMON is not set
+# CONFIG_BLK_DEV_LOOP is not set
+# CONFIG_BLK_DEV_NBD is not set
+# CONFIG_BLK_DEV_UB is not set
+# CONFIG_BLK_DEV_RAM is not set
+# CONFIG_CDROM_PKTCDVD is not set
+# CONFIG_ATA_OVER_ETH is not set
+CONFIG_MISC_DEVICES=y
+# CONFIG_EEPROM_93CX6 is not set
+# CONFIG_ENCLOSURE_SERVICES is not set
+CONFIG_HAVE_IDE=y
+# CONFIG_IDE is not set
+
+#
+# SCSI device support
+#
+# CONFIG_RAID_ATTRS is not set
+CONFIG_SCSI=y
+CONFIG_SCSI_DMA=y
+# CONFIG_SCSI_TGT is not set
+# CONFIG_SCSI_NETLINK is not set
+CONFIG_SCSI_PROC_FS=y
+
+#
+# SCSI support type (disk, tape, CD-ROM)
+#
+CONFIG_BLK_DEV_SD=y
+# CONFIG_CHR_DEV_ST is not set
+# CONFIG_CHR_DEV_OSST is not set
+# CONFIG_BLK_DEV_SR is not set
+# CONFIG_CHR_DEV_SG is not set
+# CONFIG_CHR_DEV_SCH is not set
+
+#
+# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
+#
+CONFIG_SCSI_MULTI_LUN=y
+# CONFIG_SCSI_CONSTANTS is not set
+# CONFIG_SCSI_LOGGING is not set
+# CONFIG_SCSI_SCAN_ASYNC is not set
+CONFIG_SCSI_WAIT_SCAN=m
+
+#
+# SCSI Transports
+#
+# CONFIG_SCSI_SPI_ATTRS is not set
+# CONFIG_SCSI_FC_ATTRS is not set
+# CONFIG_SCSI_ISCSI_ATTRS is not set
+# CONFIG_SCSI_SAS_LIBSAS is not set
+# CONFIG_SCSI_SRP_ATTRS is not set
+# CONFIG_SCSI_LOWLEVEL is not set
+CONFIG_ATA=y
+# CONFIG_ATA_NONSTANDARD is not set
+# CONFIG_SATA_MV is not set
+CONFIG_PATA_PLATFORM=y
+# CONFIG_MD is not set
+CONFIG_NETDEVICES=y
+# CONFIG_NETDEVICES_MULTIQUEUE is not set
+# CONFIG_DUMMY is not set
+# CONFIG_BONDING is not set
+# CONFIG_MACVLAN is not set
+# CONFIG_EQUALIZER is not set
+# CONFIG_TUN is not set
+# CONFIG_VETH is not set
+# CONFIG_NET_ETHERNET is not set
+CONFIG_NETDEV_1000=y
+# CONFIG_E1000E_ENABLED is not set
+CONFIG_NETDEV_10000=y
+
+#
+# Wireless LAN
+#
+# CONFIG_WLAN_PRE80211 is not set
+# CONFIG_WLAN_80211 is not set
+
+#
+# USB Network Adapters
+#
+# CONFIG_USB_CATC is not set
+# CONFIG_USB_KAWETH is not set
+# CONFIG_USB_PEGASUS is not set
+# CONFIG_USB_RTL8150 is not set
+# CONFIG_USB_USBNET is not set
+# CONFIG_WAN is not set
+# CONFIG_PPP is not set
+# CONFIG_SLIP is not set
+# CONFIG_NETCONSOLE is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_ISDN is not set
+# CONFIG_PHONE is not set
+
+#
+# Input device support
+#
+CONFIG_INPUT=y
+# CONFIG_INPUT_FF_MEMLESS is not set
+# CONFIG_INPUT_POLLDEV is not set
+
+#
+# Userland interfaces
+#
+CONFIG_INPUT_MOUSEDEV=y
+CONFIG_INPUT_MOUSEDEV_PSAUX=y
+CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
+CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
+# CONFIG_INPUT_JOYDEV is not set
+CONFIG_INPUT_EVDEV=y
+# CONFIG_INPUT_EVBUG is not set
+
+#
+# Input Device Drivers
+#
+CONFIG_INPUT_KEYBOARD=y
+# CONFIG_KEYBOARD_ATKBD is not set
+# CONFIG_KEYBOARD_SUNKBD is not set
+# CONFIG_KEYBOARD_LKKBD is not set
+# CONFIG_KEYBOARD_XTKBD is not set
+# CONFIG_KEYBOARD_NEWTON is not set
+# CONFIG_KEYBOARD_STOWAWAY is not set
+# CONFIG_KEYBOARD_SH_KEYSC is not set
+CONFIG_INPUT_MOUSE=y
+# CONFIG_MOUSE_PS2 is not set
+# CONFIG_MOUSE_SERIAL is not set
+# CONFIG_MOUSE_APPLETOUCH is not set
+# CONFIG_MOUSE_VSXXXAA is not set
+# CONFIG_INPUT_JOYSTICK is not set
+# CONFIG_INPUT_TABLET is not set
+# CONFIG_INPUT_TOUCHSCREEN is not set
+# CONFIG_INPUT_MISC is not set
+
+#
+# Hardware I/O ports
+#
+# CONFIG_SERIO is not set
+# CONFIG_GAMEPORT is not set
+
+#
+# Character devices
+#
+# CONFIG_VT is not set
+# CONFIG_SERIAL_NONSTANDARD is not set
+
+#
+# Serial drivers
+#
+# CONFIG_SERIAL_8250 is not set
+
+#
+# Non-8250 serial port support
+#
+CONFIG_SERIAL_SH_SCI=y
+CONFIG_SERIAL_SH_SCI_NR_UARTS=2
+CONFIG_SERIAL_SH_SCI_CONSOLE=y
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+CONFIG_UNIX98_PTYS=y
+# CONFIG_LEGACY_PTYS is not set
+# CONFIG_IPMI_HANDLER is not set
+# CONFIG_HW_RANDOM is not set
+# CONFIG_R3964 is not set
+# CONFIG_RAW_DRIVER is not set
+# CONFIG_TCG_TPM is not set
+# CONFIG_I2C is not set
+
+#
+# SPI support
+#
+# CONFIG_SPI is not set
+# CONFIG_SPI_MASTER is not set
+# CONFIG_W1 is not set
+# CONFIG_POWER_SUPPLY is not set
+# CONFIG_HWMON is not set
+CONFIG_THERMAL=y
+# CONFIG_WATCHDOG is not set
+
+#
+# Sonics Silicon Backplane
+#
+CONFIG_SSB_POSSIBLE=y
+# CONFIG_SSB is not set
+
+#
+# Multifunction device drivers
+#
+# CONFIG_MFD_SM501 is not set
+
+#
+# Multimedia devices
+#
+# CONFIG_VIDEO_DEV is not set
+# CONFIG_DVB_CORE is not set
+# CONFIG_DAB is not set
+
+#
+# Graphics support
+#
+# CONFIG_VGASTATE is not set
+# CONFIG_VIDEO_OUTPUT_CONTROL is not set
+# CONFIG_FB is not set
+# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
+
+#
+# Display device support
+#
+# CONFIG_DISPLAY_SUPPORT is not set
+
+#
+# Sound
+#
+# CONFIG_SOUND is not set
+CONFIG_HID_SUPPORT=y
+CONFIG_HID=y
+# CONFIG_HID_DEBUG is not set
+# CONFIG_HIDRAW is not set
+
+#
+# USB Input Devices
+#
+CONFIG_USB_HID=y
+# CONFIG_USB_HIDINPUT_POWERBOOK is not set
+# CONFIG_HID_FF is not set
+# CONFIG_USB_HIDDEV is not set
+CONFIG_USB_SUPPORT=y
+CONFIG_USB_ARCH_HAS_HCD=y
+CONFIG_USB_ARCH_HAS_OHCI=y
+# CONFIG_USB_ARCH_HAS_EHCI is not set
+CONFIG_USB=y
+# CONFIG_USB_DEBUG is not set
+# CONFIG_USB_ANNOUNCE_NEW_DEVICES is not set
+
+#
+# Miscellaneous USB options
+#
+# CONFIG_USB_DEVICEFS is not set
+CONFIG_USB_DEVICE_CLASS=y
+# CONFIG_USB_DYNAMIC_MINORS is not set
+# CONFIG_USB_OTG is not set
+
+#
+# USB Host Controller Drivers
+#
+# CONFIG_USB_ISP116X_HCD is not set
+CONFIG_USB_OHCI_HCD=y
+# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set
+# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set
+CONFIG_USB_OHCI_LITTLE_ENDIAN=y
+# CONFIG_USB_SL811_HCD is not set
+# CONFIG_USB_R8A66597_HCD is not set
+
+#
+# USB Device Class drivers
+#
+# CONFIG_USB_ACM is not set
+# CONFIG_USB_PRINTER is not set
+
+#
+# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
+#
+
+#
+# may also be needed; see USB_STORAGE Help for more information
+#
+CONFIG_USB_STORAGE=y
+# CONFIG_USB_STORAGE_DEBUG is not set
+# CONFIG_USB_STORAGE_DATAFAB is not set
+# CONFIG_USB_STORAGE_FREECOM is not set
+# CONFIG_USB_STORAGE_ISD200 is not set
+# CONFIG_USB_STORAGE_DPCM is not set
+# CONFIG_USB_STORAGE_USBAT is not set
+# CONFIG_USB_STORAGE_SDDR09 is not set
+# CONFIG_USB_STORAGE_SDDR55 is not set
+# CONFIG_USB_STORAGE_JUMPSHOT is not set
+# CONFIG_USB_STORAGE_ALAUDA is not set
+# CONFIG_USB_STORAGE_ONETOUCH is not set
+# CONFIG_USB_STORAGE_KARMA is not set
+# CONFIG_USB_LIBUSUAL is not set
+
+#
+# USB Imaging devices
+#
+# CONFIG_USB_MDC800 is not set
+# CONFIG_USB_MICROTEK is not set
+CONFIG_USB_MON=y
+
+#
+# USB port drivers
+#
+# CONFIG_USB_SERIAL is not set
+
+#
+# USB Miscellaneous drivers
+#
+# CONFIG_USB_EMI62 is not set
+# CONFIG_USB_EMI26 is not set
+# CONFIG_USB_ADUTUX is not set
+# CONFIG_USB_AUERSWALD is not set
+# CONFIG_USB_RIO500 is not set
+# CONFIG_USB_LEGOTOWER is not set
+# CONFIG_USB_LCD is not set
+# CONFIG_USB_BERRY_CHARGE is not set
+# CONFIG_USB_LED is not set
+# CONFIG_USB_CYPRESS_CY7C63 is not set
+# CONFIG_USB_CYTHERM is not set
+# CONFIG_USB_PHIDGET is not set
+# CONFIG_USB_IDMOUSE is not set
+# CONFIG_USB_FTDI_ELAN is not set
+# CONFIG_USB_APPLEDISPLAY is not set
+# CONFIG_USB_LD is not set
+# CONFIG_USB_TRANCEVIBRATOR is not set
+# CONFIG_USB_IOWARRIOR is not set
+# CONFIG_USB_GADGET is not set
+# CONFIG_MMC is not set
+# CONFIG_MEMSTICK is not set
+CONFIG_NEW_LEDS=y
+CONFIG_LEDS_CLASS=y
+
+#
+# LED drivers
+#
+
+#
+# LED Triggers
+#
+CONFIG_LEDS_TRIGGERS=y
+# CONFIG_LEDS_TRIGGER_TIMER is not set
+# CONFIG_LEDS_TRIGGER_HEARTBEAT is not set
+# CONFIG_RTC_CLASS is not set
+
+#
+# Userspace I/O
+#
+# CONFIG_UIO is not set
+
+#
+# File systems
+#
+CONFIG_EXT2_FS=y
+CONFIG_EXT2_FS_XATTR=y
+CONFIG_EXT2_FS_POSIX_ACL=y
+CONFIG_EXT2_FS_SECURITY=y
+# CONFIG_EXT2_FS_XIP is not set
+CONFIG_EXT3_FS=y
+CONFIG_EXT3_FS_XATTR=y
+# CONFIG_EXT3_FS_POSIX_ACL is not set
+# CONFIG_EXT3_FS_SECURITY is not set
+# CONFIG_EXT4DEV_FS is not set
+CONFIG_JBD=y
+CONFIG_FS_MBCACHE=y
+# CONFIG_REISERFS_FS is not set
+# CONFIG_JFS_FS is not set
+CONFIG_FS_POSIX_ACL=y
+# CONFIG_XFS_FS is not set
+# CONFIG_GFS2_FS is not set
+# CONFIG_OCFS2_FS is not set
+# CONFIG_DNOTIFY is not set
+# CONFIG_INOTIFY is not set
+# CONFIG_QUOTA is not set
+# CONFIG_AUTOFS_FS is not set
+# CONFIG_AUTOFS4_FS is not set
+# CONFIG_FUSE_FS is not set
+
+#
+# CD-ROM/DVD Filesystems
+#
+# CONFIG_ISO9660_FS is not set
+# CONFIG_UDF_FS is not set
+
+#
+# DOS/FAT/NT Filesystems
+#
+CONFIG_FAT_FS=y
+CONFIG_MSDOS_FS=y
+CONFIG_VFAT_FS=y
+CONFIG_FAT_DEFAULT_CODEPAGE=437
+CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
+# CONFIG_NTFS_FS is not set
+
+#
+# Pseudo filesystems
+#
+CONFIG_PROC_FS=y
+# CONFIG_PROC_KCORE is not set
+CONFIG_PROC_SYSCTL=y
+CONFIG_SYSFS=y
+CONFIG_TMPFS=y
+# CONFIG_TMPFS_POSIX_ACL is not set
+# CONFIG_HUGETLBFS is not set
+# CONFIG_HUGETLB_PAGE is not set
+# CONFIG_CONFIGFS_FS is not set
+
+#
+# Miscellaneous filesystems
+#
+# CONFIG_ADFS_FS is not set
+# CONFIG_AFFS_FS is not set
+# CONFIG_HFS_FS is not set
+# CONFIG_HFSPLUS_FS is not set
+# CONFIG_BEFS_FS is not set
+# CONFIG_BFS_FS is not set
+# CONFIG_EFS_FS is not set
+CONFIG_JFFS2_FS=y
+CONFIG_JFFS2_FS_DEBUG=0
+CONFIG_JFFS2_FS_WRITEBUFFER=y
+# CONFIG_JFFS2_FS_WBUF_VERIFY is not set
+# CONFIG_JFFS2_SUMMARY is not set
+# CONFIG_JFFS2_FS_XATTR is not set
+# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
+CONFIG_JFFS2_ZLIB=y
+# CONFIG_JFFS2_LZO is not set
+CONFIG_JFFS2_RTIME=y
+# CONFIG_JFFS2_RUBIN is not set
+CONFIG_CRAMFS=y
+# CONFIG_VXFS_FS is not set
+# CONFIG_MINIX_FS is not set
+# CONFIG_HPFS_FS is not set
+# CONFIG_QNX4FS_FS is not set
+# CONFIG_ROMFS_FS is not set
+# CONFIG_SYSV_FS is not set
+# CONFIG_UFS_FS is not set
+# CONFIG_NETWORK_FILESYSTEMS is not set
+
+#
+# Partition Types
+#
+# CONFIG_PARTITION_ADVANCED is not set
+CONFIG_MSDOS_PARTITION=y
+CONFIG_NLS=y
+CONFIG_NLS_DEFAULT="iso8859-1"
+CONFIG_NLS_CODEPAGE_437=y
+# CONFIG_NLS_CODEPAGE_737 is not set
+# CONFIG_NLS_CODEPAGE_775 is not set
+# CONFIG_NLS_CODEPAGE_850 is not set
+# CONFIG_NLS_CODEPAGE_852 is not set
+# CONFIG_NLS_CODEPAGE_855 is not set
+# CONFIG_NLS_CODEPAGE_857 is not set
+# CONFIG_NLS_CODEPAGE_860 is not set
+# CONFIG_NLS_CODEPAGE_861 is not set
+# CONFIG_NLS_CODEPAGE_862 is not set
+# CONFIG_NLS_CODEPAGE_863 is not set
+# CONFIG_NLS_CODEPAGE_864 is not set
+# CONFIG_NLS_CODEPAGE_865 is not set
+# CONFIG_NLS_CODEPAGE_866 is not set
+# CONFIG_NLS_CODEPAGE_869 is not set
+# CONFIG_NLS_CODEPAGE_936 is not set
+# CONFIG_NLS_CODEPAGE_950 is not set
+CONFIG_NLS_CODEPAGE_932=y
+# CONFIG_NLS_CODEPAGE_949 is not set
+# CONFIG_NLS_CODEPAGE_874 is not set
+# CONFIG_NLS_ISO8859_8 is not set
+# CONFIG_NLS_CODEPAGE_1250 is not set
+# CONFIG_NLS_CODEPAGE_1251 is not set
+# CONFIG_NLS_ASCII is not set
+CONFIG_NLS_ISO8859_1=y
+# CONFIG_NLS_ISO8859_2 is not set
+# CONFIG_NLS_ISO8859_3 is not set
+# CONFIG_NLS_ISO8859_4 is not set
+# CONFIG_NLS_ISO8859_5 is not set
+# CONFIG_NLS_ISO8859_6 is not set
+# CONFIG_NLS_ISO8859_7 is not set
+# CONFIG_NLS_ISO8859_9 is not set
+# CONFIG_NLS_ISO8859_13 is not set
+# CONFIG_NLS_ISO8859_14 is not set
+# CONFIG_NLS_ISO8859_15 is not set
+# CONFIG_NLS_KOI8_R is not set
+# CONFIG_NLS_KOI8_U is not set
+# CONFIG_NLS_UTF8 is not set
+# CONFIG_DLM is not set
+
+#
+# Kernel hacking
+#
+CONFIG_TRACE_IRQFLAGS_SUPPORT=y
+# CONFIG_PRINTK_TIME is not set
+CONFIG_ENABLE_WARN_DEPRECATED=y
+CONFIG_ENABLE_MUST_CHECK=y
+# CONFIG_MAGIC_SYSRQ is not set
+# CONFIG_UNUSED_SYMBOLS is not set
+# CONFIG_DEBUG_FS is not set
+# CONFIG_HEADERS_CHECK is not set
+CONFIG_DEBUG_KERNEL=y
+# CONFIG_DEBUG_SHIRQ is not set
+# CONFIG_DETECT_SOFTLOCKUP is not set
+CONFIG_SCHED_DEBUG=y
+# CONFIG_SCHEDSTATS is not set
+# CONFIG_TIMER_STATS is not set
+# CONFIG_DEBUG_SLAB is not set
+# CONFIG_DEBUG_RT_MUTEXES is not set
+# CONFIG_RT_MUTEX_TESTER is not set
+# CONFIG_DEBUG_SPINLOCK is not set
+# CONFIG_DEBUG_MUTEXES is not set
+# CONFIG_DEBUG_LOCK_ALLOC is not set
+# CONFIG_PROVE_LOCKING is not set
+# CONFIG_LOCK_STAT is not set
+# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
+# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
+# CONFIG_DEBUG_KOBJECT is not set
+CONFIG_DEBUG_INFO=y
+# CONFIG_DEBUG_VM is not set
+# CONFIG_DEBUG_LIST is not set
+# CONFIG_DEBUG_SG is not set
+CONFIG_FRAME_POINTER=y
+# CONFIG_BOOT_PRINTK_DELAY is not set
+# CONFIG_RCU_TORTURE_TEST is not set
+# CONFIG_BACKTRACE_SELF_TEST is not set
+# CONFIG_FAULT_INJECTION is not set
+# CONFIG_SAMPLES is not set
+# CONFIG_SH_STANDARD_BIOS is not set
+# CONFIG_EARLY_SCIF_CONSOLE is not set
+# CONFIG_DEBUG_BOOTMEM is not set
+# CONFIG_DEBUG_STACKOVERFLOW is not set
+# CONFIG_DEBUG_STACK_USAGE is not set
+# CONFIG_4KSTACKS is not set
+# CONFIG_IRQSTACKS is not set
+# CONFIG_SH_KGDB is not set
+
+#
+# Security options
+#
+# CONFIG_KEYS is not set
+# CONFIG_SECURITY is not set
+# CONFIG_SECURITY_FILE_CAPABILITIES is not set
+CONFIG_CRYPTO=y
+CONFIG_CRYPTO_ALGAPI=y
+CONFIG_CRYPTO_AEAD=y
+CONFIG_CRYPTO_BLKCIPHER=y
+# CONFIG_CRYPTO_SEQIV is not set
+CONFIG_CRYPTO_HASH=y
+CONFIG_CRYPTO_MANAGER=y
+CONFIG_CRYPTO_HMAC=y
+# CONFIG_CRYPTO_XCBC is not set
+# CONFIG_CRYPTO_NULL is not set
+# CONFIG_CRYPTO_MD4 is not set
+CONFIG_CRYPTO_MD5=y
+CONFIG_CRYPTO_SHA1=y
+# CONFIG_CRYPTO_SHA256 is not set
+# CONFIG_CRYPTO_SHA512 is not set
+# CONFIG_CRYPTO_WP512 is not set
+# CONFIG_CRYPTO_TGR192 is not set
+# CONFIG_CRYPTO_GF128MUL is not set
+# CONFIG_CRYPTO_ECB is not set
+CONFIG_CRYPTO_CBC=y
+# CONFIG_CRYPTO_PCBC is not set
+# CONFIG_CRYPTO_LRW is not set
+# CONFIG_CRYPTO_XTS is not set
+# CONFIG_CRYPTO_CTR is not set
+# CONFIG_CRYPTO_GCM is not set
+# CONFIG_CRYPTO_CCM is not set
+# CONFIG_CRYPTO_CRYPTD is not set
+CONFIG_CRYPTO_DES=y
+# CONFIG_CRYPTO_FCRYPT is not set
+# CONFIG_CRYPTO_BLOWFISH is not set
+# CONFIG_CRYPTO_TWOFISH is not set
+# CONFIG_CRYPTO_SERPENT is not set
+# CONFIG_CRYPTO_AES is not set
+# CONFIG_CRYPTO_CAST5 is not set
+# CONFIG_CRYPTO_CAST6 is not set
+# CONFIG_CRYPTO_TEA is not set
+# CONFIG_CRYPTO_ARC4 is not set
+# CONFIG_CRYPTO_KHAZAD is not set
+# CONFIG_CRYPTO_ANUBIS is not set
+# CONFIG_CRYPTO_SEED is not set
+# CONFIG_CRYPTO_SALSA20 is not set
+CONFIG_CRYPTO_DEFLATE=y
+# CONFIG_CRYPTO_MICHAEL_MIC is not set
+# CONFIG_CRYPTO_CRC32C is not set
+# CONFIG_CRYPTO_CAMELLIA is not set
+# CONFIG_CRYPTO_TEST is not set
+CONFIG_CRYPTO_AUTHENC=y
+# CONFIG_CRYPTO_LZO is not set
+CONFIG_CRYPTO_HW=y
+
+#
+# Library routines
+#
+CONFIG_BITREVERSE=y
+CONFIG_CRC_CCITT=y
+# CONFIG_CRC16 is not set
+# CONFIG_CRC_ITU_T is not set
+CONFIG_CRC32=y
+# CONFIG_CRC7 is not set
+# CONFIG_LIBCRC32C is not set
+CONFIG_ZLIB_INFLATE=y
+CONFIG_ZLIB_DEFLATE=y
+CONFIG_PLIST=y
+CONFIG_HAS_IOMEM=y
+CONFIG_HAS_IOPORT=y
+CONFIG_HAS_DMA=y
index 1c3b99642e1c3df4d2d90b37f26a1482655c27d4..01ff4d05aab0303c38cdad719302db33fd904a59 100644 (file)
@@ -83,6 +83,8 @@ static int __init cf_init_default(void)
 #include <asm/se.h>
 #elif defined(CONFIG_SH_7722_SOLUTION_ENGINE)
 #include <asm/se7722.h>
+#elif defined(CONFIG_SH_7721_SOLUTION_ENGINE)
+#include <asm/se7721.h>
 #endif
 
 /*
@@ -99,7 +101,9 @@ static int __init cf_init_default(void)
  * 0xB0600000 : I/O
  */
 
-#if defined(CONFIG_SH_SOLUTION_ENGINE) || defined(CONFIG_SH_7722_SOLUTION_ENGINE) 
+#if defined(CONFIG_SH_SOLUTION_ENGINE) || \
+    defined(CONFIG_SH_7722_SOLUTION_ENGINE) || \
+    defined(CONFIG_SH_7721_SOLUTION_ENGINE)
 static int __init cf_init_se(void)
 {
        if ((ctrl_inw(MRSHPC_CSR) & 0x000c) != 0)
@@ -112,7 +116,7 @@ static int __init cf_init_se(void)
        }
 
        /*
-        *  PC-Card window open 
+        *  PC-Card window open
         *  flag == COMMON/ATTRIBUTE/IO
         */
        /* common window open */
@@ -122,7 +126,7 @@ static int __init cf_init_se(void)
                ctrl_outw(0x0b00, MRSHPC_MW0CR2);
        else
                /* common mode & bus width 16bit SWAP = 0*/
-               ctrl_outw(0x0300, MRSHPC_MW0CR2); 
+               ctrl_outw(0x0300, MRSHPC_MW0CR2);
 
        /* attribute window open */
        ctrl_outw(0x8a85, MRSHPC_MW1CR1);
@@ -155,10 +159,9 @@ static int __init cf_init_se(void)
 
 int __init cf_init(void)
 {
-       if( mach_is_se() || mach_is_7722se() ){
+       if (mach_is_se() || mach_is_7722se() || mach_is_7721se())
                return cf_init_se();
-       }
-       
+
        return cf_init_default();
 }
 
index b279cdc3a23305856300299c51ffefad487b2cd6..7e2b90cfa7bf88492e08d253fb100bad5f261273 100644 (file)
@@ -8,6 +8,7 @@ common-y        += $(addprefix ../sh2/, ex.o entry.o)
 
 obj-$(CONFIG_SH_FPU)   += fpu.o
 
-obj-$(CONFIG_CPU_SUBTYPE_SH7206) += setup-sh7206.o clock-sh7206.o
-obj-$(CONFIG_CPU_SUBTYPE_SH7203) += setup-sh7203.o clock-sh7203.o
-obj-$(CONFIG_CPU_SUBTYPE_SH7263) += setup-sh7203.o clock-sh7203.o
+obj-$(CONFIG_CPU_SUBTYPE_SH7206)       += setup-sh7206.o clock-sh7206.o
+obj-$(CONFIG_CPU_SUBTYPE_SH7203)       += setup-sh7203.o clock-sh7203.o
+obj-$(CONFIG_CPU_SUBTYPE_SH7263)       += setup-sh7203.o clock-sh7203.o
+obj-$(CONFIG_CPU_SUBTYPE_MXG)          += setup-mxg.o clock-sh7206.o
index 6910e2664468cedb00cc16378483646158671e6d..6e79132f6f3047dc275bd912de3d95710fd2f8d1 100644 (file)
@@ -29,6 +29,9 @@ int __init detect_cpu_and_cache_system(void)
        boot_cpu_data.type                      = CPU_SH7206;
        /* While SH7206 has a DSP.. */
        boot_cpu_data.flags                     |= CPU_HAS_DSP;
+#elif defined(CONFIG_CPU_SUBTYPE_MXG)
+       boot_cpu_data.type                      = CPU_MXG;
+       boot_cpu_data.flags                     |= CPU_HAS_DSP;
 #endif
 
        boot_cpu_data.dcache.ways               = 4;
diff --git a/arch/sh/kernel/cpu/sh2a/setup-mxg.c b/arch/sh/kernel/cpu/sh2a/setup-mxg.c
new file mode 100644 (file)
index 0000000..e611d79
--- /dev/null
@@ -0,0 +1,168 @@
+/*
+ * Renesas MX-G (R8A03022BG) Setup
+ *
+ *  Copyright (C) 2008  Paul Mundt
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ */
+#include <linux/platform_device.h>
+#include <linux/init.h>
+#include <linux/serial.h>
+#include <linux/serial_sci.h>
+
+enum {
+       UNUSED = 0,
+
+       /* interrupt sources */
+       IRQ0, IRQ1, IRQ2, IRQ3, IRQ4, IRQ5, IRQ6, IRQ7,
+       IRQ8, IRQ9, IRQ10, IRQ11, IRQ12, IRQ13, IRQ14, IRQ15,
+
+       PINT0, PINT1, PINT2, PINT3, PINT4, PINT5, PINT6, PINT7,
+
+       SINT8, SINT7, SINT6, SINT5, SINT4, SINT3, SINT2, SINT1,
+
+       SCIF0_BRI, SCIF0_ERI, SCIF0_RXI, SCIF0_TXI,
+       SCIF1_BRI, SCIF1_ERI, SCIF1_RXI, SCIF1_TXI,
+
+       MTU2_TGI0A, MTU2_TGI0B, MTU2_TGI0C, MTU2_TGI0D,
+       MTU2_TCI0V, MTU2_TGI0E, MTU2_TGI0F,
+       MTU2_TGI1A, MTU2_TGI1B, MTU2_TCI1V, MTU2_TCI1U,
+       MTU2_TGI2A, MTU2_TGI2B, MTU2_TCI2V, MTU2_TCI2U,
+       MTU2_TGI3A, MTU2_TGI3B, MTU2_TGI3C, MTU2_TGI3D, MTU2_TCI3V,
+       MTU2_TGI4A, MTU2_TGI4B, MTU2_TGI4C, MTU2_TGI4D, MTU2_TCI4V,
+       MTU2_TGI5U, MTU2_TGI5V, MTU2_TGI5W,
+
+       /* interrupt groups */
+       PINT, SCIF0, SCIF1,
+       MTU2_GROUP1, MTU2_GROUP2, MTU2_GROUP3, MTU2_GROUP4, MTU2_GROUP5
+};
+
+static struct intc_vect vectors[] __initdata = {
+       INTC_IRQ(IRQ0, 64), INTC_IRQ(IRQ1, 65),
+       INTC_IRQ(IRQ2, 66), INTC_IRQ(IRQ3, 67),
+       INTC_IRQ(IRQ4, 68), INTC_IRQ(IRQ5, 69),
+       INTC_IRQ(IRQ6, 70), INTC_IRQ(IRQ7, 71),
+       INTC_IRQ(IRQ8, 72), INTC_IRQ(IRQ9, 73),
+       INTC_IRQ(IRQ10, 74), INTC_IRQ(IRQ11, 75),
+       INTC_IRQ(IRQ12, 76), INTC_IRQ(IRQ13, 77),
+       INTC_IRQ(IRQ14, 78), INTC_IRQ(IRQ15, 79),
+
+       INTC_IRQ(PINT0, 80), INTC_IRQ(PINT1, 81),
+       INTC_IRQ(PINT2, 82), INTC_IRQ(PINT3, 83),
+       INTC_IRQ(PINT4, 84), INTC_IRQ(PINT5, 85),
+       INTC_IRQ(PINT6, 86), INTC_IRQ(PINT7, 87),
+
+       INTC_IRQ(SINT8, 94), INTC_IRQ(SINT7, 95),
+       INTC_IRQ(SINT6, 96), INTC_IRQ(SINT5, 97),
+       INTC_IRQ(SINT4, 98), INTC_IRQ(SINT3, 99),
+       INTC_IRQ(SINT2, 100), INTC_IRQ(SINT1, 101),
+
+       INTC_IRQ(SCIF0_RXI, 220), INTC_IRQ(SCIF0_TXI, 221),
+       INTC_IRQ(SCIF0_BRI, 222), INTC_IRQ(SCIF0_ERI, 223),
+       INTC_IRQ(SCIF1_RXI, 224), INTC_IRQ(SCIF1_TXI, 225),
+       INTC_IRQ(SCIF1_BRI, 226), INTC_IRQ(SCIF1_ERI, 227),
+
+       INTC_IRQ(MTU2_TGI0A, 228), INTC_IRQ(MTU2_TGI0B, 229),
+       INTC_IRQ(MTU2_TGI0C, 230), INTC_IRQ(MTU2_TGI0D, 231),
+       INTC_IRQ(MTU2_TCI0V, 232), INTC_IRQ(MTU2_TGI0E, 233),
+
+       INTC_IRQ(MTU2_TGI0F, 234), INTC_IRQ(MTU2_TGI1A, 235),
+       INTC_IRQ(MTU2_TGI1B, 236), INTC_IRQ(MTU2_TCI1V, 237),
+       INTC_IRQ(MTU2_TCI1U, 238), INTC_IRQ(MTU2_TGI2A, 239),
+
+       INTC_IRQ(MTU2_TGI2B, 240), INTC_IRQ(MTU2_TCI2V, 241),
+       INTC_IRQ(MTU2_TCI2U, 242), INTC_IRQ(MTU2_TGI3A, 243),
+
+       INTC_IRQ(MTU2_TGI3B, 244),
+       INTC_IRQ(MTU2_TGI3C, 245),
+
+       INTC_IRQ(MTU2_TGI3D, 246), INTC_IRQ(MTU2_TCI3V, 247),
+       INTC_IRQ(MTU2_TGI4A, 248), INTC_IRQ(MTU2_TGI4B, 249),
+       INTC_IRQ(MTU2_TGI4C, 250), INTC_IRQ(MTU2_TGI4D, 251),
+
+       INTC_IRQ(MTU2_TCI4V, 252), INTC_IRQ(MTU2_TGI5U, 253),
+       INTC_IRQ(MTU2_TGI5V, 254), INTC_IRQ(MTU2_TGI5W, 255),
+};
+
+static struct intc_group groups[] __initdata = {
+       INTC_GROUP(PINT, PINT0, PINT1, PINT2, PINT3,
+                  PINT4, PINT5, PINT6, PINT7),
+       INTC_GROUP(MTU2_GROUP1, MTU2_TGI0A, MTU2_TGI0B, MTU2_TGI0C, MTU2_TGI0D,
+                  MTU2_TCI0V, MTU2_TGI0E),
+       INTC_GROUP(MTU2_GROUP2, MTU2_TGI0F, MTU2_TGI1A, MTU2_TGI1B,
+                  MTU2_TCI1V, MTU2_TCI1U, MTU2_TGI2A),
+       INTC_GROUP(MTU2_GROUP3, MTU2_TGI2B, MTU2_TCI2V, MTU2_TCI2U,
+                  MTU2_TGI3A),
+       INTC_GROUP(MTU2_GROUP4, MTU2_TGI3D, MTU2_TCI3V, MTU2_TGI4A,
+                  MTU2_TGI4B, MTU2_TGI4C, MTU2_TGI4D),
+       INTC_GROUP(MTU2_GROUP5, MTU2_TCI4V, MTU2_TGI5U, MTU2_TGI5V, MTU2_TGI5W),
+       INTC_GROUP(SCIF0, SCIF0_BRI, SCIF0_ERI, SCIF0_RXI, SCIF0_TXI),
+       INTC_GROUP(SCIF1, SCIF1_BRI, SCIF1_ERI, SCIF1_RXI, SCIF1_TXI),
+};
+
+static struct intc_prio_reg prio_registers[] __initdata = {
+       { 0xfffd9418, 0, 16, 4, /* IPR01 */ { IRQ0, IRQ1, IRQ2, IRQ3 } },
+       { 0xfffd941a, 0, 16, 4, /* IPR02 */ { IRQ4, IRQ5, IRQ6, IRQ7 } },
+       { 0xfffd941c, 0, 16, 4, /* IPR03 */ { IRQ8, IRQ9, IRQ10, IRQ11 } },
+       { 0xfffd941e, 0, 16, 4, /* IPR04 */ { IRQ12, IRQ13, IRQ14, IRQ15 } },
+       { 0xfffd9420, 0, 16, 4, /* IPR05 */ { PINT, 0, 0, 0 } },
+       { 0xfffd9800, 0, 16, 4, /* IPR06 */ { } },
+       { 0xfffd9802, 0, 16, 4, /* IPR07 */ { } },
+       { 0xfffd9804, 0, 16, 4, /* IPR08 */ { } },
+       { 0xfffd9806, 0, 16, 4, /* IPR09 */ { } },
+       { 0xfffd9808, 0, 16, 4, /* IPR10 */ { } },
+       { 0xfffd980a, 0, 16, 4, /* IPR11 */ { } },
+       { 0xfffd980c, 0, 16, 4, /* IPR12 */ { } },
+       { 0xfffd980e, 0, 16, 4, /* IPR13 */ { } },
+       { 0xfffd9810, 0, 16, 4, /* IPR14 */ { 0, 0, 0, SCIF0 } },
+       { 0xfffd9812, 0, 16, 4, /* IPR15 */
+               { SCIF1, MTU2_GROUP1, MTU2_GROUP2, MTU2_GROUP3 } },
+       { 0xfffd9814, 0, 16, 4, /* IPR16 */
+               { MTU2_TGI3B, MTU2_TGI3C, MTU2_GROUP4, MTU2_GROUP5 } },
+};
+
+static struct intc_mask_reg mask_registers[] __initdata = {
+       { 0xfffd9408, 0, 16, /* PINTER */
+         { 0, 0, 0, 0, 0, 0, 0, 0,
+           PINT7, PINT6, PINT5, PINT4, PINT3, PINT2, PINT1, PINT0 } },
+};
+
+static DECLARE_INTC_DESC(intc_desc, "mxg", vectors, groups,
+                        mask_registers, prio_registers, NULL);
+
+static struct plat_sci_port sci_platform_data[] = {
+       {
+               .mapbase        = 0xff804000,
+               .flags          = UPF_BOOT_AUTOCONF,
+               .type           = PORT_SCIF,
+               .irqs           = { 223, 220, 221, 222 },
+       }, {
+               .flags = 0,
+       }
+};
+
+static struct platform_device sci_device = {
+       .name           = "sh-sci",
+       .id             = -1,
+       .dev            = {
+               .platform_data  = sci_platform_data,
+       },
+};
+
+static struct platform_device *mxg_devices[] __initdata = {
+       &sci_device,
+};
+
+static int __init mxg_devices_setup(void)
+{
+       return platform_add_devices(mxg_devices,
+                                   ARRAY_SIZE(mxg_devices));
+}
+__initcall(mxg_devices_setup);
+
+void __init plat_irq_setup(void)
+{
+       register_intc_controller(&intc_desc);
+}
index 9e89984c4f1d3930d8d15bce210347806eeb7a7b..ebceb0dadff58fc70026f646fe507b48f29c6a2d 100644 (file)
@@ -53,7 +53,7 @@ int __init detect_cpu_and_cache_system(void)
        /*
         * Setup some generic flags we can probe on SH-4A parts
         */
-       if (((pvr >> 16) & 0xff) == 0x10) {
+       if (((pvr >> 24) & 0xff) == 0x10) {
                if ((cvr & 0x10000000) == 0)
                        boot_cpu_data.flags |= CPU_HAS_DSP;
 
@@ -126,17 +126,22 @@ int __init detect_cpu_and_cache_system(void)
                                          CPU_HAS_LLSC;
                break;
        case 0x3008:
-               if (prr == 0xa0 || prr == 0xa1) {
-                       boot_cpu_data.type = CPU_SH7722;
-                       boot_cpu_data.icache.ways = 4;
-                       boot_cpu_data.dcache.ways = 4;
-                       boot_cpu_data.flags |= CPU_HAS_LLSC;
-               }
-               else if (prr == 0x70) {
+               boot_cpu_data.icache.ways = 4;
+               boot_cpu_data.dcache.ways = 4;
+               boot_cpu_data.flags |= CPU_HAS_LLSC;
+
+               switch (prr) {
+               case 0x50:
+                       boot_cpu_data.type = CPU_SH7723;
+                       boot_cpu_data.flags |= CPU_HAS_FPU | CPU_HAS_L2_CACHE;
+                       break;
+               case 0x70:
                        boot_cpu_data.type = CPU_SH7366;
-                       boot_cpu_data.icache.ways = 4;
-                       boot_cpu_data.dcache.ways = 4;
-                       boot_cpu_data.flags |= CPU_HAS_LLSC;
+                       break;
+               case 0xa0:
+               case 0xa1:
+                       boot_cpu_data.type = CPU_SH7722;
+                       break;
                }
                break;
        case 0x4000:    /* 1st cut */
@@ -215,6 +220,12 @@ int __init detect_cpu_and_cache_system(void)
         * SH-4A's have an optional PIPT L2.
         */
        if (boot_cpu_data.flags & CPU_HAS_L2_CACHE) {
+               /* Bug if we can't decode the L2 info */
+               BUG_ON(!(cvr & 0xf));
+
+               /* Silicon and specifications have clearly never met.. */
+               cvr ^= 0xf;
+
                /*
                 * Size calculation is much more sensible
                 * than it is for the L1.
index 5d890ac8e793559da9d8baddd552dde2314263f7..a880e7968750a63aa3aba1ae4ea3fcd477d06b82 100644 (file)
@@ -9,6 +9,7 @@ obj-$(CONFIG_CPU_SUBTYPE_SH7780)        += setup-sh7780.o
 obj-$(CONFIG_CPU_SUBTYPE_SH7785)       += setup-sh7785.o
 obj-$(CONFIG_CPU_SUBTYPE_SH7343)       += setup-sh7343.o
 obj-$(CONFIG_CPU_SUBTYPE_SH7722)       += setup-sh7722.o
+obj-$(CONFIG_CPU_SUBTYPE_SH7723)       += setup-sh7723.o
 obj-$(CONFIG_CPU_SUBTYPE_SH7366)       += setup-sh7366.o
 obj-$(CONFIG_CPU_SUBTYPE_SHX3)         += setup-shx3.o
 
@@ -22,6 +23,7 @@ clock-$(CONFIG_CPU_SUBTYPE_SH7780)    := clock-sh7780.o
 clock-$(CONFIG_CPU_SUBTYPE_SH7785)     := clock-sh7785.o
 clock-$(CONFIG_CPU_SUBTYPE_SH7343)     := clock-sh7343.o
 clock-$(CONFIG_CPU_SUBTYPE_SH7722)     := clock-sh7722.o
+clock-$(CONFIG_CPU_SUBTYPE_SH7723)     := clock-sh7722.o
 clock-$(CONFIG_CPU_SUBTYPE_SH7366)     := clock-sh7722.o
 clock-$(CONFIG_CPU_SUBTYPE_SHX3)       := clock-shx3.o
 
index b98b4bc93ec9df41bfd5b61ada70a65b3bd8ba99..069314037049d725f5da27a13d738a04a25d1853 100644 (file)
 
 static struct resource usbf_resources[] = {
        [0] = {
-               .name   = "m66592_udc",
-               .start  = 0xA4480000,
-               .end    = 0xA44800FF,
+               .name   = "USBF",
+               .start  = 0x04480000,
+               .end    = 0x044800FF,
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .name   = "m66592_udc",
                .start  = 65,
                .end    = 65,
                .flags  = IORESOURCE_IRQ,
@@ -40,6 +39,26 @@ static struct platform_device usbf_device = {
        .resource       = usbf_resources,
 };
 
+static struct resource iic_resources[] = {
+       [0] = {
+               .name   = "IIC",
+               .start  = 0x04470000,
+               .end    = 0x04470017,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = 96,
+               .end    = 99,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device iic_device = {
+       .name           = "i2c-sh_mobile",
+       .num_resources  = ARRAY_SIZE(iic_resources),
+       .resource       = iic_resources,
+};
+
 static struct plat_sci_port sci_platform_data[] = {
        {
                .mapbase        = 0xffe00000,
@@ -74,6 +93,7 @@ static struct platform_device sci_device = {
 
 static struct platform_device *sh7722_devices[] __initdata = {
        &usbf_device,
+       &iic_device,
        &sci_device,
 };
 
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7723.c b/arch/sh/kernel/cpu/sh4a/setup-sh7723.c
new file mode 100644 (file)
index 0000000..16925cf
--- /dev/null
@@ -0,0 +1,300 @@
+/*
+ * SH7723 Setup
+ *
+ *  Copyright (C) 2008  Paul Mundt
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ */
+#include <linux/platform_device.h>
+#include <linux/init.h>
+#include <linux/serial.h>
+#include <linux/mm.h>
+#include <linux/serial_sci.h>
+#include <asm/mmzone.h>
+
+static struct plat_sci_port sci_platform_data[] = {
+       {
+               .mapbase        = 0xa4e30000,
+               .flags          = UPF_BOOT_AUTOCONF,
+               .type           = PORT_SCI,
+               .irqs           = { 56, 56, 56, 56 },
+       },{
+               .mapbase        = 0xa4e40000,
+               .flags          = UPF_BOOT_AUTOCONF,
+               .type           = PORT_SCI,
+               .irqs           = { 88, 88, 88, 88 },
+       },{
+               .mapbase        = 0xa4e50000,
+               .flags          = UPF_BOOT_AUTOCONF,
+               .type           = PORT_SCI,
+               .irqs           = { 109, 109, 109, 109 },
+       }, {
+               .flags = 0,
+       }
+};
+
+static struct platform_device sci_device = {
+       .name           = "sh-sci",
+       .id             = -1,
+       .dev            = {
+               .platform_data  = sci_platform_data,
+       },
+};
+
+static struct resource rtc_resources[] = {
+       [0] = {
+               .start  = 0xa465fec0,
+               .end    = 0xa465fec0 + 0x58 - 1,
+               .flags  = IORESOURCE_IO,
+       },
+       [1] = {
+               /* Period IRQ */
+               .start  = 69,
+               .flags  = IORESOURCE_IRQ,
+       },
+       [2] = {
+               /* Carry IRQ */
+               .start  = 70,
+               .flags  = IORESOURCE_IRQ,
+       },
+       [3] = {
+               /* Alarm IRQ */
+               .start  = 68,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device rtc_device = {
+       .name           = "sh-rtc",
+       .id             = -1,
+       .num_resources  = ARRAY_SIZE(rtc_resources),
+       .resource       = rtc_resources,
+};
+
+static struct platform_device *sh7723_devices[] __initdata = {
+       &sci_device,
+       &rtc_device,
+};
+
+static int __init sh7723_devices_setup(void)
+{
+       return platform_add_devices(sh7723_devices,
+                                   ARRAY_SIZE(sh7723_devices));
+}
+__initcall(sh7723_devices_setup);
+
+enum {
+       UNUSED=0,
+
+       /* interrupt sources */
+       IRQ0, IRQ1, IRQ2, IRQ3, IRQ4, IRQ5, IRQ6, IRQ7,
+       HUDI,
+       DMAC1A_DEI0,DMAC1A_DEI1,DMAC1A_DEI2,DMAC1A_DEI3,
+       _2DG_TRI,_2DG_INI,_2DG_CEI,
+       DMAC0A_DEI0,DMAC0A_DEI1,DMAC0A_DEI2,DMAC0A_DEI3,
+       VIO_CEUI,VIO_BEUI,VIO_VEU2HI,VIO_VOUI,
+       SCIFA_SCIFA0,
+       VPU_VPUI,
+       TPU_TPUI,
+       ADC_ADI,
+       USB_USI0,
+       RTC_ATI,RTC_PRI,RTC_CUI,
+       DMAC1B_DEI4,DMAC1B_DEI5,DMAC1B_DADERR,
+       DMAC0B_DEI4,DMAC0B_DEI5,DMAC0B_DADERR,
+       KEYSC_KEYI,
+       SCIF_SCIF0,SCIF_SCIF1,SCIF_SCIF2,
+       MSIOF_MSIOFI0,MSIOF_MSIOFI1,
+       SCIFA_SCIFA1,
+       FLCTL_FLSTEI,FLCTL_FLTENDI,FLCTL_FLTREQ0I,FLCTL_FLTREQ1I,
+       I2C_ALI,I2C_TACKI,I2C_WAITI,I2C_DTEI,
+       SDHI0_SDHII0,SDHI0_SDHII1,SDHI0_SDHII2,
+       CMT_CMTI,
+       TSIF_TSIFI,
+       SIU_SIUI,
+       SCIFA_SCIFA2,
+       TMU0_TUNI0, TMU0_TUNI1, TMU0_TUNI2,
+       IRDA_IRDAI,
+       ATAPI_ATAPII,
+       SDHI1_SDHII0,SDHI1_SDHII1,SDHI1_SDHII2,
+       VEU2H1_VEU2HI,
+       LCDC_LCDCI,
+       TMU1_TUNI0,TMU1_TUNI1,TMU1_TUNI2,
+
+       /* interrupt groups */
+       DMAC1A, DMAC0A, VIO, DMAC0B, FLCTL, I2C, _2DG,
+       SDHI1, RTC, DMAC1B, SDHI0,
+};
+
+static struct intc_vect vectors[] __initdata = {
+       INTC_VECT(IRQ0, 0x600), INTC_VECT(IRQ1, 0x620),
+       INTC_VECT(IRQ2, 0x640), INTC_VECT(IRQ3, 0x660),
+       INTC_VECT(IRQ4, 0x680), INTC_VECT(IRQ5, 0x6a0),
+       INTC_VECT(IRQ6, 0x6c0), INTC_VECT(IRQ7, 0x6e0),
+
+       INTC_VECT(DMAC1A_DEI0,0x700),
+       INTC_VECT(DMAC1A_DEI1,0x720),
+       INTC_VECT(DMAC1A_DEI2,0x740),
+       INTC_VECT(DMAC1A_DEI3,0x760),
+
+       INTC_VECT(_2DG_TRI, 0x780),
+       INTC_VECT(_2DG_INI, 0x7A0),
+       INTC_VECT(_2DG_CEI, 0x7C0),
+
+       INTC_VECT(DMAC0A_DEI0,0x800),
+       INTC_VECT(DMAC0A_DEI1,0x820),
+       INTC_VECT(DMAC0A_DEI2,0x840),
+       INTC_VECT(DMAC0A_DEI3,0x860),
+
+       INTC_VECT(VIO_CEUI,0x880),
+       INTC_VECT(VIO_BEUI,0x8A0),
+       INTC_VECT(VIO_VEU2HI,0x8C0),
+       INTC_VECT(VIO_VOUI,0x8E0),
+
+       INTC_VECT(SCIFA_SCIFA0,0x900),
+       INTC_VECT(VPU_VPUI,0x920),
+       INTC_VECT(TPU_TPUI,0x9A0),
+       INTC_VECT(ADC_ADI,0x9E0),
+       INTC_VECT(USB_USI0,0xA20),
+
+       INTC_VECT(RTC_ATI,0xA80),
+       INTC_VECT(RTC_PRI,0xAA0),
+       INTC_VECT(RTC_CUI,0xAC0),
+
+       INTC_VECT(DMAC1B_DEI4,0xB00),
+       INTC_VECT(DMAC1B_DEI5,0xB20),
+       INTC_VECT(DMAC1B_DADERR,0xB40),
+
+       INTC_VECT(DMAC0B_DEI4,0xB80),
+       INTC_VECT(DMAC0B_DEI5,0xBA0),
+       INTC_VECT(DMAC0B_DADERR,0xBC0),
+
+       INTC_VECT(KEYSC_KEYI,0xBE0),
+       INTC_VECT(SCIF_SCIF0,0xC00),
+       INTC_VECT(SCIF_SCIF1,0xC20),
+       INTC_VECT(SCIF_SCIF2,0xC40),
+       INTC_VECT(MSIOF_MSIOFI0,0xC80),
+       INTC_VECT(MSIOF_MSIOFI1,0xCA0),
+       INTC_VECT(SCIFA_SCIFA1,0xD00),
+
+       INTC_VECT(FLCTL_FLSTEI,0xD80),
+       INTC_VECT(FLCTL_FLTENDI,0xDA0),
+       INTC_VECT(FLCTL_FLTREQ0I,0xDC0),
+       INTC_VECT(FLCTL_FLTREQ1I,0xDE0),
+
+       INTC_VECT(I2C_ALI,0xE00),
+       INTC_VECT(I2C_TACKI,0xE20),
+       INTC_VECT(I2C_WAITI,0xE40),
+       INTC_VECT(I2C_DTEI,0xE60),
+
+       INTC_VECT(SDHI0_SDHII0,0xE80),
+       INTC_VECT(SDHI0_SDHII1,0xEA0),
+       INTC_VECT(SDHI0_SDHII2,0xEC0),
+
+       INTC_VECT(CMT_CMTI,0xF00),
+       INTC_VECT(TSIF_TSIFI,0xF20),
+       INTC_VECT(SIU_SIUI,0xF80),
+       INTC_VECT(SCIFA_SCIFA2,0xFA0),
+
+       INTC_VECT(TMU0_TUNI0,0x400),
+       INTC_VECT(TMU0_TUNI1,0x420),
+       INTC_VECT(TMU0_TUNI2,0x440),
+
+       INTC_VECT(IRDA_IRDAI,0x480),
+       INTC_VECT(ATAPI_ATAPII,0x4A0),
+
+       INTC_VECT(SDHI1_SDHII0,0x4E0),
+       INTC_VECT(SDHI1_SDHII1,0x500),
+       INTC_VECT(SDHI1_SDHII2,0x520),
+
+       INTC_VECT(VEU2H1_VEU2HI,0x560),
+       INTC_VECT(LCDC_LCDCI,0x580),
+
+       INTC_VECT(TMU1_TUNI0,0x920),
+       INTC_VECT(TMU1_TUNI1,0x940),
+       INTC_VECT(TMU1_TUNI2,0x960),
+
+};
+
+static struct intc_group groups[] __initdata = {
+       INTC_GROUP(DMAC1A,DMAC1A_DEI0,DMAC1A_DEI1,DMAC1A_DEI2,DMAC1A_DEI3),
+       INTC_GROUP(DMAC0A,DMAC0A_DEI0,DMAC0A_DEI1,DMAC0A_DEI2,DMAC0A_DEI3),
+       INTC_GROUP(VIO, VIO_CEUI,VIO_BEUI,VIO_VEU2HI,VIO_VOUI),
+       INTC_GROUP(DMAC0B, DMAC0B_DEI4,DMAC0B_DEI5,DMAC0B_DADERR),
+       INTC_GROUP(FLCTL,FLCTL_FLSTEI,FLCTL_FLTENDI,FLCTL_FLTREQ0I,FLCTL_FLTREQ1I),
+       INTC_GROUP(I2C,I2C_ALI,I2C_TACKI,I2C_WAITI,I2C_DTEI),
+       INTC_GROUP(_2DG, _2DG_TRI,_2DG_INI,_2DG_CEI),
+       INTC_GROUP(SDHI1, SDHI1_SDHII0,SDHI1_SDHII1,SDHI1_SDHII2),
+       INTC_GROUP(RTC, RTC_ATI,RTC_PRI,RTC_CUI),
+       INTC_GROUP(DMAC1B, DMAC1B_DEI4,DMAC1B_DEI5,DMAC1B_DADERR),
+       INTC_GROUP(SDHI0,SDHI0_SDHII0,SDHI0_SDHII1,SDHI0_SDHII2),
+};
+
+static struct intc_mask_reg mask_registers[] __initdata = {
+       { 0xa4080080, 0xa40800c0, 8, /* IMR0 / IMCR0 */
+         { 0,  TMU1_TUNI2,TMU1_TUNI1,TMU1_TUNI0,0,SDHI1_SDHII2,SDHI1_SDHII1,SDHI1_SDHII0} },
+       { 0xa4080084, 0xa40800c4, 8, /* IMR1 / IMCR1 */
+         { VIO_VOUI, VIO_VEU2HI,VIO_BEUI,VIO_CEUI,DMAC0A_DEI3,DMAC0A_DEI2,DMAC0A_DEI1,DMAC0A_DEI0 } },
+       { 0xa4080088, 0xa40800c8, 8, /* IMR2 / IMCR2 */
+         { 0, 0, 0, VPU_VPUI,0,0,0,SCIFA_SCIFA0 } },
+       { 0xa408008c, 0xa40800cc, 8, /* IMR3 / IMCR3 */
+         { DMAC1A_DEI3,DMAC1A_DEI2,DMAC1A_DEI1,DMAC1A_DEI0,0,0,0,IRDA_IRDAI } },
+       { 0xa4080090, 0xa40800d0, 8, /* IMR4 / IMCR4 */
+         { 0,TMU0_TUNI2,TMU0_TUNI1,TMU0_TUNI0,VEU2H1_VEU2HI,0,0,LCDC_LCDCI } },
+       { 0xa4080094, 0xa40800d4, 8, /* IMR5 / IMCR5 */
+         { KEYSC_KEYI,DMAC0B_DADERR,DMAC0B_DEI5,DMAC0B_DEI4,0,SCIF_SCIF2,SCIF_SCIF1,SCIF_SCIF0 } },
+       { 0xa4080098, 0xa40800d8, 8, /* IMR6 / IMCR6 */
+         { 0,0,0,SCIFA_SCIFA1,ADC_ADI,0,MSIOF_MSIOFI1,MSIOF_MSIOFI0 } },
+       { 0xa408009c, 0xa40800dc, 8, /* IMR7 / IMCR7 */
+         { I2C_DTEI, I2C_WAITI, I2C_TACKI, I2C_ALI,
+           FLCTL_FLTREQ1I, FLCTL_FLTREQ0I, FLCTL_FLTENDI, FLCTL_FLSTEI } },
+       { 0xa40800a0, 0xa40800e0, 8, /* IMR8 / IMCR8 */
+         { 0,SDHI0_SDHII2,SDHI0_SDHII1,SDHI0_SDHII0,0,0,SCIFA_SCIFA2,SIU_SIUI } },
+       { 0xa40800a4, 0xa40800e4, 8, /* IMR9 / IMCR9 */
+         { 0, 0, 0, CMT_CMTI, 0, 0, USB_USI0,0 } },
+       { 0xa40800a8, 0xa40800e8, 8, /* IMR10 / IMCR10 */
+         { 0, DMAC1B_DADERR,DMAC1B_DEI5,DMAC1B_DEI4,0,RTC_ATI,RTC_PRI,RTC_CUI } },
+       { 0xa40800ac, 0xa40800ec, 8, /* IMR11 / IMCR11 */
+         { 0,_2DG_CEI,_2DG_INI,_2DG_TRI,0,TPU_TPUI,0,TSIF_TSIFI } },
+       { 0xa40800b0, 0xa40800f0, 8, /* IMR12 / IMCR12 */
+         { 0,0,0,0,0,0,0,ATAPI_ATAPII } },
+       { 0xa4140044, 0xa4140064, 8, /* INTMSK00 / INTMSKCLR00 */
+         { IRQ0, IRQ1, IRQ2, IRQ3, IRQ4, IRQ5, IRQ6, IRQ7 } },
+};
+
+static struct intc_prio_reg prio_registers[] __initdata = {
+       { 0xa4080000, 0, 16, 4, /* IPRA */ { TMU0_TUNI0, TMU0_TUNI1, TMU0_TUNI2, IRDA_IRDAI } },
+       { 0xa4080004, 0, 16, 4, /* IPRB */ { VEU2H1_VEU2HI, LCDC_LCDCI, DMAC1A, 0} },
+       { 0xa4080008, 0, 16, 4, /* IPRC */ { TMU1_TUNI0, TMU1_TUNI1, TMU1_TUNI2, 0} },
+       { 0xa408000c, 0, 16, 4, /* IPRD */ { } },
+       { 0xa4080010, 0, 16, 4, /* IPRE */ { DMAC0A, VIO, SCIFA_SCIFA0, VPU_VPUI } },
+       { 0xa4080014, 0, 16, 4, /* IPRF */ { KEYSC_KEYI, DMAC0B, USB_USI0, CMT_CMTI } },
+       { 0xa4080018, 0, 16, 4, /* IPRG */ { SCIF_SCIF0, SCIF_SCIF1, SCIF_SCIF2,0 } },
+       { 0xa408001c, 0, 16, 4, /* IPRH */ { MSIOF_MSIOFI0,MSIOF_MSIOFI1, FLCTL, I2C } },
+       { 0xa4080020, 0, 16, 4, /* IPRI */ { SCIFA_SCIFA1,0,TSIF_TSIFI,_2DG } },
+       { 0xa4080024, 0, 16, 4, /* IPRJ */ { ADC_ADI,0,SIU_SIUI,SDHI1 } },
+       { 0xa4080028, 0, 16, 4, /* IPRK */ { RTC,DMAC1B,0,SDHI0 } },
+       { 0xa408002c, 0, 16, 4, /* IPRL */ { SCIFA_SCIFA2,0,TPU_TPUI,ATAPI_ATAPII } },
+       { 0xa4140010, 0, 32, 4, /* INTPRI00 */
+         { IRQ0, IRQ1, IRQ2, IRQ3, IRQ4, IRQ5, IRQ6, IRQ7 } },
+};
+
+static struct intc_sense_reg sense_registers[] __initdata = {
+       { 0xa414001c, 16, 2, /* ICR1 */
+         { IRQ0, IRQ1, IRQ2, IRQ3, IRQ4, IRQ5, IRQ6, IRQ7 } },
+};
+
+static DECLARE_INTC_DESC(intc_desc, "sh7723", vectors, groups,
+                        mask_registers, prio_registers, sense_registers);
+
+void __init plat_irq_setup(void)
+{
+       register_intc_controller(&intc_desc);
+}
+
+void __init plat_mem_setup(void)
+{
+       /* Register the URAM space as Node 1 */
+       setup_bootmem_node(1, 0x055f0000, 0x05610000);
+}
index 07c988dc9de6fa7bf07e7f315f294cc5e90453c0..ae2b22219f02dffa1c6b05e7520ef46cfb495357 100644 (file)
@@ -231,12 +231,6 @@ static struct intc_group groups[] __initdata = {
        INTC_GROUP(GPIO, GPIO_CH0, GPIO_CH1, GPIO_CH2, GPIO_CH3),
 };
 
-static struct intc_prio priorities[] __initdata = {
-       INTC_PRIO(SCIF0, 3),
-       INTC_PRIO(SCIF1, 3),
-       INTC_PRIO(SCIF2, 3),
-};
-
 static struct intc_mask_reg mask_registers[] __initdata = {
        { 0xffd40038, 0xffd4003c, 32, /* INT2MSKR / INT2MSKCR */
          { 0, 0, 0, 0, 0, 0, GPIO, 0,
@@ -270,11 +264,10 @@ static struct intc_prio_reg prio_registers[] __initdata = {
        { 0xffd400b4, 0, 32, 8, /* INT2PRI13 */ { 0, 0, STIF1, STIF0 } },
 };
 
-static DECLARE_INTC_DESC(intc_desc, "sh7763", vectors, groups, priorities,
+static DECLARE_INTC_DESC(intc_desc, "sh7763", vectors, groups,
                         mask_registers, prio_registers, NULL);
 
 /* Support for external interrupt pins in IRQ mode */
-
 static struct intc_vect irq_vectors[] __initdata = {
        INTC_VECT(IRQ0, 0x240), INTC_VECT(IRQ1, 0x280),
        INTC_VECT(IRQ2, 0x2c0), INTC_VECT(IRQ3, 0x300),
@@ -302,7 +295,6 @@ static DECLARE_INTC_DESC(intc_irq_desc, "sh7763-irq", irq_vectors,
                         irq_sense_registers);
 
 /* External interrupt pins in IRL mode */
-
 static struct intc_vect irl_vectors[] __initdata = {
        INTC_VECT(IRL_LLLL, 0x200), INTC_VECT(IRL_LLLH, 0x220),
        INTC_VECT(IRL_LLHL, 0x240), INTC_VECT(IRL_LLHH, 0x260),
index b9cec48b18088dc0b0239f23b120626d10c5abe3..b73578ee295d47c5335fcf8ec4b170b9b327ca77 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * SH7770 Setup
  *
- *  Copyright (C) 2006  Paul Mundt
+ *  Copyright (C) 2006 - 2008  Paul Mundt
  *
  * This file is subject to the terms and conditions of the GNU General Public
  * License.  See the file "COPYING" in the main directory of this archive
@@ -28,6 +28,41 @@ static struct plat_sci_port sci_platform_data[] = {
                .flags          = UPF_BOOT_AUTOCONF,
                .type           = PORT_SCIF,
                .irqs           = { 63, 63, 63, 63 },
+       }, {
+               .mapbase        = 0xff926000,
+               .flags          = UPF_BOOT_AUTOCONF,
+               .type           = PORT_SCIF,
+               .irqs           = { 64, 64, 64, 64 },
+       }, {
+               .mapbase        = 0xff927000,
+               .flags          = UPF_BOOT_AUTOCONF,
+               .type           = PORT_SCIF,
+               .irqs           = { 65, 65, 65, 65 },
+       }, {
+               .mapbase        = 0xff928000,
+               .flags          = UPF_BOOT_AUTOCONF,
+               .type           = PORT_SCIF,
+               .irqs           = { 66, 66, 66, 66 },
+       }, {
+               .mapbase        = 0xff929000,
+               .flags          = UPF_BOOT_AUTOCONF,
+               .type           = PORT_SCIF,
+               .irqs           = { 67, 67, 67, 67 },
+       }, {
+               .mapbase        = 0xff92a000,
+               .flags          = UPF_BOOT_AUTOCONF,
+               .type           = PORT_SCIF,
+               .irqs           = { 68, 68, 68, 68 },
+       }, {
+               .mapbase        = 0xff92b000,
+               .flags          = UPF_BOOT_AUTOCONF,
+               .type           = PORT_SCIF,
+               .irqs           = { 69, 69, 69, 69 },
+       }, {
+               .mapbase        = 0xff92c000,
+               .flags          = UPF_BOOT_AUTOCONF,
+               .type           = PORT_SCIF,
+               .irqs           = { 70, 70, 70, 70 },
        }, {
                .flags = 0,
        }
index ff4f54a47c0724942ca9f489de602d5884c287f9..284f66f1ebbeb812be6623c7111d820ccaa4ad01 100644 (file)
@@ -23,6 +23,8 @@
 #include <linux/kexec.h>
 #include <linux/module.h>
 #include <linux/smp.h>
+#include <linux/err.h>
+#include <linux/debugfs.h>
 #include <asm/uaccess.h>
 #include <asm/io.h>
 #include <asm/page.h>
@@ -333,6 +335,7 @@ static const char *cpu_name[] = {
        [CPU_SH7343]    = "SH7343",     [CPU_SH7785]    = "SH7785",
        [CPU_SH7722]    = "SH7722",     [CPU_SHX3]      = "SH-X3",
        [CPU_SH5_101]   = "SH5-101",    [CPU_SH5_103]   = "SH5-103",
+       [CPU_MXG]       = "MX-G",       [CPU_SH7723]    = "SH7723",
        [CPU_SH7366]    = "SH7366",     [CPU_SH_NONE]   = "Unknown"
 };
 
@@ -443,3 +446,15 @@ const struct seq_operations cpuinfo_op = {
        .show   = show_cpuinfo,
 };
 #endif /* CONFIG_PROC_FS */
+
+struct dentry *sh_debugfs_root;
+
+static int __init sh_debugfs_init(void)
+{
+       sh_debugfs_root = debugfs_create_dir("sh", NULL);
+       if (IS_ERR(sh_debugfs_root))
+               return PTR_ERR(sh_debugfs_root);
+
+       return 0;
+}
+arch_initcall(sh_debugfs_init);
index 3539123fe5174b29fb95c1b64fcc3e46a3e688a3..8342bfbde64c23a1f1128785b1ed810ba4f46b86 100644 (file)
@@ -27,11 +27,11 @@ ENTRY(clear_page)
        mov     #0,r0
        !
 1:
-#if defined(CONFIG_CPU_SH3)
-       mov.l   r0,@r4
-#elif defined(CONFIG_CPU_SH4)
+#if defined(CONFIG_CPU_SH4)
        movca.l r0,@r4
        mov     r4,r1
+#else
+       mov.l   r0,@r4
 #endif
        add     #32,r4
        mov.l   r0,@-r4
index e002b91c87526bf506757b0e9684fcb25d7ceee5..5d12e657be34e051b8ba2ab676cf472d58ffe77b 100644 (file)
@@ -41,11 +41,11 @@ ENTRY(copy_page)
        mov.l   @r11+,r5
        mov.l   @r11+,r6
        mov.l   @r11+,r7
-#if defined(CONFIG_CPU_SH3)
-       mov.l   r0,@r10
-#elif defined(CONFIG_CPU_SH4)
+#if defined(CONFIG_CPU_SH4)
        movca.l r0,@r10
        mov     r10,r0
+#else
+       mov.l   r0,@r10
 #endif
        add     #32,r10
        mov.l   r7,@-r10
index db6d950b6f5e2f768204982a4b2e2cc015429a68..c5b56d52b7d27cf7d87a6bd3e2d1e99b24f97bf2 100644 (file)
@@ -127,13 +127,13 @@ static int __init cache_debugfs_init(void)
 {
        struct dentry *dcache_dentry, *icache_dentry;
 
-       dcache_dentry = debugfs_create_file("dcache", S_IRUSR, NULL,
+       dcache_dentry = debugfs_create_file("dcache", S_IRUSR, sh_debugfs_root,
                                            (unsigned int *)CACHE_TYPE_DCACHE,
                                            &cache_debugfs_fops);
        if (IS_ERR(dcache_dentry))
                return PTR_ERR(dcache_dentry);
 
-       icache_dentry = debugfs_create_file("icache", S_IRUSR, NULL,
+       icache_dentry = debugfs_create_file("icache", S_IRUSR, sh_debugfs_root,
                                            (unsigned int *)CACHE_TYPE_ICACHE,
                                            &cache_debugfs_fops);
        if (IS_ERR(icache_dentry)) {
index ab81c602295f063906c6de58b398325b2ccd49cc..0b0ec6e047530bd1b7a4dde27088a004631755d5 100644 (file)
@@ -393,7 +393,7 @@ static int __init pmb_debugfs_init(void)
        struct dentry *dentry;
 
        dentry = debugfs_create_file("pmb", S_IFREG | S_IRUGO,
-                                    NULL, NULL, &pmb_debugfs_fops);
+                                    sh_debugfs_root, NULL, &pmb_debugfs_fops);
        if (IS_ERR(dentry))
                return PTR_ERR(dentry);
 
index d63b93da952d4e0eafa9e6df984bccdb6517881b..987c6682bf9906a51f120dc73cc478b00a07d8d8 100644 (file)
@@ -21,8 +21,9 @@ HD64465                       HD64465
 7206SE                 SH_7206_SOLUTION_ENGINE
 7343SE                 SH_7343_SOLUTION_ENGINE
 7619SE                 SH_7619_SOLUTION_ENGINE
-7722SE                 SH_7722_SOLUTION_ENGINE         
-7751SE                 SH_7751_SOLUTION_ENGINE         
+7721SE                 SH_7721_SOLUTION_ENGINE
+7722SE                 SH_7722_SOLUTION_ENGINE
+7751SE                 SH_7751_SOLUTION_ENGINE
 7780SE                 SH_7780_SOLUTION_ENGINE
 7751SYSTEMH            SH_7751_SYSTEMH
 HP6XX                  SH_HP6XX
index cfaf22c05bc460aacf9c5c15a3f4ce907bc57e90..53caacbb3982e20c3feb464facdbe10352122dcf 100644 (file)
@@ -105,7 +105,7 @@ __volatile__ unsigned int *master_l10_limit;
 
 #define TICK_SIZE (tick_nsec / 1000)
 
-irqreturn_t timer_interrupt(int irq, void *dev_id)
+static irqreturn_t timer_interrupt(int dummy, void *dev_id)
 {
        /* last time the cmos clock got updated */
        static long last_rtc_update;
index 463d1be32c98614cea3fc98cb31154895a5858eb..2667a9dee11d943cd2f018a2eec489034c0fd07d 100644 (file)
@@ -16,6 +16,7 @@ config SPARC64
        bool
        default y
        select HAVE_IDE
+       select HAVE_LMB
        help
          SPARC is a family of RISC microprocessors designed and marketed by
          Sun Microsystems, incorporated.  This port covers the newer 64-bit
index 2455fa498876f344b0c00db0800bbd1718acead0..c1a61e98899a7ec741db282798bfdaddbdc4763d 100644 (file)
@@ -55,7 +55,6 @@
 #include <asm/types.h>
 #include <asm/uaccess.h>
 #include <asm/fpumacro.h>
-#include <asm/semaphore.h>
 #include <asm/mmu_context.h>
 #include <asm/compat_signal.h>
 
index 0a4df4d6e05fcf3b03acd138b54a0520444ce5c3..003db9c8c44aa4fc9934c7cff03169af05a96e25 100644 (file)
@@ -30,7 +30,6 @@
 #include <linux/file.h>
 
 #include <asm/uaccess.h>
-#include <asm/semaphore.h>
 #include <asm/unistd.h>
 
 /*
index 2a59dbb28248b7da44c9695250e97bf68a05799c..87a693cf2bb79f6cebbd82368bb2da35e3b45cf9 100644 (file)
@@ -117,6 +117,9 @@ config ARCH_HAS_CPU_RELAX
 config HAVE_SETUP_PER_CPU_AREA
        def_bool X86_64 || (X86_SMP && !X86_VOYAGER)
 
+config HAVE_CPUMASK_OF_CPU_MAP
+       def_bool X86_64_SMP
+
 config ARCH_HIBERNATION_POSSIBLE
        def_bool y
        depends on !SMP || !X86_VOYAGER
@@ -903,6 +906,15 @@ config X86_64_ACPI_NUMA
        help
          Enable ACPI SRAT based node topology detection.
 
+# Some NUMA nodes have memory ranges that span
+# other nodes.  Even though a pfn is valid and
+# between a node's start and end pfns, it may not
+# reside on that node.  See memmap_init_zone()
+# for details.
+config NODES_SPAN_OTHER_NODES
+       def_bool y
+       depends on X86_64_ACPI_NUMA
+
 config NUMA_EMU
        bool "NUMA emulation"
        depends on X86_64 && NUMA
index 31348d054fca6129db01e2fd1e6f3600dc3038dd..90943f83e84d69ba1172ab745febe31a231f58fc 100644 (file)
@@ -9,8 +9,6 @@
  * ----------------------------------------------------------------------- */
 
 /*
- * arch/i386/boot/a20.c
- *
  * Enable A20 gate (return -1 on failure)
  */
 
index c117c7fb859c12bb13685f9fd213dd3e8facec2e..7aa6033001f9ace30ef1a4ffdb52bfd629a98f26 100644 (file)
@@ -12,8 +12,6 @@
  * ----------------------------------------------------------------------- */
 
 /*
- * arch/i386/boot/apm.c
- *
  * Get APM BIOS information
  */
 
index 8dcc8dc7db88c98a143a7361966ee6901b51f596..878e4b9940d9212ce581c5bea0ac518ae6bbf85f 100644 (file)
@@ -9,8 +9,6 @@
  * ----------------------------------------------------------------------- */
 
 /*
- * arch/i386/boot/bitops.h
- *
  * Very simple bitops for the boot code.
  */
 
index 09578070bfba94b2a66c750e6f0a1aafb25e9a1b..a34b9982c7cbcf928bd96e3b17955a789f226f57 100644 (file)
@@ -9,8 +9,6 @@
  * ----------------------------------------------------------------------- */
 
 /*
- * arch/i386/boot/boot.h
- *
  * Header file for the real-mode kernel code
  */
 
index 680408a0f46317c898d5e73a620b499e9a9cbdb2..a1d35634bce0097d6ea32110f4285d0c1a9225b8 100644 (file)
@@ -9,8 +9,6 @@
  * ----------------------------------------------------------------------- */
 
 /*
- * arch/i386/boot/cmdline.c
- *
  * Simple command-line parser for early boot.
  */
 
index 036e635f18a3f14391fa39033fb70d37f8cad8d2..ba7736cf2ec73e8977e447a8ab852d083f079c42 100644 (file)
@@ -130,7 +130,7 @@ relocated:
 /*
  * Setup the stack for the decompressor
  */
-       leal stack_end(%ebx), %esp
+       leal boot_stack_end(%ebx), %esp
 
 /*
  * Do the decompression, and jump to the new kernel..
@@ -142,8 +142,8 @@ relocated:
        pushl %eax      # input_len
        leal input_data(%ebx), %eax
        pushl %eax      # input_data
-       leal _end(%ebx), %eax
-       pushl %eax      # end of the image as third argument
+       leal boot_heap(%ebx), %eax
+       pushl %eax      # heap area as third argument
        pushl %esi      # real mode pointer as second arg
        call decompress_kernel
        addl $20, %esp
@@ -181,7 +181,10 @@ relocated:
        jmp *%ebp
 
 .bss
+/* Stack and heap for uncompression */
 .balign 4
-stack:
-       .fill 4096, 1, 0
-stack_end:
+boot_heap:
+       .fill BOOT_HEAP_SIZE, 1, 0
+boot_stack:
+       .fill BOOT_STACK_SIZE, 1, 0
+boot_stack_end:
index e8657b98c902a0773a1e9861fc4db6349f0bb909..d8819efac81dc4488ff59163172448710311cce0 100644 (file)
@@ -28,6 +28,7 @@
 #include <asm/segment.h>
 #include <asm/pgtable.h>
 #include <asm/page.h>
+#include <asm/boot.h>
 #include <asm/msr.h>
 #include <asm/asm-offsets.h>
 
@@ -62,7 +63,7 @@ startup_32:
        subl    $1b, %ebp
 
 /* setup a stack and make sure cpu supports long mode. */
-       movl    $user_stack_end, %eax
+       movl    $boot_stack_end, %eax
        addl    %ebp, %eax
        movl    %eax, %esp
 
@@ -243,9 +244,9 @@ ENTRY(startup_64)
 /* Copy the compressed kernel to the end of our buffer
  * where decompression in place becomes safe.
  */
-       leaq    _end(%rip), %r8
-       leaq    _end(%rbx), %r9
-       movq    $_end /* - $startup_32 */, %rcx
+       leaq    _end_before_pgt(%rip), %r8
+       leaq    _end_before_pgt(%rbx), %r9
+       movq    $_end_before_pgt /* - $startup_32 */, %rcx
 1:     subq    $8, %r8
        subq    $8, %r9
        movq    0(%r8), %rax
@@ -267,14 +268,14 @@ relocated:
  */
        xorq    %rax, %rax
        leaq    _edata(%rbx), %rdi
-       leaq    _end(%rbx), %rcx
+       leaq    _end_before_pgt(%rbx), %rcx
        subq    %rdi, %rcx
        cld
        rep
        stosb
 
        /* Setup the stack */
-       leaq    user_stack_end(%rip), %rsp
+       leaq    boot_stack_end(%rip), %rsp
 
        /* zero EFLAGS after setting rsp */
        pushq   $0
@@ -285,7 +286,7 @@ relocated:
  */
        pushq   %rsi                    # Save the real mode argument
        movq    %rsi, %rdi              # real mode address
-       leaq    _heap(%rip), %rsi       # _heap
+       leaq    boot_heap(%rip), %rsi   # malloc area for uncompression
        leaq    input_data(%rip), %rdx  # input_data
        movl    input_len(%rip), %eax
        movq    %rax, %rcx              # input_len
@@ -310,9 +311,12 @@ gdt:
        .quad   0x0080890000000000      /* TS descriptor */
        .quad   0x0000000000000000      /* TS continued */
 gdt_end:
-       .bss
-/* Stack for uncompression */
-       .balign 4
-user_stack:
-       .fill 4096,4,0
-user_stack_end:
+
+.bss
+/* Stack and heap for uncompression */
+.balign 4
+boot_heap:
+       .fill BOOT_HEAP_SIZE, 1, 0
+boot_stack:
+       .fill BOOT_STACK_SIZE, 1, 0
+boot_stack_end:
index dad4e699f5a326d41bd6c72d988517c32f0ec538..90456cee47c337b226a8874582440377c428a91e 100644 (file)
@@ -217,12 +217,6 @@ static void putstr(const char *);
 static memptr free_mem_ptr;
 static memptr free_mem_end_ptr;
 
-#ifdef CONFIG_X86_64
-#define HEAP_SIZE             0x7000
-#else
-#define HEAP_SIZE             0x4000
-#endif
-
 static char *vidmem;
 static int vidport;
 static int lines, cols;
@@ -449,7 +443,7 @@ asmlinkage void decompress_kernel(void *rmode, memptr heap,
 
        window = output;                /* Output buffer (Normally at 1M) */
        free_mem_ptr     = heap;        /* Heap */
-       free_mem_end_ptr = heap + HEAP_SIZE;
+       free_mem_end_ptr = heap + BOOT_HEAP_SIZE;
        inbuf  = input_data;            /* Input buffer */
        insize = input_len;
        inptr  = 0;
index 7e5c7209f6cc2f0b932c6deb3208b8c4d5583374..bef1ac891bce9987d2693cdc1ff601457af0d6c4 100644 (file)
@@ -39,10 +39,10 @@ SECTIONS
                *(.bss.*)
                *(COMMON)
                . = ALIGN(8);
-               _end = . ;
+               _end_before_pgt = . ;
                . = ALIGN(4096);
                pgtable = . ;
                . = . + 4096 * 6;
-               _heap = .;
+               _ebss = .;
        }
 }
index ef127e56a3cf7ca36fed6bd275edc690325857fd..ef50c84e8b4bd6a517417d84c9275240ae19dd0c 100644 (file)
@@ -9,8 +9,6 @@
  * ----------------------------------------------------------------------- */
 
 /*
- * arch/i386/boot/copy.S
- *
  * Memory copy routines
  */
 
index 2462c88689edd47ea939de1b2d54cb82c25b7a40..7804389ee0059eb8f4be589cccd24a2623f9567f 100644 (file)
@@ -9,8 +9,6 @@
  * ----------------------------------------------------------------------- */
 
 /*
- * arch/i386/boot/cpucheck.c
- *
  * Check for obligatory CPU features and abort if the features are not
  * present.  This code should be compilable as 16-, 32- or 64-bit
  * code, so be very careful with types and inline assembly.
index 8721dc46a0b618336b9908e0d855611f7beb6175..d84a48ece78503b10e8429981e44397b6755a454 100644 (file)
@@ -9,8 +9,6 @@
  * ----------------------------------------------------------------------- */
 
 /*
- * arch/i386/boot/edd.c
- *
  * Get EDD BIOS disk information
  */
 
index 88d77761d01bfbccba3dc9d970ede616b0900d52..8d60ee15dfd9b2e5e4ff3808976ea8143e94c05a 100644 (file)
@@ -1,7 +1,5 @@
 #!/bin/sh
 #
-# arch/i386/boot/install.sh
-#
 # This file is subject to the terms and conditions of the GNU General Public
 # License.  See the file "COPYING" in the main directory of this archive
 # for more details.
index 7828da5cfd07475376c7d4d3fc95282334b60a3d..77569a4a3be114aaca948d04b060ebd28c80c1a9 100644 (file)
@@ -9,8 +9,6 @@
  * ----------------------------------------------------------------------- */
 
 /*
- * arch/i386/boot/main.c
- *
  * Main module for the real-mode kernel code
  */
 
index 68222f2d4b670479fd7656f4036c848bfed7e5e8..911eaae5d696427c98fdad7f344a14bdc0340efc 100644 (file)
@@ -9,8 +9,6 @@
  * ----------------------------------------------------------------------- */
 
 /*
- * arch/i386/boot/mca.c
- *
  * Get the MCA system description table
  */
 
index e77d89f9e8aa23c13751bee268718e8ed7ee54a7..acad32eb4290861b1539553c1e8eb49f7ec82e92 100644 (file)
@@ -9,8 +9,6 @@
  * ----------------------------------------------------------------------- */
 
 /*
- * arch/i386/boot/memory.c
- *
  * Memory detection code
  */
 
index a93cb8bded4da529e76ee746874cc628808c767a..328956fdb59e79dc354e96f47e98c5cb5dff4a6b 100644 (file)
@@ -9,8 +9,6 @@
  * ----------------------------------------------------------------------- */
 
 /*
- * arch/i386/boot/pm.c
- *
  * Prepare the machine for transition to protected mode.
  */
 
index f5402d51f7c3d1ff534a009d54d438a3cfa54ec8..ab049d40a884d7ef44d32fb63e30c44ed6aedabf 100644 (file)
@@ -9,8 +9,6 @@
  * ----------------------------------------------------------------------- */
 
 /*
- * arch/i386/boot/pmjump.S
- *
  * The actual transition into protected mode
  */
 
index 7e7e890699be9acf34756c7179e1b928db3c0bb8..c1d00c0274c4888c203ac186b4f3930791669be4 100644 (file)
@@ -9,8 +9,6 @@
  * ----------------------------------------------------------------------- */
 
 /*
- * arch/i386/boot/printf.c
- *
  * Oh, it's a waste of space, but oh-so-yummy for debugging.  This
  * version of printf() does not include 64-bit support.  "Live with
  * it."
index 481a22097781953c088931b52021d9a5365b80b2..f94b7a0c2abf8e2477ec5589a54ba682872f680b 100644 (file)
@@ -9,8 +9,6 @@
  * ----------------------------------------------------------------------- */
 
 /*
- * arch/i386/boot/string.c
- *
  * Very basic string functions
  */
 
index f3f14bd2637191ca7a87faf8f69785f87dce2aef..0be77b39328afc957c8aa70b64bbe0641f477a7c 100644 (file)
@@ -9,8 +9,6 @@
  * ----------------------------------------------------------------------- */
 
 /*
- * arch/i386/boot/tty.c
- *
  * Very simple screen I/O
  * XXX: Probably should add very simple serial I/O?
  */
index c61462f7d9a75b636dae291e65924bdf39f3604b..2723d9b5ce432b4d229a9d3cbe47f9b8fdf08a2c 100644 (file)
@@ -9,8 +9,6 @@
  * ----------------------------------------------------------------------- */
 
 /*
- * arch/i386/boot/version.c
- *
  * Kernel version string
  */
 
index 39e247e96172a53c24aefbfe1c6a6beae89d01bc..49f26aaaebc8f2d58064cc1be981103742ab8524 100644 (file)
@@ -9,8 +9,6 @@
  * ----------------------------------------------------------------------- */
 
 /*
- * arch/i386/boot/video-bios.c
- *
  * Standard video BIOS modes
  *
  * We have two options for this; silent and scanned.
index 5d5a3f6e8b5ca31e05bac9e862c9067aaf1afd72..401ad998ad08d7cd63943a5b7a7ae893264b5e3f 100644 (file)
@@ -9,8 +9,6 @@
  * ----------------------------------------------------------------------- */
 
 /*
- * arch/i386/boot/video-vesa.c
- *
  * VESA text modes
  */
 
index 330d6589a2adf854e6e43836b6d4327fb2a072dc..40ecb8d7688c3d5c8a7587aa8fce8bb7ea06d76b 100644 (file)
@@ -9,8 +9,6 @@
  * ----------------------------------------------------------------------- */
 
 /*
- * arch/i386/boot/video-vga.c
- *
  * Common all-VGA modes
  */
 
index c1c47ba069ef7c98c9732f03d408a927bb2eb905..83598b23093aa31398db2d1c9a5f89eb30733357 100644 (file)
@@ -9,8 +9,6 @@
  * ----------------------------------------------------------------------- */
 
 /*
- * arch/i386/boot/video.c
- *
  * Select video mode
  */
 
index d69347f79e8e5b76e23233f7b64216023336e96f..ee63f5d14461517ef96b89a6c644ac6c3a60a2f6 100644 (file)
@@ -9,8 +9,6 @@
  * ----------------------------------------------------------------------- */
 
 /*
- * arch/i386/boot/video.h
- *
  * Header file for the real-mode video probing code
  */
 
index 6499e3239b4132213907ab9ff54d00be9219dd1b..433909d61e5cb2ef7a20f7386c0ad87c362b47c1 100644 (file)
@@ -9,8 +9,6 @@
  * ----------------------------------------------------------------------- */
 
 /*
- * arch/i386/boot/voyager.c
- *
  * Get the Voyager config information
  */
 
index 7cede7a9e0dc4831cf80349ce2a049b88cf8cab8..f00afdf61e6735bbee01085fa24dc42ea529bed7 100644 (file)
@@ -43,7 +43,6 @@
 #include <asm/mman.h>
 #include <asm/types.h>
 #include <asm/uaccess.h>
-#include <asm/semaphore.h>
 #include <asm/atomic.h>
 #include <asm/ia32.h>
 #include <asm/vgtod.h>
index c3920ea8ac56f99020c2de9562b422c97ec2a0c3..90e092d0af0c639211932fc44a0f5dd959ec590b 100644 (file)
@@ -22,13 +22,14 @@ obj-y                       += setup_$(BITS).o i8259_$(BITS).o setup.o
 obj-$(CONFIG_X86_32)   += sys_i386_32.o i386_ksyms_32.o
 obj-$(CONFIG_X86_64)   += sys_x86_64.o x8664_ksyms_64.o
 obj-$(CONFIG_X86_64)   += syscall_64.o vsyscall_64.o setup64.o
-obj-y                  += pci-dma_$(BITS).o  bootflag.o e820_$(BITS).o
-obj-y                  += quirks.o i8237.o topology.o kdebugfs.o
-obj-y                  += alternative.o i8253.o
-obj-$(CONFIG_X86_64)   += pci-nommu_64.o bugs_64.o
+obj-y                  += bootflag.o e820_$(BITS).o
+obj-y                  += pci-dma.o quirks.o i8237.o topology.o kdebugfs.o
+obj-y                  += alternative.o i8253.o pci-nommu.o
+obj-$(CONFIG_X86_64)   += bugs_64.o
 obj-y                  += tsc_$(BITS).o io_delay.o rtc.o
 
 obj-$(CONFIG_X86_TRAMPOLINE)   += trampoline.o
+obj-y                          += process.o
 obj-y                          += i387.o
 obj-y                          += ptrace.o
 obj-y                          += ds.o
index 8ca3557a6d599c947a8b71314902d2d9470e8d48..c2502eb9aa8355488a7057602bfdfa71134785a7 100644 (file)
@@ -1,6 +1,4 @@
 /*
- * arch/i386/kernel/acpi/cstate.c
- *
  * Copyright (C) 2005 Intel Corporation
  *     Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
  *     - Added _PDC for SMP C-states on Intel CPUs
@@ -93,7 +91,7 @@ int acpi_processor_ffh_cstate_probe(unsigned int cpu,
 
        /* Make sure we are running on right CPU */
        saved_mask = current->cpus_allowed;
-       retval = set_cpus_allowed(current, cpumask_of_cpu(cpu));
+       retval = set_cpus_allowed_ptr(current, &cpumask_of_cpu(cpu));
        if (retval)
                return -1;
 
@@ -130,7 +128,7 @@ int acpi_processor_ffh_cstate_probe(unsigned int cpu,
                 cx->address);
 
 out:
-       set_cpus_allowed(current, saved_mask);
+       set_cpus_allowed_ptr(current, &saved_mask);
        return retval;
 }
 EXPORT_SYMBOL_GPL(acpi_processor_ffh_cstate_probe);
index 324eb0cab19ceb7c8353f402d78884f139c6741d..de2d2e4ebad97217be93de05b32886cfa09d0526 100644 (file)
@@ -1,6 +1,4 @@
 /*
- * arch/i386/kernel/acpi/processor.c
- *
  * Copyright (C) 2005 Intel Corporation
  *     Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
  *     - Added _PDC for platforms with Intel CPUs
index d999d7833bc2e15951b35e7d514f48684435f8c1..35b4f6a9c8effca5b2a609aedb669417d26b5f66 100644 (file)
@@ -5,7 +5,6 @@
 #include <linux/module.h>
 #include <linux/percpu.h>
 #include <linux/bootmem.h>
-#include <asm/semaphore.h>
 #include <asm/processor.h>
 #include <asm/i387.h>
 #include <asm/msr.h>
index a962dcb9c408518add7154ac9757ad2ed2c08f7c..e2d870de837c2ba73599a8f58c9408669446ae9c 100644 (file)
@@ -192,9 +192,9 @@ static void drv_read(struct drv_cmd *cmd)
        cpumask_t saved_mask = current->cpus_allowed;
        cmd->val = 0;
 
-       set_cpus_allowed(current, cmd->mask);
+       set_cpus_allowed_ptr(current, &cmd->mask);
        do_drv_read(cmd);
-       set_cpus_allowed(current, saved_mask);
+       set_cpus_allowed_ptr(current, &saved_mask);
 }
 
 static void drv_write(struct drv_cmd *cmd)
@@ -203,30 +203,30 @@ static void drv_write(struct drv_cmd *cmd)
        unsigned int i;
 
        for_each_cpu_mask(i, cmd->mask) {
-               set_cpus_allowed(current, cpumask_of_cpu(i));
+               set_cpus_allowed_ptr(current, &cpumask_of_cpu(i));
                do_drv_write(cmd);
        }
 
-       set_cpus_allowed(current, saved_mask);
+       set_cpus_allowed_ptr(current, &saved_mask);
        return;
 }
 
-static u32 get_cur_val(cpumask_t mask)
+static u32 get_cur_val(const cpumask_t *mask)
 {
        struct acpi_processor_performance *perf;
        struct drv_cmd cmd;
 
-       if (unlikely(cpus_empty(mask)))
+       if (unlikely(cpus_empty(*mask)))
                return 0;
 
-       switch (per_cpu(drv_data, first_cpu(mask))->cpu_feature) {
+       switch (per_cpu(drv_data, first_cpu(*mask))->cpu_feature) {
        case SYSTEM_INTEL_MSR_CAPABLE:
                cmd.type = SYSTEM_INTEL_MSR_CAPABLE;
                cmd.addr.msr.reg = MSR_IA32_PERF_STATUS;
                break;
        case SYSTEM_IO_CAPABLE:
                cmd.type = SYSTEM_IO_CAPABLE;
-               perf = per_cpu(drv_data, first_cpu(mask))->acpi_data;
+               perf = per_cpu(drv_data, first_cpu(*mask))->acpi_data;
                cmd.addr.io.port = perf->control_register.address;
                cmd.addr.io.bit_width = perf->control_register.bit_width;
                break;
@@ -234,7 +234,7 @@ static u32 get_cur_val(cpumask_t mask)
                return 0;
        }
 
-       cmd.mask = mask;
+       cmd.mask = *mask;
 
        drv_read(&cmd);
 
@@ -271,7 +271,7 @@ static unsigned int get_measured_perf(unsigned int cpu)
        unsigned int retval;
 
        saved_mask = current->cpus_allowed;
-       set_cpus_allowed(current, cpumask_of_cpu(cpu));
+       set_cpus_allowed_ptr(current, &cpumask_of_cpu(cpu));
        if (get_cpu() != cpu) {
                /* We were not able to run on requested processor */
                put_cpu();
@@ -329,7 +329,7 @@ static unsigned int get_measured_perf(unsigned int cpu)
        retval = per_cpu(drv_data, cpu)->max_freq * perf_percent / 100;
 
        put_cpu();
-       set_cpus_allowed(current, saved_mask);
+       set_cpus_allowed_ptr(current, &saved_mask);
 
        dprintk("cpu %d: performance percent %d\n", cpu, perf_percent);
        return retval;
@@ -347,13 +347,13 @@ static unsigned int get_cur_freq_on_cpu(unsigned int cpu)
                return 0;
        }
 
-       freq = extract_freq(get_cur_val(cpumask_of_cpu(cpu)), data);
+       freq = extract_freq(get_cur_val(&cpumask_of_cpu(cpu)), data);
        dprintk("cur freq = %u\n", freq);
 
        return freq;
 }
 
-static unsigned int check_freqs(cpumask_t mask, unsigned int freq,
+static unsigned int check_freqs(const cpumask_t *mask, unsigned int freq,
                                struct acpi_cpufreq_data *data)
 {
        unsigned int cur_freq;
@@ -449,7 +449,7 @@ static int acpi_cpufreq_target(struct cpufreq_policy *policy,
        drv_write(&cmd);
 
        if (acpi_pstate_strict) {
-               if (!check_freqs(cmd.mask, freqs.new, data)) {
+               if (!check_freqs(&cmd.mask, freqs.new, data)) {
                        dprintk("acpi_cpufreq_target failed (%d)\n",
                                policy->cpu);
                        return -EAGAIN;
index 14791ec55cfd16798eb0366cb908b31d0dedf1e7..199e4e05e5dc1c7cb82cbe417864377cb399d2d8 100644 (file)
@@ -289,8 +289,8 @@ static int __init cpufreq_p4_init(void)
        if (c->x86_vendor != X86_VENDOR_INTEL)
                return -ENODEV;
 
-       if (!test_bit(X86_FEATURE_ACPI, c->x86_capability) ||
-               !test_bit(X86_FEATURE_ACC, c->x86_capability))
+       if (!test_cpu_cap(c, X86_FEATURE_ACPI) ||
+                               !test_cpu_cap(c, X86_FEATURE_ACC))
                return -ENODEV;
 
        ret = cpufreq_register_driver(&p4clockmod_driver);
index c99d59d8ef2ea46694ac8b3da1cb07de2714cf10..46d4034d9f379237feba3ad4bbe0a4689f1e0b9b 100644 (file)
@@ -478,12 +478,12 @@ static int core_voltage_post_transition(struct powernow_k8_data *data, u32 reqvi
 
 static int check_supported_cpu(unsigned int cpu)
 {
-       cpumask_t oldmask = CPU_MASK_ALL;
+       cpumask_t oldmask;
        u32 eax, ebx, ecx, edx;
        unsigned int rc = 0;
 
        oldmask = current->cpus_allowed;
-       set_cpus_allowed(current, cpumask_of_cpu(cpu));
+       set_cpus_allowed_ptr(current, &cpumask_of_cpu(cpu));
 
        if (smp_processor_id() != cpu) {
                printk(KERN_ERR PFX "limiting to cpu %u failed\n", cpu);
@@ -528,7 +528,7 @@ static int check_supported_cpu(unsigned int cpu)
        rc = 1;
 
 out:
-       set_cpus_allowed(current, oldmask);
+       set_cpus_allowed_ptr(current, &oldmask);
        return rc;
 }
 
@@ -1015,7 +1015,7 @@ static int transition_frequency_pstate(struct powernow_k8_data *data, unsigned i
 /* Driver entry point to switch to the target frequency */
 static int powernowk8_target(struct cpufreq_policy *pol, unsigned targfreq, unsigned relation)
 {
-       cpumask_t oldmask = CPU_MASK_ALL;
+       cpumask_t oldmask;
        struct powernow_k8_data *data = per_cpu(powernow_data, pol->cpu);
        u32 checkfid;
        u32 checkvid;
@@ -1030,7 +1030,7 @@ static int powernowk8_target(struct cpufreq_policy *pol, unsigned targfreq, unsi
 
        /* only run on specific CPU from here on */
        oldmask = current->cpus_allowed;
-       set_cpus_allowed(current, cpumask_of_cpu(pol->cpu));
+       set_cpus_allowed_ptr(current, &cpumask_of_cpu(pol->cpu));
 
        if (smp_processor_id() != pol->cpu) {
                printk(KERN_ERR PFX "limiting to cpu %u failed\n", pol->cpu);
@@ -1085,7 +1085,7 @@ static int powernowk8_target(struct cpufreq_policy *pol, unsigned targfreq, unsi
        ret = 0;
 
 err_out:
-       set_cpus_allowed(current, oldmask);
+       set_cpus_allowed_ptr(current, &oldmask);
        return ret;
 }
 
@@ -1104,7 +1104,7 @@ static int powernowk8_verify(struct cpufreq_policy *pol)
 static int __cpuinit powernowk8_cpu_init(struct cpufreq_policy *pol)
 {
        struct powernow_k8_data *data;
-       cpumask_t oldmask = CPU_MASK_ALL;
+       cpumask_t oldmask;
        int rc;
 
        if (!cpu_online(pol->cpu))
@@ -1145,7 +1145,7 @@ static int __cpuinit powernowk8_cpu_init(struct cpufreq_policy *pol)
 
        /* only run on specific CPU from here on */
        oldmask = current->cpus_allowed;
-       set_cpus_allowed(current, cpumask_of_cpu(pol->cpu));
+       set_cpus_allowed_ptr(current, &cpumask_of_cpu(pol->cpu));
 
        if (smp_processor_id() != pol->cpu) {
                printk(KERN_ERR PFX "limiting to cpu %u failed\n", pol->cpu);
@@ -1164,7 +1164,7 @@ static int __cpuinit powernowk8_cpu_init(struct cpufreq_policy *pol)
                fidvid_msr_init();
 
        /* run on any CPU again */
-       set_cpus_allowed(current, oldmask);
+       set_cpus_allowed_ptr(current, &oldmask);
 
        if (cpu_family == CPU_HW_PSTATE)
                pol->cpus = cpumask_of_cpu(pol->cpu);
@@ -1205,7 +1205,7 @@ static int __cpuinit powernowk8_cpu_init(struct cpufreq_policy *pol)
        return 0;
 
 err_out:
-       set_cpus_allowed(current, oldmask);
+       set_cpus_allowed_ptr(current, &oldmask);
        powernow_k8_cpu_exit_acpi(data);
 
        kfree(data);
@@ -1242,10 +1242,11 @@ static unsigned int powernowk8_get (unsigned int cpu)
        if (!data)
                return -EINVAL;
 
-       set_cpus_allowed(current, cpumask_of_cpu(cpu));
+       set_cpus_allowed_ptr(current, &cpumask_of_cpu(cpu));
        if (smp_processor_id() != cpu) {
-               printk(KERN_ERR PFX "limiting to CPU %d failed in powernowk8_get\n", cpu);
-               set_cpus_allowed(current, oldmask);
+               printk(KERN_ERR PFX
+                       "limiting to CPU %d failed in powernowk8_get\n", cpu);
+               set_cpus_allowed_ptr(current, &oldmask);
                return 0;
        }
 
@@ -1253,13 +1254,14 @@ static unsigned int powernowk8_get (unsigned int cpu)
                goto out;
 
        if (cpu_family == CPU_HW_PSTATE)
-               khz = find_khz_freq_from_pstate(data->powernow_table, data->currpstate);
+               khz = find_khz_freq_from_pstate(data->powernow_table,
+                                               data->currpstate);
        else
                khz = find_khz_freq_from_fid(data->currfid);
 
 
 out:
-       set_cpus_allowed(current, oldmask);
+       set_cpus_allowed_ptr(current, &oldmask);
        return khz;
 }
 
index 3031f119619212d40946ee2d0b297bf8a43bc576..908dd347c67ec3dc29aa5ab8b3dcbae9a12e5e37 100644 (file)
@@ -315,7 +315,7 @@ static unsigned int get_cur_freq(unsigned int cpu)
        cpumask_t saved_mask;
 
        saved_mask = current->cpus_allowed;
-       set_cpus_allowed(current, cpumask_of_cpu(cpu));
+       set_cpus_allowed_ptr(current, &cpumask_of_cpu(cpu));
        if (smp_processor_id() != cpu)
                return 0;
 
@@ -333,7 +333,7 @@ static unsigned int get_cur_freq(unsigned int cpu)
                clock_freq = extract_clock(l, cpu, 1);
        }
 
-       set_cpus_allowed(current, saved_mask);
+       set_cpus_allowed_ptr(current, &saved_mask);
        return clock_freq;
 }
 
@@ -487,7 +487,7 @@ static int centrino_target (struct cpufreq_policy *policy,
                else
                        cpu_set(j, set_mask);
 
-               set_cpus_allowed(current, set_mask);
+               set_cpus_allowed_ptr(current, &set_mask);
                preempt_disable();
                if (unlikely(!cpu_isset(smp_processor_id(), set_mask))) {
                        dprintk("couldn't limit to CPUs in this domain\n");
@@ -555,7 +555,8 @@ static int centrino_target (struct cpufreq_policy *policy,
 
                if (!cpus_empty(covered_cpus)) {
                        for_each_cpu_mask(j, covered_cpus) {
-                               set_cpus_allowed(current, cpumask_of_cpu(j));
+                               set_cpus_allowed_ptr(current,
+                                                    &cpumask_of_cpu(j));
                                wrmsr(MSR_IA32_PERF_CTL, oldmsr, h);
                        }
                }
@@ -569,12 +570,12 @@ static int centrino_target (struct cpufreq_policy *policy,
                        cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
                }
        }
-       set_cpus_allowed(current, saved_mask);
+       set_cpus_allowed_ptr(current, &saved_mask);
        return 0;
 
 migrate_end:
        preempt_enable();
-       set_cpus_allowed(current, saved_mask);
+       set_cpus_allowed_ptr(current, &saved_mask);
        return 0;
 }
 
index 14d68aa301eea923ebff083e7cfbc5ad42a1083d..1b50244b1fdfd892e016d015e922fc12130992e2 100644 (file)
@@ -229,22 +229,22 @@ static unsigned int speedstep_detect_chipset (void)
        return 0;
 }
 
-static unsigned int _speedstep_get(cpumask_t cpus)
+static unsigned int _speedstep_get(const cpumask_t *cpus)
 {
        unsigned int speed;
        cpumask_t cpus_allowed;
 
        cpus_allowed = current->cpus_allowed;
-       set_cpus_allowed(current, cpus);
+       set_cpus_allowed_ptr(current, cpus);
        speed = speedstep_get_processor_frequency(speedstep_processor);
-       set_cpus_allowed(current, cpus_allowed);
+       set_cpus_allowed_ptr(current, &cpus_allowed);
        dprintk("detected %u kHz as current frequency\n", speed);
        return speed;
 }
 
 static unsigned int speedstep_get(unsigned int cpu)
 {
-       return _speedstep_get(cpumask_of_cpu(cpu));
+       return _speedstep_get(&cpumask_of_cpu(cpu));
 }
 
 /**
@@ -267,7 +267,7 @@ static int speedstep_target (struct cpufreq_policy *policy,
        if (cpufreq_frequency_table_target(policy, &speedstep_freqs[0], target_freq, relation, &newstate))
                return -EINVAL;
 
-       freqs.old = _speedstep_get(policy->cpus);
+       freqs.old = _speedstep_get(&policy->cpus);
        freqs.new = speedstep_freqs[newstate].frequency;
        freqs.cpu = policy->cpu;
 
@@ -285,12 +285,12 @@ static int speedstep_target (struct cpufreq_policy *policy,
        }
 
        /* switch to physical CPU where state is to be changed */
-       set_cpus_allowed(current, policy->cpus);
+       set_cpus_allowed_ptr(current, &policy->cpus);
 
        speedstep_set_state(newstate);
 
        /* allow to be run on all CPUs */
-       set_cpus_allowed(current, cpus_allowed);
+       set_cpus_allowed_ptr(current, &cpus_allowed);
 
        for_each_cpu_mask(i, policy->cpus) {
                freqs.cpu = i;
@@ -326,7 +326,7 @@ static int speedstep_cpu_init(struct cpufreq_policy *policy)
 #endif
 
        cpus_allowed = current->cpus_allowed;
-       set_cpus_allowed(current, policy->cpus);
+       set_cpus_allowed_ptr(current, &policy->cpus);
 
        /* detect low and high frequency and transition latency */
        result = speedstep_get_freqs(speedstep_processor,
@@ -334,12 +334,12 @@ static int speedstep_cpu_init(struct cpufreq_policy *policy)
                                     &speedstep_freqs[SPEEDSTEP_HIGH].frequency,
                                     &policy->cpuinfo.transition_latency,
                                     &speedstep_set_state);
-       set_cpus_allowed(current, cpus_allowed);
+       set_cpus_allowed_ptr(current, &cpus_allowed);
        if (result)
                return result;
 
        /* get current speed setting */
-       speed = _speedstep_get(policy->cpus);
+       speed = _speedstep_get(&policy->cpus);
        if (!speed)
                return -EIO;
 
index 1b889860eb730fc3081b31d02fd304c923667711..26d615dcb1498ed7664b2483e3a68e74abc5ee71 100644 (file)
@@ -129,7 +129,7 @@ struct _cpuid4_info {
        union _cpuid4_leaf_ebx ebx;
        union _cpuid4_leaf_ecx ecx;
        unsigned long size;
-       cpumask_t shared_cpu_map;
+       cpumask_t shared_cpu_map;       /* future?: only cpus/node is needed */
 };
 
 unsigned short                 num_cache_leaves;
@@ -451,8 +451,8 @@ unsigned int __cpuinit init_intel_cacheinfo(struct cpuinfo_x86 *c)
 }
 
 /* pointer to _cpuid4_info array (for each cache leaf) */
-static struct _cpuid4_info *cpuid4_info[NR_CPUS];
-#define CPUID4_INFO_IDX(x,y)    (&((cpuid4_info[x])[y]))
+static DEFINE_PER_CPU(struct _cpuid4_info *, cpuid4_info);
+#define CPUID4_INFO_IDX(x, y)    (&((per_cpu(cpuid4_info, x))[y]))
 
 #ifdef CONFIG_SMP
 static void __cpuinit cache_shared_cpu_map_setup(unsigned int cpu, int index)
@@ -474,7 +474,7 @@ static void __cpuinit cache_shared_cpu_map_setup(unsigned int cpu, int index)
                        if (cpu_data(i).apicid >> index_msb ==
                            c->apicid >> index_msb) {
                                cpu_set(i, this_leaf->shared_cpu_map);
-                               if (i != cpu && cpuid4_info[i])  {
+                               if (i != cpu && per_cpu(cpuid4_info, i))  {
                                        sibling_leaf = CPUID4_INFO_IDX(i, index);
                                        cpu_set(cpu, sibling_leaf->shared_cpu_map);
                                }
@@ -505,8 +505,8 @@ static void __cpuinit free_cache_attributes(unsigned int cpu)
        for (i = 0; i < num_cache_leaves; i++)
                cache_remove_shared_cpu_map(cpu, i);
 
-       kfree(cpuid4_info[cpu]);
-       cpuid4_info[cpu] = NULL;
+       kfree(per_cpu(cpuid4_info, cpu));
+       per_cpu(cpuid4_info, cpu) = NULL;
 }
 
 static int __cpuinit detect_cache_attributes(unsigned int cpu)
@@ -519,13 +519,13 @@ static int __cpuinit detect_cache_attributes(unsigned int cpu)
        if (num_cache_leaves == 0)
                return -ENOENT;
 
-       cpuid4_info[cpu] = kzalloc(
+       per_cpu(cpuid4_info, cpu) = kzalloc(
            sizeof(struct _cpuid4_info) * num_cache_leaves, GFP_KERNEL);
-       if (cpuid4_info[cpu] == NULL)
+       if (per_cpu(cpuid4_info, cpu) == NULL)
                return -ENOMEM;
 
        oldmask = current->cpus_allowed;
-       retval = set_cpus_allowed(current, cpumask_of_cpu(cpu));
+       retval = set_cpus_allowed_ptr(current, &cpumask_of_cpu(cpu));
        if (retval)
                goto out;
 
@@ -542,12 +542,12 @@ static int __cpuinit detect_cache_attributes(unsigned int cpu)
                }
                cache_shared_cpu_map_setup(cpu, j);
        }
-       set_cpus_allowed(current, oldmask);
+       set_cpus_allowed_ptr(current, &oldmask);
 
 out:
        if (retval) {
-               kfree(cpuid4_info[cpu]);
-               cpuid4_info[cpu] = NULL;
+               kfree(per_cpu(cpuid4_info, cpu));
+               per_cpu(cpuid4_info, cpu) = NULL;
        }
 
        return retval;
@@ -561,7 +561,7 @@ out:
 extern struct sysdev_class cpu_sysdev_class; /* from drivers/base/cpu.c */
 
 /* pointer to kobject for cpuX/cache */
-static struct kobject * cache_kobject[NR_CPUS];
+static DEFINE_PER_CPU(struct kobject *, cache_kobject);
 
 struct _index_kobject {
        struct kobject kobj;
@@ -570,8 +570,8 @@ struct _index_kobject {
 };
 
 /* pointer to array of kobjects for cpuX/cache/indexY */
-static struct _index_kobject *index_kobject[NR_CPUS];
-#define INDEX_KOBJECT_PTR(x,y)    (&((index_kobject[x])[y]))
+static DEFINE_PER_CPU(struct _index_kobject *, index_kobject);
+#define INDEX_KOBJECT_PTR(x, y)    (&((per_cpu(index_kobject, x))[y]))
 
 #define show_one_plus(file_name, object, val)                          \
 static ssize_t show_##file_name                                                \
@@ -591,11 +591,32 @@ static ssize_t show_size(struct _cpuid4_info *this_leaf, char *buf)
        return sprintf (buf, "%luK\n", this_leaf->size / 1024);
 }
 
-static ssize_t show_shared_cpu_map(struct _cpuid4_info *this_leaf, char *buf)
+static ssize_t show_shared_cpu_map_func(struct _cpuid4_info *this_leaf,
+                                       int type, char *buf)
 {
-       char mask_str[NR_CPUS];
-       cpumask_scnprintf(mask_str, NR_CPUS, this_leaf->shared_cpu_map);
-       return sprintf(buf, "%s\n", mask_str);
+       ptrdiff_t len = PTR_ALIGN(buf + PAGE_SIZE - 1, PAGE_SIZE) - buf;
+       int n = 0;
+
+       if (len > 1) {
+               cpumask_t *mask = &this_leaf->shared_cpu_map;
+
+               n = type?
+                       cpulist_scnprintf(buf, len-2, *mask):
+                       cpumask_scnprintf(buf, len-2, *mask);
+               buf[n++] = '\n';
+               buf[n] = '\0';
+       }
+       return n;
+}
+
+static inline ssize_t show_shared_cpu_map(struct _cpuid4_info *leaf, char *buf)
+{
+       return show_shared_cpu_map_func(leaf, 0, buf);
+}
+
+static inline ssize_t show_shared_cpu_list(struct _cpuid4_info *leaf, char *buf)
+{
+       return show_shared_cpu_map_func(leaf, 1, buf);
 }
 
 static ssize_t show_type(struct _cpuid4_info *this_leaf, char *buf) {
@@ -633,6 +654,7 @@ define_one_ro(ways_of_associativity);
 define_one_ro(number_of_sets);
 define_one_ro(size);
 define_one_ro(shared_cpu_map);
+define_one_ro(shared_cpu_list);
 
 static struct attribute * default_attrs[] = {
        &type.attr,
@@ -643,6 +665,7 @@ static struct attribute * default_attrs[] = {
        &number_of_sets.attr,
        &size.attr,
        &shared_cpu_map.attr,
+       &shared_cpu_list.attr,
        NULL
 };
 
@@ -684,10 +707,10 @@ static struct kobj_type ktype_percpu_entry = {
 
 static void __cpuinit cpuid4_cache_sysfs_exit(unsigned int cpu)
 {
-       kfree(cache_kobject[cpu]);
-       kfree(index_kobject[cpu]);
-       cache_kobject[cpu] = NULL;
-       index_kobject[cpu] = NULL;
+       kfree(per_cpu(cache_kobject, cpu));
+       kfree(per_cpu(index_kobject, cpu));
+       per_cpu(cache_kobject, cpu) = NULL;
+       per_cpu(index_kobject, cpu) = NULL;
        free_cache_attributes(cpu);
 }
 
@@ -703,13 +726,14 @@ static int __cpuinit cpuid4_cache_sysfs_init(unsigned int cpu)
                return err;
 
        /* Allocate all required memory */
-       cache_kobject[cpu] = kzalloc(sizeof(struct kobject), GFP_KERNEL);
-       if (unlikely(cache_kobject[cpu] == NULL))
+       per_cpu(cache_kobject, cpu) =
+               kzalloc(sizeof(struct kobject), GFP_KERNEL);
+       if (unlikely(per_cpu(cache_kobject, cpu) == NULL))
                goto err_out;
 
-       index_kobject[cpu] = kzalloc(
+       per_cpu(index_kobject, cpu) = kzalloc(
            sizeof(struct _index_kobject ) * num_cache_leaves, GFP_KERNEL);
-       if (unlikely(index_kobject[cpu] == NULL))
+       if (unlikely(per_cpu(index_kobject, cpu) == NULL))
                goto err_out;
 
        return 0;
@@ -733,7 +757,8 @@ static int __cpuinit cache_add_dev(struct sys_device * sys_dev)
        if (unlikely(retval < 0))
                return retval;
 
-       retval = kobject_init_and_add(cache_kobject[cpu], &ktype_percpu_entry,
+       retval = kobject_init_and_add(per_cpu(cache_kobject, cpu),
+                                     &ktype_percpu_entry,
                                      &sys_dev->kobj, "%s", "cache");
        if (retval < 0) {
                cpuid4_cache_sysfs_exit(cpu);
@@ -745,13 +770,14 @@ static int __cpuinit cache_add_dev(struct sys_device * sys_dev)
                this_object->cpu = cpu;
                this_object->index = i;
                retval = kobject_init_and_add(&(this_object->kobj),
-                                             &ktype_cache, cache_kobject[cpu],
+                                             &ktype_cache,
+                                             per_cpu(cache_kobject, cpu),
                                              "index%1lu", i);
                if (unlikely(retval)) {
                        for (j = 0; j < i; j++) {
                                kobject_put(&(INDEX_KOBJECT_PTR(cpu,j)->kobj));
                        }
-                       kobject_put(cache_kobject[cpu]);
+                       kobject_put(per_cpu(cache_kobject, cpu));
                        cpuid4_cache_sysfs_exit(cpu);
                        break;
                }
@@ -760,7 +786,7 @@ static int __cpuinit cache_add_dev(struct sys_device * sys_dev)
        if (!retval)
                cpu_set(cpu, cache_dev_map);
 
-       kobject_uevent(cache_kobject[cpu], KOBJ_ADD);
+       kobject_uevent(per_cpu(cache_kobject, cpu), KOBJ_ADD);
        return retval;
 }
 
@@ -769,7 +795,7 @@ static void __cpuinit cache_remove_dev(struct sys_device * sys_dev)
        unsigned int cpu = sys_dev->id;
        unsigned long i;
 
-       if (cpuid4_info[cpu] == NULL)
+       if (per_cpu(cpuid4_info, cpu) == NULL)
                return;
        if (!cpu_isset(cpu, cache_dev_map))
                return;
@@ -777,7 +803,7 @@ static void __cpuinit cache_remove_dev(struct sys_device * sys_dev)
 
        for (i = 0; i < num_cache_leaves; i++)
                kobject_put(&(INDEX_KOBJECT_PTR(cpu,i)->kobj));
-       kobject_put(cache_kobject[cpu]);
+       kobject_put(per_cpu(cache_kobject, cpu));
        cpuid4_cache_sysfs_exit(cpu);
 }
 
index 32671da8184e5e78c1e090d5d795606057f3cd37..7c9a813e11939b7e7fa583549d4c9affdde26476 100644 (file)
@@ -251,18 +251,18 @@ struct threshold_attr {
        ssize_t(*store) (struct threshold_block *, const char *, size_t count);
 };
 
-static cpumask_t affinity_set(unsigned int cpu)
+static void affinity_set(unsigned int cpu, cpumask_t *oldmask,
+                                          cpumask_t *newmask)
 {
-       cpumask_t oldmask = current->cpus_allowed;
-       cpumask_t newmask = CPU_MASK_NONE;
-       cpu_set(cpu, newmask);
-       set_cpus_allowed(current, newmask);
-       return oldmask;
+       *oldmask = current->cpus_allowed;
+       cpus_clear(*newmask);
+       cpu_set(cpu, *newmask);
+       set_cpus_allowed_ptr(current, newmask);
 }
 
-static void affinity_restore(cpumask_t oldmask)
+static void affinity_restore(const cpumask_t *oldmask)
 {
-       set_cpus_allowed(current, oldmask);
+       set_cpus_allowed_ptr(current, oldmask);
 }
 
 #define SHOW_FIELDS(name)                                           \
@@ -277,15 +277,15 @@ static ssize_t store_interrupt_enable(struct threshold_block *b,
                                      const char *buf, size_t count)
 {
        char *end;
-       cpumask_t oldmask;
+       cpumask_t oldmask, newmask;
        unsigned long new = simple_strtoul(buf, &end, 0);
        if (end == buf)
                return -EINVAL;
        b->interrupt_enable = !!new;
 
-       oldmask = affinity_set(b->cpu);
+       affinity_set(b->cpu, &oldmask, &newmask);
        threshold_restart_bank(b, 0, 0);
-       affinity_restore(oldmask);
+       affinity_restore(&oldmask);
 
        return end - buf;
 }
@@ -294,7 +294,7 @@ static ssize_t store_threshold_limit(struct threshold_block *b,
                                     const char *buf, size_t count)
 {
        char *end;
-       cpumask_t oldmask;
+       cpumask_t oldmask, newmask;
        u16 old;
        unsigned long new = simple_strtoul(buf, &end, 0);
        if (end == buf)
@@ -306,9 +306,9 @@ static ssize_t store_threshold_limit(struct threshold_block *b,
        old = b->threshold_limit;
        b->threshold_limit = new;
 
-       oldmask = affinity_set(b->cpu);
+       affinity_set(b->cpu, &oldmask, &newmask);
        threshold_restart_bank(b, 0, old);
-       affinity_restore(oldmask);
+       affinity_restore(&oldmask);
 
        return end - buf;
 }
@@ -316,10 +316,10 @@ static ssize_t store_threshold_limit(struct threshold_block *b,
 static ssize_t show_error_count(struct threshold_block *b, char *buf)
 {
        u32 high, low;
-       cpumask_t oldmask;
-       oldmask = affinity_set(b->cpu);
+       cpumask_t oldmask, newmask;
+       affinity_set(b->cpu, &oldmask, &newmask);
        rdmsr(b->address, low, high);
-       affinity_restore(oldmask);
+       affinity_restore(&oldmask);
        return sprintf(buf, "%x\n",
                       (high & 0xFFF) - (THRESHOLD_MAX - b->threshold_limit));
 }
@@ -327,10 +327,10 @@ static ssize_t show_error_count(struct threshold_block *b, char *buf)
 static ssize_t store_error_count(struct threshold_block *b,
                                 const char *buf, size_t count)
 {
-       cpumask_t oldmask;
-       oldmask = affinity_set(b->cpu);
+       cpumask_t oldmask, newmask;
+       affinity_set(b->cpu, &oldmask, &newmask);
        threshold_restart_bank(b, 1, 0);
-       affinity_restore(oldmask);
+       affinity_restore(&oldmask);
        return 1;
 }
 
@@ -468,7 +468,7 @@ static __cpuinit int threshold_create_bank(unsigned int cpu, unsigned int bank)
 {
        int i, err = 0;
        struct threshold_bank *b = NULL;
-       cpumask_t oldmask = CPU_MASK_NONE;
+       cpumask_t oldmask, newmask;
        char name[32];
 
        sprintf(name, "threshold_bank%i", bank);
@@ -519,10 +519,10 @@ static __cpuinit int threshold_create_bank(unsigned int cpu, unsigned int bank)
 
        per_cpu(threshold_banks, cpu)[bank] = b;
 
-       oldmask = affinity_set(cpu);
+       affinity_set(cpu, &oldmask, &newmask);
        err = allocate_threshold_blocks(cpu, bank, 0,
                                        MSR_IA32_MC0_MISC + bank * 4);
-       affinity_restore(oldmask);
+       affinity_restore(&oldmask);
 
        if (err)
                goto out_free;
index 9b7e01daa1ca22c70830add7e46e68247f903899..1f4cc48c14c633be4e0a1ca62b1502616337b048 100644 (file)
@@ -1,5 +1,4 @@
 /*
- * linux/arch/i386/kernel/cpu/mcheck/therm_throt.c
  *
  * Thermal throttle event support code (such as syslog messaging and rate
  * limiting) that was factored out from x86_64 (mce_intel.c) and i386 (p4.c).
index 0978a4a39418acd6c9cdabcb0dc85d38b5785d55..0d0d9057e7c0b63b36591385d89397ff7322bd99 100644 (file)
@@ -1,7 +1,6 @@
 #include <linux/smp.h>
 #include <linux/timex.h>
 #include <linux/string.h>
-#include <asm/semaphore.h>
 #include <linux/seq_file.h>
 #include <linux/cpufreq.h>
 
index 288e7a6598ac6450c1b13a88e51337ccc0c0b9d2..daff52a6224857f79985d20c96b0661922c88504 100644 (file)
@@ -154,12 +154,10 @@ static int __cpuinit cpuid_class_cpu_callback(struct notifier_block *nfb,
                err = cpuid_device_create(cpu);
                break;
        case CPU_UP_CANCELED:
+       case CPU_UP_CANCELED_FROZEN:
        case CPU_DEAD:
                cpuid_device_destroy(cpu);
                break;
-       case CPU_UP_CANCELED_FROZEN:
-               destroy_suspended_device(cpuid_class, MKDEV(CPUID_MAJOR, cpu));
-               break;
        }
        return err ? NOTIFY_BAD : NOTIFY_OK;
 }
index 0240cd778365d12a05e3096e4b7492b510573e5a..ed733e7cf4e611c454f9ea622c9322919aa624b4 100644 (file)
@@ -475,7 +475,7 @@ int __init copy_e820_map(struct e820entry *biosmap, int nr_map)
 /*
  * Find the highest page frame number we have available
  */
-void __init find_max_pfn(void)
+void __init propagate_e820_map(void)
 {
        int i;
 
@@ -704,7 +704,7 @@ static int __init parse_memmap(char *arg)
                 * size before original memory map is
                 * reset.
                 */
-               find_max_pfn();
+               propagate_e820_map();
                saved_max_pfn = max_pfn;
 #endif
                e820.nr_map = 0;
index 7f6c0c85c8f65e0a37524a095b6ac5d7d86009b1..cbd42e51cb082d82b8f287eaa1c244913268d64c 100644 (file)
@@ -96,7 +96,7 @@ void __init early_res_to_bootmem(void)
 }
 
 /* Check for already reserved areas */
-static inline int
+static inline int __init
 bad_addr(unsigned long *addrp, unsigned long size, unsigned long align)
 {
        int i;
@@ -116,7 +116,7 @@ again:
 }
 
 /* Check for already reserved areas */
-static inline int
+static inline int __init
 bad_addr_size(unsigned long *addrp, unsigned long *sizep, unsigned long align)
 {
        int i;
index 759e02bec0708f955764907ec380e6eb737c6dfa..77d424cf68b38e6b919f55b6fd895436e887fd74 100644 (file)
@@ -383,6 +383,7 @@ static void __init runtime_code_page_mkexec(void)
 {
        efi_memory_desc_t *md;
        void *p;
+       u64 addr, npages;
 
        /* Make EFI runtime service code area executable */
        for (p = memmap.map; p < memmap.map_end; p += memmap.desc_size) {
@@ -391,7 +392,10 @@ static void __init runtime_code_page_mkexec(void)
                if (md->type != EFI_RUNTIME_SERVICES_CODE)
                        continue;
 
-               set_memory_x(md->virt_addr, md->num_pages);
+               addr = md->virt_addr;
+               npages = md->num_pages;
+               memrange_efi_to_native(&addr, &npages);
+               set_memory_x(addr, npages);
        }
 }
 
@@ -408,7 +412,7 @@ void __init efi_enter_virtual_mode(void)
        efi_memory_desc_t *md;
        efi_status_t status;
        unsigned long size;
-       u64 end, systab;
+       u64 end, systab, addr, npages;
        void *p, *va;
 
        efi.systab = NULL;
@@ -420,7 +424,7 @@ void __init efi_enter_virtual_mode(void)
                size = md->num_pages << EFI_PAGE_SHIFT;
                end = md->phys_addr + size;
 
-               if ((end >> PAGE_SHIFT) <= max_pfn_mapped)
+               if (PFN_UP(end) <= max_pfn_mapped)
                        va = __va(md->phys_addr);
                else
                        va = efi_ioremap(md->phys_addr, size);
@@ -433,8 +437,12 @@ void __init efi_enter_virtual_mode(void)
                        continue;
                }
 
-               if (!(md->attribute & EFI_MEMORY_WB))
-                       set_memory_uc(md->virt_addr, md->num_pages);
+               if (!(md->attribute & EFI_MEMORY_WB)) {
+                       addr = md->virt_addr;
+                       npages = md->num_pages;
+                       memrange_efi_to_native(&addr, &npages);
+                       set_memory_uc(addr, npages);
+               }
 
                systab = (u64) (unsigned long) efi_phys.systab;
                if (md->phys_addr <= systab && systab < end) {
index d143a1e76b301737c6fc34f2a0d6da656b787038..d0060fdcccac1658968db527f4c05d791b056e6b 100644 (file)
@@ -105,14 +105,14 @@ void __init efi_reserve_bootmem(void)
 
 void __iomem * __init efi_ioremap(unsigned long phys_addr, unsigned long size)
 {
-       static unsigned pages_mapped;
+       static unsigned pages_mapped __initdata;
        unsigned i, pages;
+       unsigned long offset;
 
-       /* phys_addr and size must be page aligned */
-       if ((phys_addr & ~PAGE_MASK) || (size & ~PAGE_MASK))
-               return NULL;
+       pages = PFN_UP(phys_addr + size) - PFN_DOWN(phys_addr);
+       offset = phys_addr & ~PAGE_MASK;
+       phys_addr &= PAGE_MASK;
 
-       pages = size >> PAGE_SHIFT;
        if (pages_mapped + pages > MAX_EFI_IO_PAGES)
                return NULL;
 
@@ -124,5 +124,5 @@ void __iomem * __init efi_ioremap(unsigned long phys_addr, unsigned long size)
        }
 
        return (void __iomem *)__fix_to_virt(FIX_EFI_IO_MAP_FIRST_PAGE - \
-                                            (pages_mapped - pages));
+                                            (pages_mapped - pages)) + offset;
 }
index 9ba49a26dff8a25c5ad0e1adfb9c175e7cb3639e..f0f8934fc30324fc29af50dc436db6f14b198a93 100644 (file)
@@ -1,5 +1,4 @@
 /*
- *  linux/arch/i386/entry.S
  *
  *  Copyright (C) 1991, 1992  Linus Torvalds
  */
index 5d77c9cd8e15c6782e4a0872d5f8e4e820509395..ebf13908a743b6cd8cbdc231d0758f2388b92243 100644 (file)
@@ -61,26 +61,31 @@ int uv_wakeup_secondary(int phys_apicid, unsigned int start_rip)
        val = (1UL << UVH_IPI_INT_SEND_SHFT) |
            (phys_apicid << UVH_IPI_INT_APIC_ID_SHFT) |
            (((long)start_rip << UVH_IPI_INT_VECTOR_SHFT) >> 12) |
-           (6 << UVH_IPI_INT_DELIVERY_MODE_SHFT);
+           APIC_DM_INIT;
+       uv_write_global_mmr64(nasid, UVH_IPI_INT, val);
+       mdelay(10);
+
+       val = (1UL << UVH_IPI_INT_SEND_SHFT) |
+           (phys_apicid << UVH_IPI_INT_APIC_ID_SHFT) |
+           (((long)start_rip << UVH_IPI_INT_VECTOR_SHFT) >> 12) |
+           APIC_DM_STARTUP;
        uv_write_global_mmr64(nasid, UVH_IPI_INT, val);
        return 0;
 }
 
 static void uv_send_IPI_one(int cpu, int vector)
 {
-       unsigned long val, apicid;
+       unsigned long val, apicid, lapicid;
        int nasid;
 
        apicid = per_cpu(x86_cpu_to_apicid, cpu); /* ZZZ - cache node-local ? */
+       lapicid = apicid & 0x3f;                /* ZZZ macro needed */
        nasid = uv_apicid_to_nasid(apicid);
        val =
-           (1UL << UVH_IPI_INT_SEND_SHFT) | (apicid <<
+           (1UL << UVH_IPI_INT_SEND_SHFT) | (lapicid <<
                                              UVH_IPI_INT_APIC_ID_SHFT) |
            (vector << UVH_IPI_INT_VECTOR_SHFT);
        uv_write_global_mmr64(nasid, UVH_IPI_INT, val);
-       printk(KERN_DEBUG
-            "UV: IPI to cpu %d, apicid 0x%lx, vec %d, nasid%d, val 0x%lx\n",
-            cpu, apicid, vector, nasid, val);
 }
 
 static void uv_send_IPI_mask(cpumask_t mask, int vector)
index d6d54faa84dfb1020ea838896a2aca8ee18bda06..993c767732564afe285e7ddc23228511108b7b11 100644 (file)
@@ -146,6 +146,7 @@ void __init x86_64_start_kernel(char * real_mode_data)
 
        reserve_early(__pa_symbol(&_text), __pa_symbol(&_end), "TEXT DATA BSS");
 
+#ifdef CONFIG_BLK_DEV_INITRD
        /* Reserve INITRD */
        if (boot_params.hdr.type_of_loader && boot_params.hdr.ramdisk_image) {
                unsigned long ramdisk_image = boot_params.hdr.ramdisk_image;
@@ -153,6 +154,7 @@ void __init x86_64_start_kernel(char * real_mode_data)
                unsigned long ramdisk_end   = ramdisk_image + ramdisk_size;
                reserve_early(ramdisk_image, ramdisk_end, "RAMDISK");
        }
+#endif
 
        reserve_ebda_region();
 
index 826988a6e964717e623350efec94e03db932c798..90f038af3adc326725cbdec61825e1b31f340ebb 100644 (file)
@@ -1,5 +1,4 @@
 /*
- *  linux/arch/i386/kernel/head.S -- the 32-bit startup code.
  *
  *  Copyright (C) 1991, 1992  Linus Torvalds
  *
index 8f8102d967b3f4111c58be6dccbd6e4192fc3864..db6839b53195e1a83d9186a76bf9a05562fc39e6 100644 (file)
 #endif
 
 static unsigned int            mxcsr_feature_mask __read_mostly = 0xffffffffu;
+unsigned int xstate_size;
+static struct i387_fxsave_struct fx_scratch __cpuinitdata;
 
-void mxcsr_feature_mask_init(void)
+void __cpuinit mxcsr_feature_mask_init(void)
 {
        unsigned long mask = 0;
 
        clts();
        if (cpu_has_fxsr) {
-               memset(&current->thread.i387.fxsave, 0,
-                      sizeof(struct i387_fxsave_struct));
-               asm volatile("fxsave %0" : : "m" (current->thread.i387.fxsave));
-               mask = current->thread.i387.fxsave.mxcsr_mask;
+               memset(&fx_scratch, 0, sizeof(struct i387_fxsave_struct));
+               asm volatile("fxsave %0" : : "m" (fx_scratch));
+               mask = fx_scratch.mxcsr_mask;
                if (mask == 0)
                        mask = 0x0000ffbf;
        }
@@ -53,6 +54,16 @@ void mxcsr_feature_mask_init(void)
        stts();
 }
 
+void __init init_thread_xstate(void)
+{
+       if (cpu_has_fxsr)
+               xstate_size = sizeof(struct i387_fxsave_struct);
+#ifdef CONFIG_X86_32
+       else
+               xstate_size = sizeof(struct i387_fsave_struct);
+#endif
+}
+
 #ifdef CONFIG_X86_64
 /*
  * Called at bootup to set up the initial FPU state that is later cloned
@@ -61,10 +72,6 @@ void mxcsr_feature_mask_init(void)
 void __cpuinit fpu_init(void)
 {
        unsigned long oldcr0 = read_cr0();
-       extern void __bad_fxsave_alignment(void);
-
-       if (offsetof(struct task_struct, thread.i387.fxsave) & 15)
-               __bad_fxsave_alignment();
 
        set_in_cr4(X86_CR4_OSFXSR);
        set_in_cr4(X86_CR4_OSXMMEXCPT);
@@ -84,32 +91,44 @@ void __cpuinit fpu_init(void)
  * value at reset if we support XMM instructions and then
  * remeber the current task has used the FPU.
  */
-void init_fpu(struct task_struct *tsk)
+int init_fpu(struct task_struct *tsk)
 {
        if (tsk_used_math(tsk)) {
                if (tsk == current)
                        unlazy_fpu(tsk);
-               return;
+               return 0;
+       }
+
+       /*
+        * Memory allocation at the first usage of the FPU and other state.
+        */
+       if (!tsk->thread.xstate) {
+               tsk->thread.xstate = kmem_cache_alloc(task_xstate_cachep,
+                                                     GFP_KERNEL);
+               if (!tsk->thread.xstate)
+                       return -ENOMEM;
        }
 
        if (cpu_has_fxsr) {
-               memset(&tsk->thread.i387.fxsave, 0,
-                      sizeof(struct i387_fxsave_struct));
-               tsk->thread.i387.fxsave.cwd = 0x37f;
+               struct i387_fxsave_struct *fx = &tsk->thread.xstate->fxsave;
+
+               memset(fx, 0, xstate_size);
+               fx->cwd = 0x37f;
                if (cpu_has_xmm)
-                       tsk->thread.i387.fxsave.mxcsr = MXCSR_DEFAULT;
+                       fx->mxcsr = MXCSR_DEFAULT;
        } else {
-               memset(&tsk->thread.i387.fsave, 0,
-                      sizeof(struct i387_fsave_struct));
-               tsk->thread.i387.fsave.cwd = 0xffff037fu;
-               tsk->thread.i387.fsave.swd = 0xffff0000u;
-               tsk->thread.i387.fsave.twd = 0xffffffffu;
-               tsk->thread.i387.fsave.fos = 0xffff0000u;
+               struct i387_fsave_struct *fp = &tsk->thread.xstate->fsave;
+               memset(fp, 0, xstate_size);
+               fp->cwd = 0xffff037fu;
+               fp->swd = 0xffff0000u;
+               fp->twd = 0xffffffffu;
+               fp->fos = 0xffff0000u;
        }
        /*
         * Only the device not available exception or ptrace can call init_fpu.
         */
        set_stopped_child_used_math(tsk);
+       return 0;
 }
 
 int fpregs_active(struct task_struct *target, const struct user_regset *regset)
@@ -126,13 +145,17 @@ int xfpregs_get(struct task_struct *target, const struct user_regset *regset,
                unsigned int pos, unsigned int count,
                void *kbuf, void __user *ubuf)
 {
+       int ret;
+
        if (!cpu_has_fxsr)
                return -ENODEV;
 
-       init_fpu(target);
+       ret = init_fpu(target);
+       if (ret)
+               return ret;
 
        return user_regset_copyout(&pos, &count, &kbuf, &ubuf,
-                                  &target->thread.i387.fxsave, 0, -1);
+                                  &target->thread.xstate->fxsave, 0, -1);
 }
 
 int xfpregs_set(struct task_struct *target, const struct user_regset *regset,
@@ -144,16 +167,19 @@ int xfpregs_set(struct task_struct *target, const struct user_regset *regset,
        if (!cpu_has_fxsr)
                return -ENODEV;
 
-       init_fpu(target);
+       ret = init_fpu(target);
+       if (ret)
+               return ret;
+
        set_stopped_child_used_math(target);
 
        ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf,
-                                &target->thread.i387.fxsave, 0, -1);
+                                &target->thread.xstate->fxsave, 0, -1);
 
        /*
         * mxcsr reserved bits must be masked to zero for security reasons.
         */
-       target->thread.i387.fxsave.mxcsr &= mxcsr_feature_mask;
+       target->thread.xstate->fxsave.mxcsr &= mxcsr_feature_mask;
 
        return ret;
 }
@@ -233,7 +259,7 @@ static inline u32 twd_fxsr_to_i387(struct i387_fxsave_struct *fxsave)
 static void
 convert_from_fxsr(struct user_i387_ia32_struct *env, struct task_struct *tsk)
 {
-       struct i387_fxsave_struct *fxsave = &tsk->thread.i387.fxsave;
+       struct i387_fxsave_struct *fxsave = &tsk->thread.xstate->fxsave;
        struct _fpreg *to = (struct _fpreg *) &env->st_space[0];
        struct _fpxreg *from = (struct _fpxreg *) &fxsave->st_space[0];
        int i;
@@ -273,7 +299,7 @@ static void convert_to_fxsr(struct task_struct *tsk,
                            const struct user_i387_ia32_struct *env)
 
 {
-       struct i387_fxsave_struct *fxsave = &tsk->thread.i387.fxsave;
+       struct i387_fxsave_struct *fxsave = &tsk->thread.xstate->fxsave;
        struct _fpreg *from = (struct _fpreg *) &env->st_space[0];
        struct _fpxreg *to = (struct _fpxreg *) &fxsave->st_space[0];
        int i;
@@ -302,15 +328,19 @@ int fpregs_get(struct task_struct *target, const struct user_regset *regset,
               void *kbuf, void __user *ubuf)
 {
        struct user_i387_ia32_struct env;
+       int ret;
 
        if (!HAVE_HWFP)
                return fpregs_soft_get(target, regset, pos, count, kbuf, ubuf);
 
-       init_fpu(target);
+       ret = init_fpu(target);
+       if (ret)
+               return ret;
 
        if (!cpu_has_fxsr) {
                return user_regset_copyout(&pos, &count, &kbuf, &ubuf,
-                                          &target->thread.i387.fsave, 0, -1);
+                                          &target->thread.xstate->fsave, 0,
+                                          -1);
        }
 
        if (kbuf && pos == 0 && count == sizeof(env)) {
@@ -333,12 +363,15 @@ int fpregs_set(struct task_struct *target, const struct user_regset *regset,
        if (!HAVE_HWFP)
                return fpregs_soft_set(target, regset, pos, count, kbuf, ubuf);
 
-       init_fpu(target);
+       ret = init_fpu(target);
+       if (ret)
+               return ret;
+
        set_stopped_child_used_math(target);
 
        if (!cpu_has_fxsr) {
                return user_regset_copyin(&pos, &count, &kbuf, &ubuf,
-                                         &target->thread.i387.fsave, 0, -1);
+                                         &target->thread.xstate->fsave, 0, -1);
        }
 
        if (pos > 0 || count < sizeof(env))
@@ -358,11 +391,11 @@ int fpregs_set(struct task_struct *target, const struct user_regset *regset,
 static inline int save_i387_fsave(struct _fpstate_ia32 __user *buf)
 {
        struct task_struct *tsk = current;
+       struct i387_fsave_struct *fp = &tsk->thread.xstate->fsave;
 
        unlazy_fpu(tsk);
-       tsk->thread.i387.fsave.status = tsk->thread.i387.fsave.swd;
-       if (__copy_to_user(buf, &tsk->thread.i387.fsave,
-                          sizeof(struct i387_fsave_struct)))
+       fp->status = fp->swd;
+       if (__copy_to_user(buf, fp, sizeof(struct i387_fsave_struct)))
                return -1;
        return 1;
 }
@@ -370,6 +403,7 @@ static inline int save_i387_fsave(struct _fpstate_ia32 __user *buf)
 static int save_i387_fxsave(struct _fpstate_ia32 __user *buf)
 {
        struct task_struct *tsk = current;
+       struct i387_fxsave_struct *fx = &tsk->thread.xstate->fxsave;
        struct user_i387_ia32_struct env;
        int err = 0;
 
@@ -379,12 +413,12 @@ static int save_i387_fxsave(struct _fpstate_ia32 __user *buf)
        if (__copy_to_user(buf, &env, sizeof(env)))
                return -1;
 
-       err |= __put_user(tsk->thread.i387.fxsave.swd, &buf->status);
+       err |= __put_user(fx->swd, &buf->status);
        err |= __put_user(X86_FXSR_MAGIC, &buf->magic);
        if (err)
                return -1;
 
-       if (__copy_to_user(&buf->_fxsr_env[0], &tsk->thread.i387.fxsave,
+       if (__copy_to_user(&buf->_fxsr_env[0], fx,
                           sizeof(struct i387_fxsave_struct)))
                return -1;
        return 1;
@@ -417,7 +451,7 @@ static inline int restore_i387_fsave(struct _fpstate_ia32 __user *buf)
        struct task_struct *tsk = current;
 
        clear_fpu(tsk);
-       return __copy_from_user(&tsk->thread.i387.fsave, buf,
+       return __copy_from_user(&tsk->thread.xstate->fsave, buf,
                                sizeof(struct i387_fsave_struct));
 }
 
@@ -428,10 +462,10 @@ static int restore_i387_fxsave(struct _fpstate_ia32 __user *buf)
        int err;
 
        clear_fpu(tsk);
-       err = __copy_from_user(&tsk->thread.i387.fxsave, &buf->_fxsr_env[0],
+       err = __copy_from_user(&tsk->thread.xstate->fxsave, &buf->_fxsr_env[0],
                               sizeof(struct i387_fxsave_struct));
        /* mxcsr reserved bits must be masked to zero for security reasons */
-       tsk->thread.i387.fxsave.mxcsr &= mxcsr_feature_mask;
+       tsk->thread.xstate->fxsave.mxcsr &= mxcsr_feature_mask;
        if (err || __copy_from_user(&env, buf, sizeof(env)))
                return 1;
        convert_to_fxsr(tsk, &env);
index b54464b26658227413cbbd17b810cf77ed9a14d6..9ba11d07920f794c71e11de98d51d8430e129cf2 100644 (file)
@@ -785,7 +785,7 @@ static void __clear_irq_vector(int irq)
                per_cpu(vector_irq, cpu)[vector] = -1;
 
        cfg->vector = 0;
-       cfg->domain = CPU_MASK_NONE;
+       cpus_clear(cfg->domain);
 }
 
 void __setup_vector_irq(int cpu)
index 24362ecf5f9a9006f76698a2e410a48312904ed5..f47f0eb886b8ddeab27ec8a8fd319801c45ef503 100644 (file)
 #include <asm/apicdef.h>
 #include <asm/system.h>
 
-#ifdef CONFIG_X86_32
-# include <mach_ipi.h>
-#else
-# include <asm/mach_apic.h>
-#endif
+#include <mach_ipi.h>
 
 /*
  * Put the error code here just in case the user cares:
index 25cf6dee4e56f74befff8a9be9d3261caba2b0ea..69729e38b78a2d83e7f7e799bd2ea37730305d18 100644 (file)
@@ -402,7 +402,7 @@ static int do_microcode_update (void)
 
                        if (!uci->valid)
                                continue;
-                       set_cpus_allowed(current, cpumask_of_cpu(cpu));
+                       set_cpus_allowed_ptr(current, &cpumask_of_cpu(cpu));
                        error = get_maching_microcode(new_mc, cpu);
                        if (error < 0)
                                goto out;
@@ -416,7 +416,7 @@ out:
                vfree(new_mc);
        if (cursor < 0)
                error = cursor;
-       set_cpus_allowed(current, old);
+       set_cpus_allowed_ptr(current, &old);
        return error;
 }
 
@@ -579,7 +579,7 @@ static int apply_microcode_check_cpu(int cpu)
                return 0;
 
        old = current->cpus_allowed;
-       set_cpus_allowed(current, cpumask_of_cpu(cpu));
+       set_cpus_allowed_ptr(current, &cpumask_of_cpu(cpu));
 
        /* Check if the microcode we have in memory matches the CPU */
        if (c->x86_vendor != X86_VENDOR_INTEL || c->x86 < 6 ||
@@ -610,7 +610,7 @@ static int apply_microcode_check_cpu(int cpu)
                        " sig=0x%x, pf=0x%x, rev=0x%x\n",
                        cpu, uci->sig, uci->pf, uci->rev);
 
-       set_cpus_allowed(current, old);
+       set_cpus_allowed_ptr(current, &old);
        return err;
 }
 
@@ -621,13 +621,13 @@ static void microcode_init_cpu(int cpu, int resume)
 
        old = current->cpus_allowed;
 
-       set_cpus_allowed(current, cpumask_of_cpu(cpu));
+       set_cpus_allowed_ptr(current, &cpumask_of_cpu(cpu));
        mutex_lock(&microcode_mutex);
        collect_cpu_info(cpu);
        if (uci->valid && system_state == SYSTEM_RUNNING && !resume)
                cpu_request_microcode(cpu);
        mutex_unlock(&microcode_mutex);
-       set_cpus_allowed(current, old);
+       set_cpus_allowed_ptr(current, &old);
 }
 
 static void microcode_fini_cpu(int cpu)
@@ -657,14 +657,14 @@ static ssize_t reload_store(struct sys_device *dev, const char *buf, size_t sz)
                old = current->cpus_allowed;
 
                get_online_cpus();
-               set_cpus_allowed(current, cpumask_of_cpu(cpu));
+               set_cpus_allowed_ptr(current, &cpumask_of_cpu(cpu));
 
                mutex_lock(&microcode_mutex);
                if (uci->valid)
                        err = cpu_request_microcode(cpu);
                mutex_unlock(&microcode_mutex);
                put_online_cpus();
-               set_cpus_allowed(current, old);
+               set_cpus_allowed_ptr(current, &old);
        }
        if (err)
                return err;
index 4dfb4053005714bb222f19d821856ccb19cadd7a..1f3abe048e93ea3dd0aaa06225deb8a577904fc6 100644 (file)
@@ -162,12 +162,10 @@ static int __cpuinit msr_class_cpu_callback(struct notifier_block *nfb,
                err = msr_device_create(cpu);
                break;
        case CPU_UP_CANCELED:
+       case CPU_UP_CANCELED_FROZEN:
        case CPU_DEAD:
                msr_device_destroy(cpu);
                break;
-       case CPU_UP_CANCELED_FROZEN:
-               destroy_suspended_device(msr_class, MKDEV(MSR_MAJOR, cpu));
-               break;
        }
        return err ? NOTIFY_BAD : NOTIFY_OK;
 }
index 8421d0ac6f2200fbf91dcae68aceba921ea49cbd..11b14bbaa61e6be6cfb1ffe7fd5b4c8f69fd71a7 100644 (file)
@@ -321,7 +321,8 @@ EXPORT_SYMBOL(touch_nmi_watchdog);
 
 extern void die_nmi(struct pt_regs *, const char *msg);
 
-__kprobes int nmi_watchdog_tick(struct pt_regs * regs, unsigned reason)
+notrace __kprobes int
+nmi_watchdog_tick(struct pt_regs *regs, unsigned reason)
 {
 
        /*
index 11f9130ac513e732fb6f9832d3af32c07bd4bd05..5a29ded994fa345fb67f92cc19b9fa9dd5606cf8 100644 (file)
@@ -313,7 +313,8 @@ void touch_nmi_watchdog(void)
 }
 EXPORT_SYMBOL(touch_nmi_watchdog);
 
-int __kprobes nmi_watchdog_tick(struct pt_regs * regs, unsigned reason)
+notrace __kprobes int
+nmi_watchdog_tick(struct pt_regs *regs, unsigned reason)
 {
        int sum;
        int touched = 0;
@@ -384,7 +385,8 @@ int __kprobes nmi_watchdog_tick(struct pt_regs * regs, unsigned reason)
 
 static unsigned ignore_nmis;
 
-asmlinkage __kprobes void do_nmi(struct pt_regs * regs, long error_code)
+asmlinkage notrace __kprobes void
+do_nmi(struct pt_regs *regs, long error_code)
 {
        nmi_enter();
        add_pda(__nmi_count,1);
index 1b5464c2434f2fbe115816a6603fc3434dd55b96..adb91e4b62dad3d6ef51188eb8e628b2024755c2 100644 (file)
@@ -470,10 +470,11 @@ error:
        return 0;
 }
 
-static dma_addr_t calgary_map_single(struct device *dev, void *vaddr,
+static dma_addr_t calgary_map_single(struct device *dev, phys_addr_t paddr,
        size_t size, int direction)
 {
        dma_addr_t dma_handle = bad_dma_address;
+       void *vaddr = phys_to_virt(paddr);
        unsigned long uaddr;
        unsigned int npages;
        struct iommu_table *tbl = find_iommu_table(dev);
similarity index 55%
rename from arch/x86/kernel/pci-dma_64.c
rename to arch/x86/kernel/pci-dma.c
index ada5a0604992d7788a3fda58ec82e44a2c662804..388b113a7d88ffbc0efaf52c348412af9e439a8c 100644 (file)
-/*
- * Dynamic DMA mapping support.
- */
-
-#include <linux/types.h>
-#include <linux/mm.h>
-#include <linux/string.h>
-#include <linux/pci.h>
-#include <linux/module.h>
+#include <linux/dma-mapping.h>
 #include <linux/dmar.h>
-#include <asm/io.h>
+#include <linux/bootmem.h>
+#include <linux/pci.h>
+
+#include <asm/proto.h>
+#include <asm/dma.h>
 #include <asm/gart.h>
 #include <asm/calgary.h>
 
-int iommu_merge __read_mostly = 0;
-
-dma_addr_t bad_dma_address __read_mostly;
-EXPORT_SYMBOL(bad_dma_address);
+int forbid_dac __read_mostly;
+EXPORT_SYMBOL(forbid_dac);
 
-/* This tells the BIO block layer to assume merging. Default to off
-   because we cannot guarantee merging later. */
-int iommu_bio_merge __read_mostly = 0;
-EXPORT_SYMBOL(iommu_bio_merge);
+const struct dma_mapping_ops *dma_ops;
+EXPORT_SYMBOL(dma_ops);
 
-static int iommu_sac_force __read_mostly = 0;
+int iommu_sac_force __read_mostly = 0;
 
-int no_iommu __read_mostly;
 #ifdef CONFIG_IOMMU_DEBUG
 int panic_on_overflow __read_mostly = 1;
 int force_iommu __read_mostly = 1;
 #else
 int panic_on_overflow __read_mostly = 0;
-int force_iommu __read_mostly= 0;
+int force_iommu __read_mostly = 0;
 #endif
 
+int iommu_merge __read_mostly = 0;
+
+int no_iommu __read_mostly;
 /* Set this to 1 if there is a HW IOMMU in the system */
 int iommu_detected __read_mostly = 0;
 
+/* This tells the BIO block layer to assume merging. Default to off
+   because we cannot guarantee merging later. */
+int iommu_bio_merge __read_mostly = 0;
+EXPORT_SYMBOL(iommu_bio_merge);
+
+dma_addr_t bad_dma_address __read_mostly = 0;
+EXPORT_SYMBOL(bad_dma_address);
+
 /* Dummy device used for NULL arguments (normally ISA). Better would
    be probably a smaller DMA mask, but this is bug-to-bug compatible
-   to i386. */
+   to older i386. */
 struct device fallback_dev = {
        .bus_id = "fallback device",
        .coherent_dma_mask = DMA_32BIT_MASK,
        .dma_mask = &fallback_dev.coherent_dma_mask,
 };
 
+int dma_set_mask(struct device *dev, u64 mask)
+{
+       if (!dev->dma_mask || !dma_supported(dev, mask))
+               return -EIO;
+
+       *dev->dma_mask = mask;
+
+       return 0;
+}
+EXPORT_SYMBOL(dma_set_mask);
+
+#ifdef CONFIG_X86_64
+static __initdata void *dma32_bootmem_ptr;
+static unsigned long dma32_bootmem_size __initdata = (128ULL<<20);
+
+static int __init parse_dma32_size_opt(char *p)
+{
+       if (!p)
+               return -EINVAL;
+       dma32_bootmem_size = memparse(p, &p);
+       return 0;
+}
+early_param("dma32_size", parse_dma32_size_opt);
+
+void __init dma32_reserve_bootmem(void)
+{
+       unsigned long size, align;
+       if (end_pfn <= MAX_DMA32_PFN)
+               return;
+
+       align = 64ULL<<20;
+       size = round_up(dma32_bootmem_size, align);
+       dma32_bootmem_ptr = __alloc_bootmem_nopanic(size, align,
+                                __pa(MAX_DMA_ADDRESS));
+       if (dma32_bootmem_ptr)
+               dma32_bootmem_size = size;
+       else
+               dma32_bootmem_size = 0;
+}
+static void __init dma32_free_bootmem(void)
+{
+       int node;
+
+       if (end_pfn <= MAX_DMA32_PFN)
+               return;
+
+       if (!dma32_bootmem_ptr)
+               return;
+
+       for_each_online_node(node)
+               free_bootmem_node(NODE_DATA(node), __pa(dma32_bootmem_ptr),
+                                 dma32_bootmem_size);
+
+       dma32_bootmem_ptr = NULL;
+       dma32_bootmem_size = 0;
+}
+
+void __init pci_iommu_alloc(void)
+{
+       /* free the range so iommu could get some range less than 4G */
+       dma32_free_bootmem();
+       /*
+        * The order of these functions is important for
+        * fall-back/fail-over reasons
+        */
+#ifdef CONFIG_GART_IOMMU
+       gart_iommu_hole_init();
+#endif
+
+#ifdef CONFIG_CALGARY_IOMMU
+       detect_calgary();
+#endif
+
+       detect_intel_iommu();
+
+#ifdef CONFIG_SWIOTLB
+       pci_swiotlb_init();
+#endif
+}
+#endif
+
+/*
+ * See <Documentation/x86_64/boot-options.txt> for the iommu kernel parameter
+ * documentation.
+ */
+static __init int iommu_setup(char *p)
+{
+       iommu_merge = 1;
+
+       if (!p)
+               return -EINVAL;
+
+       while (*p) {
+               if (!strncmp(p, "off", 3))
+                       no_iommu = 1;
+               /* gart_parse_options has more force support */
+               if (!strncmp(p, "force", 5))
+                       force_iommu = 1;
+               if (!strncmp(p, "noforce", 7)) {
+                       iommu_merge = 0;
+                       force_iommu = 0;
+               }
+
+               if (!strncmp(p, "biomerge", 8)) {
+                       iommu_bio_merge = 4096;
+                       iommu_merge = 1;
+                       force_iommu = 1;
+               }
+               if (!strncmp(p, "panic", 5))
+                       panic_on_overflow = 1;
+               if (!strncmp(p, "nopanic", 7))
+                       panic_on_overflow = 0;
+               if (!strncmp(p, "merge", 5)) {
+                       iommu_merge = 1;
+                       force_iommu = 1;
+               }
+               if (!strncmp(p, "nomerge", 7))
+                       iommu_merge = 0;
+               if (!strncmp(p, "forcesac", 8))
+                       iommu_sac_force = 1;
+               if (!strncmp(p, "allowdac", 8))
+                       forbid_dac = 0;
+               if (!strncmp(p, "nodac", 5))
+                       forbid_dac = -1;
+               if (!strncmp(p, "usedac", 6)) {
+                       forbid_dac = -1;
+                       return 1;
+               }
+#ifdef CONFIG_SWIOTLB
+               if (!strncmp(p, "soft", 4))
+                       swiotlb = 1;
+#endif
+
+#ifdef CONFIG_GART_IOMMU
+               gart_parse_options(p);
+#endif
+
+#ifdef CONFIG_CALGARY_IOMMU
+               if (!strncmp(p, "calgary", 7))
+                       use_calgary = 1;
+#endif /* CONFIG_CALGARY_IOMMU */
+
+               p += strcspn(p, ",");
+               if (*p == ',')
+                       ++p;
+       }
+       return 0;
+}
+early_param("iommu", iommu_setup);
+
+#ifdef CONFIG_X86_32
+int dma_declare_coherent_memory(struct device *dev, dma_addr_t bus_addr,
+                               dma_addr_t device_addr, size_t size, int flags)
+{
+       void __iomem *mem_base = NULL;
+       int pages = size >> PAGE_SHIFT;
+       int bitmap_size = BITS_TO_LONGS(pages) * sizeof(long);
+
+       if ((flags & (DMA_MEMORY_MAP | DMA_MEMORY_IO)) == 0)
+               goto out;
+       if (!size)
+               goto out;
+       if (dev->dma_mem)
+               goto out;
+
+       /* FIXME: this routine just ignores DMA_MEMORY_INCLUDES_CHILDREN */
+
+       mem_base = ioremap(bus_addr, size);
+       if (!mem_base)
+               goto out;
+
+       dev->dma_mem = kzalloc(sizeof(struct dma_coherent_mem), GFP_KERNEL);
+       if (!dev->dma_mem)
+               goto out;
+       dev->dma_mem->bitmap = kzalloc(bitmap_size, GFP_KERNEL);
+       if (!dev->dma_mem->bitmap)
+               goto free1_out;
+
+       dev->dma_mem->virt_base = mem_base;
+       dev->dma_mem->device_base = device_addr;
+       dev->dma_mem->size = pages;
+       dev->dma_mem->flags = flags;
+
+       if (flags & DMA_MEMORY_MAP)
+               return DMA_MEMORY_MAP;
+
+       return DMA_MEMORY_IO;
+
+ free1_out:
+       kfree(dev->dma_mem);
+ out:
+       if (mem_base)
+               iounmap(mem_base);
+       return 0;
+}
+EXPORT_SYMBOL(dma_declare_coherent_memory);
+
+void dma_release_declared_memory(struct device *dev)
+{
+       struct dma_coherent_mem *mem = dev->dma_mem;
+
+       if (!mem)
+               return;
+       dev->dma_mem = NULL;
+       iounmap(mem->virt_base);
+       kfree(mem->bitmap);
+       kfree(mem);
+}
+EXPORT_SYMBOL(dma_release_declared_memory);
+
+void *dma_mark_declared_memory_occupied(struct device *dev,
+                                       dma_addr_t device_addr, size_t size)
+{
+       struct dma_coherent_mem *mem = dev->dma_mem;
+       int pos, err;
+       int pages = (size + (device_addr & ~PAGE_MASK) + PAGE_SIZE - 1);
+
+       pages >>= PAGE_SHIFT;
+
+       if (!mem)
+               return ERR_PTR(-EINVAL);
+
+       pos = (device_addr - mem->device_base) >> PAGE_SHIFT;
+       err = bitmap_allocate_region(mem->bitmap, pos, get_order(pages));
+       if (err != 0)
+               return ERR_PTR(err);
+       return mem->virt_base + (pos << PAGE_SHIFT);
+}
+EXPORT_SYMBOL(dma_mark_declared_memory_occupied);
+
+static int dma_alloc_from_coherent_mem(struct device *dev, ssize_t size,
+                                      dma_addr_t *dma_handle, void **ret)
+{
+       struct dma_coherent_mem *mem = dev ? dev->dma_mem : NULL;
+       int order = get_order(size);
+
+       if (mem) {
+               int page = bitmap_find_free_region(mem->bitmap, mem->size,
+                                                    order);
+               if (page >= 0) {
+                       *dma_handle = mem->device_base + (page << PAGE_SHIFT);
+                       *ret = mem->virt_base + (page << PAGE_SHIFT);
+                       memset(*ret, 0, size);
+               }
+               if (mem->flags & DMA_MEMORY_EXCLUSIVE)
+                       *ret = NULL;
+       }
+       return (mem != NULL);
+}
+
+static int dma_release_coherent(struct device *dev, int order, void *vaddr)
+{
+       struct dma_coherent_mem *mem = dev ? dev->dma_mem : NULL;
+
+       if (mem && vaddr >= mem->virt_base && vaddr <
+                  (mem->virt_base + (mem->size << PAGE_SHIFT))) {
+               int page = (vaddr - mem->virt_base) >> PAGE_SHIFT;
+
+               bitmap_release_region(mem->bitmap, page, order);
+               return 1;
+       }
+       return 0;
+}
+#else
+#define dma_alloc_from_coherent_mem(dev, size, handle, ret) (0)
+#define dma_release_coherent(dev, order, vaddr) (0)
+#endif /* CONFIG_X86_32 */
+
+int dma_supported(struct device *dev, u64 mask)
+{
+#ifdef CONFIG_PCI
+       if (mask > 0xffffffff && forbid_dac > 0) {
+               printk(KERN_INFO "PCI: Disallowing DAC for device %s\n",
+                                dev->bus_id);
+               return 0;
+       }
+#endif
+
+       if (dma_ops->dma_supported)
+               return dma_ops->dma_supported(dev, mask);
+
+       /* Copied from i386. Doesn't make much sense, because it will
+          only work for pci_alloc_coherent.
+          The caller just has to use GFP_DMA in this case. */
+       if (mask < DMA_24BIT_MASK)
+               return 0;
+
+       /* Tell the device to use SAC when IOMMU force is on.  This
+          allows the driver to use cheaper accesses in some cases.
+
+          Problem with this is that if we overflow the IOMMU area and
+          return DAC as fallback address the device may not handle it
+          correctly.
+
+          As a special case some controllers have a 39bit address
+          mode that is as efficient as 32bit (aic79xx). Don't force
+          SAC for these.  Assume all masks <= 40 bits are of this
+          type. Normally this doesn't make any difference, but gives
+          more gentle handling of IOMMU overflow. */
+       if (iommu_sac_force && (mask >= DMA_40BIT_MASK)) {
+               printk(KERN_INFO "%s: Force SAC with mask %Lx\n",
+                                dev->bus_id, mask);
+               return 0;
+       }
+
+       return 1;
+}
+EXPORT_SYMBOL(dma_supported);
+
 /* Allocate DMA memory on node near device */
-noinline static void *
+noinline struct page *
 dma_alloc_pages(struct device *dev, gfp_t gfp, unsigned order)
 {
-       struct page *page;
        int node;
 
        node = dev_to_node(dev);
 
-       page = alloc_pages_node(node, gfp, order);
-       return page ? page_address(page) : NULL;
+       return alloc_pages_node(node, gfp, order);
 }
 
 /*
@@ -65,9 +374,16 @@ void *
 dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle,
                   gfp_t gfp)
 {
-       void *memory;
+       void *memory = NULL;
+       struct page *page;
        unsigned long dma_mask = 0;
-       u64 bus;
+       dma_addr_t bus;
+
+       /* ignore region specifiers */
+       gfp &= ~(__GFP_DMA | __GFP_HIGHMEM | __GFP_DMA32);
+
+       if (dma_alloc_from_coherent_mem(dev, size, dma_handle, &memory))
+               return memory;
 
        if (!dev)
                dev = &fallback_dev;
@@ -82,26 +398,25 @@ dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle,
        /* Don't invoke OOM killer */
        gfp |= __GFP_NORETRY;
 
-       /* Kludge to make it bug-to-bug compatible with i386. i386
-          uses the normal dma_mask for alloc_coherent. */
-       dma_mask &= *dev->dma_mask;
-
+#ifdef CONFIG_X86_64
        /* Why <=? Even when the mask is smaller than 4GB it is often
           larger than 16MB and in this case we have a chance of
           finding fitting memory in the next higher zone first. If
           not retry with true GFP_DMA. -AK */
        if (dma_mask <= DMA_32BIT_MASK)
                gfp |= GFP_DMA32;
+#endif
 
  again:
-       memory = dma_alloc_pages(dev, gfp, get_order(size));
-       if (memory == NULL)
+       page = dma_alloc_pages(dev, gfp, get_order(size));
+       if (page == NULL)
                return NULL;
 
        {
                int high, mmu;
-               bus = virt_to_bus(memory);
-               high = (bus + size) >= dma_mask;
+               bus = page_to_phys(page);
+               memory = page_address(page);
+               high = (bus + size) >= dma_mask;
                mmu = high;
                if (force_iommu && !(gfp & GFP_DMA))
                        mmu = 1;
@@ -127,7 +442,7 @@ dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle,
 
                memset(memory, 0, size);
                if (!mmu) {
-                       *dma_handle = virt_to_bus(memory);
+                       *dma_handle = bus;
                        return memory;
                }
        }
@@ -139,7 +454,7 @@ dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle,
        }
 
        if (dma_ops->map_simple) {
-               *dma_handle = dma_ops->map_simple(dev, memory,
+               *dma_handle = dma_ops->map_simple(dev, virt_to_phys(memory),
                                              size,
                                              PCI_DMA_BIDIRECTIONAL);
                if (*dma_handle != bad_dma_address)
@@ -147,7 +462,8 @@ dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle,
        }
 
        if (panic_on_overflow)
-               panic("dma_alloc_coherent: IOMMU overflow by %lu bytes\n",size);
+               panic("dma_alloc_coherent: IOMMU overflow by %lu bytes\n",
+                     (unsigned long)size);
        free_pages((unsigned long)memory, get_order(size));
        return NULL;
 }
@@ -160,153 +476,16 @@ EXPORT_SYMBOL(dma_alloc_coherent);
 void dma_free_coherent(struct device *dev, size_t size,
                         void *vaddr, dma_addr_t bus)
 {
+       int order = get_order(size);
        WARN_ON(irqs_disabled());       /* for portability */
+       if (dma_release_coherent(dev, order, vaddr))
+               return;
        if (dma_ops->unmap_single)
                dma_ops->unmap_single(dev, bus, size, 0);
-       free_pages((unsigned long)vaddr, get_order(size));
+       free_pages((unsigned long)vaddr, order);
 }
 EXPORT_SYMBOL(dma_free_coherent);
 
-static int forbid_dac __read_mostly;
-
-int dma_supported(struct device *dev, u64 mask)
-{
-#ifdef CONFIG_PCI
-       if (mask > 0xffffffff && forbid_dac > 0) {
-
-
-
-               printk(KERN_INFO "PCI: Disallowing DAC for device %s\n", dev->bus_id);
-               return 0;
-       }
-#endif
-
-       if (dma_ops->dma_supported)
-               return dma_ops->dma_supported(dev, mask);
-
-       /* Copied from i386. Doesn't make much sense, because it will
-          only work for pci_alloc_coherent.
-          The caller just has to use GFP_DMA in this case. */
-        if (mask < DMA_24BIT_MASK)
-                return 0;
-
-       /* Tell the device to use SAC when IOMMU force is on.  This
-          allows the driver to use cheaper accesses in some cases.
-
-          Problem with this is that if we overflow the IOMMU area and
-          return DAC as fallback address the device may not handle it
-          correctly.
-
-          As a special case some controllers have a 39bit address
-          mode that is as efficient as 32bit (aic79xx). Don't force
-          SAC for these.  Assume all masks <= 40 bits are of this
-          type. Normally this doesn't make any difference, but gives
-          more gentle handling of IOMMU overflow. */
-       if (iommu_sac_force && (mask >= DMA_40BIT_MASK)) {
-               printk(KERN_INFO "%s: Force SAC with mask %Lx\n", dev->bus_id,mask);
-               return 0;
-       }
-
-       return 1;
-}
-EXPORT_SYMBOL(dma_supported);
-
-int dma_set_mask(struct device *dev, u64 mask)
-{
-       if (!dev->dma_mask || !dma_supported(dev, mask))
-               return -EIO;
-       *dev->dma_mask = mask;
-       return 0;
-}
-EXPORT_SYMBOL(dma_set_mask);
-
-/*
- * See <Documentation/x86_64/boot-options.txt> for the iommu kernel parameter
- * documentation.
- */
-static __init int iommu_setup(char *p)
-{
-       iommu_merge = 1;
-
-       if (!p)
-               return -EINVAL;
-
-       while (*p) {
-               if (!strncmp(p, "off", 3))
-                       no_iommu = 1;
-               /* gart_parse_options has more force support */
-               if (!strncmp(p, "force", 5))
-                       force_iommu = 1;
-               if (!strncmp(p, "noforce", 7)) {
-                       iommu_merge = 0;
-                       force_iommu = 0;
-               }
-
-               if (!strncmp(p, "biomerge", 8)) {
-                       iommu_bio_merge = 4096;
-                       iommu_merge = 1;
-                       force_iommu = 1;
-               }
-               if (!strncmp(p, "panic", 5))
-                       panic_on_overflow = 1;
-               if (!strncmp(p, "nopanic", 7))
-                       panic_on_overflow = 0;
-               if (!strncmp(p, "merge", 5)) {
-                       iommu_merge = 1;
-                       force_iommu = 1;
-               }
-               if (!strncmp(p, "nomerge", 7))
-                       iommu_merge = 0;
-               if (!strncmp(p, "forcesac", 8))
-                       iommu_sac_force = 1;
-               if (!strncmp(p, "allowdac", 8))
-                       forbid_dac = 0;
-               if (!strncmp(p, "nodac", 5))
-                       forbid_dac = -1;
-
-#ifdef CONFIG_SWIOTLB
-               if (!strncmp(p, "soft", 4))
-                       swiotlb = 1;
-#endif
-
-#ifdef CONFIG_GART_IOMMU
-               gart_parse_options(p);
-#endif
-
-#ifdef CONFIG_CALGARY_IOMMU
-               if (!strncmp(p, "calgary", 7))
-                       use_calgary = 1;
-#endif /* CONFIG_CALGARY_IOMMU */
-
-               p += strcspn(p, ",");
-               if (*p == ',')
-                       ++p;
-       }
-       return 0;
-}
-early_param("iommu", iommu_setup);
-
-void __init pci_iommu_alloc(void)
-{
-       /*
-        * The order of these functions is important for
-        * fall-back/fail-over reasons
-        */
-#ifdef CONFIG_GART_IOMMU
-       gart_iommu_hole_init();
-#endif
-
-#ifdef CONFIG_CALGARY_IOMMU
-       detect_calgary();
-#endif
-
-       detect_intel_iommu();
-
-#ifdef CONFIG_SWIOTLB
-       pci_swiotlb_init();
-#endif
-}
-
 static int __init pci_iommu_init(void)
 {
 #ifdef CONFIG_CALGARY_IOMMU
@@ -327,6 +506,8 @@ void pci_iommu_shutdown(void)
 {
        gart_iommu_shutdown();
 }
+/* Must execute after PCI subsystem */
+fs_initcall(pci_iommu_init);
 
 #ifdef CONFIG_PCI
 /* Many VIA bridges seem to corrupt data for DAC. Disable it here */
@@ -334,11 +515,10 @@ void pci_iommu_shutdown(void)
 static __devinit void via_no_dac(struct pci_dev *dev)
 {
        if ((dev->class >> 8) == PCI_CLASS_BRIDGE_PCI && forbid_dac == 0) {
-               printk(KERN_INFO "PCI: VIA PCI bridge detected. Disabling DAC.\n");
+               printk(KERN_INFO "PCI: VIA PCI bridge detected."
+                                "Disabling DAC.\n");
                forbid_dac = 1;
        }
 }
 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_VIA, PCI_ANY_ID, via_no_dac);
 #endif
-/* Must execute after PCI subsystem */
-fs_initcall(pci_iommu_init);
diff --git a/arch/x86/kernel/pci-dma_32.c b/arch/x86/kernel/pci-dma_32.c
deleted file mode 100644 (file)
index 5133032..0000000
+++ /dev/null
@@ -1,177 +0,0 @@
-/*
- * Dynamic DMA mapping support.
- *
- * On i386 there is no hardware dynamic DMA address translation,
- * so consistent alloc/free are merely page allocation/freeing.
- * The rest of the dynamic DMA mapping interface is implemented
- * in asm/pci.h.
- */
-
-#include <linux/types.h>
-#include <linux/mm.h>
-#include <linux/string.h>
-#include <linux/pci.h>
-#include <linux/module.h>
-#include <asm/io.h>
-
-struct dma_coherent_mem {
-       void            *virt_base;
-       u32             device_base;
-       int             size;
-       int             flags;
-       unsigned long   *bitmap;
-};
-
-void *dma_alloc_coherent(struct device *dev, size_t size,
-                          dma_addr_t *dma_handle, gfp_t gfp)
-{
-       void *ret;
-       struct dma_coherent_mem *mem = dev ? dev->dma_mem : NULL;
-       int order = get_order(size);
-       /* ignore region specifiers */
-       gfp &= ~(__GFP_DMA | __GFP_HIGHMEM);
-
-       if (mem) {
-               int page = bitmap_find_free_region(mem->bitmap, mem->size,
-                                                    order);
-               if (page >= 0) {
-                       *dma_handle = mem->device_base + (page << PAGE_SHIFT);
-                       ret = mem->virt_base + (page << PAGE_SHIFT);
-                       memset(ret, 0, size);
-                       return ret;
-               }
-               if (mem->flags & DMA_MEMORY_EXCLUSIVE)
-                       return NULL;
-       }
-
-       if (dev == NULL || (dev->coherent_dma_mask < 0xffffffff))
-               gfp |= GFP_DMA;
-
-       ret = (void *)__get_free_pages(gfp, order);
-
-       if (ret != NULL) {
-               memset(ret, 0, size);
-               *dma_handle = virt_to_phys(ret);
-       }
-       return ret;
-}
-EXPORT_SYMBOL(dma_alloc_coherent);
-
-void dma_free_coherent(struct device *dev, size_t size,
-                        void *vaddr, dma_addr_t dma_handle)
-{
-       struct dma_coherent_mem *mem = dev ? dev->dma_mem : NULL;
-       int order = get_order(size);
-
-       WARN_ON(irqs_disabled());       /* for portability */
-       if (mem && vaddr >= mem->virt_base && vaddr < (mem->virt_base + (mem->size << PAGE_SHIFT))) {
-               int page = (vaddr - mem->virt_base) >> PAGE_SHIFT;
-
-               bitmap_release_region(mem->bitmap, page, order);
-       } else
-               free_pages((unsigned long)vaddr, order);
-}
-EXPORT_SYMBOL(dma_free_coherent);
-
-int dma_declare_coherent_memory(struct device *dev, dma_addr_t bus_addr,
-                               dma_addr_t device_addr, size_t size, int flags)
-{
-       void __iomem *mem_base = NULL;
-       int pages = size >> PAGE_SHIFT;
-       int bitmap_size = BITS_TO_LONGS(pages) * sizeof(long);
-
-       if ((flags & (DMA_MEMORY_MAP | DMA_MEMORY_IO)) == 0)
-               goto out;
-       if (!size)
-               goto out;
-       if (dev->dma_mem)
-               goto out;
-
-       /* FIXME: this routine just ignores DMA_MEMORY_INCLUDES_CHILDREN */
-
-       mem_base = ioremap(bus_addr, size);
-       if (!mem_base)
-               goto out;
-
-       dev->dma_mem = kzalloc(sizeof(struct dma_coherent_mem), GFP_KERNEL);
-       if (!dev->dma_mem)
-               goto out;
-       dev->dma_mem->bitmap = kzalloc(bitmap_size, GFP_KERNEL);
-       if (!dev->dma_mem->bitmap)
-               goto free1_out;
-
-       dev->dma_mem->virt_base = mem_base;
-       dev->dma_mem->device_base = device_addr;
-       dev->dma_mem->size = pages;
-       dev->dma_mem->flags = flags;
-
-       if (flags & DMA_MEMORY_MAP)
-               return DMA_MEMORY_MAP;
-
-       return DMA_MEMORY_IO;
-
- free1_out:
-       kfree(dev->dma_mem);
- out:
-       if (mem_base)
-               iounmap(mem_base);
-       return 0;
-}
-EXPORT_SYMBOL(dma_declare_coherent_memory);
-
-void dma_release_declared_memory(struct device *dev)
-{
-       struct dma_coherent_mem *mem = dev->dma_mem;
-       
-       if(!mem)
-               return;
-       dev->dma_mem = NULL;
-       iounmap(mem->virt_base);
-       kfree(mem->bitmap);
-       kfree(mem);
-}
-EXPORT_SYMBOL(dma_release_declared_memory);
-
-void *dma_mark_declared_memory_occupied(struct device *dev,
-                                       dma_addr_t device_addr, size_t size)
-{
-       struct dma_coherent_mem *mem = dev->dma_mem;
-       int pages = (size + (device_addr & ~PAGE_MASK) + PAGE_SIZE - 1) >> PAGE_SHIFT;
-       int pos, err;
-
-       if (!mem)
-               return ERR_PTR(-EINVAL);
-
-       pos = (device_addr - mem->device_base) >> PAGE_SHIFT;
-       err = bitmap_allocate_region(mem->bitmap, pos, get_order(pages));
-       if (err != 0)
-               return ERR_PTR(err);
-       return mem->virt_base + (pos << PAGE_SHIFT);
-}
-EXPORT_SYMBOL(dma_mark_declared_memory_occupied);
-
-#ifdef CONFIG_PCI
-/* Many VIA bridges seem to corrupt data for DAC. Disable it here */
-
-int forbid_dac;
-EXPORT_SYMBOL(forbid_dac);
-
-static __devinit void via_no_dac(struct pci_dev *dev)
-{
-       if ((dev->class >> 8) == PCI_CLASS_BRIDGE_PCI && forbid_dac == 0) {
-               printk(KERN_INFO "PCI: VIA PCI bridge detected. Disabling DAC.\n");
-               forbid_dac = 1;
-       }
-}
-DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_VIA, PCI_ANY_ID, via_no_dac);
-
-static int check_iommu(char *s)
-{
-       if (!strcmp(s, "usedac")) {
-               forbid_dac = -1;
-               return 1;
-       }
-       return 0;
-}
-__setup("iommu=", check_iommu);
-#endif
index 700e4647dd30214ba33b90845f4121421515948d..c07455d1695f531843df8bf165ce5131bb1ca836 100644 (file)
@@ -264,9 +264,9 @@ static dma_addr_t dma_map_area(struct device *dev, dma_addr_t phys_mem,
 }
 
 static dma_addr_t
-gart_map_simple(struct device *dev, char *buf, size_t size, int dir)
+gart_map_simple(struct device *dev, phys_addr_t paddr, size_t size, int dir)
 {
-       dma_addr_t map = dma_map_area(dev, virt_to_bus(buf), size, dir);
+       dma_addr_t map = dma_map_area(dev, paddr, size, dir);
 
        flush_gart();
 
@@ -275,18 +275,17 @@ gart_map_simple(struct device *dev, char *buf, size_t size, int dir)
 
 /* Map a single area into the IOMMU */
 static dma_addr_t
-gart_map_single(struct device *dev, void *addr, size_t size, int dir)
+gart_map_single(struct device *dev, phys_addr_t paddr, size_t size, int dir)
 {
-       unsigned long phys_mem, bus;
+       unsigned long bus;
 
        if (!dev)
                dev = &fallback_dev;
 
-       phys_mem = virt_to_phys(addr);
-       if (!need_iommu(dev, phys_mem, size))
-               return phys_mem;
+       if (!need_iommu(dev, paddr, size))
+               return paddr;
 
-       bus = gart_map_simple(dev, addr, size, dir);
+       bus = gart_map_simple(dev, paddr, size, dir);
 
        return bus;
 }
similarity index 77%
rename from arch/x86/kernel/pci-nommu_64.c
rename to arch/x86/kernel/pci-nommu.c
index ab08e1832228a74869bc6e7aeb517b0e29e8b044..aec43d56f49c57cedffaefad7205fbbfe9b984c2 100644 (file)
@@ -14,7 +14,7 @@
 static int
 check_addr(char *name, struct device *hwdev, dma_addr_t bus, size_t size)
 {
-        if (hwdev && bus + size > *hwdev->dma_mask) {
+       if (hwdev && bus + size > *hwdev->dma_mask) {
                if (*hwdev->dma_mask >= DMA_32BIT_MASK)
                        printk(KERN_ERR
                            "nommu_%s: overflow %Lx+%zu of device mask %Lx\n",
@@ -26,19 +26,17 @@ check_addr(char *name, struct device *hwdev, dma_addr_t bus, size_t size)
 }
 
 static dma_addr_t
-nommu_map_single(struct device *hwdev, void *ptr, size_t size,
+nommu_map_single(struct device *hwdev, phys_addr_t paddr, size_t size,
               int direction)
 {
-       dma_addr_t bus = virt_to_bus(ptr);
+       dma_addr_t bus = paddr;
+       WARN_ON(size == 0);
        if (!check_addr("map_single", hwdev, bus, size))
                                return bad_dma_address;
+       flush_write_buffers();
        return bus;
 }
 
-static void nommu_unmap_single(struct device *dev, dma_addr_t addr,size_t size,
-                       int direction)
-{
-}
 
 /* Map a set of buffers described by scatterlist in streaming
  * mode for DMA.  This is the scatter-gather version of the
@@ -61,30 +59,34 @@ static int nommu_map_sg(struct device *hwdev, struct scatterlist *sg,
        struct scatterlist *s;
        int i;
 
+       WARN_ON(nents == 0 || sg[0].length == 0);
+
        for_each_sg(sg, s, nents, i) {
                BUG_ON(!sg_page(s));
-               s->dma_address = virt_to_bus(sg_virt(s));
+               s->dma_address = sg_phys(s);
                if (!check_addr("map_sg", hwdev, s->dma_address, s->length))
                        return 0;
                s->dma_length = s->length;
        }
+       flush_write_buffers();
        return nents;
 }
 
-/* Unmap a set of streaming mode DMA translations.
- * Again, cpu read rules concerning calls here are the same as for
- * pci_unmap_single() above.
- */
-static void nommu_unmap_sg(struct device *dev, struct scatterlist *sg,
-                 int nents, int dir)
+/* Make sure we keep the same behaviour */
+static int nommu_mapping_error(dma_addr_t dma_addr)
 {
+#ifdef CONFIG_X86_32
+       return 0;
+#else
+       return (dma_addr == bad_dma_address);
+#endif
 }
 
+
 const struct dma_mapping_ops nommu_dma_ops = {
        .map_single = nommu_map_single,
-       .unmap_single = nommu_unmap_single,
        .map_sg = nommu_map_sg,
-       .unmap_sg = nommu_unmap_sg,
+       .mapping_error = nommu_mapping_error,
        .is_phys = 1,
 };
 
index 82a0a674a003f815b5d98cd540e56e26f4c332df..490da7f4b8d0dd8e29abf7ddd2e11b01fe19f196 100644 (file)
 
 int swiotlb __read_mostly;
 
+static dma_addr_t
+swiotlb_map_single_phys(struct device *hwdev, phys_addr_t paddr, size_t size,
+                       int direction)
+{
+       return swiotlb_map_single(hwdev, phys_to_virt(paddr), size, direction);
+}
+
 const struct dma_mapping_ops swiotlb_dma_ops = {
        .mapping_error = swiotlb_dma_mapping_error,
        .alloc_coherent = swiotlb_alloc_coherent,
        .free_coherent = swiotlb_free_coherent,
-       .map_single = swiotlb_map_single,
+       .map_single = swiotlb_map_single_phys,
        .unmap_single = swiotlb_unmap_single,
        .sync_single_for_cpu = swiotlb_sync_single_for_cpu,
        .sync_single_for_device = swiotlb_sync_single_for_device,
diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c
new file mode 100644 (file)
index 0000000..3004d71
--- /dev/null
@@ -0,0 +1,44 @@
+#include <linux/errno.h>
+#include <linux/kernel.h>
+#include <linux/mm.h>
+#include <linux/smp.h>
+#include <linux/slab.h>
+#include <linux/sched.h>
+
+struct kmem_cache *task_xstate_cachep;
+
+int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src)
+{
+       *dst = *src;
+       if (src->thread.xstate) {
+               dst->thread.xstate = kmem_cache_alloc(task_xstate_cachep,
+                                                     GFP_KERNEL);
+               if (!dst->thread.xstate)
+                       return -ENOMEM;
+               WARN_ON((unsigned long)dst->thread.xstate & 15);
+               memcpy(dst->thread.xstate, src->thread.xstate, xstate_size);
+       }
+       return 0;
+}
+
+void free_thread_xstate(struct task_struct *tsk)
+{
+       if (tsk->thread.xstate) {
+               kmem_cache_free(task_xstate_cachep, tsk->thread.xstate);
+               tsk->thread.xstate = NULL;
+       }
+}
+
+void free_thread_info(struct thread_info *ti)
+{
+       free_thread_xstate(ti->task);
+       free_pages((unsigned long)ti, get_order(THREAD_SIZE));
+}
+
+void arch_task_cache_init(void)
+{
+        task_xstate_cachep =
+               kmem_cache_create("task_xstate", xstate_size,
+                                 __alignof__(union thread_xstate),
+                                 SLAB_PANIC, NULL);
+}
index 3903a8f2eb978f2d9c6676c8f1bc9813d749fae9..7adad088e373fbf4bf5523dcf70f22665331b105 100644 (file)
@@ -36,6 +36,7 @@
 #include <linux/personality.h>
 #include <linux/tick.h>
 #include <linux/percpu.h>
+#include <linux/prctl.h>
 
 #include <asm/uaccess.h>
 #include <asm/pgtable.h>
@@ -45,7 +46,6 @@
 #include <asm/processor.h>
 #include <asm/i387.h>
 #include <asm/desc.h>
-#include <asm/vm86.h>
 #ifdef CONFIG_MATH_EMULATION
 #include <asm/math_emu.h>
 #endif
@@ -521,14 +521,18 @@ start_thread(struct pt_regs *regs, unsigned long new_ip, unsigned long new_sp)
        regs->cs                = __USER_CS;
        regs->ip                = new_ip;
        regs->sp                = new_sp;
+       /*
+        * Free the old FP and other extended state
+        */
+       free_thread_xstate(current);
 }
 EXPORT_SYMBOL_GPL(start_thread);
 
-#ifdef CONFIG_SECCOMP
 static void hard_disable_TSC(void)
 {
        write_cr4(read_cr4() | X86_CR4_TSD);
 }
+
 void disable_TSC(void)
 {
        preempt_disable();
@@ -540,11 +544,47 @@ void disable_TSC(void)
                hard_disable_TSC();
        preempt_enable();
 }
+
 static void hard_enable_TSC(void)
 {
        write_cr4(read_cr4() & ~X86_CR4_TSD);
 }
-#endif /* CONFIG_SECCOMP */
+
+void enable_TSC(void)
+{
+       preempt_disable();
+       if (test_and_clear_thread_flag(TIF_NOTSC))
+               /*
+                * Must flip the CPU state synchronously with
+                * TIF_NOTSC in the current running context.
+                */
+               hard_enable_TSC();
+       preempt_enable();
+}
+
+int get_tsc_mode(unsigned long adr)
+{
+       unsigned int val;
+
+       if (test_thread_flag(TIF_NOTSC))
+               val = PR_TSC_SIGSEGV;
+       else
+               val = PR_TSC_ENABLE;
+
+       return put_user(val, (unsigned int __user *)adr);
+}
+
+int set_tsc_mode(unsigned int val)
+{
+       if (val == PR_TSC_SIGSEGV)
+               disable_TSC();
+       else if (val == PR_TSC_ENABLE)
+               enable_TSC();
+       else
+               return -EINVAL;
+
+       return 0;
+}
 
 static noinline void
 __switch_to_xtra(struct task_struct *prev_p, struct task_struct *next_p,
@@ -578,7 +618,6 @@ __switch_to_xtra(struct task_struct *prev_p, struct task_struct *next_p,
                set_debugreg(next->debugreg7, 7);
        }
 
-#ifdef CONFIG_SECCOMP
        if (test_tsk_thread_flag(prev_p, TIF_NOTSC) ^
            test_tsk_thread_flag(next_p, TIF_NOTSC)) {
                /* prev and next are different */
@@ -587,7 +626,6 @@ __switch_to_xtra(struct task_struct *prev_p, struct task_struct *next_p,
                else
                        hard_enable_TSC();
        }
-#endif
 
 #ifdef X86_BTS
        if (test_tsk_thread_flag(prev_p, TIF_BTS_TRACE_TS))
@@ -669,7 +707,7 @@ struct task_struct * __switch_to(struct task_struct *prev_p, struct task_struct
 
        /* we're going to use this soon, after a few expensive things */
        if (next_p->fpu_counter > 5)
-               prefetch(&next->i387.fxsave);
+               prefetch(next->xstate);
 
        /*
         * Reload esp0.
index e75ccc8a2b87b7e659e0ee4c8ad74459239b98bb..891af1a1b48a5cbf0ef303d9f1b5c5601b485869 100644 (file)
@@ -36,6 +36,7 @@
 #include <linux/kprobes.h>
 #include <linux/kdebug.h>
 #include <linux/tick.h>
+#include <linux/prctl.h>
 
 #include <asm/uaccess.h>
 #include <asm/pgtable.h>
@@ -532,9 +533,71 @@ start_thread(struct pt_regs *regs, unsigned long new_ip, unsigned long new_sp)
        regs->ss                = __USER_DS;
        regs->flags             = 0x200;
        set_fs(USER_DS);
+       /*
+        * Free the old FP and other extended state
+        */
+       free_thread_xstate(current);
 }
 EXPORT_SYMBOL_GPL(start_thread);
 
+static void hard_disable_TSC(void)
+{
+       write_cr4(read_cr4() | X86_CR4_TSD);
+}
+
+void disable_TSC(void)
+{
+       preempt_disable();
+       if (!test_and_set_thread_flag(TIF_NOTSC))
+               /*
+                * Must flip the CPU state synchronously with
+                * TIF_NOTSC in the current running context.
+                */
+               hard_disable_TSC();
+       preempt_enable();
+}
+
+static void hard_enable_TSC(void)
+{
+       write_cr4(read_cr4() & ~X86_CR4_TSD);
+}
+
+void enable_TSC(void)
+{
+       preempt_disable();
+       if (test_and_clear_thread_flag(TIF_NOTSC))
+               /*
+                * Must flip the CPU state synchronously with
+                * TIF_NOTSC in the current running context.
+                */
+               hard_enable_TSC();
+       preempt_enable();
+}
+
+int get_tsc_mode(unsigned long adr)
+{
+       unsigned int val;
+
+       if (test_thread_flag(TIF_NOTSC))
+               val = PR_TSC_SIGSEGV;
+       else
+               val = PR_TSC_ENABLE;
+
+       return put_user(val, (unsigned int __user *)adr);
+}
+
+int set_tsc_mode(unsigned int val)
+{
+       if (val == PR_TSC_SIGSEGV)
+               disable_TSC();
+       else if (val == PR_TSC_ENABLE)
+               enable_TSC();
+       else
+               return -EINVAL;
+
+       return 0;
+}
+
 /*
  * This special macro can be used to load a debugging register
  */
@@ -572,6 +635,15 @@ static inline void __switch_to_xtra(struct task_struct *prev_p,
                loaddebug(next, 7);
        }
 
+       if (test_tsk_thread_flag(prev_p, TIF_NOTSC) ^
+           test_tsk_thread_flag(next_p, TIF_NOTSC)) {
+               /* prev and next are different */
+               if (test_tsk_thread_flag(next_p, TIF_NOTSC))
+                       hard_disable_TSC();
+               else
+                       hard_enable_TSC();
+       }
+
        if (test_tsk_thread_flag(next_p, TIF_IO_BITMAP)) {
                /*
                 * Copy the relevant range of the IO bitmap.
@@ -614,7 +686,7 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
 
        /* we're going to use this soon, after a few expensive things */
        if (next_p->fpu_counter>5)
-               prefetch(&next->i387.fxsave);
+               prefetch(next->xstate);
 
        /*
         * Reload esp0, LDT and the page table pointer:
index 9692202d3bfb62125c42f0e437f4a618354a9223..19c9386ac1187e4f9b25144437732dc45b11a98c 100644 (file)
@@ -420,7 +420,7 @@ static void native_machine_shutdown(void)
                reboot_cpu_id = smp_processor_id();
 
        /* Make certain I only run on the appropriate processor */
-       set_cpus_allowed(current, cpumask_of_cpu(reboot_cpu_id));
+       set_cpus_allowed_ptr(current, &cpumask_of_cpu(reboot_cpu_id));
 
        /* O.K Now that I'm on the appropriate processor,
         * stop all of the others.
index ed157c90412e25a01076dd268133a8d4d86a9296..0d1f44ae6eea83b3ab32d17fe04a817227dd2acf 100644 (file)
@@ -54,6 +54,24 @@ static void __init setup_per_cpu_maps(void)
 #endif
 }
 
+#ifdef CONFIG_HAVE_CPUMASK_OF_CPU_MAP
+cpumask_t *cpumask_of_cpu_map __read_mostly;
+EXPORT_SYMBOL(cpumask_of_cpu_map);
+
+/* requires nr_cpu_ids to be initialized */
+static void __init setup_cpumask_of_cpu(void)
+{
+       int i;
+
+       /* alloc_bootmem zeroes memory */
+       cpumask_of_cpu_map = alloc_bootmem_low(sizeof(cpumask_t) * nr_cpu_ids);
+       for (i = 0; i < nr_cpu_ids; i++)
+               cpu_set(i, cpumask_of_cpu_map[i]);
+}
+#else
+static inline void setup_cpumask_of_cpu(void) { }
+#endif
+
 #ifdef CONFIG_X86_32
 /*
  * Great future not-so-futuristic plan: make i386 and x86_64 do it
@@ -70,7 +88,7 @@ EXPORT_SYMBOL(__per_cpu_offset);
  */
 void __init setup_per_cpu_areas(void)
 {
-       int i;
+       int i, highest_cpu = 0;
        unsigned long size;
 
 #ifdef CONFIG_HOTPLUG_CPU
@@ -104,10 +122,18 @@ void __init setup_per_cpu_areas(void)
                __per_cpu_offset[i] = ptr - __per_cpu_start;
 #endif
                memcpy(ptr, __per_cpu_start, __per_cpu_end - __per_cpu_start);
+
+               highest_cpu = i;
        }
 
+       nr_cpu_ids = highest_cpu + 1;
+       printk(KERN_DEBUG "NR_CPUS: %d, nr_cpu_ids: %d\n", NR_CPUS, nr_cpu_ids);
+
        /* Setup percpu data maps */
        setup_per_cpu_maps();
+
+       /* Setup cpumask_of_cpu map */
+       setup_cpumask_of_cpu();
 }
 
 #endif
index 9042fb0e36f54b8846fea6ddb8dfe37ce4db9ce2..aee0e8200777057699f8cd580c1add23684d780d 100644 (file)
@@ -74,8 +74,8 @@ int force_personality32 = 0;
 Control non executable heap for 32bit processes.
 To control the stack too use noexec=off
 
-on     PROT_READ does not imply PROT_EXEC for 32bit processes
-off    PROT_READ implies PROT_EXEC (default)
+on     PROT_READ does not imply PROT_EXEC for 32bit processes (default)
+off    PROT_READ implies PROT_EXEC
 */
 static int __init nonx32_setup(char *str)
 {
index 5b0bffb7fcc91d9aa237367a396dd1e5321aba6c..78828b0f604fb387f1e847ae16f35272d51cb44a 100644 (file)
@@ -39,6 +39,7 @@
 #include <linux/efi.h>
 #include <linux/init.h>
 #include <linux/edd.h>
+#include <linux/iscsi_ibft.h>
 #include <linux/nodemask.h>
 #include <linux/kexec.h>
 #include <linux/crash_dump.h>
@@ -689,6 +690,8 @@ void __init setup_bootmem_allocator(void)
 #endif
        numa_kva_reserve();
        reserve_crashkernel();
+
+       reserve_ibft_region();
 }
 
 /*
@@ -812,10 +815,10 @@ void __init setup_arch(char **cmdline_p)
                efi_init();
 
        /* update e820 for memory not covered by WB MTRRs */
-       find_max_pfn();
+       propagate_e820_map();
        mtrr_bp_init();
        if (mtrr_trim_uncached_memory(max_pfn))
-               find_max_pfn();
+               propagate_e820_map();
 
        max_low_pfn = setup_memory();
 
index 674ef3510cdfd66972a08f716e374a0d96884dea..c2ec3dcb6b991304633ed138098e974fc9ff3ff5 100644 (file)
@@ -33,6 +33,7 @@
 #include <linux/acpi.h>
 #include <linux/kallsyms.h>
 #include <linux/edd.h>
+#include <linux/iscsi_ibft.h>
 #include <linux/mmzone.h>
 #include <linux/kexec.h>
 #include <linux/cpufreq.h>
@@ -398,6 +399,8 @@ void __init setup_arch(char **cmdline_p)
 
        early_res_to_bootmem();
 
+       dma32_reserve_bootmem();
+
 #ifdef CONFIG_ACPI_SLEEP
        /*
         * Reserve low memory region for sleep support.
@@ -420,11 +423,14 @@ void __init setup_arch(char **cmdline_p)
                unsigned long end_of_mem    = end_pfn << PAGE_SHIFT;
 
                if (ramdisk_end <= end_of_mem) {
-                       reserve_bootmem_generic(ramdisk_image, ramdisk_size);
+                       /*
+                        * don't need to reserve again, already reserved early
+                        * in x86_64_start_kernel, and early_res_to_bootmem
+                        * convert that to reserved in bootmem
+                        */
                        initrd_start = ramdisk_image + PAGE_OFFSET;
                        initrd_end = initrd_start+ramdisk_size;
                } else {
-                       /* Assumes everything on node 0 */
                        free_bootmem(ramdisk_image, ramdisk_size);
                        printk(KERN_ERR "initrd extends beyond end of memory "
                               "(0x%08lx > 0x%08lx)\ndisabling initrd\n",
@@ -434,6 +440,9 @@ void __init setup_arch(char **cmdline_p)
        }
 #endif
        reserve_crashkernel();
+
+       reserve_ibft_region();
+
        paging_init();
        map_vsyscall();
 
index e6abe8a49b1fa0b63cccf4b4e1ebfb03c6de8fde..6a925394bc7e646e70cd17a54fd6da0710a11e80 100644 (file)
@@ -61,6 +61,7 @@
 #include <asm/mtrr.h>
 #include <asm/nmi.h>
 #include <asm/vmi.h>
+#include <asm/genapic.h>
 #include <linux/mc146818rtc.h>
 
 #include <mach_apic.h>
@@ -677,6 +678,12 @@ wakeup_secondary_cpu(int phys_apicid, unsigned long start_eip)
        unsigned long send_status, accept_status = 0;
        int maxlvt, num_starts, j;
 
+       if (get_uv_system_type() == UV_NON_UNIQUE_APIC) {
+               send_status = uv_wakeup_secondary(phys_apicid, start_eip);
+               atomic_set(&init_deasserted, 1);
+               return send_status;
+       }
+
        /*
         * Be paranoid about clearing APIC errors.
         */
@@ -918,16 +925,19 @@ do_rest:
 
        atomic_set(&init_deasserted, 0);
 
-       Dprintk("Setting warm reset code and vector.\n");
+       if (get_uv_system_type() != UV_NON_UNIQUE_APIC) {
 
-       store_NMI_vector(&nmi_high, &nmi_low);
+               Dprintk("Setting warm reset code and vector.\n");
 
-       smpboot_setup_warm_reset_vector(start_ip);
-       /*
-        * Be paranoid about clearing APIC errors.
-        */
-       apic_write(APIC_ESR, 0);
-       apic_read(APIC_ESR);
+               store_NMI_vector(&nmi_high, &nmi_low);
+
+               smpboot_setup_warm_reset_vector(start_ip);
+               /*
+                * Be paranoid about clearing APIC errors.
+               */
+               apic_write(APIC_ESR, 0);
+               apic_read(APIC_ESR);
+       }
 
        /*
         * Starting actual IPI sequence...
@@ -966,7 +976,8 @@ do_rest:
                        else
                                /* trampoline code not run */
                                printk(KERN_ERR "Not responding.\n");
-                       inquire_remote_apic(apicid);
+                       if (get_uv_system_type() != UV_NON_UNIQUE_APIC)
+                               inquire_remote_apic(apicid);
                }
        }
 
index 65791ca2824a289651017fb524485746908a804e..471e694d6713193baa5a25dac995f177ef34abf2 100644 (file)
@@ -681,7 +681,7 @@ gp_in_kernel:
        }
 }
 
-static __kprobes void
+static notrace __kprobes void
 mem_parity_error(unsigned char reason, struct pt_regs *regs)
 {
        printk(KERN_EMERG
@@ -707,7 +707,7 @@ mem_parity_error(unsigned char reason, struct pt_regs *regs)
        clear_mem_error(reason);
 }
 
-static __kprobes void
+static notrace __kprobes void
 io_check_error(unsigned char reason, struct pt_regs *regs)
 {
        unsigned long i;
@@ -727,7 +727,7 @@ io_check_error(unsigned char reason, struct pt_regs *regs)
        outb(reason, 0x61);
 }
 
-static __kprobes void
+static notrace __kprobes void
 unknown_nmi_error(unsigned char reason, struct pt_regs *regs)
 {
        if (notify_die(DIE_NMIUNKNOWN, "nmi", regs, reason, 2, SIGINT) == NOTIFY_STOP)
@@ -755,7 +755,7 @@ unknown_nmi_error(unsigned char reason, struct pt_regs *regs)
 
 static DEFINE_SPINLOCK(nmi_print_lock);
 
-void __kprobes die_nmi(struct pt_regs *regs, const char *msg)
+void notrace __kprobes die_nmi(struct pt_regs *regs, const char *msg)
 {
        if (notify_die(DIE_NMIWATCHDOG, msg, regs, 0, 2, SIGINT) == NOTIFY_STOP)
                return;
@@ -786,7 +786,7 @@ void __kprobes die_nmi(struct pt_regs *regs, const char *msg)
        do_exit(SIGSEGV);
 }
 
-static __kprobes void default_do_nmi(struct pt_regs *regs)
+static notrace __kprobes void default_do_nmi(struct pt_regs *regs)
 {
        unsigned char reason = 0;
 
@@ -828,7 +828,7 @@ static __kprobes void default_do_nmi(struct pt_regs *regs)
 
 static int ignore_nmis;
 
-__kprobes void do_nmi(struct pt_regs *regs, long error_code)
+notrace __kprobes void do_nmi(struct pt_regs *regs, long error_code)
 {
        int cpu;
 
@@ -1148,9 +1148,22 @@ asmlinkage void math_state_restore(void)
        struct thread_info *thread = current_thread_info();
        struct task_struct *tsk = thread->task;
 
+       if (!tsk_used_math(tsk)) {
+               local_irq_enable();
+               /*
+                * does a slab alloc which can sleep
+                */
+               if (init_fpu(tsk)) {
+                       /*
+                        * ran out of memory!
+                        */
+                       do_group_exit(SIGKILL);
+                       return;
+               }
+               local_irq_disable();
+       }
+
        clts();                         /* Allow maths ops (or we recurse) */
-       if (!tsk_used_math(tsk))
-               init_fpu(tsk);
        restore_fpu(tsk);
        thread->status |= TS_USEDFPU;   /* So we fnsave on switch_to() */
        tsk->fpu_counter++;
@@ -1208,11 +1221,6 @@ void __init trap_init(void)
 #endif
        set_trap_gate(19, &simd_coprocessor_error);
 
-       /*
-        * Verify that the FXSAVE/FXRSTOR data will be 16-byte aligned.
-        * Generate a build-time error if the alignment is wrong.
-        */
-       BUILD_BUG_ON(offsetof(struct task_struct, thread.i387.fxsave) & 15);
        if (cpu_has_fxsr) {
                printk(KERN_INFO "Enabling fast FPU save and restore... ");
                set_in_cr4(X86_CR4_OSFXSR);
@@ -1233,6 +1241,7 @@ void __init trap_init(void)
 
        set_bit(SYSCALL_VECTOR, used_vectors);
 
+       init_thread_xstate();
        /*
         * Should be a barrier for any external CPU state:
         */
index 79aa6fc0815c9e75de806430c5660335bc1cc13e..adff76ea97c4732de4b7766272c8b6ad26ace478 100644 (file)
@@ -600,7 +600,8 @@ void die(const char * str, struct pt_regs * regs, long err)
        oops_end(flags, regs, SIGSEGV);
 }
 
-void __kprobes die_nmi(char *str, struct pt_regs *regs, int do_panic)
+notrace __kprobes void
+die_nmi(char *str, struct pt_regs *regs, int do_panic)
 {
        unsigned long flags;
 
@@ -772,7 +773,7 @@ asmlinkage void __kprobes do_general_protection(struct pt_regs * regs,
        die("general protection fault", regs, error_code);
 }
 
-static __kprobes void
+static notrace __kprobes void
 mem_parity_error(unsigned char reason, struct pt_regs * regs)
 {
        printk(KERN_EMERG "Uhhuh. NMI received for unknown reason %02x.\n",
@@ -796,7 +797,7 @@ mem_parity_error(unsigned char reason, struct pt_regs * regs)
        outb(reason, 0x61);
 }
 
-static __kprobes void
+static notrace __kprobes void
 io_check_error(unsigned char reason, struct pt_regs * regs)
 {
        printk("NMI: IOCK error (debug interrupt?)\n");
@@ -810,7 +811,7 @@ io_check_error(unsigned char reason, struct pt_regs * regs)
        outb(reason, 0x61);
 }
 
-static __kprobes void
+static notrace __kprobes void
 unknown_nmi_error(unsigned char reason, struct pt_regs * regs)
 {
        if (notify_die(DIE_NMIUNKNOWN, "nmi", regs, reason, 2, SIGINT) == NOTIFY_STOP)
@@ -827,7 +828,7 @@ unknown_nmi_error(unsigned char reason, struct pt_regs * regs)
 
 /* Runs on IST stack. This code must keep interrupts off all the time.
    Nested NMIs are prevented by the CPU. */
-asmlinkage __kprobes void default_do_nmi(struct pt_regs *regs)
+asmlinkage notrace  __kprobes void default_do_nmi(struct pt_regs *regs)
 {
        unsigned char reason = 0;
        int cpu;
@@ -1123,11 +1124,24 @@ asmlinkage void __attribute__((weak)) mce_threshold_interrupt(void)
 asmlinkage void math_state_restore(void)
 {
        struct task_struct *me = current;
-       clts();                 /* Allow maths ops (or we recurse) */
 
-       if (!used_math())
-               init_fpu(me);
-       restore_fpu_checking(&me->thread.i387.fxsave);
+       if (!used_math()) {
+               local_irq_enable();
+               /*
+                * does a slab alloc which can sleep
+                */
+               if (init_fpu(me)) {
+                       /*
+                        * ran out of memory!
+                        */
+                       do_group_exit(SIGKILL);
+                       return;
+               }
+               local_irq_disable();
+       }
+
+       clts();                 /* Allow maths ops (or we recurse) */
+       restore_fpu_checking(&me->thread.xstate->fxsave);
        task_thread_info(me)->status |= TS_USEDFPU;
        me->fpu_counter++;
 }
@@ -1162,6 +1176,10 @@ void __init trap_init(void)
        set_system_gate(IA32_SYSCALL_VECTOR, ia32_syscall);
 #endif
        
+       /*
+        * initialize the per thread extended state:
+        */
+        init_thread_xstate();
        /*
         * Should be a barrier for any external CPU state.
         */
index 3d7e6e9fa6c2e4eaf5bee5c78927f63ddfa49e51..e4790728b2244fc90c60ff755d17f32653bcbbab 100644 (file)
@@ -221,9 +221,9 @@ EXPORT_SYMBOL(recalibrate_cpu_khz);
  * if the CPU frequency is scaled, TSC-based delays will need a different
  * loops_per_jiffy value to function properly.
  */
-static unsigned int ref_freq = 0;
-static unsigned long loops_per_jiffy_ref = 0;
-static unsigned long cpu_khz_ref = 0;
+static unsigned int ref_freq;
+static unsigned long loops_per_jiffy_ref;
+static unsigned long cpu_khz_ref;
 
 static int
 time_cpufreq_notifier(struct notifier_block *nb, unsigned long val, void *data)
@@ -283,15 +283,28 @@ core_initcall(cpufreq_tsc);
 
 /* clock source code */
 
-static unsigned long current_tsc_khz = 0;
+static unsigned long current_tsc_khz;
+static struct clocksource clocksource_tsc;
 
+/*
+ * We compare the TSC to the cycle_last value in the clocksource
+ * structure to avoid a nasty time-warp issue. This can be observed in
+ * a very small window right after one CPU updated cycle_last under
+ * xtime lock and the other CPU reads a TSC value which is smaller
+ * than the cycle_last reference value due to a TSC which is slighty
+ * behind. This delta is nowhere else observable, but in that case it
+ * results in a forward time jump in the range of hours due to the
+ * unsigned delta calculation of the time keeping core code, which is
+ * necessary to support wrapping clocksources like pm timer.
+ */
 static cycle_t read_tsc(void)
 {
        cycle_t ret;
 
        rdtscll(ret);
 
-       return ret;
+       return ret >= clocksource_tsc.cycle_last ?
+               ret : clocksource_tsc.cycle_last;
 }
 
 static struct clocksource clocksource_tsc = {
index ceeba01e7f479a9dabc73906d5d2e243ff5e7926..fcc16e58609e17c42de7fae8a8309106df366423 100644 (file)
@@ -11,6 +11,7 @@
 #include <asm/hpet.h>
 #include <asm/timex.h>
 #include <asm/timer.h>
+#include <asm/vgtod.h>
 
 static int notsc __initdata = 0;
 
@@ -287,18 +288,34 @@ int __init notsc_setup(char *s)
 
 __setup("notsc", notsc_setup);
 
+static struct clocksource clocksource_tsc;
 
-/* clock source code: */
+/*
+ * We compare the TSC to the cycle_last value in the clocksource
+ * structure to avoid a nasty time-warp. This can be observed in a
+ * very small window right after one CPU updated cycle_last under
+ * xtime/vsyscall_gtod lock and the other CPU reads a TSC value which
+ * is smaller than the cycle_last reference value due to a TSC which
+ * is slighty behind. This delta is nowhere else observable, but in
+ * that case it results in a forward time jump in the range of hours
+ * due to the unsigned delta calculation of the time keeping core
+ * code, which is necessary to support wrapping clocksources like pm
+ * timer.
+ */
 static cycle_t read_tsc(void)
 {
        cycle_t ret = (cycle_t)get_cycles();
-       return ret;
+
+       return ret >= clocksource_tsc.cycle_last ?
+               ret : clocksource_tsc.cycle_last;
 }
 
 static cycle_t __vsyscall_fn vread_tsc(void)
 {
        cycle_t ret = (cycle_t)vget_cycles();
-       return ret;
+
+       return ret >= __vsyscall_gtod_data.clock.cycle_last ?
+               ret : __vsyscall_gtod_data.clock.cycle_last;
 }
 
 static struct clocksource clocksource_tsc = {
index 710faf71a650b11a991cdbc034cb21e31f0a98f1..cef9cb1d15accf6a6677efcfd76260dcd8990dca 100644 (file)
@@ -1,6 +1,4 @@
 /*
- *     linux/arch/i386/mach-visws/visws_apic.c
- *
  *     Copyright (C) 1999 Bent Hagemark, Ingo Molnar
  *
  *  SGI Visual Workstation interrupt controller
index 6a949e4edde8f17758fbb5fc9ff004eff0b4d286..46d6f8067690d9f37610718c9af1b924a3233e98 100644 (file)
@@ -2,8 +2,6 @@
  *
  * Author: J.E.J.Bottomley@HansenPartnership.com
  *
- * linux/arch/i386/kernel/voyager.c
- *
  * This file contains all the voyager specific routines for getting
  * initialisation of the architecture to function.  For additional
  * features see:
index 17a7904f75b19ce55b63a562158bc82c172cf677..ecab9fff0fd17579b43d550f8bae2e5eea98f22b 100644 (file)
@@ -4,8 +4,6 @@
  *
  * Author: J.E.J.Bottomley@HansenPartnership.com
  *
- * linux/arch/i386/kernel/voyager_cat.c
- *
  * This file contains all the logic for manipulating the CAT bus
  * in a level 5 machine.
  *
index be7235bf105d8ac7f2e77838e36988710fd51048..96f60c7cd124a141e7f4825bbbe555e8893d9ef3 100644 (file)
@@ -4,8 +4,6 @@
  *
  * Author: J.E.J.Bottomley@HansenPartnership.com
  *
- * linux/arch/i386/kernel/voyager_smp.c
- *
  * This file provides all the same external entries as smp.c but uses
  * the voyager hal to provide the functionality
  */
index c69c931818ed49b8d5d9326a50aefb8aa339ba9e..15464a20fb388ee56fb4c7f05de9e8ed34803be6 100644 (file)
@@ -4,8 +4,6 @@
  *
  * Author: J.E.J.Bottomley@HansenPartnership.com
  *
- * linux/arch/i386/kernel/voyager_thread.c
- *
  * This module provides the machine status monitor thread for the
  * voyager architecture.  This allows us to monitor the machine
  * environment (temp, voltage, fan function) and the front panel and
index 4bab3b14539242ceeddf3a1580617f71c9227710..6e38d877ea7725fb8d94d2c91a0ee7daab2585d1 100644 (file)
@@ -678,7 +678,7 @@ int fpregs_soft_set(struct task_struct *target,
                    unsigned int pos, unsigned int count,
                    const void *kbuf, const void __user *ubuf)
 {
-       struct i387_soft_struct *s387 = &target->thread.i387.soft;
+       struct i387_soft_struct *s387 = &target->thread.xstate->soft;
        void *space = s387->st_space;
        int ret;
        int offset, other, i, tags, regnr, tag, newtop;
@@ -730,7 +730,7 @@ int fpregs_soft_get(struct task_struct *target,
                    unsigned int pos, unsigned int count,
                    void *kbuf, void __user *ubuf)
 {
-       struct i387_soft_struct *s387 = &target->thread.i387.soft;
+       struct i387_soft_struct *s387 = &target->thread.xstate->soft;
        const void *space = s387->st_space;
        int ret;
        int offset = (S387->ftop & 7) * 10, other = 80 - offset;
index a3ae28c49dddad063de9c177f7d0f13480df3da5..13488fa153e0c81dacc9370edc1f0a2128d0babd 100644 (file)
@@ -35,8 +35,8 @@
 #define SEG_EXPAND_DOWN(s)     (((s).b & ((1 << 11) | (1 << 10))) \
                                 == (1 << 10))
 
-#define I387                   (current->thread.i387)
-#define FPU_info               (I387.soft.info)
+#define I387                   (current->thread.xstate)
+#define FPU_info               (I387->soft.info)
 
 #define FPU_CS                 (*(unsigned short *) &(FPU_info->___cs))
 #define FPU_SS                 (*(unsigned short *) &(FPU_info->___ss))
 #define FPU_EIP                        (FPU_info->___eip)
 #define FPU_ORIG_EIP           (FPU_info->___orig_eip)
 
-#define FPU_lookahead           (I387.soft.lookahead)
+#define FPU_lookahead           (I387->soft.lookahead)
 
 /* nz if ip_offset and cs_selector are not to be set for the current
    instruction. */
-#define no_ip_update           (*(u_char *)&(I387.soft.no_update))
-#define FPU_rm                 (*(u_char *)&(I387.soft.rm))
+#define no_ip_update           (*(u_char *)&(I387->soft.no_update))
+#define FPU_rm                 (*(u_char *)&(I387->soft.rm))
 
 /* Number of bytes of data which can be legally accessed by the current
    instruction. This only needs to hold a number <= 108, so a byte will do. */
-#define access_limit           (*(u_char *)&(I387.soft.alimit))
+#define access_limit           (*(u_char *)&(I387->soft.alimit))
 
-#define partial_status         (I387.soft.swd)
-#define control_word           (I387.soft.cwd)
-#define fpu_tag_word           (I387.soft.twd)
-#define registers              (I387.soft.st_space)
-#define top                    (I387.soft.ftop)
+#define partial_status         (I387->soft.swd)
+#define control_word           (I387->soft.cwd)
+#define fpu_tag_word           (I387->soft.twd)
+#define registers              (I387->soft.st_space)
+#define top                    (I387->soft.ftop)
 
-#define instruction_address    (*(struct address *)&I387.soft.fip)
-#define operand_address                (*(struct address *)&I387.soft.foo)
+#define instruction_address    (*(struct address *)&I387->soft.fip)
+#define operand_address                (*(struct address *)&I387->soft.foo)
 
 #define FPU_access_ok(x,y,z)   if ( !access_ok(x,y,z) ) \
                                math_abort(FPU_info,SIGSEGV)
index 02af772a24db24f12d2fbd17cfbd53fc5d22515b..d597fe7423c98441f7ed52f8bcb0df3bd45646a9 100644 (file)
@@ -1180,8 +1180,8 @@ u_char __user *fstenv(fpu_addr_modes addr_modes, u_char __user *d)
                control_word |= 0xffff0040;
                partial_status = status_word() | 0xffff0000;
                fpu_tag_word |= 0xffff0000;
-               I387.soft.fcs &= ~0xf8000000;
-               I387.soft.fos |= 0xffff0000;
+               I387->soft.fcs &= ~0xf8000000;
+               I387->soft.fos |= 0xffff0000;
 #endif /* PECULIAR_486 */
                if (__copy_to_user(d, &control_word, 7 * 4))
                        FPU_abort;
index eba0bbede7a6b8e05319c5148b8d8b8b715e0db3..18378850e25aab13c3149903b5c2d6c611ca10a9 100644 (file)
@@ -120,7 +120,7 @@ int __init get_memcfg_numa_flat(void)
        printk("NUMA - single node, flat memory mode\n");
 
        /* Run the memory configuration and find the top of memory. */
-       find_max_pfn();
+       propagate_e820_map();
        node_start_pfn[0] = 0;
        node_end_pfn[0] = max_pfn;
        memory_present(0, 0, max_pfn);
@@ -134,7 +134,7 @@ int __init get_memcfg_numa_flat(void)
 /*
  * Find the highest page frame number we have available for the node
  */
-static void __init find_max_pfn_node(int nid)
+static void __init propagate_e820_map_node(int nid)
 {
        if (node_end_pfn[nid] > max_pfn)
                node_end_pfn[nid] = max_pfn;
@@ -379,7 +379,7 @@ unsigned long __init setup_memory(void)
        printk("High memory starts at vaddr %08lx\n",
                        (ulong) pfn_to_kaddr(highstart_pfn));
        for_each_online_node(nid)
-               find_max_pfn_node(nid);
+               propagate_e820_map_node(nid);
 
        memset(NODE_DATA(0), 0, sizeof(struct pglist_data));
        NODE_DATA(0)->bdata = &node0_bdata;
index 1500dc8d63e4676586470d458722b71cad63ace1..9ec62da85fd79a75fc450b58c4ea54e4c77f857b 100644 (file)
@@ -1,5 +1,4 @@
 /*
- *  linux/arch/i386/mm/init.c
  *
  *  Copyright (C) 1995  Linus Torvalds
  *
index 1076097dcab22115f5de1e9b22afc1baf2129ab6..1ff7906a9a4dbc7afa6dfdd24f274e077cd26773 100644 (file)
@@ -47,9 +47,6 @@
 #include <asm/numa.h>
 #include <asm/cacheflush.h>
 
-const struct dma_mapping_ops *dma_ops;
-EXPORT_SYMBOL(dma_ops);
-
 static unsigned long dma_reserve __initdata;
 
 DEFINE_PER_CPU(struct mmu_gather, mmu_gathers);
index c590fd200e297e892d1552b8b575e2cf7b8604f7..3a4baf95e24d5a5cee6626a5b8789064e9dce564 100644 (file)
@@ -134,7 +134,7 @@ static void __iomem *__ioremap(resource_size_t phys_addr, unsigned long size,
 
        if (!phys_addr_valid(phys_addr)) {
                printk(KERN_WARNING "ioremap: invalid physical address %llx\n",
-                      phys_addr);
+                      (unsigned long long)phys_addr);
                WARN_ON_ONCE(1);
                return NULL;
        }
@@ -187,7 +187,8 @@ static void __iomem *__ioremap(resource_size_t phys_addr, unsigned long size,
                     new_prot_val == _PAGE_CACHE_WB)) {
                        pr_debug(
                "ioremap error for 0x%llx-0x%llx, requested 0x%lx, got 0x%lx\n",
-                               phys_addr, phys_addr + size,
+                               (unsigned long long)phys_addr,
+                               (unsigned long long)(phys_addr + size),
                                prot_val, new_prot_val);
                        free_memtype(phys_addr, phys_addr + size);
                        return NULL;
index 7a2ebce87df5dee511701d3f3d521d62e2d26dc8..86808e666f9c2aeea15492a8609400915f819a09 100644 (file)
@@ -164,7 +164,7 @@ int __init k8_scan_nodes(unsigned long start, unsigned long end)
        if (!found)
                return -1;
 
-       memnode_shift = compute_hash_shift(nodes, 8);
+       memnode_shift = compute_hash_shift(nodes, 8, NULL);
        if (memnode_shift < 0) {
                printk(KERN_ERR "No NUMA node hash function found. Contact maintainer\n");
                return -1;
index 2ea56f48f29b506c3a180bfd79b3bdb62bf5fd2c..9a6892200b271a1ebec5fe64da0adef13b54df78 100644 (file)
@@ -60,7 +60,7 @@ unsigned long __initdata nodemap_size;
  * -1 if node overlap or lost ram (shift too big)
  */
 static int __init populate_memnodemap(const struct bootnode *nodes,
-                                     int numnodes, int shift)
+                                     int numnodes, int shift, int *nodeids)
 {
        unsigned long addr, end;
        int i, res = -1;
@@ -76,7 +76,12 @@ static int __init populate_memnodemap(const struct bootnode *nodes,
                do {
                        if (memnodemap[addr >> shift] != NUMA_NO_NODE)
                                return -1;
-                       memnodemap[addr >> shift] = i;
+
+                       if (!nodeids)
+                               memnodemap[addr >> shift] = i;
+                       else
+                               memnodemap[addr >> shift] = nodeids[i];
+
                        addr += (1UL << shift);
                } while (addr < end);
                res = 1;
@@ -139,7 +144,8 @@ static int __init extract_lsb_from_nodes(const struct bootnode *nodes,
        return i;
 }
 
-int __init compute_hash_shift(struct bootnode *nodes, int numnodes)
+int __init compute_hash_shift(struct bootnode *nodes, int numnodes,
+                             int *nodeids)
 {
        int shift;
 
@@ -149,7 +155,7 @@ int __init compute_hash_shift(struct bootnode *nodes, int numnodes)
        printk(KERN_DEBUG "NUMA: Using %d for the hash shift.\n",
                shift);
 
-       if (populate_memnodemap(nodes, numnodes, shift) != 1) {
+       if (populate_memnodemap(nodes, numnodes, shift, nodeids) != 1) {
                printk(KERN_INFO "Your memory is not aligned you need to "
                       "rebuild your kernel with a bigger NODEMAPSIZE "
                       "shift=%d\n", shift);
@@ -380,9 +386,10 @@ static int __init split_nodes_by_size(struct bootnode *nodes, u64 *addr,
  * Sets up the system RAM area from start_pfn to end_pfn according to the
  * numa=fake command-line option.
  */
+static struct bootnode nodes[MAX_NUMNODES] __initdata;
+
 static int __init numa_emulation(unsigned long start_pfn, unsigned long end_pfn)
 {
-       struct bootnode nodes[MAX_NUMNODES];
        u64 size, addr = start_pfn << PAGE_SHIFT;
        u64 max_addr = end_pfn << PAGE_SHIFT;
        int num_nodes = 0, num = 0, coeff_flag, coeff = -1, i;
@@ -462,7 +469,7 @@ done:
                }
        }
 out:
-       memnode_shift = compute_hash_shift(nodes, num_nodes);
+       memnode_shift = compute_hash_shift(nodes, num_nodes, NULL);
        if (memnode_shift < 0) {
                memnode_shift = 0;
                printk(KERN_ERR "No NUMA hash function found.  NUMA emulation "
index 3165ec0672bd1855cb607c6864b83c810c29d729..6fb9e7c6893fd44afad45232355b47c867c7cf75 100644 (file)
@@ -1,7 +1,3 @@
-/*
- *  linux/arch/i386/mm/pgtable.c
- */
-
 #include <linux/sched.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
index 1bae9c855ceb8b56cce821129a21194a693f7c81..fb43d89f46f3c92b51e5eedc85be49340eabd765 100644 (file)
@@ -32,6 +32,10 @@ static struct bootnode nodes_add[MAX_NUMNODES];
 static int found_add_area __initdata;
 int hotadd_percent __initdata = 0;
 
+static int num_node_memblks __initdata;
+static struct bootnode node_memblk_range[NR_NODE_MEMBLKS] __initdata;
+static int memblk_nodeid[NR_NODE_MEMBLKS] __initdata;
+
 /* Too small nodes confuse the VM badly. Usually they result
    from BIOS bugs. */
 #define NODE_MIN_SIZE (4*1024*1024)
@@ -41,17 +45,17 @@ static __init int setup_node(int pxm)
        return acpi_map_pxm_to_node(pxm);
 }
 
-static __init int conflicting_nodes(unsigned long start, unsigned long end)
+static __init int conflicting_memblks(unsigned long start, unsigned long end)
 {
        int i;
-       for_each_node_mask(i, nodes_parsed) {
-               struct bootnode *nd = &nodes[i];
+       for (i = 0; i < num_node_memblks; i++) {
+               struct bootnode *nd = &node_memblk_range[i];
                if (nd->start == nd->end)
                        continue;
                if (nd->end > start && nd->start < end)
-                       return i;
+                       return memblk_nodeid[i];
                if (nd->end == end && nd->start == start)
-                       return i;
+                       return memblk_nodeid[i];
        }
        return -1;
 }
@@ -258,7 +262,7 @@ acpi_numa_memory_affinity_init(struct acpi_srat_mem_affinity *ma)
                bad_srat();
                return;
        }
-       i = conflicting_nodes(start, end);
+       i = conflicting_memblks(start, end);
        if (i == node) {
                printk(KERN_WARNING
                "SRAT: Warning: PXM %d (%lx-%lx) overlaps with itself (%Lx-%Lx)\n",
@@ -283,10 +287,10 @@ acpi_numa_memory_affinity_init(struct acpi_srat_mem_affinity *ma)
                        nd->end = end;
        }
 
-       printk(KERN_INFO "SRAT: Node %u PXM %u %Lx-%Lx\n", node, pxm,
-              nd->start, nd->end);
-       e820_register_active_regions(node, nd->start >> PAGE_SHIFT,
-                                               nd->end >> PAGE_SHIFT);
+       printk(KERN_INFO "SRAT: Node %u PXM %u %lx-%lx\n", node, pxm,
+              start, end);
+       e820_register_active_regions(node, start >> PAGE_SHIFT,
+                                    end >> PAGE_SHIFT);
        push_node_boundaries(node, nd->start >> PAGE_SHIFT,
                                                nd->end >> PAGE_SHIFT);
 
@@ -298,6 +302,11 @@ acpi_numa_memory_affinity_init(struct acpi_srat_mem_affinity *ma)
                if ((nd->start | nd->end) == 0)
                        node_clear(node, nodes_parsed);
        }
+
+       node_memblk_range[num_node_memblks].start = start;
+       node_memblk_range[num_node_memblks].end = end;
+       memblk_nodeid[num_node_memblks] = node;
+       num_node_memblks++;
 }
 
 /* Sanity check to catch more bad SRATs (they are amazingly common).
@@ -368,7 +377,8 @@ int __init acpi_scan_nodes(unsigned long start, unsigned long end)
                return -1;
        }
 
-       memnode_shift = compute_hash_shift(nodes, MAX_NUMNODES);
+       memnode_shift = compute_hash_shift(node_memblk_range, num_node_memblks,
+                                          memblk_nodeid);
        if (memnode_shift < 0) {
                printk(KERN_ERR
                     "SRAT: No NUMA node hash function found. Contact maintainer\n");
index 1f11cf0a307f448e777f5a132e0de15ebc4ca7a3..cc48d3fde545c014dc6d4a34f07cc2578ea0f481 100644 (file)
@@ -23,8 +23,8 @@
 #include "op_x86_model.h"
 
 static struct op_x86_model_spec const *model;
-static struct op_msrs cpu_msrs[NR_CPUS];
-static unsigned long saved_lvtpc[NR_CPUS];
+static DEFINE_PER_CPU(struct op_msrs, cpu_msrs);
+static DEFINE_PER_CPU(unsigned long, saved_lvtpc);
 
 static int nmi_start(void);
 static void nmi_stop(void);
@@ -89,7 +89,7 @@ static int profile_exceptions_notify(struct notifier_block *self,
 
        switch (val) {
        case DIE_NMI:
-               if (model->check_ctrs(args->regs, &cpu_msrs[cpu]))
+               if (model->check_ctrs(args->regs, &per_cpu(cpu_msrs, cpu)))
                        ret = NOTIFY_STOP;
                break;
        default:
@@ -126,7 +126,7 @@ static void nmi_cpu_save_registers(struct op_msrs *msrs)
 static void nmi_save_registers(void *dummy)
 {
        int cpu = smp_processor_id();
-       struct op_msrs *msrs = &cpu_msrs[cpu];
+       struct op_msrs *msrs = &per_cpu(cpu_msrs, cpu);
        nmi_cpu_save_registers(msrs);
 }
 
@@ -134,10 +134,10 @@ static void free_msrs(void)
 {
        int i;
        for_each_possible_cpu(i) {
-               kfree(cpu_msrs[i].counters);
-               cpu_msrs[i].counters = NULL;
-               kfree(cpu_msrs[i].controls);
-               cpu_msrs[i].controls = NULL;
+               kfree(per_cpu(cpu_msrs, i).counters);
+               per_cpu(cpu_msrs, i).counters = NULL;
+               kfree(per_cpu(cpu_msrs, i).controls);
+               per_cpu(cpu_msrs, i).controls = NULL;
        }
 }
 
@@ -149,13 +149,15 @@ static int allocate_msrs(void)
 
        int i;
        for_each_possible_cpu(i) {
-               cpu_msrs[i].counters = kmalloc(counters_size, GFP_KERNEL);
-               if (!cpu_msrs[i].counters) {
+               per_cpu(cpu_msrs, i).counters = kmalloc(counters_size,
+                                                               GFP_KERNEL);
+               if (!per_cpu(cpu_msrs, i).counters) {
                        success = 0;
                        break;
                }
-               cpu_msrs[i].controls = kmalloc(controls_size, GFP_KERNEL);
-               if (!cpu_msrs[i].controls) {
+               per_cpu(cpu_msrs, i).controls = kmalloc(controls_size,
+                                                               GFP_KERNEL);
+               if (!per_cpu(cpu_msrs, i).controls) {
                        success = 0;
                        break;
                }
@@ -170,11 +172,11 @@ static int allocate_msrs(void)
 static void nmi_cpu_setup(void *dummy)
 {
        int cpu = smp_processor_id();
-       struct op_msrs *msrs = &cpu_msrs[cpu];
+       struct op_msrs *msrs = &per_cpu(cpu_msrs, cpu);
        spin_lock(&oprofilefs_lock);
        model->setup_ctrs(msrs);
        spin_unlock(&oprofilefs_lock);
-       saved_lvtpc[cpu] = apic_read(APIC_LVTPC);
+       per_cpu(saved_lvtpc, cpu) = apic_read(APIC_LVTPC);
        apic_write(APIC_LVTPC, APIC_DM_NMI);
 }
 
@@ -203,13 +205,15 @@ static int nmi_setup(void)
         */
 
        /* Assume saved/restored counters are the same on all CPUs */
-       model->fill_in_addresses(&cpu_msrs[0]);
+       model->fill_in_addresses(&per_cpu(cpu_msrs, 0));
        for_each_possible_cpu(cpu) {
                if (cpu != 0) {
-                       memcpy(cpu_msrs[cpu].counters, cpu_msrs[0].counters,
+                       memcpy(per_cpu(cpu_msrs, cpu).counters,
+                               per_cpu(cpu_msrs, 0).counters,
                                sizeof(struct op_msr) * model->num_counters);
 
-                       memcpy(cpu_msrs[cpu].controls, cpu_msrs[0].controls,
+                       memcpy(per_cpu(cpu_msrs, cpu).controls,
+                               per_cpu(cpu_msrs, 0).controls,
                                sizeof(struct op_msr) * model->num_controls);
                }
 
@@ -249,7 +253,7 @@ static void nmi_cpu_shutdown(void *dummy)
 {
        unsigned int v;
        int cpu = smp_processor_id();
-       struct op_msrs *msrs = &cpu_msrs[cpu];
+       struct op_msrs *msrs = &__get_cpu_var(cpu_msrs);
 
        /* restoring APIC_LVTPC can trigger an apic error because the delivery
         * mode and vector nr combination can be illegal. That's by design: on
@@ -258,23 +262,24 @@ static void nmi_cpu_shutdown(void *dummy)
         */
        v = apic_read(APIC_LVTERR);
        apic_write(APIC_LVTERR, v | APIC_LVT_MASKED);
-       apic_write(APIC_LVTPC, saved_lvtpc[cpu]);
+       apic_write(APIC_LVTPC, per_cpu(saved_lvtpc, cpu));
        apic_write(APIC_LVTERR, v);
        nmi_restore_registers(msrs);
 }
 
 static void nmi_shutdown(void)
 {
+       struct op_msrs *msrs = &__get_cpu_var(cpu_msrs);
        nmi_enabled = 0;
        on_each_cpu(nmi_cpu_shutdown, NULL, 0, 1);
        unregister_die_notifier(&profile_exceptions_nb);
-       model->shutdown(cpu_msrs);
+       model->shutdown(msrs);
        free_msrs();
 }
 
 static void nmi_cpu_start(void *dummy)
 {
-       struct op_msrs const *msrs = &cpu_msrs[smp_processor_id()];
+       struct op_msrs const *msrs = &__get_cpu_var(cpu_msrs);
        model->start(msrs);
 }
 
@@ -286,7 +291,7 @@ static int nmi_start(void)
 
 static void nmi_cpu_stop(void *dummy)
 {
-       struct op_msrs const *msrs = &cpu_msrs[smp_processor_id()];
+       struct op_msrs const *msrs = &__get_cpu_var(cpu_msrs);
        model->stop(msrs);
 }
 
index 17a6b057856b6f6759eb358d7060b5b682861440..b7ad9f89d21f8898dbf792de05b0dddd21f3a803 100644 (file)
@@ -37,7 +37,8 @@ $(obj)/%.so: OBJCOPYFLAGS := -S
 $(obj)/%.so: $(obj)/%.so.dbg FORCE
        $(call if_changed,objcopy)
 
-CFL := $(PROFILING) -mcmodel=small -fPIC -g0 -O2 -fasynchronous-unwind-tables -m64
+CFL := $(PROFILING) -mcmodel=small -fPIC -O2 -fasynchronous-unwind-tables -m64 \
+       $(filter -g%,$(KBUILD_CFLAGS))
 
 $(vobjs): KBUILD_CFLAGS += $(CFL)
 
index 48fb38d7d2c0ff695a60deedfb0d92139f84c21d..4db42bff8c603ee216345bba6143ad5f5efd3dec 100644 (file)
@@ -1,5 +1,4 @@
 /*
- * arch/i386/video/fbdev.c - i386 Framebuffer
  *
  * Copyright (C) 2007 Antonino Daplas <adaplas@gmail.com>
  *
index 302ac1f5af391b7058aad198615cdf1fee29931d..f51172ed27c25b02f54dc91895e794d30e9d3914 100644 (file)
@@ -758,7 +758,7 @@ static struct bsg_device *bsg_add_device(struct inode *inode,
        mutex_lock(&bsg_mutex);
        hlist_add_head(&bd->dev_list, bsg_dev_idx_hash(iminor(inode)));
 
-       strncpy(bd->name, rq->bsg_dev.class_dev->class_id, sizeof(bd->name) - 1);
+       strncpy(bd->name, rq->bsg_dev.class_dev->bus_id, sizeof(bd->name) - 1);
        dprintk("bound to <%s>, max queue %d\n",
                format_dev_t(buf, inode->i_rdev), bd->max_queue);
 
@@ -946,7 +946,7 @@ void bsg_unregister_queue(struct request_queue *q)
        mutex_lock(&bsg_mutex);
        idr_remove(&bsg_minor_idr, bcd->minor);
        sysfs_remove_link(&q->kobj, "bsg");
-       class_device_unregister(bcd->class_dev);
+       device_unregister(bcd->class_dev);
        put_device(bcd->dev);
        bcd->class_dev = NULL;
        mutex_unlock(&bsg_mutex);
@@ -959,7 +959,7 @@ int bsg_register_queue(struct request_queue *q, struct device *gdev,
        struct bsg_class_device *bcd;
        dev_t dev;
        int ret, minor;
-       struct class_device *class_dev = NULL;
+       struct device *class_dev = NULL;
        const char *devname;
 
        if (name)
@@ -998,8 +998,7 @@ int bsg_register_queue(struct request_queue *q, struct device *gdev,
        bcd->queue = q;
        bcd->dev = get_device(gdev);
        dev = MKDEV(bsg_major, bcd->minor);
-       class_dev = class_device_create(bsg_class, NULL, dev, gdev, "%s",
-                                       devname);
+       class_dev = device_create(bsg_class, gdev, dev, "%s", devname);
        if (IS_ERR(class_dev)) {
                ret = PTR_ERR(class_dev);
                goto put_dev;
@@ -1016,7 +1015,7 @@ int bsg_register_queue(struct request_queue *q, struct device *gdev,
        return 0;
 
 unregister_class_dev:
-       class_device_unregister(class_dev);
+       device_unregister(class_dev);
 put_dev:
        put_device(gdev);
 remove_idr:
index 1b8e592a82415a0772ebf1474acde406229236c9..0bba3a914e865562c51b11703fca695cfd0051a0 100644 (file)
@@ -838,10 +838,10 @@ static int acpi_processor_get_throttling(struct acpi_processor *pr)
         * Migrate task to the cpu pointed by pr.
         */
        saved_mask = current->cpus_allowed;
-       set_cpus_allowed(current, cpumask_of_cpu(pr->id));
+       set_cpus_allowed_ptr(current, &cpumask_of_cpu(pr->id));
        ret = pr->throttling.acpi_processor_get_throttling(pr);
        /* restore the previous state */
-       set_cpus_allowed(current, saved_mask);
+       set_cpus_allowed_ptr(current, &saved_mask);
 
        return ret;
 }
@@ -1025,7 +1025,7 @@ int acpi_processor_set_throttling(struct acpi_processor *pr, int state)
         * it can be called only for the cpu pointed by pr.
         */
        if (p_throttling->shared_type == DOMAIN_COORD_TYPE_SW_ANY) {
-               set_cpus_allowed(current, cpumask_of_cpu(pr->id));
+               set_cpus_allowed_ptr(current, &cpumask_of_cpu(pr->id));
                ret = p_throttling->acpi_processor_set_throttling(pr,
                                                t_state.target_state);
        } else {
@@ -1056,7 +1056,7 @@ int acpi_processor_set_throttling(struct acpi_processor *pr, int state)
                                continue;
                        }
                        t_state.cpu = i;
-                       set_cpus_allowed(current, cpumask_of_cpu(i));
+                       set_cpus_allowed_ptr(current, &cpumask_of_cpu(i));
                        ret = match_pr->throttling.
                                acpi_processor_set_throttling(
                                match_pr, t_state.target_state);
@@ -1074,7 +1074,7 @@ int acpi_processor_set_throttling(struct acpi_processor *pr, int state)
                                                        &t_state);
        }
        /* restore the previous state */
-       set_cpus_allowed(current, saved_mask);
+       set_cpus_allowed_ptr(current, &saved_mask);
        return ret;
 }
 
index 739ba3f222e851407cd97dcc2ed52ac509e32edc..986e3324e3026230bee39dbf9b0001fe23c15c64 100644 (file)
@@ -273,8 +273,8 @@ static int ahci_pci_device_suspend(struct pci_dev *pdev, pm_message_t mesg);
 static int ahci_pci_device_resume(struct pci_dev *pdev);
 #endif
 
-static struct class_device_attribute *ahci_shost_attrs[] = {
-       &class_device_attr_link_power_management_policy,
+static struct device_attribute *ahci_shost_attrs[] = {
+       &dev_attr_link_power_management_policy,
        NULL
 };
 
index 733eb94d055e34420348a6edb65dbfb368728547..b0b00af90d0e18314782fec05cdd136cbd41eff1 100644 (file)
@@ -61,7 +61,6 @@
 #include <scsi/scsi_cmnd.h>
 #include <scsi/scsi_host.h>
 #include <linux/libata.h>
-#include <asm/semaphore.h>
 #include <asm/byteorder.h>
 #include <linux/cdrom.h>
 
index f3c69a8c1103a0af3ac48e99694ff2e364603258..a34f32442edf8687c832213f02c3a01e144d49a1 100644 (file)
@@ -131,10 +131,11 @@ static const char *ata_scsi_lpm_get(enum link_pm policy)
        return NULL;
 }
 
-static ssize_t ata_scsi_lpm_put(struct class_device *class_dev,
-       const char *buf, size_t count)
+static ssize_t ata_scsi_lpm_put(struct device *dev,
+                               struct device_attribute *attr,
+                               const char *buf, size_t count)
 {
-       struct Scsi_Host *shost = class_to_shost(class_dev);
+       struct Scsi_Host *shost = class_to_shost(dev);
        struct ata_port *ap = ata_shost_to_port(shost);
        enum link_pm policy = 0;
        int i;
@@ -162,9 +163,9 @@ static ssize_t ata_scsi_lpm_put(struct class_device *class_dev,
 }
 
 static ssize_t
-ata_scsi_lpm_show(struct class_device *class_dev, char *buf)
+ata_scsi_lpm_show(struct device *dev, struct device_attribute *attr, char *buf)
 {
-       struct Scsi_Host *shost = class_to_shost(class_dev);
+       struct Scsi_Host *shost = class_to_shost(dev);
        struct ata_port *ap = ata_shost_to_port(shost);
        const char *policy =
                ata_scsi_lpm_get(ap->pm_policy);
@@ -174,9 +175,9 @@ ata_scsi_lpm_show(struct class_device *class_dev, char *buf)
 
        return snprintf(buf, 23, "%s\n", policy);
 }
-CLASS_DEVICE_ATTR(link_power_management_policy, S_IRUGO | S_IWUSR,
+DEVICE_ATTR(link_power_management_policy, S_IRUGO | S_IWUSR,
                ata_scsi_lpm_show, ata_scsi_lpm_put);
-EXPORT_SYMBOL_GPL(class_device_attr_link_power_management_policy);
+EXPORT_SYMBOL_GPL(dev_attr_link_power_management_policy);
 
 static void ata_scsi_invalid_field(struct scsi_cmnd *cmd,
                                   void (*done)(struct scsi_cmnd *))
index 05ff8c776497be69a2b05846674ac94574682c86..d52ce1188327bf2a9f89b21e9335c0442fb5f748 100644 (file)
@@ -76,6 +76,7 @@
 #include <linux/device.h>
 #include <linux/platform_device.h>
 #include <linux/ata_platform.h>
+#include <linux/mbus.h>
 #include <scsi/scsi_host.h>
 #include <scsi/scsi_cmnd.h>
 #include <scsi/scsi_device.h>
@@ -370,6 +371,9 @@ enum {
 #define IS_GEN_IIE(hpriv) ((hpriv)->hp_flags & MV_HP_GEN_IIE)
 #define HAS_PCI(host) (!((host)->ports[0]->flags & MV_FLAG_SOC))
 
+#define WINDOW_CTRL(i)         (0x20030 + ((i) << 4))
+#define WINDOW_BASE(i)         (0x20034 + ((i) << 4))
+
 enum {
        /* DMA boundary 0xffff is required by the s/g splitting
         * we need on /length/ in mv_fill-sg().
@@ -2769,6 +2773,27 @@ static int mv_create_dma_pools(struct mv_host_priv *hpriv, struct device *dev)
        return 0;
 }
 
+static void mv_conf_mbus_windows(struct mv_host_priv *hpriv,
+                                struct mbus_dram_target_info *dram)
+{
+       int i;
+
+       for (i = 0; i < 4; i++) {
+               writel(0, hpriv->base + WINDOW_CTRL(i));
+               writel(0, hpriv->base + WINDOW_BASE(i));
+       }
+
+       for (i = 0; i < dram->num_cs; i++) {
+               struct mbus_dram_window *cs = dram->cs + i;
+
+               writel(((cs->size - 1) & 0xffff0000) |
+                       (cs->mbus_attr << 8) |
+                       (dram->mbus_dram_target_id << 4) | 1,
+                       hpriv->base + WINDOW_CTRL(i));
+               writel(cs->base, hpriv->base + WINDOW_BASE(i));
+       }
+}
+
 /**
  *      mv_platform_probe - handle a positive probe of an soc Marvell
  *      host
@@ -2823,6 +2848,12 @@ static int mv_platform_probe(struct platform_device *pdev)
                                   res->end - res->start + 1);
        hpriv->base -= MV_SATAHC0_REG_BASE;
 
+       /*
+        * (Re-)program MBUS remapping windows if we are asked to.
+        */
+       if (mv_platform_data->dram != NULL)
+               mv_conf_mbus_windows(hpriv, mv_platform_data->dram);
+
        rc = mv_create_dma_pools(hpriv, &pdev->dev);
        if (rc)
                return rc;
index 670c093ed25f7ce93e0b03ed1d21f124f64d96fc..5c28ca7380ff6fa0683599178cbd17af6109e8d4 100644 (file)
@@ -60,7 +60,8 @@
 #include <asm/uaccess.h>  
 #include <asm/string.h>  
 #include <asm/byteorder.h>  
-#include <linux/vmalloc.h>  
+#include <linux/vmalloc.h>
+#include <linux/jiffies.h>
 #include "iphase.h"              
 #include "suni.h"                
 #define swap(x) (((x & 0xff) << 8) | ((x & 0xff00) >> 8))  
@@ -189,7 +190,7 @@ static u16 get_desc (IADEV *dev, struct ia_vcc *iavcc) {
   int ltimeout;
 
   ia_hack_tcq (dev);
-  if(((jiffies - timer)>50)||((dev->ffL.tcq_rd==dev->host_tcq_wr))){      
+  if((time_after(jiffies,timer+50)) || ((dev->ffL.tcq_rd==dev->host_tcq_wr))) {
      timer = jiffies; 
      i=0;
      while (i < dev->num_tx_desc) {
@@ -1225,7 +1226,7 @@ static void rx_intr(struct atm_dev *dev)
         iadev->rx_tmp_jif = jiffies; 
         iadev->rxing = 0;
      } 
-     else if (((jiffies - iadev->rx_tmp_jif) > 50) && 
+     else if ((time_after(jiffies, iadev->rx_tmp_jif + 50)) &&
                ((iadev->rx_pkt_cnt - iadev->rx_tmp_cnt) == 0)) {
         for (i = 1; i <= iadev->num_rx_desc; i++)
                free_desc(dev, i);
index 0c205b000e8b9038e6f175e2f6455e107df71c55..38c769f8d2b7a991762c1727cf1ff2f192b85c67 100644 (file)
 #define ATM_SKB(s) (&(s)->atm)
 #endif
 
-   /* Spinlock debugging stuff */
-#ifdef NS_DEBUG_SPINLOCKS /* See nicstar.h */
-#define ns_grab_int_lock(card,flags) \
- do { \
-    unsigned long nsdsf, nsdsf2; \
-    local_irq_save(flags); \
-    save_flags(nsdsf); cli();\
-    if (nsdsf & (1<<9)) printk ("nicstar.c: ints %sabled -> enabled.\n", \
-                                (flags)&(1<<9)?"en":"dis"); \
-    if (spin_is_locked(&(card)->int_lock) && \
-        (card)->cpu_int == smp_processor_id()) { \
-       printk("nicstar.c: line %d (cpu %d) int_lock already locked at line %d (cpu %d)\n", \
-              __LINE__, smp_processor_id(), (card)->has_int_lock, \
-              (card)->cpu_int); \
-       printk("nicstar.c: ints were %sabled.\n", ((flags)&(1<<9)?"en":"dis")); \
-    } \
-    if (spin_is_locked(&(card)->res_lock) && \
-        (card)->cpu_res == smp_processor_id()) { \
-       printk("nicstar.c: line %d (cpu %d) res_lock locked at line %d (cpu %d)(trying int)\n", \
-              __LINE__, smp_processor_id(), (card)->has_res_lock, \
-              (card)->cpu_res); \
-       printk("nicstar.c: ints were %sabled.\n", ((flags)&(1<<9)?"en":"dis")); \
-    } \
-    spin_lock_irq(&(card)->int_lock); \
-    (card)->has_int_lock = __LINE__; \
-    (card)->cpu_int = smp_processor_id(); \
-    restore_flags(nsdsf); } while (0)
-#define ns_grab_res_lock(card,flags) \
- do { \
-    unsigned long nsdsf, nsdsf2; \
-    local_irq_save(flags); \
-    save_flags(nsdsf); cli();\
-    if (nsdsf & (1<<9)) printk ("nicstar.c: ints %sabled -> enabled.\n", \
-                                (flags)&(1<<9)?"en":"dis"); \
-    if (spin_is_locked(&(card)->res_lock) && \
-        (card)->cpu_res == smp_processor_id()) { \
-       printk("nicstar.c: line %d (cpu %d) res_lock already locked at line %d (cpu %d)\n", \
-              __LINE__, smp_processor_id(), (card)->has_res_lock, \
-              (card)->cpu_res); \
-       printk("nicstar.c: ints were %sabled.\n", ((flags)&(1<<9)?"en":"dis")); \
-    } \
-    spin_lock_irq(&(card)->res_lock); \
-    (card)->has_res_lock = __LINE__; \
-    (card)->cpu_res = smp_processor_id(); \
-    restore_flags(nsdsf); } while (0)
-#define ns_grab_scq_lock(card,scq,flags) \
- do { \
-    unsigned long nsdsf, nsdsf2; \
-    local_irq_save(flags); \
-    save_flags(nsdsf); cli();\
-    if (nsdsf & (1<<9)) printk ("nicstar.c: ints %sabled -> enabled.\n", \
-                                (flags)&(1<<9)?"en":"dis"); \
-    if (spin_is_locked(&(scq)->lock) && \
-        (scq)->cpu_lock == smp_processor_id()) { \
-       printk("nicstar.c: line %d (cpu %d) this scq_lock already locked at line %d (cpu %d)\n", \
-              __LINE__, smp_processor_id(), (scq)->has_lock, \
-              (scq)->cpu_lock); \
-       printk("nicstar.c: ints were %sabled.\n", ((flags)&(1<<9)?"en":"dis")); \
-    } \
-    if (spin_is_locked(&(card)->res_lock) && \
-        (card)->cpu_res == smp_processor_id()) { \
-       printk("nicstar.c: line %d (cpu %d) res_lock locked at line %d (cpu %d)(trying scq)\n", \
-              __LINE__, smp_processor_id(), (card)->has_res_lock, \
-              (card)->cpu_res); \
-       printk("nicstar.c: ints were %sabled.\n", ((flags)&(1<<9)?"en":"dis")); \
-    } \
-    spin_lock_irq(&(scq)->lock); \
-    (scq)->has_lock = __LINE__; \
-    (scq)->cpu_lock = smp_processor_id(); \
-    restore_flags(nsdsf); } while (0)
-#else /* !NS_DEBUG_SPINLOCKS */
-#define ns_grab_int_lock(card,flags) \
-        spin_lock_irqsave(&(card)->int_lock,(flags))
-#define ns_grab_res_lock(card,flags) \
-        spin_lock_irqsave(&(card)->res_lock,(flags))
-#define ns_grab_scq_lock(card,scq,flags) \
-        spin_lock_irqsave(&(scq)->lock,flags)
-#endif /* NS_DEBUG_SPINLOCKS */
-
 
 /* Function declarations ******************************************************/
 
@@ -422,7 +343,7 @@ static u32 ns_read_sram(ns_dev *card, u32 sram_address)
    sram_address <<= 2;
    sram_address &= 0x0007FFFC; /* address must be dword aligned */
    sram_address |= 0x50000000; /* SRAM read command */
-   ns_grab_res_lock(card, flags);
+   spin_lock_irqsave(&card->res_lock, flags);
    while (CMD_BUSY(card));
    writel(sram_address, card->membase + CMD);
    while (CMD_BUSY(card));
@@ -440,7 +361,7 @@ static void ns_write_sram(ns_dev *card, u32 sram_address, u32 *value, int count)
    count--;    /* count range now is 0..3 instead of 1..4 */
    c = count;
    c <<= 2;    /* to use increments of 4 */
-   ns_grab_res_lock(card, flags);
+   spin_lock_irqsave(&card->res_lock, flags);
    while (CMD_BUSY(card));
    for (i = 0; i <= c; i += 4)
       writel(*(value++), card->membase + i);
@@ -1166,7 +1087,7 @@ static void push_rxbufs(ns_dev *card, struct sk_buff *skb)
             card->lbfqc += 2;
       }
 
-      ns_grab_res_lock(card, flags);
+      spin_lock_irqsave(&card->res_lock, flags);
 
       while (CMD_BUSY(card));
       writel(addr2, card->membase + DR3);
@@ -1206,7 +1127,7 @@ static irqreturn_t ns_irq_handler(int irq, void *dev_id)
 
    PRINTK("nicstar%d: NICStAR generated an interrupt\n", card->index);
 
-   ns_grab_int_lock(card, flags);
+   spin_lock_irqsave(&card->int_lock, flags);
    
    stat_r = readl(card->membase + STAT);
 
@@ -1585,7 +1506,7 @@ static void ns_close(struct atm_vcc *vcc)
       unsigned long flags;
       
       addr = NS_RCT + (vcc->vpi << card->vcibits | vcc->vci) * NS_RCT_ENTRY_SIZE;
-      ns_grab_res_lock(card, flags);
+      spin_lock_irqsave(&card->res_lock, flags);
       while(CMD_BUSY(card));
       writel(NS_CMD_CLOSE_CONNECTION | addr << 2, card->membase + CMD);
       spin_unlock_irqrestore(&card->res_lock, flags);
@@ -1607,7 +1528,7 @@ static void ns_close(struct atm_vcc *vcc)
                               NS_SKB(iovb)->iovcnt);
          NS_SKB(iovb)->iovcnt = 0;
          NS_SKB(iovb)->vcc = NULL;
-         ns_grab_int_lock(card, flags);
+         spin_lock_irqsave(&card->int_lock, flags);
          recycle_iov_buf(card, iovb);
          spin_unlock_irqrestore(&card->int_lock, flags);
          vc->rx_iov = NULL;
@@ -1629,7 +1550,7 @@ static void ns_close(struct atm_vcc *vcc)
 
       for (;;)
       {
-         ns_grab_scq_lock(card, scq, flags);
+         spin_lock_irqsave(&scq->lock, flags);
          scqep = scq->next;
          if (scqep == scq->base)
             scqep = scq->last;
@@ -1691,7 +1612,7 @@ static void ns_close(struct atm_vcc *vcc)
      unsigned long flags;
      scq_info *scq = card->scq0;
 
-     ns_grab_scq_lock(card, scq, flags);
+     spin_lock_irqsave(&scq->lock, flags);
 
      for(i = 0; i < scq->num_entries; i++) {
        if(scq->skb[i] && ATM_SKB(scq->skb[i])->vcc == vcc) {
@@ -1892,7 +1813,7 @@ static int push_scqe(ns_dev *card, vc_map *vc, scq_info *scq, ns_scqe *tbd,
    u32 data;
    int index;
    
-   ns_grab_scq_lock(card, scq, flags);
+   spin_lock_irqsave(&scq->lock, flags);
    while (scq->tail == scq->next)
    {
       if (in_interrupt()) {
@@ -1904,7 +1825,7 @@ static int push_scqe(ns_dev *card, vc_map *vc, scq_info *scq, ns_scqe *tbd,
       scq->full = 1;
       spin_unlock_irqrestore(&scq->lock, flags);
       interruptible_sleep_on_timeout(&scq->scqfull_waitq, SCQFULL_TIMEOUT);
-      ns_grab_scq_lock(card, scq, flags);
+      spin_lock_irqsave(&scq->lock, flags);
 
       if (scq->full) {
          spin_unlock_irqrestore(&scq->lock, flags);
@@ -1953,7 +1874,7 @@ static int push_scqe(ns_dev *card, vc_map *vc, scq_info *scq, ns_scqe *tbd,
          if (has_run++) break;
          spin_unlock_irqrestore(&scq->lock, flags);
          interruptible_sleep_on_timeout(&scq->scqfull_waitq, SCQFULL_TIMEOUT);
-         ns_grab_scq_lock(card, scq, flags);
+         spin_lock_irqsave(&scq->lock, flags);
       }
 
       if (!scq->full)
@@ -2090,7 +2011,7 @@ static void drain_scq(ns_dev *card, scq_info *scq, int pos)
       return;
    }
 
-   ns_grab_scq_lock(card, scq, flags);
+   spin_lock_irqsave(&scq->lock, flags);
    i = (int) (scq->tail - scq->base);
    if (++i == scq->num_entries)
       i = 0;
@@ -2898,7 +2819,7 @@ static int ns_ioctl(struct atm_dev *dev, unsigned int cmd, void __user *arg)
               {
                   struct sk_buff *hb;
 
-                  ns_grab_int_lock(card, flags);
+                  spin_lock_irqsave(&card->int_lock, flags);
                  hb = skb_dequeue(&card->hbpool.queue);
                  card->hbpool.count--;
                   spin_unlock_irqrestore(&card->int_lock, flags);
@@ -2917,7 +2838,7 @@ static int ns_ioctl(struct atm_dev *dev, unsigned int cmd, void __user *arg)
                   if (hb == NULL)
                      return -ENOMEM;
                   NS_SKB_CB(hb)->buf_type = BUF_NONE;
-                  ns_grab_int_lock(card, flags);
+                  spin_lock_irqsave(&card->int_lock, flags);
                   skb_queue_tail(&card->hbpool.queue, hb);
                   card->hbpool.count++;
                   spin_unlock_irqrestore(&card->int_lock, flags);
@@ -2929,7 +2850,7 @@ static int ns_ioctl(struct atm_dev *dev, unsigned int cmd, void __user *arg)
               {
                  struct sk_buff *iovb;
 
-                  ns_grab_int_lock(card, flags);
+                  spin_lock_irqsave(&card->int_lock, flags);
                  iovb = skb_dequeue(&card->iovpool.queue);
                  card->iovpool.count--;
                   spin_unlock_irqrestore(&card->int_lock, flags);
@@ -2948,7 +2869,7 @@ static int ns_ioctl(struct atm_dev *dev, unsigned int cmd, void __user *arg)
                   if (iovb == NULL)
                      return -ENOMEM;
                   NS_SKB_CB(iovb)->buf_type = BUF_NONE;
-                  ns_grab_int_lock(card, flags);
+                  spin_lock_irqsave(&card->int_lock, flags);
                   skb_queue_tail(&card->iovpool.queue, iovb);
                   card->iovpool.count++;
                   spin_unlock_irqrestore(&card->int_lock, flags);
@@ -2995,7 +2916,7 @@ static void ns_poll(unsigned long arg)
       /* Probably it isn't worth spinning */
          continue;
       }
-      ns_grab_int_lock(card, flags);
+      spin_lock_irqsave(&card->int_lock, flags);
 
       stat_w = 0;
       stat_r = readl(card->membase + STAT);
@@ -3062,7 +2983,7 @@ static void ns_phy_put(struct atm_dev *dev, unsigned char value,
    unsigned long flags;
 
    card = dev->dev_data;
-   ns_grab_res_lock(card, flags);
+   spin_lock_irqsave(&card->res_lock, flags);
    while(CMD_BUSY(card));
    writel((unsigned long) value, card->membase + DR0);
    writel(NS_CMD_WRITE_UTILITY | 0x00000200 | (addr & 0x000000FF),
@@ -3079,7 +3000,7 @@ static unsigned char ns_phy_get(struct atm_dev *dev, unsigned long addr)
    unsigned long data;
 
    card = dev->dev_data;
-   ns_grab_res_lock(card, flags);
+   spin_lock_irqsave(&card->res_lock, flags);
    while(CMD_BUSY(card));
    writel(NS_CMD_READ_UTILITY | 0x00000200 | (addr & 0x000000FF),
           card->membase + CMD);
index 5997bcb45b59492486bafb4d951b6171a6a01049..6010e3daa6a21fd6e6c5fd23dd32cf9634497593 100644 (file)
@@ -28,8 +28,6 @@
 
 /* Options ********************************************************************/
 
-#undef NS_DEBUG_SPINLOCKS
-
 #define NS_MAX_CARDS 4         /* Maximum number of NICStAR based cards
                                   controlled by the device driver. Must
                                    be <= 5 */
@@ -721,10 +719,6 @@ typedef struct scq_info
    wait_queue_head_t scqfull_waitq;
    volatile char full;                 /* SCQ full indicator */
    spinlock_t lock;                    /* SCQ spinlock */
-#ifdef NS_DEBUG_SPINLOCKS
-   volatile long has_lock;
-   volatile int cpu_lock;
-#endif /* NS_DEBUG_SPINLOCKS */
 } scq_info;
 
 
@@ -810,12 +804,6 @@ typedef struct ns_dev
    unsigned intcnt;                    /* Interrupt counter */
    spinlock_t int_lock;                /* Interrupt lock */
    spinlock_t res_lock;                /* Card resource lock */
-#ifdef NS_DEBUG_SPINLOCKS
-   volatile long has_int_lock;
-   volatile int cpu_int;
-   volatile long has_res_lock;
-   volatile int cpu_res;
-#endif /* NS_DEBUG_SPINLOCKS */
 } ns_dev;
 
 
index 3b43e8a9f87e45e0763c8ae3d7b7d5b539616151..f57652db0a2a1261ef79e0c59326be6163bcaa1c 100644 (file)
 struct internal_container {
        struct klist_node node;
        struct attribute_container *cont;
-       struct class_device classdev;
+       struct device classdev;
 };
 
 static void internal_container_klist_get(struct klist_node *n)
 {
        struct internal_container *ic =
                container_of(n, struct internal_container, node);
-       class_device_get(&ic->classdev);
+       get_device(&ic->classdev);
 }
 
 static void internal_container_klist_put(struct klist_node *n)
 {
        struct internal_container *ic =
                container_of(n, struct internal_container, node);
-       class_device_put(&ic->classdev);
+       put_device(&ic->classdev);
 }
 
 
@@ -53,7 +53,7 @@ static void internal_container_klist_put(struct klist_node *n)
  * Returns the container associated with this classdev.
  */
 struct attribute_container *
-attribute_container_classdev_to_container(struct class_device *classdev)
+attribute_container_classdev_to_container(struct device *classdev)
 {
        struct internal_container *ic =
                container_of(classdev, struct internal_container, classdev);
@@ -110,11 +110,11 @@ attribute_container_unregister(struct attribute_container *cont)
 EXPORT_SYMBOL_GPL(attribute_container_unregister);
 
 /* private function used as class release */
-static void attribute_container_release(struct class_device *classdev)
+static void attribute_container_release(struct device *classdev)
 {
        struct internal_container *ic 
                = container_of(classdev, struct internal_container, classdev);
-       struct device *dev = classdev->dev;
+       struct device *dev = classdev->parent;
 
        kfree(ic);
        put_device(dev);
@@ -129,12 +129,12 @@ static void attribute_container_release(struct class_device *classdev)
  * This function allocates storage for the class device(s) to be
  * attached to dev (one for each matching attribute_container).  If no
  * fn is provided, the code will simply register the class device via
- * class_device_add.  If a function is provided, it is expected to add
+ * device_add.  If a function is provided, it is expected to add
  * the class device at the appropriate time.  One of the things that
  * might be necessary is to allocate and initialise the classdev and
  * then add it a later time.  To do this, call this routine for
  * allocation and initialisation and then use
- * attribute_container_device_trigger() to call class_device_add() on
+ * attribute_container_device_trigger() to call device_add() on
  * it.  Note: after this, the class device contains a reference to dev
  * which is not relinquished until the release of the classdev.
  */
@@ -142,7 +142,7 @@ void
 attribute_container_add_device(struct device *dev,
                               int (*fn)(struct attribute_container *,
                                         struct device *,
-                                        struct class_device *))
+                                        struct device *))
 {
        struct attribute_container *cont;
 
@@ -163,11 +163,11 @@ attribute_container_add_device(struct device *dev,
                }
 
                ic->cont = cont;
-               class_device_initialize(&ic->classdev);
-               ic->classdev.dev = get_device(dev);
+               device_initialize(&ic->classdev);
+               ic->classdev.parent = get_device(dev);
                ic->classdev.class = cont->class;
-               cont->class->release = attribute_container_release;
-               strcpy(ic->classdev.class_id, dev->bus_id);
+               cont->class->dev_release = attribute_container_release;
+               strcpy(ic->classdev.bus_id, dev->bus_id);
                if (fn)
                        fn(cont, dev, &ic->classdev);
                else
@@ -195,20 +195,19 @@ attribute_container_add_device(struct device *dev,
  * @fn:          A function to call to remove the device
  *
  * This routine triggers device removal.  If fn is NULL, then it is
- * simply done via class_device_unregister (note that if something
+ * simply done via device_unregister (note that if something
  * still has a reference to the classdev, then the memory occupied
  * will not be freed until the classdev is released).  If you want a
  * two phase release: remove from visibility and then delete the
  * device, then you should use this routine with a fn that calls
- * class_device_del() and then use
- * attribute_container_device_trigger() to do the final put on the
- * classdev.
+ * device_del() and then use attribute_container_device_trigger()
+ * to do the final put on the classdev.
  */
 void
 attribute_container_remove_device(struct device *dev,
                                  void (*fn)(struct attribute_container *,
                                             struct device *,
-                                            struct class_device *))
+                                            struct device *))
 {
        struct attribute_container *cont;
 
@@ -224,14 +223,14 @@ attribute_container_remove_device(struct device *dev,
                        continue;
 
                klist_for_each_entry(ic, &cont->containers, node, &iter) {
-                       if (dev != ic->classdev.dev)
+                       if (dev != ic->classdev.parent)
                                continue;
                        klist_del(&ic->node);
                        if (fn)
                                fn(cont, dev, &ic->classdev);
                        else {
                                attribute_container_remove_attrs(&ic->classdev);
-                               class_device_unregister(&ic->classdev);
+                               device_unregister(&ic->classdev);
                        }
                }
        }
@@ -252,7 +251,7 @@ void
 attribute_container_device_trigger(struct device *dev, 
                                   int (*fn)(struct attribute_container *,
                                             struct device *,
-                                            struct class_device *))
+                                            struct device *))
 {
        struct attribute_container *cont;
 
@@ -270,7 +269,7 @@ attribute_container_device_trigger(struct device *dev,
                }
 
                klist_for_each_entry(ic, &cont->containers, node, &iter) {
-                       if (dev == ic->classdev.dev)
+                       if (dev == ic->classdev.parent)
                                fn(cont, dev, &ic->classdev);
                }
        }
@@ -313,11 +312,11 @@ attribute_container_trigger(struct device *dev,
  * attributes listed in the container
  */
 int
-attribute_container_add_attrs(struct class_device *classdev)
+attribute_container_add_attrs(struct device *classdev)
 {
        struct attribute_container *cont =
                attribute_container_classdev_to_container(classdev);
-       struct class_device_attribute **attrs = cont->attrs;
+       struct device_attribute **attrs = cont->attrs;
        int i, error;
 
        BUG_ON(attrs && cont->grp);
@@ -329,7 +328,7 @@ attribute_container_add_attrs(struct class_device *classdev)
                return sysfs_create_group(&classdev->kobj, cont->grp);
 
        for (i = 0; attrs[i]; i++) {
-               error = class_device_create_file(classdev, attrs[i]);
+               error = device_create_file(classdev, attrs[i]);
                if (error)
                        return error;
        }
@@ -338,18 +337,18 @@ attribute_container_add_attrs(struct class_device *classdev)
 }
 
 /**
- * attribute_container_add_class_device - same function as class_device_add
+ * attribute_container_add_class_device - same function as device_add
  *
  * @classdev:  the class device to add
  *
- * This performs essentially the same function as class_device_add except for
+ * This performs essentially the same function as device_add except for
  * attribute containers, namely add the classdev to the system and then
  * create the attribute files
  */
 int
-attribute_container_add_class_device(struct class_device *classdev)
+attribute_container_add_class_device(struct device *classdev)
 {
-       int error = class_device_add(classdev);
+       int error = device_add(classdev);
        if (error)
                return error;
        return attribute_container_add_attrs(classdev);
@@ -364,7 +363,7 @@ attribute_container_add_class_device(struct class_device *classdev)
 int
 attribute_container_add_class_device_adapter(struct attribute_container *cont,
                                             struct device *dev,
-                                            struct class_device *classdev)
+                                            struct device *classdev)
 {
        return attribute_container_add_class_device(classdev);
 }
@@ -376,11 +375,11 @@ attribute_container_add_class_device_adapter(struct attribute_container *cont,
  *
  */
 void
-attribute_container_remove_attrs(struct class_device *classdev)
+attribute_container_remove_attrs(struct device *classdev)
 {
        struct attribute_container *cont =
                attribute_container_classdev_to_container(classdev);
-       struct class_device_attribute **attrs = cont->attrs;
+       struct device_attribute **attrs = cont->attrs;
        int i;
 
        if (!attrs && !cont->grp)
@@ -392,7 +391,7 @@ attribute_container_remove_attrs(struct class_device *classdev)
        }
 
        for (i = 0; attrs[i]; i++)
-               class_device_remove_file(classdev, attrs[i]);
+               device_remove_file(classdev, attrs[i]);
 }
 
 /**
@@ -401,13 +400,13 @@ attribute_container_remove_attrs(struct class_device *classdev)
  * @classdev: the class device
  *
  * This function simply removes all the attribute files and then calls
- * class_device_del.
+ * device_del.
  */
 void
-attribute_container_class_device_del(struct class_device *classdev)
+attribute_container_class_device_del(struct device *classdev)
 {
        attribute_container_remove_attrs(classdev);
-       class_device_del(classdev);
+       device_del(classdev);
 }
 
 /**
@@ -419,16 +418,16 @@ attribute_container_class_device_del(struct class_device *classdev)
  * Looks up the device in the container's list of class devices and returns
  * the corresponding class_device.
  */
-struct class_device *
+struct device *
 attribute_container_find_class_device(struct attribute_container *cont,
                                      struct device *dev)
 {
-       struct class_device *cdev = NULL;
+       struct device *cdev = NULL;
        struct internal_container *ic;
        struct klist_iter iter;
 
        klist_for_each_entry(ic, &cont->containers, node, &iter) {
-               if (ic->classdev.dev == dev) {
+               if (ic->classdev.parent == dev) {
                        cdev = &ic->classdev;
                        /* FIXME: must exit iterator then break */
                        klist_iter_exit(&iter);
index 2d207ad303367ac12adb58ef795b6f622bd11789..be1cc514335456c64622304836558b6f0d102a28 100644 (file)
@@ -79,7 +79,7 @@ static void driver_release(struct kobject *kobj)
 {
        struct driver_private *drv_priv = to_driver(kobj);
 
-       pr_debug("driver: '%s': %s\n", kobject_name(kobj), __FUNCTION__);
+       pr_debug("driver: '%s': %s\n", kobject_name(kobj), __func__);
        kfree(drv_priv);
 }
 
@@ -505,14 +505,11 @@ void bus_attach_device(struct device *dev)
        int ret = 0;
 
        if (bus) {
-               dev->is_registered = 1;
                if (bus->p->drivers_autoprobe)
                        ret = device_attach(dev);
                WARN_ON(ret < 0);
                if (ret >= 0)
                        klist_add_tail(&dev->knode_bus, &bus->p->klist_devices);
-               else
-                       dev->is_registered = 0;
        }
 }
 
@@ -533,10 +530,8 @@ void bus_remove_device(struct device *dev)
                sysfs_remove_link(&dev->bus->p->devices_kset->kobj,
                                  dev->bus_id);
                device_remove_attrs(dev->bus, dev);
-               if (dev->is_registered) {
-                       dev->is_registered = 0;
-                       klist_del(&dev->knode_bus);
-               }
+               klist_del(&dev->knode_bus);
+
                pr_debug("bus: '%s': remove device %s\n",
                         dev->bus->name, dev->bus_id);
                device_release_driver(dev);
@@ -682,19 +677,19 @@ int bus_add_driver(struct device_driver *drv)
        error = driver_create_file(drv, &driver_attr_uevent);
        if (error) {
                printk(KERN_ERR "%s: uevent attr (%s) failed\n",
-                       __FUNCTION__, drv->name);
+                       __func__, drv->name);
        }
        error = driver_add_attrs(bus, drv);
        if (error) {
                /* How the hell do we get out of this pickle? Give up */
                printk(KERN_ERR "%s: driver_add_attrs(%s) failed\n",
-                       __FUNCTION__, drv->name);
+                       __func__, drv->name);
        }
        error = add_bind_files(drv);
        if (error) {
                /* Ditto */
                printk(KERN_ERR "%s: add_bind_files(%s) failed\n",
-                       __FUNCTION__, drv->name);
+                       __func__, drv->name);
        }
 
        kobject_uevent(&priv->kobj, KOBJ_ADD);
index 9d915376c313d1049e9dc0c8cdd65d2c788db3bd..b4901799308b00d2755e1536e477976a8302ff08 100644 (file)
@@ -175,13 +175,13 @@ void class_unregister(struct class *cls)
 
 static void class_create_release(struct class *cls)
 {
-       pr_debug("%s called for %s\n", __FUNCTION__, cls->name);
+       pr_debug("%s called for %s\n", __func__, cls->name);
        kfree(cls);
 }
 
 static void class_device_create_release(struct class_device *class_dev)
 {
-       pr_debug("%s called for %s\n", __FUNCTION__, class_dev->class_id);
+       pr_debug("%s called for %s\n", __func__, class_dev->class_id);
        kfree(class_dev);
 }
 
@@ -189,7 +189,7 @@ static void class_device_create_release(struct class_device *class_dev)
 static int class_device_create_uevent(struct class_device *class_dev,
                                      struct kobj_uevent_env *env)
 {
-       pr_debug("%s called for %s\n", __FUNCTION__, class_dev->class_id);
+       pr_debug("%s called for %s\n", __func__, class_dev->class_id);
        return 0;
 }
 
@@ -415,7 +415,7 @@ static int class_uevent(struct kset *kset, struct kobject *kobj,
        struct device *dev = class_dev->dev;
        int retval = 0;
 
-       pr_debug("%s - name = %s\n", __FUNCTION__, class_dev->class_id);
+       pr_debug("%s - name = %s\n", __func__, class_dev->class_id);
 
        if (MAJOR(class_dev->devt)) {
                add_uevent_var(env, "MAJOR=%u", MAJOR(class_dev->devt));
index 24198ad0197654943ae95250b22386358cb22e71..9248e0927d0873062800a4fd10ee2746bb956c34 100644 (file)
@@ -20,7 +20,7 @@
 #include <linux/notifier.h>
 #include <linux/genhd.h>
 #include <linux/kallsyms.h>
-#include <asm/semaphore.h>
+#include <linux/semaphore.h>
 
 #include "base.h"
 #include "power/power.h"
@@ -207,7 +207,7 @@ static int dev_uevent(struct kset *kset, struct kobject *kobj,
                retval = dev->bus->uevent(dev, env);
                if (retval)
                        pr_debug("device: '%s': %s: bus uevent() returned %d\n",
-                                dev->bus_id, __FUNCTION__, retval);
+                                dev->bus_id, __func__, retval);
        }
 
        /* have the class specific function add its stuff */
@@ -216,7 +216,7 @@ static int dev_uevent(struct kset *kset, struct kobject *kobj,
                if (retval)
                        pr_debug("device: '%s': %s: class uevent() "
                                 "returned %d\n", dev->bus_id,
-                                __FUNCTION__, retval);
+                                __func__, retval);
        }
 
        /* have the device type specific fuction add its stuff */
@@ -225,7 +225,7 @@ static int dev_uevent(struct kset *kset, struct kobject *kobj,
                if (retval)
                        pr_debug("device: '%s': %s: dev_type uevent() "
                                 "returned %d\n", dev->bus_id,
-                                __FUNCTION__, retval);
+                                __func__, retval);
        }
 
        return retval;
@@ -782,7 +782,7 @@ int device_add(struct device *dev)
                goto Done;
        }
 
-       pr_debug("device: '%s': %s\n", dev->bus_id, __FUNCTION__);
+       pr_debug("device: '%s': %s\n", dev->bus_id, __func__);
 
        parent = get_device(dev->parent);
        setup_parent(dev, parent);
@@ -817,13 +817,12 @@ int device_add(struct device *dev)
        error = device_add_attrs(dev);
        if (error)
                goto AttrsError;
-       error = dpm_sysfs_add(dev);
-       if (error)
-               goto PMError;
-       device_pm_add(dev);
        error = bus_add_device(dev);
        if (error)
                goto BusError;
+       error = device_pm_add(dev);
+       if (error)
+               goto PMError;
        kobject_uevent(&dev->kobj, KOBJ_ADD);
        bus_attach_device(dev);
        if (parent)
@@ -843,9 +842,9 @@ int device_add(struct device *dev)
  Done:
        put_device(dev);
        return error;
- BusError:
-       device_pm_remove(dev);
  PMError:
+       bus_remove_device(dev);
+ BusError:
        if (dev->bus)
                blocking_notifier_call_chain(&dev->bus->p->bus_notifier,
                                             BUS_NOTIFY_DEL_DEVICE, dev);
@@ -981,7 +980,7 @@ void device_del(struct device *dev)
  */
 void device_unregister(struct device *dev)
 {
-       pr_debug("device: '%s': %s\n", dev->bus_id, __FUNCTION__);
+       pr_debug("device: '%s': %s\n", dev->bus_id, __func__);
        device_del(dev);
        put_device(dev);
 }
@@ -1076,7 +1075,7 @@ EXPORT_SYMBOL_GPL(device_remove_file);
 
 static void device_create_release(struct device *dev)
 {
-       pr_debug("device: '%s': %s\n", dev->bus_id, __FUNCTION__);
+       pr_debug("device: '%s': %s\n", dev->bus_id, __func__);
        kfree(dev);
 }
 
@@ -1164,35 +1163,6 @@ void device_destroy(struct class *class, dev_t devt)
 }
 EXPORT_SYMBOL_GPL(device_destroy);
 
-#ifdef CONFIG_PM_SLEEP
-/**
- * destroy_suspended_device - asks the PM core to remove a suspended device
- * @class: pointer to the struct class that this device was registered with
- * @devt: the dev_t of the device that was previously registered
- *
- * This call notifies the PM core of the necessity to unregister a suspended
- * device created with a call to device_create() (devices cannot be
- * unregistered directly while suspended, since the PM core holds their
- * semaphores at that time).
- *
- * It can only be called within the scope of a system sleep transition.  In
- * practice this means it has to be directly or indirectly invoked either by
- * a suspend or resume method, or by the PM core (e.g. via
- * disable_nonboot_cpus() or enable_nonboot_cpus()).
- */
-void destroy_suspended_device(struct class *class, dev_t devt)
-{
-       struct device *dev;
-
-       dev = class_find_device(class, &devt, __match_devt);
-       if (dev) {
-               device_pm_schedule_removal(dev);
-               put_device(dev);
-       }
-}
-EXPORT_SYMBOL_GPL(destroy_suspended_device);
-#endif /* CONFIG_PM_SLEEP */
-
 /**
  * device_rename - renames a device
  * @dev: the pointer to the struct device to be renamed
@@ -1210,7 +1180,7 @@ int device_rename(struct device *dev, char *new_name)
                return -EINVAL;
 
        pr_debug("device: '%s': %s: renaming to '%s'\n", dev->bus_id,
-                __FUNCTION__, new_name);
+                __func__, new_name);
 
 #ifdef CONFIG_SYSFS_DEPRECATED
        if ((dev->class) && (dev->parent))
@@ -1249,7 +1219,7 @@ int device_rename(struct device *dev, char *new_name)
                                          dev->bus_id);
                if (error) {
                        dev_err(dev, "%s: sysfs_create_symlink failed (%d)\n",
-                               __FUNCTION__, error);
+                               __func__, error);
                }
        }
 #endif
@@ -1325,7 +1295,7 @@ int device_move(struct device *dev, struct device *new_parent)
        new_parent_kobj = get_device_parent(dev, new_parent);
 
        pr_debug("device: '%s': %s: moving to '%s'\n", dev->bus_id,
-                __FUNCTION__, new_parent ? new_parent->bus_id : "<NULL>");
+                __func__, new_parent ? new_parent->bus_id : "<NULL>");
        error = kobject_move(&dev->kobj, new_parent_kobj);
        if (error) {
                cleanup_glue_dir(dev, new_parent_kobj);
index 499b003f92782dfc8259791d6f13b4a377f24f5b..6fe417429977058b40f9ac2caee0b5b933078070 100644 (file)
@@ -28,7 +28,7 @@ static ssize_t show_online(struct sys_device *dev, char *buf)
        return sprintf(buf, "%u\n", !!cpu_online(cpu->sysdev.id));
 }
 
-static ssize_t store_online(struct sys_device *dev, const char *buf,
+static ssize_t __ref store_online(struct sys_device *dev, const char *buf,
                            size_t count)
 {
        struct cpu *cpu = container_of(dev, struct cpu, sysdev);
@@ -55,7 +55,7 @@ static ssize_t store_online(struct sys_device *dev, const char *buf,
 }
 static SYSDEV_ATTR(online, 0644, show_online, store_online);
 
-static void __devinit register_cpu_control(struct cpu *cpu)
+static void __cpuinit register_cpu_control(struct cpu *cpu)
 {
        sysdev_create_file(&cpu->sysdev, &attr_online);
 }
@@ -102,6 +102,51 @@ static ssize_t show_crash_notes(struct sys_device *dev, char *buf)
 static SYSDEV_ATTR(crash_notes, 0400, show_crash_notes, NULL);
 #endif
 
+/*
+ * Print cpu online, possible, present, and system maps
+ */
+static ssize_t print_cpus_map(char *buf, cpumask_t *map)
+{
+       int n = cpulist_scnprintf(buf, PAGE_SIZE-2, *map);
+
+       buf[n++] = '\n';
+       buf[n] = '\0';
+       return n;
+}
+
+#define        print_cpus_func(type) \
+static ssize_t print_cpus_##type(struct sysdev_class *class, char *buf)        \
+{                                                                      \
+       return print_cpus_map(buf, &cpu_##type##_map);                  \
+}                                                                      \
+struct sysdev_class_attribute attr_##type##_map =                      \
+       _SYSDEV_CLASS_ATTR(type, 0444, print_cpus_##type, NULL)
+
+print_cpus_func(online);
+print_cpus_func(possible);
+print_cpus_func(present);
+
+struct sysdev_class_attribute *cpu_state_attr[] = {
+       &attr_online_map,
+       &attr_possible_map,
+       &attr_present_map,
+};
+
+static int cpu_states_init(void)
+{
+       int i;
+       int err = 0;
+
+       for (i = 0;  i < ARRAY_SIZE(cpu_state_attr); i++) {
+               int ret;
+               ret = sysdev_class_create_file(&cpu_sysdev_class,
+                                               cpu_state_attr[i]);
+               if (!err)
+                       err = ret;
+       }
+       return err;
+}
+
 /*
  * register_cpu - Setup a sysfs device for a CPU.
  * @cpu - cpu->hotpluggable field set to 1 will generate a control file in
@@ -147,6 +192,9 @@ int __init cpu_dev_init(void)
        int err;
 
        err = sysdev_class_register(&cpu_sysdev_class);
+       if (!err)
+               err = cpu_states_init();
+
 #if defined(CONFIG_SCHED_MC) || defined(CONFIG_SCHED_SMT)
        if (!err)
                err = sched_create_sysfs_power_savings_entries(&cpu_sysdev_class);
index a5cde94bb982aacc2b111e0c65773d8be8378351..3ac443b2ac08579b978b7f49de2a2b73034a88cf 100644 (file)
@@ -30,12 +30,12 @@ static void driver_bound(struct device *dev)
 {
        if (klist_node_attached(&dev->knode_driver)) {
                printk(KERN_WARNING "%s: device %s already bound\n",
-                       __FUNCTION__, kobject_name(&dev->kobj));
+                       __func__, kobject_name(&dev->kobj));
                return;
        }
 
        pr_debug("driver: '%s': %s: bound to device '%s'\n", dev->bus_id,
-                __FUNCTION__, dev->driver->name);
+                __func__, dev->driver->name);
 
        if (dev->bus)
                blocking_notifier_call_chain(&dev->bus->p->bus_notifier,
@@ -104,13 +104,13 @@ static int really_probe(struct device *dev, struct device_driver *drv)
 
        atomic_inc(&probe_count);
        pr_debug("bus: '%s': %s: probing driver %s with device %s\n",
-                drv->bus->name, __FUNCTION__, drv->name, dev->bus_id);
+                drv->bus->name, __func__, drv->name, dev->bus_id);
        WARN_ON(!list_empty(&dev->devres_head));
 
        dev->driver = drv;
        if (driver_sysfs_add(dev)) {
                printk(KERN_ERR "%s: driver_sysfs_add(%s) failed\n",
-                       __FUNCTION__, dev->bus_id);
+                       __func__, dev->bus_id);
                goto probe_failed;
        }
 
@@ -127,7 +127,7 @@ static int really_probe(struct device *dev, struct device_driver *drv)
        driver_bound(dev);
        ret = 1;
        pr_debug("bus: '%s': %s: bound device %s to driver %s\n",
-                drv->bus->name, __FUNCTION__, dev->bus_id, drv->name);
+                drv->bus->name, __func__, dev->bus_id, drv->name);
        goto done;
 
 probe_failed:
@@ -160,7 +160,7 @@ done:
  */
 int driver_probe_done(void)
 {
-       pr_debug("%s: probe_count = %d\n", __FUNCTION__,
+       pr_debug("%s: probe_count = %d\n", __func__,
                 atomic_read(&probe_count));
        if (atomic_read(&probe_count))
                return -EBUSY;
@@ -194,7 +194,7 @@ int driver_probe_device(struct device_driver *drv, struct device *dev)
                goto done;
 
        pr_debug("bus: '%s': %s: matched device %s with driver %s\n",
-                drv->bus->name, __FUNCTION__, dev->bus_id, drv->name);
+                drv->bus->name, __func__, dev->bus_id, drv->name);
 
        ret = really_probe(dev, drv);
 
index 4a1b9bfc5471fe91ade02cedfaab22f6cec0d636..1fef7df8c9d601417312c088a6c0b8b9351646c8 100644 (file)
@@ -156,7 +156,7 @@ static ssize_t firmware_loading_store(struct device *dev,
                }
                /* fallthrough */
        default:
-               printk(KERN_ERR "%s: unexpected value (%d)\n", __FUNCTION__,
+               printk(KERN_ERR "%s: unexpected value (%d)\n", __func__,
                       loading);
                /* fallthrough */
        case -1:
@@ -209,7 +209,7 @@ fw_realloc_buffer(struct firmware_priv *fw_priv, int min_size)
        new_size = ALIGN(min_size, PAGE_SIZE);
        new_data = vmalloc(new_size);
        if (!new_data) {
-               printk(KERN_ERR "%s: unable to alloc buffer\n", __FUNCTION__);
+               printk(KERN_ERR "%s: unable to alloc buffer\n", __func__);
                /* Make sure that we don't keep incomplete data */
                fw_load_abort(fw_priv);
                return -ENOMEM;
@@ -307,7 +307,7 @@ static int fw_register_device(struct device **dev_p, const char *fw_name,
        *dev_p = NULL;
 
        if (!fw_priv || !f_dev) {
-               printk(KERN_ERR "%s: kmalloc failed\n", __FUNCTION__);
+               printk(KERN_ERR "%s: kmalloc failed\n", __func__);
                retval = -ENOMEM;
                goto error_kfree;
        }
@@ -328,7 +328,7 @@ static int fw_register_device(struct device **dev_p, const char *fw_name,
        retval = device_register(f_dev);
        if (retval) {
                printk(KERN_ERR "%s: device_register failed\n",
-                      __FUNCTION__);
+                      __func__);
                goto error_kfree;
        }
        *dev_p = f_dev;
@@ -362,14 +362,14 @@ static int fw_setup_device(struct firmware *fw, struct device **dev_p,
        retval = sysfs_create_bin_file(&f_dev->kobj, &fw_priv->attr_data);
        if (retval) {
                printk(KERN_ERR "%s: sysfs_create_bin_file failed\n",
-                      __FUNCTION__);
+                      __func__);
                goto error_unreg;
        }
 
        retval = device_create_file(f_dev, &dev_attr_loading);
        if (retval) {
                printk(KERN_ERR "%s: device_create_file failed\n",
-                      __FUNCTION__);
+                      __func__);
                goto error_unreg;
        }
 
@@ -399,7 +399,7 @@ _request_firmware(const struct firmware **firmware_p, const char *name,
        *firmware_p = firmware = kzalloc(sizeof(*firmware), GFP_KERNEL);
        if (!firmware) {
                printk(KERN_ERR "%s: kmalloc(struct firmware) failed\n",
-                      __FUNCTION__);
+                      __func__);
                retval = -ENOMEM;
                goto out;
        }
@@ -570,13 +570,13 @@ firmware_class_init(void)
        int error;
        error = class_register(&firmware_class);
        if (error) {
-               printk(KERN_ERR "%s: class_register failed\n", __FUNCTION__);
+               printk(KERN_ERR "%s: class_register failed\n", __func__);
                return error;
        }
        error = class_create_file(&firmware_class, &class_attr_timeout);
        if (error) {
                printk(KERN_ERR "%s: class_create_file failed\n",
-                      __FUNCTION__);
+                      __func__);
                class_unregister(&firmware_class);
        }
        return error;
index 7ae413fdd5fc4bd1f0d1b0941316df52dbe8e11f..8ce6de5a7e289f4bcf5138d96d013ba71117d66f 100644 (file)
@@ -20,6 +20,7 @@
 #include <linux/kobject.h>
 #include <linux/memory_hotplug.h>
 #include <linux/mm.h>
+#include <linux/mutex.h>
 #include <asm/atomic.h>
 #include <asm/uaccess.h>
 
@@ -61,8 +62,8 @@ void unregister_memory_notifier(struct notifier_block *nb)
 /*
  * register_memory - Setup a sysfs device for a memory block
  */
-int register_memory(struct memory_block *memory, struct mem_section *section,
-               struct node *root)
+static
+int register_memory(struct memory_block *memory, struct mem_section *section)
 {
        int error;
 
@@ -70,26 +71,18 @@ int register_memory(struct memory_block *memory, struct mem_section *section,
        memory->sysdev.id = __section_nr(section);
 
        error = sysdev_register(&memory->sysdev);
-
-       if (root && !error)
-               error = sysfs_create_link(&root->sysdev.kobj,
-                                         &memory->sysdev.kobj,
-                                         kobject_name(&memory->sysdev.kobj));
-
        return error;
 }
 
 static void
-unregister_memory(struct memory_block *memory, struct mem_section *section,
-               struct node *root)
+unregister_memory(struct memory_block *memory, struct mem_section *section)
 {
        BUG_ON(memory->sysdev.cls != &memory_sysdev_class);
        BUG_ON(memory->sysdev.id != __section_nr(section));
 
+       /* drop the ref. we got in remove_memory_block() */
+       kobject_put(&memory->sysdev.kobj);
        sysdev_unregister(&memory->sysdev);
-       if (root)
-               sysfs_remove_link(&root->sysdev.kobj,
-                                 kobject_name(&memory->sysdev.kobj));
 }
 
 /*
@@ -193,7 +186,7 @@ memory_block_action(struct memory_block *mem, unsigned long action)
                        break;
                default:
                        printk(KERN_WARNING "%s(%p, %ld) unknown action: %ld\n",
-                                       __FUNCTION__, mem, action, action);
+                                       __func__, mem, action, action);
                        WARN_ON(1);
                        ret = -EINVAL;
        }
@@ -205,7 +198,7 @@ static int memory_block_change_state(struct memory_block *mem,
                unsigned long to_state, unsigned long from_state_req)
 {
        int ret = 0;
-       down(&mem->state_sem);
+       mutex_lock(&mem->state_mutex);
 
        if (mem->state != from_state_req) {
                ret = -EINVAL;
@@ -217,7 +210,7 @@ static int memory_block_change_state(struct memory_block *mem,
                mem->state = to_state;
 
 out:
-       up(&mem->state_sem);
+       mutex_unlock(&mem->state_mutex);
        return ret;
 }
 
@@ -341,10 +334,10 @@ static int add_memory_block(unsigned long node_id, struct mem_section *section,
 
        mem->phys_index = __section_nr(section);
        mem->state = state;
-       init_MUTEX(&mem->state_sem);
+       mutex_init(&mem->state_mutex);
        mem->phys_device = phys_device;
 
-       ret = register_memory(mem, section, NULL);
+       ret = register_memory(mem, section);
        if (!ret)
                ret = mem_create_simple_file(mem, phys_index);
        if (!ret)
@@ -395,7 +388,7 @@ int remove_memory_block(unsigned long node_id, struct mem_section *section,
        mem_remove_simple_file(mem, phys_index);
        mem_remove_simple_file(mem, state);
        mem_remove_simple_file(mem, phys_device);
-       unregister_memory(mem, section, NULL);
+       unregister_memory(mem, section);
 
        return 0;
 }
@@ -451,6 +444,6 @@ int __init memory_dev_init(void)
                ret = err;
 out:
        if (ret)
-               printk(KERN_ERR "%s() failed: %d\n", __FUNCTION__, ret);
+               printk(KERN_ERR "%s() failed: %d\n", __func__, ret);
        return ret;
 }
index e59861f18ce55616981e7ca9fbc5ad2a6698f04f..12fde2d03d695a112f02debd25c4fb897a4b937c 100644 (file)
@@ -19,21 +19,34 @@ static struct sysdev_class node_class = {
 };
 
 
-static ssize_t node_read_cpumap(struct sys_device * dev, char * buf)
+static ssize_t node_read_cpumap(struct sys_device *dev, int type, char *buf)
 {
        struct node *node_dev = to_node(dev);
-       cpumask_t mask = node_to_cpumask(node_dev->sysdev.id);
+       node_to_cpumask_ptr(mask, node_dev->sysdev.id);
        int len;
 
-       /* 2004/06/03: buf currently PAGE_SIZE, need > 1 char per 4 bits. */
-       BUILD_BUG_ON(MAX_NUMNODES/4 > PAGE_SIZE/2);
+       /* 2008/04/07: buf currently PAGE_SIZE, need 9 chars per 32 bits. */
+       BUILD_BUG_ON((NR_CPUS/32 * 9) > (PAGE_SIZE-1));
 
-       len = cpumask_scnprintf(buf, PAGE_SIZE-1, mask);
-       len += sprintf(buf + len, "\n");
+       len = type?
+               cpulist_scnprintf(buf, PAGE_SIZE-2, *mask):
+               cpumask_scnprintf(buf, PAGE_SIZE-2, *mask);
+       buf[len++] = '\n';
+       buf[len] = '\0';
        return len;
 }
 
-static SYSDEV_ATTR(cpumap, S_IRUGO, node_read_cpumap, NULL);
+static inline ssize_t node_read_cpumask(struct sys_device *dev, char *buf)
+{
+       return node_read_cpumap(dev, 0, buf);
+}
+static inline ssize_t node_read_cpulist(struct sys_device *dev, char *buf)
+{
+       return node_read_cpumap(dev, 1, buf);
+}
+
+static SYSDEV_ATTR(cpumap,  S_IRUGO, node_read_cpumask, NULL);
+static SYSDEV_ATTR(cpulist, S_IRUGO, node_read_cpulist, NULL);
 
 #define K(x) ((x) << (PAGE_SHIFT - 10))
 static ssize_t node_read_meminfo(struct sys_device * dev, char * buf)
@@ -149,6 +162,7 @@ int register_node(struct node *node, int num, struct node *parent)
 
        if (!error){
                sysdev_create_file(&node->sysdev, &attr_cpumap);
+               sysdev_create_file(&node->sysdev, &attr_cpulist);
                sysdev_create_file(&node->sysdev, &attr_meminfo);
                sysdev_create_file(&node->sysdev, &attr_numastat);
                sysdev_create_file(&node->sysdev, &attr_distance);
@@ -166,6 +180,7 @@ int register_node(struct node *node, int num, struct node *parent)
 void unregister_node(struct node *node)
 {
        sysdev_remove_file(&node->sysdev, &attr_cpumap);
+       sysdev_remove_file(&node->sysdev, &attr_cpulist);
        sysdev_remove_file(&node->sysdev, &attr_meminfo);
        sysdev_remove_file(&node->sysdev, &attr_numastat);
        sysdev_remove_file(&node->sysdev, &attr_distance);
index d887d5cb5bef74496f323a84d94b691ab24a2550..c4568b82875b9fb6379f3c650175143c2ebc6e81 100644 (file)
 LIST_HEAD(dpm_active);
 static LIST_HEAD(dpm_off);
 static LIST_HEAD(dpm_off_irq);
-static LIST_HEAD(dpm_destroy);
 
 static DEFINE_MUTEX(dpm_list_mtx);
 
-static DECLARE_RWSEM(pm_sleep_rwsem);
-
-int (*platform_enable_wakeup)(struct device *dev, int is_on);
+/* 'true' if all devices have been suspended, protected by dpm_list_mtx */
+static bool all_sleeping;
 
 /**
  *     device_pm_add - add a device to the list of active devices
  *     @dev:   Device to be added to the list
  */
-void device_pm_add(struct device *dev)
+int device_pm_add(struct device *dev)
 {
+       int error = 0;
+
        pr_debug("PM: Adding info for %s:%s\n",
                 dev->bus ? dev->bus->name : "No Bus",
                 kobject_name(&dev->kobj));
        mutex_lock(&dpm_list_mtx);
-       list_add_tail(&dev->power.entry, &dpm_active);
+       if ((dev->parent && dev->parent->power.sleeping) || all_sleeping) {
+               if (dev->parent->power.sleeping)
+                       dev_warn(dev,
+                               "parent %s is sleeping, will not add\n",
+                               dev->parent->bus_id);
+               else
+                       dev_warn(dev, "devices are sleeping, will not add\n");
+               WARN_ON(true);
+               error = -EBUSY;
+       } else {
+               error = dpm_sysfs_add(dev);
+               if (!error)
+                       list_add_tail(&dev->power.entry, &dpm_active);
+       }
        mutex_unlock(&dpm_list_mtx);
+       return error;
 }
 
 /**
@@ -89,50 +103,6 @@ void device_pm_remove(struct device *dev)
        mutex_unlock(&dpm_list_mtx);
 }
 
-/**
- *     device_pm_schedule_removal - schedule the removal of a suspended device
- *     @dev:   Device to destroy
- *
- *     Moves the device to the dpm_destroy list for further processing by
- *     unregister_dropped_devices().
- */
-void device_pm_schedule_removal(struct device *dev)
-{
-       pr_debug("PM: Preparing for removal: %s:%s\n",
-               dev->bus ? dev->bus->name : "No Bus",
-               kobject_name(&dev->kobj));
-       mutex_lock(&dpm_list_mtx);
-       list_move_tail(&dev->power.entry, &dpm_destroy);
-       mutex_unlock(&dpm_list_mtx);
-}
-EXPORT_SYMBOL_GPL(device_pm_schedule_removal);
-
-/**
- *     pm_sleep_lock - mutual exclusion for registration and suspend
- *
- *     Returns 0 if no suspend is underway and device registration
- *     may proceed, otherwise -EBUSY.
- */
-int pm_sleep_lock(void)
-{
-       if (down_read_trylock(&pm_sleep_rwsem))
-               return 0;
-
-       return -EBUSY;
-}
-
-/**
- *     pm_sleep_unlock - mutual exclusion for registration and suspend
- *
- *     This routine undoes the effect of device_pm_add_lock
- *     when a device's registration is complete.
- */
-void pm_sleep_unlock(void)
-{
-       up_read(&pm_sleep_rwsem);
-}
-
-
 /*------------------------- Resume routines -------------------------*/
 
 /**
@@ -242,11 +212,13 @@ static int resume_device(struct device *dev)
 static void dpm_resume(void)
 {
        mutex_lock(&dpm_list_mtx);
+       all_sleeping = false;
        while(!list_empty(&dpm_off)) {
                struct list_head *entry = dpm_off.next;
                struct device *dev = to_device(entry);
 
                list_move_tail(entry, &dpm_active);
+               dev->power.sleeping = false;
                mutex_unlock(&dpm_list_mtx);
                resume_device(dev);
                mutex_lock(&dpm_list_mtx);
@@ -254,26 +226,6 @@ static void dpm_resume(void)
        mutex_unlock(&dpm_list_mtx);
 }
 
-/**
- *     unregister_dropped_devices - Unregister devices scheduled for removal
- *
- *     Unregister all devices on the dpm_destroy list.
- */
-static void unregister_dropped_devices(void)
-{
-       mutex_lock(&dpm_list_mtx);
-       while (!list_empty(&dpm_destroy)) {
-               struct list_head *entry = dpm_destroy.next;
-               struct device *dev = to_device(entry);
-
-               mutex_unlock(&dpm_list_mtx);
-               /* This also removes the device from the list */
-               device_unregister(dev);
-               mutex_lock(&dpm_list_mtx);
-       }
-       mutex_unlock(&dpm_list_mtx);
-}
-
 /**
  *     device_resume - Restore state of each device in system.
  *
@@ -284,8 +236,6 @@ void device_resume(void)
 {
        might_sleep();
        dpm_resume();
-       unregister_dropped_devices();
-       up_write(&pm_sleep_rwsem);
 }
 EXPORT_SYMBOL_GPL(device_resume);
 
@@ -377,11 +327,6 @@ static int suspend_device(struct device *dev, pm_message_t state)
 
        down(&dev->sem);
 
-       if (dev->power.power_state.event) {
-               dev_dbg(dev, "PM: suspend %d-->%d\n",
-                       dev->power.power_state.event, state.event);
-       }
-
        if (dev->class && dev->class->suspend) {
                suspend_device_dbg(dev, state, "class ");
                error = dev->class->suspend(dev, state);
@@ -426,6 +371,9 @@ static int dpm_suspend(pm_message_t state)
                struct list_head *entry = dpm_active.prev;
                struct device *dev = to_device(entry);
 
+               WARN_ON(dev->parent && dev->parent->power.sleeping);
+
+               dev->power.sleeping = true;
                mutex_unlock(&dpm_list_mtx);
                error = suspend_device(dev, state);
                mutex_lock(&dpm_list_mtx);
@@ -437,11 +385,14 @@ static int dpm_suspend(pm_message_t state)
                                        (error == -EAGAIN ?
                                        " (please convert to suspend_late)" :
                                        ""));
+                       dev->power.sleeping = false;
                        break;
                }
                if (!list_empty(&dev->power.entry))
                        list_move(&dev->power.entry, &dpm_off);
        }
+       if (!error)
+               all_sleeping = true;
        mutex_unlock(&dpm_list_mtx);
 
        return error;
@@ -459,7 +410,6 @@ int device_suspend(pm_message_t state)
        int error;
 
        might_sleep();
-       down_write(&pm_sleep_rwsem);
        error = dpm_suspend(state);
        if (error)
                device_resume();
index e32d3bdb92c1dbf45d02c161130fcafbdd0044d9..a6894f2a4b9960d1a19094fa8b4b7890b9bd0e6d 100644 (file)
@@ -11,30 +11,13 @@ static inline struct device *to_device(struct list_head *entry)
        return container_of(entry, struct device, power.entry);
 }
 
-extern void device_pm_add(struct device *);
+extern int device_pm_add(struct device *);
 extern void device_pm_remove(struct device *);
-extern int pm_sleep_lock(void);
-extern void pm_sleep_unlock(void);
 
 #else /* CONFIG_PM_SLEEP */
 
-
-static inline void device_pm_add(struct device *dev)
-{
-}
-
-static inline void device_pm_remove(struct device *dev)
-{
-}
-
-static inline int pm_sleep_lock(void)
-{
-       return 0;
-}
-
-static inline void pm_sleep_unlock(void)
-{
-}
+static inline int device_pm_add(struct device *dev) { return 0; }
+static inline void device_pm_remove(struct device *dev) {}
 
 #endif
 
index f2ed179cd6950f1336e94d04ffc7289a871f2023..d11f74b038db2039026a6f4a6b1a490e994b51f6 100644 (file)
@@ -6,6 +6,8 @@
 #include <linux/string.h>
 #include "power.h"
 
+int (*platform_enable_wakeup)(struct device *dev, int is_on);
+
 
 /*
  *     wakeup - Report/change current wakeup option for device
index 8e13fd9421635753f7b634ba4177b5df003a074f..4fbb56bcb1eefbd60b5a189963e1e742ef794865 100644 (file)
@@ -167,6 +167,22 @@ int sysdev_driver_register(struct sysdev_class *cls, struct sysdev_driver *drv)
 {
        int err = 0;
 
+       if (!cls) {
+               printk(KERN_WARNING "sysdev: invalid class passed to "
+                       "sysdev_driver_register!\n");
+               WARN_ON(1);
+               return -EINVAL;
+       }
+
+       /* Check whether this driver has already been added to a class. */
+       if ((drv->entry.next != drv->entry.prev) ||
+           (drv->entry.next != NULL)) {
+               printk(KERN_WARNING "sysdev: class %s: driver (%p) has already"
+                       " been registered to a class, something is wrong, but "
+                       "will forge on!\n", cls->name, drv);
+               WARN_ON(1);
+       }
+
        mutex_lock(&sysdev_drivers_lock);
        if (cls && kset_get(&cls->kset)) {
                list_add_tail(&drv->entry, &cls->drivers);
@@ -179,7 +195,7 @@ int sysdev_driver_register(struct sysdev_class *cls, struct sysdev_driver *drv)
                }
        } else {
                err = -EINVAL;
-               printk(KERN_ERR "%s: invalid device class\n", __FUNCTION__);
+               printk(KERN_ERR "%s: invalid device class\n", __func__);
                WARN_ON(1);
        }
        mutex_unlock(&sysdev_drivers_lock);
index e1d3ad4db2f04355631efd8120946c07313789c8..fdf4044d2e74a90a24ff7b5e44a16efcab52c7a4 100644 (file)
@@ -40,15 +40,38 @@ static ssize_t show_##name(struct sys_device *dev, char *buf)       \
        return sprintf(buf, "%d\n", topology_##name(cpu));      \
 }
 
-#define define_siblings_show_func(name)                                        \
-static ssize_t show_##name(struct sys_device *dev, char *buf)          \
+static ssize_t show_cpumap(int type, cpumask_t *mask, char *buf)
+{
+       ptrdiff_t len = PTR_ALIGN(buf + PAGE_SIZE - 1, PAGE_SIZE) - buf;
+       int n = 0;
+
+       if (len > 1) {
+               n = type?
+                       cpulist_scnprintf(buf, len-2, *mask):
+                       cpumask_scnprintf(buf, len-2, *mask);
+               buf[n++] = '\n';
+               buf[n] = '\0';
+       }
+       return n;
+}
+
+#define define_siblings_show_map(name)                                 \
+static inline ssize_t show_##name(struct sys_device *dev, char *buf)   \
 {                                                                      \
-       ssize_t len = -1;                                               \
        unsigned int cpu = dev->id;                                     \
-       len = cpumask_scnprintf(buf, NR_CPUS+1, topology_##name(cpu));  \
-       return (len + sprintf(buf + len, "\n"));                        \
+       return show_cpumap(0, &(topology_##name(cpu)), buf);            \
 }
 
+#define define_siblings_show_list(name)                                        \
+static inline ssize_t show_##name##_list(struct sys_device *dev, char *buf) \
+{                                                                      \
+       unsigned int cpu = dev->id;                                     \
+       return show_cpumap(1, &(topology_##name(cpu)), buf);            \
+}
+
+#define define_siblings_show_func(name)                \
+       define_siblings_show_map(name); define_siblings_show_list(name)
+
 #ifdef topology_physical_package_id
 define_id_show_func(physical_package_id);
 define_one_ro(physical_package_id);
@@ -68,7 +91,9 @@ define_one_ro(core_id);
 #ifdef topology_thread_siblings
 define_siblings_show_func(thread_siblings);
 define_one_ro(thread_siblings);
-#define ref_thread_siblings_attr       &attr_thread_siblings.attr,
+define_one_ro(thread_siblings_list);
+#define ref_thread_siblings_attr       \
+               &attr_thread_siblings.attr, &attr_thread_siblings_list.attr,
 #else
 #define ref_thread_siblings_attr
 #endif
@@ -76,7 +101,9 @@ define_one_ro(thread_siblings);
 #ifdef topology_core_siblings
 define_siblings_show_func(core_siblings);
 define_one_ro(core_siblings);
-#define ref_core_siblings_attr         &attr_core_siblings.attr,
+define_one_ro(core_siblings_list);
+#define ref_core_siblings_attr         \
+               &attr_core_siblings.attr, &attr_core_siblings_list.attr,
 #else
 #define ref_core_siblings_attr
 #endif
index cabd0edf21569c3ea1cd2f3da9c77bfd5007936c..84997efdb23d699de42e5c8beadd1724795a1968 100644 (file)
@@ -66,7 +66,7 @@ EXPORT_SYMBOL_GPL(transport_class_unregister);
 
 static int anon_transport_dummy_function(struct transport_container *tc,
                                         struct device *dev,
-                                        struct class_device *cdev)
+                                        struct device *cdev)
 {
        /* do nothing */
        return 0;
@@ -115,7 +115,7 @@ EXPORT_SYMBOL_GPL(anon_transport_class_unregister);
 
 static int transport_setup_classdev(struct attribute_container *cont,
                                    struct device *dev,
-                                   struct class_device *classdev)
+                                   struct device *classdev)
 {
        struct transport_class *tclass = class_to_transport_class(cont->class);
        struct transport_container *tcont = attribute_container_to_transport_container(cont);
@@ -149,7 +149,7 @@ EXPORT_SYMBOL_GPL(transport_setup_device);
 
 static int transport_add_class_device(struct attribute_container *cont,
                                      struct device *dev,
-                                     struct class_device *classdev)
+                                     struct device *classdev)
 {
        int error = attribute_container_add_class_device(classdev);
        struct transport_container *tcont = 
@@ -181,7 +181,7 @@ EXPORT_SYMBOL_GPL(transport_add_device);
 
 static int transport_configure(struct attribute_container *cont,
                               struct device *dev,
-                              struct class_device *cdev)
+                              struct device *cdev)
 {
        struct transport_class *tclass = class_to_transport_class(cont->class);
        struct transport_container *tcont = attribute_container_to_transport_container(cont);
@@ -212,7 +212,7 @@ EXPORT_SYMBOL_GPL(transport_configure_device);
 
 static int transport_remove_classdev(struct attribute_container *cont,
                                     struct device *dev,
-                                    struct class_device *classdev)
+                                    struct device *classdev)
 {
        struct transport_container *tcont = 
                attribute_container_to_transport_container(cont);
@@ -251,12 +251,12 @@ EXPORT_SYMBOL_GPL(transport_remove_device);
 
 static void transport_destroy_classdev(struct attribute_container *cont,
                                      struct device *dev,
-                                     struct class_device *classdev)
+                                     struct device *classdev)
 {
        struct transport_class *tclass = class_to_transport_class(cont->class);
 
        if (tclass->remove != anon_transport_dummy_function)
-               class_device_put(classdev);
+               put_device(classdev);
 }
 
 
index 241167878edf5033aaeddf525d5ba0c529f5434c..8b6bb764b0a3f83edb759fdb2ac80559c3dfb511 100644 (file)
@@ -27,7 +27,6 @@
 #include <linux/blkdev.h>
 #include <linux/loop.h>
 #include <linux/scatterlist.h>
-#include <asm/semaphore.h>
 #include <asm/uaccess.h>
 
 MODULE_LICENSE("GPL");
index 41ca721d2523fec5987e02db1e9e7a26f35f60bb..ebfe038d859ee47fe494198be34ffba8880d3b7e 100644 (file)
@@ -69,7 +69,7 @@ MODULE_LICENSE("GPL");
 enum {
        PARTITION_SHIFT = 3,
        MAX_DISKNO = HVMAXARCHITECTEDVIRTUALDISKS,
-       MAX_DISK_NAME = sizeof(((struct gendisk *)0)->disk_name)
+       MAX_DISK_NAME = FIELD_SIZEOF(struct gendisk, disk_name)
 };
 
 static DEFINE_SPINLOCK(viodasd_spinlock);
index 8b884f87d8b7be56d4a290469cab518ebac62ba9..192522ebb771926e4fec2cfabc595869f6cd4bed 100644 (file)
 #define URB_ZERO_PACKET 0
 #endif
 
-static int ignore = 0;
-static int ignore_dga = 0;
-static int ignore_csr = 0;
-static int ignore_sniffer = 0;
-static int disable_scofix = 0;
-static int force_scofix = 0;
-static int reset = 0;
+static int ignore;
+static int ignore_dga;
+static int ignore_csr;
+static int ignore_sniffer;
+static int disable_scofix;
+static int force_scofix;
+static int reset;
 
 #ifdef CONFIG_BT_HCIUSB_SCO
 static int isoc = 2;
@@ -265,7 +265,7 @@ static int hci_usb_intr_rx_submit(struct hci_usb *husb)
                BT_ERR("%s intr rx submit failed urb %p err %d",
                                husb->hdev->name, urb, err);
                _urb_unlink(_urb);
-               _urb_free(_urb);
+               kfree(_urb);
                kfree(buf);
        }
        return err;
@@ -302,7 +302,7 @@ static int hci_usb_bulk_rx_submit(struct hci_usb *husb)
                BT_ERR("%s bulk rx submit failed urb %p err %d",
                                husb->hdev->name, urb, err);
                _urb_unlink(_urb);
-               _urb_free(_urb);
+               kfree(_urb);
                kfree(buf);
        }
        return err;
@@ -353,7 +353,7 @@ static int hci_usb_isoc_rx_submit(struct hci_usb *husb)
                BT_ERR("%s isoc rx submit failed urb %p err %d",
                                husb->hdev->name, urb, err);
                _urb_unlink(_urb);
-               _urb_free(_urb);
+               kfree(_urb);
                kfree(buf);
        }
        return err;
@@ -431,7 +431,7 @@ static void hci_usb_unlink_urbs(struct hci_usb *husb)
                                        husb->hdev->name, _urb, _urb->type, urb);
                        kfree(urb->setup_packet);
                        kfree(urb->transfer_buffer);
-                       _urb_free(_urb);
+                       kfree(_urb);
                }
        }
 }
@@ -490,7 +490,7 @@ static inline int hci_usb_send_ctrl(struct hci_usb *husb, struct sk_buff *skb)
 
                dr = kmalloc(sizeof(*dr), GFP_ATOMIC);
                if (!dr) {
-                       _urb_free(_urb);
+                       kfree(_urb);
                        return -ENOMEM;
                }
        } else
index 56cd3a92ceca8c94228ca1ae06579088632a45bb..414080a4e8ff6c157c820cf0adf840ba39c50930 100644 (file)
@@ -60,11 +60,6 @@ struct _urb {
        struct urb        urb;
 };
 
-static inline void _urb_free(struct _urb *_urb)
-{
-       kfree(_urb);
-}
-
 static inline void _urb_queue_init(struct _urb_queue *q)
 {
        INIT_LIST_HEAD(&q->head);
index 47c6be84fc842c7855883d4fb93d2257a5637fe7..a87b89db08e99dd10cb30b9b2e0f7d72421b6edf 100644 (file)
@@ -706,7 +706,7 @@ config NVRAM
 
 config RTC
        tristate "Enhanced Real Time Clock Support"
-       depends on !PPC && !PARISC && !IA64 && !M68K && !SPARC && !FRV && !ARM && !SUPERH && !S390
+       depends on !PPC && !PARISC && !IA64 && !M68K && !SPARC && !FRV && !ARM && !SUPERH && !S390 && !AVR32
        ---help---
          If you say Y here and create a character special file /dev/rtc with
          major number 10 and minor number 135 using mknod ("man mknod"), you
@@ -776,7 +776,7 @@ config SGI_IP27_RTC
 
 config GEN_RTC
        tristate "Generic /dev/rtc emulation"
-       depends on RTC!=y && !IA64 && !ARM && !M32R && !MIPS && !SPARC && !FRV && !S390 && !SUPERH
+       depends on RTC!=y && !IA64 && !ARM && !M32R && !MIPS && !SPARC && !FRV && !S390 && !SUPERH && !AVR32
        ---help---
          If you say Y here and create a character special file /dev/rtc with
          major number 10 and minor number 135 using mknod ("man mknod"), you
index 8ea9dd1717a9dc9b383120e7bbe730229d4e678c..6540948d517622ff3b20dbc39902cde5b656dd9b 100644 (file)
@@ -640,7 +640,6 @@ struct drm_head {
        struct drm_device *dev;
        struct proc_dir_entry *dev_root;  /**< proc directory entry */
        dev_t device;                   /**< Device number for mknod */
-       struct class_device *dev_class;
 };
 
 /**
index 8facf3e25c490f75773a857a012e66a968469654..7ed7da1d99cf9120f238601e794df7845992ff2a 100644 (file)
@@ -28,7 +28,6 @@
 #include <linux/interrupt.h>
 #include <linux/tty_flip.h>
 #include <linux/delay.h>
-#include <asm/semaphore.h>
 #include <asm/uaccess.h>
 
 #define DEBUG 
index e74bb949c289b30e2d43d30e9a19b9583a359400..91cdb35a920480f384fdff9efad6f28fb572021f 100644 (file)
@@ -78,8 +78,8 @@ static int hvc_beat_put_chars(uint32_t vtermno, const char *buf, int cnt)
        for (rest = cnt; rest > 0; rest -= nlen) {
                nlen = (rest > 16) ? 16 : rest;
                memcpy(kb, buf, nlen);
-               beat_put_term_char(vtermno, rest, kb[0], kb[1]);
-               rest -= nlen;
+               beat_put_term_char(vtermno, nlen, kb[0], kb[1]);
+               buf += nlen;
        }
        return cnt;
 }
index 349b6edc5794401ab9a4388707a93f9570aeaa7c..662d60e44e9a02924888d74499fbe91b268423f5 100644 (file)
@@ -238,11 +238,11 @@ static DEVICE_ATTR(rng_available, S_IRUGO,
                   NULL);
 
 
-static void unregister_miscdev(bool suspended)
+static void unregister_miscdev(void)
 {
        device_remove_file(rng_miscdev.this_device, &dev_attr_rng_available);
        device_remove_file(rng_miscdev.this_device, &dev_attr_rng_current);
-       __misc_deregister(&rng_miscdev, suspended);
+       misc_deregister(&rng_miscdev);
 }
 
 static int register_miscdev(void)
@@ -317,7 +317,7 @@ out:
 }
 EXPORT_SYMBOL_GPL(hwrng_register);
 
-void __hwrng_unregister(struct hwrng *rng, bool suspended)
+void hwrng_unregister(struct hwrng *rng)
 {
        int err;
 
@@ -336,11 +336,11 @@ void __hwrng_unregister(struct hwrng *rng, bool suspended)
                }
        }
        if (list_empty(&rng_list))
-               unregister_miscdev(suspended);
+               unregister_miscdev();
 
        mutex_unlock(&rng_mutex);
 }
-EXPORT_SYMBOL_GPL(__hwrng_unregister);
+EXPORT_SYMBOL_GPL(hwrng_unregister);
 
 
 MODULE_DESCRIPTION("H/W Random Number Generator (RNG) driver");
index 4dbd3425e928ed563ff4954378147692deff7b94..9769bf8279a6adff8d39a13fd31611bce42f0a49 100644 (file)
@@ -1033,7 +1033,8 @@ DECLARE_TASKLET_DISABLED(keyboard_tasklet, kbd_bh, 0);
 #if defined(CONFIG_X86) || defined(CONFIG_IA64) || defined(CONFIG_ALPHA) ||\
     defined(CONFIG_MIPS) || defined(CONFIG_PPC) || defined(CONFIG_SPARC) ||\
     defined(CONFIG_PARISC) || defined(CONFIG_SUPERH) ||\
-    (defined(CONFIG_ARM) && defined(CONFIG_KEYBOARD_ATKBD) && !defined(CONFIG_ARCH_RPC))
+    (defined(CONFIG_ARM) && defined(CONFIG_KEYBOARD_ATKBD) && !defined(CONFIG_ARCH_RPC)) ||\
+    defined(CONFIG_AVR32)
 
 #define HW_RAW(dev) (test_bit(EV_MSC, dev->evbit) && test_bit(MSC_RAW, dev->mscbit) &&\
                        ((dev)->id.bustype == BUS_I8042) && ((dev)->id.vendor == 0x0001) && ((dev)->id.product == 0x0001))
index a39101feb2ed8f70ff57f5d74e1a05855bec959d..4d058dadbfcc8c6324b7c4e224530289145140b3 100644 (file)
@@ -232,9 +232,8 @@ int misc_register(struct miscdevice * misc)
 }
 
 /**
- *     __misc_deregister - unregister a miscellaneous device
+ *     misc_deregister - unregister a miscellaneous device
  *     @misc: device to unregister
- *     @suspended: to be set if the function is used during suspend/resume
  *
  *     Unregister a miscellaneous device that was previously
  *     successfully registered with misc_register(). Success
@@ -242,7 +241,7 @@ int misc_register(struct miscdevice * misc)
  *     indicates an error.
  */
 
-int __misc_deregister(struct miscdevice *misc, bool suspended)
+int misc_deregister(struct miscdevice *misc)
 {
        int i = misc->minor;
 
@@ -251,11 +250,7 @@ int __misc_deregister(struct miscdevice *misc, bool suspended)
 
        mutex_lock(&misc_mtx);
        list_del(&misc->list);
-       if (suspended)
-               destroy_suspended_device(misc_class,
-                                       MKDEV(MISC_MAJOR, misc->minor));
-       else
-               device_destroy(misc_class, MKDEV(MISC_MAJOR, misc->minor));
+       device_destroy(misc_class, MKDEV(MISC_MAJOR, misc->minor));
        if (i < DYNAMIC_MINORS && i>0) {
                misc_minors[i>>3] &= ~(1 << (misc->minor & 7));
        }
@@ -264,7 +259,7 @@ int __misc_deregister(struct miscdevice *misc, bool suspended)
 }
 
 EXPORT_SYMBOL(misc_register);
-EXPORT_SYMBOL(__misc_deregister);
+EXPORT_SYMBOL(misc_deregister);
 
 static int __init misc_init(void)
 {
index f282976daaacfe8e6da245071757c9d552f0fbad..37fe80df0b91bdbeecee5072ac3f6b129ca62481 100644 (file)
@@ -97,20 +97,24 @@ static void EnableSRAM(THINKPAD_BD_DATA * pBDData)
 
 static irqreturn_t UartInterrupt(int irq, void *dev_id)
 {
+       int irqno = (int)(unsigned long) dev_id;
+
        PRINTK_3(TRACE_TP3780I,
-               "tp3780i::UartInterrupt entry irq %x dev_id %p\n", irq, dev_id);
+               "tp3780i::UartInterrupt entry irq %x dev_id %p\n", irqno, dev_id);
        return IRQ_HANDLED;
 }
 
 static irqreturn_t DspInterrupt(int irq, void *dev_id)
 {
+       int irqno = (int)(unsigned long) dev_id;
+
        pMWAVE_DEVICE_DATA pDrvData = &mwave_s_mdd;
        DSP_3780I_CONFIG_SETTINGS *pSettings = &pDrvData->rBDData.rDspSettings;
        unsigned short usDspBaseIO = pSettings->usDspBaseIO;
        unsigned short usIPCSource = 0, usIsolationMask, usPCNum;
 
        PRINTK_3(TRACE_TP3780I,
-               "tp3780i::DspInterrupt entry irq %x dev_id %p\n", irq, dev_id);
+               "tp3780i::DspInterrupt entry irq %x dev_id %p\n", irqno, dev_id);
 
        if (dsp3780I_GetIPCSource(usDspBaseIO, &usIPCSource) == 0) {
                PRINTK_2(TRACE_TP3780I,
@@ -361,14 +365,16 @@ int tp3780I_EnableDSP(THINKPAD_BD_DATA * pBDData)
        pSettings->bPllBypass = TP_CFG_PllBypass;
        pSettings->usChipletEnable = TP_CFG_ChipletEnable;
 
-       if (request_irq(pSettings->usUartIrq, &UartInterrupt, 0, "mwave_uart", NULL)) {
+       if (request_irq(pSettings->usUartIrq, &UartInterrupt, 0, "mwave_uart",
+                       (void *)(unsigned long) pSettings->usUartIrq)) {
                PRINTK_ERROR(KERN_ERR_MWAVE "tp3780i::tp3780I_EnableDSP: Error: Could not get UART IRQ %x\n", pSettings->usUartIrq);
                goto exit_cleanup;
        } else {                /* no conflict just release */
                free_irq(pSettings->usUartIrq, NULL);
        }
 
-       if (request_irq(pSettings->usDspIrq, &DspInterrupt, 0, "mwave_3780i", NULL)) {
+       if (request_irq(pSettings->usDspIrq, &DspInterrupt, 0, "mwave_3780i",
+                       (void *)(unsigned long) pSettings->usDspIrq)) {
                PRINTK_ERROR("tp3780i::tp3780I_EnableDSP: Error: Could not get 3780i IRQ %x\n", pSettings->usDspIrq);
                goto exit_cleanup;
        } else {
index 279ff5005cec0890e18a6292788c11fcb9299057..4e84d233e5a295b8cb5c0e43b051e6133197efbe 100644 (file)
@@ -1225,17 +1225,15 @@ static void ri_change(MGSLPC_INFO *info)
  * irq     interrupt number that caused interrupt
  * dev_id  device ID supplied during interrupt registration
  */
-static irqreturn_t mgslpc_isr(int irq, void *dev_id)
+static irqreturn_t mgslpc_isr(int dummy, void *dev_id)
 {
-       MGSLPC_INFO * info = (MGSLPC_INFO *)dev_id;
+       MGSLPC_INFO *info = dev_id;
        unsigned short isr;
        unsigned char gis, pis;
        int count=0;
 
        if (debug_level >= DEBUG_LEVEL_ISR)
-               printk("mgslpc_isr(%d) entry.\n", irq);
-       if (!info)
-               return IRQ_NONE;
+               printk("mgslpc_isr(%d) entry.\n", info->irq_level);
 
        if (!(info->p_dev->_locked))
                return IRQ_HANDLED;
@@ -1327,7 +1325,7 @@ static irqreturn_t mgslpc_isr(int irq, void *dev_id)
 
        if (debug_level >= DEBUG_LEVEL_ISR)
                printk("%s(%d):mgslpc_isr(%d)exit.\n",
-                      __FILE__,__LINE__,irq);
+                      __FILE__, __LINE__, info->irq_level);
 
        return IRQ_HANDLED;
 }
index eca2b95343e2c3f63a9de30dfa705a8d412e485a..d956dd31600552a8eebf08e62c81ef557ad38e0c 100644 (file)
@@ -35,7 +35,6 @@
 #include <linux/termios.h>
 #include <linux/serial.h>
 #include <linux/vmalloc.h>
-#include <asm/semaphore.h>
 #include <linux/generic_serial.h>
 #include <linux/errno.h>
 #include <linux/interrupt.h>
index 7321d002c34f4b3177faad14c93012d7e77cfc48..bf36959fc12149edc7610c1bf4957fa52c08eda6 100644 (file)
@@ -41,7 +41,6 @@ static char *_riocmd_c_sccs_ = "@(#)riocmd.c  1.2";
 #include <asm/io.h>
 #include <asm/system.h>
 #include <asm/string.h>
-#include <asm/semaphore.h>
 #include <asm/uaccess.h>
 
 #include <linux/termios.h>
index 7ce77619707cf2f4fa1db2480d1acaebaf968ca9..d8eb2bcbe015dca54fce742555ec18142cb7851c 100644 (file)
@@ -40,7 +40,6 @@ static char *_rioctrl_c_sccs_ = "@(#)rioctrl.c        1.3";
 #include <asm/io.h>
 #include <asm/system.h>
 #include <asm/string.h>
-#include <asm/semaphore.h>
 #include <asm/uaccess.h>
 
 #include <linux/termios.h>
index 0794844369d6fcdedda20fae17ddd5d39c21f6e7..add1718295efb4a52d51b37463b87796d7c23894 100644 (file)
@@ -40,7 +40,6 @@ static char *_rioinit_c_sccs_ = "@(#)rioinit.c        1.3";
 #include <asm/io.h>
 #include <asm/system.h>
 #include <asm/string.h>
-#include <asm/semaphore.h>
 #include <asm/uaccess.h>
 
 #include <linux/termios.h>
index ebc76342712c1485da63b58eb01d83be38e34a4d..4734e26e1ccd8a694ba23e090e56b35fe890598c 100644 (file)
@@ -42,7 +42,6 @@ static char *_riointr_c_sccs_ = "@(#)riointr.c        1.2";
 #include <asm/io.h>
 #include <asm/system.h>
 #include <asm/string.h>
-#include <asm/semaphore.h>
 #include <asm/uaccess.h>
 
 #include <linux/termios.h>
index bb498d24adcc471cf08e50fa076e093eb5f9c54b..da276ed57b3f5b8ade87dc12f3188bd50404978c 100644 (file)
@@ -41,7 +41,6 @@ static char *_rioparam_c_sccs_ = "@(#)rioparam.c      1.3";
 #include <asm/io.h>
 #include <asm/system.h>
 #include <asm/string.h>
-#include <asm/semaphore.h>
 #include <asm/uaccess.h>
 
 #include <linux/termios.h>
index a99f3d9d7d652a1bfa63d142890de86448cbe991..85091ff74d968452dd5fc91e3851be346357f04d 100644 (file)
@@ -39,7 +39,6 @@ static char *_rioroute_c_sccs_ = "@(#)rioroute.c      1.3";
 #include <asm/io.h>
 #include <asm/system.h>
 #include <asm/string.h>
-#include <asm/semaphore.h>
 #include <asm/uaccess.h>
 
 #include <linux/termios.h>
index 9b52892a501f67702222eca6eedcf913783e3fc3..2b24488e95f284eeb0d2fe1bcaac23139a4c0c53 100644 (file)
@@ -42,7 +42,6 @@ static char *_riotable_c_sccs_ = "@(#)riotable.c      1.2";
 #include <asm/io.h>
 #include <asm/system.h>
 #include <asm/string.h>
-#include <asm/semaphore.h>
 #include <asm/uaccess.h>
 
 #include <linux/termios.h>
index cfa54361473ffe05cb989be41987e0ffbefb04c8..1cb8580a161dc72b1403b13fff81e862748ab239 100644 (file)
@@ -44,7 +44,6 @@ static char *_riotty_c_sccs_ = "@(#)riotty.c  1.3";
 #include <asm/io.h>
 #include <asm/system.h>
 #include <asm/string.h>
-#include <asm/semaphore.h>
 #include <asm/uaccess.h>
 
 #include <linux/termios.h>
index 8a98169b60c1ad42cb240bf71202f30d1f4f1e33..4be62eda9fbc6ddac0522e8d321b7afd1bba015a 100644 (file)
@@ -22,8 +22,8 @@
 #include <linux/kobject.h>
 #include <linux/fs.h>
 #include <linux/cdev.h>
+#include <linux/semaphore.h>
 #include <asm/sn/types.h>
-#include <asm/semaphore.h>
 
 #define CHUNKSIZE 127
 
index 5ff83df67b447d18054bf45359c183d18fdb9e5a..4b5b5b78acb4835c3e58a212b92c87d035e512c5 100644 (file)
@@ -443,8 +443,7 @@ void missed_irq (unsigned long data)
        spin_unlock_irqrestore(&bp->lock, flags);
        if (irq) {
                printk (KERN_INFO "Missed interrupt... Calling int from timer. \n");
-               sx_interrupt (((struct specialix_board *)data)->irq,
-                               (void*)data);
+               sx_interrupt (-1, bp);
        }
        mod_timer(&missed_irq_timer, jiffies + sx_poll);
 }
@@ -862,23 +861,22 @@ static inline void sx_check_modem(struct specialix_board * bp)
 
 
 /* The main interrupt processing routine */
-static irqreturn_t sx_interrupt(int irq, void *dev_id)
+static irqreturn_t sx_interrupt(int dummy, void *dev_id)
 {
        unsigned char status;
        unsigned char ack;
-       struct specialix_board *bp;
+       struct specialix_board *bp = dev_id;
        unsigned long loop = 0;
        int saved_reg;
        unsigned long flags;
 
        func_enter();
 
-       bp = dev_id;
        spin_lock_irqsave(&bp->lock, flags);
 
        dprintk (SX_DEBUG_FLOW, "enter %s port %d room: %ld\n", __FUNCTION__, port_No(sx_get_port(bp, "INT")), SERIAL_XMIT_SIZE - sx_get_port(bp, "ITN")->xmit_cnt - 1);
        if (!(bp->flags & SX_BOARD_ACTIVE)) {
-               dprintk (SX_DEBUG_IRQ, "sx: False interrupt. irq %d.\n", irq);
+               dprintk (SX_DEBUG_IRQ, "sx: False interrupt. irq %d.\n", bp->irq);
                spin_unlock_irqrestore(&bp->lock, flags);
                func_exit();
                return IRQ_NONE;
index feac54e32a12753f25f78eaed9e7c1b7749cc141..874aaa08e956d8ae8143308b9582317076dfd371 100644 (file)
@@ -1645,7 +1645,7 @@ static irqreturn_t stl_intr(int irq, void *dev_id)
 {
        struct stlbrd *brdp = dev_id;
 
-       pr_debug("stl_intr(brdp=%p,irq=%d)\n", brdp, irq);
+       pr_debug("stl_intr(brdp=%p,irq=%d)\n", brdp, brdp->irq);
 
        return IRQ_RETVAL((* brdp->isr)(brdp));
 }
index ddc74d1f4f1beb3922c39fa4809a428529a74615..a3237d48a584e24ac5a2f12e637183d8f43cee5f 100644 (file)
@@ -1695,20 +1695,16 @@ static void mgsl_isr_transmit_dma( struct mgsl_struct *info )
  *     
  * Return Value: None
  */
-static irqreturn_t mgsl_interrupt(int irq, void *dev_id)
+static irqreturn_t mgsl_interrupt(int dummy, void *dev_id)
 {
-       struct mgsl_struct * info;
+       struct mgsl_struct *info = dev_id;
        u16 UscVector;
        u16 DmaVector;
 
        if ( debug_level >= DEBUG_LEVEL_ISR )   
-               printk("%s(%d):mgsl_interrupt(%d)entry.\n",
-                       __FILE__,__LINE__,irq);
+               printk(KERN_DEBUG "%s(%d):mgsl_interrupt(%d)entry.\n",
+                       __FILE__, __LINE__, info->irq_level);
 
-       info = (struct mgsl_struct *)dev_id;    
-       if (!info)
-               return IRQ_NONE;
-               
        spin_lock(&info->irq_spinlock);
 
        for(;;) {
@@ -1732,8 +1728,8 @@ static irqreturn_t mgsl_interrupt(int irq, void *dev_id)
                        mgsl_isr_receive_dma(info);
 
                if ( info->isr_overflow ) {
-                       printk(KERN_ERR"%s(%d):%s isr overflow irq=%d\n",
-                               __FILE__,__LINE__,info->device_name, irq);
+                       printk(KERN_ERR "%s(%d):%s isr overflow irq=%d\n",
+                               __FILE__, __LINE__, info->device_name, info->irq_level);
                        usc_DisableMasterIrqBit(info);
                        usc_DisableDmaInterrupts(info,DICR_MASTER);
                        break;
@@ -1755,8 +1751,9 @@ static irqreturn_t mgsl_interrupt(int irq, void *dev_id)
        spin_unlock(&info->irq_spinlock);
        
        if ( debug_level >= DEBUG_LEVEL_ISR )   
-               printk("%s(%d):mgsl_interrupt(%d)exit.\n",
-                       __FILE__,__LINE__,irq);
+               printk(KERN_DEBUG "%s(%d):mgsl_interrupt(%d)exit.\n",
+                       __FILE__, __LINE__, info->irq_level);
+
        return IRQ_HANDLED;
 }      /* end of mgsl_interrupt() */
 
index 1f954acf2bac49125be4b18f0167eb437ec0cbe0..3c89266c8255fedeb8b5114abeb28a7998691e22 100644 (file)
@@ -491,7 +491,6 @@ static void isr_serial(struct slgt_info *info);
 static void isr_rdma(struct slgt_info *info);
 static void isr_txeom(struct slgt_info *info, unsigned short status);
 static void isr_tdma(struct slgt_info *info);
-static irqreturn_t slgt_interrupt(int irq, void *dev_id);
 
 static int  alloc_dma_bufs(struct slgt_info *info);
 static void free_dma_bufs(struct slgt_info *info);
@@ -2326,17 +2325,13 @@ static void isr_gpio(struct slgt_info *info, unsigned int changed, unsigned int
  *     irq     interrupt number
  *     dev_id  device ID supplied during interrupt registration
  */
-static irqreturn_t slgt_interrupt(int irq, void *dev_id)
+static irqreturn_t slgt_interrupt(int dummy, void *dev_id)
 {
-       struct slgt_info *info;
+       struct slgt_info *info = dev_id;
        unsigned int gsr;
        unsigned int i;
 
-       DBGISR(("slgt_interrupt irq=%d entry\n", irq));
-
-       info = dev_id;
-       if (!info)
-               return IRQ_NONE;
+       DBGISR(("slgt_interrupt irq=%d entry\n", info->irq_level));
 
        spin_lock(&info->lock);
 
@@ -2385,7 +2380,7 @@ static irqreturn_t slgt_interrupt(int irq, void *dev_id)
 
        spin_unlock(&info->lock);
 
-       DBGISR(("slgt_interrupt irq=%d exit\n", irq));
+       DBGISR(("slgt_interrupt irq=%d exit\n", info->irq_level));
        return IRQ_HANDLED;
 }
 
index f3e7807f78d98781d903ea8075a970e18c881033..c96062ea72b4acffd82ea352006e7af53adb4329 100644 (file)
@@ -2586,9 +2586,9 @@ void isr_io_pin( SLMP_INFO *info, u16 status )
  *     dev_id          device ID supplied during interrupt registration
  *     regs            interrupted processor context
  */
-static irqreturn_t synclinkmp_interrupt(int irq, void *dev_id)
+static irqreturn_t synclinkmp_interrupt(int dummy, void *dev_id)
 {
-       SLMP_INFO * info;
+       SLMP_INFO *info = dev_id;
        unsigned char status, status0, status1=0;
        unsigned char dmastatus, dmastatus0, dmastatus1=0;
        unsigned char timerstatus0, timerstatus1=0;
@@ -2597,12 +2597,8 @@ static irqreturn_t synclinkmp_interrupt(int irq, void *dev_id)
        unsigned short tmp;
 
        if ( debug_level >= DEBUG_LEVEL_ISR )
-               printk("%s(%d): synclinkmp_interrupt(%d)entry.\n",
-                       __FILE__,__LINE__,irq);
-
-       info = (SLMP_INFO *)dev_id;
-       if (!info)
-               return IRQ_NONE;
+               printk(KERN_DEBUG "%s(%d): synclinkmp_interrupt(%d)entry.\n",
+                       __FILE__, __LINE__, info->irq_level);
 
        spin_lock(&info->lock);
 
@@ -2615,9 +2611,9 @@ static irqreturn_t synclinkmp_interrupt(int irq, void *dev_id)
                timerstatus0 = read_reg(info, ISR2);
 
                if ( debug_level >= DEBUG_LEVEL_ISR )
-                       printk("%s(%d):%s status0=%02x, dmastatus0=%02x, timerstatus0=%02x\n",
-                               __FILE__,__LINE__,info->device_name,
-                               status0,dmastatus0,timerstatus0);
+                       printk(KERN_DEBUG "%s(%d):%s status0=%02x, dmastatus0=%02x, timerstatus0=%02x\n",
+                               __FILE__, __LINE__, info->device_name,
+                               status0, dmastatus0, timerstatus0);
 
                if (info->port_count == 4) {
                        /* get status for SCA1 (ports 2-3) */
@@ -2702,8 +2698,8 @@ static irqreturn_t synclinkmp_interrupt(int irq, void *dev_id)
        spin_unlock(&info->lock);
 
        if ( debug_level >= DEBUG_LEVEL_ISR )
-               printk("%s(%d):synclinkmp_interrupt(%d)exit.\n",
-                       __FILE__,__LINE__,irq);
+               printk(KERN_DEBUG "%s(%d):synclinkmp_interrupt(%d)exit.\n",
+                       __FILE__, __LINE__, info->irq_level);
        return IRQ_HANDLED;
 }
 
index 81503d94fecca00062582831d7112f8c1acf9374..13a4bdd4e4d67ff73535cd6b1cb4dece7e3aba65 100644 (file)
@@ -399,7 +399,7 @@ static irqreturn_t tis_int_probe(int irq, void *dev_id)
        return IRQ_HANDLED;
 }
 
-static irqreturn_t tis_int_handler(int irq, void *dev_id)
+static irqreturn_t tis_int_handler(int dummy, void *dev_id)
 {
        struct tpm_chip *chip = dev_id;
        u32 interrupt;
index f577daedb630d1babb74c8e7c9e9e3d5458d052c..aa7f7962a9a0e678b0e3cdfdd9da1058c3798d14 100644 (file)
@@ -74,7 +74,7 @@
 
 /**
  * buffer_icap_get_status - Get the contents of the status register.
- * @base_address: is the base address of the device
+ * @drvdata: a pointer to the drvdata.
  *
  * The status register contains the ICAP status and the done bit.
  *
@@ -88,9 +88,9 @@
  * D1 - Always 1
  * D0 - Done bit
  **/
-static inline u32 buffer_icap_get_status(void __iomem *base_address)
+u32 buffer_icap_get_status(struct hwicap_drvdata *drvdata)
 {
-       return in_be32(base_address + XHI_STATUS_REG_OFFSET);
+       return in_be32(drvdata->base_address + XHI_STATUS_REG_OFFSET);
 }
 
 /**
@@ -117,20 +117,8 @@ static inline u32 buffer_icap_get_bram(void __iomem *base_address,
  **/
 static inline bool buffer_icap_busy(void __iomem *base_address)
 {
-       return (buffer_icap_get_status(base_address) & 1) == XHI_NOT_FINISHED;
-}
-
-/**
- * buffer_icap_busy - Return true if the icap device is not busy
- * @base_address: is the base address of the device
- *
- * The queries the low order bit of the status register, which
- * indicates whether the current configuration or readback operation
- * has completed.
- **/
-static inline bool buffer_icap_done(void __iomem *base_address)
-{
-       return (buffer_icap_get_status(base_address) & 1) == XHI_FINISHED;
+       u32 status = in_be32(base_address + XHI_STATUS_REG_OFFSET);
+       return (status & 1) == XHI_NOT_FINISHED;
 }
 
 /**
index 03184959fa00f7d8810ad918567566a3f72ada70..c5b1840906b2fdb968277fd6f02b594fb6d86683 100644 (file)
@@ -44,8 +44,6 @@
 #include <asm/io.h>
 #include "xilinx_hwicap.h"
 
-void buffer_icap_reset(struct hwicap_drvdata *drvdata);
-
 /* Loads a partial bitstream from system memory. */
 int buffer_icap_set_configuration(struct hwicap_drvdata *drvdata, u32 *data,
                             u32 Size);
@@ -54,4 +52,7 @@ int buffer_icap_set_configuration(struct hwicap_drvdata *drvdata, u32 *data,
 int buffer_icap_get_configuration(struct hwicap_drvdata *drvdata, u32 *data,
                             u32 Size);
 
+u32 buffer_icap_get_status(struct hwicap_drvdata *drvdata);
+void buffer_icap_reset(struct hwicap_drvdata *drvdata);
+
 #endif
index 6f45dbd47125636a44af08d8b2dab33a70e3bf4c..776b505284783cc0f128763a65925c9dbbd622e1 100644 (file)
 #define XHI_CR_READ_MASK 0x00000002 /* Read from ICAP to FIFO */
 #define XHI_CR_WRITE_MASK 0x00000001 /* Write from FIFO to ICAP */
 
-/* Status Register (SR) */
-#define XHI_SR_CFGERR_N_MASK 0x00000100 /* Config Error Mask */
-#define XHI_SR_DALIGN_MASK 0x00000080 /* Data Alignment Mask */
-#define XHI_SR_RIP_MASK 0x00000040 /* Read back Mask */
-#define XHI_SR_IN_ABORT_N_MASK 0x00000020 /* Select Map Abort Mask */
-#define XHI_SR_DONE_MASK 0x00000001 /* Done bit Mask  */
-
 
 #define XHI_WFO_MAX_VACANCY 1024 /* Max Write FIFO Vacancy, in words */
 #define XHI_RFO_MAX_OCCUPANCY 256 /* Max Read FIFO Occupancy, in words */
@@ -151,6 +144,29 @@ static inline void fifo_icap_start_readback(struct hwicap_drvdata *drvdata)
        dev_dbg(drvdata->dev, "readback started\n");
 }
 
+/**
+ * fifo_icap_get_status - Get the contents of the status register.
+ * @drvdata: a pointer to the drvdata.
+ *
+ * The status register contains the ICAP status and the done bit.
+ *
+ * D8 - cfgerr
+ * D7 - dalign
+ * D6 - rip
+ * D5 - in_abort_l
+ * D4 - Always 1
+ * D3 - Always 1
+ * D2 - Always 1
+ * D1 - Always 1
+ * D0 - Done bit
+ **/
+u32 fifo_icap_get_status(struct hwicap_drvdata *drvdata)
+{
+       u32 status = in_be32(drvdata->base_address + XHI_SR_OFFSET);
+       dev_dbg(drvdata->dev, "Getting status = %x\n", status);
+       return status;
+}
+
 /**
  * fifo_icap_busy - Return true if the ICAP is still processing a transaction.
  * @drvdata: a pointer to the drvdata.
@@ -158,7 +174,6 @@ static inline void fifo_icap_start_readback(struct hwicap_drvdata *drvdata)
 static inline u32 fifo_icap_busy(struct hwicap_drvdata *drvdata)
 {
        u32 status = in_be32(drvdata->base_address + XHI_SR_OFFSET);
-       dev_dbg(drvdata->dev, "Getting status = %x\n", status);
        return (status & XHI_SR_DONE_MASK) ? 0 : 1;
 }
 
index 4d3068dd0405af673d606b708490beef46b96893..ffabd3ba2bd82c25076751ddf24decf25f699268 100644 (file)
@@ -56,6 +56,7 @@ int fifo_icap_set_configuration(
                u32 *FrameBuffer,
                u32 NumWords);
 
+u32 fifo_icap_get_status(struct hwicap_drvdata *drvdata);
 void fifo_icap_reset(struct hwicap_drvdata *drvdata);
 void fifo_icap_flush_fifo(struct hwicap_drvdata *drvdata);
 
index 2284fa2a5a5726c52c873e4f13caff36cfab5f3b..016f90567a5200eb27c7a3baf095972f68529cbb 100644 (file)
@@ -36,7 +36,7 @@
  *****************************************************************************/
 
 /*
- * This is the code behind /dev/xilinx_icap -- it allows a user-space
+ * This is the code behind /dev/icap* -- it allows a user-space
  * application to use the Xilinx ICAP subsystem.
  *
  * The following operations are possible:
@@ -67,7 +67,7 @@
  * user-space application code that uses this device.  The simplest
  * way to use this interface is simply:
  *
- * cp foo.bit /dev/xilinx_icap
+ * cp foo.bit /dev/icap0
  *
  * Note that unless foo.bit is an appropriately constructed partial
  * bitstream, this has a high likelyhood of overwriting the design
 #include "buffer_icap.h"
 #include "fifo_icap.h"
 
-#define DRIVER_NAME "xilinx_icap"
+#define DRIVER_NAME "icap"
 
 #define HWICAP_REGS   (0x10000)
 
-/* dynamically allocate device number */
-static int xhwicap_major;
-static int xhwicap_minor;
+#define XHWICAP_MAJOR 259
+#define XHWICAP_MINOR 0
 #define HWICAP_DEVICES 1
 
-module_param(xhwicap_major, int, S_IRUGO);
-module_param(xhwicap_minor, int, S_IRUGO);
-
 /* An array, which is set to true when the device is registered. */
 static bool probed_devices[HWICAP_DEVICES];
 static struct mutex icap_sem;
@@ -250,8 +246,26 @@ static int hwicap_get_configuration_register(struct hwicap_drvdata *drvdata,
         * Create the data to be written to the ICAP.
         */
        buffer[index++] = XHI_DUMMY_PACKET;
+       buffer[index++] = XHI_NOOP_PACKET;
        buffer[index++] = XHI_SYNC_PACKET;
        buffer[index++] = XHI_NOOP_PACKET;
+       buffer[index++] = XHI_NOOP_PACKET;
+
+       /*
+        * Write the data to the FIFO and initiate the transfer of data present
+        * in the FIFO to the ICAP device.
+        */
+       status = drvdata->config->set_configuration(drvdata,
+                                                   &buffer[0], index);
+       if (status)
+               return status;
+
+       /* If the syncword was not found, then we need to start over. */
+       status = drvdata->config->get_status(drvdata);
+       if ((status & XHI_SR_DALIGN_MASK) != XHI_SR_DALIGN_MASK)
+               return -EIO;
+
+       index = 0;
        buffer[index++] = hwicap_type_1_read(reg) | 1;
        buffer[index++] = XHI_NOOP_PACKET;
        buffer[index++] = XHI_NOOP_PACKET;
@@ -587,7 +601,7 @@ static int __devinit hwicap_setup(struct device *dev, int id,
        probed_devices[id] = 1;
        mutex_unlock(&icap_sem);
 
-       devt = MKDEV(xhwicap_major, xhwicap_minor + id);
+       devt = MKDEV(XHWICAP_MAJOR, XHWICAP_MINOR + id);
 
        drvdata = kzalloc(sizeof(struct hwicap_drvdata), GFP_KERNEL);
        if (!drvdata) {
@@ -664,12 +678,14 @@ static int __devinit hwicap_setup(struct device *dev, int id,
 static struct hwicap_driver_config buffer_icap_config = {
        .get_configuration = buffer_icap_get_configuration,
        .set_configuration = buffer_icap_set_configuration,
+       .get_status = buffer_icap_get_status,
        .reset = buffer_icap_reset,
 };
 
 static struct hwicap_driver_config fifo_icap_config = {
        .get_configuration = fifo_icap_get_configuration,
        .set_configuration = fifo_icap_set_configuration,
+       .get_status = fifo_icap_get_status,
        .reset = fifo_icap_reset,
 };
 
@@ -690,7 +706,7 @@ static int __devexit hwicap_remove(struct device *dev)
        dev_set_drvdata(dev, NULL);
 
        mutex_lock(&icap_sem);
-       probed_devices[MINOR(dev->devt)-xhwicap_minor] = 0;
+       probed_devices[MINOR(dev->devt)-XHWICAP_MINOR] = 0;
        mutex_unlock(&icap_sem);
        return 0;               /* success */
 }
@@ -830,23 +846,12 @@ static int __init hwicap_module_init(void)
        icap_class = class_create(THIS_MODULE, "xilinx_config");
        mutex_init(&icap_sem);
 
-       if (xhwicap_major) {
-               devt = MKDEV(xhwicap_major, xhwicap_minor);
-               retval = register_chrdev_region(
-                               devt,
-                               HWICAP_DEVICES,
-                               DRIVER_NAME);
-               if (retval < 0)
-                       return retval;
-       } else {
-               retval = alloc_chrdev_region(&devt,
-                               xhwicap_minor,
-                               HWICAP_DEVICES,
-                               DRIVER_NAME);
-               if (retval < 0)
-                       return retval;
-               xhwicap_major = MAJOR(devt);
-       }
+       devt = MKDEV(XHWICAP_MAJOR, XHWICAP_MINOR);
+       retval = register_chrdev_region(devt,
+                                       HWICAP_DEVICES,
+                                       DRIVER_NAME);
+       if (retval < 0)
+               return retval;
 
        retval = platform_driver_register(&hwicap_platform_driver);
 
@@ -871,7 +876,7 @@ static int __init hwicap_module_init(void)
 
 static void __exit hwicap_module_cleanup(void)
 {
-       dev_t devt = MKDEV(xhwicap_major, xhwicap_minor);
+       dev_t devt = MKDEV(XHWICAP_MAJOR, XHWICAP_MINOR);
 
        class_destroy(icap_class);
 
index 405fee7e189bd72da5ff8d08514ad141a03771f3..1f9c8b082dbe1643920a59f4cba44973957607de 100644 (file)
@@ -65,10 +65,27 @@ struct hwicap_drvdata {
 };
 
 struct hwicap_driver_config {
+       /* Read configuration data given by size into the data buffer.
+          Return 0 if successful. */
        int (*get_configuration)(struct hwicap_drvdata *drvdata, u32 *data,
                        u32 size);
+       /* Write configuration data given by size from the data buffer.
+          Return 0 if successful. */
        int (*set_configuration)(struct hwicap_drvdata *drvdata, u32 *data,
                        u32 size);
+       /* Get the status register, bit pattern given by:
+        * D8 - 0 = configuration error
+        * D7 - 1 = alignment found
+        * D6 - 1 = readback in progress
+        * D5 - 0 = abort in progress
+        * D4 - Always 1
+        * D3 - Always 1
+        * D2 - Always 1
+        * D1 - Always 1
+        * D0 - 1 = operation completed
+        */
+       u32 (*get_status)(struct hwicap_drvdata *drvdata);
+       /* Reset the hw */
        void (*reset)(struct hwicap_drvdata *drvdata);
 };
 
@@ -163,6 +180,13 @@ struct config_registers {
 /* Constant to use for CRC check when CRC has been disabled */
 #define XHI_DISABLED_AUTO_CRC       0x0000DEFCUL
 
+/* Meanings of the bits returned by get_status */
+#define XHI_SR_CFGERR_N_MASK 0x00000100 /* Config Error Mask */
+#define XHI_SR_DALIGN_MASK 0x00000080 /* Data Alignment Mask */
+#define XHI_SR_RIP_MASK 0x00000040 /* Read back Mask */
+#define XHI_SR_IN_ABORT_N_MASK 0x00000020 /* Select Map Abort Mask */
+#define XHI_SR_DONE_MASK 0x00000001 /* Done bit Mask  */
+
 /**
  * hwicap_type_1_read - Generates a Type 1 read packet header.
  * @reg: is the address of the register to be read back.
index a522254702258df2155fde786d87e938567b3013..1525882190fdac24d6ce01eb50e3a31d3b5dbca3 100644 (file)
@@ -1,3 +1,4 @@
+obj-$(CONFIG_ATMEL_TCB_CLKSRC) += tcb_clksrc.o
 obj-$(CONFIG_X86_CYCLONE_TIMER)        += cyclone.o
 obj-$(CONFIG_X86_PM_TIMER)     += acpi_pm.o
 obj-$(CONFIG_SCx200HR_TIMER)   += scx200_hrt.o
diff --git a/drivers/clocksource/tcb_clksrc.c b/drivers/clocksource/tcb_clksrc.c
new file mode 100644 (file)
index 0000000..f450588
--- /dev/null
@@ -0,0 +1,302 @@
+#include <linux/init.h>
+#include <linux/clocksource.h>
+#include <linux/clockchips.h>
+#include <linux/interrupt.h>
+#include <linux/irq.h>
+
+#include <linux/clk.h>
+#include <linux/err.h>
+#include <linux/ioport.h>
+#include <linux/io.h>
+#include <linux/platform_device.h>
+#include <linux/atmel_tc.h>
+
+
+/*
+ * We're configured to use a specific TC block, one that's not hooked
+ * up to external hardware, to provide a time solution:
+ *
+ *   - Two channels combine to create a free-running 32 bit counter
+ *     with a base rate of 5+ MHz, packaged as a clocksource (with
+ *     resolution better than 200 nsec).
+ *
+ *   - The third channel may be used to provide a 16-bit clockevent
+ *     source, used in either periodic or oneshot mode.  This runs
+ *     at 32 KiHZ, and can handle delays of up to two seconds.
+ *
+ * A boot clocksource and clockevent source are also currently needed,
+ * unless the relevant platforms (ARM/AT91, AVR32/AT32) are changed so
+ * this code can be used when init_timers() is called, well before most
+ * devices are set up.  (Some low end AT91 parts, which can run uClinux,
+ * have only the timers in one TC block... they currently don't support
+ * the tclib code, because of that initialization issue.)
+ *
+ * REVISIT behavior during system suspend states... we should disable
+ * all clocks and save the power.  Easily done for clockevent devices,
+ * but clocksources won't necessarily get the needed notifications.
+ * For deeper system sleep states, this will be mandatory...
+ */
+
+static void __iomem *tcaddr;
+
+static cycle_t tc_get_cycles(void)
+{
+       unsigned long   flags;
+       u32             lower, upper;
+
+       raw_local_irq_save(flags);
+       do {
+               upper = __raw_readl(tcaddr + ATMEL_TC_REG(1, CV));
+               lower = __raw_readl(tcaddr + ATMEL_TC_REG(0, CV));
+       } while (upper != __raw_readl(tcaddr + ATMEL_TC_REG(1, CV)));
+
+       raw_local_irq_restore(flags);
+       return (upper << 16) | lower;
+}
+
+static struct clocksource clksrc = {
+       .name           = "tcb_clksrc",
+       .rating         = 200,
+       .read           = tc_get_cycles,
+       .mask           = CLOCKSOURCE_MASK(32),
+       .shift          = 18,
+       .flags          = CLOCK_SOURCE_IS_CONTINUOUS,
+};
+
+#ifdef CONFIG_GENERIC_CLOCKEVENTS
+
+struct tc_clkevt_device {
+       struct clock_event_device       clkevt;
+       struct clk                      *clk;
+       void __iomem                    *regs;
+};
+
+static struct tc_clkevt_device *to_tc_clkevt(struct clock_event_device *clkevt)
+{
+       return container_of(clkevt, struct tc_clkevt_device, clkevt);
+}
+
+/* For now, we always use the 32K clock ... this optimizes for NO_HZ,
+ * because using one of the divided clocks would usually mean the
+ * tick rate can never be less than several dozen Hz (vs 0.5 Hz).
+ *
+ * A divided clock could be good for high resolution timers, since
+ * 30.5 usec resolution can seem "low".
+ */
+static u32 timer_clock;
+
+static void tc_mode(enum clock_event_mode m, struct clock_event_device *d)
+{
+       struct tc_clkevt_device *tcd = to_tc_clkevt(d);
+       void __iomem            *regs = tcd->regs;
+
+       if (tcd->clkevt.mode == CLOCK_EVT_MODE_PERIODIC
+                       || tcd->clkevt.mode == CLOCK_EVT_MODE_ONESHOT) {
+               __raw_writel(0xff, regs + ATMEL_TC_REG(2, IDR));
+               __raw_writel(ATMEL_TC_CLKDIS, regs + ATMEL_TC_REG(2, CCR));
+               clk_disable(tcd->clk);
+       }
+
+       switch (m) {
+
+       /* By not making the gentime core emulate periodic mode on top
+        * of oneshot, we get lower overhead and improved accuracy.
+        */
+       case CLOCK_EVT_MODE_PERIODIC:
+               clk_enable(tcd->clk);
+
+               /* slow clock, count up to RC, then irq and restart */
+               __raw_writel(timer_clock
+                               | ATMEL_TC_WAVE | ATMEL_TC_WAVESEL_UP_AUTO,
+                               regs + ATMEL_TC_REG(2, CMR));
+               __raw_writel((32768 + HZ/2) / HZ, tcaddr + ATMEL_TC_REG(2, RC));
+
+               /* Enable clock and interrupts on RC compare */
+               __raw_writel(ATMEL_TC_CPCS, regs + ATMEL_TC_REG(2, IER));
+
+               /* go go gadget! */
+               __raw_writel(ATMEL_TC_CLKEN | ATMEL_TC_SWTRG,
+                               regs + ATMEL_TC_REG(2, CCR));
+               break;
+
+       case CLOCK_EVT_MODE_ONESHOT:
+               clk_enable(tcd->clk);
+
+               /* slow clock, count up to RC, then irq and stop */
+               __raw_writel(timer_clock | ATMEL_TC_CPCSTOP
+                               | ATMEL_TC_WAVE | ATMEL_TC_WAVESEL_UP_AUTO,
+                               regs + ATMEL_TC_REG(2, CMR));
+               __raw_writel(ATMEL_TC_CPCS, regs + ATMEL_TC_REG(2, IER));
+
+               /* set_next_event() configures and starts the timer */
+               break;
+
+       default:
+               break;
+       }
+}
+
+static int tc_next_event(unsigned long delta, struct clock_event_device *d)
+{
+       __raw_writel(delta, tcaddr + ATMEL_TC_REG(2, RC));
+
+       /* go go gadget! */
+       __raw_writel(ATMEL_TC_CLKEN | ATMEL_TC_SWTRG,
+                       tcaddr + ATMEL_TC_REG(2, CCR));
+       return 0;
+}
+
+static struct tc_clkevt_device clkevt = {
+       .clkevt = {
+               .name           = "tc_clkevt",
+               .features       = CLOCK_EVT_FEAT_PERIODIC
+                                       | CLOCK_EVT_FEAT_ONESHOT,
+               .shift          = 32,
+               /* Should be lower than at91rm9200's system timer */
+               .rating         = 125,
+               .cpumask        = CPU_MASK_CPU0,
+               .set_next_event = tc_next_event,
+               .set_mode       = tc_mode,
+       },
+};
+
+static irqreturn_t ch2_irq(int irq, void *handle)
+{
+       struct tc_clkevt_device *dev = handle;
+       unsigned int            sr;
+
+       sr = __raw_readl(dev->regs + ATMEL_TC_REG(2, SR));
+       if (sr & ATMEL_TC_CPCS) {
+               dev->clkevt.event_handler(&dev->clkevt);
+               return IRQ_HANDLED;
+       }
+
+       return IRQ_NONE;
+}
+
+static struct irqaction tc_irqaction = {
+       .name           = "tc_clkevt",
+       .flags          = IRQF_TIMER | IRQF_DISABLED,
+       .handler        = ch2_irq,
+};
+
+static void __init setup_clkevents(struct atmel_tc *tc, int clk32k_divisor_idx)
+{
+       struct clk *t2_clk = tc->clk[2];
+       int irq = tc->irq[2];
+
+       clkevt.regs = tc->regs;
+       clkevt.clk = t2_clk;
+       tc_irqaction.dev_id = &clkevt;
+
+       timer_clock = clk32k_divisor_idx;
+
+       clkevt.clkevt.mult = div_sc(32768, NSEC_PER_SEC, clkevt.clkevt.shift);
+       clkevt.clkevt.max_delta_ns
+               = clockevent_delta2ns(0xffff, &clkevt.clkevt);
+       clkevt.clkevt.min_delta_ns = clockevent_delta2ns(1, &clkevt.clkevt) + 1;
+
+       setup_irq(irq, &tc_irqaction);
+
+       clockevents_register_device(&clkevt.clkevt);
+}
+
+#else /* !CONFIG_GENERIC_CLOCKEVENTS */
+
+static void __init setup_clkevents(struct atmel_tc *tc, int clk32k_divisor_idx)
+{
+       /* NOTHING */
+}
+
+#endif
+
+static int __init tcb_clksrc_init(void)
+{
+       static char bootinfo[] __initdata
+               = KERN_DEBUG "%s: tc%d at %d.%03d MHz\n";
+
+       struct platform_device *pdev;
+       struct atmel_tc *tc;
+       struct clk *t0_clk;
+       u32 rate, divided_rate = 0;
+       int best_divisor_idx = -1;
+       int clk32k_divisor_idx = -1;
+       int i;
+
+       tc = atmel_tc_alloc(CONFIG_ATMEL_TCB_CLKSRC_BLOCK, clksrc.name);
+       if (!tc) {
+               pr_debug("can't alloc TC for clocksource\n");
+               return -ENODEV;
+       }
+       tcaddr = tc->regs;
+       pdev = tc->pdev;
+
+       t0_clk = tc->clk[0];
+       clk_enable(t0_clk);
+
+       /* How fast will we be counting?  Pick something over 5 MHz.  */
+       rate = (u32) clk_get_rate(t0_clk);
+       for (i = 0; i < 5; i++) {
+               unsigned divisor = atmel_tc_divisors[i];
+               unsigned tmp;
+
+               /* remember 32 KiHz clock for later */
+               if (!divisor) {
+                       clk32k_divisor_idx = i;
+                       continue;
+               }
+
+               tmp = rate / divisor;
+               pr_debug("TC: %u / %-3u [%d] --> %u\n", rate, divisor, i, tmp);
+               if (best_divisor_idx > 0) {
+                       if (tmp < 5 * 1000 * 1000)
+                               continue;
+               }
+               divided_rate = tmp;
+               best_divisor_idx = i;
+       }
+
+       clksrc.mult = clocksource_hz2mult(divided_rate, clksrc.shift);
+
+       printk(bootinfo, clksrc.name, CONFIG_ATMEL_TCB_CLKSRC_BLOCK,
+                       divided_rate / 1000000,
+                       ((divided_rate + 500000) % 1000000) / 1000);
+
+       /* tclib will give us three clocks no matter what the
+        * underlying platform supports.
+        */
+       clk_enable(tc->clk[1]);
+
+       /* channel 0:  waveform mode, input mclk/8, clock TIOA0 on overflow */
+       __raw_writel(best_divisor_idx                   /* likely divide-by-8 */
+                       | ATMEL_TC_WAVE
+                       | ATMEL_TC_WAVESEL_UP           /* free-run */
+                       | ATMEL_TC_ACPA_SET             /* TIOA0 rises at 0 */
+                       | ATMEL_TC_ACPC_CLEAR,          /* (duty cycle 50%) */
+                       tcaddr + ATMEL_TC_REG(0, CMR));
+       __raw_writel(0x0000, tcaddr + ATMEL_TC_REG(0, RA));
+       __raw_writel(0x8000, tcaddr + ATMEL_TC_REG(0, RC));
+       __raw_writel(0xff, tcaddr + ATMEL_TC_REG(0, IDR));      /* no irqs */
+       __raw_writel(ATMEL_TC_CLKEN, tcaddr + ATMEL_TC_REG(0, CCR));
+
+       /* channel 1:  waveform mode, input TIOA0 */
+       __raw_writel(ATMEL_TC_XC1                       /* input: TIOA0 */
+                       | ATMEL_TC_WAVE
+                       | ATMEL_TC_WAVESEL_UP,          /* free-run */
+                       tcaddr + ATMEL_TC_REG(1, CMR));
+       __raw_writel(0xff, tcaddr + ATMEL_TC_REG(1, IDR));      /* no irqs */
+       __raw_writel(ATMEL_TC_CLKEN, tcaddr + ATMEL_TC_REG(1, CCR));
+
+       /* chain channel 0 to channel 1, then reset all the timers */
+       __raw_writel(ATMEL_TC_TC1XC1S_TIOA0, tcaddr + ATMEL_TC_BMR);
+       __raw_writel(ATMEL_TC_SYNC, tcaddr + ATMEL_TC_BCR);
+
+       /* and away we go! */
+       clocksource_register(&clksrc);
+
+       /* channel 2:  periodic and oneshot timer support */
+       setup_clkevents(tc, clk32k_divisor_idx);
+
+       return 0;
+}
+arch_initcall(tcb_clksrc_init);
index 2d01bc1b9752d0d5bbc43c844561699575f030d6..d9c8daf7ae7d798b29a728464e1365c2fbe10b22 100644 (file)
@@ -26,7 +26,8 @@
 #include <linux/delay.h>
 #include <linux/idr.h>
 #include <linux/string.h>
-#include <asm/semaphore.h>
+#include <linux/rwsem.h>
+#include <linux/semaphore.h>
 #include <asm/system.h>
 #include <linux/ctype.h>
 #include "fw-transaction.h"
index 3a59e9b783b03a6dfc60539df1d04dcff0af48fd..ccf0e4cf108f4b65298f1cde98041cc08027d7e2 100644 (file)
@@ -29,7 +29,6 @@
 #include <linux/list.h>
 #include <linux/kthread.h>
 #include <asm/uaccess.h>
-#include <asm/semaphore.h>
 
 #include "fw-transaction.h"
 #include "fw-topology.h"
index 05f02a326f1c6283277964f307873df9cb5a5489..40ffd767647d623baa1259618b8912ef8ecc863d 100644 (file)
@@ -93,4 +93,24 @@ config DMIID
          information from userspace through /sys/class/dmi/id/ or if you want
          DMI-based module auto-loading.
 
+config ISCSI_IBFT_FIND
+       bool "iSCSI Boot Firmware Table Attributes"
+       depends on X86
+       default n
+       help
+         This option enables the kernel to find the region of memory
+         in which the ISCSI Boot Firmware Table (iBFT) resides. This
+         is necessary for iSCSI Boot Firmware Table Attributes module to work
+         properly.
+
+config ISCSI_IBFT
+       tristate "iSCSI Boot Firmware Table Attributes module"
+       depends on ISCSI_IBFT_FIND
+       default n
+       help
+         This option enables support for detection and exposing of iSCSI
+         Boot Firmware Table (iBFT) via sysfs to userspace. If you wish to
+         detect iSCSI boot parameters dynamically during system boot, say Y.
+         Otherwise, say N.
+
 endmenu
index 8d4ebc805a505cae9ff188fc24604e88e058be60..4c9147154df891d0659cd1f68582a9f6fca4a196 100644 (file)
@@ -8,3 +8,5 @@ obj-$(CONFIG_EFI_PCDP)          += pcdp.o
 obj-$(CONFIG_DELL_RBU)          += dell_rbu.o
 obj-$(CONFIG_DCDBAS)           += dcdbas.o
 obj-$(CONFIG_DMIID)            += dmi-id.o
+obj-$(CONFIG_ISCSI_IBFT_FIND)  += iscsi_ibft_find.o
+obj-$(CONFIG_ISCSI_IBFT)       += iscsi_ibft.o
index 1636806ec55e8432af872e6327ef02b297db795c..f235940719e71363b0a5f273ac84e9bc57093c37 100644 (file)
@@ -35,7 +35,6 @@
 #include <linux/types.h>
 #include <linux/mutex.h>
 #include <asm/io.h>
-#include <asm/semaphore.h>
 
 #include "dcdbas.h"
 
@@ -265,7 +264,7 @@ static int smi_request(struct smi_cmd *smi_cmd)
 
        /* SMI requires CPU 0 */
        old_mask = current->cpus_allowed;
-       set_cpus_allowed(current, cpumask_of_cpu(0));
+       set_cpus_allowed_ptr(current, &cpumask_of_cpu(0));
        if (smp_processor_id() != 0) {
                dev_dbg(&dcdbas_pdev->dev, "%s: failed to get CPU 0\n",
                        __FUNCTION__);
@@ -285,7 +284,7 @@ static int smi_request(struct smi_cmd *smi_cmd)
        );
 
 out:
-       set_cpus_allowed(current, old_mask);
+       set_cpus_allowed_ptr(current, &old_mask);
        return ret;
 }
 
diff --git a/drivers/firmware/iscsi_ibft.c b/drivers/firmware/iscsi_ibft.c
new file mode 100644 (file)
index 0000000..8024e3b
--- /dev/null
@@ -0,0 +1,982 @@
+/*
+ *  Copyright 2007 Red Hat, Inc.
+ *  by Peter Jones <pjones@redhat.com>
+ *  Copyright 2008 IBM, Inc.
+ *  by Konrad Rzeszutek <konradr@linux.vnet.ibm.com>
+ *  Copyright 2008
+ *  by Konrad Rzeszutek <ketuzsezr@darnok.org>
+ *
+ * This code exposes the iSCSI Boot Format Table to userland via sysfs.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License v2.0 as published by
+ * the Free Software Foundation
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * Changelog:
+ *
+ *  14 Mar 2008 - Konrad Rzeszutek <ketuzsezr@darnok.org>
+ *    Updated comments and copyrights. (v0.4.9)
+ *
+ *  11 Feb 2008 - Konrad Rzeszutek <konradr@linux.vnet.ibm.com>
+ *    Converted to using ibft_addr. (v0.4.8)
+ *
+ *   8 Feb 2008 - Konrad Rzeszutek <konradr@linux.vnet.ibm.com>
+ *    Combined two functions in one: reserve_ibft_region. (v0.4.7)
+ *
+ *  30 Jan 2008 - Konrad Rzeszutek <konradr@linux.vnet.ibm.com>
+ *   Added logic to handle IPv6 addresses. (v0.4.6)
+ *
+ *  25 Jan 2008 - Konrad Rzeszutek <konradr@linux.vnet.ibm.com>
+ *   Added logic to handle badly not-to-spec iBFT. (v0.4.5)
+ *
+ *   4 Jan 2008 - Konrad Rzeszutek <konradr@linux.vnet.ibm.com>
+ *   Added __init to function declarations. (v0.4.4)
+ *
+ *  21 Dec 2007 - Konrad Rzeszutek <konradr@linux.vnet.ibm.com>
+ *   Updated kobject registration, combined unregister functions in one
+ *   and code and style cleanup. (v0.4.3)
+ *
+ *   5 Dec 2007 - Konrad Rzeszutek <konradr@linux.vnet.ibm.com>
+ *   Added end-markers to enums and re-organized kobject registration. (v0.4.2)
+ *
+ *   4 Dec 2007 - Konrad Rzeszutek <konradr@linux.vnet.ibm.com>
+ *   Created 'device' sysfs link to the NIC and style cleanup. (v0.4.1)
+ *
+ *  28 Nov 2007 - Konrad Rzeszutek <konradr@linux.vnet.ibm.com>
+ *   Added sysfs-ibft documentation, moved 'find_ibft' function to
+ *   in its own file and added text attributes for every struct field.  (v0.4)
+ *
+ *  21 Nov 2007 - Konrad Rzeszutek <konradr@linux.vnet.ibm.com>
+ *   Added text attributes emulating OpenFirmware /proc/device-tree naming.
+ *   Removed binary /sysfs interface (v0.3)
+ *
+ *  29 Aug 2007 - Konrad Rzeszutek <konradr@linux.vnet.ibm.com>
+ *   Added functionality in setup.c to reserve iBFT region. (v0.2)
+ *
+ *  27 Aug 2007 - Konrad Rzeszutek <konradr@linux.vnet.ibm.com>
+ *   First version exposing iBFT data via a binary /sysfs. (v0.1)
+ *
+ */
+
+
+#include <linux/blkdev.h>
+#include <linux/capability.h>
+#include <linux/ctype.h>
+#include <linux/device.h>
+#include <linux/err.h>
+#include <linux/init.h>
+#include <linux/iscsi_ibft.h>
+#include <linux/limits.h>
+#include <linux/module.h>
+#include <linux/pci.h>
+#include <linux/slab.h>
+#include <linux/stat.h>
+#include <linux/string.h>
+#include <linux/types.h>
+
+#define IBFT_ISCSI_VERSION "0.4.9"
+#define IBFT_ISCSI_DATE "2008-Mar-14"
+
+MODULE_AUTHOR("Peter Jones <pjones@redhat.com> and \
+Konrad Rzeszutek <ketuzsezr@darnok.org>");
+MODULE_DESCRIPTION("sysfs interface to BIOS iBFT information");
+MODULE_LICENSE("GPL");
+MODULE_VERSION(IBFT_ISCSI_VERSION);
+
+struct ibft_hdr {
+       u8 id;
+       u8 version;
+       u16 length;
+       u8 index;
+       u8 flags;
+} __attribute__((__packed__));
+
+struct ibft_control {
+       struct ibft_hdr hdr;
+       u16 extensions;
+       u16 initiator_off;
+       u16 nic0_off;
+       u16 tgt0_off;
+       u16 nic1_off;
+       u16 tgt1_off;
+} __attribute__((__packed__));
+
+struct ibft_initiator {
+       struct ibft_hdr hdr;
+       char isns_server[16];
+       char slp_server[16];
+       char pri_radius_server[16];
+       char sec_radius_server[16];
+       u16 initiator_name_len;
+       u16 initiator_name_off;
+} __attribute__((__packed__));
+
+struct ibft_nic {
+       struct ibft_hdr hdr;
+       char ip_addr[16];
+       u8 subnet_mask_prefix;
+       u8 origin;
+       char gateway[16];
+       char primary_dns[16];
+       char secondary_dns[16];
+       char dhcp[16];
+       u16 vlan;
+       char mac[6];
+       u16 pci_bdf;
+       u16 hostname_len;
+       u16 hostname_off;
+} __attribute__((__packed__));
+
+struct ibft_tgt {
+       struct ibft_hdr hdr;
+       char ip_addr[16];
+       u16 port;
+       char lun[8];
+       u8 chap_type;
+       u8 nic_assoc;
+       u16 tgt_name_len;
+       u16 tgt_name_off;
+       u16 chap_name_len;
+       u16 chap_name_off;
+       u16 chap_secret_len;
+       u16 chap_secret_off;
+       u16 rev_chap_name_len;
+       u16 rev_chap_name_off;
+       u16 rev_chap_secret_len;
+       u16 rev_chap_secret_off;
+} __attribute__((__packed__));
+
+/*
+ * The kobject different types and its names.
+ *
+*/
+enum ibft_id {
+       id_reserved = 0, /* We don't support. */
+       id_control = 1, /* Should show up only once and is not exported. */
+       id_initiator = 2,
+       id_nic = 3,
+       id_target = 4,
+       id_extensions = 5, /* We don't support. */
+       id_end_marker,
+};
+
+/*
+ * We do not support the other types, hence the usage of NULL.
+ * This maps to the enum ibft_id.
+ */
+static const char *ibft_id_names[] =
+       {NULL, NULL, "initiator", "ethernet%d", "target%d", NULL, NULL};
+
+/*
+ * The text attributes names for each of the kobjects.
+*/
+enum ibft_eth_properties_enum {
+       ibft_eth_index,
+       ibft_eth_flags,
+       ibft_eth_ip_addr,
+       ibft_eth_subnet_mask,
+       ibft_eth_origin,
+       ibft_eth_gateway,
+       ibft_eth_primary_dns,
+       ibft_eth_secondary_dns,
+       ibft_eth_dhcp,
+       ibft_eth_vlan,
+       ibft_eth_mac,
+       /* ibft_eth_pci_bdf - this is replaced by link to the device itself. */
+       ibft_eth_hostname,
+       ibft_eth_end_marker,
+};
+
+static const char *ibft_eth_properties[] =
+       {"index", "flags", "ip-addr", "subnet-mask", "origin", "gateway",
+       "primary-dns", "secondary-dns", "dhcp", "vlan", "mac", "hostname",
+       NULL};
+
+enum ibft_tgt_properties_enum {
+       ibft_tgt_index,
+       ibft_tgt_flags,
+       ibft_tgt_ip_addr,
+       ibft_tgt_port,
+       ibft_tgt_lun,
+       ibft_tgt_chap_type,
+       ibft_tgt_nic_assoc,
+       ibft_tgt_name,
+       ibft_tgt_chap_name,
+       ibft_tgt_chap_secret,
+       ibft_tgt_rev_chap_name,
+       ibft_tgt_rev_chap_secret,
+       ibft_tgt_end_marker,
+};
+
+static const char *ibft_tgt_properties[] =
+       {"index", "flags", "ip-addr", "port", "lun", "chap-type", "nic-assoc",
+       "target-name", "chap-name", "chap-secret", "rev-chap-name",
+       "rev-chap-name-secret", NULL};
+
+enum ibft_initiator_properties_enum {
+       ibft_init_index,
+       ibft_init_flags,
+       ibft_init_isns_server,
+       ibft_init_slp_server,
+       ibft_init_pri_radius_server,
+       ibft_init_sec_radius_server,
+       ibft_init_initiator_name,
+       ibft_init_end_marker,
+};
+
+static const char *ibft_initiator_properties[] =
+       {"index", "flags", "isns-server", "slp-server", "pri-radius-server",
+       "sec-radius-server", "initiator-name", NULL};
+
+/*
+ * The kobject and attribute structures.
+ */
+
+struct ibft_kobject {
+       struct ibft_table_header *header;
+       union {
+               struct ibft_initiator *initiator;
+               struct ibft_nic *nic;
+               struct ibft_tgt *tgt;
+               struct ibft_hdr *hdr;
+       };
+       struct kobject kobj;
+       struct list_head node;
+};
+
+struct ibft_attribute {
+       struct attribute attr;
+       ssize_t (*show) (struct  ibft_kobject *entry,
+                        struct ibft_attribute *attr, char *buf);
+       union {
+               struct ibft_initiator *initiator;
+               struct ibft_nic *nic;
+               struct ibft_tgt *tgt;
+               struct ibft_hdr *hdr;
+       };
+       struct kobject *kobj;
+       int type; /* The enum of the type. This can be any value of:
+               ibft_eth_properties_enum, ibft_tgt_properties_enum,
+               or ibft_initiator_properties_enum. */
+       struct list_head node;
+};
+
+static LIST_HEAD(ibft_attr_list);
+static LIST_HEAD(ibft_kobject_list);
+
+static const char nulls[16];
+
+/*
+ * Helper functions to parse data properly.
+ */
+static ssize_t sprintf_ipaddr(char *buf, u8 *ip)
+{
+       char *str = buf;
+
+       if (ip[0] == 0 && ip[1] == 0 && ip[2] == 0 && ip[3] == 0 &&
+           ip[4] == 0 && ip[5] == 0 && ip[6] == 0 && ip[7] == 0 &&
+           ip[8] == 0 && ip[9] == 0 && ip[10] == 0xff && ip[11] == 0xff) {
+               /*
+                * IPV4
+                */
+               str += sprintf(buf, NIPQUAD_FMT, ip[12],
+                              ip[13], ip[14], ip[15]);
+       } else {
+               /*
+                * IPv6
+                */
+               str += sprintf(str, NIP6_FMT, ntohs(ip[0]), ntohs(ip[1]),
+                              ntohs(ip[2]), ntohs(ip[3]), ntohs(ip[4]),
+                              ntohs(ip[5]), ntohs(ip[6]), ntohs(ip[7]));
+       }
+       str += sprintf(str, "\n");
+       return str - buf;
+}
+
+static ssize_t sprintf_string(char *str, int len, char *buf)
+{
+       return sprintf(str, "%.*s\n", len, buf);
+}
+
+/*
+ * Helper function to verify the IBFT header.
+ */
+static int ibft_verify_hdr(char *t, struct ibft_hdr *hdr, int id, int length)
+{
+       if (hdr->id != id) {
+               printk(KERN_ERR "iBFT error: We expected the " \
+                               "field header.id to have %d but " \
+                               "found %d instead!\n", id, hdr->id);
+               return -ENODEV;
+       }
+       if (hdr->length != length) {
+               printk(KERN_ERR "iBFT error: We expected the " \
+                               "field header.length to have %d but " \
+                               "found %d instead!\n", length, hdr->length);
+               return -ENODEV;
+       }
+
+       return 0;
+}
+
+static void ibft_release(struct kobject *kobj)
+{
+       struct ibft_kobject *ibft =
+               container_of(kobj, struct ibft_kobject, kobj);
+       kfree(ibft);
+}
+
+/*
+ *  Routines for parsing the iBFT data to be human readable.
+ */
+ssize_t ibft_attr_show_initiator(struct ibft_kobject *entry,
+                                 struct ibft_attribute *attr,
+                                 char *buf)
+{
+       struct ibft_initiator *initiator = entry->initiator;
+       void *ibft_loc = entry->header;
+       char *str = buf;
+
+       if (!initiator)
+               return 0;
+
+       switch (attr->type) {
+       case ibft_init_index:
+               str += sprintf(str, "%d\n", initiator->hdr.index);
+               break;
+       case ibft_init_flags:
+               str += sprintf(str, "%d\n", initiator->hdr.flags);
+               break;
+       case ibft_init_isns_server:
+               str += sprintf_ipaddr(str, initiator->isns_server);
+               break;
+       case ibft_init_slp_server:
+               str += sprintf_ipaddr(str, initiator->slp_server);
+               break;
+       case ibft_init_pri_radius_server:
+               str += sprintf_ipaddr(str, initiator->pri_radius_server);
+               break;
+       case ibft_init_sec_radius_server:
+               str += sprintf_ipaddr(str, initiator->sec_radius_server);
+               break;
+       case ibft_init_initiator_name:
+               str += sprintf_string(str, initiator->initiator_name_len,
+                                     (char *)ibft_loc +
+                                     initiator->initiator_name_off);
+               break;
+       default:
+               break;
+       }
+
+       return str - buf;
+}
+
+ssize_t ibft_attr_show_nic(struct ibft_kobject *entry,
+                           struct ibft_attribute *attr,
+                           char *buf)
+{
+       struct ibft_nic *nic = entry->nic;
+       void *ibft_loc = entry->header;
+       char *str = buf;
+       char *mac;
+       int val;
+
+       if (!nic)
+               return 0;
+
+       switch (attr->type) {
+       case ibft_eth_index:
+               str += sprintf(str, "%d\n", nic->hdr.index);
+               break;
+       case ibft_eth_flags:
+               str += sprintf(str, "%d\n", nic->hdr.flags);
+               break;
+       case ibft_eth_ip_addr:
+               str += sprintf_ipaddr(str, nic->ip_addr);
+               break;
+       case ibft_eth_subnet_mask:
+               val = ~((1 << (32-nic->subnet_mask_prefix))-1);
+               str += sprintf(str, NIPQUAD_FMT,
+                              (u8)(val >> 24), (u8)(val >> 16),
+                              (u8)(val >> 8), (u8)(val));
+               break;
+       case ibft_eth_origin:
+               str += sprintf(str, "%d\n", nic->origin);
+               break;
+       case ibft_eth_gateway:
+               str += sprintf_ipaddr(str, nic->gateway);
+               break;
+       case ibft_eth_primary_dns:
+               str += sprintf_ipaddr(str, nic->primary_dns);
+               break;
+       case ibft_eth_secondary_dns:
+               str += sprintf_ipaddr(str, nic->secondary_dns);
+               break;
+       case ibft_eth_dhcp:
+               str += sprintf_ipaddr(str, nic->dhcp);
+               break;
+       case ibft_eth_vlan:
+               str += sprintf(str, "%d\n", nic->vlan);
+               break;
+       case ibft_eth_mac:
+               mac = nic->mac;
+               str += sprintf(str, "%02x:%02x:%02x:%02x:%02x:%02x\n",
+                              (u8)mac[0], (u8)mac[1], (u8)mac[2],
+                              (u8)mac[3], (u8)mac[4], (u8)mac[5]);
+               break;
+       case ibft_eth_hostname:
+               str += sprintf_string(str, nic->hostname_len,
+                                     (char *)ibft_loc + nic->hostname_off);
+               break;
+       default:
+               break;
+       }
+
+       return str - buf;
+};
+
+ssize_t ibft_attr_show_target(struct ibft_kobject *entry,
+                              struct ibft_attribute *attr,
+                              char *buf)
+{
+       struct ibft_tgt *tgt = entry->tgt;
+       void *ibft_loc = entry->header;
+       char *str = buf;
+       int i;
+
+       if (!tgt)
+               return 0;
+
+       switch (attr->type) {
+       case ibft_tgt_index:
+               str += sprintf(str, "%d\n", tgt->hdr.index);
+               break;
+       case ibft_tgt_flags:
+               str += sprintf(str, "%d\n", tgt->hdr.flags);
+               break;
+       case ibft_tgt_ip_addr:
+               str += sprintf_ipaddr(str, tgt->ip_addr);
+               break;
+       case ibft_tgt_port:
+               str += sprintf(str, "%d\n", tgt->port);
+               break;
+       case ibft_tgt_lun:
+               for (i = 0; i < 8; i++)
+                       str += sprintf(str, "%x", (u8)tgt->lun[i]);
+               str += sprintf(str, "\n");
+               break;
+       case ibft_tgt_nic_assoc:
+               str += sprintf(str, "%d\n", tgt->nic_assoc);
+               break;
+       case ibft_tgt_chap_type:
+               str += sprintf(str, "%d\n", tgt->chap_type);
+               break;
+       case ibft_tgt_name:
+               str += sprintf_string(str, tgt->tgt_name_len,
+                                     (char *)ibft_loc + tgt->tgt_name_off);
+               break;
+       case ibft_tgt_chap_name:
+               str += sprintf_string(str, tgt->chap_name_len,
+                                     (char *)ibft_loc + tgt->chap_name_off);
+               break;
+       case ibft_tgt_chap_secret:
+               str += sprintf_string(str, tgt->chap_secret_len,
+                                     (char *)ibft_loc + tgt->chap_secret_off);
+               break;
+       case ibft_tgt_rev_chap_name:
+               str += sprintf_string(str, tgt->rev_chap_name_len,
+                                     (char *)ibft_loc +
+                                     tgt->rev_chap_name_off);
+               break;
+       case ibft_tgt_rev_chap_secret:
+               str += sprintf_string(str, tgt->rev_chap_secret_len,
+                                     (char *)ibft_loc +
+                                     tgt->rev_chap_secret_off);
+               break;
+       default:
+               break;
+       }
+
+       return str - buf;
+}
+
+/*
+ * The routine called for all sysfs attributes.
+ */
+static ssize_t ibft_show_attribute(struct kobject *kobj,
+                                   struct attribute *attr,
+                                   char *buf)
+{
+       struct ibft_kobject *dev =
+               container_of(kobj, struct ibft_kobject, kobj);
+       struct ibft_attribute *ibft_attr =
+               container_of(attr, struct ibft_attribute, attr);
+       ssize_t ret = -EIO;
+       char *str = buf;
+
+       if (!capable(CAP_SYS_ADMIN))
+               return -EACCES;
+
+       if (ibft_attr->show)
+               ret = ibft_attr->show(dev, ibft_attr, str);
+
+       return ret;
+}
+
+static struct sysfs_ops ibft_attr_ops = {
+       .show = ibft_show_attribute,
+};
+
+static struct kobj_type ibft_ktype = {
+       .release = ibft_release,
+       .sysfs_ops = &ibft_attr_ops,
+};
+
+static struct kset *ibft_kset;
+
+static int __init ibft_check_device(void)
+{
+       int len;
+       u8 *pos;
+       u8 csum = 0;
+
+       len = ibft_addr->length;
+
+       /* Sanity checking of iBFT. */
+       if (ibft_addr->revision != 1) {
+               printk(KERN_ERR "iBFT module supports only revision 1, " \
+                               "while this is %d.\n", ibft_addr->revision);
+               return -ENOENT;
+       }
+       for (pos = (u8 *)ibft_addr; pos < (u8 *)ibft_addr + len; pos++)
+               csum += *pos;
+
+       if (csum) {
+               printk(KERN_ERR "iBFT has incorrect checksum (0x%x)!\n", csum);
+               return -ENOENT;
+       }
+
+       return 0;
+}
+
+/*
+ * Helper function for ibft_register_kobjects.
+ */
+static int __init ibft_create_kobject(struct ibft_table_header *header,
+                                      struct ibft_hdr *hdr,
+                                      struct list_head *list)
+{
+       struct ibft_kobject *ibft_kobj = NULL;
+       struct ibft_nic *nic = (struct ibft_nic *)hdr;
+       struct pci_dev *pci_dev;
+       int rc = 0;
+
+       ibft_kobj = kzalloc(sizeof(*ibft_kobj), GFP_KERNEL);
+       if (!ibft_kobj)
+               return -ENOMEM;
+
+       ibft_kobj->header = header;
+       ibft_kobj->hdr = hdr;
+
+       switch (hdr->id) {
+       case id_initiator:
+               rc = ibft_verify_hdr("initiator", hdr, id_initiator,
+                                    sizeof(*ibft_kobj->initiator));
+               break;
+       case id_nic:
+               rc = ibft_verify_hdr("ethernet", hdr, id_nic,
+                                    sizeof(*ibft_kobj->nic));
+               break;
+       case id_target:
+               rc = ibft_verify_hdr("target", hdr, id_target,
+                                    sizeof(*ibft_kobj->tgt));
+               break;
+       case id_reserved:
+       case id_control:
+       case id_extensions:
+               /* Fields which we don't support. Ignore them */
+               rc = 1;
+               break;
+       default:
+               printk(KERN_ERR "iBFT has unknown structure type (%d). " \
+                               "Report this bug to %.6s!\n", hdr->id,
+                               header->oem_id);
+               rc = 1;
+               break;
+       }
+
+       if (rc) {
+               /* Skip adding this kobject, but exit with non-fatal error. */
+               kfree(ibft_kobj);
+               goto out_invalid_struct;
+       }
+
+       ibft_kobj->kobj.kset = ibft_kset;
+
+       rc = kobject_init_and_add(&ibft_kobj->kobj, &ibft_ktype,
+                                 NULL, ibft_id_names[hdr->id], hdr->index);
+
+       if (rc) {
+               kfree(ibft_kobj);
+               goto out;
+       }
+
+       kobject_uevent(&ibft_kobj->kobj, KOBJ_ADD);
+
+       if (hdr->id == id_nic) {
+               /*
+               * We don't search for the device in other domains than
+               * zero. This is because on x86 platforms the BIOS
+               * executes only devices which are in domain 0. Furthermore, the
+               * iBFT spec doesn't have a domain id field :-(
+               */
+               pci_dev = pci_get_bus_and_slot((nic->pci_bdf & 0xff00) >> 8,
+                                              (nic->pci_bdf & 0xff));
+               if (pci_dev) {
+                       rc = sysfs_create_link(&ibft_kobj->kobj,
+                                              &pci_dev->dev.kobj, "device");
+                       pci_dev_put(pci_dev);
+               }
+       }
+
+       /* Nothing broke so lets add it to the list. */
+       list_add_tail(&ibft_kobj->node, list);
+out:
+       return rc;
+out_invalid_struct:
+       /* Unsupported structs are skipped. */
+       return 0;
+}
+
+/*
+ * Scan the IBFT table structure for the NIC and Target fields. When
+ * found add them on the passed-in list. We do not support the other
+ * fields at this point, so they are skipped.
+ */
+static int __init ibft_register_kobjects(struct ibft_table_header *header,
+                                         struct list_head *list)
+{
+       struct ibft_control *control = NULL;
+       void *ptr, *end;
+       int rc = 0;
+       u16 offset;
+       u16 eot_offset;
+
+       control = (void *)header + sizeof(*header);
+       end = (void *)control + control->hdr.length;
+       eot_offset = (void *)header + header->length -
+                    (void *)control - sizeof(*header);
+       rc = ibft_verify_hdr("control", (struct ibft_hdr *)control, id_control,
+                            sizeof(*control));
+
+       /* iBFT table safety checking */
+       rc |= ((control->hdr.index) ? -ENODEV : 0);
+       if (rc) {
+               printk(KERN_ERR "iBFT error: Control header is invalid!\n");
+               return rc;
+       }
+       for (ptr = &control->initiator_off; ptr < end; ptr += sizeof(u16)) {
+               offset = *(u16 *)ptr;
+               if (offset && offset < header->length && offset < eot_offset) {
+                       rc = ibft_create_kobject(header,
+                                                (void *)header + offset,
+                                                list);
+                       if (rc)
+                               break;
+               }
+       }
+
+       return rc;
+}
+
+static void ibft_unregister(struct list_head *attr_list,
+                            struct list_head *kobj_list)
+{
+       struct ibft_kobject *data = NULL, *n;
+       struct ibft_attribute *attr = NULL, *m;
+
+       list_for_each_entry_safe(attr, m, attr_list, node) {
+               sysfs_remove_file(attr->kobj, &attr->attr);
+               list_del(&attr->node);
+               kfree(attr);
+       };
+       list_del_init(attr_list);
+
+       list_for_each_entry_safe(data, n, kobj_list, node) {
+               list_del(&data->node);
+               if (data->hdr->id == id_nic)
+                       sysfs_remove_link(&data->kobj, "device");
+               kobject_put(&data->kobj);
+       };
+       list_del_init(kobj_list);
+}
+
+static int __init ibft_create_attribute(struct ibft_kobject *kobj_data,
+                                        int type,
+                                        const char *name,
+                                        ssize_t (*show)(struct ibft_kobject *,
+                                                        struct ibft_attribute*,
+                                                        char *buf),
+                                        struct list_head *list)
+{
+       struct ibft_attribute *attr = NULL;
+       struct ibft_hdr *hdr = kobj_data->hdr;
+
+       attr = kmalloc(sizeof(*attr), GFP_KERNEL);
+       if (!attr)
+               return -ENOMEM;
+
+       attr->attr.name = name;
+       attr->attr.mode = S_IRUSR;
+       attr->attr.owner = THIS_MODULE;
+
+       attr->hdr = hdr;
+       attr->show = show;
+       attr->kobj = &kobj_data->kobj;
+       attr->type = type;
+
+       list_add_tail(&attr->node, list);
+
+       return 0;
+}
+
+/*
+ * Helper routiners to check to determine if the entry is valid
+ * in the proper iBFT structure.
+ */
+static int __init ibft_check_nic_for(struct ibft_nic *nic, int entry)
+{
+       int rc = 0;
+
+       switch (entry) {
+       case ibft_eth_index:
+       case ibft_eth_flags:
+               rc = 1;
+               break;
+       case ibft_eth_ip_addr:
+               if (!memcmp(nic->dhcp, nulls, sizeof(nic->dhcp)))
+                       rc = 1;
+               break;
+       case ibft_eth_subnet_mask:
+               if (!memcmp(nic->dhcp, nulls, sizeof(nic->dhcp)))
+                       rc = 1;
+               break;
+       case ibft_eth_origin:
+               rc = 1;
+               break;
+       case ibft_eth_gateway:
+               if (memcmp(nic->gateway, nulls, sizeof(nic->gateway)))
+                       rc = 1;
+               break;
+       case ibft_eth_primary_dns:
+               if (memcmp(nic->primary_dns, nulls,
+                          sizeof(nic->primary_dns)))
+                       rc = 1;
+               break;
+       case ibft_eth_secondary_dns:
+               if (memcmp(nic->secondary_dns, nulls,
+                          sizeof(nic->secondary_dns)))
+                       rc = 1;
+               break;
+       case ibft_eth_dhcp:
+               if (memcmp(nic->dhcp, nulls, sizeof(nic->dhcp)))
+                       rc = 1;
+               break;
+       case ibft_eth_vlan:
+       case ibft_eth_mac:
+               rc = 1;
+               break;
+       case ibft_eth_hostname:
+               if (nic->hostname_off)
+                       rc = 1;
+               break;
+       default:
+               break;
+       }
+
+       return rc;
+}
+
+static int __init ibft_check_tgt_for(struct ibft_tgt *tgt, int entry)
+{
+       int rc = 0;
+
+       switch (entry) {
+       case ibft_tgt_index:
+       case ibft_tgt_flags:
+       case ibft_tgt_ip_addr:
+       case ibft_tgt_port:
+       case ibft_tgt_lun:
+       case ibft_tgt_nic_assoc:
+       case ibft_tgt_chap_type:
+               rc = 1;
+       case ibft_tgt_name:
+               if (tgt->tgt_name_len)
+                       rc = 1;
+               break;
+       case ibft_tgt_chap_name:
+       case ibft_tgt_chap_secret:
+               if (tgt->chap_name_len)
+                       rc = 1;
+               break;
+       case ibft_tgt_rev_chap_name:
+       case ibft_tgt_rev_chap_secret:
+               if (tgt->rev_chap_name_len)
+                       rc = 1;
+               break;
+       default:
+               break;
+       }
+
+       return rc;
+}
+
+static int __init ibft_check_initiator_for(struct ibft_initiator *init,
+                                           int entry)
+{
+       int rc = 0;
+
+       switch (entry) {
+       case ibft_init_index:
+       case ibft_init_flags:
+               rc = 1;
+               break;
+       case ibft_init_isns_server:
+               if (memcmp(init->isns_server, nulls,
+                          sizeof(init->isns_server)))
+                       rc = 1;
+               break;
+       case ibft_init_slp_server:
+               if (memcmp(init->slp_server, nulls,
+                          sizeof(init->slp_server)))
+                       rc = 1;
+               break;
+       case ibft_init_pri_radius_server:
+               if (memcmp(init->pri_radius_server, nulls,
+                          sizeof(init->pri_radius_server)))
+                       rc = 1;
+               break;
+       case ibft_init_sec_radius_server:
+               if (memcmp(init->sec_radius_server, nulls,
+                          sizeof(init->sec_radius_server)))
+                       rc = 1;
+               break;
+       case ibft_init_initiator_name:
+               if (init->initiator_name_len)
+                       rc = 1;
+               break;
+       default:
+               break;
+       }
+
+       return rc;
+}
+
+/*
+ *  Register the attributes for all of the kobjects.
+ */
+static int __init ibft_register_attributes(struct list_head *kobject_list,
+                                           struct list_head *attr_list)
+{
+       int rc = 0, i = 0;
+       struct ibft_kobject *data = NULL;
+       struct ibft_attribute *attr = NULL, *m;
+
+       list_for_each_entry(data, kobject_list, node) {
+               switch (data->hdr->id) {
+               case id_nic:
+                       for (i = 0; i < ibft_eth_end_marker && !rc; i++)
+                               if (ibft_check_nic_for(data->nic, i))
+                                       rc = ibft_create_attribute(data, i,
+                                               ibft_eth_properties[i],
+                                               ibft_attr_show_nic, attr_list);
+                       break;
+               case id_target:
+                       for (i = 0; i < ibft_tgt_end_marker && !rc; i++)
+                               if (ibft_check_tgt_for(data->tgt, i))
+                                       rc = ibft_create_attribute(data, i,
+                                               ibft_tgt_properties[i],
+                                               ibft_attr_show_target,
+                                               attr_list);
+                       break;
+               case id_initiator:
+                       for (i = 0; i < ibft_init_end_marker && !rc; i++)
+                               if (ibft_check_initiator_for(
+                                       data->initiator, i))
+                                       rc = ibft_create_attribute(data, i,
+                                               ibft_initiator_properties[i],
+                                               ibft_attr_show_initiator,
+                                               attr_list);
+                       break;
+               default:
+                       break;
+               }
+               if (rc)
+                       break;
+       }
+       list_for_each_entry_safe(attr, m, attr_list, node) {
+               rc = sysfs_create_file(attr->kobj, &attr->attr);
+               if (rc) {
+                       list_del(&attr->node);
+                       kfree(attr);
+                       break;
+               }
+       }
+
+       return rc;
+}
+
+/*
+ * ibft_init() - creates sysfs tree entries for the iBFT data.
+ */
+static int __init ibft_init(void)
+{
+       int rc = 0;
+
+       ibft_kset = kset_create_and_add("ibft", NULL, firmware_kobj);
+       if (!ibft_kset)
+               return -ENOMEM;
+
+       if (ibft_addr) {
+               printk(KERN_INFO "iBFT detected at 0x%lx.\n",
+                      virt_to_phys((void *)ibft_addr));
+
+               rc = ibft_check_device();
+               if (rc)
+                       goto out_firmware_unregister;
+
+               /* Scan the IBFT for data and register the kobjects. */
+               rc = ibft_register_kobjects(ibft_addr, &ibft_kobject_list);
+               if (rc)
+                       goto out_free;
+
+               /* Register the attributes */
+               rc = ibft_register_attributes(&ibft_kobject_list,
+                                             &ibft_attr_list);
+               if (rc)
+                       goto out_free;
+       } else
+               printk(KERN_INFO "No iBFT detected.\n");
+
+       return 0;
+
+out_free:
+       ibft_unregister(&ibft_attr_list, &ibft_kobject_list);
+out_firmware_unregister:
+       kset_unregister(ibft_kset);
+       return rc;
+}
+
+static void __exit ibft_exit(void)
+{
+       ibft_unregister(&ibft_attr_list, &ibft_kobject_list);
+       kset_unregister(ibft_kset);
+}
+
+module_init(ibft_init);
+module_exit(ibft_exit);
diff --git a/drivers/firmware/iscsi_ibft_find.c b/drivers/firmware/iscsi_ibft_find.c
new file mode 100644 (file)
index 0000000..d0e5fa4
--- /dev/null
@@ -0,0 +1,84 @@
+/*
+ *  Copyright 2007 Red Hat, Inc.
+ *  by Peter Jones <pjones@redhat.com>
+ *  Copyright 2007 IBM, Inc.
+ *  by Konrad Rzeszutek <konradr@linux.vnet.ibm.com>
+ *  Copyright 2008
+ *  by Konrad Rzeszutek <ketuzsezr@darnok.org>
+ *
+ * This code finds the iSCSI Boot Format Table.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License v2.0 as published by
+ * the Free Software Foundation
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#include <linux/bootmem.h>
+#include <linux/blkdev.h>
+#include <linux/ctype.h>
+#include <linux/device.h>
+#include <linux/err.h>
+#include <linux/init.h>
+#include <linux/limits.h>
+#include <linux/module.h>
+#include <linux/pci.h>
+#include <linux/slab.h>
+#include <linux/stat.h>
+#include <linux/string.h>
+#include <linux/types.h>
+
+#include <asm/mmzone.h>
+
+/*
+ * Physical location of iSCSI Boot Format Table.
+ */
+struct ibft_table_header *ibft_addr;
+EXPORT_SYMBOL_GPL(ibft_addr);
+
+#define IBFT_SIGN "iBFT"
+#define IBFT_SIGN_LEN 4
+#define IBFT_START 0x80000 /* 512kB */
+#define IBFT_END 0x100000 /* 1MB */
+#define VGA_MEM 0xA0000 /* VGA buffer */
+#define VGA_SIZE 0x20000 /* 128kB */
+
+
+/*
+ * Routine used to find the iSCSI Boot Format Table. The logical
+ * kernel address is set in the ibft_addr global variable.
+ */
+void __init reserve_ibft_region(void)
+{
+       unsigned long pos;
+       unsigned int len = 0;
+       void *virt;
+
+       ibft_addr = 0;
+
+       for (pos = IBFT_START; pos < IBFT_END; pos += 16) {
+               /* The table can't be inside the VGA BIOS reserved space,
+                * so skip that area */
+               if (pos == VGA_MEM)
+                       pos += VGA_SIZE;
+               virt = phys_to_virt(pos);
+               if (memcmp(virt, IBFT_SIGN, IBFT_SIGN_LEN) == 0) {
+                       unsigned long *addr =
+                           (unsigned long *)phys_to_virt(pos + 4);
+                       len = *addr;
+                       /* if the length of the table extends past 1M,
+                        * the table cannot be valid. */
+                       if (pos + len <= (IBFT_END-1)) {
+                               ibft_addr = (struct ibft_table_header *)virt;
+                               break;
+                       }
+               }
+       }
+       if (ibft_addr)
+               reserve_bootmem(pos, PAGE_ALIGN(len), BOOTMEM_DEFAULT);
+}
+EXPORT_SYMBOL_GPL(reserve_ibft_region);
index 5fa9c3c67e0cd55d18f779552c89f017a9ab644f..b04c99580d0dc167fee9f1b99dc812eacc5c3965 100644 (file)
@@ -645,7 +645,7 @@ config I2C_PCA_ISA
 
 config I2C_MV64XXX
        tristate "Marvell mv64xxx I2C Controller"
-       depends on (MV64X60 || ARCH_ORION) && EXPERIMENTAL
+       depends on (MV64X60 || PLAT_ORION) && EXPERIMENTAL
        help
          If you say yes to this option, support will be included for the
          built-in I2C interface on the Marvell 64xxx line of host bridges.
index 2d2087ad708f4f70a8b4277b5789a2c22be0d2b2..6fd2d6a84effbb6118edfb606e27ce9b1a3ffec6 100644 (file)
@@ -39,6 +39,7 @@
 #include <asm/io.h>
 #include <asm/arch/i2c.h>
 #include <asm/arch/pxa-regs.h>
+#include <asm/arch/pxa2xx-gpio.h>
 
 struct pxa_i2c {
        spinlock_t              lock;
index b21593f93586adc191cf43178c06d1166bf0ed6b..2da2edfa68ec1ebf0954cfc48b9ea87fd3e50d26 100644 (file)
@@ -93,6 +93,7 @@ config ISP1301_OMAP
 
 config TPS65010
        tristate "TPS6501x Power Management chips"
+       depends on HAVE_GPIO_LIB
        default y if MACH_OMAP_H2 || MACH_OMAP_H3 || MACH_OMAP_OSK
        help
          If you say yes here you get support for the TPS6501x series of
index 4154a9108859845911c9ac68cdacf75eaac32b0f..b67f69c2e7f3850c9a80cf405dc78a3b29505d93 100644 (file)
 #include <linux/debugfs.h>
 #include <linux/seq_file.h>
 #include <linux/mutex.h>
+#include <linux/platform_device.h>
 
 #include <linux/i2c/tps65010.h>
 
+#include <asm/gpio.h>
+
+
 /*-------------------------------------------------------------------------*/
 
 #define        DRIVER_VERSION  "2 May 2005"
@@ -84,7 +88,9 @@ struct tps65010 {
        u8                      chgstatus, regstatus, chgconf;
        u8                      nmask1, nmask2;
 
-       /* not currently tracking GPIO state */
+       u8                      outmask;
+       struct gpio_chip        chip;
+       struct platform_device  *leds;
 };
 
 #define        POWER_POLL_DELAY        msecs_to_jiffies(5000)
@@ -447,6 +453,59 @@ static irqreturn_t tps65010_irq(int irq, void *_tps)
        return IRQ_HANDLED;
 }
 
+/*-------------------------------------------------------------------------*/
+
+/* offsets 0..3 == GPIO1..GPIO4
+ * offsets 4..5 == LED1/nPG, LED2 (we set one of the non-BLINK modes)
+ */
+static void
+tps65010_gpio_set(struct gpio_chip *chip, unsigned offset, int value)
+{
+       if (offset < 4)
+               tps65010_set_gpio_out_value(offset + 1, value);
+       else
+               tps65010_set_led(offset - 3, value ? ON : OFF);
+}
+
+static int
+tps65010_output(struct gpio_chip *chip, unsigned offset, int value)
+{
+       /* GPIOs may be input-only */
+       if (offset < 4) {
+               struct tps65010         *tps;
+
+               tps = container_of(chip, struct tps65010, chip);
+               if (!(tps->outmask & (1 << offset)))
+                       return -EINVAL;
+               tps65010_set_gpio_out_value(offset + 1, value);
+       } else
+               tps65010_set_led(offset - 3, value ? ON : OFF);
+
+       return 0;
+}
+
+static int tps65010_gpio_get(struct gpio_chip *chip, unsigned offset)
+{
+       int                     value;
+       struct tps65010         *tps;
+
+       tps = container_of(chip, struct tps65010, chip);
+
+       if (offset < 4) {
+               value = i2c_smbus_read_byte_data(tps->client, TPS_DEFGPIO);
+               if (value < 0)
+                       return 0;
+               if (value & (1 << (offset + 4)))        /* output */
+                       return !(value & (1 << offset));
+               else                                    /* input */
+                       return (value & (1 << offset));
+       }
+
+       /* REVISIT we *could* report LED1/nPG and LED2 state ... */
+       return 0;
+}
+
+
 /*-------------------------------------------------------------------------*/
 
 static struct tps65010 *the_tps;
@@ -454,7 +513,14 @@ static struct tps65010 *the_tps;
 static int __exit tps65010_remove(struct i2c_client *client)
 {
        struct tps65010         *tps = i2c_get_clientdata(client);
+       struct tps65010_board   *board = client->dev.platform_data;
 
+       if (board && board->teardown) {
+               int status = board->teardown(client, board->context);
+               if (status < 0)
+                       dev_dbg(&client->dev, "board %s %s err %d\n",
+                               "teardown", client->name, status);
+       }
        if (client->irq > 0)
                free_irq(client->irq, tps);
        cancel_delayed_work(&tps->work);
@@ -469,6 +535,7 @@ static int tps65010_probe(struct i2c_client *client)
 {
        struct tps65010         *tps;
        int                     status;
+       struct tps65010_board   *board = client->dev.platform_data;
 
        if (the_tps) {
                dev_dbg(&client->dev, "only one tps6501x chip allowed\n");
@@ -577,6 +644,38 @@ static int tps65010_probe(struct i2c_client *client)
 
        tps->file = debugfs_create_file(DRIVER_NAME, S_IRUGO, NULL,
                                tps, DEBUG_FOPS);
+
+       /* optionally register GPIOs */
+       if (board && board->base > 0) {
+               tps->outmask = board->outmask;
+
+               tps->chip.label = client->name;
+
+               tps->chip.set = tps65010_gpio_set;
+               tps->chip.direction_output = tps65010_output;
+
+               /* NOTE:  only partial support for inputs; nyet IRQs */
+               tps->chip.get = tps65010_gpio_get;
+
+               tps->chip.base = board->base;
+               tps->chip.ngpio = 6;
+               tps->chip.can_sleep = 1;
+
+               status = gpiochip_add(&tps->chip);
+               if (status < 0)
+                       dev_err(&client->dev, "can't add gpiochip, err %d\n",
+                                       status);
+               else if (board->setup) {
+                       status = board->setup(client, board->context);
+                       if (status < 0) {
+                               dev_dbg(&client->dev,
+                                       "board %s %s err %d\n",
+                                       "setup", client->name, status);
+                               status = 0;
+                       }
+               }
+       }
+
        return 0;
 fail1:
        kfree(tps);
index 8b645c6b2cb50c506b82a21f7af0d3c1fdecccf8..e186df657119e9af61296b68db2f8ece414371f1 100644 (file)
@@ -35,8 +35,8 @@
 #include <linux/completion.h>
 #include <linux/hardirq.h>
 #include <linux/irqflags.h>
+#include <linux/semaphore.h>
 #include <asm/uaccess.h>
-#include <asm/semaphore.h>
 
 #include "i2c-core.h"
 
index 70afa3786f3f7d549f91d9c8317b0bd0ff105931..29d833e71cbfbc3c8ef0be7137186cc07afa553e 100644 (file)
@@ -18,8 +18,8 @@
 #include <linux/moduleparam.h>
 #include <linux/mutex.h>
 #include <linux/freezer.h>
+#include <linux/semaphore.h>
 #include <asm/atomic.h>
-#include <asm/semaphore.h>
 
 #include "csr.h"
 #include "highlevel.h"
index 5a4b2e65534b4b4fcd1fc878a0477dc5096126b1..95756551cf7c94bb9c6679168c1a6a19d2381082 100644 (file)
@@ -427,17 +427,17 @@ static struct kobj_type port_type = {
        .default_attrs = port_default_attrs
 };
 
-static void ib_device_release(struct class_device *cdev)
+static void ib_device_release(struct device *device)
 {
-       struct ib_device *dev = container_of(cdev, struct ib_device, class_dev);
+       struct ib_device *dev = container_of(device, struct ib_device, dev);
 
        kfree(dev);
 }
 
-static int ib_device_uevent(struct class_device *cdev,
+static int ib_device_uevent(struct device *device,
                            struct kobj_uevent_env *env)
 {
-       struct ib_device *dev = container_of(cdev, struct ib_device, class_dev);
+       struct ib_device *dev = container_of(device, struct ib_device, dev);
 
        if (add_uevent_var(env, "NAME=%s", dev->name))
                return -ENOMEM;
@@ -567,9 +567,10 @@ err_put:
        return ret;
 }
 
-static ssize_t show_node_type(struct class_device *cdev, char *buf)
+static ssize_t show_node_type(struct device *device,
+                             struct device_attribute *attr, char *buf)
 {
-       struct ib_device *dev = container_of(cdev, struct ib_device, class_dev);
+       struct ib_device *dev = container_of(device, struct ib_device, dev);
 
        if (!ibdev_is_alive(dev))
                return -ENODEV;
@@ -583,9 +584,10 @@ static ssize_t show_node_type(struct class_device *cdev, char *buf)
        }
 }
 
-static ssize_t show_sys_image_guid(struct class_device *cdev, char *buf)
+static ssize_t show_sys_image_guid(struct device *device,
+                                  struct device_attribute *dev_attr, char *buf)
 {
-       struct ib_device *dev = container_of(cdev, struct ib_device, class_dev);
+       struct ib_device *dev = container_of(device, struct ib_device, dev);
        struct ib_device_attr attr;
        ssize_t ret;
 
@@ -603,9 +605,10 @@ static ssize_t show_sys_image_guid(struct class_device *cdev, char *buf)
                       be16_to_cpu(((__be16 *) &attr.sys_image_guid)[3]));
 }
 
-static ssize_t show_node_guid(struct class_device *cdev, char *buf)
+static ssize_t show_node_guid(struct device *device,
+                             struct device_attribute *attr, char *buf)
 {
-       struct ib_device *dev = container_of(cdev, struct ib_device, class_dev);
+       struct ib_device *dev = container_of(device, struct ib_device, dev);
 
        if (!ibdev_is_alive(dev))
                return -ENODEV;
@@ -617,17 +620,19 @@ static ssize_t show_node_guid(struct class_device *cdev, char *buf)
                       be16_to_cpu(((__be16 *) &dev->node_guid)[3]));
 }
 
-static ssize_t show_node_desc(struct class_device *cdev, char *buf)
+static ssize_t show_node_desc(struct device *device,
+                             struct device_attribute *attr, char *buf)
 {
-       struct ib_device *dev = container_of(cdev, struct ib_device, class_dev);
+       struct ib_device *dev = container_of(device, struct ib_device, dev);
 
        return sprintf(buf, "%.64s\n", dev->node_desc);
 }
 
-static ssize_t set_node_desc(struct class_device *cdev, const char *buf,
-                             size_t count)
+static ssize_t set_node_desc(struct device *device,
+                            struct device_attribute *attr,
+                            const char *buf, size_t count)
 {
-       struct ib_device *dev = container_of(cdev, struct ib_device, class_dev);
+       struct ib_device *dev = container_of(device, struct ib_device, dev);
        struct ib_device_modify desc = {};
        int ret;
 
@@ -642,44 +647,43 @@ static ssize_t set_node_desc(struct class_device *cdev, const char *buf,
        return count;
 }
 
-static CLASS_DEVICE_ATTR(node_type, S_IRUGO, show_node_type, NULL);
-static CLASS_DEVICE_ATTR(sys_image_guid, S_IRUGO, show_sys_image_guid, NULL);
-static CLASS_DEVICE_ATTR(node_guid, S_IRUGO, show_node_guid, NULL);
-static CLASS_DEVICE_ATTR(node_desc, S_IRUGO | S_IWUSR, show_node_desc,
-                        set_node_desc);
-
-static struct class_device_attribute *ib_class_attributes[] = {
-       &class_device_attr_node_type,
-       &class_device_attr_sys_image_guid,
-       &class_device_attr_node_guid,
-       &class_device_attr_node_desc
+static DEVICE_ATTR(node_type, S_IRUGO, show_node_type, NULL);
+static DEVICE_ATTR(sys_image_guid, S_IRUGO, show_sys_image_guid, NULL);
+static DEVICE_ATTR(node_guid, S_IRUGO, show_node_guid, NULL);
+static DEVICE_ATTR(node_desc, S_IRUGO | S_IWUSR, show_node_desc, set_node_desc);
+
+static struct device_attribute *ib_class_attributes[] = {
+       &dev_attr_node_type,
+       &dev_attr_sys_image_guid,
+       &dev_attr_node_guid,
+       &dev_attr_node_desc
 };
 
 static struct class ib_class = {
        .name    = "infiniband",
-       .release = ib_device_release,
-       .uevent = ib_device_uevent,
+       .dev_release = ib_device_release,
+       .dev_uevent = ib_device_uevent,
 };
 
 int ib_device_register_sysfs(struct ib_device *device)
 {
-       struct class_device *class_dev = &device->class_dev;
+       struct device *class_dev = &device->dev;
        int ret;
        int i;
 
        class_dev->class      = &ib_class;
-       class_dev->class_data = device;
-       class_dev->dev        = device->dma_device;
-       strlcpy(class_dev->class_id, device->name, BUS_ID_SIZE);
+       class_dev->driver_data = device;
+       class_dev->parent     = device->dma_device;
+       strlcpy(class_dev->bus_id, device->name, BUS_ID_SIZE);
 
        INIT_LIST_HEAD(&device->port_list);
 
-       ret = class_device_register(class_dev);
+       ret = device_register(class_dev);
        if (ret)
                goto err;
 
        for (i = 0; i < ARRAY_SIZE(ib_class_attributes); ++i) {
-               ret = class_device_create_file(class_dev, ib_class_attributes[i]);
+               ret = device_create_file(class_dev, ib_class_attributes[i]);
                if (ret)
                        goto err_unregister;
        }
@@ -723,7 +727,7 @@ err_put:
        kobject_put(&class_dev->kobj);
 
 err_unregister:
-       class_device_unregister(class_dev);
+       device_unregister(class_dev);
 
 err:
        return ret;
@@ -744,7 +748,7 @@ void ib_device_unregister_sysfs(struct ib_device *device)
        }
 
        kobject_put(device->ports_parent);
-       class_device_unregister(&device->class_dev);
+       device_unregister(&device->dev);
 }
 
 int ib_sysfs_setup(void)
index 4291ab42a5b9c60fb78eeecdf09087b9af10f58b..d7a6881b571d990ec1fd47ba959126ac68a64b7e 100644 (file)
@@ -58,8 +58,8 @@ MODULE_LICENSE("Dual BSD/GPL");
 
 struct ib_ucm_device {
        int                     devnum;
-       struct cdev             dev;
-       struct class_device     class_dev;
+       struct cdev             cdev;
+       struct device           dev;
        struct ib_device        *ib_dev;
 };
 
@@ -1171,7 +1171,7 @@ static int ib_ucm_open(struct inode *inode, struct file *filp)
 
        filp->private_data = file;
        file->filp = filp;
-       file->device = container_of(inode->i_cdev, struct ib_ucm_device, dev);
+       file->device = container_of(inode->i_cdev, struct ib_ucm_device, cdev);
 
        return 0;
 }
@@ -1202,14 +1202,14 @@ static int ib_ucm_close(struct inode *inode, struct file *filp)
        return 0;
 }
 
-static void ucm_release_class_dev(struct class_device *class_dev)
+static void ib_ucm_release_dev(struct device *dev)
 {
-       struct ib_ucm_device *dev;
+       struct ib_ucm_device *ucm_dev;
 
-       dev = container_of(class_dev, struct ib_ucm_device, class_dev);
-       cdev_del(&dev->dev);
-       clear_bit(dev->devnum, dev_map);
-       kfree(dev);
+       ucm_dev = container_of(dev, struct ib_ucm_device, dev);
+       cdev_del(&ucm_dev->cdev);
+       clear_bit(ucm_dev->devnum, dev_map);
+       kfree(ucm_dev);
 }
 
 static const struct file_operations ucm_fops = {
@@ -1220,14 +1220,15 @@ static const struct file_operations ucm_fops = {
        .poll    = ib_ucm_poll,
 };
 
-static ssize_t show_ibdev(struct class_device *class_dev, char *buf)
+static ssize_t show_ibdev(struct device *dev, struct device_attribute *attr,
+                         char *buf)
 {
-       struct ib_ucm_device *dev;
+       struct ib_ucm_device *ucm_dev;
 
-       dev = container_of(class_dev, struct ib_ucm_device, class_dev);
-       return sprintf(buf, "%s\n", dev->ib_dev->name);
+       ucm_dev = container_of(dev, struct ib_ucm_device, dev);
+       return sprintf(buf, "%s\n", ucm_dev->ib_dev->name);
 }
-static CLASS_DEVICE_ATTR(ibdev, S_IRUGO, show_ibdev, NULL);
+static DEVICE_ATTR(ibdev, S_IRUGO, show_ibdev, NULL);
 
 static void ib_ucm_add_one(struct ib_device *device)
 {
@@ -1249,32 +1250,31 @@ static void ib_ucm_add_one(struct ib_device *device)
 
        set_bit(ucm_dev->devnum, dev_map);
 
-       cdev_init(&ucm_dev->dev, &ucm_fops);
-       ucm_dev->dev.owner = THIS_MODULE;
-       kobject_set_name(&ucm_dev->dev.kobj, "ucm%d", ucm_dev->devnum);
-       if (cdev_add(&ucm_dev->dev, IB_UCM_BASE_DEV + ucm_dev->devnum, 1))
+       cdev_init(&ucm_dev->cdev, &ucm_fops);
+       ucm_dev->cdev.owner = THIS_MODULE;
+       kobject_set_name(&ucm_dev->cdev.kobj, "ucm%d", ucm_dev->devnum);
+       if (cdev_add(&ucm_dev->cdev, IB_UCM_BASE_DEV + ucm_dev->devnum, 1))
                goto err;
 
-       ucm_dev->class_dev.class = &cm_class;
-       ucm_dev->class_dev.dev = device->dma_device;
-       ucm_dev->class_dev.devt = ucm_dev->dev.dev;
-       ucm_dev->class_dev.release = ucm_release_class_dev;
-       snprintf(ucm_dev->class_dev.class_id, BUS_ID_SIZE, "ucm%d",
+       ucm_dev->dev.class = &cm_class;
+       ucm_dev->dev.parent = device->dma_device;
+       ucm_dev->dev.devt = ucm_dev->cdev.dev;
+       ucm_dev->dev.release = ib_ucm_release_dev;
+       snprintf(ucm_dev->dev.bus_id, BUS_ID_SIZE, "ucm%d",
                 ucm_dev->devnum);
-       if (class_device_register(&ucm_dev->class_dev))
+       if (device_register(&ucm_dev->dev))
                goto err_cdev;
 
-       if (class_device_create_file(&ucm_dev->class_dev,
-                                    &class_device_attr_ibdev))
-               goto err_class;
+       if (device_create_file(&ucm_dev->dev, &dev_attr_ibdev))
+               goto err_dev;
 
        ib_set_client_data(device, &ucm_client, ucm_dev);
        return;
 
-err_class:
-       class_device_unregister(&ucm_dev->class_dev);
+err_dev:
+       device_unregister(&ucm_dev->dev);
 err_cdev:
-       cdev_del(&ucm_dev->dev);
+       cdev_del(&ucm_dev->cdev);
        clear_bit(ucm_dev->devnum, dev_map);
 err:
        kfree(ucm_dev);
@@ -1288,7 +1288,7 @@ static void ib_ucm_remove_one(struct ib_device *device)
        if (!ucm_dev)
                return;
 
-       class_device_unregister(&ucm_dev->class_dev);
+       device_unregister(&ucm_dev->dev);
 }
 
 static ssize_t show_abi_version(struct class *class, char *buf)
index 4e915104ac4ca38e70569896a746c5686fba28ac..3aa2db54eae4058266919049b848238aa59e4a87 100644 (file)
@@ -46,9 +46,9 @@
 #include <linux/mutex.h>
 #include <linux/kref.h>
 #include <linux/compat.h>
+#include <linux/semaphore.h>
 
 #include <asm/uaccess.h>
-#include <asm/semaphore.h>
 
 #include <rdma/ib_mad.h>
 #include <rdma/ib_user_mad.h>
@@ -88,11 +88,11 @@ enum {
  */
 
 struct ib_umad_port {
-       struct cdev           *dev;
-       struct class_device   *class_dev;
+       struct cdev           *cdev;
+       struct device         *dev;
 
-       struct cdev           *sm_dev;
-       struct class_device   *sm_class_dev;
+       struct cdev           *sm_cdev;
+       struct device         *sm_dev;
        struct semaphore       sm_sem;
 
        struct mutex           file_mutex;
@@ -948,27 +948,29 @@ static struct ib_client umad_client = {
        .remove = ib_umad_remove_one
 };
 
-static ssize_t show_ibdev(struct class_device *class_dev, char *buf)
+static ssize_t show_ibdev(struct device *dev, struct device_attribute *attr,
+                         char *buf)
 {
-       struct ib_umad_port *port = class_get_devdata(class_dev);
+       struct ib_umad_port *port = dev_get_drvdata(dev);
 
        if (!port)
                return -ENODEV;
 
        return sprintf(buf, "%s\n", port->ib_dev->name);
 }
-static CLASS_DEVICE_ATTR(ibdev, S_IRUGO, show_ibdev, NULL);
+static DEVICE_ATTR(ibdev, S_IRUGO, show_ibdev, NULL);
 
-static ssize_t show_port(struct class_device *class_dev, char *buf)
+static ssize_t show_port(struct device *dev, struct device_attribute *attr,
+                        char *buf)
 {
-       struct ib_umad_port *port = class_get_devdata(class_dev);
+       struct ib_umad_port *port = dev_get_drvdata(dev);
 
        if (!port)
                return -ENODEV;
 
        return sprintf(buf, "%d\n", port->port_num);
 }
-static CLASS_DEVICE_ATTR(port, S_IRUGO, show_port, NULL);
+static DEVICE_ATTR(port, S_IRUGO, show_port, NULL);
 
 static ssize_t show_abi_version(struct class *class, char *buf)
 {
@@ -994,48 +996,47 @@ static int ib_umad_init_port(struct ib_device *device, int port_num,
        mutex_init(&port->file_mutex);
        INIT_LIST_HEAD(&port->file_list);
 
-       port->dev = cdev_alloc();
-       if (!port->dev)
+       port->cdev = cdev_alloc();
+       if (!port->cdev)
                return -1;
-       port->dev->owner = THIS_MODULE;
-       port->dev->ops   = &umad_fops;
-       kobject_set_name(&port->dev->kobj, "umad%d", port->dev_num);
-       if (cdev_add(port->dev, base_dev + port->dev_num, 1))
+       port->cdev->owner = THIS_MODULE;
+       port->cdev->ops   = &umad_fops;
+       kobject_set_name(&port->cdev->kobj, "umad%d", port->dev_num);
+       if (cdev_add(port->cdev, base_dev + port->dev_num, 1))
                goto err_cdev;
 
-       port->class_dev = class_device_create(umad_class, NULL, port->dev->dev,
-                                             device->dma_device,
-                                             "umad%d", port->dev_num);
-       if (IS_ERR(port->class_dev))
+       port->dev = device_create(umad_class, device->dma_device,
+                                 port->cdev->dev, "umad%d", port->dev_num);
+       if (IS_ERR(port->dev))
                goto err_cdev;
 
-       if (class_device_create_file(port->class_dev, &class_device_attr_ibdev))
-               goto err_class;
-       if (class_device_create_file(port->class_dev, &class_device_attr_port))
-               goto err_class;
-
-       port->sm_dev = cdev_alloc();
-       if (!port->sm_dev)
-               goto err_class;
-       port->sm_dev->owner = THIS_MODULE;
-       port->sm_dev->ops   = &umad_sm_fops;
-       kobject_set_name(&port->sm_dev->kobj, "issm%d", port->dev_num);
-       if (cdev_add(port->sm_dev, base_dev + port->dev_num + IB_UMAD_MAX_PORTS, 1))
+       if (device_create_file(port->dev, &dev_attr_ibdev))
+               goto err_dev;
+       if (device_create_file(port->dev, &dev_attr_port))
+               goto err_dev;
+
+       port->sm_cdev = cdev_alloc();
+       if (!port->sm_cdev)
+               goto err_dev;
+       port->sm_cdev->owner = THIS_MODULE;
+       port->sm_cdev->ops   = &umad_sm_fops;
+       kobject_set_name(&port->sm_cdev->kobj, "issm%d", port->dev_num);
+       if (cdev_add(port->sm_cdev, base_dev + port->dev_num + IB_UMAD_MAX_PORTS, 1))
                goto err_sm_cdev;
 
-       port->sm_class_dev = class_device_create(umad_class, NULL, port->sm_dev->dev,
-                                                device->dma_device,
-                                                "issm%d", port->dev_num);
-       if (IS_ERR(port->sm_class_dev))
+       port->sm_dev = device_create(umad_class, device->dma_device,
+                                    port->sm_cdev->dev,
+                                    "issm%d", port->dev_num);
+       if (IS_ERR(port->sm_dev))
                goto err_sm_cdev;
 
-       class_set_devdata(port->class_dev,    port);
-       class_set_devdata(port->sm_class_dev, port);
+       dev_set_drvdata(port->dev,    port);
+       dev_set_drvdata(port->sm_dev, port);
 
-       if (class_device_create_file(port->sm_class_dev, &class_device_attr_ibdev))
-               goto err_sm_class;
-       if (class_device_create_file(port->sm_class_dev, &class_device_attr_port))
-               goto err_sm_class;
+       if (device_create_file(port->sm_dev, &dev_attr_ibdev))
+               goto err_sm_dev;
+       if (device_create_file(port->sm_dev, &dev_attr_port))
+               goto err_sm_dev;
 
        spin_lock(&port_lock);
        umad_port[port->dev_num] = port;
@@ -1043,17 +1044,17 @@ static int ib_umad_init_port(struct ib_device *device, int port_num,
 
        return 0;
 
-err_sm_class:
-       class_device_destroy(umad_class, port->sm_dev->dev);
+err_sm_dev:
+       device_destroy(umad_class, port->sm_cdev->dev);
 
 err_sm_cdev:
-       cdev_del(port->sm_dev);
+       cdev_del(port->sm_cdev);
 
-err_class:
-       class_device_destroy(umad_class, port->dev->dev);
+err_dev:
+       device_destroy(umad_class, port->cdev->dev);
 
 err_cdev:
-       cdev_del(port->dev);
+       cdev_del(port->cdev);
        clear_bit(port->dev_num, dev_map);
 
        return -1;
@@ -1065,14 +1066,14 @@ static void ib_umad_kill_port(struct ib_umad_port *port)
        int already_dead;
        int id;
 
-       class_set_devdata(port->class_dev,    NULL);
-       class_set_devdata(port->sm_class_dev, NULL);
+       dev_set_drvdata(port->dev,    NULL);
+       dev_set_drvdata(port->sm_dev, NULL);
 
-       class_device_destroy(umad_class, port->dev->dev);
-       class_device_destroy(umad_class, port->sm_dev->dev);
+       device_destroy(umad_class, port->cdev->dev);
+       device_destroy(umad_class, port->sm_cdev->dev);
 
-       cdev_del(port->dev);
-       cdev_del(port->sm_dev);
+       cdev_del(port->cdev);
+       cdev_del(port->sm_cdev);
 
        spin_lock(&port_lock);
        umad_port[port->dev_num] = NULL;
index 2cad8b4b52924a1b72e61b49b42b1cad47896c34..376a57ce1b4067b1fc0e12c96f5863d0d849b741 100644 (file)
@@ -73,8 +73,8 @@ struct ib_uverbs_device {
        struct kref                             ref;
        struct completion                       comp;
        int                                     devnum;
-       struct cdev                            *dev;
-       struct class_device                    *class_dev;
+       struct cdev                            *cdev;
+       struct device                          *dev;
        struct ib_device                       *ib_dev;
        int                                     num_comp_vectors;
 };
index f49f94653a963aed973d53730bd10358282d8e1c..cc1afa28c18145839049e51c03f0a5da4f30844e 100644 (file)
@@ -690,27 +690,29 @@ static struct ib_client uverbs_client = {
        .remove = ib_uverbs_remove_one
 };
 
-static ssize_t show_ibdev(struct class_device *class_dev, char *buf)
+static ssize_t show_ibdev(struct device *device, struct device_attribute *attr,
+                         char *buf)
 {
-       struct ib_uverbs_device *dev = class_get_devdata(class_dev);
+       struct ib_uverbs_device *dev = dev_get_drvdata(device);
 
        if (!dev)
                return -ENODEV;
 
        return sprintf(buf, "%s\n", dev->ib_dev->name);
 }
-static CLASS_DEVICE_ATTR(ibdev, S_IRUGO, show_ibdev, NULL);
+static DEVICE_ATTR(ibdev, S_IRUGO, show_ibdev, NULL);
 
-static ssize_t show_dev_abi_version(struct class_device *class_dev, char *buf)
+static ssize_t show_dev_abi_version(struct device *device,
+                                   struct device_attribute *attr, char *buf)
 {
-       struct ib_uverbs_device *dev = class_get_devdata(class_dev);
+       struct ib_uverbs_device *dev = dev_get_drvdata(device);
 
        if (!dev)
                return -ENODEV;
 
        return sprintf(buf, "%d\n", dev->ib_dev->uverbs_abi_ver);
 }
-static CLASS_DEVICE_ATTR(abi_version, S_IRUGO, show_dev_abi_version, NULL);
+static DEVICE_ATTR(abi_version, S_IRUGO, show_dev_abi_version, NULL);
 
 static ssize_t show_abi_version(struct class *class, char *buf)
 {
@@ -744,27 +746,26 @@ static void ib_uverbs_add_one(struct ib_device *device)
        uverbs_dev->ib_dev           = device;
        uverbs_dev->num_comp_vectors = device->num_comp_vectors;
 
-       uverbs_dev->dev = cdev_alloc();
-       if (!uverbs_dev->dev)
+       uverbs_dev->cdev = cdev_alloc();
+       if (!uverbs_dev->cdev)
                goto err;
-       uverbs_dev->dev->owner = THIS_MODULE;
-       uverbs_dev->dev->ops = device->mmap ? &uverbs_mmap_fops : &uverbs_fops;
-       kobject_set_name(&uverbs_dev->dev->kobj, "uverbs%d", uverbs_dev->devnum);
-       if (cdev_add(uverbs_dev->dev, IB_UVERBS_BASE_DEV + uverbs_dev->devnum, 1))
+       uverbs_dev->cdev->owner = THIS_MODULE;
+       uverbs_dev->cdev->ops = device->mmap ? &uverbs_mmap_fops : &uverbs_fops;
+       kobject_set_name(&uverbs_dev->cdev->kobj, "uverbs%d", uverbs_dev->devnum);
+       if (cdev_add(uverbs_dev->cdev, IB_UVERBS_BASE_DEV + uverbs_dev->devnum, 1))
                goto err_cdev;
 
-       uverbs_dev->class_dev = class_device_create(uverbs_class, NULL,
-                                                   uverbs_dev->dev->dev,
-                                                   device->dma_device,
-                                                   "uverbs%d", uverbs_dev->devnum);
-       if (IS_ERR(uverbs_dev->class_dev))
+       uverbs_dev->dev = device_create(uverbs_class, device->dma_device,
+                                       uverbs_dev->cdev->dev,
+                                       "uverbs%d", uverbs_dev->devnum);
+       if (IS_ERR(uverbs_dev->dev))
                goto err_cdev;
 
-       class_set_devdata(uverbs_dev->class_dev, uverbs_dev);
+       dev_set_drvdata(uverbs_dev->dev, uverbs_dev);
 
-       if (class_device_create_file(uverbs_dev->class_dev, &class_device_attr_ibdev))
+       if (device_create_file(uverbs_dev->dev, &dev_attr_ibdev))
                goto err_class;
-       if (class_device_create_file(uverbs_dev->class_dev, &class_device_attr_abi_version))
+       if (device_create_file(uverbs_dev->dev, &dev_attr_abi_version))
                goto err_class;
 
        spin_lock(&map_lock);
@@ -776,10 +777,10 @@ static void ib_uverbs_add_one(struct ib_device *device)
        return;
 
 err_class:
-       class_device_destroy(uverbs_class, uverbs_dev->dev->dev);
+       device_destroy(uverbs_class, uverbs_dev->cdev->dev);
 
 err_cdev:
-       cdev_del(uverbs_dev->dev);
+       cdev_del(uverbs_dev->cdev);
        clear_bit(uverbs_dev->devnum, dev_map);
 
 err:
@@ -796,9 +797,9 @@ static void ib_uverbs_remove_one(struct ib_device *device)
        if (!uverbs_dev)
                return;
 
-       class_set_devdata(uverbs_dev->class_dev, NULL);
-       class_device_destroy(uverbs_class, uverbs_dev->dev->dev);
-       cdev_del(uverbs_dev->dev);
+       dev_set_drvdata(uverbs_dev->dev, NULL);
+       device_destroy(uverbs_class, uverbs_dev->cdev->dev);
+       cdev_del(uverbs_dev->cdev);
 
        spin_lock(&map_lock);
        dev_table[uverbs_dev->devnum] = NULL;
index ed38ab8d9c0c9547933bd40cbc81ea46118c6274..d12a24a84fd960838441413178486f1e4636ce24 100644 (file)
@@ -40,7 +40,6 @@
 #include <linux/pci.h>
 #include <linux/dma-mapping.h>
 #include <linux/idr.h>
-#include <asm/semaphore.h>
 
 #include "c2_provider.h"
 #include "c2_mq.h"
index e10d27a6e145fe2b9b4c7f998b96e20f700badf3..6af2c0f79a677ab889685e4b54d6ed53c580850d 100644 (file)
@@ -523,45 +523,49 @@ static int c2_dereg_mr(struct ib_mr *ib_mr)
        return err;
 }
 
-static ssize_t show_rev(struct class_device *cdev, char *buf)
+static ssize_t show_rev(struct device *dev, struct device_attribute *attr,
+                       char *buf)
 {
-       struct c2_dev *dev = container_of(cdev, struct c2_dev, ibdev.class_dev);
+       struct c2_dev *c2dev = container_of(dev, struct c2_dev, ibdev.dev);
        pr_debug("%s:%u\n", __func__, __LINE__);
-       return sprintf(buf, "%x\n", dev->props.hw_ver);
+       return sprintf(buf, "%x\n", c2dev->props.hw_ver);
 }
 
-static ssize_t show_fw_ver(struct class_device *cdev, char *buf)
+static ssize_t show_fw_ver(struct device *dev, struct device_attribute *attr,
+                          char *buf)
 {
-       struct c2_dev *dev = container_of(cdev, struct c2_dev, ibdev.class_dev);
+       struct c2_dev *c2dev = container_of(dev, struct c2_dev, ibdev.dev);
        pr_debug("%s:%u\n", __func__, __LINE__);
        return sprintf(buf, "%x.%x.%x\n",
-                      (int) (dev->props.fw_ver >> 32),
-                      (int) (dev->props.fw_ver >> 16) & 0xffff,
-                      (int) (dev->props.fw_ver & 0xffff));
+                      (int) (c2dev->props.fw_ver >> 32),
+                      (int) (c2dev->props.fw_ver >> 16) & 0xffff,
+                      (int) (c2dev->props.fw_ver & 0xffff));
 }
 
-static ssize_t show_hca(struct class_device *cdev, char *buf)
+static ssize_t show_hca(struct device *dev, struct device_attribute *attr,
+                       char *buf)
 {
        pr_debug("%s:%u\n", __func__, __LINE__);
        return sprintf(buf, "AMSO1100\n");
 }
 
-static ssize_t show_board(struct class_device *cdev, char *buf)
+static ssize_t show_board(struct device *dev, struct device_attribute *attr,
+                         char *buf)
 {
        pr_debug("%s:%u\n", __func__, __LINE__);
        return sprintf(buf, "%.*s\n", 32, "AMSO1100 Board ID");
 }
 
-static CLASS_DEVICE_ATTR(hw_rev, S_IRUGO, show_rev, NULL);
-static CLASS_DEVICE_ATTR(fw_ver, S_IRUGO, show_fw_ver, NULL);
-static CLASS_DEVICE_ATTR(hca_type, S_IRUGO, show_hca, NULL);
-static CLASS_DEVICE_ATTR(board_id, S_IRUGO, show_board, NULL);
+static DEVICE_ATTR(hw_rev, S_IRUGO, show_rev, NULL);
+static DEVICE_ATTR(fw_ver, S_IRUGO, show_fw_ver, NULL);
+static DEVICE_ATTR(hca_type, S_IRUGO, show_hca, NULL);
+static DEVICE_ATTR(board_id, S_IRUGO, show_board, NULL);
 
-static struct class_device_attribute *c2_class_attributes[] = {
-       &class_device_attr_hw_rev,
-       &class_device_attr_fw_ver,
-       &class_device_attr_hca_type,
-       &class_device_attr_board_id
+static struct device_attribute *c2_dev_attributes[] = {
+       &dev_attr_hw_rev,
+       &dev_attr_fw_ver,
+       &dev_attr_hca_type,
+       &dev_attr_board_id
 };
 
 static int c2_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr,
@@ -861,9 +865,9 @@ int c2_register_device(struct c2_dev *dev)
        if (ret)
                goto out1;
 
-       for (i = 0; i < ARRAY_SIZE(c2_class_attributes); ++i) {
-               ret = class_device_create_file(&dev->ibdev.class_dev,
-                                              c2_class_attributes[i]);
+       for (i = 0; i < ARRAY_SIZE(c2_dev_attributes); ++i) {
+               ret = device_create_file(&dev->ibdev.dev,
+                                              c2_dev_attributes[i]);
                if (ret)
                        goto out0;
        }
index ca7265443c05c37cf79f5fc35811b93dd206b53d..ab4695c1dd5614b3e881ad6d03abca913621ebf6 100644 (file)
@@ -1041,61 +1041,60 @@ static int iwch_query_port(struct ib_device *ibdev,
        return 0;
 }
 
-static ssize_t show_rev(struct class_device *cdev, char *buf)
+static ssize_t show_rev(struct device *dev, struct device_attribute *attr,
+                       char *buf)
 {
-       struct iwch_dev *dev = container_of(cdev, struct iwch_dev,
-                                           ibdev.class_dev);
-       PDBG("%s class dev 0x%p\n", __func__, cdev);
-       return sprintf(buf, "%d\n", dev->rdev.t3cdev_p->type);
+       struct iwch_dev *iwch_dev = container_of(dev, struct iwch_dev,
+                                                ibdev.dev);
+       PDBG("%s dev 0x%p\n", __func__, dev);
+       return sprintf(buf, "%d\n", iwch_dev->rdev.t3cdev_p->type);
 }
 
-static ssize_t show_fw_ver(struct class_device *cdev, char *buf)
+static ssize_t show_fw_ver(struct device *dev, struct device_attribute *attr, char *buf)
 {
-       struct iwch_dev *dev = container_of(cdev, struct iwch_dev,
-                                           ibdev.class_dev);
+       struct iwch_dev *iwch_dev = container_of(dev, struct iwch_dev,
+                                                ibdev.dev);
        struct ethtool_drvinfo info;
-       struct net_device *lldev = dev->rdev.t3cdev_p->lldev;
+       struct net_device *lldev = iwch_dev->rdev.t3cdev_p->lldev;
 
-       PDBG("%s class dev 0x%p\n", __func__, cdev);
-       rtnl_lock();
+       PDBG("%s dev 0x%p\n", __func__, dev);
        lldev->ethtool_ops->get_drvinfo(lldev, &info);
-       rtnl_unlock();
        return sprintf(buf, "%s\n", info.fw_version);
 }
 
-static ssize_t show_hca(struct class_device *cdev, char *buf)
+static ssize_t show_hca(struct device *dev, struct device_attribute *attr,
+                       char *buf)
 {
-       struct iwch_dev *dev = container_of(cdev, struct iwch_dev,
-                                           ibdev.class_dev);
+       struct iwch_dev *iwch_dev = container_of(dev, struct iwch_dev,
+                                                ibdev.dev);
        struct ethtool_drvinfo info;
-       struct net_device *lldev = dev->rdev.t3cdev_p->lldev;
+       struct net_device *lldev = iwch_dev->rdev.t3cdev_p->lldev;
 
-       PDBG("%s class dev 0x%p\n", __func__, cdev);
-       rtnl_lock();
+       PDBG("%s dev 0x%p\n", __func__, dev);
        lldev->ethtool_ops->get_drvinfo(lldev, &info);
-       rtnl_unlock();
        return sprintf(buf, "%s\n", info.driver);
 }
 
-static ssize_t show_board(struct class_device *cdev, char *buf)
+static ssize_t show_board(struct device *dev, struct device_attribute *attr,
+                         char *buf)
 {
-       struct iwch_dev *dev = container_of(cdev, struct iwch_dev,
-                                           ibdev.class_dev);
-       PDBG("%s class dev 0x%p\n", __func__, dev);
-       return sprintf(buf, "%x.%x\n", dev->rdev.rnic_info.pdev->vendor,
-                                      dev->rdev.rnic_info.pdev->device);
+       struct iwch_dev *iwch_dev = container_of(dev, struct iwch_dev,
+                                                ibdev.dev);
+       PDBG("%s dev 0x%p\n", __func__, dev);
+       return sprintf(buf, "%x.%x\n", iwch_dev->rdev.rnic_info.pdev->vendor,
+                      iwch_dev->rdev.rnic_info.pdev->device);
 }
 
-static CLASS_DEVICE_ATTR(hw_rev, S_IRUGO, show_rev, NULL);
-static CLASS_DEVICE_ATTR(fw_ver, S_IRUGO, show_fw_ver, NULL);
-static CLASS_DEVICE_ATTR(hca_type, S_IRUGO, show_hca, NULL);
-static CLASS_DEVICE_ATTR(board_id, S_IRUGO, show_board, NULL);
+static DEVICE_ATTR(hw_rev, S_IRUGO, show_rev, NULL);
+static DEVICE_ATTR(fw_ver, S_IRUGO, show_fw_ver, NULL);
+static DEVICE_ATTR(hca_type, S_IRUGO, show_hca, NULL);
+static DEVICE_ATTR(board_id, S_IRUGO, show_board, NULL);
 
-static struct class_device_attribute *iwch_class_attributes[] = {
-       &class_device_attr_hw_rev,
-       &class_device_attr_fw_ver,
-       &class_device_attr_hca_type,
-       &class_device_attr_board_id
+static struct device_attribute *iwch_class_attributes[] = {
+       &dev_attr_hw_rev,
+       &dev_attr_fw_ver,
+       &dev_attr_hca_type,
+       &dev_attr_board_id
 };
 
 int iwch_register_device(struct iwch_dev *dev)
@@ -1189,8 +1188,8 @@ int iwch_register_device(struct iwch_dev *dev)
                goto bail1;
 
        for (i = 0; i < ARRAY_SIZE(iwch_class_attributes); ++i) {
-               ret = class_device_create_file(&dev->ibdev.class_dev,
-                                              iwch_class_attributes[i]);
+               ret = device_create_file(&dev->ibdev.dev,
+                                        iwch_class_attributes[i]);
                if (ret) {
                        goto bail2;
                }
@@ -1208,8 +1207,8 @@ void iwch_unregister_device(struct iwch_dev *dev)
 
        PDBG("%s iwch_dev %p\n", __func__, dev);
        for (i = 0; i < ARRAY_SIZE(iwch_class_attributes); ++i)
-               class_device_remove_file(&dev->ibdev.class_dev,
-                                        iwch_class_attributes[i]);
+               device_remove_file(&dev->ibdev.dev,
+                                  iwch_class_attributes[i]);
        ib_unregister_device(&dev->ibdev);
        return;
 }
index 6d49d2f18a88223df10ffd7dc0afcdaa3fd70092..d4ce8b63e19eba275cc2e11235dc751ed438e1f1 100644 (file)
@@ -79,7 +79,7 @@ static const struct file_operations diagpkt_file_ops = {
 
 static atomic_t diagpkt_count = ATOMIC_INIT(0);
 static struct cdev *diagpkt_cdev;
-static struct class_device *diagpkt_class_dev;
+static struct device *diagpkt_dev;
 
 int ipath_diag_add(struct ipath_devdata *dd)
 {
@@ -89,7 +89,7 @@ int ipath_diag_add(struct ipath_devdata *dd)
        if (atomic_inc_return(&diagpkt_count) == 1) {
                ret = ipath_cdev_init(IPATH_DIAGPKT_MINOR,
                                      "ipath_diagpkt", &diagpkt_file_ops,
-                                     &diagpkt_cdev, &diagpkt_class_dev);
+                                     &diagpkt_cdev, &diagpkt_dev);
 
                if (ret) {
                        ipath_dev_err(dd, "Couldn't create ipath_diagpkt "
@@ -102,7 +102,7 @@ int ipath_diag_add(struct ipath_devdata *dd)
 
        ret = ipath_cdev_init(IPATH_DIAG_MINOR_BASE + dd->ipath_unit, name,
                              &diag_file_ops, &dd->diag_cdev,
-                             &dd->diag_class_dev);
+                             &dd->diag_dev);
        if (ret)
                ipath_dev_err(dd, "Couldn't create %s device: %d",
                              name, ret);
@@ -114,9 +114,9 @@ done:
 void ipath_diag_remove(struct ipath_devdata *dd)
 {
        if (atomic_dec_and_test(&diagpkt_count))
-               ipath_cdev_cleanup(&diagpkt_cdev, &diagpkt_class_dev);
+               ipath_cdev_cleanup(&diagpkt_cdev, &diagpkt_dev);
 
-       ipath_cdev_cleanup(&dd->diag_cdev, &dd->diag_class_dev);
+       ipath_cdev_cleanup(&dd->diag_cdev, &dd->diag_dev);
 }
 
 /**
index 1e627aab18bf59b2b449dd8ccb141436b0e8295c..8b1752202e78a8d69c09579428a339df283bd55c 100644 (file)
@@ -2434,11 +2434,11 @@ static ssize_t ipath_writev(struct kiocb *iocb, const struct iovec *iov,
 static struct class *ipath_class;
 
 static int init_cdev(int minor, char *name, const struct file_operations *fops,
-                    struct cdev **cdevp, struct class_device **class_devp)
+                    struct cdev **cdevp, struct device **devp)
 {
        const dev_t dev = MKDEV(IPATH_MAJOR, minor);
        struct cdev *cdev = NULL;
-       struct class_device *class_dev = NULL;
+       struct device *device = NULL;
        int ret;
 
        cdev = cdev_alloc();
@@ -2462,12 +2462,12 @@ static int init_cdev(int minor, char *name, const struct file_operations *fops,
                goto err_cdev;
        }
 
-       class_dev = class_device_create(ipath_class, NULL, dev, NULL, name);
+       device = device_create(ipath_class, NULL, dev, name);
 
-       if (IS_ERR(class_dev)) {
-               ret = PTR_ERR(class_dev);
+       if (IS_ERR(device)) {
+               ret = PTR_ERR(device);
                printk(KERN_ERR IPATH_DRV_NAME ": Could not create "
-                      "class_dev for minor %d, %s (err %d)\n",
+                      "device for minor %d, %s (err %d)\n",
                       minor, name, -ret);
                goto err_cdev;
        }
@@ -2481,29 +2481,29 @@ err_cdev:
 done:
        if (ret >= 0) {
                *cdevp = cdev;
-               *class_devp = class_dev;
+               *devp = device;
        } else {
                *cdevp = NULL;
-               *class_devp = NULL;
+               *devp = NULL;
        }
 
        return ret;
 }
 
 int ipath_cdev_init(int minor, char *name, const struct file_operations *fops,
-                   struct cdev **cdevp, struct class_device **class_devp)
+                   struct cdev **cdevp, struct device **devp)
 {
-       return init_cdev(minor, name, fops, cdevp, class_devp);
+       return init_cdev(minor, name, fops, cdevp, devp);
 }
 
 static void cleanup_cdev(struct cdev **cdevp,
-                        struct class_device **class_devp)
+                        struct device **devp)
 {
-       struct class_device *class_dev = *class_devp;
+       struct device *dev = *devp;
 
-       if (class_dev) {
-               class_device_unregister(class_dev);
-               *class_devp = NULL;
+       if (dev) {
+               device_unregister(dev);
+               *devp = NULL;
        }
 
        if (*cdevp) {
@@ -2513,13 +2513,13 @@ static void cleanup_cdev(struct cdev **cdevp,
 }
 
 void ipath_cdev_cleanup(struct cdev **cdevp,
-                       struct class_device **class_devp)
+                       struct device **devp)
 {
-       cleanup_cdev(cdevp, class_devp);
+       cleanup_cdev(cdevp, devp);
 }
 
 static struct cdev *wildcard_cdev;
-static struct class_device *wildcard_class_dev;
+static struct device *wildcard_dev;
 
 static const dev_t dev = MKDEV(IPATH_MAJOR, 0);
 
@@ -2576,7 +2576,7 @@ int ipath_user_add(struct ipath_devdata *dd)
                        goto bail;
                }
                ret = init_cdev(0, "ipath", &ipath_file_ops, &wildcard_cdev,
-                               &wildcard_class_dev);
+                               &wildcard_dev);
                if (ret < 0) {
                        ipath_dev_err(dd, "Could not create wildcard "
                                      "minor: error %d\n", -ret);
@@ -2589,7 +2589,7 @@ int ipath_user_add(struct ipath_devdata *dd)
        snprintf(name, sizeof(name), "ipath%d", dd->ipath_unit);
 
        ret = init_cdev(dd->ipath_unit + 1, name, &ipath_file_ops,
-                       &dd->user_cdev, &dd->user_class_dev);
+                       &dd->user_cdev, &dd->user_dev);
        if (ret < 0)
                ipath_dev_err(dd, "Could not create user minor %d, %s\n",
                              dd->ipath_unit + 1, name);
@@ -2604,13 +2604,13 @@ bail:
 
 void ipath_user_remove(struct ipath_devdata *dd)
 {
-       cleanup_cdev(&dd->user_cdev, &dd->user_class_dev);
+       cleanup_cdev(&dd->user_cdev, &dd->user_dev);
 
        if (atomic_dec_return(&user_count) == 0) {
                if (atomic_read(&user_setup) == 0)
                        goto bail;
 
-               cleanup_cdev(&wildcard_cdev, &wildcard_class_dev);
+               cleanup_cdev(&wildcard_cdev, &wildcard_dev);
                user_cleanup();
 
                atomic_set(&user_setup, 0);
index 5863cbe9930313a5cd16522b6806432512d4b3ff..202337ae90dc68621dc89feefe931dbb82982c37 100644 (file)
@@ -466,8 +466,8 @@ struct ipath_devdata {
        struct pci_dev *pcidev;
        struct cdev *user_cdev;
        struct cdev *diag_cdev;
-       struct class_device *user_class_dev;
-       struct class_device *diag_class_dev;
+       struct device *user_dev;
+       struct device *diag_dev;
        /* timer used to prevent stats overflow, error throttling, etc. */
        struct timer_list ipath_stats_timer;
        /* timer to verify interrupts work, and fallback if possible */
@@ -854,9 +854,9 @@ void ipath_clear_freeze(struct ipath_devdata *);
 
 struct file_operations;
 int ipath_cdev_init(int minor, char *name, const struct file_operations *fops,
-                   struct cdev **cdevp, struct class_device **class_devp);
+                   struct cdev **cdevp, struct device **devp);
 void ipath_cdev_cleanup(struct cdev **cdevp,
-                       struct class_device **class_devp);
+                       struct device **devp);
 
 int ipath_diag_add(struct ipath_devdata *);
 void ipath_diag_remove(struct ipath_devdata *);
index 320a6d018de7522cf07c5eaf9217ef666938b22e..c38f9aa8be8dc000c26124da1477759a5a20fa76 100644 (file)
@@ -2172,18 +2172,20 @@ void ipath_unregister_ib_device(struct ipath_ibdev *dev)
        ib_dealloc_device(ibdev);
 }
 
-static ssize_t show_rev(struct class_device *cdev, char *buf)
+static ssize_t show_rev(struct device *device, struct device_attribute *attr,
+                       char *buf)
 {
        struct ipath_ibdev *dev =
-               container_of(cdev, struct ipath_ibdev, ibdev.class_dev);
+               container_of(device, struct ipath_ibdev, ibdev.dev);
 
        return sprintf(buf, "%x\n", dev->dd->ipath_pcirev);
 }
 
-static ssize_t show_hca(struct class_device *cdev, char *buf)
+static ssize_t show_hca(struct device *device, struct device_attribute *attr,
+                       char *buf)
 {
        struct ipath_ibdev *dev =
-               container_of(cdev, struct ipath_ibdev, ibdev.class_dev);
+               container_of(device, struct ipath_ibdev, ibdev.dev);
        int ret;
 
        ret = dev->dd->ipath_f_get_boardname(dev->dd, buf, 128);
@@ -2196,10 +2198,11 @@ bail:
        return ret;
 }
 
-static ssize_t show_stats(struct class_device *cdev, char *buf)
+static ssize_t show_stats(struct device *device, struct device_attribute *attr,
+                         char *buf)
 {
        struct ipath_ibdev *dev =
-               container_of(cdev, struct ipath_ibdev, ibdev.class_dev);
+               container_of(device, struct ipath_ibdev, ibdev.dev);
        int i;
        int len;
 
@@ -2237,16 +2240,16 @@ static ssize_t show_stats(struct class_device *cdev, char *buf)
        return len;
 }
 
-static CLASS_DEVICE_ATTR(hw_rev, S_IRUGO, show_rev, NULL);
-static CLASS_DEVICE_ATTR(hca_type, S_IRUGO, show_hca, NULL);
-static CLASS_DEVICE_ATTR(board_id, S_IRUGO, show_hca, NULL);
-static CLASS_DEVICE_ATTR(stats, S_IRUGO, show_stats, NULL);
+static DEVICE_ATTR(hw_rev, S_IRUGO, show_rev, NULL);
+static DEVICE_ATTR(hca_type, S_IRUGO, show_hca, NULL);
+static DEVICE_ATTR(board_id, S_IRUGO, show_hca, NULL);
+static DEVICE_ATTR(stats, S_IRUGO, show_stats, NULL);
 
-static struct class_device_attribute *ipath_class_attributes[] = {
-       &class_device_attr_hw_rev,
-       &class_device_attr_hca_type,
-       &class_device_attr_board_id,
-       &class_device_attr_stats
+static struct device_attribute *ipath_class_attributes[] = {
+       &dev_attr_hw_rev,
+       &dev_attr_hca_type,
+       &dev_attr_board_id,
+       &dev_attr_stats
 };
 
 static int ipath_verbs_register_sysfs(struct ib_device *dev)
@@ -2255,8 +2258,8 @@ static int ipath_verbs_register_sysfs(struct ib_device *dev)
        int ret;
 
        for (i = 0; i < ARRAY_SIZE(ipath_class_attributes); ++i)
-               if (class_device_create_file(&dev->class_dev,
-                                            ipath_class_attributes[i])) {
+               if (device_create_file(&dev->dev,
+                                      ipath_class_attributes[i])) {
                        ret = 1;
                        goto bail;
                }
index 136c76c7b4e78ac394ebc73442d6ba587200427a..4d9b5ac42202cc3df5b81961068f18e65beb00ac 100644 (file)
@@ -481,42 +481,51 @@ out:
        return err;
 }
 
-static ssize_t show_hca(struct class_device *cdev, char *buf)
+static ssize_t show_hca(struct device *device, struct device_attribute *attr,
+                       char *buf)
 {
-       struct mlx4_ib_dev *dev = container_of(cdev, struct mlx4_ib_dev, ib_dev.class_dev);
+       struct mlx4_ib_dev *dev =
+               container_of(device, struct mlx4_ib_dev, ib_dev.dev);
        return sprintf(buf, "MT%d\n", dev->dev->pdev->device);
 }
 
-static ssize_t show_fw_ver(struct class_device *cdev, char *buf)
+static ssize_t show_fw_ver(struct device *device, struct device_attribute *attr,
+                          char *buf)
 {
-       struct mlx4_ib_dev *dev = container_of(cdev, struct mlx4_ib_dev, ib_dev.class_dev);
+       struct mlx4_ib_dev *dev =
+               container_of(device, struct mlx4_ib_dev, ib_dev.dev);
        return sprintf(buf, "%d.%d.%d\n", (int) (dev->dev->caps.fw_ver >> 32),
                       (int) (dev->dev->caps.fw_ver >> 16) & 0xffff,
                       (int) dev->dev->caps.fw_ver & 0xffff);
 }
 
-static ssize_t show_rev(struct class_device *cdev, char *buf)
+static ssize_t show_rev(struct device *device, struct device_attribute *attr,
+                       char *buf)
 {
-       struct mlx4_ib_dev *dev = container_of(cdev, struct mlx4_ib_dev, ib_dev.class_dev);
+       struct mlx4_ib_dev *dev =
+               container_of(device, struct mlx4_ib_dev, ib_dev.dev);
        return sprintf(buf, "%x\n", dev->dev->rev_id);
 }
 
-static ssize_t show_board(struct class_device *cdev, char *buf)
+static ssize_t show_board(struct device *device, struct device_attribute *attr,
+                         char *buf)
 {
-       struct mlx4_ib_dev *dev = container_of(cdev, struct mlx4_ib_dev, ib_dev.class_dev);
-       return sprintf(buf, "%.*s\n", MLX4_BOARD_ID_LEN, dev->dev->board_id);
+       struct mlx4_ib_dev *dev =
+               container_of(device, struct mlx4_ib_dev, ib_dev.dev);
+       return sprintf(buf, "%.*s\n", MLX4_BOARD_ID_LEN,
+                      dev->dev->board_id);
 }
 
-static CLASS_DEVICE_ATTR(hw_rev,   S_IRUGO, show_rev,    NULL);
-static CLASS_DEVICE_ATTR(fw_ver,   S_IRUGO, show_fw_ver, NULL);
-static CLASS_DEVICE_ATTR(hca_type, S_IRUGO, show_hca,    NULL);
-static CLASS_DEVICE_ATTR(board_id, S_IRUGO, show_board,  NULL);
+static DEVICE_ATTR(hw_rev,   S_IRUGO, show_rev,    NULL);
+static DEVICE_ATTR(fw_ver,   S_IRUGO, show_fw_ver, NULL);
+static DEVICE_ATTR(hca_type, S_IRUGO, show_hca,    NULL);
+static DEVICE_ATTR(board_id, S_IRUGO, show_board,  NULL);
 
-static struct class_device_attribute *mlx4_class_attributes[] = {
-       &class_device_attr_hw_rev,
-       &class_device_attr_fw_ver,
-       &class_device_attr_hca_type,
-       &class_device_attr_board_id
+static struct device_attribute *mlx4_class_attributes[] = {
+       &dev_attr_hw_rev,
+       &dev_attr_fw_ver,
+       &dev_attr_hca_type,
+       &dev_attr_board_id
 };
 
 static void *mlx4_ib_add(struct mlx4_dev *dev)
@@ -640,8 +649,8 @@ static void *mlx4_ib_add(struct mlx4_dev *dev)
                goto err_reg;
 
        for (i = 0; i < ARRAY_SIZE(mlx4_class_attributes); ++i) {
-               if (class_device_create_file(&ibdev->ib_dev.class_dev,
-                                              mlx4_class_attributes[i]))
+               if (device_create_file(&ibdev->ib_dev.dev,
+                                      mlx4_class_attributes[i]))
                        goto err_reg;
        }
 
index 0e842e023400c848ef4d9e954339a026f817262d..7bc32f8e377ec4747a0c884243efcd34757bc23d 100644 (file)
@@ -46,8 +46,7 @@
 #include <linux/timer.h>
 #include <linux/mutex.h>
 #include <linux/list.h>
-
-#include <asm/semaphore.h>
+#include <linux/semaphore.h>
 
 #include "mthca_provider.h"
 #include "mthca_doorbell.h"
index 81b257e18bb6b0bff96a47a991378390db850785..696e1f30233268a6f69261ca10dd4fb0beadef28 100644 (file)
@@ -1170,23 +1170,29 @@ static int mthca_unmap_fmr(struct list_head *fmr_list)
        return 0;
 }
 
-static ssize_t show_rev(struct class_device *cdev, char *buf)
+static ssize_t show_rev(struct device *device, struct device_attribute *attr,
+                       char *buf)
 {
-       struct mthca_dev *dev = container_of(cdev, struct mthca_dev, ib_dev.class_dev);
+       struct mthca_dev *dev =
+               container_of(device, struct mthca_dev, ib_dev.dev);
        return sprintf(buf, "%x\n", dev->rev_id);
 }
 
-static ssize_t show_fw_ver(struct class_device *cdev, char *buf)
+static ssize_t show_fw_ver(struct device *device, struct device_attribute *attr,
+                          char *buf)
 {
-       struct mthca_dev *dev = container_of(cdev, struct mthca_dev, ib_dev.class_dev);
+       struct mthca_dev *dev =
+               container_of(device, struct mthca_dev, ib_dev.dev);
        return sprintf(buf, "%d.%d.%d\n", (int) (dev->fw_ver >> 32),
                       (int) (dev->fw_ver >> 16) & 0xffff,
                       (int) dev->fw_ver & 0xffff);
 }
 
-static ssize_t show_hca(struct class_device *cdev, char *buf)
+static ssize_t show_hca(struct device *device, struct device_attribute *attr,
+                       char *buf)
 {
-       struct mthca_dev *dev = container_of(cdev, struct mthca_dev, ib_dev.class_dev);
+       struct mthca_dev *dev =
+               container_of(device, struct mthca_dev, ib_dev.dev);
        switch (dev->pdev->device) {
        case PCI_DEVICE_ID_MELLANOX_TAVOR:
                return sprintf(buf, "MT23108\n");
@@ -1202,22 +1208,24 @@ static ssize_t show_hca(struct class_device *cdev, char *buf)
        }
 }
 
-static ssize_t show_board(struct class_device *cdev, char *buf)
+static ssize_t show_board(struct device *device, struct device_attribute *attr,
+                         char *buf)
 {
-       struct mthca_dev *dev = container_of(cdev, struct mthca_dev, ib_dev.class_dev);
+       struct mthca_dev *dev =
+               container_of(device, struct mthca_dev, ib_dev.dev);
        return sprintf(buf, "%.*s\n", MTHCA_BOARD_ID_LEN, dev->board_id);
 }
 
-static CLASS_DEVICE_ATTR(hw_rev,   S_IRUGO, show_rev,    NULL);
-static CLASS_DEVICE_ATTR(fw_ver,   S_IRUGO, show_fw_ver, NULL);
-static CLASS_DEVICE_ATTR(hca_type, S_IRUGO, show_hca,    NULL);
-static CLASS_DEVICE_ATTR(board_id, S_IRUGO, show_board,  NULL);
+static DEVICE_ATTR(hw_rev,   S_IRUGO, show_rev,    NULL);
+static DEVICE_ATTR(fw_ver,   S_IRUGO, show_fw_ver, NULL);
+static DEVICE_ATTR(hca_type, S_IRUGO, show_hca,    NULL);
+static DEVICE_ATTR(board_id, S_IRUGO, show_board,  NULL);
 
-static struct class_device_attribute *mthca_class_attributes[] = {
-       &class_device_attr_hw_rev,
-       &class_device_attr_fw_ver,
-       &class_device_attr_hca_type,
-       &class_device_attr_board_id
+static struct device_attribute *mthca_dev_attributes[] = {
+       &dev_attr_hw_rev,
+       &dev_attr_fw_ver,
+       &dev_attr_hca_type,
+       &dev_attr_board_id
 };
 
 static int mthca_init_node_data(struct mthca_dev *dev)
@@ -1379,9 +1387,9 @@ int mthca_register_device(struct mthca_dev *dev)
        if (ret)
                return ret;
 
-       for (i = 0; i < ARRAY_SIZE(mthca_class_attributes); ++i) {
-               ret = class_device_create_file(&dev->ib_dev.class_dev,
-                                              mthca_class_attributes[i]);
+       for (i = 0; i < ARRAY_SIZE(mthca_dev_attributes); ++i) {
+               ret = device_create_file(&dev->ib_dev.dev,
+                                        mthca_dev_attributes[i]);
                if (ret) {
                        ib_unregister_device(&dev->ib_dev);
                        return ret;
index 1626124a156d53615e0fafe9ba1eb03990d01d77..cdf2e9ad62f7512b59d601558ac53349f732552f 100644 (file)
@@ -43,7 +43,6 @@
 #include <linux/dma-mapping.h>
 #include <linux/workqueue.h>
 #include <linux/slab.h>
-#include <asm/semaphore.h>
 #include <linux/version.h>
 #include <asm/io.h>
 #include <linux/crc32c.h>
index 7c27420c22405a0bfd1faaa9549915dd7f37e6ea..f9a5d43908923081526b50e4eed3a709c5b4b8e0 100644 (file)
@@ -2800,10 +2800,11 @@ static int nes_dereg_mr(struct ib_mr *ib_mr)
 /**
  * show_rev
  */
-static ssize_t show_rev(struct class_device *cdev, char *buf)
+static ssize_t show_rev(struct device *dev, struct device_attribute *attr,
+                       char *buf)
 {
        struct nes_ib_device *nesibdev =
-                       container_of(cdev, struct nes_ib_device, ibdev.class_dev);
+                       container_of(dev, struct nes_ib_device, ibdev.dev);
        struct nes_vnic *nesvnic = nesibdev->nesvnic;
 
        nes_debug(NES_DBG_INIT, "\n");
@@ -2814,10 +2815,11 @@ static ssize_t show_rev(struct class_device *cdev, char *buf)
 /**
  * show_fw_ver
  */
-static ssize_t show_fw_ver(struct class_device *cdev, char *buf)
+static ssize_t show_fw_ver(struct device *dev, struct device_attribute *attr,
+                          char *buf)
 {
        struct nes_ib_device *nesibdev =
-                       container_of(cdev, struct nes_ib_device, ibdev.class_dev);
+                       container_of(dev, struct nes_ib_device, ibdev.dev);
        struct nes_vnic *nesvnic = nesibdev->nesvnic;
 
        nes_debug(NES_DBG_INIT, "\n");
@@ -2831,7 +2833,8 @@ static ssize_t show_fw_ver(struct class_device *cdev, char *buf)
 /**
  * show_hca
  */
-static ssize_t show_hca(struct class_device *cdev, char *buf)
+static ssize_t show_hca(struct device *dev, struct device_attribute *attr,
+                       char *buf)
 {
        nes_debug(NES_DBG_INIT, "\n");
        return sprintf(buf, "NES020\n");
@@ -2841,23 +2844,24 @@ static ssize_t show_hca(struct class_device *cdev, char *buf)
 /**
  * show_board
  */
-static ssize_t show_board(struct class_device *cdev, char *buf)
+static ssize_t show_board(struct device *dev, struct device_attribute *attr,
+                         char *buf)
 {
        nes_debug(NES_DBG_INIT, "\n");
        return sprintf(buf, "%.*s\n", 32, "NES020 Board ID");
 }
 
 
-static CLASS_DEVICE_ATTR(hw_rev, S_IRUGO, show_rev, NULL);
-static CLASS_DEVICE_ATTR(fw_ver, S_IRUGO, show_fw_ver, NULL);
-static CLASS_DEVICE_ATTR(hca_type, S_IRUGO, show_hca, NULL);
-static CLASS_DEVICE_ATTR(board_id, S_IRUGO, show_board, NULL);
+static DEVICE_ATTR(hw_rev, S_IRUGO, show_rev, NULL);
+static DEVICE_ATTR(fw_ver, S_IRUGO, show_fw_ver, NULL);
+static DEVICE_ATTR(hca_type, S_IRUGO, show_hca, NULL);
+static DEVICE_ATTR(board_id, S_IRUGO, show_board, NULL);
 
-static struct class_device_attribute *nes_class_attributes[] = {
-       &class_device_attr_hw_rev,
-       &class_device_attr_fw_ver,
-       &class_device_attr_hca_type,
-       &class_device_attr_board_id
+static struct device_attribute *nes_dev_attributes[] = {
+       &dev_attr_hw_rev,
+       &dev_attr_fw_ver,
+       &dev_attr_hca_type,
+       &dev_attr_board_id
 };
 
 
@@ -3782,7 +3786,7 @@ struct nes_ib_device *nes_init_ofa_device(struct net_device *netdev)
        nesibdev->ibdev.phys_port_cnt = 1;
        nesibdev->ibdev.num_comp_vectors = 1;
        nesibdev->ibdev.dma_device = &nesdev->pcidev->dev;
-       nesibdev->ibdev.class_dev.dev = &nesdev->pcidev->dev;
+       nesibdev->ibdev.dev.parent = &nesdev->pcidev->dev;
        nesibdev->ibdev.query_device = nes_query_device;
        nesibdev->ibdev.query_port = nes_query_port;
        nesibdev->ibdev.modify_port = nes_modify_port;
@@ -3877,13 +3881,13 @@ int nes_register_ofa_device(struct nes_ib_device *nesibdev)
        nesibdev->max_qp = (nesadapter->max_qp-NES_FIRST_QPN) / nesadapter->port_count;
        nesibdev->max_pd = nesadapter->max_pd / nesadapter->port_count;
 
-       for (i = 0; i < ARRAY_SIZE(nes_class_attributes); ++i) {
-               ret = class_device_create_file(&nesibdev->ibdev.class_dev, nes_class_attributes[i]);
+       for (i = 0; i < ARRAY_SIZE(nes_dev_attributes); ++i) {
+               ret = device_create_file(&nesibdev->ibdev.dev, nes_dev_attributes[i]);
                if (ret) {
                        while (i > 0) {
                                i--;
-                               class_device_remove_file(&nesibdev->ibdev.class_dev,
-                                               nes_class_attributes[i]);
+                               device_remove_file(&nesibdev->ibdev.dev,
+                                                  nes_dev_attributes[i]);
                        }
                        ib_unregister_device(&nesibdev->ibdev);
                        return ret;
@@ -3904,8 +3908,8 @@ static void nes_unregister_ofa_device(struct nes_ib_device *nesibdev)
        struct nes_vnic *nesvnic = nesibdev->nesvnic;
        int i;
 
-       for (i = 0; i < ARRAY_SIZE(nes_class_attributes); ++i) {
-               class_device_remove_file(&nesibdev->ibdev.class_dev, nes_class_attributes[i]);
+       for (i = 0; i < ARRAY_SIZE(nes_dev_attributes); ++i) {
+               device_remove_file(&nesibdev->ibdev.dev, nes_dev_attributes[i]);
        }
 
        if (nesvnic->of_device_registered) {
index 125765aa9d59dfc02b0045dc3e23df0d37f1167e..435145709dd624395cf92cd2414364e58983bd89 100644 (file)
@@ -139,8 +139,9 @@ static struct srp_iu *srp_alloc_iu(struct srp_host *host, size_t size,
        if (!iu->buf)
                goto out_free_iu;
 
-       iu->dma = ib_dma_map_single(host->dev->dev, iu->buf, size, direction);
-       if (ib_dma_mapping_error(host->dev->dev, iu->dma))
+       iu->dma = ib_dma_map_single(host->srp_dev->dev, iu->buf, size,
+                                   direction);
+       if (ib_dma_mapping_error(host->srp_dev->dev, iu->dma))
                goto out_free_buf;
 
        iu->size      = size;
@@ -161,7 +162,8 @@ static void srp_free_iu(struct srp_host *host, struct srp_iu *iu)
        if (!iu)
                return;
 
-       ib_dma_unmap_single(host->dev->dev, iu->dma, iu->size, iu->direction);
+       ib_dma_unmap_single(host->srp_dev->dev, iu->dma, iu->size,
+                           iu->direction);
        kfree(iu->buf);
        kfree(iu);
 }
@@ -181,7 +183,7 @@ static int srp_init_qp(struct srp_target_port *target,
        if (!attr)
                return -ENOMEM;
 
-       ret = ib_find_cached_pkey(target->srp_host->dev->dev,
+       ret = ib_find_cached_pkey(target->srp_host->srp_dev->dev,
                                  target->srp_host->port,
                                  be16_to_cpu(target->path.pkey),
                                  &attr->pkey_index);
@@ -208,7 +210,7 @@ static int srp_new_cm_id(struct srp_target_port *target)
 {
        struct ib_cm_id *new_cm_id;
 
-       new_cm_id = ib_create_cm_id(target->srp_host->dev->dev,
+       new_cm_id = ib_create_cm_id(target->srp_host->srp_dev->dev,
                                    srp_cm_handler, target);
        if (IS_ERR(new_cm_id))
                return PTR_ERR(new_cm_id);
@@ -229,8 +231,8 @@ static int srp_create_target_ib(struct srp_target_port *target)
        if (!init_attr)
                return -ENOMEM;
 
-       target->cq = ib_create_cq(target->srp_host->dev->dev, srp_completion,
-                                 NULL, target, SRP_CQ_SIZE, 0);
+       target->cq = ib_create_cq(target->srp_host->srp_dev->dev,
+                                 srp_completion, NULL, target, SRP_CQ_SIZE, 0);
        if (IS_ERR(target->cq)) {
                ret = PTR_ERR(target->cq);
                goto out;
@@ -248,7 +250,7 @@ static int srp_create_target_ib(struct srp_target_port *target)
        init_attr->send_cq             = target->cq;
        init_attr->recv_cq             = target->cq;
 
-       target->qp = ib_create_qp(target->srp_host->dev->pd, init_attr);
+       target->qp = ib_create_qp(target->srp_host->srp_dev->pd, init_attr);
        if (IS_ERR(target->qp)) {
                ret = PTR_ERR(target->qp);
                ib_destroy_cq(target->cq);
@@ -302,7 +304,7 @@ static int srp_lookup_path(struct srp_target_port *target)
        init_completion(&target->done);
 
        target->path_query_id = ib_sa_path_rec_get(&srp_sa_client,
-                                                  target->srp_host->dev->dev,
+                                                  target->srp_host->srp_dev->dev,
                                                   target->srp_host->port,
                                                   &target->path,
                                                   IB_SA_PATH_REC_SERVICE_ID    |
@@ -403,7 +405,7 @@ static int srp_send_req(struct srp_target_port *target)
                             (unsigned long long) be64_to_cpu(target->ioc_guid));
                memset(req->priv.initiator_port_id, 0, 8);
                memcpy(req->priv.initiator_port_id + 8,
-                      &target->srp_host->dev->dev->node_guid, 8);
+                      &target->srp_host->srp_dev->dev->node_guid, 8);
        }
 
        status = ib_send_cm_req(target->cm_id, &req->param);
@@ -520,7 +522,7 @@ static void srp_unmap_data(struct scsi_cmnd *scmnd,
                req->fmr = NULL;
        }
 
-       ib_dma_unmap_sg(target->srp_host->dev->dev, scsi_sglist(scmnd),
+       ib_dma_unmap_sg(target->srp_host->srp_dev->dev, scsi_sglist(scmnd),
                        scsi_sg_count(scmnd), scmnd->sc_data_direction);
 }
 
@@ -628,7 +630,7 @@ static int srp_map_fmr(struct srp_target_port *target, struct scatterlist *scat,
        int page_cnt;
        int i, j;
        int ret;
-       struct srp_device *dev = target->srp_host->dev;
+       struct srp_device *dev = target->srp_host->srp_dev;
        struct ib_device *ibdev = dev->dev;
        struct scatterlist *sg;
 
@@ -723,7 +725,7 @@ static int srp_map_data(struct scsi_cmnd *scmnd, struct srp_target_port *target,
        nents = scsi_sg_count(scmnd);
        scat  = scsi_sglist(scmnd);
 
-       dev = target->srp_host->dev;
+       dev = target->srp_host->srp_dev;
        ibdev = dev->dev;
 
        count = ib_dma_map_sg(ibdev, scat, nents, scmnd->sc_data_direction);
@@ -779,7 +781,7 @@ static int srp_map_data(struct scsi_cmnd *scmnd, struct srp_target_port *target,
                buf->table_desc.va  =
                        cpu_to_be64(req->cmd->dma + sizeof *cmd + sizeof *buf);
                buf->table_desc.key =
-                       cpu_to_be32(target->srp_host->dev->mr->rkey);
+                       cpu_to_be32(target->srp_host->srp_dev->mr->rkey);
                buf->table_desc.len =
                        cpu_to_be32(count * sizeof (struct srp_direct_buf));
 
@@ -855,7 +857,7 @@ static void srp_handle_recv(struct srp_target_port *target, struct ib_wc *wc)
 
        iu = target->rx_ring[wc->wr_id & ~SRP_OP_RECV];
 
-       dev = target->srp_host->dev->dev;
+       dev = target->srp_host->srp_dev->dev;
        ib_dma_sync_single_for_cpu(dev, iu->dma, target->max_ti_iu_len,
                                   DMA_FROM_DEVICE);
 
@@ -937,7 +939,7 @@ static int __srp_post_recv(struct srp_target_port *target)
 
        list.addr   = iu->dma;
        list.length = iu->size;
-       list.lkey   = target->srp_host->dev->mr->lkey;
+       list.lkey   = target->srp_host->srp_dev->mr->lkey;
 
        wr.next     = NULL;
        wr.sg_list  = &list;
@@ -996,7 +998,7 @@ static int __srp_post_send(struct srp_target_port *target,
 
        list.addr   = iu->dma;
        list.length = len;
-       list.lkey   = target->srp_host->dev->mr->lkey;
+       list.lkey   = target->srp_host->srp_dev->mr->lkey;
 
        wr.next       = NULL;
        wr.wr_id      = target->tx_head & SRP_SQ_SIZE;
@@ -1039,7 +1041,7 @@ static int srp_queuecommand(struct scsi_cmnd *scmnd,
        if (!iu)
                goto err;
 
-       dev = target->srp_host->dev->dev;
+       dev = target->srp_host->srp_dev->dev;
        ib_dma_sync_single_for_cpu(dev, iu->dma, srp_max_iu_len,
                                   DMA_TO_DEVICE);
 
@@ -1456,9 +1458,10 @@ static int srp_reset_host(struct scsi_cmnd *scmnd)
        return ret;
 }
 
-static ssize_t show_id_ext(struct class_device *cdev, char *buf)
+static ssize_t show_id_ext(struct device *dev, struct device_attribute *attr,
+                          char *buf)
 {
-       struct srp_target_port *target = host_to_target(class_to_shost(cdev));
+       struct srp_target_port *target = host_to_target(class_to_shost(dev));
 
        if (target->state == SRP_TARGET_DEAD ||
            target->state == SRP_TARGET_REMOVED)
@@ -1468,9 +1471,10 @@ static ssize_t show_id_ext(struct class_device *cdev, char *buf)
                       (unsigned long long) be64_to_cpu(target->id_ext));
 }
 
-static ssize_t show_ioc_guid(struct class_device *cdev, char *buf)
+static ssize_t show_ioc_guid(struct device *dev, struct device_attribute *attr,
+                            char *buf)
 {
-       struct srp_target_port *target = host_to_target(class_to_shost(cdev));
+       struct srp_target_port *target = host_to_target(class_to_shost(dev));
 
        if (target->state == SRP_TARGET_DEAD ||
            target->state == SRP_TARGET_REMOVED)
@@ -1480,9 +1484,10 @@ static ssize_t show_ioc_guid(struct class_device *cdev, char *buf)
                       (unsigned long long) be64_to_cpu(target->ioc_guid));
 }
 
-static ssize_t show_service_id(struct class_device *cdev, char *buf)
+static ssize_t show_service_id(struct device *dev,
+                              struct device_attribute *attr, char *buf)
 {
-       struct srp_target_port *target = host_to_target(class_to_shost(cdev));
+       struct srp_target_port *target = host_to_target(class_to_shost(dev));
 
        if (target->state == SRP_TARGET_DEAD ||
            target->state == SRP_TARGET_REMOVED)
@@ -1492,9 +1497,10 @@ static ssize_t show_service_id(struct class_device *cdev, char *buf)
                       (unsigned long long) be64_to_cpu(target->service_id));
 }
 
-static ssize_t show_pkey(struct class_device *cdev, char *buf)
+static ssize_t show_pkey(struct device *dev, struct device_attribute *attr,
+                        char *buf)
 {
-       struct srp_target_port *target = host_to_target(class_to_shost(cdev));
+       struct srp_target_port *target = host_to_target(class_to_shost(dev));
 
        if (target->state == SRP_TARGET_DEAD ||
            target->state == SRP_TARGET_REMOVED)
@@ -1503,9 +1509,10 @@ static ssize_t show_pkey(struct class_device *cdev, char *buf)
        return sprintf(buf, "0x%04x\n", be16_to_cpu(target->path.pkey));
 }
 
-static ssize_t show_dgid(struct class_device *cdev, char *buf)
+static ssize_t show_dgid(struct device *dev, struct device_attribute *attr,
+                        char *buf)
 {
-       struct srp_target_port *target = host_to_target(class_to_shost(cdev));
+       struct srp_target_port *target = host_to_target(class_to_shost(dev));
 
        if (target->state == SRP_TARGET_DEAD ||
            target->state == SRP_TARGET_REMOVED)
@@ -1522,9 +1529,10 @@ static ssize_t show_dgid(struct class_device *cdev, char *buf)
                       be16_to_cpu(((__be16 *) target->path.dgid.raw)[7]));
 }
 
-static ssize_t show_orig_dgid(struct class_device *cdev, char *buf)
+static ssize_t show_orig_dgid(struct device *dev,
+                             struct device_attribute *attr, char *buf)
 {
-       struct srp_target_port *target = host_to_target(class_to_shost(cdev));
+       struct srp_target_port *target = host_to_target(class_to_shost(dev));
 
        if (target->state == SRP_TARGET_DEAD ||
            target->state == SRP_TARGET_REMOVED)
@@ -1541,9 +1549,10 @@ static ssize_t show_orig_dgid(struct class_device *cdev, char *buf)
                       be16_to_cpu(target->orig_dgid[7]));
 }
 
-static ssize_t show_zero_req_lim(struct class_device *cdev, char *buf)
+static ssize_t show_zero_req_lim(struct device *dev,
+                                struct device_attribute *attr, char *buf)
 {
-       struct srp_target_port *target = host_to_target(class_to_shost(cdev));
+       struct srp_target_port *target = host_to_target(class_to_shost(dev));
 
        if (target->state == SRP_TARGET_DEAD ||
            target->state == SRP_TARGET_REMOVED)
@@ -1552,40 +1561,42 @@ static ssize_t show_zero_req_lim(struct class_device *cdev, char *buf)
        return sprintf(buf, "%d\n", target->zero_req_lim);
 }
 
-static ssize_t show_local_ib_port(struct class_device *cdev, char *buf)
+static ssize_t show_local_ib_port(struct device *dev,
+                                 struct device_attribute *attr, char *buf)
 {
-       struct srp_target_port *target = host_to_target(class_to_shost(cdev));
+       struct srp_target_port *target = host_to_target(class_to_shost(dev));
 
        return sprintf(buf, "%d\n", target->srp_host->port);
 }
 
-static ssize_t show_local_ib_device(struct class_device *cdev, char *buf)
+static ssize_t show_local_ib_device(struct device *dev,
+                                   struct device_attribute *attr, char *buf)
 {
-       struct srp_target_port *target = host_to_target(class_to_shost(cdev));
+       struct srp_target_port *target = host_to_target(class_to_shost(dev));
 
-       return sprintf(buf, "%s\n", target->srp_host->dev->dev->name);
+       return sprintf(buf, "%s\n", target->srp_host->srp_dev->dev->name);
 }
 
-static CLASS_DEVICE_ATTR(id_ext,         S_IRUGO, show_id_ext,          NULL);
-static CLASS_DEVICE_ATTR(ioc_guid,       S_IRUGO, show_ioc_guid,        NULL);
-static CLASS_DEVICE_ATTR(service_id,     S_IRUGO, show_service_id,      NULL);
-static CLASS_DEVICE_ATTR(pkey,           S_IRUGO, show_pkey,            NULL);
-static CLASS_DEVICE_ATTR(dgid,           S_IRUGO, show_dgid,            NULL);
-static CLASS_DEVICE_ATTR(orig_dgid,      S_IRUGO, show_orig_dgid,       NULL);
-static CLASS_DEVICE_ATTR(zero_req_lim,   S_IRUGO, show_zero_req_lim,    NULL);
-static CLASS_DEVICE_ATTR(local_ib_port,   S_IRUGO, show_local_ib_port,  NULL);
-static CLASS_DEVICE_ATTR(local_ib_device, S_IRUGO, show_local_ib_device, NULL);
-
-static struct class_device_attribute *srp_host_attrs[] = {
-       &class_device_attr_id_ext,
-       &class_device_attr_ioc_guid,
-       &class_device_attr_service_id,
-       &class_device_attr_pkey,
-       &class_device_attr_dgid,
-       &class_device_attr_orig_dgid,
-       &class_device_attr_zero_req_lim,
-       &class_device_attr_local_ib_port,
-       &class_device_attr_local_ib_device,
+static DEVICE_ATTR(id_ext,         S_IRUGO, show_id_ext,          NULL);
+static DEVICE_ATTR(ioc_guid,       S_IRUGO, show_ioc_guid,        NULL);
+static DEVICE_ATTR(service_id,     S_IRUGO, show_service_id,      NULL);
+static DEVICE_ATTR(pkey,           S_IRUGO, show_pkey,            NULL);
+static DEVICE_ATTR(dgid,           S_IRUGO, show_dgid,            NULL);
+static DEVICE_ATTR(orig_dgid,      S_IRUGO, show_orig_dgid,       NULL);
+static DEVICE_ATTR(zero_req_lim,    S_IRUGO, show_zero_req_lim,           NULL);
+static DEVICE_ATTR(local_ib_port,   S_IRUGO, show_local_ib_port,   NULL);
+static DEVICE_ATTR(local_ib_device, S_IRUGO, show_local_ib_device, NULL);
+
+static struct device_attribute *srp_host_attrs[] = {
+       &dev_attr_id_ext,
+       &dev_attr_ioc_guid,
+       &dev_attr_service_id,
+       &dev_attr_pkey,
+       &dev_attr_dgid,
+       &dev_attr_orig_dgid,
+       &dev_attr_zero_req_lim,
+       &dev_attr_local_ib_port,
+       &dev_attr_local_ib_device,
        NULL
 };
 
@@ -1613,7 +1624,7 @@ static int srp_add_target(struct srp_host *host, struct srp_target_port *target)
        sprintf(target->target_name, "SRP.T10:%016llX",
                 (unsigned long long) be64_to_cpu(target->id_ext));
 
-       if (scsi_add_host(target->scsi_host, host->dev->dev->dma_device))
+       if (scsi_add_host(target->scsi_host, host->srp_dev->dev->dma_device))
                return -ENODEV;
 
        memcpy(ids.port_id, &target->id_ext, 8);
@@ -1637,17 +1648,17 @@ static int srp_add_target(struct srp_host *host, struct srp_target_port *target)
        return 0;
 }
 
-static void srp_release_class_dev(struct class_device *class_dev)
+static void srp_release_dev(struct device *dev)
 {
        struct srp_host *host =
-               container_of(class_dev, struct srp_host, class_dev);
+               container_of(dev, struct srp_host, dev);
 
        complete(&host->released);
 }
 
 static struct class srp_class = {
        .name    = "infiniband_srp",
-       .release = srp_release_class_dev
+       .dev_release = srp_release_dev
 };
 
 /*
@@ -1835,11 +1846,12 @@ out:
        return ret;
 }
 
-static ssize_t srp_create_target(struct class_device *class_dev,
+static ssize_t srp_create_target(struct device *dev,
+                                struct device_attribute *attr,
                                 const char *buf, size_t count)
 {
        struct srp_host *host =
-               container_of(class_dev, struct srp_host, class_dev);
+               container_of(dev, struct srp_host, dev);
        struct Scsi_Host *target_host;
        struct srp_target_port *target;
        int ret;
@@ -1871,7 +1883,8 @@ static ssize_t srp_create_target(struct class_device *class_dev,
        if (ret)
                goto err;
 
-       ib_get_cached_gid(host->dev->dev, host->port, 0, &target->path.sgid);
+       ib_get_cached_gid(host->srp_dev->dev, host->port, 0,
+                         &target->path.sgid);
 
        shost_printk(KERN_DEBUG, target->scsi_host, PFX
                     "new target: id_ext %016llx ioc_guid %016llx pkey %04x "
@@ -1926,27 +1939,27 @@ err:
        return ret;
 }
 
-static CLASS_DEVICE_ATTR(add_target, S_IWUSR, NULL, srp_create_target);
+static DEVICE_ATTR(add_target, S_IWUSR, NULL, srp_create_target);
 
-static ssize_t show_ibdev(struct class_device *class_dev, char *buf)
+static ssize_t show_ibdev(struct device *dev, struct device_attribute *attr,
+                         char *buf)
 {
-       struct srp_host *host =
-               container_of(class_dev, struct srp_host, class_dev);
+       struct srp_host *host = container_of(dev, struct srp_host, dev);
 
-       return sprintf(buf, "%s\n", host->dev->dev->name);
+       return sprintf(buf, "%s\n", host->srp_dev->dev->name);
 }
 
-static CLASS_DEVICE_ATTR(ibdev, S_IRUGO, show_ibdev, NULL);
+static DEVICE_ATTR(ibdev, S_IRUGO, show_ibdev, NULL);
 
-static ssize_t show_port(struct class_device *class_dev, char *buf)
+static ssize_t show_port(struct device *dev, struct device_attribute *attr,
+                        char *buf)
 {
-       struct srp_host *host =
-               container_of(class_dev, struct srp_host, class_dev);
+       struct srp_host *host = container_of(dev, struct srp_host, dev);
 
        return sprintf(buf, "%d\n", host->port);
 }
 
-static CLASS_DEVICE_ATTR(port, S_IRUGO, show_port, NULL);
+static DEVICE_ATTR(port, S_IRUGO, show_port, NULL);
 
 static struct srp_host *srp_add_port(struct srp_device *device, u8 port)
 {
@@ -1959,27 +1972,27 @@ static struct srp_host *srp_add_port(struct srp_device *device, u8 port)
        INIT_LIST_HEAD(&host->target_list);
        spin_lock_init(&host->target_lock);
        init_completion(&host->released);
-       host->dev  = device;
+       host->srp_dev = device;
        host->port = port;
 
-       host->class_dev.class = &srp_class;
-       host->class_dev.dev   = device->dev->dma_device;
-       snprintf(host->class_dev.class_id, BUS_ID_SIZE, "srp-%s-%d",
+       host->dev.class = &srp_class;
+       host->dev.parent = device->dev->dma_device;
+       snprintf(host->dev.bus_id, BUS_ID_SIZE, "srp-%s-%d",
                 device->dev->name, port);
 
-       if (class_device_register(&host->class_dev))
+       if (device_register(&host->dev))
                goto free_host;
-       if (class_device_create_file(&host->class_dev, &class_device_attr_add_target))
+       if (device_create_file(&host->dev, &dev_attr_add_target))
                goto err_class;
-       if (class_device_create_file(&host->class_dev, &class_device_attr_ibdev))
+       if (device_create_file(&host->dev, &dev_attr_ibdev))
                goto err_class;
-       if (class_device_create_file(&host->class_dev, &class_device_attr_port))
+       if (device_create_file(&host->dev, &dev_attr_port))
                goto err_class;
 
        return host;
 
 err_class:
-       class_device_unregister(&host->class_dev);
+       device_unregister(&host->dev);
 
 free_host:
        kfree(host);
@@ -2084,7 +2097,7 @@ static void srp_remove_one(struct ib_device *device)
        srp_dev = ib_get_client_data(device, &srp_client);
 
        list_for_each_entry_safe(host, tmp_host, &srp_dev->dev_list, list) {
-               class_device_unregister(&host->class_dev);
+               device_unregister(&host->dev);
                /*
                 * Wait for the sysfs entry to go away, so that no new
                 * target ports can be created.
index cb6eb816024a881061d0ac48c4a423fa118fd2e8..63d2ae72406181338dc248c6554bf341205bee1e 100644 (file)
@@ -97,9 +97,9 @@ struct srp_device {
 };
 
 struct srp_host {
-       struct srp_device      *dev;
+       struct srp_device      *srp_dev;
        u8                      port;
-       struct class_device     class_dev;
+       struct device           dev;
        struct list_head        target_list;
        spinlock_t              target_lock;
        struct completion       released;
index 8ea709be3306976244a35180b4ce15c2923a0cb0..efd70a9745910bfacd97e39b4fdebe451fa14ca4 100644 (file)
@@ -314,4 +314,13 @@ config KEYBOARD_BFIN
          To compile this driver as a module, choose M here: the
          module will be called bf54x-keys.
 
+config KEYBOARD_SH_KEYSC
+       tristate "SuperH KEYSC keypad support"
+       depends on SUPERH
+       help
+         Say Y here if you want to use a keypad attached to the KEYSC block
+         on SuperH processors such as sh7722 and sh7343.
+
+         To compile this driver as a module, choose M here: the
+         module will be called sh_keysc.
 endif
index e741f4031012c470d829abf122e9d1408d345b2e..0edc8f285d1cf57f21a93eb4da8e6fa279920a7a 100644 (file)
@@ -26,3 +26,4 @@ obj-$(CONFIG_KEYBOARD_HP6XX)          += jornada680_kbd.o
 obj-$(CONFIG_KEYBOARD_HP7XX)           += jornada720_kbd.o
 obj-$(CONFIG_KEYBOARD_MAPLE)           += maple_keyb.o
 obj-$(CONFIG_KEYBOARD_BFIN)            += bf54x-keys.o
+obj-$(CONFIG_KEYBOARD_SH_KEYSC)                += sh_keysc.o
index 790fed368aae0ea144ddb053b6c20276d6717792..5d6cc7f1dc947d74c9de6a955080fb388c087c6d 100644 (file)
@@ -23,6 +23,7 @@
 #include <asm/arch/corgi.h>
 #include <asm/arch/hardware.h>
 #include <asm/arch/pxa-regs.h>
+#include <asm/arch/pxa2xx-gpio.h>
 #include <asm/hardware/scoop.h>
 
 #define KB_ROWS                                8
diff --git a/drivers/input/keyboard/sh_keysc.c b/drivers/input/keyboard/sh_keysc.c
new file mode 100644 (file)
index 0000000..8486abc
--- /dev/null
@@ -0,0 +1,280 @@
+/*
+ * SuperH KEYSC Keypad Driver
+ *
+ * Copyright (C) 2008 Magnus Damm
+ *
+ * Based on gpio_keys.c, Copyright 2005 Phil Blundell
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/interrupt.h>
+#include <linux/irq.h>
+#include <linux/delay.h>
+#include <linux/platform_device.h>
+#include <linux/input.h>
+#include <linux/io.h>
+#include <asm/sh_keysc.h>
+
+#define KYCR1_OFFS   0x00
+#define KYCR2_OFFS   0x04
+#define KYINDR_OFFS  0x08
+#define KYOUTDR_OFFS 0x0c
+
+#define KYCR2_IRQ_LEVEL    0x10
+#define KYCR2_IRQ_DISABLED 0x00
+
+static const struct {
+       unsigned char kymd, keyout, keyin;
+} sh_keysc_mode[] = {
+       [SH_KEYSC_MODE_1] = { 0, 6, 5 },
+       [SH_KEYSC_MODE_2] = { 1, 5, 6 },
+       [SH_KEYSC_MODE_3] = { 2, 4, 7 },
+};
+
+struct sh_keysc_priv {
+       void __iomem *iomem_base;
+       unsigned long last_keys;
+       struct input_dev *input;
+       struct sh_keysc_info pdata;
+};
+
+static irqreturn_t sh_keysc_isr(int irq, void *dev_id)
+{
+       struct platform_device *pdev = dev_id;
+       struct sh_keysc_priv *priv = platform_get_drvdata(pdev);
+       struct sh_keysc_info *pdata = &priv->pdata;
+       unsigned long keys, keys1, keys0, mask;
+       unsigned char keyin_set, tmp;
+       int i, k;
+
+       dev_dbg(&pdev->dev, "isr!\n");
+
+       keys1 = ~0;
+       keys0 = 0;
+
+       do {
+               keys = 0;
+               keyin_set = 0;
+
+               iowrite16(KYCR2_IRQ_DISABLED, priv->iomem_base + KYCR2_OFFS);
+
+               for (i = 0; i < sh_keysc_mode[pdata->mode].keyout; i++) {
+                       iowrite16(0xfff ^ (3 << (i * 2)),
+                                 priv->iomem_base + KYOUTDR_OFFS);
+                       udelay(pdata->delay);
+                       tmp = ioread16(priv->iomem_base + KYINDR_OFFS);
+                       keys |= tmp << (sh_keysc_mode[pdata->mode].keyin * i);
+                       tmp ^= (1 << sh_keysc_mode[pdata->mode].keyin) - 1;
+                       keyin_set |= tmp;
+               }
+
+               iowrite16(0, priv->iomem_base + KYOUTDR_OFFS);
+               iowrite16(KYCR2_IRQ_LEVEL | (keyin_set << 8),
+                         priv->iomem_base + KYCR2_OFFS);
+
+               keys ^= ~0;
+               keys &= (1 << (sh_keysc_mode[pdata->mode].keyin *
+                              sh_keysc_mode[pdata->mode].keyout)) - 1;
+               keys1 &= keys;
+               keys0 |= keys;
+
+               dev_dbg(&pdev->dev, "keys 0x%08lx\n", keys);
+
+       } while (ioread16(priv->iomem_base + KYCR2_OFFS) & 0x01);
+
+       dev_dbg(&pdev->dev, "last_keys 0x%08lx keys0 0x%08lx keys1 0x%08lx\n",
+               priv->last_keys, keys0, keys1);
+
+       for (i = 0; i < SH_KEYSC_MAXKEYS; i++) {
+               k = pdata->keycodes[i];
+               if (!k)
+                       continue;
+
+               mask = 1 << i;
+
+               if (!((priv->last_keys ^ keys0) & mask))
+                       continue;
+
+               if ((keys1 | keys0) & mask) {
+                       input_event(priv->input, EV_KEY, k, 1);
+                       priv->last_keys |= mask;
+               }
+
+               if (!(keys1 & mask)) {
+                       input_event(priv->input, EV_KEY, k, 0);
+                       priv->last_keys &= ~mask;
+               }
+
+       }
+       input_sync(priv->input);
+
+       return IRQ_HANDLED;
+}
+
+#define res_size(res) ((res)->end - (res)->start + 1)
+
+static int __devinit sh_keysc_probe(struct platform_device *pdev)
+{
+       struct sh_keysc_priv *priv;
+       struct sh_keysc_info *pdata;
+       struct resource *res;
+       struct input_dev *input;
+       int i, k;
+       int irq, error;
+
+       if (!pdev->dev.platform_data) {
+               dev_err(&pdev->dev, "no platform data defined\n");
+               error = -EINVAL;
+               goto err0;
+       }
+
+       error = -ENXIO;
+       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+       if (res == NULL) {
+               dev_err(&pdev->dev, "failed to get I/O memory\n");
+               goto err0;
+       }
+
+       irq = platform_get_irq(pdev, 0);
+       if (irq < 0) {
+               dev_err(&pdev->dev, "failed to get irq\n");
+               goto err0;
+       }
+
+       priv = kzalloc(sizeof(*priv), GFP_KERNEL);
+       if (priv == NULL) {
+               dev_err(&pdev->dev, "failed to allocate driver data\n");
+               error = -ENOMEM;
+               goto err0;
+       }
+
+       platform_set_drvdata(pdev, priv);
+       memcpy(&priv->pdata, pdev->dev.platform_data, sizeof(priv->pdata));
+       pdata = &priv->pdata;
+
+       res = request_mem_region(res->start, res_size(res), pdev->name);
+       if (res == NULL) {
+               dev_err(&pdev->dev, "failed to request I/O memory\n");
+               error = -EBUSY;
+               goto err1;
+       }
+
+       priv->iomem_base = ioremap_nocache(res->start, res_size(res));
+       if (priv->iomem_base == NULL) {
+               dev_err(&pdev->dev, "failed to remap I/O memory\n");
+               error = -ENXIO;
+               goto err2;
+       }
+
+       priv->input = input_allocate_device();
+       if (!priv->input) {
+               dev_err(&pdev->dev, "failed to allocate input device\n");
+               error = -ENOMEM;
+               goto err3;
+       }
+
+       input = priv->input;
+       input->evbit[0] = BIT_MASK(EV_KEY);
+
+       input->name = pdev->name;
+       input->phys = "sh-keysc-keys/input0";
+       input->dev.parent = &pdev->dev;
+
+       input->id.bustype = BUS_HOST;
+       input->id.vendor = 0x0001;
+       input->id.product = 0x0001;
+       input->id.version = 0x0100;
+
+       error = request_irq(irq, sh_keysc_isr, 0, pdev->name, pdev);
+       if (error) {
+               dev_err(&pdev->dev, "failed to request IRQ\n");
+               goto err4;
+       }
+
+       for (i = 0; i < SH_KEYSC_MAXKEYS; i++) {
+               k = pdata->keycodes[i];
+               if (k)
+                       input_set_capability(input, EV_KEY, k);
+       }
+
+       error = input_register_device(input);
+       if (error) {
+               dev_err(&pdev->dev, "failed to register input device\n");
+               goto err5;
+       }
+
+       iowrite16((sh_keysc_mode[pdata->mode].kymd << 8) |
+                 pdata->scan_timing, priv->iomem_base + KYCR1_OFFS);
+       iowrite16(0, priv->iomem_base + KYOUTDR_OFFS);
+       iowrite16(KYCR2_IRQ_LEVEL, priv->iomem_base + KYCR2_OFFS);
+       return 0;
+ err5:
+       free_irq(irq, pdev);
+ err4:
+       input_free_device(input);
+ err3:
+       iounmap(priv->iomem_base);
+ err2:
+       release_mem_region(res->start, res_size(res));
+ err1:
+       platform_set_drvdata(pdev, NULL);
+       kfree(priv);
+ err0:
+       return error;
+}
+
+static int __devexit sh_keysc_remove(struct platform_device *pdev)
+{
+       struct sh_keysc_priv *priv = platform_get_drvdata(pdev);
+       struct resource *res;
+
+       iowrite16(KYCR2_IRQ_DISABLED, priv->iomem_base + KYCR2_OFFS);
+
+       input_unregister_device(priv->input);
+       free_irq(platform_get_irq(pdev, 0), pdev);
+       iounmap(priv->iomem_base);
+
+       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+       release_mem_region(res->start, res_size(res));
+
+       platform_set_drvdata(pdev, NULL);
+       kfree(priv);
+       return 0;
+}
+
+
+#define sh_keysc_suspend NULL
+#define sh_keysc_resume NULL
+
+struct platform_driver sh_keysc_device_driver = {
+       .probe          = sh_keysc_probe,
+       .remove         = __devexit_p(sh_keysc_remove),
+       .suspend        = sh_keysc_suspend,
+       .resume         = sh_keysc_resume,
+       .driver         = {
+               .name   = "sh_keysc",
+       }
+};
+
+static int __init sh_keysc_init(void)
+{
+       return platform_driver_register(&sh_keysc_device_driver);
+}
+
+static void __exit sh_keysc_exit(void)
+{
+       platform_driver_unregister(&sh_keysc_device_driver);
+}
+
+module_init(sh_keysc_init);
+module_exit(sh_keysc_exit);
+
+MODULE_AUTHOR("Magnus Damm");
+MODULE_DESCRIPTION("SuperH KEYSC Keypad Driver");
+MODULE_LICENSE("GPL");
index 1d59a2dc3c17c57a6a18110e73a6128bceb28073..0be74bfc58fe0ae084f6f7ec1e88a38eeabf0554 100644 (file)
@@ -23,6 +23,7 @@
 #include <asm/arch/spitz.h>
 #include <asm/arch/hardware.h>
 #include <asm/arch/pxa-regs.h>
+#include <asm/arch/pxa2xx-gpio.h>
 
 #define KB_ROWS                        7
 #define KB_COLS                        11
index c45ea74d53e4d27c887ab3ada74621020bc853ee..f1fd3b638a379edecc0fb70a2d575498d2f09b64 100644 (file)
@@ -40,7 +40,7 @@
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/string.h>
-#include <asm/semaphore.h>
+#include <linux/semaphore.h>
 
 #define PREFIX "HP SDC MLC: "
 
index 57a1c28bf1226e0a37a904154bc3e540c4463db7..39573b91c8de4be826ff4b2a44a3c5f6f71c36c4 100644 (file)
 #include <linux/spi/ads7846.h>
 #include <asm/irq.h>
 
-#ifdef CONFIG_ARM
-#include <asm/mach-types.h>
-#ifdef CONFIG_ARCH_OMAP
-#include <asm/arch/gpio.h>
-#endif
-#endif
-
 
 /*
  * This code has been heavily tested on a Nokia 770, and lightly
@@ -1174,31 +1167,6 @@ static struct spi_driver ads7846_driver = {
 
 static int __init ads7846_init(void)
 {
-       /* grr, board-specific init should stay out of drivers!! */
-
-#ifdef CONFIG_ARCH_OMAP
-       if (machine_is_omap_osk()) {
-               /* GPIO4 = PENIRQ; GPIO6 = BUSY */
-               omap_request_gpio(4);
-               omap_set_gpio_direction(4, 1);
-               omap_request_gpio(6);
-               omap_set_gpio_direction(6, 1);
-       }
-       // also TI 1510 Innovator, bitbanging through FPGA
-       // also Nokia 770
-       // also Palm Tungsten T2
-#endif
-
-       // PXA:
-       // also Dell Axim X50
-       // also HP iPaq H191x/H192x/H415x/H435x
-       // also Intel Lubbock (additional to UCB1400; as temperature sensor)
-       // also Sharp Zaurus C7xx, C8xx (corgi/sheperd/husky)
-
-       // Atmel at91sam9261-EK uses ads7843
-
-       // also various AMD Au1x00 devel boards
-
        return spi_register_driver(&ads7846_driver);
 }
 module_init(ads7846_init);
@@ -1206,14 +1174,6 @@ module_init(ads7846_init);
 static void __exit ads7846_exit(void)
 {
        spi_unregister_driver(&ads7846_driver);
-
-#ifdef CONFIG_ARCH_OMAP
-       if (machine_is_omap_osk()) {
-               omap_free_gpio(4);
-               omap_free_gpio(6);
-       }
-#endif
-
 }
 module_exit(ads7846_exit);
 
index 99d92f5c93d68f1b778c8a419963274f9b299e5b..a22576779acdc3c7e79c4148ca3cf89c358e0261 100644 (file)
@@ -22,6 +22,7 @@
 #include <asm/arch/sharpsl.h>
 #include <asm/arch/hardware.h>
 #include <asm/arch/pxa-regs.h>
+#include <asm/arch/pxa2xx-gpio.h>
 
 
 #define PWR_MODE_ACTIVE                0
index 61e69e9c4aa98dd8cd6e925e5ec937390e105a12..b96f3184c2e5cc930232d40d56adbc6ea5cac751 100644 (file)
@@ -20,8 +20,6 @@
 #include "hscx.h"
 #include "isdnl1.h"
 
-extern const char *CardType[];
-
 static const char *Asuscom_revision = "$Revision: 1.14.2.4 $";
 
 #define byteout(addr,val) outb(val,addr)
@@ -376,8 +374,7 @@ setup_asuscom(struct IsdnCard *card)
        cs->irq = card->para[0];
        if (!request_region(cs->hw.asus.cfg_reg, bytecnt, "asuscom isdn")) {
                printk(KERN_WARNING
-                      "HiSax: %s config port %x-%x already in use\n",
-                      CardType[card->typ],
+                      "HiSax: ISDNLink config port %x-%x already in use\n",
                       cs->hw.asus.cfg_reg,
                       cs->hw.asus.cfg_reg + bytecnt);
                return (0);
index d9028e9b9b8f2736116cf20c3332fd4d1021414b..eb6b432e261fb79ade9e743b842f3c44f319917e 100644 (file)
@@ -16,7 +16,6 @@
 #include "hscx.h"
 #include "isdnl1.h"
 
-extern const char *CardType[];
 static const char *avm_revision = "$Revision: 2.15.2.4 $";
 
 #define         AVM_A1_STAT_ISAC       0x01
@@ -200,16 +199,14 @@ setup_avm_a1(struct IsdnCard *card)
        cs->irq = card->para[0];
        if (!request_region(cs->hw.avm.cfg_reg, 8, "avm cfg")) {
                printk(KERN_WARNING
-                      "HiSax: %s config port %x-%x already in use\n",
-                      CardType[card->typ],
+                      "HiSax: AVM A1 config port %x-%x already in use\n",
                       cs->hw.avm.cfg_reg,
                       cs->hw.avm.cfg_reg + 8);
                return (0);
        }
        if (!request_region(cs->hw.avm.isac + 32, 32, "HiSax isac")) {
                printk(KERN_WARNING
-                      "HiSax: %s isac ports %x-%x already in use\n",
-                      CardType[cs->typ],
+                      "HiSax: AVM A1 isac ports %x-%x already in use\n",
                       cs->hw.avm.isac + 32,
                       cs->hw.avm.isac + 64);
                release_ioregs(cs, 0);
@@ -217,16 +214,14 @@ setup_avm_a1(struct IsdnCard *card)
        }
        if (!request_region(cs->hw.avm.isacfifo, 1, "HiSax isac fifo")) {
                printk(KERN_WARNING
-                      "HiSax: %s isac fifo port %x already in use\n",
-                      CardType[cs->typ],
+                      "HiSax: AVM A1 isac fifo port %x already in use\n",
                       cs->hw.avm.isacfifo);
                release_ioregs(cs, 1);
                return (0);
        }
        if (!request_region(cs->hw.avm.hscx[0] + 32, 32, "HiSax hscx A")) {
                printk(KERN_WARNING
-                      "HiSax: %s hscx A ports %x-%x already in use\n",
-                      CardType[cs->typ],
+                      "HiSax: AVM A1 hscx A ports %x-%x already in use\n",
                       cs->hw.avm.hscx[0] + 32,
                       cs->hw.avm.hscx[0] + 64);
                release_ioregs(cs, 3);
@@ -234,16 +229,14 @@ setup_avm_a1(struct IsdnCard *card)
        }
        if (!request_region(cs->hw.avm.hscxfifo[0], 1, "HiSax hscx A fifo")) {
                printk(KERN_WARNING
-                      "HiSax: %s hscx A fifo port %x already in use\n",
-                      CardType[cs->typ],
+                      "HiSax: AVM A1 hscx A fifo port %x already in use\n",
                       cs->hw.avm.hscxfifo[0]);
                release_ioregs(cs, 7);
                return (0);
        }
        if (!request_region(cs->hw.avm.hscx[1] + 32, 32, "HiSax hscx B")) {
                printk(KERN_WARNING
-                      "HiSax: %s hscx B ports %x-%x already in use\n",
-                      CardType[cs->typ],
+                      "HiSax: AVM A1 hscx B ports %x-%x already in use\n",
                       cs->hw.avm.hscx[1] + 32,
                       cs->hw.avm.hscx[1] + 64);
                release_ioregs(cs, 0xf);
@@ -251,8 +244,7 @@ setup_avm_a1(struct IsdnCard *card)
        }
        if (!request_region(cs->hw.avm.hscxfifo[1], 1, "HiSax hscx B fifo")) {
                printk(KERN_WARNING
-                      "HiSax: %s hscx B fifo port %x already in use\n",
-                      CardType[cs->typ],
+                      "HiSax: AVM A1 hscx B fifo port %x already in use\n",
                       cs->hw.avm.hscxfifo[1]);
                release_ioregs(cs, 0x1f);
                return (0);
@@ -284,9 +276,8 @@ setup_avm_a1(struct IsdnCard *card)
        printk(KERN_INFO "AVM A1: Byte at %x is %x\n",
               cs->hw.avm.cfg_reg, val);
 
-       printk(KERN_INFO
-              "HiSax: %s config irq:%d cfg:0x%X\n",
-              CardType[cs->typ], cs->irq,
+       printk(KERN_INFO "HiSax: AVM A1 config irq:%d cfg:0x%X\n",
+              cs->irq,
               cs->hw.avm.cfg_reg);
        printk(KERN_INFO
               "HiSax: isac:0x%X/0x%X\n",
index 3d1bdc8431ada97b5b779b984628e1e2de1f4f5a..9ca2ee54cc944e1c26665d9ddb76600efa73baee 100644 (file)
@@ -20,8 +20,6 @@
 #include <linux/pci.h>
 #include "bkm_ax.h"
 
-extern const char *CardType[];
-
 static const char *bkm_a4t_revision = "$Revision: 1.22.2.4 $";
 
 
@@ -284,15 +282,16 @@ static int __devinit a4t_cs_init(struct IsdnCard *card,
        I20_REGISTER_FILE *pI20_Regs;
 
        if (!cs->irq) {         /* IRQ range check ?? */
-               printk(KERN_WARNING "HiSax: %s: No IRQ\n", CardType[card->typ]);
+               printk(KERN_WARNING "HiSax: Telekom A4T: No IRQ\n");
                return (0);
        }
        cs->hw.ax.base = (long) ioremap(pci_memaddr, 4096);
        /* Check suspecious address */
        pI20_Regs = (I20_REGISTER_FILE *) (cs->hw.ax.base);
        if ((pI20_Regs->i20IntStatus & 0x8EFFFFFF) != 0) {
-               printk(KERN_WARNING "HiSax: %s address %lx-%lx suspecious\n",
-                      CardType[card->typ], cs->hw.ax.base, cs->hw.ax.base + 4096);
+               printk(KERN_WARNING "HiSax: Telekom A4T address "
+                      "%lx-%lx suspicious\n",
+                      cs->hw.ax.base, cs->hw.ax.base + 4096);
                iounmap((void *) cs->hw.ax.base);
                cs->hw.ax.base = 0;
                return (0);
@@ -302,8 +301,9 @@ static int __devinit a4t_cs_init(struct IsdnCard *card,
        cs->hw.ax.isac_ale = GCS_1;
        cs->hw.ax.jade_ale = GCS_3;
 
-       printk(KERN_INFO "HiSax: %s: Card configured at 0x%lX IRQ %d\n",
-              CardType[card->typ], cs->hw.ax.base, cs->irq);
+       printk(KERN_INFO "HiSax: Telekom A4T: Card configured at "
+              "0x%lX IRQ %d\n",
+              cs->hw.ax.base, cs->irq);
 
        setup_isac(cs);
        cs->readisac = &ReadISAC;
@@ -349,11 +349,12 @@ setup_bkm_a4t(struct IsdnCard *card)
                        break;
        }
        if (!found) {
-               printk(KERN_WARNING "HiSax: %s: Card not found\n", CardType[card->typ]);
+               printk(KERN_WARNING "HiSax: Telekom A4T: Card not found\n");
                return (0);
        }
        if (!pci_memaddr) {
-               printk(KERN_WARNING "HiSax: %s: No Memory base address\n", CardType[card->typ]);
+               printk(KERN_WARNING "HiSax: Telekom A4T: "
+                      "No Memory base address\n");
                return (0);
        }
 
index 99ef3b43fcd79ebf276dfcd6ce48c0b60f80433f..e1ff4717a8a69c75101875764eb2db18ae7ba0b7 100644 (file)
@@ -22,8 +22,6 @@
 
 #define        ATTEMPT_PCI_REMAPPING   /* Required for PLX rev 1 */
 
-extern const char *CardType[];
-
 static const char sct_quadro_revision[] = "$Revision: 1.22.2.4 $";
 
 static const char *sct_quadro_subtypes[] =
@@ -181,8 +179,7 @@ bkm_interrupt_ipac(int intno, void *dev_id)
                goto Start_IPAC;
        }
        if (!icnt)
-               printk(KERN_WARNING "HiSax: %s (%s) IRQ LOOP\n",
-                      CardType[cs->typ],
+               printk(KERN_WARNING "HiSax: Scitel Quadro (%s) IRQ LOOP\n",
                       sct_quadro_subtypes[cs->subtyp]);
        writereg(cs->hw.ax.base, cs->hw.ax.data_adr, IPAC_MASK, 0xFF);
        writereg(cs->hw.ax.base, cs->hw.ax.data_adr, IPAC_MASK, 0xC0);
@@ -296,8 +293,8 @@ setup_sct_quadro(struct IsdnCard *card)
        if (card->para[0] >= SCT_1 && card->para[0] <= SCT_4)
                cs->subtyp = card->para[0];
        else {
-               printk(KERN_WARNING "HiSax: %s: Invalid subcontroller in configuration, default to 1\n",
-                       CardType[card->typ]);
+               printk(KERN_WARNING "HiSax: Scitel Quadro: Invalid "
+                      "subcontroller in configuration, default to 1\n");
                return (0);
        }
        if ((cs->subtyp != SCT_1) && ((sub_sys_id != PCI_DEVICE_ID_BERKOM_SCITEL_QUADRO) ||
@@ -322,16 +319,16 @@ setup_sct_quadro(struct IsdnCard *card)
                        }
                }
                if (!found) {
-                       printk(KERN_WARNING "HiSax: %s (%s): Card not found\n",
-                               CardType[card->typ],
+                       printk(KERN_WARNING "HiSax: Scitel Quadro (%s): "
+                               "Card not found\n",
                                sct_quadro_subtypes[cs->subtyp]);
                        return (0);
                }
 #ifdef ATTEMPT_PCI_REMAPPING
 /* HACK: PLX revision 1 bug: PLX address bit 7 must not be set */
                if ((pci_ioaddr1 & 0x80) && (dev_a8->revision == 1)) {
-                       printk(KERN_WARNING "HiSax: %s (%s): PLX rev 1, remapping required!\n",
-                               CardType[card->typ],
+                       printk(KERN_WARNING "HiSax: Scitel Quadro (%s): "
+                               "PLX rev 1, remapping required!\n",
                                sct_quadro_subtypes[cs->subtyp]);
                        /* Restart PCI negotiation */
                        pci_write_config_dword(dev_a8, PCI_BASE_ADDRESS_1, (u_int) - 1);
@@ -344,8 +341,7 @@ setup_sct_quadro(struct IsdnCard *card)
 #endif /* End HACK */
        }
        if (!pci_irq) {         /* IRQ range check ?? */
-               printk(KERN_WARNING "HiSax: %s (%s): No IRQ\n",
-                      CardType[card->typ],
+               printk(KERN_WARNING "HiSax: Scitel Quadro (%s): No IRQ\n",
                       sct_quadro_subtypes[cs->subtyp]);
                return (0);
        }
@@ -355,8 +351,8 @@ setup_sct_quadro(struct IsdnCard *card)
        pci_read_config_dword(dev_a8, PCI_BASE_ADDRESS_4, &pci_ioaddr4);
        pci_read_config_dword(dev_a8, PCI_BASE_ADDRESS_5, &pci_ioaddr5);
        if (!pci_ioaddr1 || !pci_ioaddr2 || !pci_ioaddr3 || !pci_ioaddr4 || !pci_ioaddr5) {
-               printk(KERN_WARNING "HiSax: %s (%s): No IO base address(es)\n",
-                      CardType[card->typ],
+               printk(KERN_WARNING "HiSax: Scitel Quadro (%s): "
+                      "No IO base address(es)\n",
                       sct_quadro_subtypes[cs->subtyp]);
                return (0);
        }
@@ -411,8 +407,8 @@ setup_sct_quadro(struct IsdnCard *card)
        /* For isac and hscx data path */
        cs->hw.ax.data_adr = cs->hw.ax.base + 4;
 
-       printk(KERN_INFO "HiSax: %s (%s) configured at 0x%.4lX, 0x%.4lX, 0x%.4lX and IRQ %d\n",
-              CardType[card->typ],
+       printk(KERN_INFO "HiSax: Scitel Quadro (%s) configured at "
+              "0x%.4lX, 0x%.4lX, 0x%.4lX and IRQ %d\n",
               sct_quadro_subtypes[cs->subtyp],
               cs->hw.ax.plx_adr,
               cs->hw.ax.base,
@@ -432,8 +428,7 @@ setup_sct_quadro(struct IsdnCard *card)
        cs->cardmsg = &BKM_card_msg;
        cs->irq_func = &bkm_interrupt_ipac;
 
-       printk(KERN_INFO "HiSax: %s (%s): IPAC Version %d\n",
-               CardType[card->typ],
+       printk(KERN_INFO "HiSax: Scitel Quadro (%s): IPAC Version %d\n",
                sct_quadro_subtypes[cs->subtyp],
                readreg(cs->hw.ax.base, cs->hw.ax.data_adr, IPAC_ID));
        return (1);
index a0ee43c04dd507eb0302064e2d749c233009e59c..84d75a3f5d17f20dfe9017baf455ba92edb28b25 100644 (file)
@@ -1169,7 +1169,9 @@ outf_cs:
 /* Used from an exported function but calls __devinit functions.
  * Tell modpost not to warn (__ref)
  */
-static int __ref checkcard(int cardnr, char *id, int *busy_flag, struct module *lockowner)
+static int __ref checkcard(int cardnr, char *id, int *busy_flag,
+                          struct module *lockowner,
+                          hisax_setup_func_t card_setup)
 {
        int ret;
        struct IsdnCard *card = cards + cardnr;
@@ -1187,7 +1189,7 @@ static int __ref checkcard(int cardnr, char *id, int *busy_flag, struct module *
               (card->protocol == ISDN_PTYPE_NI1) ? "NI1" :
               "NONE", cs->iif.id, cs->myid);
 
-       ret = hisax_cs_setup_card(card);
+       ret = card_setup(card);
        if (!ret) {
                ll_unload(cs);
                goto outf_cs;
@@ -1241,7 +1243,8 @@ static int HiSax_inithardware(int *busy_flag)
                        else
                                sprintf(ids, "%s%d", id, i);
                }
-               if (checkcard(i, ids, busy_flag, THIS_MODULE)) {
+               if (checkcard(i, ids, busy_flag, THIS_MODULE,
+                             hisax_cs_setup_card)) {
                        foundcards++;
                        i++;
                } else {
@@ -1549,7 +1552,8 @@ int hisax_init_pcmcia(void *pcm_iob, int *busy_flag, struct IsdnCard *card)
                sprintf(ids, "HiSax%d", nrcards);
        else
                sprintf(ids, "HiSax");
-       if (!checkcard(nrcards, ids, busy_flag, THIS_MODULE))
+       if (!checkcard(nrcards, ids, busy_flag, THIS_MODULE,
+                      hisax_cs_setup_card))
                goto error;
 
        ret = nrcards;
@@ -1595,7 +1599,7 @@ int hisax_register(struct hisax_d_if *hisax_d_if, struct hisax_b_if *b_if[],
        cards[i].protocol = protocol;
        sprintf(id, "%s%d", name, i);
        nrcards++;
-       retval = checkcard(i, id, NULL, hisax_d_if->owner);
+       retval = checkcard(i, id, NULL, hisax_d_if->owner, hisax_cs_setup_card);
        if (retval == 0) { // yuck
                cards[i].typ = 0;
                nrcards--;
index d272d8ce65375a5d3159688c19a8559c8db4f872..2c3691fda30099d8b3863b2a96e56bb3c30bc855 100644 (file)
@@ -299,7 +299,7 @@ elsa_interrupt(int intno, void *dev_id)
                val = serial_inp(cs, UART_IIR);
                if (!(val & UART_IIR_NO_INT)) {
                        debugl1(cs,"IIR %02x", val);
-                       rs_interrupt_elsa(intno, cs);
+                       rs_interrupt_elsa(cs);
                }
        }
 #endif
@@ -379,7 +379,7 @@ elsa_interrupt_ipac(int intno, void *dev_id)
                val = serial_inp(cs, UART_IIR);
                if (!(val & UART_IIR_NO_INT)) {
                        debugl1(cs,"IIR %02x", val);
-                       rs_interrupt_elsa(intno, cs);
+                       rs_interrupt_elsa(cs);
                }
        }
 #endif
index 1642dca988a1e74bc8a3884fd5817128b0bfed41..f181db46439281593adc208766e25a1f7a008fa5 100644 (file)
@@ -384,13 +384,13 @@ static inline void transmit_chars(struct IsdnCardState *cs, int *intr_done)
 }
 
 
-static void rs_interrupt_elsa(int irq, struct IsdnCardState *cs)
+static void rs_interrupt_elsa(struct IsdnCardState *cs)
 {
        int status, iir, msr;
        int pass_counter = 0;
        
 #ifdef SERIAL_DEBUG_INTR
-       printk("rs_interrupt_single(%d)...", irq);
+       printk(KERN_DEBUG "rs_interrupt_single(%d)...", cs->irq);
 #endif
 
        do {
index f66620ad8e7c998f89c74084cffec895b78c463f..0ea3b46076800313c0debe79b71be88dca31d939 100644 (file)
@@ -19,7 +19,6 @@
 #include "ipac.h"
 #include <linux/pci.h>
 
-extern const char *CardType[];
 static const char *gazel_revision = "$Revision: 2.19.2.4 $";
 
 #define R647      1
@@ -479,8 +478,8 @@ reserve_regions(struct IsdnCard *card, struct IsdnCardState *cs)
        return 0;
 
       error:
-       printk(KERN_WARNING "Gazel: %s io ports 0x%x-0x%x already in use\n",
-              CardType[cs->typ], adr, adr + len);
+       printk(KERN_WARNING "Gazel: io ports 0x%x-0x%x already in use\n",
+              adr, adr + len);
        return 1;
 }
 
index fba8b624ffcf19538c8a9821e227351502a11f6a..f1265667b06241205e9e60c8f7650c9175469904 100644 (file)
@@ -22,8 +22,6 @@
 #include <linux/pci.h>
 #include <linux/interrupt.h>
 
-extern const char *CardType[];
-
 static const char *hfcpci_revision = "$Revision: 1.48.2.4 $";
 
 /* table entry in the PCI devices list */
index 05482d2688e3f1742607147eea1c09992172a5e9..f4a213877e35e35619bbc42286def6a84f7c482c 100644 (file)
@@ -18,8 +18,6 @@
 #include <linux/interrupt.h>
 #include <linux/isapnp.h>
 
-extern const char *CardType[];
-
 static const char *hfcsx_revision = "$Revision: 1.12.2.5 $";
 
 /***************************************/
index 34733c903df796d3ea4d610ccb26f42ddb7cd359..e8d429fda846847fd4a6e0063e9a8efd1742615c 100644 (file)
@@ -925,7 +925,7 @@ struct IsdnCardState {
        int             (*cardmsg) (struct IsdnCardState *, int, void *);
        void            (*setstack_d) (struct PStack *, struct IsdnCardState *);
        void            (*DC_Close) (struct IsdnCardState *);
-       int             (*irq_func) (int, void *);
+       irq_handler_t   irq_func;
        int             (*auxcmd) (struct IsdnCardState *, isdn_ctrl *);
        struct Channel  channel[2+MAX_WAITING_CALLS];
        struct BCState  bcs[2+MAX_WAITING_CALLS];
index ca3fe6259bca4bed0cd801f48a744139137b0acc..17a2fea64efe52700d76ab2b0bdba5b9c29f4581 100644 (file)
@@ -60,5 +60,7 @@ struct IsdnCard {
        IsdnCardState_t *cs;
 };
 
+typedef int (*hisax_setup_func_t)(struct IsdnCard *card);
+
 extern void    HiSax_closecard(int);
 extern int     hisax_init_pcmcia(void *, int *, IsdnCard_t *);
index 55de06953540339103bad27f8a3ec18d2469f002..ca4161798cdf7529b37e25dfe046d8e313484175 100644 (file)
@@ -17,8 +17,6 @@
 #include "isdnl1.h"
 #include <linux/isapnp.h>
 
-extern const char *CardType[];
-
 static const char *ISurf_revision = "$Revision: 1.12.2.4 $";
 
 #define byteout(addr,val) outb(val,addr)
@@ -251,22 +249,19 @@ setup_isurf(struct IsdnCard *card)
                        return(0);
                }
 #else
-               printk(KERN_WARNING "HiSax: %s port/mem not set\n",
-                       CardType[card->typ]);
+               printk(KERN_WARNING "HiSax: Siemens I-Surf port/mem not set\n");
                return (0);
 #endif
        }
        if (!request_region(cs->hw.isurf.reset, 1, "isurf isdn")) {
                printk(KERN_WARNING
-                       "HiSax: %s config port %x already in use\n",
-                       CardType[card->typ],
+                       "HiSax: Siemens I-Surf config port %x already in use\n",
                        cs->hw.isurf.reset);
                        return (0);
        }
        if (!request_region(cs->hw.isurf.phymem, ISURF_IOMEM_SIZE, "isurf iomem")) {
-               printk(KERN_WARNING
-                       "HiSax: %s memory region %lx-%lx already in use\n",
-                       CardType[card->typ],
+               printk(KERN_WARNING "HiSax: Siemens I-Surf memory region "
+                       "%lx-%lx already in use\n",
                        cs->hw.isurf.phymem,
                        cs->hw.isurf.phymem + ISURF_IOMEM_SIZE);
                release_region(cs->hw.isurf.reset, 1);
index 252d79de5e5e3e87341805e6b39451f36594dd01..2d18d4f1e57e8f35d15dc388c3448a526a621226 100644 (file)
@@ -24,7 +24,6 @@
 #include "hscx.h"
 #include "isdnl1.h"
 
-extern const char *CardType[];
 static const char *ix1_revision = "$Revision: 2.12.2.4 $";
 
 #define byteout(addr,val) outb(val,addr)
@@ -288,15 +287,15 @@ setup_ix1micro(struct IsdnCard *card)
        if (cs->hw.ix1.cfg_reg) {
                if (!request_region(cs->hw.ix1.cfg_reg, 4, "ix1micro cfg")) {
                        printk(KERN_WARNING
-                         "HiSax: %s config port %x-%x already in use\n",
-                              CardType[card->typ],
+                         "HiSax: ITK ix1-micro Rev.2 config port "
+                         "%x-%x already in use\n",
                               cs->hw.ix1.cfg_reg,
                               cs->hw.ix1.cfg_reg + 4);
                        return (0);
                }
        }
-       printk(KERN_INFO "HiSax: %s config irq:%d io:0x%X\n",
-               CardType[cs->typ], cs->irq, cs->hw.ix1.cfg_reg);
+       printk(KERN_INFO "HiSax: ITK ix1-micro Rev.2 config irq:%d io:0x%X\n",
+               cs->irq, cs->hw.ix1.cfg_reg);
        setup_isac(cs);
        cs->readisac = &ReadISAC;
        cs->writeisac = &WriteISAC;
index a81d175d9f643ec0b66cfe93e17a0c144439d884..253943029d254b39183ef25199b1e670f639e604 100644 (file)
@@ -16,8 +16,6 @@
 #include "hscx.h"
 #include "isdnl1.h"
 
-extern const char *CardType[];
-
 static const char *mic_revision = "$Revision: 1.12.2.4 $";
 
 #define byteout(addr,val) outb(val,addr)
@@ -210,8 +208,7 @@ setup_mic(struct IsdnCard *card)
 
        if (!request_region(cs->hw.mic.cfg_reg, bytecnt, "mic isdn")) {
                printk(KERN_WARNING
-                      "HiSax: %s config port %x-%x already in use\n",
-                      CardType[card->typ],
+                      "HiSax: ith mic config port %x-%x already in use\n",
                       cs->hw.mic.cfg_reg,
                       cs->hw.mic.cfg_reg + bytecnt);
                return (0);
index 4d89d3ea4173f99ebfb3f7967cbb594b4dc678a8..68e504d4ebf9d6700e47efea4374c0565d8098e7 100644 (file)
@@ -12,8 +12,6 @@
  *
  */
 
-extern const char *CardType[];
-
 #define byteout(addr,val) outb(val,addr)
 #define bytein(addr) inb(addr)
 
index bd9921128aa862f15add2ee1fe63fc60e0f24d93..421b8e6763d7bd7f4bdd30596e589d720120a802 100644 (file)
@@ -21,7 +21,6 @@
 #include <linux/pci.h>
 #include <linux/isapnp.h>
 
-extern const char *CardType[];
 static const char *niccy_revision = "$Revision: 1.21.2.4 $";
 
 #define byteout(addr,val) outb(val,addr)
@@ -284,14 +283,14 @@ int __devinit setup_niccy(struct IsdnCard *card)
                cs->subtyp = NICCY_PNP;
                cs->irq = card->para[0];
                if (!request_region(cs->hw.niccy.isac, 2, "niccy data")) {
-                       printk(KERN_WARNING "HiSax: %s data port %x-%x "
-                               "already in use\n", CardType[card->typ],
+                       printk(KERN_WARNING "HiSax: NICCY data port %x-%x "
+                               "already in use\n",
                                cs->hw.niccy.isac, cs->hw.niccy.isac + 1);
                        return 0;
                }
                if (!request_region(cs->hw.niccy.isac_ale, 2, "niccy addr")) {
-                       printk(KERN_WARNING "HiSax: %s address port %x-%x "
-                               "already in use\n", CardType[card->typ],
+                       printk(KERN_WARNING "HiSax: NICCY address port %x-%x "
+                               "already in use\n",
                                cs->hw.niccy.isac_ale,
                                cs->hw.niccy.isac_ale + 1);
                        release_region(cs->hw.niccy.isac, 2);
@@ -339,15 +338,13 @@ int __devinit setup_niccy(struct IsdnCard *card)
                cs->hw.niccy.hscx_ale = pci_ioaddr + HSCX_PCI_ADDR;
                if (!request_region(cs->hw.niccy.isac, 4, "niccy")) {
                        printk(KERN_WARNING
-                              "HiSax: %s data port %x-%x already in use\n",
-                              CardType[card->typ],
+                              "HiSax: NICCY data port %x-%x already in use\n",
                               cs->hw.niccy.isac, cs->hw.niccy.isac + 4);
                        return 0;
                }
                if (!request_region(cs->hw.niccy.cfg_reg, 0x40, "niccy pci")) {
                        printk(KERN_WARNING
-                              "HiSax: %s pci port %x-%x already in use\n",
-                              CardType[card->typ],
+                              "HiSax: NICCY pci port %x-%x already in use\n",
                               cs->hw.niccy.cfg_reg,
                               cs->hw.niccy.cfg_reg + 0x40);
                        release_region(cs->hw.niccy.isac, 4);
@@ -359,8 +356,8 @@ int __devinit setup_niccy(struct IsdnCard *card)
                return 0;
 #endif                         /* CONFIG_PCI_LEGACY */
        }
-       printk(KERN_INFO "HiSax: %s %s config irq:%d data:0x%X ale:0x%X\n",
-               CardType[cs->typ], (cs->subtyp == 1) ? "PnP" : "PCI",
+       printk(KERN_INFO "HiSax: NICCY %s config irq:%d data:0x%X ale:0x%X\n",
+               (cs->subtyp == 1) ? "PnP" : "PCI",
                cs->irq, cs->hw.niccy.isac, cs->hw.niccy.isac_ale);
        setup_isac(cs);
        cs->readisac = &ReadISAC;
index a895dfed40e5fdcdc19d6e30e3fadcf4fb0d8dda..8d36ccc87d81104745b3fc3827e0063d935bd39c 100644 (file)
@@ -235,8 +235,7 @@ static int __devinit njs_cs_init_rest(struct IsdnCard *card,
                cs->subtyp ? "TJ320" : "TJ300", cs->hw.njet.base, cs->irq);
        if (!request_region(cs->hw.njet.base, bytecnt, "netjet-s isdn")) {
                printk(KERN_WARNING
-                      "HiSax: %s config port %#lx-%#lx already in use\n",
-                      CardType[card->typ],
+                      "HiSax: NETjet-S config port %#lx-%#lx already in use\n",
                       cs->hw.njet.base,
                       cs->hw.njet.base + bytecnt);
                return (0);
index f017d3816b1dcb1e36039a21f89a7f2b40f152d3..d306c946ffba85a03e906a5362d18b7d258bb4d5 100644 (file)
@@ -197,8 +197,8 @@ static int __devinit nju_cs_init_rest(struct IsdnCard *card,
                cs->hw.njet.base, cs->irq);
        if (!request_region(cs->hw.njet.base, bytecnt, "netspider-u isdn")) {
                printk(KERN_WARNING
-                      "HiSax: %s config port %#lx-%#lx already in use\n",
-                      CardType[card->typ],
+                      "HiSax: NETspider-U config port %#lx-%#lx "
+                      "already in use\n",
                       cs->hw.njet.base,
                       cs->hw.njet.base + bytecnt);
                return (0);
index 150ef68b4ae27a5a0a2369f1c304f10e5bb50d84..16d00b555c8cfa986dfa24776acc0a9dcdf92b1f 100644 (file)
@@ -16,7 +16,6 @@
 #include "hscx.h"
 #include "isdnl1.h"
 
-extern const char *CardType[];
 static const char *s0box_revision = "$Revision: 2.6.2.4 $";
 
 static inline void
@@ -231,19 +230,15 @@ setup_s0box(struct IsdnCard *card)
        cs->hw.teles3.hscxfifo[1] = cs->hw.teles3.hscx[1] + 0x3e;
        cs->irq = card->para[0];
        if (!request_region(cs->hw.teles3.cfg_reg,8, "S0Box parallel I/O")) {
-               printk(KERN_WARNING
-                      "HiSax: %s ports %x-%x already in use\n",
-                      CardType[cs->typ],
+               printk(KERN_WARNING "HiSax: S0Box ports %x-%x already in use\n",
                        cs->hw.teles3.cfg_reg,
                        cs->hw.teles3.cfg_reg + 7);
                return 0;
        }
-       printk(KERN_INFO
-               "HiSax: %s config irq:%d isac:0x%x  cfg:0x%x\n",
-               CardType[cs->typ], cs->irq,
+       printk(KERN_INFO "HiSax: S0Box config irq:%d isac:0x%x  cfg:0x%x\n",
+               cs->irq,
                cs->hw.teles3.isac, cs->hw.teles3.cfg_reg);
-       printk(KERN_INFO
-               "HiSax: hscx A:0x%x  hscx B:0x%x\n",
+       printk(KERN_INFO "HiSax: hscx A:0x%x  hscx B:0x%x\n",
                cs->hw.teles3.hscx[0], cs->hw.teles3.hscx[1]);
        setup_isac(cs);
        cs->readisac = &ReadISAC;
index c99b16690fb32e6ed986ac5d0902e969177bde97..b34a81d655b8255d5cb506196ad39df7968fb199 100644 (file)
@@ -18,7 +18,6 @@
 #include "hscx.h"
 #include "isdnl1.h"
 
-extern const char *CardType[];
 static char *saphir_rev = "$Revision: 1.10.2.4 $";
 
 #define byteout(addr,val) outb(val,addr)
@@ -260,15 +259,14 @@ setup_saphir(struct IsdnCard *card)
        cs->irq = card->para[0];
        if (!request_region(cs->hw.saphir.cfg_reg, 6, "saphir")) {
                printk(KERN_WARNING
-                       "HiSax: %s config port %x-%x already in use\n",
-                       CardType[card->typ],
+                       "HiSax: HST Saphir config port %x-%x already in use\n",
                        cs->hw.saphir.cfg_reg,
                        cs->hw.saphir.cfg_reg + 5);
                return (0);
        }
 
-       printk(KERN_INFO "HiSax: %s config irq:%d io:0x%X\n",
-               CardType[cs->typ], cs->irq, cs->hw.saphir.cfg_reg);
+       printk(KERN_INFO "HiSax: HST Saphir config irq:%d io:0x%X\n",
+              cs->irq, cs->hw.saphir.cfg_reg);
 
        setup_isac(cs);
        cs->hw.saphir.timer.function = (void *) SaphirWatchDog;
index 02209500b3b7e1445081430e87ad211eeb1fc171..0a53759adfa4e72e764d2e25a321cf7d82e41ef3 100644 (file)
@@ -18,7 +18,6 @@
 #include "hscx.h"
 #include "isdnl1.h"
 
-extern const char *CardType[];
 static const char *sportster_revision = "$Revision: 1.16.2.4 $";
 
 #define byteout(addr,val) outb(val,addr)
@@ -192,9 +191,9 @@ get_io_range(struct IsdnCardState *cs)
        for (i=0;i<64;i++) {
                adr = cs->hw.spt.cfg_reg + i *1024;
                if (!request_region(adr, 8, "sportster")) {
-                       printk(KERN_WARNING
-                               "HiSax: %s config port %x-%x already in use\n",
-                               CardType[cs->typ], adr, adr + 8);
+                       printk(KERN_WARNING "HiSax: USR Sportster config port "
+                               "%x-%x already in use\n",
+                               adr, adr + 8);
                        break;
                } 
        }
@@ -247,8 +246,8 @@ setup_sportster(struct IsdnCard *card)
                        printk(KERN_WARNING "Sportster: wrong IRQ\n");
                        return(0);
        }
-       printk(KERN_INFO "HiSax: %s config irq:%d cfg:0x%X\n",
-               CardType[cs->typ], cs->irq, cs->hw.spt.cfg_reg);
+       printk(KERN_INFO "HiSax: USR Sportster config irq:%d cfg:0x%X\n",
+               cs->irq, cs->hw.spt.cfg_reg);
        setup_isac(cs);
        cs->readisac = &ReadISAC;
        cs->writeisac = &WriteISAC;
index 0909662b745855de25ba95593fdbbc1afa51c5f5..b0ce4ae45cbf4bd9b15089534cb4c6a1fff4a5c2 100644 (file)
@@ -16,8 +16,6 @@
 #include "hfc_2bs0.h"
 #include "isdnl1.h"
 
-extern const char *CardType[];
-
 static const char *TeleInt_revision = "$Revision: 1.16.2.5 $";
 
 #define byteout(addr,val) outb(val,addr)
@@ -286,8 +284,7 @@ setup_TeleInt(struct IsdnCard *card)
        init_timer(&cs->hw.hfc.timer);
        if (!request_region(cs->hw.hfc.addr, 2, "TeleInt isdn")) {
                printk(KERN_WARNING
-                      "HiSax: %s config port %x-%x already in use\n",
-                      CardType[card->typ],
+                      "HiSax: TeleInt config port %x-%x already in use\n",
                       cs->hw.hfc.addr,
                       cs->hw.hfc.addr + 2);
                return (0);
index 4393003ae162b5d7a7bd83991c3d53909d0f894d..28b08de4673da9288ac8406c0e7d9976916805c1 100644 (file)
@@ -19,7 +19,6 @@
 #include "isdnl1.h"
 #include <linux/pci.h>
 
-extern const char *CardType[];
 static const char *telespci_revision = "$Revision: 2.23.2.3 $";
 
 #define ZORAN_PO_RQ_PEN        0x02000000
@@ -329,8 +328,8 @@ setup_telespci(struct IsdnCard *card)
        /* writel(0x00800000, cs->hw.teles0.membase + 0x200); */
 
        printk(KERN_INFO
-              "HiSax: %s config irq:%d mem:%p\n",
-              CardType[cs->typ], cs->irq,
+              "HiSax: Teles PCI config irq:%d mem:%p\n",
+              cs->irq,
               cs->hw.teles0.membase);
 
        setup_isac(cs);
index 39129b94f8be503340686e7122584dfa8a14021a..bb1c8dd1a230463910283ad6b5017f94769138f8 100644 (file)
@@ -38,8 +38,6 @@ static const PCI_ENTRY id_list[] =
 #define W6692_DYNALINK 1
 #define W6692_USR      2
 
-extern const char *CardType[];
-
 static const char *w6692_revision = "$Revision: 1.18.2.4 $";
 
 #define DBUSY_TIMER_VALUE 80
index 859814f62cb07e5f1e14ea71c012a70560e988e9..a3a6199639f986dff5d21bb2742c3ad6277f8614 100644 (file)
@@ -46,13 +46,6 @@ config LEDS_SPITZ
          This option enables support for the LEDs on Sharp Zaurus
          SL-Cxx00 series (C1000, C3000, C3100).
 
-config LEDS_TOSA
-       tristate "LED Support for the Sharp SL-6000 series"
-       depends on LEDS_CLASS && PXA_SHARPSL
-       help
-         This option enables support for the LEDs on Sharp Zaurus
-         SL-6000 series.
-
 config LEDS_S3C24XX
        tristate "LED Support for Samsung S3C24XX GPIO LEDs"
        depends on LEDS_CLASS && ARCH_S3C2410
index 84ced3b1a13d0d85b9082255e38bc7b75d2426fe..e54f42da21a225e3f4e689952d7f25280e0340fc 100644 (file)
@@ -9,7 +9,6 @@ obj-$(CONFIG_LEDS_ATMEL_PWM)            += leds-atmel-pwm.o
 obj-$(CONFIG_LEDS_CORGI)               += leds-corgi.o
 obj-$(CONFIG_LEDS_LOCOMO)              += leds-locomo.o
 obj-$(CONFIG_LEDS_SPITZ)               += leds-spitz.o
-obj-$(CONFIG_LEDS_TOSA)                        += leds-tosa.o
 obj-$(CONFIG_LEDS_S3C24XX)             += leds-s3c24xx.o
 obj-$(CONFIG_LEDS_AMS_DELTA)           += leds-ams-delta.o
 obj-$(CONFIG_LEDS_NET48XX)             += leds-net48xx.o
index 4a938780dfc380e187b058afcd4da96be6cdf3f8..63aad90247c49483554c6af4d59cd6b57b1669f2 100644 (file)
@@ -139,12 +139,10 @@ EXPORT_SYMBOL_GPL(led_classdev_register);
 /**
  * __led_classdev_unregister - unregisters a object of led_properties class.
  * @led_cdev: the led device to unregister
- * @suspended: indicates whether system-wide suspend or resume is in progress
  *
  * Unregisters a previously registered via led_classdev_register object.
  */
-void __led_classdev_unregister(struct led_classdev *led_cdev,
-                                     bool suspended)
+void led_classdev_unregister(struct led_classdev *led_cdev)
 {
        device_remove_file(led_cdev->dev, &dev_attr_brightness);
 #ifdef CONFIG_LEDS_TRIGGERS
@@ -155,16 +153,13 @@ void __led_classdev_unregister(struct led_classdev *led_cdev,
        up_write(&led_cdev->trigger_lock);
 #endif
 
-       if (suspended)
-               device_pm_schedule_removal(led_cdev->dev);
-       else
-               device_unregister(led_cdev->dev);
+       device_unregister(led_cdev->dev);
 
        down_write(&leds_list_lock);
        list_del(&led_cdev->node);
        up_write(&leds_list_lock);
 }
-EXPORT_SYMBOL_GPL(__led_classdev_unregister);
+EXPORT_SYMBOL_GPL(led_classdev_unregister);
 
 static int __init leds_init(void)
 {
diff --git a/drivers/leds/leds-tosa.c b/drivers/leds/leds-tosa.c
deleted file mode 100644 (file)
index 7ebecc4..0000000
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
- * LED Triggers Core
- *
- * Copyright 2005 Dirk Opfer
- *
- * Author: Dirk Opfer <Dirk@Opfer-Online.de>
- *     based on spitz.c
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- */
-
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/platform_device.h>
-#include <linux/leds.h>
-#include <asm/hardware/scoop.h>
-#include <asm/mach-types.h>
-#include <asm/arch/hardware.h>
-#include <asm/arch/pxa-regs.h>
-#include <asm/arch/tosa.h>
-
-static void tosaled_amber_set(struct led_classdev *led_cdev,
-                               enum led_brightness value)
-{
-       if (value)
-               set_scoop_gpio(&tosascoop_jc_device.dev,
-                               TOSA_SCOOP_JC_CHRG_ERR_LED);
-       else
-               reset_scoop_gpio(&tosascoop_jc_device.dev,
-                               TOSA_SCOOP_JC_CHRG_ERR_LED);
-}
-
-static void tosaled_green_set(struct led_classdev *led_cdev,
-                               enum led_brightness value)
-{
-       if (value)
-               set_scoop_gpio(&tosascoop_jc_device.dev,
-                               TOSA_SCOOP_JC_NOTE_LED);
-       else
-               reset_scoop_gpio(&tosascoop_jc_device.dev,
-                               TOSA_SCOOP_JC_NOTE_LED);
-}
-
-static struct led_classdev tosa_amber_led = {
-       .name                   = "tosa:amber:charge",
-       .default_trigger        = "sharpsl-charge",
-       .brightness_set         = tosaled_amber_set,
-};
-
-static struct led_classdev tosa_green_led = {
-       .name                   = "tosa:green:mail",
-       .default_trigger        = "nand-disk",
-       .brightness_set         = tosaled_green_set,
-};
-
-#ifdef CONFIG_PM
-static int tosaled_suspend(struct platform_device *dev, pm_message_t state)
-{
-#ifdef CONFIG_LEDS_TRIGGERS
-       if (tosa_amber_led.trigger && strcmp(tosa_amber_led.trigger->name,
-                                               "sharpsl-charge"))
-#endif
-               led_classdev_suspend(&tosa_amber_led);
-       led_classdev_suspend(&tosa_green_led);
-       return 0;
-}
-
-static int tosaled_resume(struct platform_device *dev)
-{
-       led_classdev_resume(&tosa_amber_led);
-       led_classdev_resume(&tosa_green_led);
-       return 0;
-}
-#else
-#define tosaled_suspend NULL
-#define tosaled_resume NULL
-#endif
-
-static int tosaled_probe(struct platform_device *pdev)
-{
-       int ret;
-
-       ret = led_classdev_register(&pdev->dev, &tosa_amber_led);
-       if (ret < 0)
-               return ret;
-
-       ret = led_classdev_register(&pdev->dev, &tosa_green_led);
-       if (ret < 0)
-               led_classdev_unregister(&tosa_amber_led);
-
-       return ret;
-}
-
-static int tosaled_remove(struct platform_device *pdev)
-{
-       led_classdev_unregister(&tosa_amber_led);
-       led_classdev_unregister(&tosa_green_led);
-
-       return 0;
-}
-
-static struct platform_driver tosaled_driver = {
-       .probe          = tosaled_probe,
-       .remove         = tosaled_remove,
-       .suspend        = tosaled_suspend,
-       .resume         = tosaled_resume,
-       .driver         = {
-               .name           = "tosa-led",
-               .owner          = THIS_MODULE,
-       },
-};
-
-static int __init tosaled_init(void)
-{
-       return platform_driver_register(&tosaled_driver);
-}
-
-static void __exit tosaled_exit(void)
-{
-       platform_driver_unregister(&tosaled_driver);
-}
-
-module_init(tosaled_init);
-module_exit(tosaled_exit);
-
-MODULE_AUTHOR("Dirk Opfer <Dirk@Opfer-Online.de>");
-MODULE_DESCRIPTION("Tosa LED driver");
-MODULE_LICENSE("GPL");
-MODULE_ALIAS("platform:tosa-led");
index 2337e1a06f023ffd226c3ad9748ca3104c41d9e4..005bd045d2ebca47a61a5633bfa171fe9df29896 100644 (file)
@@ -10,7 +10,6 @@
 #include <linux/wait.h>
 #include <linux/hrtimer.h>
 #include <linux/err.h>
-#include <asm/semaphore.h>
 
 #include <asm/lguest.h>
 
index 28958101061f9a922cf4c79f7cd41c8ec3472e45..20978205cd02e2033e789eee8952495b982f6b33 100644 (file)
@@ -37,9 +37,9 @@
 #include <linux/device.h>
 #include <linux/kthread.h>
 #include <linux/platform_device.h>
+#include <linux/semaphore.h>
 
 #include <asm/uaccess.h>
-#include <asm/semaphore.h>
 #ifdef CONFIG_PPC
 #include <asm/prom.h>
 #include <asm/machdep.h>
index f449d775cdf490a4092f08294ca2a3c222e15796..797918d0e59cb5888c8b5852f9f6e863ed7a3f1e 100644 (file)
@@ -13,7 +13,7 @@
 #include <linux/init.h>
 #include <linux/wait.h>
 #include <linux/i2c.h>
-#include <asm/semaphore.h>
+#include <linux/semaphore.h>
 #include <asm/prom.h>
 #include <asm/smu.h>
 #include <asm/pmac_low_i2c.h>
index f0a67e93d7fd0765a38baece496b3eadc18b2b3a..c69bde39a2336c8ae623001bc7465139abc4f693 100644 (file)
@@ -36,7 +36,6 @@
 #include <asm/uaccess.h>       /* copy to/from user            */
 #include <linux/videodev2.h>   /* kernel radio structs         */
 #include <media/v4l2-common.h>
-#include <asm/semaphore.h>     /* Lock for the I/O             */
 
 #include <linux/version.h>     /* for KERNEL_VERSION MACRO     */
 #define RADIO_VERSION KERNEL_VERSION(0,0,2)
index 9851987b95fbed200c94fa0207817271f3e728d0..dabafdf71e609ca2860b55ac449d3989154f8bd3 100644 (file)
@@ -40,7 +40,6 @@
 #include <linux/i2c.h>
 #include <linux/i2c-id.h>
 #include <linux/workqueue.h>
-#include <asm/semaphore.h>
 
 #include <media/ir-common.h>
 #include <media/ir-kbd-i2c.h>
index d55d5800efb463cb19de27ac6ecd670bbfd6152f..6590058e8ff00ee8ce4acf1028538e2e3e79572b 100644 (file)
@@ -41,7 +41,6 @@
 #include <linux/slab.h>
 #include <linux/ctype.h>
 #include <linux/pagemap.h>
-#include <asm/semaphore.h>
 #include <asm/processor.h>
 #include <linux/mm.h>
 #include <linux/device.h>
index 9d94aed2e12dcacb2f66cbf339db899fbd1ba18d..160437b21e6d3457490f2bd30dc9fdeed82d01b7 100644 (file)
@@ -26,7 +26,6 @@
 #include <linux/errno.h>
 #include <linux/string.h>
 #include <linux/slab.h>
-#include <asm/semaphore.h>
 
 
 static void pvr2_context_destroy(struct pvr2_context *mp)
index d6955fa39598bdce1b5be999e247a5179248db43..2404053a4d8585b5eda3f4822d9ad816e3c3f90a 100644 (file)
@@ -25,7 +25,6 @@
 #include <linux/firmware.h>
 #include <linux/videodev2.h>
 #include <media/v4l2-common.h>
-#include <asm/semaphore.h>
 #include "pvrusb2.h"
 #include "pvrusb2-std.h"
 #include "pvrusb2-util.h"
index 7a1cd878e31a70f8423bbdf6810914fa2ec3192c..07f4eae184330a6a91796a3d53e07e24a7c3204a 100644 (file)
@@ -21,7 +21,6 @@
 
 #include <linux/string.h>
 #include <linux/slab.h>
-#include <asm/semaphore.h>
 #include "pvrusb2-sysfs.h"
 #include "pvrusb2-hdw.h"
 #include "pvrusb2-debug.h"
index 946e3d3506ac98d3dc6ad34df75201c14bfc8245..61b98c333cb0fafcd9dad77f00e7285f2ca1b17a 100644 (file)
@@ -177,16 +177,16 @@ static struct bus_type memstick_bus_type = {
        .resume         = memstick_device_resume
 };
 
-static void memstick_free(struct class_device *cdev)
+static void memstick_free(struct device *dev)
 {
-       struct memstick_host *host = container_of(cdev, struct memstick_host,
-                                                 cdev);
+       struct memstick_host *host = container_of(dev, struct memstick_host,
+                                                 dev);
        kfree(host);
 }
 
 static struct class memstick_host_class = {
        .name       = "memstick_host",
-       .release    = memstick_free
+       .dev_release = memstick_free
 };
 
 static void memstick_free_card(struct device *dev)
@@ -383,8 +383,8 @@ static struct memstick_dev *memstick_alloc_card(struct memstick_host *host)
        if (card) {
                card->host = host;
                snprintf(card->dev.bus_id, sizeof(card->dev.bus_id),
-                        "%s", host->cdev.class_id);
-               card->dev.parent = host->cdev.dev;
+                        "%s", host->dev.bus_id);
+               card->dev.parent = &host->dev;
                card->dev.bus = &memstick_bus_type;
                card->dev.release = memstick_free_card;
                card->check = memstick_dummy_check;
@@ -427,7 +427,7 @@ static void memstick_check(struct work_struct *work)
                                                  media_checker);
        struct memstick_dev *card;
 
-       dev_dbg(host->cdev.dev, "memstick_check started\n");
+       dev_dbg(&host->dev, "memstick_check started\n");
        mutex_lock(&host->lock);
        if (!host->card)
                memstick_power_on(host);
@@ -440,7 +440,7 @@ static void memstick_check(struct work_struct *work)
                        host->card = NULL;
                }
        } else {
-               dev_dbg(host->cdev.dev, "new card %02x, %02x, %02x\n",
+               dev_dbg(&host->dev, "new card %02x, %02x, %02x\n",
                        card->id.type, card->id.category, card->id.class);
                if (host->card) {
                        if (memstick_set_rw_addr(host->card)
@@ -465,7 +465,7 @@ static void memstick_check(struct work_struct *work)
                host->set_param(host, MEMSTICK_POWER, MEMSTICK_POWER_OFF);
 
        mutex_unlock(&host->lock);
-       dev_dbg(host->cdev.dev, "memstick_check finished\n");
+       dev_dbg(&host->dev, "memstick_check finished\n");
 }
 
 /**
@@ -482,9 +482,9 @@ struct memstick_host *memstick_alloc_host(unsigned int extra,
        if (host) {
                mutex_init(&host->lock);
                INIT_WORK(&host->media_checker, memstick_check);
-               host->cdev.class = &memstick_host_class;
-               host->cdev.dev = dev;
-               class_device_initialize(&host->cdev);
+               host->dev.class = &memstick_host_class;
+               host->dev.parent = dev;
+               device_initialize(&host->dev);
        }
        return host;
 }
@@ -507,10 +507,9 @@ int memstick_add_host(struct memstick_host *host)
        if (rc)
                return rc;
 
-       snprintf(host->cdev.class_id, BUS_ID_SIZE,
-                "memstick%u", host->id);
+       snprintf(host->dev.bus_id, BUS_ID_SIZE, "memstick%u", host->id);
 
-       rc = class_device_add(&host->cdev);
+       rc = device_add(&host->dev);
        if (rc) {
                spin_lock(&memstick_host_lock);
                idr_remove(&memstick_host_idr, host->id);
@@ -541,7 +540,7 @@ void memstick_remove_host(struct memstick_host *host)
        spin_lock(&memstick_host_lock);
        idr_remove(&memstick_host_idr, host->id);
        spin_unlock(&memstick_host_lock);
-       class_device_del(&host->cdev);
+       device_del(&host->dev);
 }
 EXPORT_SYMBOL(memstick_remove_host);
 
@@ -552,7 +551,7 @@ EXPORT_SYMBOL(memstick_remove_host);
 void memstick_free_host(struct memstick_host *host)
 {
        mutex_destroy(&host->lock);
-       class_device_put(&host->cdev);
+       put_device(&host->dev);
 }
 EXPORT_SYMBOL(memstick_free_host);
 
index 557dbbba5cb211c82280a8779f058be9f5a91ca3..477d0fb6e5883dafcaca0d273e79893c10c4173f 100644 (file)
@@ -1127,8 +1127,8 @@ static int mspro_block_init_disk(struct memstick_dev *card)
        u64 limit = BLK_BOUNCE_HIGH;
        unsigned long capacity;
 
-       if (host->cdev.dev->dma_mask && *(host->cdev.dev->dma_mask))
-               limit = *(host->cdev.dev->dma_mask);
+       if (host->dev.dma_mask && *(host->dev.dma_mask))
+               limit = *(host->dev.dma_mask);
 
        for (rc = 0; msb->attr_group.attrs[rc]; ++rc) {
                s_attr = mspro_from_sysfs_attr(msb->attr_group.attrs[rc]);
index 8770a5fac3b629455e9cb9ff84875e44f6e6769b..a054668eda16c93e2ad2389402c94a8b358bae27 100644 (file)
@@ -361,15 +361,15 @@ static int jmb38x_ms_issue_cmd(struct memstick_host *msh)
        unsigned int data_len, cmd, t_val;
 
        if (!(STATUS_HAS_MEDIA & readl(host->addr + STATUS))) {
-               dev_dbg(msh->cdev.dev, "no media status\n");
+               dev_dbg(&msh->dev, "no media status\n");
                host->req->error = -ETIME;
                return host->req->error;
        }
 
-       dev_dbg(msh->cdev.dev, "control %08x\n",
+       dev_dbg(&msh->dev, "control %08x\n",
                readl(host->addr + HOST_CONTROL));
-       dev_dbg(msh->cdev.dev, "status %08x\n", readl(host->addr + INT_STATUS));
-       dev_dbg(msh->cdev.dev, "hstatus %08x\n", readl(host->addr + STATUS));
+       dev_dbg(&msh->dev, "status %08x\n", readl(host->addr + INT_STATUS));
+       dev_dbg(&msh->dev, "hstatus %08x\n", readl(host->addr + STATUS));
 
        host->cmd_flags = 0;
        host->block_pos = 0;
@@ -448,7 +448,7 @@ static int jmb38x_ms_issue_cmd(struct memstick_host *msh)
        host->req->error = 0;
 
        writel(cmd, host->addr + TPC);
-       dev_dbg(msh->cdev.dev, "executing TPC %08x, len %x\n", cmd, data_len);
+       dev_dbg(&msh->dev, "executing TPC %08x, len %x\n", cmd, data_len);
 
        return 0;
 }
@@ -461,11 +461,11 @@ static void jmb38x_ms_complete_cmd(struct memstick_host *msh, int last)
 
        del_timer(&host->timer);
 
-       dev_dbg(msh->cdev.dev, "c control %08x\n",
+       dev_dbg(&msh->dev, "c control %08x\n",
                readl(host->addr + HOST_CONTROL));
-       dev_dbg(msh->cdev.dev, "c status %08x\n",
+       dev_dbg(&msh->dev, "c status %08x\n",
                readl(host->addr + INT_STATUS));
-       dev_dbg(msh->cdev.dev, "c hstatus %08x\n", readl(host->addr + STATUS));
+       dev_dbg(&msh->dev, "c hstatus %08x\n", readl(host->addr + STATUS));
 
        host->req->int_reg = readl(host->addr + STATUS) & 0xff;
 
index 89c63147a15dcb734c429695c31bfd0240fb3dbc..b109bd8a4d199b76a08270b14158d658ba217781 100644 (file)
@@ -3300,9 +3300,10 @@ mptscsih_synchronize_cache(MPT_SCSI_HOST *hd, VirtDevice *vdevice)
 }
 
 static ssize_t
-mptscsih_version_fw_show(struct class_device *cdev, char *buf)
+mptscsih_version_fw_show(struct device *dev, struct device_attribute *attr,
+                        char *buf)
 {
-       struct Scsi_Host *host = class_to_shost(cdev);
+       struct Scsi_Host *host = class_to_shost(dev);
        MPT_SCSI_HOST   *hd = shost_priv(host);
        MPT_ADAPTER *ioc = hd->ioc;
 
@@ -3312,12 +3313,13 @@ mptscsih_version_fw_show(struct class_device *cdev, char *buf)
            (ioc->facts.FWVersion.Word & 0x0000FF00) >> 8,
            ioc->facts.FWVersion.Word & 0x000000FF);
 }
-static CLASS_DEVICE_ATTR(version_fw, S_IRUGO, mptscsih_version_fw_show, NULL);
+static DEVICE_ATTR(version_fw, S_IRUGO, mptscsih_version_fw_show, NULL);
 
 static ssize_t
-mptscsih_version_bios_show(struct class_device *cdev, char *buf)
+mptscsih_version_bios_show(struct device *dev, struct device_attribute *attr,
+                          char *buf)
 {
-       struct Scsi_Host *host = class_to_shost(cdev);
+       struct Scsi_Host *host = class_to_shost(dev);
        MPT_SCSI_HOST   *hd = shost_priv(host);
        MPT_ADAPTER *ioc = hd->ioc;
 
@@ -3327,129 +3329,141 @@ mptscsih_version_bios_show(struct class_device *cdev, char *buf)
            (ioc->biosVersion & 0x0000FF00) >> 8,
            ioc->biosVersion & 0x000000FF);
 }
-static CLASS_DEVICE_ATTR(version_bios, S_IRUGO, mptscsih_version_bios_show, NULL);
+static DEVICE_ATTR(version_bios, S_IRUGO, mptscsih_version_bios_show, NULL);
 
 static ssize_t
-mptscsih_version_mpi_show(struct class_device *cdev, char *buf)
+mptscsih_version_mpi_show(struct device *dev, struct device_attribute *attr,
+                         char *buf)
 {
-       struct Scsi_Host *host = class_to_shost(cdev);
+       struct Scsi_Host *host = class_to_shost(dev);
        MPT_SCSI_HOST   *hd = shost_priv(host);
        MPT_ADAPTER *ioc = hd->ioc;
 
        return snprintf(buf, PAGE_SIZE, "%03x\n", ioc->facts.MsgVersion);
 }
-static CLASS_DEVICE_ATTR(version_mpi, S_IRUGO, mptscsih_version_mpi_show, NULL);
+static DEVICE_ATTR(version_mpi, S_IRUGO, mptscsih_version_mpi_show, NULL);
 
 static ssize_t
-mptscsih_version_product_show(struct class_device *cdev, char *buf)
+mptscsih_version_product_show(struct device *dev,
+                             struct device_attribute *attr,
+char *buf)
 {
-       struct Scsi_Host *host = class_to_shost(cdev);
+       struct Scsi_Host *host = class_to_shost(dev);
        MPT_SCSI_HOST   *hd = shost_priv(host);
        MPT_ADAPTER *ioc = hd->ioc;
 
        return snprintf(buf, PAGE_SIZE, "%s\n", ioc->prod_name);
 }
-static CLASS_DEVICE_ATTR(version_product, S_IRUGO,
+static DEVICE_ATTR(version_product, S_IRUGO,
     mptscsih_version_product_show, NULL);
 
 static ssize_t
-mptscsih_version_nvdata_persistent_show(struct class_device *cdev, char *buf)
+mptscsih_version_nvdata_persistent_show(struct device *dev,
+                                       struct device_attribute *attr,
+                                       char *buf)
 {
-       struct Scsi_Host *host = class_to_shost(cdev);
+       struct Scsi_Host *host = class_to_shost(dev);
        MPT_SCSI_HOST   *hd = shost_priv(host);
        MPT_ADAPTER *ioc = hd->ioc;
 
        return snprintf(buf, PAGE_SIZE, "%02xh\n",
            ioc->nvdata_version_persistent);
 }
-static CLASS_DEVICE_ATTR(version_nvdata_persistent, S_IRUGO,
+static DEVICE_ATTR(version_nvdata_persistent, S_IRUGO,
     mptscsih_version_nvdata_persistent_show, NULL);
 
 static ssize_t
-mptscsih_version_nvdata_default_show(struct class_device *cdev, char *buf)
+mptscsih_version_nvdata_default_show(struct device *dev,
+                                    struct device_attribute *attr, char *buf)
 {
-       struct Scsi_Host *host = class_to_shost(cdev);
+       struct Scsi_Host *host = class_to_shost(dev);
        MPT_SCSI_HOST   *hd = shost_priv(host);
        MPT_ADAPTER *ioc = hd->ioc;
 
        return snprintf(buf, PAGE_SIZE, "%02xh\n",ioc->nvdata_version_default);
 }
-static CLASS_DEVICE_ATTR(version_nvdata_default, S_IRUGO,
+static DEVICE_ATTR(version_nvdata_default, S_IRUGO,
     mptscsih_version_nvdata_default_show, NULL);
 
 static ssize_t
-mptscsih_board_name_show(struct class_device *cdev, char *buf)
+mptscsih_board_name_show(struct device *dev, struct device_attribute *attr,
+                        char *buf)
 {
-       struct Scsi_Host *host = class_to_shost(cdev);
+       struct Scsi_Host *host = class_to_shost(dev);
        MPT_SCSI_HOST   *hd = shost_priv(host);
        MPT_ADAPTER *ioc = hd->ioc;
 
        return snprintf(buf, PAGE_SIZE, "%s\n", ioc->board_name);
 }
-static CLASS_DEVICE_ATTR(board_name, S_IRUGO, mptscsih_board_name_show, NULL);
+static DEVICE_ATTR(board_name, S_IRUGO, mptscsih_board_name_show, NULL);
 
 static ssize_t
-mptscsih_board_assembly_show(struct class_device *cdev, char *buf)
+mptscsih_board_assembly_show(struct device *dev,
+                            struct device_attribute *attr, char *buf)
 {
-       struct Scsi_Host *host = class_to_shost(cdev);
+       struct Scsi_Host *host = class_to_shost(dev);
        MPT_SCSI_HOST   *hd = shost_priv(host);
        MPT_ADAPTER *ioc = hd->ioc;
 
        return snprintf(buf, PAGE_SIZE, "%s\n", ioc->board_assembly);
 }
-static CLASS_DEVICE_ATTR(board_assembly, S_IRUGO,
+static DEVICE_ATTR(board_assembly, S_IRUGO,
     mptscsih_board_assembly_show, NULL);
 
 static ssize_t
-mptscsih_board_tracer_show(struct class_device *cdev, char *buf)
+mptscsih_board_tracer_show(struct device *dev, struct device_attribute *attr,
+                          char *buf)
 {
-       struct Scsi_Host *host = class_to_shost(cdev);
+       struct Scsi_Host *host = class_to_shost(dev);
        MPT_SCSI_HOST   *hd = shost_priv(host);
        MPT_ADAPTER *ioc = hd->ioc;
 
        return snprintf(buf, PAGE_SIZE, "%s\n", ioc->board_tracer);
 }
-static CLASS_DEVICE_ATTR(board_tracer, S_IRUGO,
+static DEVICE_ATTR(board_tracer, S_IRUGO,
     mptscsih_board_tracer_show, NULL);
 
 static ssize_t
-mptscsih_io_delay_show(struct class_device *cdev, char *buf)
+mptscsih_io_delay_show(struct device *dev, struct device_attribute *attr,
+                      char *buf)
 {
-       struct Scsi_Host *host = class_to_shost(cdev);
+       struct Scsi_Host *host = class_to_shost(dev);
        MPT_SCSI_HOST   *hd = shost_priv(host);
        MPT_ADAPTER *ioc = hd->ioc;
 
        return snprintf(buf, PAGE_SIZE, "%02d\n", ioc->io_missing_delay);
 }
-static CLASS_DEVICE_ATTR(io_delay, S_IRUGO,
+static DEVICE_ATTR(io_delay, S_IRUGO,
     mptscsih_io_delay_show, NULL);
 
 static ssize_t
-mptscsih_device_delay_show(struct class_device *cdev, char *buf)
+mptscsih_device_delay_show(struct device *dev, struct device_attribute *attr,
+                          char *buf)
 {
-       struct Scsi_Host *host = class_to_shost(cdev);
+       struct Scsi_Host *host = class_to_shost(dev);
        MPT_SCSI_HOST   *hd = shost_priv(host);
        MPT_ADAPTER *ioc = hd->ioc;
 
        return snprintf(buf, PAGE_SIZE, "%02d\n", ioc->device_missing_delay);
 }
-static CLASS_DEVICE_ATTR(device_delay, S_IRUGO,
+static DEVICE_ATTR(device_delay, S_IRUGO,
     mptscsih_device_delay_show, NULL);
 
 static ssize_t
-mptscsih_debug_level_show(struct class_device *cdev, char *buf)
+mptscsih_debug_level_show(struct device *dev, struct device_attribute *attr,
+                         char *buf)
 {
-       struct Scsi_Host *host = class_to_shost(cdev);
+       struct Scsi_Host *host = class_to_shost(dev);
        MPT_SCSI_HOST   *hd = shost_priv(host);
        MPT_ADAPTER *ioc = hd->ioc;
 
        return snprintf(buf, PAGE_SIZE, "%08xh\n", ioc->debug_level);
 }
 static ssize_t
-mptscsih_debug_level_store(struct class_device *cdev, const char *buf,
-                                                               size_t count)
+mptscsih_debug_level_store(struct device *dev, struct device_attribute *attr,
+                          const char *buf, size_t count)
 {
-       struct Scsi_Host *host = class_to_shost(cdev);
+       struct Scsi_Host *host = class_to_shost(dev);
        MPT_SCSI_HOST   *hd = shost_priv(host);
        MPT_ADAPTER *ioc = hd->ioc;
        int val = 0;
@@ -3462,22 +3476,22 @@ mptscsih_debug_level_store(struct class_device *cdev, const char *buf,
                                ioc->name, ioc->debug_level);
        return strlen(buf);
 }
-static CLASS_DEVICE_ATTR(debug_level, S_IRUGO | S_IWUSR,
-    mptscsih_debug_level_show, mptscsih_debug_level_store);
-
-struct class_device_attribute *mptscsih_host_attrs[] = {
-       &class_device_attr_version_fw,
-       &class_device_attr_version_bios,
-       &class_device_attr_version_mpi,
-       &class_device_attr_version_product,
-       &class_device_attr_version_nvdata_persistent,
-       &class_device_attr_version_nvdata_default,
-       &class_device_attr_board_name,
-       &class_device_attr_board_assembly,
-       &class_device_attr_board_tracer,
-       &class_device_attr_io_delay,
-       &class_device_attr_device_delay,
-       &class_device_attr_debug_level,
+static DEVICE_ATTR(debug_level, S_IRUGO | S_IWUSR,
+       mptscsih_debug_level_show, mptscsih_debug_level_store);
+
+struct device_attribute *mptscsih_host_attrs[] = {
+       &dev_attr_version_fw,
+       &dev_attr_version_bios,
+       &dev_attr_version_mpi,
+       &dev_attr_version_product,
+       &dev_attr_version_nvdata_persistent,
+       &dev_attr_version_nvdata_default,
+       &dev_attr_board_name,
+       &dev_attr_board_assembly,
+       &dev_attr_board_tracer,
+       &dev_attr_io_delay,
+       &dev_attr_device_delay,
+       &dev_attr_debug_level,
        NULL,
 };
 EXPORT_SYMBOL(mptscsih_host_attrs);
index d289e97cfe8b2b781734454fee76ee8426ac3050..7ea7da0e090c7e86556faef3b119c3ce2d2e5fe5 100644 (file)
@@ -129,4 +129,4 @@ extern void mptscsih_timer_expired(unsigned long data);
 extern int mptscsih_TMHandler(MPT_SCSI_HOST *hd, u8 type, u8 channel, u8 id, int lun, int ctx2abort, ulong timeout);
 extern u8 mptscsih_raid_id_to_num(MPT_ADAPTER *ioc, u8 channel, u8 id);
 extern int mptscsih_is_phys_disk(MPT_ADAPTER *ioc, u8 channel, u8 id);
-extern struct class_device_attribute *mptscsih_host_attrs[];
+extern struct device_attribute *mptscsih_host_attrs[];
index 0c886c8823854b5411af4c9a6f1aaf222f5d11e4..2566479937c9e7ce224643069c6e13fbb10768c3 100644 (file)
@@ -22,6 +22,22 @@ config MFD_ASIC3
          This driver supports the ASIC3 multifunction chip found on many
          PDAs (mainly iPAQ and HTC based ones)
 
+config HTC_EGPIO
+       bool "HTC EGPIO support"
+       depends on GENERIC_HARDIRQS && HAVE_GPIO_LIB
+       help
+           This driver supports the CPLD egpio chip present on
+           several HTC phones.  It provides basic support for input
+           pins, output pins, and irqs.
+
+config HTC_PASIC3
+       tristate "HTC PASIC3 LED/DS1WM chip support"
+       help
+         This core driver provides register access for the LED/DS1WM
+         chips labeled "AIC2" and "AIC3", found on HTC Blueangel and
+         HTC Magician devices, respectively. Actual functionality is
+         handled by the leds-pasic3 and ds1wm drivers.
+
 endmenu
 
 menu "Multimedia Capabilities Port drivers"
index 521cd5cb68af3fc8a5692270f27f8f1e866f974d..eef4e26807dfc38d37f62154f6fdf6aa6c407f80 100644 (file)
@@ -5,6 +5,9 @@
 obj-$(CONFIG_MFD_SM501)                += sm501.o
 obj-$(CONFIG_MFD_ASIC3)                += asic3.o
 
+obj-$(CONFIG_HTC_EGPIO)                += htc-egpio.o
+obj-$(CONFIG_HTC_PASIC3)       += htc-pasic3.o
+
 obj-$(CONFIG_MCP)              += mcp-core.o
 obj-$(CONFIG_MCP_SA11X0)       += mcp-sa11x0.o
 obj-$(CONFIG_MCP_UCB1200)      += ucb1x00-core.o
diff --git a/drivers/mfd/htc-egpio.c b/drivers/mfd/htc-egpio.c
new file mode 100644 (file)
index 0000000..8872cc0
--- /dev/null
@@ -0,0 +1,440 @@
+/*
+ * Support for the GPIO/IRQ expander chips present on several HTC phones.
+ * These are implemented in CPLD chips present on the board.
+ *
+ * Copyright (c) 2007 Kevin O'Connor <kevin@koconnor.net>
+ * Copyright (c) 2007 Philipp Zabel <philipp.zabel@gmail.com>
+ *
+ * This file may be distributed under the terms of the GNU GPL license.
+ */
+
+#include <linux/kernel.h>
+#include <linux/errno.h>
+#include <linux/interrupt.h>
+#include <linux/irq.h>
+#include <linux/io.h>
+#include <linux/spinlock.h>
+#include <linux/platform_device.h>
+#include <linux/module.h>
+#include <linux/mfd/htc-egpio.h>
+
+struct egpio_chip {
+       int              reg_start;
+       int              cached_values;
+       unsigned long    is_out;
+       struct device    *dev;
+       struct gpio_chip chip;
+};
+
+struct egpio_info {
+       spinlock_t        lock;
+
+       /* iomem info */
+       void __iomem      *base_addr;
+       int               bus_shift;    /* byte shift */
+       int               reg_shift;    /* bit shift */
+       int               reg_mask;
+
+       /* irq info */
+       int               ack_register;
+       int               ack_write;
+       u16               irqs_enabled;
+       uint              irq_start;
+       int               nirqs;
+       uint              chained_irq;
+
+       /* egpio info */
+       struct egpio_chip *chip;
+       int               nchips;
+};
+
+static inline void egpio_writew(u16 value, struct egpio_info *ei, int reg)
+{
+       writew(value, ei->base_addr + (reg << ei->bus_shift));
+}
+
+static inline u16 egpio_readw(struct egpio_info *ei, int reg)
+{
+       return readw(ei->base_addr + (reg << ei->bus_shift));
+}
+
+/*
+ * IRQs
+ */
+
+static inline void ack_irqs(struct egpio_info *ei)
+{
+       egpio_writew(ei->ack_write, ei, ei->ack_register);
+       pr_debug("EGPIO ack - write %x to base+%x\n",
+                       ei->ack_write, ei->ack_register << ei->bus_shift);
+}
+
+static void egpio_ack(unsigned int irq)
+{
+}
+
+/* There does not appear to be a way to proactively mask interrupts
+ * on the egpio chip itself.  So, we simply ignore interrupts that
+ * aren't desired. */
+static void egpio_mask(unsigned int irq)
+{
+       struct egpio_info *ei = get_irq_chip_data(irq);
+       ei->irqs_enabled &= ~(1 << (irq - ei->irq_start));
+       pr_debug("EGPIO mask %d %04x\n", irq, ei->irqs_enabled);
+}
+static void egpio_unmask(unsigned int irq)
+{
+       struct egpio_info *ei = get_irq_chip_data(irq);
+       ei->irqs_enabled |= 1 << (irq - ei->irq_start);
+       pr_debug("EGPIO unmask %d %04x\n", irq, ei->irqs_enabled);
+}
+
+static struct irq_chip egpio_muxed_chip = {
+       .name   = "htc-egpio",
+       .ack    = egpio_ack,
+       .mask   = egpio_mask,
+       .unmask = egpio_unmask,
+};
+
+static void egpio_handler(unsigned int irq, struct irq_desc *desc)
+{
+       struct egpio_info *ei = get_irq_data(irq);
+       int irqpin;
+
+       /* Read current pins. */
+       unsigned long readval = egpio_readw(ei, ei->ack_register);
+       pr_debug("IRQ reg: %x\n", (unsigned int)readval);
+       /* Ack/unmask interrupts. */
+       ack_irqs(ei);
+       /* Process all set pins. */
+       readval &= ei->irqs_enabled;
+       for_each_bit(irqpin, &readval, ei->nirqs) {
+               /* Run irq handler */
+               pr_debug("got IRQ %d\n", irqpin);
+               irq = ei->irq_start + irqpin;
+               desc = &irq_desc[irq];
+               desc->handle_irq(irq, desc);
+       }
+}
+
+int htc_egpio_get_wakeup_irq(struct device *dev)
+{
+       struct egpio_info *ei = dev_get_drvdata(dev);
+
+       /* Read current pins. */
+       u16 readval = egpio_readw(ei, ei->ack_register);
+       /* Ack/unmask interrupts. */
+       ack_irqs(ei);
+       /* Return first set pin. */
+       readval &= ei->irqs_enabled;
+       return ei->irq_start + ffs(readval) - 1;
+}
+EXPORT_SYMBOL(htc_egpio_get_wakeup_irq);
+
+static inline int egpio_pos(struct egpio_info *ei, int bit)
+{
+       return bit >> ei->reg_shift;
+}
+
+static inline int egpio_bit(struct egpio_info *ei, int bit)
+{
+       return 1 << (bit & ((1 << ei->reg_shift)-1));
+}
+
+/*
+ * Input pins
+ */
+
+static int egpio_get(struct gpio_chip *chip, unsigned offset)
+{
+       struct egpio_chip *egpio;
+       struct egpio_info *ei;
+       unsigned           bit;
+       int                reg;
+       int                value;
+
+       pr_debug("egpio_get_value(%d)\n", chip->base + offset);
+
+       egpio = container_of(chip, struct egpio_chip, chip);
+       ei    = dev_get_drvdata(egpio->dev);
+       bit   = egpio_bit(ei, offset);
+       reg   = egpio->reg_start + egpio_pos(ei, offset);
+
+       value = egpio_readw(ei, reg);
+       pr_debug("readw(%p + %x) = %x\n",
+                       ei->base_addr, reg << ei->bus_shift, value);
+       return value & bit;
+}
+
+static int egpio_direction_input(struct gpio_chip *chip, unsigned offset)
+{
+       struct egpio_chip *egpio;
+
+       egpio = container_of(chip, struct egpio_chip, chip);
+       return test_bit(offset, &egpio->is_out) ? -EINVAL : 0;
+}
+
+
+/*
+ * Output pins
+ */
+
+static void egpio_set(struct gpio_chip *chip, unsigned offset, int value)
+{
+       unsigned long     flag;
+       struct egpio_chip *egpio;
+       struct egpio_info *ei;
+       unsigned          bit;
+       int               pos;
+       int               reg;
+       int               shift;
+
+       pr_debug("egpio_set(%s, %d(%d), %d)\n",
+                       chip->label, offset, offset+chip->base, value);
+
+       egpio = container_of(chip, struct egpio_chip, chip);
+       ei    = dev_get_drvdata(egpio->dev);
+       bit   = egpio_bit(ei, offset);
+       pos   = egpio_pos(ei, offset);
+       reg   = egpio->reg_start + pos;
+       shift = pos << ei->reg_shift;
+
+       pr_debug("egpio %s: reg %d = 0x%04x\n", value ? "set" : "clear",
+                       reg, (egpio->cached_values >> shift) & ei->reg_mask);
+
+       spin_lock_irqsave(&ei->lock, flag);
+       if (value)
+               egpio->cached_values |= (1 << offset);
+       else
+               egpio->cached_values &= ~(1 << offset);
+       egpio_writew((egpio->cached_values >> shift) & ei->reg_mask, ei, reg);
+       spin_unlock_irqrestore(&ei->lock, flag);
+}
+
+static int egpio_direction_output(struct gpio_chip *chip,
+                                       unsigned offset, int value)
+{
+       struct egpio_chip *egpio;
+
+       egpio = container_of(chip, struct egpio_chip, chip);
+       if (test_bit(offset, &egpio->is_out)) {
+               egpio_set(chip, offset, value);
+               return 0;
+       } else {
+               return -EINVAL;
+       }
+}
+
+static void egpio_write_cache(struct egpio_info *ei)
+{
+       int               i;
+       struct egpio_chip *egpio;
+       int               shift;
+
+       for (i = 0; i < ei->nchips; i++) {
+               egpio = &(ei->chip[i]);
+               if (!egpio->is_out)
+                       continue;
+
+               for (shift = 0; shift < egpio->chip.ngpio;
+                               shift += (1<<ei->reg_shift)) {
+
+                       int reg = egpio->reg_start + egpio_pos(ei, shift);
+
+                       if (!((egpio->is_out >> shift) & ei->reg_mask))
+                               continue;
+
+                       pr_debug("EGPIO: setting %x to %x, was %x\n", reg,
+                               (egpio->cached_values >> shift) & ei->reg_mask,
+                               egpio_readw(ei, reg));
+
+                       egpio_writew((egpio->cached_values >> shift)
+                                       & ei->reg_mask, ei, reg);
+               }
+       }
+}
+
+
+/*
+ * Setup
+ */
+
+static int __init egpio_probe(struct platform_device *pdev)
+{
+       struct htc_egpio_platform_data *pdata = pdev->dev.platform_data;
+       struct resource   *res;
+       struct egpio_info *ei;
+       struct gpio_chip  *chip;
+       unsigned int      irq, irq_end;
+       int               i;
+       int               ret;
+
+       /* Initialize ei data structure. */
+       ei = kzalloc(sizeof(*ei), GFP_KERNEL);
+       if (!ei)
+               return -ENOMEM;
+
+       spin_lock_init(&ei->lock);
+
+       /* Find chained irq */
+       ret = -EINVAL;
+       res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
+       if (res)
+               ei->chained_irq = res->start;
+
+       /* Map egpio chip into virtual address space. */
+       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+       if (!res)
+               goto fail;
+       ei->base_addr = ioremap_nocache(res->start, res->end - res->start);
+       if (!ei->base_addr)
+               goto fail;
+       pr_debug("EGPIO phys=%08x virt=%p\n", res->start, ei->base_addr);
+
+       if ((pdata->bus_width != 16) && (pdata->bus_width != 32))
+               goto fail;
+       ei->bus_shift = fls(pdata->bus_width - 1) - 3;
+       pr_debug("bus_shift = %d\n", ei->bus_shift);
+
+       if ((pdata->reg_width != 8) && (pdata->reg_width != 16))
+               goto fail;
+       ei->reg_shift = fls(pdata->reg_width - 1);
+       pr_debug("reg_shift = %d\n", ei->reg_shift);
+
+       ei->reg_mask = (1 << pdata->reg_width) - 1;
+
+       platform_set_drvdata(pdev, ei);
+
+       ei->nchips = pdata->num_chips;
+       ei->chip = kzalloc(sizeof(struct egpio_chip) * ei->nchips, GFP_KERNEL);
+       if (!ei) {
+               ret = -ENOMEM;
+               goto fail;
+       }
+       for (i = 0; i < ei->nchips; i++) {
+               ei->chip[i].reg_start = pdata->chip[i].reg_start;
+               ei->chip[i].cached_values = pdata->chip[i].initial_values;
+               ei->chip[i].is_out = pdata->chip[i].direction;
+               ei->chip[i].dev = &(pdev->dev);
+               chip = &(ei->chip[i].chip);
+               chip->label           = "htc-egpio";
+               chip->get             = egpio_get;
+               chip->set             = egpio_set;
+               chip->direction_input = egpio_direction_input;
+               chip->direction_output = egpio_direction_output;
+               chip->base            = pdata->chip[i].gpio_base;
+               chip->ngpio           = pdata->chip[i].num_gpios;
+
+               gpiochip_add(chip);
+       }
+
+       /* Set initial pin values */
+       egpio_write_cache(ei);
+
+       ei->irq_start = pdata->irq_base;
+       ei->nirqs = pdata->num_irqs;
+       ei->ack_register = pdata->ack_register;
+
+       if (ei->chained_irq) {
+               /* Setup irq handlers */
+               ei->ack_write = 0xFFFF;
+               if (pdata->invert_acks)
+                       ei->ack_write = 0;
+               irq_end = ei->irq_start + ei->nirqs;
+               for (irq = ei->irq_start; irq < irq_end; irq++) {
+                       set_irq_chip(irq, &egpio_muxed_chip);
+                       set_irq_chip_data(irq, ei);
+                       set_irq_handler(irq, handle_simple_irq);
+                       set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
+               }
+               set_irq_type(ei->chained_irq, IRQ_TYPE_EDGE_RISING);
+               set_irq_data(ei->chained_irq, ei);
+               set_irq_chained_handler(ei->chained_irq, egpio_handler);
+               ack_irqs(ei);
+
+               device_init_wakeup(&pdev->dev, 1);
+       }
+
+       return 0;
+
+fail:
+       printk(KERN_ERR "EGPIO failed to setup\n");
+       kfree(ei);
+       return ret;
+}
+
+static int __exit egpio_remove(struct platform_device *pdev)
+{
+       struct egpio_info *ei = platform_get_drvdata(pdev);
+       unsigned int      irq, irq_end;
+
+       if (ei->chained_irq) {
+               irq_end = ei->irq_start + ei->nirqs;
+               for (irq = ei->irq_start; irq < irq_end; irq++) {
+                       set_irq_chip(irq, NULL);
+                       set_irq_handler(irq, NULL);
+                       set_irq_flags(irq, 0);
+               }
+               set_irq_chained_handler(ei->chained_irq, NULL);
+               device_init_wakeup(&pdev->dev, 0);
+       }
+       iounmap(ei->base_addr);
+       kfree(ei->chip);
+       kfree(ei);
+
+       return 0;
+}
+
+#ifdef CONFIG_PM
+static int egpio_suspend(struct platform_device *pdev, pm_message_t state)
+{
+       struct egpio_info *ei = platform_get_drvdata(pdev);
+
+       if (ei->chained_irq && device_may_wakeup(&pdev->dev))
+               enable_irq_wake(ei->chained_irq);
+       return 0;
+}
+
+static int egpio_resume(struct platform_device *pdev)
+{
+       struct egpio_info *ei = platform_get_drvdata(pdev);
+
+       if (ei->chained_irq && device_may_wakeup(&pdev->dev))
+               disable_irq_wake(ei->chained_irq);
+
+       /* Update registers from the cache, in case
+          the CPLD was powered off during suspend */
+       egpio_write_cache(ei);
+       return 0;
+}
+#else
+#define egpio_suspend NULL
+#define egpio_resume NULL
+#endif
+
+
+static struct platform_driver egpio_driver = {
+       .driver = {
+               .name = "htc-egpio",
+       },
+       .remove       = __exit_p(egpio_remove),
+       .suspend      = egpio_suspend,
+       .resume       = egpio_resume,
+};
+
+static int __init egpio_init(void)
+{
+       return platform_driver_probe(&egpio_driver, egpio_probe);
+}
+
+static void __exit egpio_exit(void)
+{
+       platform_driver_unregister(&egpio_driver);
+}
+
+/* start early for dependencies */
+subsys_initcall(egpio_init);
+module_exit(egpio_exit)
+
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("Kevin O'Connor <kevin@koconnor.net>");
diff --git a/drivers/mfd/htc-pasic3.c b/drivers/mfd/htc-pasic3.c
new file mode 100644 (file)
index 0000000..af66f4f
--- /dev/null
@@ -0,0 +1,265 @@
+/*
+ * Core driver for HTC PASIC3 LED/DS1WM chip.
+ *
+ * Copyright (C) 2006 Philipp Zabel <philipp.zabel@gmail.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ */
+
+#include <linux/init.h>
+#include <linux/module.h>
+#include <linux/platform_device.h>
+
+#include <linux/ds1wm.h>
+#include <linux/gpio.h>
+#include <linux/io.h>
+#include <linux/irq.h>
+#include <linux/interrupt.h>
+#include <linux/mfd/htc-pasic3.h>
+
+#include <asm/arch/pxa-regs.h>
+
+struct pasic3_data {
+       void __iomem *mapping;
+       unsigned int bus_shift;
+       struct platform_device *ds1wm_pdev;
+       struct platform_device *led_pdev;
+};
+
+#define REG_ADDR  5
+#define REG_DATA  6
+#define NUM_REGS  7
+
+#define READ_MODE 0x80
+
+/*
+ * write to a secondary register on the PASIC3
+ */
+void pasic3_write_register(struct device *dev, u32 reg, u8 val)
+{
+       struct pasic3_data *asic = dev->driver_data;
+       int bus_shift = asic->bus_shift;
+       void __iomem *addr = asic->mapping + (REG_ADDR << bus_shift);
+       void __iomem *data = asic->mapping + (REG_DATA << bus_shift);
+
+       __raw_writeb(~READ_MODE & reg, addr);
+       __raw_writeb(val, data);
+}
+EXPORT_SYMBOL(pasic3_write_register); /* for leds-pasic3 */
+
+/*
+ * read from a secondary register on the PASIC3
+ */
+u8 pasic3_read_register(struct device *dev, u32 reg)
+{
+       struct pasic3_data *asic = dev->driver_data;
+       int bus_shift = asic->bus_shift;
+       void __iomem *addr = asic->mapping + (REG_ADDR << bus_shift);
+       void __iomem *data = asic->mapping + (REG_DATA << bus_shift);
+
+       __raw_writeb(READ_MODE | reg, addr);
+       return __raw_readb(data);
+}
+EXPORT_SYMBOL(pasic3_read_register); /* for leds-pasic3 */
+
+/*
+ * LEDs
+ */
+
+static int led_device_add(struct device *pasic3_dev,
+                               const struct pasic3_leds_machinfo *pdata)
+{
+       struct pasic3_data *asic = pasic3_dev->driver_data;
+       struct platform_device *pdev;
+       int ret;
+
+       pdev = platform_device_alloc("pasic3-led", -1);
+       if (!pdev) {
+               dev_dbg(pasic3_dev, "failed to allocate LED platform device\n");
+               return -ENOMEM;
+       }
+
+       ret = platform_device_add_data(pdev, pdata,
+                                       sizeof(struct pasic3_leds_machinfo));
+       if (ret < 0) {
+               dev_dbg(pasic3_dev, "failed to add LED platform data\n");
+               goto exit_pdev_put;
+       }
+
+       pdev->dev.parent = pasic3_dev;
+       ret = platform_device_add(pdev);
+       if (ret < 0) {
+               dev_dbg(pasic3_dev, "failed to add LED platform device\n");
+               goto exit_pdev_put;
+       }
+
+       asic->led_pdev = pdev;
+       return 0;
+
+exit_pdev_put:
+       platform_device_put(pdev);
+       return ret;
+}
+
+/*
+ * DS1WM
+ */
+
+static void ds1wm_enable(struct platform_device *pdev)
+{
+       struct device *dev = pdev->dev.parent;
+       int c;
+
+       c = pasic3_read_register(dev, 0x28);
+       pasic3_write_register(dev, 0x28, c & 0x7f);
+
+       dev_dbg(dev, "DS1WM OWM_EN low (active) %02x\n", c & 0x7f);
+}
+
+static void ds1wm_disable(struct platform_device *pdev)
+{
+       struct device *dev = pdev->dev.parent;
+       int c;
+
+       c = pasic3_read_register(dev, 0x28);
+       pasic3_write_register(dev, 0x28, c | 0x80);
+
+       dev_dbg(dev, "DS1WM OWM_EN high (inactive) %02x\n", c | 0x80);
+}
+
+static struct ds1wm_platform_data ds1wm_pdata = {
+       .bus_shift = 2,
+       .enable    = ds1wm_enable,
+       .disable   = ds1wm_disable,
+};
+
+static int ds1wm_device_add(struct device *pasic3_dev, int bus_shift)
+{
+       struct pasic3_data *asic = pasic3_dev->driver_data;
+       struct platform_device *pdev;
+       int ret;
+
+       pdev = platform_device_alloc("ds1wm", -1);
+       if (!pdev) {
+               dev_dbg(pasic3_dev, "failed to allocate DS1WM platform device\n");
+               return -ENOMEM;
+       }
+
+       ret = platform_device_add_resources(pdev, pdev->resource,
+                                               pdev->num_resources);
+       if (ret < 0) {
+               dev_dbg(pasic3_dev, "failed to add DS1WM resources\n");
+               goto exit_pdev_put;
+       }
+
+       ds1wm_pdata.bus_shift = asic->bus_shift;
+       ret = platform_device_add_data(pdev, &ds1wm_pdata,
+                                       sizeof(struct ds1wm_platform_data));
+       if (ret < 0) {
+               dev_dbg(pasic3_dev, "failed to add DS1WM platform data\n");
+               goto exit_pdev_put;
+       }
+
+       pdev->dev.parent = pasic3_dev;
+       ret = platform_device_add(pdev);
+       if (ret < 0) {
+               dev_dbg(pasic3_dev, "failed to add DS1WM platform device\n");
+               goto exit_pdev_put;
+       }
+
+       asic->ds1wm_pdev = pdev;
+       return 0;
+
+exit_pdev_put:
+       platform_device_put(pdev);
+       return ret;
+}
+
+static int __init pasic3_probe(struct platform_device *pdev)
+{
+       struct pasic3_platform_data *pdata = pdev->dev.platform_data;
+       struct device *dev = &pdev->dev;
+       struct pasic3_data *asic;
+       struct resource *r;
+       int ret;
+
+       r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+       if (!r)
+               return -ENXIO;
+
+       if (!request_mem_region(r->start, r->end - r->start + 1, "pasic3"))
+               return -EBUSY;
+
+       asic = kzalloc(sizeof(struct pasic3_data), GFP_KERNEL);
+       if (!asic)
+               return -ENOMEM;
+
+       platform_set_drvdata(pdev, asic);
+
+       if (pdata && pdata->bus_shift)
+               asic->bus_shift = pdata->bus_shift;
+       else
+               asic->bus_shift = 2;
+
+       asic->mapping = ioremap(r->start, r->end - r->start + 1);
+       if (!asic->mapping) {
+               dev_err(dev, "couldn't ioremap PASIC3\n");
+               kfree(asic);
+               return -ENOMEM;
+       }
+
+       ret = ds1wm_device_add(dev, asic->bus_shift);
+       if (ret < 0)
+               dev_warn(dev, "failed to register DS1WM\n");
+
+       if (pdata->led_pdata) {
+               ret = led_device_add(dev, pdata->led_pdata);
+               if (ret < 0)
+                       dev_warn(dev, "failed to register LED device\n");
+       }
+
+       return 0;
+}
+
+static int pasic3_remove(struct platform_device *pdev)
+{
+       struct pasic3_data *asic = platform_get_drvdata(pdev);
+       struct resource *r;
+
+       if (asic->led_pdev)
+               platform_device_unregister(asic->led_pdev);
+       if (asic->ds1wm_pdev)
+               platform_device_unregister(asic->ds1wm_pdev);
+
+       iounmap(asic->mapping);
+       r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+       release_mem_region(r->start, r->end - r->start + 1);
+       kfree(asic);
+       return 0;
+}
+
+static struct platform_driver pasic3_driver = {
+       .driver         = {
+               .name   = "pasic3",
+       },
+       .remove         = pasic3_remove,
+};
+
+static int __init pasic3_base_init(void)
+{
+       return platform_driver_probe(&pasic3_driver, pasic3_probe);
+}
+
+static void __exit pasic3_base_exit(void)
+{
+       platform_driver_unregister(&pasic3_driver);
+}
+
+module_init(pasic3_base_init);
+module_exit(pasic3_base_exit);
+
+MODULE_AUTHOR("Philipp Zabel <philipp.zabel@gmail.com>");
+MODULE_DESCRIPTION("Core driver for HTC PASIC3");
+MODULE_LICENSE("GPL");
index fdbaa776f249f0eaec80a9c0fa21d11892057361..5e859486eaf851ea077501abf02d987a16d5a379 100644 (file)
@@ -32,7 +32,6 @@
 #include <linux/kthread.h>
 
 #include <asm/dma.h>
-#include <asm/semaphore.h>
 #include <asm/arch/collie.h>
 #include <asm/mach-types.h>
 
index 962817e49fba02e063dc164a3d0971e221eaa3a7..bb94ce78a6d003a1cfb8c9baa020c45eb0a416e9 100644 (file)
@@ -22,6 +22,39 @@ config ATMEL_PWM
          purposes including software controlled power-efficent backlights
          on LCD displays, motor control, and waveform generation.
 
+config ATMEL_TCLIB
+       bool "Atmel AT32/AT91 Timer/Counter Library"
+       depends on (AVR32 || ARCH_AT91)
+       help
+         Select this if you want a library to allocate the Timer/Counter
+         blocks found on many Atmel processors.  This facilitates using
+         these blocks by different drivers despite processor differences.
+
+config ATMEL_TCB_CLKSRC
+       bool "TC Block Clocksource"
+       depends on ATMEL_TCLIB && GENERIC_TIME
+       default y
+       help
+         Select this to get a high precision clocksource based on a
+         TC block with a 5+ MHz base clock rate.  Two timer channels
+         are combined to make a single 32-bit timer.
+
+         When GENERIC_CLOCKEVENTS is defined, the third timer channel
+         may be used as a clock event device supporting oneshot mode
+         (delays of up to two seconds) based on the 32 KiHz clock.
+
+config ATMEL_TCB_CLKSRC_BLOCK
+       int
+       depends on ATMEL_TCB_CLKSRC
+       prompt "TC Block" if ARCH_AT91RM9200 || ARCH_AT91SAM9260 || CPU_AT32AP700X
+       default 0
+       range 0 1
+       help
+         Some chips provide more than one TC block, so you have the
+         choice of which one to use for the clock framework.  The other
+         TC can be used for other purposes, such as PWM generation and
+         interval timing.
+
 config IBM_ASM
        tristate "Device driver for IBM RSA service processor"
        depends on X86 && PCI && INPUT && EXPERIMENTAL
index bbc69fdd1b9d2d10f699ae702a119548fd253881..4581b2533111deb34f72a42d72bee4fdc8a7d63b 100644 (file)
@@ -10,6 +10,7 @@ obj-$(CONFIG_ACER_WMI)     += acer-wmi.o
 obj-$(CONFIG_ASUS_LAPTOP)     += asus-laptop.o
 obj-$(CONFIG_ATMEL_PWM)                += atmel_pwm.o
 obj-$(CONFIG_ATMEL_SSC)                += atmel-ssc.o
+obj-$(CONFIG_ATMEL_TCLIB)      += atmel_tclib.o
 obj-$(CONFIG_TC1100_WMI)       += tc1100-wmi.o
 obj-$(CONFIG_LKDTM)            += lkdtm.o
 obj-$(CONFIG_TIFM_CORE)        += tifm_core.o
diff --git a/drivers/misc/atmel_tclib.c b/drivers/misc/atmel_tclib.c
new file mode 100644 (file)
index 0000000..05dc8a3
--- /dev/null
@@ -0,0 +1,161 @@
+#include <linux/atmel_tc.h>
+#include <linux/clk.h>
+#include <linux/err.h>
+#include <linux/init.h>
+#include <linux/io.h>
+#include <linux/ioport.h>
+#include <linux/kernel.h>
+#include <linux/platform_device.h>
+
+/* Number of bytes to reserve for the iomem resource */
+#define ATMEL_TC_IOMEM_SIZE    256
+
+
+/*
+ * This is a thin library to solve the problem of how to portably allocate
+ * one of the TC blocks.  For simplicity, it doesn't currently expect to
+ * share individual timers between different drivers.
+ */
+
+#if defined(CONFIG_AVR32)
+/* AVR32 has these divide PBB */
+const u8 atmel_tc_divisors[5] = { 0, 4, 8, 16, 32, };
+EXPORT_SYMBOL(atmel_tc_divisors);
+
+#elif defined(CONFIG_ARCH_AT91)
+/* AT91 has these divide MCK */
+const u8 atmel_tc_divisors[5] = { 2, 8, 32, 128, 0, };
+EXPORT_SYMBOL(atmel_tc_divisors);
+
+#endif
+
+static DEFINE_SPINLOCK(tc_list_lock);
+static LIST_HEAD(tc_list);
+
+/**
+ * atmel_tc_alloc - allocate a specified TC block
+ * @block: which block to allocate
+ * @name: name to be associated with the iomem resource
+ *
+ * Caller allocates a block.  If it is available, a pointer to a
+ * pre-initialized struct atmel_tc is returned. The caller can access
+ * the registers directly through the "regs" field.
+ */
+struct atmel_tc *atmel_tc_alloc(unsigned block, const char *name)
+{
+       struct atmel_tc         *tc;
+       struct platform_device  *pdev = NULL;
+       struct resource         *r;
+
+       spin_lock(&tc_list_lock);
+       list_for_each_entry(tc, &tc_list, node) {
+               if (tc->pdev->id == block) {
+                       pdev = tc->pdev;
+                       break;
+               }
+       }
+
+       if (!pdev || tc->iomem)
+               goto fail;
+
+       r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+       r = request_mem_region(r->start, ATMEL_TC_IOMEM_SIZE, name);
+       if (!r)
+               goto fail;
+
+       tc->regs = ioremap(r->start, ATMEL_TC_IOMEM_SIZE);
+       if (!tc->regs)
+               goto fail_ioremap;
+
+       tc->iomem = r;
+
+out:
+       spin_unlock(&tc_list_lock);
+       return tc;
+
+fail_ioremap:
+       release_resource(r);
+fail:
+       tc = NULL;
+       goto out;
+}
+EXPORT_SYMBOL_GPL(atmel_tc_alloc);
+
+/**
+ * atmel_tc_free - release a specified TC block
+ * @tc: Timer/counter block that was returned by atmel_tc_alloc()
+ *
+ * This reverses the effect of atmel_tc_alloc(), unmapping the I/O
+ * registers, invalidating the resource returned by that routine and
+ * making the TC available to other drivers.
+ */
+void atmel_tc_free(struct atmel_tc *tc)
+{
+       spin_lock(&tc_list_lock);
+       if (tc->regs) {
+               iounmap(tc->regs);
+               release_resource(tc->iomem);
+               tc->regs = NULL;
+               tc->iomem = NULL;
+       }
+       spin_unlock(&tc_list_lock);
+}
+EXPORT_SYMBOL_GPL(atmel_tc_free);
+
+static int __init tc_probe(struct platform_device *pdev)
+{
+       struct atmel_tc *tc;
+       struct clk      *clk;
+       int             irq;
+
+       if (!platform_get_resource(pdev, IORESOURCE_MEM, 0))
+               return -EINVAL;
+
+       irq = platform_get_irq(pdev, 0);
+       if (irq < 0)
+               return -EINVAL;
+
+       tc = kzalloc(sizeof(struct atmel_tc), GFP_KERNEL);
+       if (!tc)
+               return -ENOMEM;
+
+       tc->pdev = pdev;
+
+       clk = clk_get(&pdev->dev, "t0_clk");
+       if (IS_ERR(clk)) {
+               kfree(tc);
+               return -EINVAL;
+       }
+
+       tc->clk[0] = clk;
+       tc->clk[1] = clk_get(&pdev->dev, "t1_clk");
+       if (IS_ERR(tc->clk[1]))
+               tc->clk[1] = clk;
+       tc->clk[2] = clk_get(&pdev->dev, "t2_clk");
+       if (IS_ERR(tc->clk[2]))
+               tc->clk[2] = clk;
+
+       tc->irq[0] = irq;
+       tc->irq[1] = platform_get_irq(pdev, 1);
+       if (tc->irq[1] < 0)
+               tc->irq[1] = irq;
+       tc->irq[2] = platform_get_irq(pdev, 2);
+       if (tc->irq[2] < 0)
+               tc->irq[2] = irq;
+
+       spin_lock(&tc_list_lock);
+       list_add_tail(&tc->node, &tc_list);
+       spin_unlock(&tc_list_lock);
+
+       return 0;
+}
+
+static struct platform_driver tc_driver = {
+       .driver.name    = "atmel_tcb",
+};
+
+static int __init tc_init(void)
+{
+       return platform_driver_probe(&tc_driver, tc_probe);
+}
+arch_initcall(tc_init);
index 6fcb0e96adf4283e1554f0fcc77a17b0acebd297..fafb57fed761c8f1e6fa5c91f136c139593e0211 100644 (file)
@@ -40,16 +40,16 @@ static struct class enclosure_component_class;
  * Looks through the list of registered enclosures to see
  * if it can find a match for a device.  Returns NULL if no
  * enclosure is found. Obtains a reference to the enclosure class
- * device which must be released with class_device_put().
+ * device which must be released with device_put().
  */
 struct enclosure_device *enclosure_find(struct device *dev)
 {
-       struct enclosure_device *edev = NULL;
+       struct enclosure_device *edev;
 
        mutex_lock(&container_list_lock);
        list_for_each_entry(edev, &container_list, node) {
-               if (edev->cdev.dev == dev) {
-                       class_device_get(&edev->cdev);
+               if (edev->edev.parent == dev) {
+                       get_device(&edev->edev);
                        mutex_unlock(&container_list_lock);
                        return edev;
                }
@@ -117,11 +117,11 @@ enclosure_register(struct device *dev, const char *name, int components,
 
        edev->components = components;
 
-       edev->cdev.class = &enclosure_class;
-       edev->cdev.dev = get_device(dev);
+       edev->edev.class = &enclosure_class;
+       edev->edev.parent = get_device(dev);
        edev->cb = cb;
-       snprintf(edev->cdev.class_id, BUS_ID_SIZE, "%s", name);
-       err = class_device_register(&edev->cdev);
+       snprintf(edev->edev.bus_id, BUS_ID_SIZE, "%s", name);
+       err = device_register(&edev->edev);
        if (err)
                goto err;
 
@@ -135,7 +135,7 @@ enclosure_register(struct device *dev, const char *name, int components,
        return edev;
 
  err:
-       put_device(edev->cdev.dev);
+       put_device(edev->edev.parent);
        kfree(edev);
        return ERR_PTR(err);
 }
@@ -158,27 +158,28 @@ void enclosure_unregister(struct enclosure_device *edev)
 
        for (i = 0; i < edev->components; i++)
                if (edev->component[i].number != -1)
-                       class_device_unregister(&edev->component[i].cdev);
+                       device_unregister(&edev->component[i].cdev);
 
        /* prevent any callbacks into service user */
        edev->cb = &enclosure_null_callbacks;
-       class_device_unregister(&edev->cdev);
+       device_unregister(&edev->edev);
 }
 EXPORT_SYMBOL_GPL(enclosure_unregister);
 
-static void enclosure_release(struct class_device *cdev)
+static void enclosure_release(struct device *cdev)
 {
        struct enclosure_device *edev = to_enclosure_device(cdev);
 
-       put_device(cdev->dev);
+       put_device(cdev->parent);
        kfree(edev);
 }
 
-static void enclosure_component_release(struct class_device *cdev)
+static void enclosure_component_release(struct device *dev)
 {
-       if (cdev->dev)
-               put_device(cdev->dev);
-       class_device_put(cdev->parent);
+       struct enclosure_component *cdev = to_enclosure_component(dev);
+
+       put_device(cdev->dev);
+       put_device(dev->parent);
 }
 
 /**
@@ -201,7 +202,7 @@ enclosure_component_register(struct enclosure_device *edev,
                             const char *name)
 {
        struct enclosure_component *ecomp;
-       struct class_device *cdev;
+       struct device *cdev;
        int err;
 
        if (number >= edev->components)
@@ -215,14 +216,14 @@ enclosure_component_register(struct enclosure_device *edev,
        ecomp->type = type;
        ecomp->number = number;
        cdev = &ecomp->cdev;
-       cdev->parent = class_device_get(&edev->cdev);
+       cdev->parent = get_device(&edev->edev);
        cdev->class = &enclosure_component_class;
        if (name)
-               snprintf(cdev->class_id, BUS_ID_SIZE, "%s", name);
+               snprintf(cdev->bus_id, BUS_ID_SIZE, "%s", name);
        else
-               snprintf(cdev->class_id, BUS_ID_SIZE, "%u", number);
+               snprintf(cdev->bus_id, BUS_ID_SIZE, "%u", number);
 
-       err = class_device_register(cdev);
+       err = device_register(cdev);
        if (err)
                ERR_PTR(err);
 
@@ -247,18 +248,17 @@ EXPORT_SYMBOL_GPL(enclosure_component_register);
 int enclosure_add_device(struct enclosure_device *edev, int component,
                         struct device *dev)
 {
-       struct class_device *cdev;
+       struct enclosure_component *cdev;
 
        if (!edev || component >= edev->components)
                return -EINVAL;
 
-       cdev = &edev->component[component].cdev;
+       cdev = &edev->component[component];
 
-       class_device_del(cdev);
-       if (cdev->dev)
-               put_device(cdev->dev);
+       device_del(&cdev->cdev);
+       put_device(cdev->dev);
        cdev->dev = get_device(dev);
-       return class_device_add(cdev);
+       return device_add(&cdev->cdev);
 }
 EXPORT_SYMBOL_GPL(enclosure_add_device);
 
@@ -272,18 +272,17 @@ EXPORT_SYMBOL_GPL(enclosure_add_device);
  */
 int enclosure_remove_device(struct enclosure_device *edev, int component)
 {
-       struct class_device *cdev;
+       struct enclosure_component *cdev;
 
        if (!edev || component >= edev->components)
                return -EINVAL;
 
-       cdev = &edev->component[component].cdev;
+       cdev = &edev->component[component];
 
-       class_device_del(cdev);
-       if (cdev->dev)
-               put_device(cdev->dev);
+       device_del(&cdev->cdev);
+       put_device(cdev->dev);
        cdev->dev = NULL;
-       return class_device_add(cdev);
+       return device_add(&cdev->cdev);
 }
 EXPORT_SYMBOL_GPL(enclosure_remove_device);
 
@@ -291,14 +290,16 @@ EXPORT_SYMBOL_GPL(enclosure_remove_device);
  * sysfs pieces below
  */
 
-static ssize_t enclosure_show_components(struct class_device *cdev, char *buf)
+static ssize_t enclosure_show_components(struct device *cdev,
+                                        struct device_attribute *attr,
+                                        char *buf)
 {
        struct enclosure_device *edev = to_enclosure_device(cdev);
 
        return snprintf(buf, 40, "%d\n", edev->components);
 }
 
-static struct class_device_attribute enclosure_attrs[] = {
+static struct device_attribute enclosure_attrs[] = {
        __ATTR(components, S_IRUGO, enclosure_show_components, NULL),
        __ATTR_NULL
 };
@@ -306,8 +307,8 @@ static struct class_device_attribute enclosure_attrs[] = {
 static struct class enclosure_class = {
        .name                   = "enclosure",
        .owner                  = THIS_MODULE,
-       .release                = enclosure_release,
-       .class_dev_attrs        = enclosure_attrs,
+       .dev_release            = enclosure_release,
+       .dev_attrs              = enclosure_attrs,
 };
 
 static const char *const enclosure_status [] = {
@@ -326,7 +327,8 @@ static const char *const enclosure_type [] = {
        [ENCLOSURE_COMPONENT_ARRAY_DEVICE] = "array device",
 };
 
-static ssize_t get_component_fault(struct class_device *cdev, char *buf)
+static ssize_t get_component_fault(struct device *cdev,
+                                  struct device_attribute *attr, char *buf)
 {
        struct enclosure_device *edev = to_enclosure_device(cdev->parent);
        struct enclosure_component *ecomp = to_enclosure_component(cdev);
@@ -336,8 +338,9 @@ static ssize_t get_component_fault(struct class_device *cdev, char *buf)
        return snprintf(buf, 40, "%d\n", ecomp->fault);
 }
 
-static ssize_t set_component_fault(struct class_device *cdev, const char *buf,
-                                  size_t count)
+static ssize_t set_component_fault(struct device *cdev,
+                                  struct device_attribute *attr,
+                                  const char *buf, size_t count)
 {
        struct enclosure_device *edev = to_enclosure_device(cdev->parent);
        struct enclosure_component *ecomp = to_enclosure_component(cdev);
@@ -348,7 +351,8 @@ static ssize_t set_component_fault(struct class_device *cdev, const char *buf,
        return count;
 }
 
-static ssize_t get_component_status(struct class_device *cdev, char *buf)
+static ssize_t get_component_status(struct device *cdev,
+                                   struct device_attribute *attr,char *buf)
 {
        struct enclosure_device *edev = to_enclosure_device(cdev->parent);
        struct enclosure_component *ecomp = to_enclosure_component(cdev);
@@ -358,8 +362,9 @@ static ssize_t get_component_status(struct class_device *cdev, char *buf)
        return snprintf(buf, 40, "%s\n", enclosure_status[ecomp->status]);
 }
 
-static ssize_t set_component_status(struct class_device *cdev, const char *buf,
-                                  size_t count)
+static ssize_t set_component_status(struct device *cdev,
+                                   struct device_attribute *attr,
+                                   const char *buf, size_t count)
 {
        struct enclosure_device *edev = to_enclosure_device(cdev->parent);
        struct enclosure_component *ecomp = to_enclosure_component(cdev);
@@ -380,7 +385,8 @@ static ssize_t set_component_status(struct class_device *cdev, const char *buf,
                return -EINVAL;
 }
 
-static ssize_t get_component_active(struct class_device *cdev, char *buf)
+static ssize_t get_component_active(struct device *cdev,
+                                   struct device_attribute *attr, char *buf)
 {
        struct enclosure_device *edev = to_enclosure_device(cdev->parent);
        struct enclosure_component *ecomp = to_enclosure_component(cdev);
@@ -390,8 +396,9 @@ static ssize_t get_component_active(struct class_device *cdev, char *buf)
        return snprintf(buf, 40, "%d\n", ecomp->active);
 }
 
-static ssize_t set_component_active(struct class_device *cdev, const char *buf,
-                                  size_t count)
+static ssize_t set_component_active(struct device *cdev,
+                                   struct device_attribute *attr,
+                                   const char *buf, size_t count)
 {
        struct enclosure_device *edev = to_enclosure_device(cdev->parent);
        struct enclosure_component *ecomp = to_enclosure_component(cdev);
@@ -402,7 +409,8 @@ static ssize_t set_component_active(struct class_device *cdev, const char *buf,
        return count;
 }
 
-static ssize_t get_component_locate(struct class_device *cdev, char *buf)
+static ssize_t get_component_locate(struct device *cdev,
+                                   struct device_attribute *attr, char *buf)
 {
        struct enclosure_device *edev = to_enclosure_device(cdev->parent);
        struct enclosure_component *ecomp = to_enclosure_component(cdev);
@@ -412,8 +420,9 @@ static ssize_t get_component_locate(struct class_device *cdev, char *buf)
        return snprintf(buf, 40, "%d\n", ecomp->locate);
 }
 
-static ssize_t set_component_locate(struct class_device *cdev, const char *buf,
-                                  size_t count)
+static ssize_t set_component_locate(struct device *cdev,
+                                   struct device_attribute *attr,
+                                   const char *buf, size_t count)
 {
        struct enclosure_device *edev = to_enclosure_device(cdev->parent);
        struct enclosure_component *ecomp = to_enclosure_component(cdev);
@@ -424,7 +433,8 @@ static ssize_t set_component_locate(struct class_device *cdev, const char *buf,
        return count;
 }
 
-static ssize_t get_component_type(struct class_device *cdev, char *buf)
+static ssize_t get_component_type(struct device *cdev,
+                                 struct device_attribute *attr, char *buf)
 {
        struct enclosure_component *ecomp = to_enclosure_component(cdev);
 
@@ -432,7 +442,7 @@ static ssize_t get_component_type(struct class_device *cdev, char *buf)
 }
 
 
-static struct class_device_attribute enclosure_component_attrs[] = {
+static struct device_attribute enclosure_component_attrs[] = {
        __ATTR(fault, S_IRUGO | S_IWUSR, get_component_fault,
               set_component_fault),
        __ATTR(status, S_IRUGO | S_IWUSR, get_component_status,
@@ -448,8 +458,8 @@ static struct class_device_attribute enclosure_component_attrs[] = {
 static struct class enclosure_component_class =  {
        .name                   = "enclosure_component",
        .owner                  = THIS_MODULE,
-       .class_dev_attrs        = enclosure_component_attrs,
-       .release                = enclosure_component_release,
+       .dev_attrs      = enclosure_component_attrs,
+       .dev_release            = enclosure_component_release,
 };
 
 static int __init enclosure_init(void)
index 4a3c6759492b95b4a18150c0f63003f9e2ee211c..959fb86cda01e113aca653ef91c646b26f954aa3 100644 (file)
@@ -314,7 +314,7 @@ config MTD_ALAUDA
 
 config MTD_NAND_ORION
        tristate "NAND Flash support for Marvell Orion SoC"
-       depends on ARCH_ORION && MTD_NAND
+       depends on PLAT_ORION && MTD_NAND
        help
          This enables the NAND flash controller on Orion machines.
 
index b025dfe0b27471e89a569f063a7b5f77eeb07c62..378b7aa638125cfd92929cb537fa2bbd1871cf7f 100644 (file)
 #include <linux/mtd/partitions.h>
 
 #include <asm/io.h>
-
+#include <asm/fsl_lbc.h>
 
 #define MAX_BANKS 8
 #define ERR_BYTE 0xFF /* Value returned for read bytes when read failed */
 #define FCM_TIMEOUT_MSECS 500 /* Maximum number of mSecs to wait for FCM */
 
-struct elbc_bank {
-       __be32 br;             /**< Base Register  */
-#define BR_BA           0xFFFF8000
-#define BR_BA_SHIFT             15
-#define BR_PS           0x00001800
-#define BR_PS_SHIFT             11
-#define BR_PS_8         0x00000800  /* Port Size 8 bit */
-#define BR_PS_16        0x00001000  /* Port Size 16 bit */
-#define BR_PS_32        0x00001800  /* Port Size 32 bit */
-#define BR_DECC         0x00000600
-#define BR_DECC_SHIFT            9
-#define BR_DECC_OFF     0x00000000  /* HW ECC checking and generation off */
-#define BR_DECC_CHK     0x00000200  /* HW ECC checking on, generation off */
-#define BR_DECC_CHK_GEN 0x00000400  /* HW ECC checking and generation on */
-#define BR_WP           0x00000100
-#define BR_WP_SHIFT              8
-#define BR_MSEL         0x000000E0
-#define BR_MSEL_SHIFT            5
-#define BR_MS_GPCM      0x00000000  /* GPCM */
-#define BR_MS_FCM       0x00000020  /* FCM */
-#define BR_MS_SDRAM     0x00000060  /* SDRAM */
-#define BR_MS_UPMA      0x00000080  /* UPMA */
-#define BR_MS_UPMB      0x000000A0  /* UPMB */
-#define BR_MS_UPMC      0x000000C0  /* UPMC */
-#define BR_V            0x00000001
-#define BR_V_SHIFT               0
-#define BR_RES          ~(BR_BA|BR_PS|BR_DECC|BR_WP|BR_MSEL|BR_V)
-
-       __be32 or;             /**< Base Register  */
-#define OR0 0x5004
-#define OR1 0x500C
-#define OR2 0x5014
-#define OR3 0x501C
-#define OR4 0x5024
-#define OR5 0x502C
-#define OR6 0x5034
-#define OR7 0x503C
-
-#define OR_FCM_AM               0xFFFF8000
-#define OR_FCM_AM_SHIFT                 15
-#define OR_FCM_BCTLD            0x00001000
-#define OR_FCM_BCTLD_SHIFT              12
-#define OR_FCM_PGS              0x00000400
-#define OR_FCM_PGS_SHIFT                10
-#define OR_FCM_CSCT             0x00000200
-#define OR_FCM_CSCT_SHIFT                9
-#define OR_FCM_CST              0x00000100
-#define OR_FCM_CST_SHIFT                 8
-#define OR_FCM_CHT              0x00000080
-#define OR_FCM_CHT_SHIFT                 7
-#define OR_FCM_SCY              0x00000070
-#define OR_FCM_SCY_SHIFT                 4
-#define OR_FCM_SCY_1            0x00000010
-#define OR_FCM_SCY_2            0x00000020
-#define OR_FCM_SCY_3            0x00000030
-#define OR_FCM_SCY_4            0x00000040
-#define OR_FCM_SCY_5            0x00000050
-#define OR_FCM_SCY_6            0x00000060
-#define OR_FCM_SCY_7            0x00000070
-#define OR_FCM_RST              0x00000008
-#define OR_FCM_RST_SHIFT                 3
-#define OR_FCM_TRLX             0x00000004
-#define OR_FCM_TRLX_SHIFT                2
-#define OR_FCM_EHTR             0x00000002
-#define OR_FCM_EHTR_SHIFT                1
-};
-
-struct elbc_regs {
-       struct elbc_bank bank[8];
-       u8 res0[0x28];
-       __be32 mar;             /**< UPM Address Register */
-       u8 res1[0x4];
-       __be32 mamr;            /**< UPMA Mode Register */
-       __be32 mbmr;            /**< UPMB Mode Register */
-       __be32 mcmr;            /**< UPMC Mode Register */
-       u8 res2[0x8];
-       __be32 mrtpr;           /**< Memory Refresh Timer Prescaler Register */
-       __be32 mdr;             /**< UPM Data Register */
-       u8 res3[0x4];
-       __be32 lsor;            /**< Special Operation Initiation Register */
-       __be32 lsdmr;           /**< SDRAM Mode Register */
-       u8 res4[0x8];
-       __be32 lurt;            /**< UPM Refresh Timer */
-       __be32 lsrt;            /**< SDRAM Refresh Timer */
-       u8 res5[0x8];
-       __be32 ltesr;           /**< Transfer Error Status Register */
-#define LTESR_BM   0x80000000
-#define LTESR_FCT  0x40000000
-#define LTESR_PAR  0x20000000
-#define LTESR_WP   0x04000000
-#define LTESR_ATMW 0x00800000
-#define LTESR_ATMR 0x00400000
-#define LTESR_CS   0x00080000
-#define LTESR_CC   0x00000001
-#define LTESR_NAND_MASK (LTESR_FCT | LTESR_PAR | LTESR_CC)
-       __be32 ltedr;           /**< Transfer Error Disable Register */
-       __be32 lteir;           /**< Transfer Error Interrupt Register */
-       __be32 lteatr;          /**< Transfer Error Attributes Register */
-       __be32 ltear;           /**< Transfer Error Address Register */
-       u8 res6[0xC];
-       __be32 lbcr;            /**< Configuration Register */
-#define LBCR_LDIS  0x80000000
-#define LBCR_LDIS_SHIFT    31
-#define LBCR_BCTLC 0x00C00000
-#define LBCR_BCTLC_SHIFT   22
-#define LBCR_AHD   0x00200000
-#define LBCR_LPBSE 0x00020000
-#define LBCR_LPBSE_SHIFT   17
-#define LBCR_EPAR  0x00010000
-#define LBCR_EPAR_SHIFT    16
-#define LBCR_BMT   0x0000FF00
-#define LBCR_BMT_SHIFT      8
-#define LBCR_INIT  0x00040000
-       __be32 lcrr;            /**< Clock Ratio Register */
-#define LCRR_DBYP    0x80000000
-#define LCRR_DBYP_SHIFT      31
-#define LCRR_BUFCMDC 0x30000000
-#define LCRR_BUFCMDC_SHIFT   28
-#define LCRR_ECL     0x03000000
-#define LCRR_ECL_SHIFT       24
-#define LCRR_EADC    0x00030000
-#define LCRR_EADC_SHIFT      16
-#define LCRR_CLKDIV  0x0000000F
-#define LCRR_CLKDIV_SHIFT     0
-       u8 res7[0x8];
-       __be32 fmr;             /**< Flash Mode Register */
-#define FMR_CWTO     0x0000F000
-#define FMR_CWTO_SHIFT       12
-#define FMR_BOOT     0x00000800
-#define FMR_ECCM     0x00000100
-#define FMR_AL       0x00000030
-#define FMR_AL_SHIFT          4
-#define FMR_OP       0x00000003
-#define FMR_OP_SHIFT          0
-       __be32 fir;             /**< Flash Instruction Register */
-#define FIR_OP0      0xF0000000
-#define FIR_OP0_SHIFT        28
-#define FIR_OP1      0x0F000000
-#define FIR_OP1_SHIFT        24
-#define FIR_OP2      0x00F00000
-#define FIR_OP2_SHIFT        20
-#define FIR_OP3      0x000F0000
-#define FIR_OP3_SHIFT        16
-#define FIR_OP4      0x0000F000
-#define FIR_OP4_SHIFT        12
-#define FIR_OP5      0x00000F00
-#define FIR_OP5_SHIFT         8
-#define FIR_OP6      0x000000F0
-#define FIR_OP6_SHIFT         4
-#define FIR_OP7      0x0000000F
-#define FIR_OP7_SHIFT         0
-#define FIR_OP_NOP   0x0       /* No operation and end of sequence */
-#define FIR_OP_CA    0x1        /* Issue current column address */
-#define FIR_OP_PA    0x2        /* Issue current block+page address */
-#define FIR_OP_UA    0x3        /* Issue user defined address */
-#define FIR_OP_CM0   0x4        /* Issue command from FCR[CMD0] */
-#define FIR_OP_CM1   0x5        /* Issue command from FCR[CMD1] */
-#define FIR_OP_CM2   0x6        /* Issue command from FCR[CMD2] */
-#define FIR_OP_CM3   0x7        /* Issue command from FCR[CMD3] */
-#define FIR_OP_WB    0x8        /* Write FBCR bytes from FCM buffer */
-#define FIR_OP_WS    0x9        /* Write 1 or 2 bytes from MDR[AS] */
-#define FIR_OP_RB    0xA        /* Read FBCR bytes to FCM buffer */
-#define FIR_OP_RS    0xB        /* Read 1 or 2 bytes to MDR[AS] */
-#define FIR_OP_CW0   0xC        /* Wait then issue FCR[CMD0] */
-#define FIR_OP_CW1   0xD        /* Wait then issue FCR[CMD1] */
-#define FIR_OP_RBW   0xE        /* Wait then read FBCR bytes */
-#define FIR_OP_RSW   0xE        /* Wait then read 1 or 2 bytes */
-       __be32 fcr;             /**< Flash Command Register */
-#define FCR_CMD0     0xFF000000
-#define FCR_CMD0_SHIFT       24
-#define FCR_CMD1     0x00FF0000
-#define FCR_CMD1_SHIFT       16
-#define FCR_CMD2     0x0000FF00
-#define FCR_CMD2_SHIFT        8
-#define FCR_CMD3     0x000000FF
-#define FCR_CMD3_SHIFT        0
-       __be32 fbar;            /**< Flash Block Address Register */
-#define FBAR_BLK     0x00FFFFFF
-       __be32 fpar;            /**< Flash Page Address Register */
-#define FPAR_SP_PI   0x00007C00
-#define FPAR_SP_PI_SHIFT     10
-#define FPAR_SP_MS   0x00000200
-#define FPAR_SP_CI   0x000001FF
-#define FPAR_SP_CI_SHIFT      0
-#define FPAR_LP_PI   0x0003F000
-#define FPAR_LP_PI_SHIFT     12
-#define FPAR_LP_MS   0x00000800
-#define FPAR_LP_CI   0x000007FF
-#define FPAR_LP_CI_SHIFT      0
-       __be32 fbcr;            /**< Flash Byte Count Register */
-#define FBCR_BC      0x00000FFF
-       u8 res11[0x8];
-       u8 res8[0xF00];
-};
-
 struct fsl_elbc_ctrl;
 
 /* mtd information per set */
@@ -261,7 +66,7 @@ struct fsl_elbc_ctrl {
 
        /* device info */
        struct device *dev;
-       struct elbc_regs __iomem *regs;
+       struct fsl_lbc_regs __iomem *regs;
        int irq;
        wait_queue_head_t irq_wait;
        unsigned int irq_status; /* status read from LTESR by irq handler */
@@ -322,7 +127,7 @@ static void set_addr(struct mtd_info *mtd, int column, int page_addr, int oob)
        struct nand_chip *chip = mtd->priv;
        struct fsl_elbc_mtd *priv = chip->priv;
        struct fsl_elbc_ctrl *ctrl = priv->ctrl;
-       struct elbc_regs __iomem *lbc = ctrl->regs;
+       struct fsl_lbc_regs __iomem *lbc = ctrl->regs;
        int buf_num;
 
        ctrl->page = page_addr;
@@ -363,7 +168,7 @@ static int fsl_elbc_run_command(struct mtd_info *mtd)
        struct nand_chip *chip = mtd->priv;
        struct fsl_elbc_mtd *priv = chip->priv;
        struct fsl_elbc_ctrl *ctrl = priv->ctrl;
-       struct elbc_regs __iomem *lbc = ctrl->regs;
+       struct fsl_lbc_regs __iomem *lbc = ctrl->regs;
 
        /* Setup the FMR[OP] to execute without write protection */
        out_be32(&lbc->fmr, priv->fmr | 3);
@@ -406,7 +211,7 @@ static void fsl_elbc_do_read(struct nand_chip *chip, int oob)
 {
        struct fsl_elbc_mtd *priv = chip->priv;
        struct fsl_elbc_ctrl *ctrl = priv->ctrl;
-       struct elbc_regs __iomem *lbc = ctrl->regs;
+       struct fsl_lbc_regs __iomem *lbc = ctrl->regs;
 
        if (priv->page_size) {
                out_be32(&lbc->fir,
@@ -439,7 +244,7 @@ static void fsl_elbc_cmdfunc(struct mtd_info *mtd, unsigned int command,
        struct nand_chip *chip = mtd->priv;
        struct fsl_elbc_mtd *priv = chip->priv;
        struct fsl_elbc_ctrl *ctrl = priv->ctrl;
-       struct elbc_regs __iomem *lbc = ctrl->regs;
+       struct fsl_lbc_regs __iomem *lbc = ctrl->regs;
 
        ctrl->use_mdr = 0;
 
@@ -775,7 +580,7 @@ static int fsl_elbc_wait(struct mtd_info *mtd, struct nand_chip *chip)
 {
        struct fsl_elbc_mtd *priv = chip->priv;
        struct fsl_elbc_ctrl *ctrl = priv->ctrl;
-       struct elbc_regs __iomem *lbc = ctrl->regs;
+       struct fsl_lbc_regs __iomem *lbc = ctrl->regs;
 
        if (ctrl->status != LTESR_CC)
                return NAND_STATUS_FAIL;
@@ -807,7 +612,7 @@ static int fsl_elbc_chip_init_tail(struct mtd_info *mtd)
        struct nand_chip *chip = mtd->priv;
        struct fsl_elbc_mtd *priv = chip->priv;
        struct fsl_elbc_ctrl *ctrl = priv->ctrl;
-       struct elbc_regs __iomem *lbc = ctrl->regs;
+       struct fsl_lbc_regs __iomem *lbc = ctrl->regs;
        unsigned int al;
 
        /* calculate FMR Address Length field */
@@ -922,7 +727,7 @@ static void fsl_elbc_write_page(struct mtd_info *mtd,
 static int fsl_elbc_chip_init(struct fsl_elbc_mtd *priv)
 {
        struct fsl_elbc_ctrl *ctrl = priv->ctrl;
-       struct elbc_regs __iomem *lbc = ctrl->regs;
+       struct fsl_lbc_regs __iomem *lbc = ctrl->regs;
        struct nand_chip *chip = &priv->chip;
 
        dev_dbg(priv->dev, "eLBC Set Information for bank %d\n", priv->bank);
@@ -986,7 +791,7 @@ static int fsl_elbc_chip_remove(struct fsl_elbc_mtd *priv)
 static int fsl_elbc_chip_probe(struct fsl_elbc_ctrl *ctrl,
                                struct device_node *node)
 {
-       struct elbc_regs __iomem *lbc = ctrl->regs;
+       struct fsl_lbc_regs __iomem *lbc = ctrl->regs;
        struct fsl_elbc_mtd *priv;
        struct resource res;
 #ifdef CONFIG_MTD_PARTITIONS
@@ -1083,7 +888,7 @@ err:
 
 static int __devinit fsl_elbc_ctrl_init(struct fsl_elbc_ctrl *ctrl)
 {
-       struct elbc_regs __iomem *lbc = ctrl->regs;
+       struct fsl_lbc_regs __iomem *lbc = ctrl->regs;
 
        /* clear event registers */
        setbits32(&lbc->ltesr, LTESR_NAND_MASK);
@@ -1128,7 +933,7 @@ static int __devexit fsl_elbc_ctrl_remove(struct of_device *ofdev)
 static irqreturn_t fsl_elbc_ctrl_irq(int irqno, void *data)
 {
        struct fsl_elbc_ctrl *ctrl = data;
-       struct elbc_regs __iomem *lbc = ctrl->regs;
+       struct fsl_lbc_regs __iomem *lbc = ctrl->regs;
        __be32 status = in_be32(&lbc->ltesr) & LTESR_NAND_MASK;
 
        if (status) {
index 9162cca0182b55e7e10be13483512d33a948dda6..ec5ad28b237ef338859b072157b7a24f00b32507 100644 (file)
@@ -18,8 +18,8 @@
 #include <linux/mtd/partitions.h>
 #include <asm/io.h>
 #include <asm/sizes.h>
-#include <asm/arch/platform.h>
 #include <asm/arch/hardware.h>
+#include <asm/plat-orion/orion_nand.h>
 
 #ifdef CONFIG_MTD_CMDLINE_PARTS
 static const char *part_probes[] = { "cmdlinepart", NULL };
index b72b89d53ec8347061de4b4feb215bc633ed2edb..fae295b6809c4a83050e23905df2d25da00001cf 100644 (file)
@@ -103,8 +103,8 @@ DRV_NAME ".c:v" DRV_VERSION " " DRV_RELDATE " Richard Procter <rnp@paradise.net.
 #include <linux/ethtool.h>
 #include <linux/completion.h>
 #include <linux/bitops.h>
+#include <linux/semaphore.h>
 
-#include <asm/semaphore.h>
 #include <asm/uaccess.h>
 #include <asm/system.h>
 #include <asm/io.h>
index 45c3a208d93f081acd67743e77e304310c39ffd5..2399a3796f6ed2e0bd9f4049cc7ddbd87c468f00 100644 (file)
@@ -2335,7 +2335,7 @@ config UGETH_TX_ON_DEMAND
 
 config MV643XX_ETH
        tristate "Marvell Discovery (643XX) and Orion ethernet support"
-       depends on MV64360 || MV64X60 || (PPC_MULTIPLATFORM && PPC32) || ARCH_ORION
+       depends on MV64360 || MV64X60 || (PPC_MULTIPLATFORM && PPC32) || PLAT_ORION
        select MII
        help
          This driver supports the gigabit ethernet MACs in the
index 4d71729e85e51bbfb285407bca388e988239b448..2f1f3f2739fdf32dc088a883775491da4f3c161e 100644 (file)
@@ -218,7 +218,8 @@ obj-$(CONFIG_SMC911X) += smc911x.o
 obj-$(CONFIG_BFIN_MAC) += bfin_mac.o
 obj-$(CONFIG_DM9000) += dm9000.o
 obj-$(CONFIG_FEC_8XX) += fec_8xx/
-obj-$(CONFIG_PASEMI_MAC) += pasemi_mac.o
+obj-$(CONFIG_PASEMI_MAC) += pasemi_mac_driver.o
+pasemi_mac_driver-objs := pasemi_mac.o pasemi_mac_ethtool.o
 obj-$(CONFIG_MLX4_CORE) += mlx4/
 obj-$(CONFIG_ENC28J60) += enc28j60.o
 
index 65b901ebfd621de68c7cb7e45dce2b7480d93c8b..82e9a5bd0dd29f7a4297500910e292668832b817 100644 (file)
@@ -69,6 +69,7 @@ static const char *version =
 #include <linux/atalk.h>
 #include <linux/spinlock.h>
 #include <linux/bitops.h>
+#include <linux/jiffies.h>
 
 #include <asm/system.h>
 #include <asm/io.h>
@@ -503,7 +504,7 @@ static void cops_reset(struct net_device *dev, int sleep)
                         long snap=jiffies;
 
                        /* Let card finish initializing, about 1/3 second */
-                       while(jiffies-snap<HZ/3)
+                       while (time_before(jiffies, snap + HZ/3))
                                 schedule();
                 }
                 else
index 0ae0d83e5d2254b1db9b531103a3f88d4b50b7e3..978e20a1791bda8239cbc213b0e0afebab4461b4 100644 (file)
@@ -1043,7 +1043,9 @@ static int __init at91ether_setup(unsigned long phy_type, unsigned short phy_add
        } else if (machine_is_csb337()) {
                /* mix link activity status into LED2 link state */
                write_phy(phy_address, MII_LEDCTRL_REG, 0x0d22);
-       }
+       } else if (machine_is_ecbat91())
+               write_phy(phy_address, MII_LEDCTRL_REG, 0x156A);
+
        disable_mdi();
        spin_unlock_irq(&lp->lock);
 
index eb305a0895fc4a82e3ff99717dc82c6d709bf2f4..4fdb13f8447b36a979a36a7aaf6f8fff0af8439b 100644 (file)
@@ -43,7 +43,6 @@
 #include <linux/mutex.h>
 #include <linux/bitops.h>
 #include "t3cdev.h"
-#include <asm/semaphore.h>
 #include <asm/io.h>
 
 struct vlan_group;
index 77fcc1a4984eda92d650d1c06cc369b37a93868f..a18c8a140424b54407af52947a975e09a4215350 100644 (file)
@@ -34,7 +34,6 @@
 
 #include <linux/list.h>
 #include <asm/atomic.h>
-#include <asm/semaphore.h>
 #include <linux/netdevice.h>
 #include <linux/proc_fs.h>
 #include <linux/skbuff.h>
index 0a9b75139e0f1f82e648df994b79aa9b05a7d20f..1da55dd2a5a0a07b4e05340a050e618bbf805166 100644 (file)
@@ -33,7 +33,7 @@
 #include <linux/init.h>
 #include <linux/ip.h>
 #include <linux/tcp.h>
-#include <asm/semaphore.h>
+#include <linux/semaphore.h>
 #include <asm/atomic.h>
 
 #define SIXPACK_VERSION    "Revision: 0.3.0"
index bb31e09899fc6a6fc06487b7409f19562a336bfa..ce4fc2ec2fe4650af4fe4ee614ca9503e0060f86 100644 (file)
@@ -49,7 +49,6 @@
 #include <linux/in.h>
 #include <linux/ip.h>
 #include <net/net_namespace.h>
-#include <asm/semaphore.h>
 #include <asm/hvcall.h>
 #include <asm/atomic.h>
 #include <asm/vio.h>
index 8c09344f58dc7a2440fbe968b4d76c32ee7300b1..8db71ab20456b38d14ce1f8e5cd4e1e8e4c87ecf 100644 (file)
@@ -36,6 +36,7 @@
 #include <asm/hardware.h>
 #include <asm/arch/irda.h>
 #include <asm/arch/pxa-regs.h>
+#include <asm/arch/pxa2xx-gpio.h>
 
 #ifdef CONFIG_MACH_MAINSTONE
 #include <asm/arch/mainstone.h>
@@ -831,6 +832,11 @@ static int pxa_irda_probe(struct platform_device *pdev)
        if (err)
                goto err_mem_5;
 
+       if (si->pdata->startup)
+               err = si->pdata->startup(si->dev);
+       if (err)
+               goto err_startup;
+
        dev->hard_start_xmit    = pxa_irda_hard_xmit;
        dev->open               = pxa_irda_start;
        dev->stop               = pxa_irda_stop;
@@ -856,6 +862,9 @@ static int pxa_irda_probe(struct platform_device *pdev)
                dev_set_drvdata(&pdev->dev, dev);
 
        if (err) {
+               if (si->pdata->shutdown)
+                       si->pdata->shutdown(si->dev);
+err_startup:
                kfree(si->tx_buff.head);
 err_mem_5:
                kfree(si->rx_buff.head);
@@ -881,6 +890,8 @@ static int pxa_irda_remove(struct platform_device *_dev)
        if (dev) {
                struct pxa_irda *si = netdev_priv(dev);
                unregister_netdev(dev);
+               if (si->pdata->shutdown)
+                       si->pdata->shutdown(si->dev);
                kfree(si->tx_buff.head);
                kfree(si->rx_buff.head);
                clk_put(si->fir_clk);
index 58d3bb622da6eabf5e7b5018c03fa83809019205..b8d0639c1cdfa655c2b3ab5f499de6310668cc02 100644 (file)
@@ -308,7 +308,8 @@ static void veth_complete_allocation(void *parm, int number)
 
 static int veth_allocate_events(HvLpIndex rlp, int number)
 {
-       struct veth_allocation vc = { COMPLETION_INITIALIZER(vc.c), 0 };
+       struct veth_allocation vc =
+               { COMPLETION_INITIALIZER_ONSTACK(vc.c), 0 };
 
        mf_allocate_lp_events(rlp, HvLpEvent_Type_VirtualLan,
                            sizeof(struct veth_lpevent), number,
index 160f605e58db1fb9508f5bc44e9a83c8372e0b8f..24d027e29c45a60fa340b13d5bcede0981f6b8e3 100644 (file)
@@ -34,7 +34,6 @@
 #include <linux/kernel.h>
 #include <linux/version.h>
 
-#include <asm/semaphore.h>
 #include <linux/spinlock.h>
 #include <asm/irq.h>
 #include <linux/init.h>
index bcd7f9814ed825a6699cfe8e6b7f509218dc48ae..3b2a6c5980883b6d86e46542910586b29cb8d220 100644 (file)
  * - Multiqueue RX/TX
  */
 
-
-/* Must be a power of two */
-#define RX_RING_SIZE 2048
-#define TX_RING_SIZE 4096
-
 #define LRO_MAX_AGGR 64
 
 #define PE_MIN_MTU     64
-#define PE_MAX_MTU     1500
+#define PE_MAX_MTU     9000
 #define PE_DEF_MTU     ETH_DATA_LEN
 
 #define DEFAULT_MSG_ENABLE       \
         NETIF_MSG_RX_ERR       | \
         NETIF_MSG_TX_ERR)
 
-#define TX_DESC(tx, num)       ((tx)->chan.ring_virt[(num) & (TX_RING_SIZE-1)])
-#define TX_DESC_INFO(tx, num)  ((tx)->ring_info[(num) & (TX_RING_SIZE-1)])
-#define RX_DESC(rx, num)       ((rx)->chan.ring_virt[(num) & (RX_RING_SIZE-1)])
-#define RX_DESC_INFO(rx, num)  ((rx)->ring_info[(num) & (RX_RING_SIZE-1)])
-#define RX_BUFF(rx, num)       ((rx)->buffers[(num) & (RX_RING_SIZE-1)])
-
-#define RING_USED(ring)                (((ring)->next_to_fill - (ring)->next_to_clean) \
-                                & ((ring)->size - 1))
-#define RING_AVAIL(ring)       ((ring->size) - RING_USED(ring))
-
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR ("Olof Johansson <olof@lixom.net>");
 MODULE_DESCRIPTION("PA Semi PWRficient Ethernet driver");
@@ -94,6 +79,8 @@ static int debug = -1;        /* -1 == use DEFAULT_MSG_ENABLE as value */
 module_param(debug, int, 0);
 MODULE_PARM_DESC(debug, "PA Semi MAC bitmapped debugging message enable value");
 
+extern const struct ethtool_ops pasemi_mac_ethtool_ops;
+
 static int translation_enabled(void)
 {
 #if defined(CONFIG_PPC_PASEMI_IOMMU_DMA_FORCE)
@@ -322,6 +309,104 @@ static int pasemi_mac_unmap_tx_skb(struct pasemi_mac *mac,
        return (nfrags + 3) & ~1;
 }
 
+static struct pasemi_mac_csring *pasemi_mac_setup_csring(struct pasemi_mac *mac)
+{
+       struct pasemi_mac_csring *ring;
+       u32 val;
+       unsigned int cfg;
+       int chno;
+
+       ring = pasemi_dma_alloc_chan(TXCHAN, sizeof(struct pasemi_mac_csring),
+                                      offsetof(struct pasemi_mac_csring, chan));
+
+       if (!ring) {
+               dev_err(&mac->pdev->dev, "Can't allocate checksum channel\n");
+               goto out_chan;
+       }
+
+       chno = ring->chan.chno;
+
+       ring->size = CS_RING_SIZE;
+       ring->next_to_fill = 0;
+
+       /* Allocate descriptors */
+       if (pasemi_dma_alloc_ring(&ring->chan, CS_RING_SIZE))
+               goto out_ring_desc;
+
+       write_dma_reg(PAS_DMA_TXCHAN_BASEL(chno),
+                     PAS_DMA_TXCHAN_BASEL_BRBL(ring->chan.ring_dma));
+       val = PAS_DMA_TXCHAN_BASEU_BRBH(ring->chan.ring_dma >> 32);
+       val |= PAS_DMA_TXCHAN_BASEU_SIZ(CS_RING_SIZE >> 3);
+
+       write_dma_reg(PAS_DMA_TXCHAN_BASEU(chno), val);
+
+       ring->events[0] = pasemi_dma_alloc_flag();
+       ring->events[1] = pasemi_dma_alloc_flag();
+       if (ring->events[0] < 0 || ring->events[1] < 0)
+               goto out_flags;
+
+       pasemi_dma_clear_flag(ring->events[0]);
+       pasemi_dma_clear_flag(ring->events[1]);
+
+       ring->fun = pasemi_dma_alloc_fun();
+       if (ring->fun < 0)
+               goto out_fun;
+
+       cfg = PAS_DMA_TXCHAN_CFG_TY_FUNC | PAS_DMA_TXCHAN_CFG_UP |
+             PAS_DMA_TXCHAN_CFG_TATTR(ring->fun) |
+             PAS_DMA_TXCHAN_CFG_LPSQ | PAS_DMA_TXCHAN_CFG_LPDQ;
+
+       if (translation_enabled())
+               cfg |= PAS_DMA_TXCHAN_CFG_TRD | PAS_DMA_TXCHAN_CFG_TRR;
+
+       write_dma_reg(PAS_DMA_TXCHAN_CFG(chno), cfg);
+
+       /* enable channel */
+       pasemi_dma_start_chan(&ring->chan, PAS_DMA_TXCHAN_TCMDSTA_SZ |
+                                          PAS_DMA_TXCHAN_TCMDSTA_DB |
+                                          PAS_DMA_TXCHAN_TCMDSTA_DE |
+                                          PAS_DMA_TXCHAN_TCMDSTA_DA);
+
+       return ring;
+
+out_fun:
+out_flags:
+       if (ring->events[0] >= 0)
+               pasemi_dma_free_flag(ring->events[0]);
+       if (ring->events[1] >= 0)
+               pasemi_dma_free_flag(ring->events[1]);
+       pasemi_dma_free_ring(&ring->chan);
+out_ring_desc:
+       pasemi_dma_free_chan(&ring->chan);
+out_chan:
+
+       return NULL;
+}
+
+static void pasemi_mac_setup_csrings(struct pasemi_mac *mac)
+{
+       int i;
+       mac->cs[0] = pasemi_mac_setup_csring(mac);
+       if (mac->type == MAC_TYPE_XAUI)
+               mac->cs[1] = pasemi_mac_setup_csring(mac);
+       else
+               mac->cs[1] = 0;
+
+       for (i = 0; i < MAX_CS; i++)
+               if (mac->cs[i])
+                       mac->num_cs++;
+}
+
+static void pasemi_mac_free_csring(struct pasemi_mac_csring *csring)
+{
+       pasemi_dma_stop_chan(&csring->chan);
+       pasemi_dma_free_flag(csring->events[0]);
+       pasemi_dma_free_flag(csring->events[1]);
+       pasemi_dma_free_ring(&csring->chan);
+       pasemi_dma_free_chan(&csring->chan);
+       pasemi_dma_free_fun(csring->fun);
+}
+
 static int pasemi_mac_setup_rx_resources(const struct net_device *dev)
 {
        struct pasemi_mac_rxring *ring;
@@ -445,7 +530,7 @@ pasemi_mac_setup_tx_resources(const struct net_device *dev)
        cfg = PAS_DMA_TXCHAN_CFG_TY_IFACE |
              PAS_DMA_TXCHAN_CFG_TATTR(mac->dma_if) |
              PAS_DMA_TXCHAN_CFG_UP |
-             PAS_DMA_TXCHAN_CFG_WT(2);
+             PAS_DMA_TXCHAN_CFG_WT(4);
 
        if (translation_enabled())
                cfg |= PAS_DMA_TXCHAN_CFG_TRD | PAS_DMA_TXCHAN_CFG_TRR;
@@ -810,13 +895,21 @@ restart:
                u64 mactx = TX_DESC(txring, i);
                struct sk_buff *skb;
 
-               skb = TX_DESC_INFO(txring, i+1).skb;
-               nr_frags = TX_DESC_INFO(txring, i).dma;
-
                if ((mactx  & XCT_MACTX_E) ||
                    (*chan->status & PAS_STATUS_ERROR))
                        pasemi_mac_tx_error(mac, mactx);
 
+               /* Skip over control descriptors */
+               if (!(mactx & XCT_MACTX_LLEN_M)) {
+                       TX_DESC(txring, i) = 0;
+                       TX_DESC(txring, i+1) = 0;
+                       buf_count = 2;
+                       continue;
+               }
+
+               skb = TX_DESC_INFO(txring, i+1).skb;
+               nr_frags = TX_DESC_INFO(txring, i).dma;
+
                if (unlikely(mactx & XCT_MACTX_O))
                        /* Not yet transmitted */
                        break;
@@ -1041,13 +1134,7 @@ static int pasemi_mac_open(struct net_device *dev)
 {
        struct pasemi_mac *mac = netdev_priv(dev);
        unsigned int flags;
-       int ret;
-
-       /* enable rx section */
-       write_dma_reg(PAS_DMA_COM_RXCMD, PAS_DMA_COM_RXCMD_EN);
-
-       /* enable tx section */
-       write_dma_reg(PAS_DMA_COM_TXCMD, PAS_DMA_COM_TXCMD_EN);
+       int i, ret;
 
        flags = PAS_MAC_CFG_TXP_FCE | PAS_MAC_CFG_TXP_FPC(3) |
                PAS_MAC_CFG_TXP_SL(3) | PAS_MAC_CFG_TXP_COB(0xf) |
@@ -1064,6 +1151,19 @@ static int pasemi_mac_open(struct net_device *dev)
        if (!mac->tx)
                goto out_tx_ring;
 
+       /* We might already have allocated rings in case mtu was changed
+        * before interface was brought up.
+        */
+       if (dev->mtu > 1500 && !mac->num_cs) {
+               pasemi_mac_setup_csrings(mac);
+               if (!mac->num_cs)
+                       goto out_tx_ring;
+       }
+
+       /* Zero out rmon counters */
+       for (i = 0; i < 32; i++)
+               write_mac_reg(mac, PAS_MAC_RMON(i), 0);
+
        /* 0x3ff with 33MHz clock is about 31us */
        write_iob_reg(PAS_IOB_DMA_COM_TIMEOUTCFG,
                      PAS_IOB_DMA_COM_TIMEOUTCFG_TCNT(0x3ff));
@@ -1247,7 +1347,7 @@ static int pasemi_mac_close(struct net_device *dev)
 {
        struct pasemi_mac *mac = netdev_priv(dev);
        unsigned int sta;
-       int rxch, txch;
+       int rxch, txch, i;
 
        rxch = rx_ring(mac)->chan.chno;
        txch = tx_ring(mac)->chan.chno;
@@ -1292,6 +1392,13 @@ static int pasemi_mac_close(struct net_device *dev)
        free_irq(mac->tx->chan.irq, mac->tx);
        free_irq(mac->rx->chan.irq, mac->rx);
 
+       for (i = 0; i < mac->num_cs; i++) {
+               pasemi_mac_free_csring(mac->cs[i]);
+               mac->cs[i] = NULL;
+       }
+
+       mac->num_cs = 0;
+
        /* Free resources */
        pasemi_mac_free_rx_resources(mac);
        pasemi_mac_free_tx_resources(mac);
@@ -1299,35 +1406,113 @@ static int pasemi_mac_close(struct net_device *dev)
        return 0;
 }
 
+static void pasemi_mac_queue_csdesc(const struct sk_buff *skb,
+                                   const dma_addr_t *map,
+                                   const unsigned int *map_size,
+                                   struct pasemi_mac_txring *txring,
+                                   struct pasemi_mac_csring *csring)
+{
+       u64 fund;
+       dma_addr_t cs_dest;
+       const int nh_off = skb_network_offset(skb);
+       const int nh_len = skb_network_header_len(skb);
+       const int nfrags = skb_shinfo(skb)->nr_frags;
+       int cs_size, i, fill, hdr, cpyhdr, evt;
+       dma_addr_t csdma;
+
+       fund = XCT_FUN_ST | XCT_FUN_RR_8BRES |
+              XCT_FUN_O | XCT_FUN_FUN(csring->fun) |
+              XCT_FUN_CRM_SIG | XCT_FUN_LLEN(skb->len - nh_off) |
+              XCT_FUN_SHL(nh_len >> 2) | XCT_FUN_SE;
+
+       switch (ip_hdr(skb)->protocol) {
+       case IPPROTO_TCP:
+               fund |= XCT_FUN_SIG_TCP4;
+               /* TCP checksum is 16 bytes into the header */
+               cs_dest = map[0] + skb_transport_offset(skb) + 16;
+               break;
+       case IPPROTO_UDP:
+               fund |= XCT_FUN_SIG_UDP4;
+               /* UDP checksum is 6 bytes into the header */
+               cs_dest = map[0] + skb_transport_offset(skb) + 6;
+               break;
+       default:
+               BUG();
+       }
+
+       /* Do the checksum offloaded */
+       fill = csring->next_to_fill;
+       hdr = fill;
+
+       CS_DESC(csring, fill++) = fund;
+       /* Room for 8BRES. Checksum result is really 2 bytes into it */
+       csdma = csring->chan.ring_dma + (fill & (CS_RING_SIZE-1)) * 8 + 2;
+       CS_DESC(csring, fill++) = 0;
+
+       CS_DESC(csring, fill) = XCT_PTR_LEN(map_size[0]-nh_off) | XCT_PTR_ADDR(map[0]+nh_off);
+       for (i = 1; i <= nfrags; i++)
+               CS_DESC(csring, fill+i) = XCT_PTR_LEN(map_size[i]) | XCT_PTR_ADDR(map[i]);
+
+       fill += i;
+       if (fill & 1)
+               fill++;
+
+       /* Copy the result into the TCP packet */
+       cpyhdr = fill;
+       CS_DESC(csring, fill++) = XCT_FUN_O | XCT_FUN_FUN(csring->fun) |
+                                 XCT_FUN_LLEN(2) | XCT_FUN_SE;
+       CS_DESC(csring, fill++) = XCT_PTR_LEN(2) | XCT_PTR_ADDR(cs_dest) | XCT_PTR_T;
+       CS_DESC(csring, fill++) = XCT_PTR_LEN(2) | XCT_PTR_ADDR(csdma);
+       fill++;
+
+       evt = !csring->last_event;
+       csring->last_event = evt;
+
+       /* Event handshaking with MAC TX */
+       CS_DESC(csring, fill++) = CTRL_CMD_T | CTRL_CMD_META_EVT | CTRL_CMD_O |
+                                 CTRL_CMD_ETYPE_SET | CTRL_CMD_REG(csring->events[evt]);
+       CS_DESC(csring, fill++) = 0;
+       CS_DESC(csring, fill++) = CTRL_CMD_T | CTRL_CMD_META_EVT | CTRL_CMD_O |
+                                 CTRL_CMD_ETYPE_WCLR | CTRL_CMD_REG(csring->events[!evt]);
+       CS_DESC(csring, fill++) = 0;
+       csring->next_to_fill = fill & (CS_RING_SIZE-1);
+
+       cs_size = fill - hdr;
+       write_dma_reg(PAS_DMA_TXCHAN_INCR(csring->chan.chno), (cs_size) >> 1);
+
+       /* TX-side event handshaking */
+       fill = txring->next_to_fill;
+       TX_DESC(txring, fill++) = CTRL_CMD_T | CTRL_CMD_META_EVT | CTRL_CMD_O |
+                                 CTRL_CMD_ETYPE_WSET | CTRL_CMD_REG(csring->events[evt]);
+       TX_DESC(txring, fill++) = 0;
+       TX_DESC(txring, fill++) = CTRL_CMD_T | CTRL_CMD_META_EVT | CTRL_CMD_O |
+                                 CTRL_CMD_ETYPE_CLR | CTRL_CMD_REG(csring->events[!evt]);
+       TX_DESC(txring, fill++) = 0;
+       txring->next_to_fill = fill;
+
+       write_dma_reg(PAS_DMA_TXCHAN_INCR(txring->chan.chno), 2);
+
+       return;
+}
+
 static int pasemi_mac_start_tx(struct sk_buff *skb, struct net_device *dev)
 {
-       struct pasemi_mac *mac = netdev_priv(dev);
-       struct pasemi_mac_txring *txring;
-       u64 dflags, mactx;
+       struct pasemi_mac * const mac = netdev_priv(dev);
+       struct pasemi_mac_txring * const txring = tx_ring(mac);
+       struct pasemi_mac_csring *csring;
+       u64 dflags = 0;
+       u64 mactx;
        dma_addr_t map[MAX_SKB_FRAGS+1];
        unsigned int map_size[MAX_SKB_FRAGS+1];
        unsigned long flags;
        int i, nfrags;
        int fill;
+       const int nh_off = skb_network_offset(skb);
+       const int nh_len = skb_network_header_len(skb);
 
-       dflags = XCT_MACTX_O | XCT_MACTX_ST | XCT_MACTX_CRC_PAD;
-
-       if (skb->ip_summed == CHECKSUM_PARTIAL) {
-               const unsigned char *nh = skb_network_header(skb);
+       prefetch(&txring->ring_info);
 
-               switch (ip_hdr(skb)->protocol) {
-               case IPPROTO_TCP:
-                       dflags |= XCT_MACTX_CSUM_TCP;
-                       dflags |= XCT_MACTX_IPH(skb_network_header_len(skb) >> 2);
-                       dflags |= XCT_MACTX_IPO(nh - skb->data);
-                       break;
-               case IPPROTO_UDP:
-                       dflags |= XCT_MACTX_CSUM_UDP;
-                       dflags |= XCT_MACTX_IPH(skb_network_header_len(skb) >> 2);
-                       dflags |= XCT_MACTX_IPO(nh - skb->data);
-                       break;
-               }
-       }
+       dflags = XCT_MACTX_O | XCT_MACTX_ST | XCT_MACTX_CRC_PAD;
 
        nfrags = skb_shinfo(skb)->nr_frags;
 
@@ -1350,24 +1535,46 @@ static int pasemi_mac_start_tx(struct sk_buff *skb, struct net_device *dev)
                }
        }
 
-       mactx = dflags | XCT_MACTX_LLEN(skb->len);
+       if (skb->ip_summed == CHECKSUM_PARTIAL && skb->len <= 1540) {
+               switch (ip_hdr(skb)->protocol) {
+               case IPPROTO_TCP:
+                       dflags |= XCT_MACTX_CSUM_TCP;
+                       dflags |= XCT_MACTX_IPH(nh_len >> 2);
+                       dflags |= XCT_MACTX_IPO(nh_off);
+                       break;
+               case IPPROTO_UDP:
+                       dflags |= XCT_MACTX_CSUM_UDP;
+                       dflags |= XCT_MACTX_IPH(nh_len >> 2);
+                       dflags |= XCT_MACTX_IPO(nh_off);
+                       break;
+               default:
+                       WARN_ON(1);
+               }
+       }
 
-       txring = tx_ring(mac);
+       mactx = dflags | XCT_MACTX_LLEN(skb->len);
 
        spin_lock_irqsave(&txring->lock, flags);
 
-       fill = txring->next_to_fill;
-
        /* Avoid stepping on the same cache line that the DMA controller
         * is currently about to send, so leave at least 8 words available.
         * Total free space needed is mactx + fragments + 8
         */
-       if (RING_AVAIL(txring) < nfrags + 10) {
+       if (RING_AVAIL(txring) < nfrags + 14) {
                /* no room -- stop the queue and wait for tx intr */
                netif_stop_queue(dev);
                goto out_err;
        }
 
+       /* Queue up checksum + event descriptors, if needed */
+       if (mac->num_cs && skb->ip_summed == CHECKSUM_PARTIAL && skb->len > 1540) {
+               csring = mac->cs[mac->last_cs];
+               mac->last_cs = (mac->last_cs + 1) % mac->num_cs;
+
+               pasemi_mac_queue_csdesc(skb, map, map_size, txring, csring);
+       }
+
+       fill = txring->next_to_fill;
        TX_DESC(txring, fill) = mactx;
        TX_DESC_INFO(txring, fill).dma = nfrags;
        fill++;
@@ -1441,12 +1648,33 @@ static int pasemi_mac_poll(struct napi_struct *napi, int budget)
        return pkts;
 }
 
+#ifdef CONFIG_NET_POLL_CONTROLLER
+/*
+ * Polling 'interrupt' - used by things like netconsole to send skbs
+ * without having to re-enable interrupts. It's not called while
+ * the interrupt routine is executing.
+ */
+static void pasemi_mac_netpoll(struct net_device *dev)
+{
+       const struct pasemi_mac *mac = netdev_priv(dev);
+
+       disable_irq(mac->tx->chan.irq);
+       pasemi_mac_tx_intr(mac->tx->chan.irq, mac->tx);
+       enable_irq(mac->tx->chan.irq);
+
+       disable_irq(mac->rx->chan.irq);
+       pasemi_mac_rx_intr(mac->rx->chan.irq, mac->rx);
+       enable_irq(mac->rx->chan.irq);
+}
+#endif
+
 static int pasemi_mac_change_mtu(struct net_device *dev, int new_mtu)
 {
        struct pasemi_mac *mac = netdev_priv(dev);
        unsigned int reg;
-       unsigned int rcmdsta;
+       unsigned int rcmdsta = 0;
        int running;
+       int ret = 0;
 
        if (new_mtu < PE_MIN_MTU || new_mtu > PE_MAX_MTU)
                return -EINVAL;
@@ -1468,6 +1696,16 @@ static int pasemi_mac_change_mtu(struct net_device *dev, int new_mtu)
                pasemi_mac_pause_rxint(mac);
                pasemi_mac_clean_rx(rx_ring(mac), RX_RING_SIZE);
                pasemi_mac_free_rx_buffers(mac);
+
+       }
+
+       /* Setup checksum channels if large MTU and none already allocated */
+       if (new_mtu > 1500 && !mac->num_cs) {
+               pasemi_mac_setup_csrings(mac);
+               if (!mac->num_cs) {
+                       ret = -ENOMEM;
+                       goto out;
+               }
        }
 
        /* Change maxf, i.e. what size frames are accepted.
@@ -1482,6 +1720,7 @@ static int pasemi_mac_change_mtu(struct net_device *dev, int new_mtu)
        /* MTU + ETH_HLEN + VLAN_HLEN + 2 64B cachelines */
        mac->bufsz = new_mtu + ETH_HLEN + ETH_FCS_LEN + LOCAL_SKB_ALIGN + 128;
 
+out:
        if (running) {
                write_dma_reg(PAS_DMA_RXINT_RCMDSTA(mac->dma_if),
                              rcmdsta | PAS_DMA_RXINT_RCMDSTA_EN);
@@ -1494,7 +1733,7 @@ static int pasemi_mac_change_mtu(struct net_device *dev, int new_mtu)
                pasemi_mac_intf_enable(mac);
        }
 
-       return 0;
+       return ret;
 }
 
 static int __devinit
@@ -1528,7 +1767,7 @@ pasemi_mac_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
        netif_napi_add(dev, &mac->napi, pasemi_mac_poll, 64);
 
        dev->features = NETIF_F_IP_CSUM | NETIF_F_LLTX | NETIF_F_SG |
-                       NETIF_F_HIGHDMA;
+                       NETIF_F_HIGHDMA | NETIF_F_GSO;
 
        mac->lro_mgr.max_aggr = LRO_MAX_AGGR;
        mac->lro_mgr.max_desc = MAX_LRO_DESCRIPTORS;
@@ -1588,8 +1827,12 @@ pasemi_mac_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
        dev->mtu = PE_DEF_MTU;
        /* 1500 MTU + ETH_HLEN + VLAN_HLEN + 2 64B cachelines */
        mac->bufsz = dev->mtu + ETH_HLEN + ETH_FCS_LEN + LOCAL_SKB_ALIGN + 128;
+#ifdef CONFIG_NET_POLL_CONTROLLER
+       dev->poll_controller = pasemi_mac_netpoll;
+#endif
 
        dev->change_mtu = pasemi_mac_change_mtu;
+       dev->ethtool_ops = &pasemi_mac_ethtool_ops;
 
        if (err)
                goto out;
index 99e7b9329a6fb5366936d62f399b513a676b5897..1a115ec60b531d4bf407f406716fc8ccf9ac72f0 100644 (file)
 #include <linux/spinlock.h>
 #include <linux/phy.h>
 
+/* Must be a power of two */
+#define RX_RING_SIZE 2048
+#define TX_RING_SIZE 4096
+#define CS_RING_SIZE (TX_RING_SIZE*2)
+
+
 #define MAX_LRO_DESCRIPTORS 8
+#define MAX_CS 2
 
 struct pasemi_mac_txring {
        struct pasemi_dmachan chan; /* Must be first */
@@ -51,6 +58,15 @@ struct pasemi_mac_rxring {
        struct pasemi_mac *mac; /* Needed in intr handler */
 };
 
+struct pasemi_mac_csring {
+       struct pasemi_dmachan chan;
+       unsigned int    size;
+       unsigned int    next_to_fill;
+       int             events[2];
+       int             last_event;
+       int             fun;
+};
+
 struct pasemi_mac {
        struct net_device *netdev;
        struct pci_dev *pdev;
@@ -60,10 +76,12 @@ struct pasemi_mac {
        struct napi_struct napi;
 
        int             bufsz; /* RX ring buffer size */
+       int             last_cs;
+       int             num_cs;
+       u32             dma_if;
        u8              type;
 #define MAC_TYPE_GMAC  1
 #define MAC_TYPE_XAUI  2
-       u32     dma_if;
 
        u8              mac_addr[6];
 
@@ -74,6 +92,7 @@ struct pasemi_mac {
 
        struct pasemi_mac_txring *tx;
        struct pasemi_mac_rxring *rx;
+       struct pasemi_mac_csring *cs[MAX_CS];
        char            tx_irq_name[10];                /* "eth%d tx" */
        char            rx_irq_name[10];                /* "eth%d rx" */
        int     link;
@@ -90,6 +109,16 @@ struct pasemi_mac_buffer {
        dma_addr_t      dma;
 };
 
+#define TX_DESC(tx, num)       ((tx)->chan.ring_virt[(num) & (TX_RING_SIZE-1)])
+#define TX_DESC_INFO(tx, num)  ((tx)->ring_info[(num) & (TX_RING_SIZE-1)])
+#define RX_DESC(rx, num)       ((rx)->chan.ring_virt[(num) & (RX_RING_SIZE-1)])
+#define RX_DESC_INFO(rx, num)  ((rx)->ring_info[(num) & (RX_RING_SIZE-1)])
+#define RX_BUFF(rx, num)       ((rx)->buffers[(num) & (RX_RING_SIZE-1)])
+#define CS_DESC(cs, num)       ((cs)->chan.ring_virt[(num) & (CS_RING_SIZE-1)])
+
+#define RING_USED(ring)        (((ring)->next_to_fill - (ring)->next_to_clean) \
+                               & ((ring)->size - 1))
+#define RING_AVAIL(ring)       ((ring->size) - RING_USED(ring))
 
 /* PCI register offsets and formats */
 
@@ -101,6 +130,7 @@ enum {
        PAS_MAC_CFG_ADR0 = 0x8c,
        PAS_MAC_CFG_ADR1 = 0x90,
        PAS_MAC_CFG_TXP = 0x98,
+       PAS_MAC_CFG_RMON = 0x100,
        PAS_MAC_IPC_CHNL = 0x208,
 };
 
@@ -172,6 +202,8 @@ enum {
 #define PAS_MAC_CFG_TXP_TIFG(x)                (((x) << PAS_MAC_CFG_TXP_TIFG_S) & \
                                         PAS_MAC_CFG_TXP_TIFG_M)
 
+#define PAS_MAC_RMON(r)                        (0x100+(r)*4)
+
 #define PAS_MAC_IPC_CHNL_DCHNO_M       0x003f0000
 #define PAS_MAC_IPC_CHNL_DCHNO_S       16
 #define PAS_MAC_IPC_CHNL_DCHNO(x)      (((x) << PAS_MAC_IPC_CHNL_DCHNO_S) & \
@@ -181,4 +213,5 @@ enum {
 #define PAS_MAC_IPC_CHNL_BCH(x)                (((x) << PAS_MAC_IPC_CHNL_BCH_S) & \
                                         PAS_MAC_IPC_CHNL_BCH_M)
 
+
 #endif /* PASEMI_MAC_H */
diff --git a/drivers/net/pasemi_mac_ethtool.c b/drivers/net/pasemi_mac_ethtool.c
new file mode 100644 (file)
index 0000000..5e8df3a
--- /dev/null
@@ -0,0 +1,159 @@
+/*
+ * Copyright (C) 2006-2008 PA Semi, Inc
+ *
+ * Ethtool hooks for the PA Semi PWRficient onchip 1G/10G Ethernet MACs
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+ */
+
+
+#include <linux/netdevice.h>
+#include <linux/ethtool.h>
+#include <linux/pci.h>
+#include <linux/inet_lro.h>
+
+#include <asm/pasemi_dma.h>
+#include "pasemi_mac.h"
+
+static struct {
+       const char str[ETH_GSTRING_LEN];
+} ethtool_stats_keys[] = {
+       { "rx-drops" },
+       { "rx-bytes" },
+       { "rx-packets" },
+       { "rx-broadcast-packets" },
+       { "rx-multicast-packets" },
+       { "rx-crc-errors" },
+       { "rx-undersize-errors" },
+       { "rx-oversize-errors" },
+       { "rx-short-fragment-errors" },
+       { "rx-jabber-errors" },
+       { "rx-64-byte-packets" },
+       { "rx-65-127-byte-packets" },
+       { "rx-128-255-byte-packets" },
+       { "rx-256-511-byte-packets" },
+       { "rx-512-1023-byte-packets" },
+       { "rx-1024-1518-byte-packets" },
+       { "rx-pause-frames" },
+       { "tx-bytes" },
+       { "tx-packets" },
+       { "tx-broadcast-packets" },
+       { "tx-multicast-packets" },
+       { "tx-collisions" },
+       { "tx-late-collisions" },
+       { "tx-excessive-collisions" },
+       { "tx-crc-errors" },
+       { "tx-undersize-errors" },
+       { "tx-oversize-errors" },
+       { "tx-64-byte-packets" },
+       { "tx-65-127-byte-packets" },
+       { "tx-128-255-byte-packets" },
+       { "tx-256-511-byte-packets" },
+       { "tx-512-1023-byte-packets" },
+       { "tx-1024-1518-byte-packets" },
+};
+
+static int
+pasemi_mac_ethtool_get_settings(struct net_device *netdev,
+                              struct ethtool_cmd *cmd)
+{
+       struct pasemi_mac *mac = netdev_priv(netdev);
+       struct phy_device *phydev = mac->phydev;
+
+       return phy_ethtool_gset(phydev, cmd);
+}
+
+static void
+pasemi_mac_ethtool_get_drvinfo(struct net_device *netdev,
+                              struct ethtool_drvinfo *drvinfo)
+{
+       struct pasemi_mac *mac;
+       mac = netdev_priv(netdev);
+
+       /* clear and fill out info */
+       memset(drvinfo, 0, sizeof(struct ethtool_drvinfo));
+       strncpy(drvinfo->driver, "pasemi_mac", 12);
+       strcpy(drvinfo->version, "N/A");
+       strcpy(drvinfo->fw_version, "N/A");
+       strncpy(drvinfo->bus_info, pci_name(mac->pdev), 32);
+}
+
+static u32
+pasemi_mac_ethtool_get_msglevel(struct net_device *netdev)
+{
+       struct pasemi_mac *mac = netdev_priv(netdev);
+       return mac->msg_enable;
+}
+
+static void
+pasemi_mac_ethtool_set_msglevel(struct net_device *netdev,
+                               u32 level)
+{
+       struct pasemi_mac *mac = netdev_priv(netdev);
+       mac->msg_enable = level;
+}
+
+
+static void
+pasemi_mac_ethtool_get_ringparam(struct net_device *netdev,
+                                struct ethtool_ringparam *ering)
+{
+       struct pasemi_mac *mac = netdev->priv;
+
+       ering->tx_max_pending = TX_RING_SIZE/2;
+       ering->tx_pending = RING_USED(mac->tx)/2;
+       ering->rx_max_pending = RX_RING_SIZE/4;
+       ering->rx_pending = RING_USED(mac->rx)/4;
+}
+
+static int pasemi_mac_get_sset_count(struct net_device *netdev, int sset)
+{
+       switch (sset) {
+       case ETH_SS_STATS:
+               return ARRAY_SIZE(ethtool_stats_keys);
+       default:
+               return -EOPNOTSUPP;
+       }
+}
+
+static void pasemi_mac_get_ethtool_stats(struct net_device *netdev,
+               struct ethtool_stats *stats, u64 *data)
+{
+       struct pasemi_mac *mac = netdev->priv;
+       int i;
+
+       data[0] = pasemi_read_dma_reg(PAS_DMA_RXINT_RCMDSTA(mac->dma_if))
+                       >> PAS_DMA_RXINT_RCMDSTA_DROPS_S;
+       for (i = 0; i < 32; i++)
+               data[1+i] = pasemi_read_mac_reg(mac->dma_if, PAS_MAC_RMON(i));
+}
+
+static void pasemi_mac_get_strings(struct net_device *netdev, u32 stringset,
+                                  u8 *data)
+{
+       memcpy(data, ethtool_stats_keys, sizeof(ethtool_stats_keys));
+}
+
+const struct ethtool_ops pasemi_mac_ethtool_ops = {
+       .get_settings           = pasemi_mac_ethtool_get_settings,
+       .get_drvinfo            = pasemi_mac_ethtool_get_drvinfo,
+       .get_msglevel           = pasemi_mac_ethtool_get_msglevel,
+       .set_msglevel           = pasemi_mac_ethtool_set_msglevel,
+       .get_link               = ethtool_op_get_link,
+       .get_ringparam          = pasemi_mac_ethtool_get_ringparam,
+       .get_strings            = pasemi_mac_get_strings,
+       .get_sset_count         = pasemi_mac_get_sset_count,
+       .get_ethtool_stats      = pasemi_mac_get_ethtool_stats,
+};
+
index 7eb6e7e848f414a08c80343759207e5dd1b0ed98..e365efb3c6275c6af7d7fc4fa9688e95a953b86c 100644 (file)
@@ -1266,6 +1266,85 @@ int gelic_net_set_rx_csum(struct net_device *netdev, u32 data)
        return 0;
 }
 
+static void gelic_net_get_wol(struct net_device *netdev,
+                             struct ethtool_wolinfo *wol)
+{
+       if (0 <= ps3_compare_firmware_version(2, 2, 0))
+               wol->supported = WAKE_MAGIC;
+       else
+               wol->supported = 0;
+
+       wol->wolopts = ps3_sys_manager_get_wol() ? wol->supported : 0;
+       memset(&wol->sopass, 0, sizeof(wol->sopass));
+}
+static int gelic_net_set_wol(struct net_device *netdev,
+                            struct ethtool_wolinfo *wol)
+{
+       int status;
+       struct gelic_card *card;
+       u64 v1, v2;
+
+       if (ps3_compare_firmware_version(2, 2, 0) < 0 ||
+           !capable(CAP_NET_ADMIN))
+               return -EPERM;
+
+       if (wol->wolopts & ~WAKE_MAGIC)
+               return -EINVAL;
+
+       card = netdev_card(netdev);
+       if (wol->wolopts & WAKE_MAGIC) {
+               status = lv1_net_control(bus_id(card), dev_id(card),
+                                        GELIC_LV1_SET_WOL,
+                                        GELIC_LV1_WOL_MAGIC_PACKET,
+                                        0, GELIC_LV1_WOL_MP_ENABLE,
+                                        &v1, &v2);
+               if (status) {
+                       pr_info("%s: enabling WOL failed %d\n", __func__,
+                               status);
+                       status = -EIO;
+                       goto done;
+               }
+               status = lv1_net_control(bus_id(card), dev_id(card),
+                                        GELIC_LV1_SET_WOL,
+                                        GELIC_LV1_WOL_ADD_MATCH_ADDR,
+                                        0, GELIC_LV1_WOL_MATCH_ALL,
+                                        &v1, &v2);
+               if (!status)
+                       ps3_sys_manager_set_wol(1);
+               else {
+                       pr_info("%s: enabling WOL filter failed %d\n",
+                               __func__, status);
+                       status = -EIO;
+               }
+       } else {
+               status = lv1_net_control(bus_id(card), dev_id(card),
+                                        GELIC_LV1_SET_WOL,
+                                        GELIC_LV1_WOL_MAGIC_PACKET,
+                                        0, GELIC_LV1_WOL_MP_DISABLE,
+                                        &v1, &v2);
+               if (status) {
+                       pr_info("%s: disabling WOL failed %d\n", __func__,
+                               status);
+                       status = -EIO;
+                       goto done;
+               }
+               status = lv1_net_control(bus_id(card), dev_id(card),
+                                        GELIC_LV1_SET_WOL,
+                                        GELIC_LV1_WOL_DELETE_MATCH_ADDR,
+                                        0, GELIC_LV1_WOL_MATCH_ALL,
+                                        &v1, &v2);
+               if (!status)
+                       ps3_sys_manager_set_wol(0);
+               else {
+                       pr_info("%s: removing WOL filter failed %d\n",
+                               __func__, status);
+                       status = -EIO;
+               }
+       }
+done:
+       return status;
+}
+
 static struct ethtool_ops gelic_ether_ethtool_ops = {
        .get_drvinfo    = gelic_net_get_drvinfo,
        .get_settings   = gelic_ether_get_settings,
@@ -1274,6 +1353,8 @@ static struct ethtool_ops gelic_ether_ethtool_ops = {
        .set_tx_csum    = ethtool_op_set_tx_csum,
        .get_rx_csum    = gelic_net_get_rx_csum,
        .set_rx_csum    = gelic_net_set_rx_csum,
+       .get_wol        = gelic_net_get_wol,
+       .set_wol        = gelic_net_set_wol,
 };
 
 /**
index 1d39d06797e4abe02ed685d3dc50fb2ccf3298a9..520f143c2c09c39cde27ed7ee83275a211c60abe 100644 (file)
@@ -182,12 +182,32 @@ enum gelic_lv1_net_control_code {
        GELIC_LV1_GET_ETH_PORT_STATUS   = 2,
        GELIC_LV1_SET_NEGOTIATION_MODE  = 3,
        GELIC_LV1_GET_VLAN_ID           = 4,
+       GELIC_LV1_SET_WOL               = 5,
        GELIC_LV1_GET_CHANNEL           = 6,
        GELIC_LV1_POST_WLAN_CMD         = 9,
        GELIC_LV1_GET_WLAN_CMD_RESULT   = 10,
        GELIC_LV1_GET_WLAN_EVENT        = 11
 };
 
+/* for GELIC_LV1_SET_WOL */
+enum gelic_lv1_wol_command {
+       GELIC_LV1_WOL_MAGIC_PACKET      = 1,
+       GELIC_LV1_WOL_ADD_MATCH_ADDR    = 6,
+       GELIC_LV1_WOL_DELETE_MATCH_ADDR = 7,
+};
+
+/* for GELIC_LV1_WOL_MAGIC_PACKET */
+enum gelic_lv1_wol_mp_arg {
+       GELIC_LV1_WOL_MP_DISABLE        = 0,
+       GELIC_LV1_WOL_MP_ENABLE         = 1,
+};
+
+/* for GELIC_LV1_WOL_{ADD,DELETE}_MATCH_ADDR */
+enum gelic_lv1_wol_match_arg {
+       GELIC_LV1_WOL_MATCH_INDIVIDUAL  = 0,
+       GELIC_LV1_WOL_MATCH_ALL         = 1,
+};
+
 /* status returened from GET_ETH_PORT_STATUS */
 enum gelic_lv1_ether_port_status {
        GELIC_LV1_ETHER_LINK_UP         = 0x0000000000000001L,
index 96043c5746d00a44977a402ccb60238a0a842fcc..bc4c62b8e81a4d7be3441bdc578daf3689646ab2 100644 (file)
@@ -64,8 +64,8 @@
 
 #define DRV_MODULE_NAME                "tg3"
 #define PFX DRV_MODULE_NAME    ": "
-#define DRV_MODULE_VERSION     "3.90"
-#define DRV_MODULE_RELDATE     "April 12, 2008"
+#define DRV_MODULE_VERSION     "3.91"
+#define DRV_MODULE_RELDATE     "April 18, 2008"
 
 #define TG3_DEF_MAC_MODE       0
 #define TG3_DEF_RX_MODE                0
@@ -4135,11 +4135,21 @@ static int tigon3_dma_hwbug_workaround(struct tg3 *tp, struct sk_buff *skb,
                                       u32 last_plus_one, u32 *start,
                                       u32 base_flags, u32 mss)
 {
-       struct sk_buff *new_skb = skb_copy(skb, GFP_ATOMIC);
+       struct sk_buff *new_skb;
        dma_addr_t new_addr = 0;
        u32 entry = *start;
        int i, ret = 0;
 
+       if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5701)
+               new_skb = skb_copy(skb, GFP_ATOMIC);
+       else {
+               int more_headroom = 4 - ((unsigned long)skb->data & 3);
+
+               new_skb = skb_copy_expand(skb,
+                                         skb_headroom(skb) + more_headroom,
+                                         skb_tailroom(skb), GFP_ATOMIC);
+       }
+
        if (!new_skb) {
                ret = -1;
        } else {
@@ -4462,7 +4472,9 @@ static int tg3_start_xmit_dma_bug(struct sk_buff *skb, struct net_device *dev)
 
        would_hit_hwbug = 0;
 
-       if (tg3_4g_overflow_test(mapping, len))
+       if (tp->tg3_flags3 & TG3_FLG3_5701_DMA_BUG)
+               would_hit_hwbug = 1;
+       else if (tg3_4g_overflow_test(mapping, len))
                would_hit_hwbug = 1;
 
        tg3_set_txd(tp, entry, mapping, len, base_flags,
@@ -11339,6 +11351,38 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
                }
        }
 
+       if ((GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5701)) {
+               static struct tg3_dev_id {
+                       u32     vendor;
+                       u32     device;
+               } bridge_chipsets[] = {
+                       { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_PXH_0 },
+                       { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_PXH_1 },
+                       { },
+               };
+               struct tg3_dev_id *pci_id = &bridge_chipsets[0];
+               struct pci_dev *bridge = NULL;
+
+               while (pci_id->vendor != 0) {
+                       bridge = pci_get_device(pci_id->vendor,
+                                               pci_id->device,
+                                               bridge);
+                       if (!bridge) {
+                               pci_id++;
+                               continue;
+                       }
+                       if (bridge->subordinate &&
+                           (bridge->subordinate->number <=
+                            tp->pdev->bus->number) &&
+                           (bridge->subordinate->subordinate >=
+                            tp->pdev->bus->number)) {
+                               tp->tg3_flags3 |= TG3_FLG3_5701_DMA_BUG;
+                               pci_dev_put(bridge);
+                               break;
+                       }
+               }
+       }
+
        /* The EPB bridge inside 5714, 5715, and 5780 cannot support
         * DMA addresses > 40-bit. This bridge may have other additional
         * 57xx devices behind it in some 4-port NIC designs for example.
index c1075a73d66c08dba2c6132113939a2a23e52f21..c688c3ac5035ed0db7feccb896a15df45a316832 100644 (file)
@@ -2476,6 +2476,7 @@ struct tg3 {
 #define TG3_FLG3_NO_NVRAM_ADDR_TRANS   0x00000001
 #define TG3_FLG3_ENABLE_APE            0x00000002
 #define TG3_FLG3_5761_5784_AX_FIXES    0x00000004
+#define TG3_FLG3_5701_DMA_BUG          0x00000008
 
        struct timer_list               timer;
        u16                             timer_counter;
index 29a4d650e8a8efcc1057ebad77746928a5f08157..2f11254bcc077fa22f506a1481221150429d3bee 100644 (file)
@@ -3853,7 +3853,13 @@ static int ucc_geth_probe(struct of_device* ofdev, const struct of_device_id *ma
 
        ugeth_vdbg("%s: IN", __FUNCTION__);
 
-       prop = of_get_property(np, "device-id", NULL);
+       prop = of_get_property(np, "cell-index", NULL);
+       if (!prop) {
+               prop = of_get_property(np, "device-id", NULL);
+               if (!prop)
+                       return -ENODEV;
+       }
+
        ucc_num = *prop - 1;
        if ((ucc_num < 0) || (ucc_num > 7))
                return -ENODEV;
index e4d3f330bac341941023a7131bb2c0e39dc86f24..2af490781005d63dbfe5eb1322ab7142c9c178ea 100644 (file)
@@ -203,9 +203,14 @@ static int uec_mdio_probe(struct of_device *ofdev, const struct of_device_id *ma
                if ((res.start >= tempres.start) &&
                    (res.end <= tempres.end)) {
                        /* set this UCC to be the MII master */
-                       const u32 *id = of_get_property(tempnp, "device-id", NULL);
-                       if (id == NULL)
-                               goto bus_register_fail;
+                       const u32 *id;
+
+                       id = of_get_property(tempnp, "cell-index", NULL);
+                       if (!id) {
+                               id = of_get_property(tempnp, "device-id", NULL);
+                               if (!id)
+                                       goto bus_register_fail;
+                       }
 
                        ucc_set_qe_mux_mii_mng(*id - 1);
 
index 569ad8bfd3833448aec6625f0b1bd87a6441d1a9..0dcfc0310264deddbe390ff13dda342a31b2f937 100644 (file)
@@ -58,7 +58,6 @@
 #include <linux/dma-mapping.h>
 #include <linux/wait.h>
 #include <asm/uaccess.h>
-#include <asm/semaphore.h>
 #include <asm/byteorder.h>
 
 #undef DEBUG
index 0aac1ff511df768a6ea38175e22a270a00ebaf20..36a9c42df835c3fa77241533cf90f1eb6c14e9e4 100644 (file)
@@ -116,10 +116,7 @@ static void b43_unregister_led(struct b43_led *led)
 {
        if (!led->dev)
                return;
-       if (led->dev->suspend_in_progress)
-               led_classdev_unregister_suspended(&led->led_dev);
-       else
-               led_classdev_unregister(&led->led_dev);
+       led_classdev_unregister(&led->led_dev);
        b43_led_turn_off(led->dev, led->index, led->activelow);
        led->dev = NULL;
 }
index cf5c046c9fa8e2539cf109239d578897b6afb6f3..943cc851c5043152d8ff521e18cc5a792da5fcad 100644 (file)
@@ -2804,10 +2804,10 @@ static int b43_rng_read(struct hwrng *rng, u32 * data)
        return (sizeof(u16));
 }
 
-static void b43_rng_exit(struct b43_wl *wl, bool suspended)
+static void b43_rng_exit(struct b43_wl *wl)
 {
        if (wl->rng_initialized)
-               __hwrng_unregister(&wl->rng, suspended);
+               hwrng_unregister(&wl->rng);
 }
 
 static int b43_rng_init(struct b43_wl *wl)
@@ -3824,7 +3824,7 @@ static void b43_wireless_core_exit(struct b43_wldev *dev)
 
        if (!dev->suspend_in_progress) {
                b43_leds_exit(dev);
-               b43_rng_exit(dev->wl, false);
+               b43_rng_exit(dev->wl);
        }
        b43_dma_free(dev);
        b43_pio_free(dev);
@@ -4589,7 +4589,7 @@ static int b43_resume(struct ssb_device *dev)
                err = b43_wireless_core_start(wldev);
                if (err) {
                        b43_leds_exit(wldev);
-                       b43_rng_exit(wldev->wl, true);
+                       b43_rng_exit(wldev->wl);
                        b43_wireless_core_exit(wldev);
                        b43err(wl, "Resume failed at core start\n");
                        goto out;
index 0f16f2606f29430ff9a99bf8b1f52e4e15078ac3..9a30e1df311d9ba9611dc07598c3254dbc404e6f 100644 (file)
@@ -239,28 +239,34 @@ static ssize_t iwl_dbgfs_stations_read(struct file *file, char __user *user_buf,
                                        "ps_status: %u\n", station->ps_status);
                        pos += scnprintf(buf + pos, bufsz - pos, "tid data:\n");
                        pos += scnprintf(buf + pos, bufsz - pos,
-                                       "seq_num\t\ttxq_id\t");
+                                       "seq_num\t\ttxq_id");
+#ifdef CONFIG_IWL4965_HT
                        pos += scnprintf(buf + pos, bufsz - pos,
-                                       "frame_count\twait_for_ba\t");
+                                       "\tframe_count\twait_for_ba\t");
                        pos += scnprintf(buf + pos, bufsz - pos,
                                        "start_idx\tbitmap0\t");
                        pos += scnprintf(buf + pos, bufsz - pos,
-                                       "bitmap1\trate_n_flags\n");
+                                       "bitmap1\trate_n_flags");
+#endif
+                       pos += scnprintf(buf + pos, bufsz - pos, "\n");
 
                        for (j = 0; j < MAX_TID_COUNT; j++) {
                                pos += scnprintf(buf + pos, bufsz - pos,
-                                               "[%d]:\t\t%u\t", j,
+                                               "[%d]:\t\t%u", j,
                                                station->tid[j].seq_number);
+#ifdef CONFIG_IWL4965_HT
                                pos += scnprintf(buf + pos, bufsz - pos,
-                                               "%u\t\t%u\t\t%u\t\t",
+                                               "\t%u\t\t%u\t\t%u\t\t",
                                                station->tid[j].agg.txq_id,
                                                station->tid[j].agg.frame_count,
                                                station->tid[j].agg.wait_for_ba);
                                pos += scnprintf(buf + pos, bufsz - pos,
-                                               "%u\t%llu\t%u\n",
+                                               "%u\t%llu\t%u",
                                                station->tid[j].agg.start_idx,
                                                (unsigned long long)station->tid[j].agg.bitmap,
                                                station->tid[j].agg.rate_n_flags);
+#endif
+                               pos += scnprintf(buf + pos, bufsz - pos, "\n");
                        }
                        pos += scnprintf(buf + pos, bufsz - pos, "\n");
                }
index c03072b12f423a981f208fdb0ad753f5c3f1ffe5..3a7a11a75fb464017ce284d34a41388f2875dd15 100644 (file)
@@ -1,3 +1,15 @@
 config OF_DEVICE
        def_bool y
        depends on OF && (SPARC || PPC_OF)
+
+config OF_GPIO
+       def_bool y
+       depends on OF && PPC_OF && HAVE_GPIO_LIB
+       help
+         OpenFirmware GPIO accessors
+
+config OF_I2C
+       def_tristate I2C
+       depends on PPC_OF && I2C
+       help
+         OpenFirmware I2C accessors
index ab9be5d5255b39a88aec66404ef265a255da2c60..548772e871fd8e52a1ed66156fc0c129e84660af 100644 (file)
@@ -1,2 +1,4 @@
 obj-y = base.o
 obj-$(CONFIG_OF_DEVICE) += device.o platform.o
+obj-$(CONFIG_OF_GPIO)   += gpio.o
+obj-$(CONFIG_OF_I2C)   += of_i2c.o
index 80c9deca5f35aa3313245d099215d5f387c687b1..9bd7c4a31253a5d7349d5b2fd3cb383e826d9680 100644 (file)
@@ -116,6 +116,32 @@ int of_device_is_compatible(const struct device_node *device,
 }
 EXPORT_SYMBOL(of_device_is_compatible);
 
+/**
+ *  of_device_is_available - check if a device is available for use
+ *
+ *  @device: Node to check for availability
+ *
+ *  Returns 1 if the status property is absent or set to "okay" or "ok",
+ *  0 otherwise
+ */
+int of_device_is_available(const struct device_node *device)
+{
+       const char *status;
+       int statlen;
+
+       status = of_get_property(device, "status", &statlen);
+       if (status == NULL)
+               return 1;
+
+       if (statlen > 0) {
+               if (!strcmp(status, "okay") || !strcmp(status, "ok"))
+                       return 1;
+       }
+
+       return 0;
+}
+EXPORT_SYMBOL(of_device_is_available);
+
 /**
  *     of_get_parent - Get a node's parent if any
  *     @node:  Node to get parent
diff --git a/drivers/of/gpio.c b/drivers/of/gpio.c
new file mode 100644 (file)
index 0000000..000681e
--- /dev/null
@@ -0,0 +1,242 @@
+/*
+ * OF helpers for the GPIO API
+ *
+ * Copyright (c) 2007-2008  MontaVista Software, Inc.
+ *
+ * Author: Anton Vorontsov <avorontsov@ru.mvista.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ */
+
+#include <linux/kernel.h>
+#include <linux/errno.h>
+#include <linux/io.h>
+#include <linux/of.h>
+#include <linux/of_gpio.h>
+#include <asm/prom.h>
+
+/**
+ * of_get_gpio - Get a GPIO number from the device tree to use with GPIO API
+ * @np:                device node to get GPIO from
+ * @index:     index of the GPIO
+ *
+ * Returns GPIO number to use with Linux generic GPIO API, or one of the errno
+ * value on the error condition.
+ */
+int of_get_gpio(struct device_node *np, int index)
+{
+       int ret = -EINVAL;
+       struct device_node *gc;
+       struct of_gpio_chip *of_gc = NULL;
+       int size;
+       const u32 *gpios;
+       u32 nr_cells;
+       int i;
+       const void *gpio_spec;
+       const u32 *gpio_cells;
+       int gpio_index = 0;
+
+       gpios = of_get_property(np, "gpios", &size);
+       if (!gpios) {
+               ret = -ENOENT;
+               goto err0;
+       }
+       nr_cells = size / sizeof(u32);
+
+       for (i = 0; i < nr_cells; gpio_index++) {
+               const phandle *gpio_phandle;
+
+               gpio_phandle = gpios + i;
+               gpio_spec = gpio_phandle + 1;
+
+               /* one cell hole in the gpios = <>; */
+               if (!*gpio_phandle) {
+                       if (gpio_index == index)
+                               return -ENOENT;
+                       i++;
+                       continue;
+               }
+
+               gc = of_find_node_by_phandle(*gpio_phandle);
+               if (!gc) {
+                       pr_debug("%s: could not find phandle for gpios\n",
+                                np->full_name);
+                       goto err0;
+               }
+
+               of_gc = gc->data;
+               if (!of_gc) {
+                       pr_debug("%s: gpio controller %s isn't registered\n",
+                                np->full_name, gc->full_name);
+                       goto err1;
+               }
+
+               gpio_cells = of_get_property(gc, "#gpio-cells", &size);
+               if (!gpio_cells || size != sizeof(*gpio_cells) ||
+                               *gpio_cells != of_gc->gpio_cells) {
+                       pr_debug("%s: wrong #gpio-cells for %s\n",
+                                np->full_name, gc->full_name);
+                       goto err1;
+               }
+
+               /* Next phandle is at phandle cells + #gpio-cells */
+               i += sizeof(*gpio_phandle) / sizeof(u32) + *gpio_cells;
+               if (i >= nr_cells + 1) {
+                       pr_debug("%s: insufficient gpio-spec length\n",
+                                np->full_name);
+                       goto err1;
+               }
+
+               if (gpio_index == index)
+                       break;
+
+               of_gc = NULL;
+               of_node_put(gc);
+       }
+
+       if (!of_gc) {
+               ret = -ENOENT;
+               goto err0;
+       }
+
+       ret = of_gc->xlate(of_gc, np, gpio_spec);
+       if (ret < 0)
+               goto err1;
+
+       ret += of_gc->gc.base;
+err1:
+       of_node_put(gc);
+err0:
+       pr_debug("%s exited with status %d\n", __func__, ret);
+       return ret;
+}
+EXPORT_SYMBOL(of_get_gpio);
+
+/**
+ * of_gpio_simple_xlate - translate gpio_spec to the GPIO number
+ * @of_gc:     pointer to the of_gpio_chip structure
+ * @np:                device node of the GPIO chip
+ * @gpio_spec: gpio specifier as found in the device tree
+ *
+ * This is simple translation function, suitable for the most 1:1 mapped
+ * gpio chips. This function performs only one sanity check: whether gpio
+ * is less than ngpios (that is specified in the gpio_chip).
+ */
+int of_gpio_simple_xlate(struct of_gpio_chip *of_gc, struct device_node *np,
+                        const void *gpio_spec)
+{
+       const u32 *gpio = gpio_spec;
+
+       if (*gpio > of_gc->gc.ngpio)
+               return -EINVAL;
+
+       return *gpio;
+}
+EXPORT_SYMBOL(of_gpio_simple_xlate);
+
+/* Should be sufficient for now, later we'll use dynamic bases. */
+#if defined(CONFIG_PPC32) || defined(CONFIG_SPARC32)
+#define GPIOS_PER_CHIP 32
+#else
+#define GPIOS_PER_CHIP 64
+#endif
+
+static int of_get_gpiochip_base(struct device_node *np)
+{
+       struct device_node *gc = NULL;
+       int gpiochip_base = 0;
+
+       while ((gc = of_find_all_nodes(gc))) {
+               if (!of_get_property(gc, "gpio-controller", NULL))
+                       continue;
+
+               if (gc != np) {
+                       gpiochip_base += GPIOS_PER_CHIP;
+                       continue;
+               }
+
+               of_node_put(gc);
+
+               if (gpiochip_base >= ARCH_NR_GPIOS)
+                       return -ENOSPC;
+
+               return gpiochip_base;
+       }
+
+       return -ENOENT;
+}
+
+/**
+ * of_mm_gpiochip_add - Add memory mapped GPIO chip (bank)
+ * @np:                device node of the GPIO chip
+ * @mm_gc:     pointer to the of_mm_gpio_chip allocated structure
+ *
+ * To use this function you should allocate and fill mm_gc with:
+ *
+ * 1) In the gpio_chip structure:
+ *    - all the callbacks
+ *
+ * 2) In the of_gpio_chip structure:
+ *    - gpio_cells
+ *    - xlate callback (optional)
+ *
+ * 3) In the of_mm_gpio_chip structure:
+ *    - save_regs callback (optional)
+ *
+ * If succeeded, this function will map bank's memory and will
+ * do all necessary work for you. Then you'll able to use .regs
+ * to manage GPIOs from the callbacks.
+ */
+int of_mm_gpiochip_add(struct device_node *np,
+                      struct of_mm_gpio_chip *mm_gc)
+{
+       int ret = -ENOMEM;
+       struct of_gpio_chip *of_gc = &mm_gc->of_gc;
+       struct gpio_chip *gc = &of_gc->gc;
+
+       gc->label = kstrdup(np->full_name, GFP_KERNEL);
+       if (!gc->label)
+               goto err0;
+
+       mm_gc->regs = of_iomap(np, 0);
+       if (!mm_gc->regs)
+               goto err1;
+
+       gc->base = of_get_gpiochip_base(np);
+       if (gc->base < 0) {
+               ret = gc->base;
+               goto err1;
+       }
+
+       if (!of_gc->xlate)
+               of_gc->xlate = of_gpio_simple_xlate;
+
+       if (mm_gc->save_regs)
+               mm_gc->save_regs(mm_gc);
+
+       np->data = of_gc;
+
+       ret = gpiochip_add(gc);
+       if (ret)
+               goto err2;
+
+       /* We don't want to lose the node and its ->data */
+       of_node_get(np);
+
+       pr_debug("%s: registered as generic GPIO chip, base is %d\n",
+                np->full_name, gc->base);
+       return 0;
+err2:
+       np->data = NULL;
+       iounmap(mm_gc->regs);
+err1:
+       kfree(gc->label);
+err0:
+       pr_err("%s: GPIO chip registration failed with status %d\n",
+              np->full_name, ret);
+       return ret;
+}
+EXPORT_SYMBOL(of_mm_gpiochip_add);
diff --git a/drivers/of/of_i2c.c b/drivers/of/of_i2c.c
new file mode 100644 (file)
index 0000000..6316891
--- /dev/null
@@ -0,0 +1,115 @@
+/*
+ * OF helpers for the I2C API
+ *
+ * Copyright (c) 2008 Jochen Friedrich <jochen@scram.de>
+ *
+ * Based on a previous patch from Jon Smirl <jonsmirl@gmail.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ */
+
+#include <linux/i2c.h>
+#include <linux/of.h>
+
+struct i2c_driver_device {
+       char    *of_device;
+       char    *i2c_type;
+};
+
+static struct i2c_driver_device i2c_devices[] = {
+       { "dallas,ds1374", "rtc-ds1374" },
+};
+
+static int of_find_i2c_driver(struct device_node *node,
+                             struct i2c_board_info *info)
+{
+       int i, cplen;
+       const char *compatible;
+       const char *p;
+
+       /* 1. search for exception list entry */
+       for (i = 0; i < ARRAY_SIZE(i2c_devices); i++) {
+               if (!of_device_is_compatible(node, i2c_devices[i].of_device))
+                       continue;
+               if (strlcpy(info->type, i2c_devices[i].i2c_type,
+                           I2C_NAME_SIZE) >= I2C_NAME_SIZE)
+                       return -ENOMEM;
+
+               return 0;
+       }
+
+       compatible = of_get_property(node, "compatible", &cplen);
+       if (!compatible)
+               return -ENODEV;
+
+       /* 2. search for linux,<i2c-type> entry */
+       p = compatible;
+       while (cplen > 0) {
+               if (!strncmp(p, "linux,", 6)) {
+                       p += 6;
+                       if (strlcpy(info->type, p,
+                                   I2C_NAME_SIZE) >= I2C_NAME_SIZE)
+                               return -ENOMEM;
+                       return 0;
+               }
+
+               i = strlen(p) + 1;
+               p += i;
+               cplen -= i;
+       }
+
+       /* 3. take fist compatible entry and strip manufacturer */
+       p = strchr(compatible, ',');
+       if (!p)
+               return -ENODEV;
+       p++;
+       if (strlcpy(info->type, p, I2C_NAME_SIZE) >= I2C_NAME_SIZE)
+               return -ENOMEM;
+       return 0;
+}
+
+void of_register_i2c_devices(struct i2c_adapter *adap,
+                            struct device_node *adap_node)
+{
+       void *result;
+       struct device_node *node;
+
+       for_each_child_of_node(adap_node, node) {
+               struct i2c_board_info info = {};
+               const u32 *addr;
+               int len;
+
+               addr = of_get_property(node, "reg", &len);
+               if (!addr || len < sizeof(int) || *addr > (1 << 10) - 1) {
+                       printk(KERN_ERR
+                              "of-i2c: invalid i2c device entry\n");
+                       continue;
+               }
+
+               info.irq = irq_of_parse_and_map(node, 0);
+               if (info.irq == NO_IRQ)
+                       info.irq = -1;
+
+               if (of_find_i2c_driver(node, &info) < 0) {
+                       irq_dispose_mapping(info.irq);
+                       continue;
+               }
+
+               info.addr = *addr;
+
+               request_module(info.type);
+
+               result = i2c_new_device(adap, &info);
+               if (result == NULL) {
+                       printk(KERN_ERR
+                              "of-i2c: Failed to load driver for %s\n",
+                              info.type);
+                       irq_dispose_mapping(info.irq);
+                       continue;
+               }
+       }
+}
+EXPORT_SYMBOL(of_register_i2c_devices);
index b7bcdcc5c724e0f441faa4bbb94cb53d06a2e448..209b4a464bcfe24c129a9d703a43a728998fc0bf 100644 (file)
@@ -36,7 +36,7 @@ if PARPORT
 config PARPORT_PC
        tristate "PC-style hardware"
        depends on (!SPARC64 || PCI) && !SPARC32 && !M32R && !FRV && \
-               (!M68K || ISA) && !MN10300
+               (!M68K || ISA) && !MN10300 && !AVR32
        ---help---
          You should say Y here if you have a PC-style parallel port. All
          IBM PC compatible computers and some Alphas have PC-style
index e571c72e67531017f140ee6e323e89644f7320b0..e8d94fafc2804e74fddd9c66eee9fac29a11883b 100644 (file)
@@ -182,15 +182,18 @@ static int pci_call_probe(struct pci_driver *drv, struct pci_dev *dev,
        struct mempolicy *oldpol;
        cpumask_t oldmask = current->cpus_allowed;
        int node = pcibus_to_node(dev->bus);
-       if (node >= 0 && node_online(node))
-           set_cpus_allowed(current, node_to_cpumask(node));
+
+       if (node >= 0) {
+               node_to_cpumask_ptr(nodecpumask, node);
+               set_cpus_allowed_ptr(current, nodecpumask);
+       }
        /* And set default memory allocation policy */
        oldpol = current->mempolicy;
        current->mempolicy = NULL;      /* fall back to system default policy */
 #endif
        error = drv->probe(dev, id);
 #ifdef CONFIG_NUMA
-       set_cpus_allowed(current, oldmask);
+       set_cpus_allowed_ptr(current, &oldmask);
        current->mempolicy = oldpol;
 #endif
        return error;
index 8dcf1458aa2fafe6e0433efd1dfb515ce503271a..8d9d648daeba74123a6f9cf9c74434f903292bac 100644 (file)
@@ -73,8 +73,23 @@ static ssize_t local_cpus_show(struct device *dev,
 
        mask = pcibus_to_cpumask(to_pci_dev(dev)->bus);
        len = cpumask_scnprintf(buf, PAGE_SIZE-2, mask);
-       strcat(buf,"\n"); 
-       return 1+len;
+       buf[len++] = '\n';
+       buf[len] = '\0';
+       return len;
+}
+
+
+static ssize_t local_cpulist_show(struct device *dev,
+                       struct device_attribute *attr, char *buf)
+{
+       cpumask_t mask;
+       int len;
+
+       mask = pcibus_to_cpumask(to_pci_dev(dev)->bus);
+       len = cpulist_scnprintf(buf, PAGE_SIZE-2, mask);
+       buf[len++] = '\n';
+       buf[len] = '\0';
+       return len;
 }
 
 /* show resources */
@@ -201,6 +216,7 @@ struct device_attribute pci_dev_attrs[] = {
        __ATTR_RO(class),
        __ATTR_RO(irq),
        __ATTR_RO(local_cpus),
+       __ATTR_RO(local_cpulist),
        __ATTR_RO(modalias),
 #ifdef CONFIG_NUMA
        __ATTR_RO(numa_node),
index 2db2e4bb0d1ed6073b6ec9d3e0dec604868974ab..4b3011a23effa43f9053d2889430e43225bfb2ea 100644 (file)
@@ -82,6 +82,7 @@ void pci_remove_legacy_files(struct pci_bus *bus) { return; }
  * PCI Bus Class Devices
  */
 static ssize_t pci_bus_show_cpuaffinity(struct device *dev,
+                                       int type,
                                        struct device_attribute *attr,
                                        char *buf)
 {
@@ -89,12 +90,30 @@ static ssize_t pci_bus_show_cpuaffinity(struct device *dev,
        cpumask_t cpumask;
 
        cpumask = pcibus_to_cpumask(to_pci_bus(dev));
-       ret = cpumask_scnprintf(buf, PAGE_SIZE, cpumask);
-       if (ret < PAGE_SIZE)
-               buf[ret++] = '\n';
+       ret = type?
+               cpulist_scnprintf(buf, PAGE_SIZE-2, cpumask):
+               cpumask_scnprintf(buf, PAGE_SIZE-2, cpumask);
+       buf[ret++] = '\n';
+       buf[ret] = '\0';
        return ret;
 }
-DEVICE_ATTR(cpuaffinity, S_IRUGO, pci_bus_show_cpuaffinity, NULL);
+
+static ssize_t inline pci_bus_show_cpumaskaffinity(struct device *dev,
+                                       struct device_attribute *attr,
+                                       char *buf)
+{
+       return pci_bus_show_cpuaffinity(dev, 0, attr, buf);
+}
+
+static ssize_t inline pci_bus_show_cpulistaffinity(struct device *dev,
+                                       struct device_attribute *attr,
+                                       char *buf)
+{
+       return pci_bus_show_cpuaffinity(dev, 1, attr, buf);
+}
+
+DEVICE_ATTR(cpuaffinity,     S_IRUGO, pci_bus_show_cpumaskaffinity, NULL);
+DEVICE_ATTR(cpulistaffinity, S_IRUGO, pci_bus_show_cpulistaffinity, NULL);
 
 /*
  * PCI Bus Class
index 8b22281b087f6964c9a13a013efa037458a25be8..ed8c06904807723540365699e892cacf68cc7a71 100644 (file)
@@ -200,6 +200,7 @@ config PCMCIA_AU1X00
 config PCMCIA_SA1100
        tristate "SA1100 support"
        depends on ARM && ARCH_SA1100 && PCMCIA
+       depends on ARCH_LUBBOCK || MACH_MAINSTONE || PXA_SHARPSL || MACH_ARMCORE
        help
          Say Y here to include support for SA11x0-based PCMCIA or CF
          sockets, found on HP iPAQs, Yopy, and other StrongARM(R)/
index fbf2f3a6984ccbfbf5bde88046a8303a940ee782..e7ab060ff118db5f13a80f276df59dc555826ca6 100644 (file)
@@ -20,6 +20,7 @@
 #include <asm/hardware.h>
 
 #include <asm/arch/pxa-regs.h>
+#include <asm/arch/pxa2xx-gpio.h>
 #include <asm/arch/cm-x270.h>
 
 #include "soc_common.h"
index d4f6f960dd18d1ea22c52de06a20aed885b67612..7605453b74fd965506e164a0990387aecafa2029 100644 (file)
@@ -24,6 +24,7 @@
 #include <linux/reboot.h>
 
 #include <asm/firmware.h>
+#include <asm/lv1call.h>
 #include <asm/ps3.h>
 
 #include "vuart.h"
@@ -187,6 +188,7 @@ enum ps3_sys_manager_next_op {
  * controller, and bluetooth controller.
  * @PS3_SM_WAKE_RTC:
  * @PS3_SM_WAKE_RTC_ERROR:
+ * @PS3_SM_WAKE_W_O_L: Ether or wireless LAN.
  * @PS3_SM_WAKE_P_O_R: Power on reset.
  *
  * Additional wakeup sources when specifying PS3_SM_NEXT_OP_SYS_SHUTDOWN.
@@ -200,9 +202,18 @@ enum ps3_sys_manager_wake_source {
        PS3_SM_WAKE_DEFAULT   = 0,
        PS3_SM_WAKE_RTC       = 0x00000040,
        PS3_SM_WAKE_RTC_ERROR = 0x00000080,
+       PS3_SM_WAKE_W_O_L     = 0x00000400,
        PS3_SM_WAKE_P_O_R     = 0x80000000,
 };
 
+/**
+ * user_wake_sources - User specified wakeup sources.
+ *
+ * Logical OR of enum ps3_sys_manager_wake_source types.
+ */
+
+static u32 user_wake_sources = PS3_SM_WAKE_DEFAULT;
+
 /**
  * enum ps3_sys_manager_cmd - Command from system manager to guest.
  *
@@ -581,6 +592,23 @@ fail_id:
        return -EIO;
 }
 
+static void ps3_sys_manager_fin(struct ps3_system_bus_device *dev)
+{
+       ps3_sys_manager_send_request_shutdown(dev);
+
+       pr_emerg("System Halted, OK to turn off power\n");
+
+       while (ps3_sys_manager_handle_msg(dev)) {
+               /* pause until next DEC interrupt */
+               lv1_pause(0);
+       }
+
+       while (1) {
+               /* pause, ignoring DEC interrupt */
+               lv1_pause(1);
+       }
+}
+
 /**
  * ps3_sys_manager_final_power_off - The final platform machine_power_off routine.
  *
@@ -601,13 +629,9 @@ static void ps3_sys_manager_final_power_off(struct ps3_system_bus_device *dev)
        ps3_vuart_cancel_async(dev);
 
        ps3_sys_manager_send_next_op(dev, PS3_SM_NEXT_OP_SYS_SHUTDOWN,
-               PS3_SM_WAKE_DEFAULT);
-       ps3_sys_manager_send_request_shutdown(dev);
-
-       pr_emerg("System Halted, OK to turn off power\n");
+               user_wake_sources);
 
-       while (1)
-               ps3_sys_manager_handle_msg(dev);
+       ps3_sys_manager_fin(dev);
 }
 
 /**
@@ -638,14 +662,42 @@ static void ps3_sys_manager_final_restart(struct ps3_system_bus_device *dev)
 
        ps3_sys_manager_send_attr(dev, 0);
        ps3_sys_manager_send_next_op(dev, PS3_SM_NEXT_OP_SYS_REBOOT,
-               PS3_SM_WAKE_DEFAULT);
-       ps3_sys_manager_send_request_shutdown(dev);
+               user_wake_sources);
 
-       pr_emerg("System Halted, OK to turn off power\n");
+       ps3_sys_manager_fin(dev);
+}
+
+/**
+ * ps3_sys_manager_get_wol - Get wake-on-lan setting.
+ */
+
+int ps3_sys_manager_get_wol(void)
+{
+       pr_debug("%s:%d\n", __func__, __LINE__);
+
+       return (user_wake_sources & PS3_SM_WAKE_W_O_L) != 0;
+}
+EXPORT_SYMBOL_GPL(ps3_sys_manager_get_wol);
+
+/**
+ * ps3_sys_manager_set_wol - Set wake-on-lan setting.
+ */
+
+void ps3_sys_manager_set_wol(int state)
+{
+       static DEFINE_MUTEX(mutex);
+
+       mutex_lock(&mutex);
+
+       pr_debug("%s:%d: %d\n", __func__, __LINE__, state);
 
-       while (1)
-               ps3_sys_manager_handle_msg(dev);
+       if (state)
+               user_wake_sources |= PS3_SM_WAKE_W_O_L;
+       else
+               user_wake_sources &= ~PS3_SM_WAKE_W_O_L;
+       mutex_unlock(&mutex);
 }
+EXPORT_SYMBOL_GPL(ps3_sys_manager_set_wol);
 
 /**
  * ps3_sys_manager_work - Asynchronous read handler.
index 31648f7d9ae1055bd76e18e5d4eb6c82538d85c6..474225852b63689500c87c6631677a502ed471e2 100644 (file)
@@ -19,6 +19,7 @@
  */
 
 #include <linux/kernel.h>
+#include <asm/lv1call.h>
 #include <asm/ps3.h>
 
 /**
@@ -50,10 +51,7 @@ void ps3_sys_manager_power_off(void)
        if (ps3_sys_manager_ops.power_off)
                ps3_sys_manager_ops.power_off(ps3_sys_manager_ops.dev);
 
-       printk(KERN_EMERG "System Halted, OK to turn off power\n");
-       local_irq_disable();
-       while (1)
-               (void)0;
+       ps3_sys_manager_halt();
 }
 
 void ps3_sys_manager_restart(void)
@@ -61,8 +59,14 @@ void ps3_sys_manager_restart(void)
        if (ps3_sys_manager_ops.restart)
                ps3_sys_manager_ops.restart(ps3_sys_manager_ops.dev);
 
-       printk(KERN_EMERG "System Halted, OK to turn off power\n");
+       ps3_sys_manager_halt();
+}
+
+void ps3_sys_manager_halt(void)
+{
+       pr_emerg("System Halted, OK to turn off power\n");
        local_irq_disable();
        while (1)
-               (void)0;
+               lv1_pause(1);
 }
+
index 9e9caa5d7f5f78ad747576d176c2b8052e639f2f..c594b34c67679e3f1d7df1ba143854217bc38455 100644 (file)
@@ -1,8 +1,9 @@
 /*
  * SuperH On-Chip RTC Support
  *
- * Copyright (C) 2006, 2007  Paul Mundt
+ * Copyright (C) 2006, 2007, 2008  Paul Mundt
  * Copyright (C) 2006  Jamie Lenehan
+ * Copyright (C) 2008  Angelo Castello
  *
  * Based on the old arch/sh/kernel/cpu/rtc.c by:
  *
@@ -26,7 +27,7 @@
 #include <asm/rtc.h>
 
 #define DRV_NAME       "sh-rtc"
-#define DRV_VERSION    "0.1.6"
+#define DRV_VERSION    "0.2.0"
 
 #define RTC_REG(r)     ((r) * rtc_reg_size)
 
 /* ALARM Bits - or with BCD encoded value */
 #define AR_ENB         0x80    /* Enable for alarm cmp   */
 
+/* Period Bits */
+#define PF_HP          0x100   /* Enable Half Period to support 8,32,128Hz */
+#define PF_COUNT       0x200   /* Half periodic counter */
+#define PF_OXS         0x400   /* Periodic One x Second */
+#define PF_KOU         0x800   /* Kernel or User periodic request 1=kernel */
+#define PF_MASK                0xf00
+
 /* RCR1 Bits */
 #define RCR1_CF                0x80    /* Carry Flag             */
 #define RCR1_CIE       0x10    /* Carry Interrupt Enable */
@@ -84,33 +92,24 @@ struct sh_rtc {
        unsigned int alarm_irq, periodic_irq, carry_irq;
        struct rtc_device *rtc_dev;
        spinlock_t lock;
-       int rearm_aie;
        unsigned long capabilities;     /* See asm-sh/rtc.h for cap bits */
+       unsigned short periodic_freq;
 };
 
 static irqreturn_t sh_rtc_interrupt(int irq, void *dev_id)
 {
-       struct platform_device *pdev = to_platform_device(dev_id);
-       struct sh_rtc *rtc = platform_get_drvdata(pdev);
-       unsigned int tmp, events = 0;
+       struct sh_rtc *rtc = dev_id;
+       unsigned int tmp;
 
        spin_lock(&rtc->lock);
 
        tmp = readb(rtc->regbase + RCR1);
        tmp &= ~RCR1_CF;
-
-       if (rtc->rearm_aie) {
-               if (tmp & RCR1_AF)
-                       tmp &= ~RCR1_AF;        /* try to clear AF again */
-               else {
-                       tmp |= RCR1_AIE;        /* AF has cleared, rearm IRQ */
-                       rtc->rearm_aie = 0;
-               }
-       }
-
        writeb(tmp, rtc->regbase + RCR1);
 
-       rtc_update_irq(rtc->rtc_dev, 1, events);
+       /* Users have requested One x Second IRQ */
+       if (rtc->periodic_freq & PF_OXS)
+               rtc_update_irq(rtc->rtc_dev, 1, RTC_UF | RTC_IRQF);
 
        spin_unlock(&rtc->lock);
 
@@ -119,47 +118,48 @@ static irqreturn_t sh_rtc_interrupt(int irq, void *dev_id)
 
 static irqreturn_t sh_rtc_alarm(int irq, void *dev_id)
 {
-       struct platform_device *pdev = to_platform_device(dev_id);
-       struct sh_rtc *rtc = platform_get_drvdata(pdev);
-       unsigned int tmp, events = 0;
+       struct sh_rtc *rtc = dev_id;
+       unsigned int tmp;
 
        spin_lock(&rtc->lock);
 
        tmp = readb(rtc->regbase + RCR1);
-
-       /*
-        * If AF is set then the alarm has triggered. If we clear AF while
-        * the alarm time still matches the RTC time then AF will
-        * immediately be set again, and if AIE is enabled then the alarm
-        * interrupt will immediately be retrigger. So we clear AIE here
-        * and use rtc->rearm_aie so that the carry interrupt will keep
-        * trying to clear AF and once it stays cleared it'll re-enable
-        * AIE.
-        */
-       if (tmp & RCR1_AF) {
-               events |= RTC_AF | RTC_IRQF;
-
-               tmp &= ~(RCR1_AF|RCR1_AIE);
-
+       tmp &= ~(RCR1_AF | RCR1_AIE);
                writeb(tmp, rtc->regbase + RCR1);
 
-               rtc->rearm_aie = 1;
-
-               rtc_update_irq(rtc->rtc_dev, 1, events);
-       }
+       rtc_update_irq(rtc->rtc_dev, 1, RTC_AF | RTC_IRQF);
 
        spin_unlock(&rtc->lock);
+
        return IRQ_HANDLED;
 }
 
 static irqreturn_t sh_rtc_periodic(int irq, void *dev_id)
 {
-       struct platform_device *pdev = to_platform_device(dev_id);
-       struct sh_rtc *rtc = platform_get_drvdata(pdev);
+       struct sh_rtc *rtc = dev_id;
+       struct rtc_device *rtc_dev = rtc->rtc_dev;
+       unsigned int tmp;
 
        spin_lock(&rtc->lock);
 
-       rtc_update_irq(rtc->rtc_dev, 1, RTC_PF | RTC_IRQF);
+       tmp = readb(rtc->regbase + RCR2);
+       tmp &= ~RCR2_PEF;
+       writeb(tmp, rtc->regbase + RCR2);
+
+       /* Half period enabled than one skipped and the next notified */
+       if ((rtc->periodic_freq & PF_HP) && (rtc->periodic_freq & PF_COUNT))
+               rtc->periodic_freq &= ~PF_COUNT;
+       else {
+               if (rtc->periodic_freq & PF_HP)
+                       rtc->periodic_freq |= PF_COUNT;
+               if (rtc->periodic_freq & PF_KOU) {
+                       spin_lock(&rtc_dev->irq_task_lock);
+                       if (rtc_dev->irq_task)
+                               rtc_dev->irq_task->func(rtc_dev->irq_task->private_data);
+                       spin_unlock(&rtc_dev->irq_task_lock);
+               } else
+                       rtc_update_irq(rtc->rtc_dev, 1, RTC_PF | RTC_IRQF);
+       }
 
        spin_unlock(&rtc->lock);
 
@@ -176,8 +176,8 @@ static inline void sh_rtc_setpie(struct device *dev, unsigned int enable)
        tmp = readb(rtc->regbase + RCR2);
 
        if (enable) {
-               tmp &= ~RCR2_PESMASK;
-               tmp |= RCR2_PEF | (2 << 4);
+               tmp &= ~RCR2_PEF;       /* Clear PES bit */
+               tmp |= (rtc->periodic_freq & ~PF_HP);   /* Set PES2-0 */
        } else
                tmp &= ~(RCR2_PESMASK | RCR2_PEF);
 
@@ -186,82 +186,81 @@ static inline void sh_rtc_setpie(struct device *dev, unsigned int enable)
        spin_unlock_irq(&rtc->lock);
 }
 
-static inline void sh_rtc_setaie(struct device *dev, unsigned int enable)
+static inline int sh_rtc_setfreq(struct device *dev, unsigned int freq)
 {
        struct sh_rtc *rtc = dev_get_drvdata(dev);
-       unsigned int tmp;
+       int tmp, ret = 0;
 
        spin_lock_irq(&rtc->lock);
+       tmp = rtc->periodic_freq & PF_MASK;
 
-       tmp = readb(rtc->regbase + RCR1);
-
-       if (!enable) {
-               tmp &= ~RCR1_AIE;
-               rtc->rearm_aie = 0;
-       } else if (rtc->rearm_aie == 0)
-               tmp |= RCR1_AIE;
+       switch (freq) {
+       case 0:
+               rtc->periodic_freq = 0x00;
+               break;
+       case 1:
+               rtc->periodic_freq = 0x60;
+               break;
+       case 2:
+               rtc->periodic_freq = 0x50;
+               break;
+       case 4:
+               rtc->periodic_freq = 0x40;
+               break;
+       case 8:
+               rtc->periodic_freq = 0x30 | PF_HP;
+               break;
+       case 16:
+               rtc->periodic_freq = 0x30;
+               break;
+       case 32:
+               rtc->periodic_freq = 0x20 | PF_HP;
+               break;
+       case 64:
+               rtc->periodic_freq = 0x20;
+               break;
+       case 128:
+               rtc->periodic_freq = 0x10 | PF_HP;
+               break;
+       case 256:
+               rtc->periodic_freq = 0x10;
+               break;
+       default:
+               ret = -ENOTSUPP;
+       }
 
-       writeb(tmp, rtc->regbase + RCR1);
+       if (ret == 0) {
+               rtc->periodic_freq |= tmp;
+               rtc->rtc_dev->irq_freq = freq;
+       }
 
        spin_unlock_irq(&rtc->lock);
+       return ret;
 }
 
-static int sh_rtc_open(struct device *dev)
+static inline void sh_rtc_setaie(struct device *dev, unsigned int enable)
 {
        struct sh_rtc *rtc = dev_get_drvdata(dev);
        unsigned int tmp;
-       int ret;
-
-       tmp = readb(rtc->regbase + RCR1);
-       tmp &= ~RCR1_CF;
-       tmp |= RCR1_CIE;
-       writeb(tmp, rtc->regbase + RCR1);
 
-       ret = request_irq(rtc->periodic_irq, sh_rtc_periodic, IRQF_DISABLED,
-                         "sh-rtc period", dev);
-       if (unlikely(ret)) {
-               dev_err(dev, "request period IRQ failed with %d, IRQ %d\n",
-                       ret, rtc->periodic_irq);
-               return ret;
-       }
-
-       ret = request_irq(rtc->carry_irq, sh_rtc_interrupt, IRQF_DISABLED,
-                         "sh-rtc carry", dev);
-       if (unlikely(ret)) {
-               dev_err(dev, "request carry IRQ failed with %d, IRQ %d\n",
-                       ret, rtc->carry_irq);
-               free_irq(rtc->periodic_irq, dev);
-               goto err_bad_carry;
-       }
+       spin_lock_irq(&rtc->lock);
 
-       ret = request_irq(rtc->alarm_irq, sh_rtc_alarm, IRQF_DISABLED,
-                         "sh-rtc alarm", dev);
-       if (unlikely(ret)) {
-               dev_err(dev, "request alarm IRQ failed with %d, IRQ %d\n",
-                       ret, rtc->alarm_irq);
-               goto err_bad_alarm;
-       }
+       tmp = readb(rtc->regbase + RCR1);
 
-       return 0;
+       if (!enable)
+               tmp &= ~RCR1_AIE;
+       else
+               tmp |= RCR1_AIE;
 
-err_bad_alarm:
-       free_irq(rtc->carry_irq, dev);
-err_bad_carry:
-       free_irq(rtc->periodic_irq, dev);
+       writeb(tmp, rtc->regbase + RCR1);
 
-       return ret;
+       spin_unlock_irq(&rtc->lock);
 }
 
 static void sh_rtc_release(struct device *dev)
 {
-       struct sh_rtc *rtc = dev_get_drvdata(dev);
-
        sh_rtc_setpie(dev, 0);
        sh_rtc_setaie(dev, 0);
-
-       free_irq(rtc->periodic_irq, dev);
-       free_irq(rtc->carry_irq, dev);
-       free_irq(rtc->alarm_irq, dev);
 }
 
 static int sh_rtc_proc(struct device *dev, struct seq_file *seq)
@@ -270,31 +269,44 @@ static int sh_rtc_proc(struct device *dev, struct seq_file *seq)
        unsigned int tmp;
 
        tmp = readb(rtc->regbase + RCR1);
-       seq_printf(seq, "carry_IRQ\t: %s\n",
-                  (tmp & RCR1_CIE) ? "yes" : "no");
+       seq_printf(seq, "carry_IRQ\t: %s\n", (tmp & RCR1_CIE) ? "yes" : "no");
 
        tmp = readb(rtc->regbase + RCR2);
        seq_printf(seq, "periodic_IRQ\t: %s\n",
-                  (tmp & RCR2_PEF) ? "yes" : "no");
+                  (tmp & RCR2_PESMASK) ? "yes" : "no");
 
        return 0;
 }
 
 static int sh_rtc_ioctl(struct device *dev, unsigned int cmd, unsigned long arg)
 {
-       unsigned int ret = -ENOIOCTLCMD;
+       struct sh_rtc *rtc = dev_get_drvdata(dev);
+       unsigned int ret = 0;
 
        switch (cmd) {
        case RTC_PIE_OFF:
        case RTC_PIE_ON:
                sh_rtc_setpie(dev, cmd == RTC_PIE_ON);
-               ret = 0;
                break;
        case RTC_AIE_OFF:
        case RTC_AIE_ON:
                sh_rtc_setaie(dev, cmd == RTC_AIE_ON);
-               ret = 0;
                break;
+       case RTC_UIE_OFF:
+               rtc->periodic_freq &= ~PF_OXS;
+               break;
+       case RTC_UIE_ON:
+               rtc->periodic_freq |= PF_OXS;
+               break;
+       case RTC_IRQP_READ:
+               ret = put_user(rtc->rtc_dev->irq_freq,
+                              (unsigned long __user *)arg);
+               break;
+       case RTC_IRQP_SET:
+               ret = sh_rtc_setfreq(dev, arg);
+               break;
+       default:
+               ret = -ENOIOCTLCMD;
        }
 
        return ret;
@@ -421,7 +433,7 @@ static int sh_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *wkalrm)
 {
        struct platform_device *pdev = to_platform_device(dev);
        struct sh_rtc *rtc = platform_get_drvdata(pdev);
-       struct rtc_timetm = &wkalrm->time;
+       struct rtc_time *tm = &wkalrm->time;
 
        spin_lock_irq(&rtc->lock);
 
@@ -452,7 +464,7 @@ static inline void sh_rtc_write_alarm_value(struct sh_rtc *rtc,
                writeb(BIN2BCD(value) | AR_ENB,  rtc->regbase + reg_off);
 }
 
-static int sh_rtc_check_alarm(struct rtc_timetm)
+static int sh_rtc_check_alarm(struct rtc_time *tm)
 {
        /*
         * The original rtc says anything > 0xc0 is "don't care" or "match
@@ -503,11 +515,9 @@ static int sh_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *wkalrm)
 
        /* disable alarm interrupt and clear the alarm flag */
        rcr1 = readb(rtc->regbase + RCR1);
-       rcr1 &= ~(RCR1_AF|RCR1_AIE);
+       rcr1 &= ~(RCR1_AF | RCR1_AIE);
        writeb(rcr1, rtc->regbase + RCR1);
 
-       rtc->rearm_aie = 0;
-
        /* set alarm time */
        sh_rtc_write_alarm_value(rtc, tm->tm_sec,  RSECAR);
        sh_rtc_write_alarm_value(rtc, tm->tm_min,  RMINAR);
@@ -529,14 +539,34 @@ static int sh_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *wkalrm)
        return 0;
 }
 
+static int sh_rtc_irq_set_state(struct device *dev, int enabled)
+{
+       struct platform_device *pdev = to_platform_device(dev);
+       struct sh_rtc *rtc = platform_get_drvdata(pdev);
+
+       if (enabled) {
+               rtc->periodic_freq |= PF_KOU;
+               return sh_rtc_ioctl(dev, RTC_PIE_ON, 0);
+       } else {
+               rtc->periodic_freq &= ~PF_KOU;
+               return sh_rtc_ioctl(dev, RTC_PIE_OFF, 0);
+       }
+}
+
+static int sh_rtc_irq_set_freq(struct device *dev, int freq)
+{
+       return sh_rtc_ioctl(dev, RTC_IRQP_SET, freq);
+}
+
 static struct rtc_class_ops sh_rtc_ops = {
-       .open           = sh_rtc_open,
        .release        = sh_rtc_release,
        .ioctl          = sh_rtc_ioctl,
        .read_time      = sh_rtc_read_time,
        .set_time       = sh_rtc_set_time,
        .read_alarm     = sh_rtc_read_alarm,
        .set_alarm      = sh_rtc_set_alarm,
+       .irq_set_state  = sh_rtc_irq_set_state,
+       .irq_set_freq   = sh_rtc_irq_set_freq,
        .proc           = sh_rtc_proc,
 };
 
@@ -544,6 +574,7 @@ static int __devinit sh_rtc_probe(struct platform_device *pdev)
 {
        struct sh_rtc *rtc;
        struct resource *res;
+       unsigned int tmp;
        int ret = -ENOENT;
 
        rtc = kzalloc(sizeof(struct sh_rtc), GFP_KERNEL);
@@ -552,6 +583,7 @@ static int __devinit sh_rtc_probe(struct platform_device *pdev)
 
        spin_lock_init(&rtc->lock);
 
+       /* get periodic/carry/alarm irqs */
        rtc->periodic_irq = platform_get_irq(pdev, 0);
        if (unlikely(rtc->periodic_irq < 0)) {
                dev_err(&pdev->dev, "No IRQ for period\n");
@@ -608,8 +640,48 @@ static int __devinit sh_rtc_probe(struct platform_device *pdev)
                rtc->capabilities |= pinfo->capabilities;
        }
 
+       rtc->rtc_dev->max_user_freq = 256;
+       rtc->rtc_dev->irq_freq = 1;
+       rtc->periodic_freq = 0x60;
+
        platform_set_drvdata(pdev, rtc);
 
+       /* register periodic/carry/alarm irqs */
+       ret = request_irq(rtc->periodic_irq, sh_rtc_periodic, IRQF_DISABLED,
+                         "sh-rtc period", rtc);
+       if (unlikely(ret)) {
+               dev_err(&pdev->dev,
+                       "request period IRQ failed with %d, IRQ %d\n", ret,
+                       rtc->periodic_irq);
+               goto err_badmap;
+       }
+
+       ret = request_irq(rtc->carry_irq, sh_rtc_interrupt, IRQF_DISABLED,
+                         "sh-rtc carry", rtc);
+       if (unlikely(ret)) {
+               dev_err(&pdev->dev,
+                       "request carry IRQ failed with %d, IRQ %d\n", ret,
+                       rtc->carry_irq);
+               free_irq(rtc->periodic_irq, rtc);
+               goto err_badmap;
+       }
+
+       ret = request_irq(rtc->alarm_irq, sh_rtc_alarm, IRQF_DISABLED,
+                         "sh-rtc alarm", rtc);
+       if (unlikely(ret)) {
+               dev_err(&pdev->dev,
+                       "request alarm IRQ failed with %d, IRQ %d\n", ret,
+                       rtc->alarm_irq);
+               free_irq(rtc->carry_irq, rtc);
+               free_irq(rtc->periodic_irq, rtc);
+               goto err_badmap;
+       }
+
+       tmp = readb(rtc->regbase + RCR1);
+       tmp &= ~RCR1_CF;
+       tmp |= RCR1_CIE;
+       writeb(tmp, rtc->regbase + RCR1);
+
        return 0;
 
 err_badmap:
@@ -630,6 +702,10 @@ static int __devexit sh_rtc_remove(struct platform_device *pdev)
        sh_rtc_setpie(&pdev->dev, 0);
        sh_rtc_setaie(&pdev->dev, 0);
 
+       free_irq(rtc->carry_irq, rtc);
+       free_irq(rtc->periodic_irq, rtc);
+       free_irq(rtc->alarm_irq, rtc);
+
        release_resource(rtc->res);
 
        platform_set_drvdata(pdev, NULL);
@@ -662,6 +738,8 @@ module_exit(sh_rtc_exit);
 
 MODULE_DESCRIPTION("SuperH on-chip RTC driver");
 MODULE_VERSION(DRV_VERSION);
-MODULE_AUTHOR("Paul Mundt <lethal@linux-sh.org>, Jamie Lenehan <lenehan@twibble.org>");
+MODULE_AUTHOR("Paul Mundt <lethal@linux-sh.org>, "
+             "Jamie Lenehan <lenehan@twibble.org>, "
+             "Angelo Castello <angelo.castello@st.com>");
 MODULE_LICENSE("GPL");
 MODULE_ALIAS("platform:" DRV_NAME);
index 03914fa811740084be75306421803bd74285f6e2..fe1ad1722158818f9ba594a455bb7f3b542e7fbe 100644 (file)
@@ -16,7 +16,6 @@
 #include <linux/ctype.h>
 #include <linux/dcache.h>
 
-#include <asm/semaphore.h>
 #include <asm/ccwdev.h>
 #include <asm/ccwgroup.h>
 
index c359386708e96d23ca2e8aa937116818f9a2d30a..10aa1e780801f42db88b0cf2006ad2e194744763 100644 (file)
 #include <linux/proc_fs.h>
 #include <linux/timer.h>
 #include <linux/mempool.h>
+#include <linux/semaphore.h>
 
 #include <asm/ccwdev.h>
 #include <asm/io.h>
 #include <asm/atomic.h>
-#include <asm/semaphore.h>
 #include <asm/timex.h>
 
 #include <asm/debug.h>
index 51c3ebf1c7d11ecfe93bb1a68c15839e373508ea..b31faeccb9cde4f0e15a762e38c777ba6a2ea976 100644 (file)
@@ -140,9 +140,10 @@ static void twa_unmap_scsi_data(TW_Device_Extension *tw_dev, int request_id);
 /* Functions */
 
 /* Show some statistics about the card */
-static ssize_t twa_show_stats(struct class_device *class_dev, char *buf)
+static ssize_t twa_show_stats(struct device *dev,
+                             struct device_attribute *attr, char *buf)
 {
-       struct Scsi_Host *host = class_to_shost(class_dev);
+       struct Scsi_Host *host = class_to_shost(dev);
        TW_Device_Extension *tw_dev = (TW_Device_Extension *)host->hostdata;
        unsigned long flags = 0;
        ssize_t len;
@@ -184,7 +185,7 @@ static int twa_change_queue_depth(struct scsi_device *sdev, int queue_depth)
 } /* End twa_change_queue_depth() */
 
 /* Create sysfs 'stats' entry */
-static struct class_device_attribute twa_host_stats_attr = {
+static struct device_attribute twa_host_stats_attr = {
        .attr = {
                .name =         "stats",
                .mode =         S_IRUGO,
@@ -193,7 +194,7 @@ static struct class_device_attribute twa_host_stats_attr = {
 };
 
 /* Host attributes initializer */
-static struct class_device_attribute *twa_host_attrs[] = {
+static struct device_attribute *twa_host_attrs[] = {
        &twa_host_stats_attr,
        NULL,
 };
index adb98a297210f08b8f8b3d3d4003e7aae7dabb35..8c22329aa85e1585035127185c0597cb51a95827 100644 (file)
@@ -484,9 +484,10 @@ static void tw_state_request_start(TW_Device_Extension *tw_dev, int *request_id)
 } /* End tw_state_request_start() */
 
 /* Show some statistics about the card */
-static ssize_t tw_show_stats(struct class_device *class_dev, char *buf)
+static ssize_t tw_show_stats(struct device *dev, struct device_attribute *attr,
+                            char *buf)
 {
-       struct Scsi_Host *host = class_to_shost(class_dev);
+       struct Scsi_Host *host = class_to_shost(dev);
        TW_Device_Extension *tw_dev = (TW_Device_Extension *)host->hostdata;
        unsigned long flags = 0;
        ssize_t len;
@@ -528,7 +529,7 @@ static int tw_change_queue_depth(struct scsi_device *sdev, int queue_depth)
 } /* End tw_change_queue_depth() */
 
 /* Create sysfs 'stats' entry */
-static struct class_device_attribute tw_host_stats_attr = {
+static struct device_attribute tw_host_stats_attr = {
        .attr = {
                .name =         "stats",
                .mode =         S_IRUGO,
@@ -537,7 +538,7 @@ static struct class_device_attribute tw_host_stats_attr = {
 };
 
 /* Host attributes initializer */
-static struct class_device_attribute *tw_host_attrs[] = {
+static struct device_attribute *tw_host_attrs[] = {
        &tw_host_stats_attr,
        NULL,
 };
index 369fcf78f39612303787a8c1c3fdb5598f79d982..460d4024c46c4c8118cb841d7c5107f69ed0ef29 100644 (file)
@@ -31,7 +31,6 @@
 #include <linux/slab.h>
 #include <linux/completion.h>
 #include <linux/blkdev.h>
-#include <asm/semaphore.h>
 #include <asm/uaccess.h>
 #include <linux/highmem.h> /* For flush_kernel_dcache_page */
 
@@ -1316,7 +1315,7 @@ int aac_get_adapter_info(struct aac_dev* dev)
                        tmp>>24,(tmp>>16)&0xff,tmp&0xff,
                        le32_to_cpu(dev->adapter_info.biosbuild));
                buffer[0] = '\0';
-               if (aac_show_serial_number(
+               if (aac_get_serial_number(
                  shost_to_class(dev->scsi_host_ptr), buffer))
                        printk(KERN_INFO "%s%d: serial %s",
                          dev->name, dev->id, buffer);
index ace0b751c131e311fd9e012077571889c8fafd66..113ca9c8934c775e05164f9ab302645bd9c15d53 100644 (file)
@@ -1850,9 +1850,9 @@ int aac_get_containers(struct aac_dev *dev);
 int aac_scsi_cmd(struct scsi_cmnd *cmd);
 int aac_dev_ioctl(struct aac_dev *dev, int cmd, void __user *arg);
 #ifndef shost_to_class
-#define shost_to_class(shost) &shost->shost_classdev
+#define shost_to_class(shost) &shost->shost_dev
 #endif
-ssize_t aac_show_serial_number(struct class_device *class_dev, char *buf);
+ssize_t aac_get_serial_number(struct device *dev, char *buf);
 int aac_do_ioctl(struct aac_dev * dev, int cmd, void __user *arg);
 int aac_rx_init(struct aac_dev *dev);
 int aac_rkt_init(struct aac_dev *dev);
index abef05146d7580e17d3929dcc8cc600d69c420c6..5fd83deab36ca6f1bf0834c83e4714fae63b124a 100644 (file)
@@ -39,7 +39,7 @@
 #include <linux/blkdev.h>
 #include <linux/delay.h> /* ssleep prototype */
 #include <linux/kthread.h>
-#include <asm/semaphore.h>
+#include <linux/semaphore.h>
 #include <asm/uaccess.h>
 
 #include "aacraid.h"
index 89cc8b7b42a2028f515f5e3fbe150c621d311405..294a802450be2efafe4cb0381b9c01c88920aa79 100644 (file)
@@ -39,7 +39,6 @@
 #include <linux/completion.h>
 #include <linux/mm.h>
 #include <scsi/scsi_host.h>
-#include <asm/semaphore.h>
 
 #include "aacraid.h"
 
index 23a8e9f8dcb4666126e28a22ac86c1c60f045537..ef67816a6fe5940211247e96e1299343e3f4a298 100644 (file)
 #include <linux/delay.h>
 #include <linux/kthread.h>
 #include <linux/interrupt.h>
+#include <linux/semaphore.h>
 #include <scsi/scsi.h>
 #include <scsi/scsi_host.h>
 #include <scsi/scsi_device.h>
 #include <scsi/scsi_cmnd.h>
-#include <asm/semaphore.h>
 
 #include "aacraid.h"
 
index d1163ded132bd2ab395d396a89d206e612df4bd9..933f208eedbadd92dde03f2be68c1be4e62fba33 100644 (file)
@@ -36,7 +36,7 @@
 #include <linux/slab.h>
 #include <linux/completion.h>
 #include <linux/blkdev.h>
-#include <asm/semaphore.h>
+#include <linux/semaphore.h>
 
 #include "aacraid.h"
 
index ae5f74fb62d5c93128d7075b86e80cdcb2d6cce0..c109f63f827940e275c886e462280bca459c0997 100644 (file)
@@ -42,7 +42,6 @@
 #include <linux/syscalls.h>
 #include <linux/delay.h>
 #include <linux/kthread.h>
-#include <asm/semaphore.h>
 
 #include <scsi/scsi.h>
 #include <scsi/scsi_cmnd.h>
@@ -755,10 +754,10 @@ static long aac_compat_cfg_ioctl(struct file *file, unsigned cmd, unsigned long
 }
 #endif
 
-static ssize_t aac_show_model(struct class_device *class_dev,
-               char *buf)
+static ssize_t aac_show_model(struct device *device,
+                             struct device_attribute *attr, char *buf)
 {
-       struct aac_dev *dev = (struct aac_dev*)class_to_shost(class_dev)->hostdata;
+       struct aac_dev *dev = (struct aac_dev*)class_to_shost(device)->hostdata;
        int len;
 
        if (dev->supplement_adapter_info.AdapterTypeText[0]) {
@@ -774,10 +773,10 @@ static ssize_t aac_show_model(struct class_device *class_dev,
        return len;
 }
 
-static ssize_t aac_show_vendor(struct class_device *class_dev,
-               char *buf)
+static ssize_t aac_show_vendor(struct device *device,
+                              struct device_attribute *attr, char *buf)
 {
-       struct aac_dev *dev = (struct aac_dev*)class_to_shost(class_dev)->hostdata;
+       struct aac_dev *dev = (struct aac_dev*)class_to_shost(device)->hostdata;
        int len;
 
        if (dev->supplement_adapter_info.AdapterTypeText[0]) {
@@ -793,10 +792,11 @@ static ssize_t aac_show_vendor(struct class_device *class_dev,
        return len;
 }
 
-static ssize_t aac_show_flags(struct class_device *class_dev, char *buf)
+static ssize_t aac_show_flags(struct device *cdev,
+                             struct device_attribute *attr, char *buf)
 {
        int len = 0;
-       struct aac_dev *dev = (struct aac_dev*)class_to_shost(class_dev)->hostdata;
+       struct aac_dev *dev = (struct aac_dev*)class_to_shost(cdev)->hostdata;
 
        if (nblank(dprintk(x)))
                len = snprintf(buf, PAGE_SIZE, "dprintk\n");
@@ -812,10 +812,11 @@ static ssize_t aac_show_flags(struct class_device *class_dev, char *buf)
        return len;
 }
 
-static ssize_t aac_show_kernel_version(struct class_device *class_dev,
-               char *buf)
+static ssize_t aac_show_kernel_version(struct device *device,
+                                      struct device_attribute *attr,
+                                      char *buf)
 {
-       struct aac_dev *dev = (struct aac_dev*)class_to_shost(class_dev)->hostdata;
+       struct aac_dev *dev = (struct aac_dev*)class_to_shost(device)->hostdata;
        int len, tmp;
 
        tmp = le32_to_cpu(dev->adapter_info.kernelrev);
@@ -825,10 +826,11 @@ static ssize_t aac_show_kernel_version(struct class_device *class_dev,
        return len;
 }
 
-static ssize_t aac_show_monitor_version(struct class_device *class_dev,
-               char *buf)
+static ssize_t aac_show_monitor_version(struct device *device,
+                                       struct device_attribute *attr,
+                                       char *buf)
 {
-       struct aac_dev *dev = (struct aac_dev*)class_to_shost(class_dev)->hostdata;
+       struct aac_dev *dev = (struct aac_dev*)class_to_shost(device)->hostdata;
        int len, tmp;
 
        tmp = le32_to_cpu(dev->adapter_info.monitorrev);
@@ -838,10 +840,11 @@ static ssize_t aac_show_monitor_version(struct class_device *class_dev,
        return len;
 }
 
-static ssize_t aac_show_bios_version(struct class_device *class_dev,
-               char *buf)
+static ssize_t aac_show_bios_version(struct device *device,
+                                    struct device_attribute *attr,
+                                    char *buf)
 {
-       struct aac_dev *dev = (struct aac_dev*)class_to_shost(class_dev)->hostdata;
+       struct aac_dev *dev = (struct aac_dev*)class_to_shost(device)->hostdata;
        int len, tmp;
 
        tmp = le32_to_cpu(dev->adapter_info.biosrev);
@@ -851,9 +854,10 @@ static ssize_t aac_show_bios_version(struct class_device *class_dev,
        return len;
 }
 
-ssize_t aac_show_serial_number(struct class_device *class_dev, char *buf)
+ssize_t aac_show_serial_number(struct device *device,
+                              struct device_attribute *attr, char *buf)
 {
-       struct aac_dev *dev = (struct aac_dev*)class_to_shost(class_dev)->hostdata;
+       struct aac_dev *dev = (struct aac_dev*)class_to_shost(device)->hostdata;
        int len = 0;
 
        if (le32_to_cpu(dev->adapter_info.serial[0]) != 0xBAD0)
@@ -869,35 +873,39 @@ ssize_t aac_show_serial_number(struct class_device *class_dev, char *buf)
        return len;
 }
 
-static ssize_t aac_show_max_channel(struct class_device *class_dev, char *buf)
+static ssize_t aac_show_max_channel(struct device *device,
+                                   struct device_attribute *attr, char *buf)
 {
        return snprintf(buf, PAGE_SIZE, "%d\n",
-         class_to_shost(class_dev)->max_channel);
+         class_to_shost(device)->max_channel);
 }
 
-static ssize_t aac_show_max_id(struct class_device *class_dev, char *buf)
+static ssize_t aac_show_max_id(struct device *device,
+                              struct device_attribute *attr, char *buf)
 {
        return snprintf(buf, PAGE_SIZE, "%d\n",
-         class_to_shost(class_dev)->max_id);
+         class_to_shost(device)->max_id);
 }
 
-static ssize_t aac_store_reset_adapter(struct class_device *class_dev,
-               const char *buf, size_t count)
+static ssize_t aac_store_reset_adapter(struct device *device,
+                                      struct device_attribute *attr,
+                                      const char *buf, size_t count)
 {
        int retval = -EACCES;
 
        if (!capable(CAP_SYS_ADMIN))
                return retval;
-       retval = aac_reset_adapter((struct aac_dev*)class_to_shost(class_dev)->hostdata, buf[0] == '!');
+       retval = aac_reset_adapter((struct aac_dev*)class_to_shost(device)->hostdata, buf[0] == '!');
        if (retval >= 0)
                retval = count;
        return retval;
 }
 
-static ssize_t aac_show_reset_adapter(struct class_device *class_dev,
-               char *buf)
+static ssize_t aac_show_reset_adapter(struct device *device,
+                                     struct device_attribute *attr,
+                                     char *buf)
 {
-       struct aac_dev *dev = (struct aac_dev*)class_to_shost(class_dev)->hostdata;
+       struct aac_dev *dev = (struct aac_dev*)class_to_shost(device)->hostdata;
        int len, tmp;
 
        tmp = aac_adapter_check_health(dev);
@@ -907,70 +915,70 @@ static ssize_t aac_show_reset_adapter(struct class_device *class_dev,
        return len;
 }
 
-static struct class_device_attribute aac_model = {
+static struct device_attribute aac_model = {
        .attr = {
                .name = "model",
                .mode = S_IRUGO,
        },
        .show = aac_show_model,
 };
-static struct class_device_attribute aac_vendor = {
+static struct device_attribute aac_vendor = {
        .attr = {
                .name = "vendor",
                .mode = S_IRUGO,
        },
        .show = aac_show_vendor,
 };
-static struct class_device_attribute aac_flags = {
+static struct device_attribute aac_flags = {
        .attr = {
                .name = "flags",
                .mode = S_IRUGO,
        },
        .show = aac_show_flags,
 };
-static struct class_device_attribute aac_kernel_version = {
+static struct device_attribute aac_kernel_version = {
        .attr = {
                .name = "hba_kernel_version",
                .mode = S_IRUGO,
        },
        .show = aac_show_kernel_version,
 };
-static struct class_device_attribute aac_monitor_version = {
+static struct device_attribute aac_monitor_version = {
        .attr = {
                .name = "hba_monitor_version",
                .mode = S_IRUGO,
        },
        .show = aac_show_monitor_version,
 };
-static struct class_device_attribute aac_bios_version = {
+static struct device_attribute aac_bios_version = {
        .attr = {
                .name = "hba_bios_version",
                .mode = S_IRUGO,
        },
        .show = aac_show_bios_version,
 };
-static struct class_device_attribute aac_serial_number = {
+static struct device_attribute aac_serial_number = {
        .attr = {
                .name = "serial_number",
                .mode = S_IRUGO,
        },
        .show = aac_show_serial_number,
 };
-static struct class_device_attribute aac_max_channel = {
+static struct device_attribute aac_max_channel = {
        .attr = {
                .name = "max_channel",
                .mode = S_IRUGO,
        },
        .show = aac_show_max_channel,
 };
-static struct class_device_attribute aac_max_id = {
+static struct device_attribute aac_max_id = {
        .attr = {
                .name = "max_id",
                .mode = S_IRUGO,
        },
        .show = aac_show_max_id,
 };
-static struct class_device_attribute aac_reset = {
+static struct device_attribute aac_reset = {
        .attr = {
                .name = "reset_host",
                .mode = S_IWUSR|S_IRUGO,
@@ -979,7 +987,7 @@ static struct class_device_attribute aac_reset = {
        .show = aac_show_reset_adapter,
 };
 
-static struct class_device_attribute *aac_attrs[] = {
+static struct device_attribute *aac_attrs[] = {
        &aac_model,
        &aac_vendor,
        &aac_flags,
@@ -993,6 +1001,10 @@ static struct class_device_attribute *aac_attrs[] = {
        NULL
 };
 
+ssize_t aac_get_serial_number(struct device *device, char *buf)
+{
+       return aac_show_serial_number(device, &aac_serial_number, buf);
+}
 
 static const struct file_operations aac_cfg_fops = {
        .owner          = THIS_MODULE,
index 1f18b83e1e02b90cb64850e2d0181bcaea57f4f2..073208b0f622cf6148d86418f384bbf5fa8f3f5c 100644 (file)
@@ -39,7 +39,6 @@
 #include <linux/completion.h>
 #include <linux/time.h>
 #include <linux/interrupt.h>
-#include <asm/semaphore.h>
 
 #include <scsi/scsi_host.h>
 
index cfc3410ec0733e9b828295b01a34a4c72abd4f78..fc1a55796a89197247e6554e95f972730f866cd8 100644 (file)
@@ -39,7 +39,6 @@
 #include <linux/completion.h>
 #include <linux/time.h>
 #include <linux/interrupt.h>
-#include <asm/semaphore.h>
 
 #include <scsi/scsi_host.h>
 
index 3288be2e49f80c46eb3f50d56b1fe3f07e1f4b77..ab646e580d641dcb7f08a692921733b9a14e8129 100644 (file)
@@ -44,7 +44,7 @@
 */
 #include <linux/interrupt.h>
 
-struct class_device_attribute;
+struct device_attribute;
 /*The limit of outstanding scsi command that firmware can handle*/
 #define ARCMSR_MAX_OUTSTANDING_CMD                                             256
 #define ARCMSR_MAX_FREECCB_NUM                                                 320
@@ -556,6 +556,6 @@ struct SENSE_DATA
 extern void arcmsr_post_ioctldata2iop(struct AdapterControlBlock *);
 extern void arcmsr_iop_message_read(struct AdapterControlBlock *);
 extern struct QBUFFER __iomem *arcmsr_get_iop_rqbuffer(struct AdapterControlBlock *);
-extern struct class_device_attribute *arcmsr_host_attrs[];
+extern struct device_attribute *arcmsr_host_attrs[];
 extern int arcmsr_alloc_sysfs_attr(struct AdapterControlBlock *);
 void arcmsr_free_sysfs_attr(struct AdapterControlBlock *acb);
index 7d7b0a5542766a23717c598d0231bb57b8612ca6..69f8346aa288348a86a8d9885dbfd1759867c5ad 100644 (file)
 #include <scsi/scsi_transport.h>
 #include "arcmsr.h"
 
-struct class_device_attribute *arcmsr_host_attrs[];
+struct device_attribute *arcmsr_host_attrs[];
 
 static ssize_t arcmsr_sysfs_iop_message_read(struct kobject *kobj,
                                             struct bin_attribute *bin,
                                             char *buf, loff_t off,
                                             size_t count)
 {
-       struct class_device *cdev = container_of(kobj,struct class_device,kobj);
-       struct Scsi_Host *host = class_to_shost(cdev);
+       struct device *dev = container_of(kobj,struct device,kobj);
+       struct Scsi_Host *host = class_to_shost(dev);
        struct AdapterControlBlock *acb = (struct AdapterControlBlock *) host->hostdata;
        uint8_t *pQbuffer,*ptmpQbuffer;
        int32_t allxfer_len = 0;
@@ -110,8 +110,8 @@ static ssize_t arcmsr_sysfs_iop_message_write(struct kobject *kobj,
                                              char *buf, loff_t off,
                                              size_t count)
 {
-       struct class_device *cdev = container_of(kobj,struct class_device,kobj);
-       struct Scsi_Host *host = class_to_shost(cdev);
+       struct device *dev = container_of(kobj,struct device,kobj);
+       struct Scsi_Host *host = class_to_shost(dev);
        struct AdapterControlBlock *acb = (struct AdapterControlBlock *) host->hostdata;
        int32_t my_empty_len, user_len, wqbuf_firstindex, wqbuf_lastindex;
        uint8_t *pQbuffer, *ptmpuserbuffer;
@@ -158,8 +158,8 @@ static ssize_t arcmsr_sysfs_iop_message_clear(struct kobject *kobj,
                                              char *buf, loff_t off,
                                              size_t count)
 {
-       struct class_device *cdev = container_of(kobj,struct class_device,kobj);
-       struct Scsi_Host *host = class_to_shost(cdev);
+       struct device *dev = container_of(kobj,struct device,kobj);
+       struct Scsi_Host *host = class_to_shost(dev);
        struct AdapterControlBlock *acb = (struct AdapterControlBlock *) host->hostdata;
        uint8_t *pQbuffer;
 
@@ -220,87 +220,104 @@ int arcmsr_alloc_sysfs_attr(struct AdapterControlBlock *acb)
        struct Scsi_Host *host = acb->host;
        int error;
 
-       error = sysfs_create_bin_file(&host->shost_classdev.kobj, &arcmsr_sysfs_message_read_attr);
+       error = sysfs_create_bin_file(&host->shost_dev.kobj, &arcmsr_sysfs_message_read_attr);
        if (error) {
                printk(KERN_ERR "arcmsr: alloc sysfs mu_read failed\n");
                goto error_bin_file_message_read;
        }
-       error = sysfs_create_bin_file(&host->shost_classdev.kobj, &arcmsr_sysfs_message_write_attr);
+       error = sysfs_create_bin_file(&host->shost_dev.kobj, &arcmsr_sysfs_message_write_attr);
        if (error) {
                printk(KERN_ERR "arcmsr: alloc sysfs mu_write failed\n");
                goto error_bin_file_message_write;
        }
-       error = sysfs_create_bin_file(&host->shost_classdev.kobj, &arcmsr_sysfs_message_clear_attr);
+       error = sysfs_create_bin_file(&host->shost_dev.kobj, &arcmsr_sysfs_message_clear_attr);
        if (error) {
                printk(KERN_ERR "arcmsr: alloc sysfs mu_clear failed\n");
                goto error_bin_file_message_clear;
        }
        return 0;
 error_bin_file_message_clear:
-       sysfs_remove_bin_file(&host->shost_classdev.kobj, &arcmsr_sysfs_message_write_attr);
+       sysfs_remove_bin_file(&host->shost_dev.kobj, &arcmsr_sysfs_message_write_attr);
 error_bin_file_message_write:
-       sysfs_remove_bin_file(&host->shost_classdev.kobj, &arcmsr_sysfs_message_read_attr);
+       sysfs_remove_bin_file(&host->shost_dev.kobj, &arcmsr_sysfs_message_read_attr);
 error_bin_file_message_read:
        return error;
 }
 
-void
-arcmsr_free_sysfs_attr(struct AdapterControlBlock *acb) {
+void arcmsr_free_sysfs_attr(struct AdapterControlBlock *acb)
+{
        struct Scsi_Host *host = acb->host;
 
-       sysfs_remove_bin_file(&host->shost_classdev.kobj, &arcmsr_sysfs_message_clear_attr);
-       sysfs_remove_bin_file(&host->shost_classdev.kobj, &arcmsr_sysfs_message_write_attr);
-       sysfs_remove_bin_file(&host->shost_classdev.kobj, &arcmsr_sysfs_message_read_attr);
+       sysfs_remove_bin_file(&host->shost_dev.kobj, &arcmsr_sysfs_message_clear_attr);
+       sysfs_remove_bin_file(&host->shost_dev.kobj, &arcmsr_sysfs_message_write_attr);
+       sysfs_remove_bin_file(&host->shost_dev.kobj, &arcmsr_sysfs_message_read_attr);
 }
 
 
 static ssize_t
-arcmsr_attr_host_driver_version(struct class_device *cdev, char *buf) {
+arcmsr_attr_host_driver_version(struct device *dev,
+                               struct device_attribute *attr, char *buf)
+{
        return snprintf(buf, PAGE_SIZE,
                        "%s\n",
                        ARCMSR_DRIVER_VERSION);
 }
 
 static ssize_t
-arcmsr_attr_host_driver_posted_cmd(struct class_device *cdev, char *buf) {
-       struct Scsi_Host *host = class_to_shost(cdev);
-       struct AdapterControlBlock *acb = (struct AdapterControlBlock *) host->hostdata;
+arcmsr_attr_host_driver_posted_cmd(struct device *dev,
+                                  struct device_attribute *attr, char *buf)
+{
+       struct Scsi_Host *host = class_to_shost(dev);
+       struct AdapterControlBlock *acb =
+               (struct AdapterControlBlock *) host->hostdata;
        return snprintf(buf, PAGE_SIZE,
                        "%4d\n",
                        atomic_read(&acb->ccboutstandingcount));
 }
 
 static ssize_t
-arcmsr_attr_host_driver_reset(struct class_device *cdev, char *buf) {
-       struct Scsi_Host *host = class_to_shost(cdev);
-       struct AdapterControlBlock *acb = (struct AdapterControlBlock *) host->hostdata;
+arcmsr_attr_host_driver_reset(struct device *dev,
+                             struct device_attribute *attr, char *buf)
+{
+       struct Scsi_Host *host = class_to_shost(dev);
+       struct AdapterControlBlock *acb =
+               (struct AdapterControlBlock *) host->hostdata;
        return snprintf(buf, PAGE_SIZE,
                        "%4d\n",
                        acb->num_resets);
 }
 
 static ssize_t
-arcmsr_attr_host_driver_abort(struct class_device *cdev, char *buf) {
-       struct Scsi_Host *host = class_to_shost(cdev);
-       struct AdapterControlBlock *acb = (struct AdapterControlBlock *) host->hostdata;
+arcmsr_attr_host_driver_abort(struct device *dev,
+                             struct device_attribute *attr, char *buf)
+{
+       struct Scsi_Host *host = class_to_shost(dev);
+       struct AdapterControlBlock *acb =
+               (struct AdapterControlBlock *) host->hostdata;
        return snprintf(buf, PAGE_SIZE,
                        "%4d\n",
                        acb->num_aborts);
 }
 
 static ssize_t
-arcmsr_attr_host_fw_model(struct class_device *cdev, char *buf) {
-    struct Scsi_Host *host = class_to_shost(cdev);
-       struct AdapterControlBlock *acb = (struct AdapterControlBlock *) host->hostdata;
+arcmsr_attr_host_fw_model(struct device *dev, struct device_attribute *attr,
+                         char *buf)
+{
+       struct Scsi_Host *host = class_to_shost(dev);
+       struct AdapterControlBlock *acb =
+               (struct AdapterControlBlock *) host->hostdata;
        return snprintf(buf, PAGE_SIZE,
                        "%s\n",
                        acb->firm_model);
 }
 
 static ssize_t
-arcmsr_attr_host_fw_version(struct class_device *cdev, char *buf) {
-       struct Scsi_Host *host = class_to_shost(cdev);
-       struct AdapterControlBlock *acb = (struct AdapterControlBlock *) host->hostdata;
+arcmsr_attr_host_fw_version(struct device *dev,
+                           struct device_attribute *attr, char *buf)
+{
+       struct Scsi_Host *host = class_to_shost(dev);
+       struct AdapterControlBlock *acb =
+                       (struct AdapterControlBlock *) host->hostdata;
 
        return snprintf(buf, PAGE_SIZE,
                        "%s\n",
@@ -308,9 +325,12 @@ arcmsr_attr_host_fw_version(struct class_device *cdev, char *buf) {
 }
 
 static ssize_t
-arcmsr_attr_host_fw_request_len(struct class_device *cdev, char *buf) {
-       struct Scsi_Host *host = class_to_shost(cdev);
-       struct AdapterControlBlock *acb = (struct AdapterControlBlock *) host->hostdata;
+arcmsr_attr_host_fw_request_len(struct device *dev,
+                               struct device_attribute *attr, char *buf)
+{
+       struct Scsi_Host *host = class_to_shost(dev);
+       struct AdapterControlBlock *acb =
+               (struct AdapterControlBlock *) host->hostdata;
 
        return snprintf(buf, PAGE_SIZE,
                        "%4d\n",
@@ -318,9 +338,12 @@ arcmsr_attr_host_fw_request_len(struct class_device *cdev, char *buf) {
 }
 
 static ssize_t
-arcmsr_attr_host_fw_numbers_queue(struct class_device *cdev, char *buf) {
-       struct Scsi_Host *host = class_to_shost(cdev);
-       struct AdapterControlBlock *acb = (struct AdapterControlBlock *) host->hostdata;
+arcmsr_attr_host_fw_numbers_queue(struct device *dev,
+                                 struct device_attribute *attr, char *buf)
+{
+       struct Scsi_Host *host = class_to_shost(dev);
+       struct AdapterControlBlock *acb =
+               (struct AdapterControlBlock *) host->hostdata;
 
        return snprintf(buf, PAGE_SIZE,
                        "%4d\n",
@@ -328,9 +351,12 @@ arcmsr_attr_host_fw_numbers_queue(struct class_device *cdev, char *buf) {
 }
 
 static ssize_t
-arcmsr_attr_host_fw_sdram_size(struct class_device *cdev, char *buf) {
-       struct Scsi_Host *host = class_to_shost(cdev);
-       struct AdapterControlBlock *acb = (struct AdapterControlBlock *) host->hostdata;
+arcmsr_attr_host_fw_sdram_size(struct device *dev,
+                              struct device_attribute *attr, char *buf)
+{
+       struct Scsi_Host *host = class_to_shost(dev);
+       struct AdapterControlBlock *acb =
+               (struct AdapterControlBlock *) host->hostdata;
 
        return snprintf(buf, PAGE_SIZE,
                        "%4d\n",
@@ -338,36 +364,39 @@ arcmsr_attr_host_fw_sdram_size(struct class_device *cdev, char *buf) {
 }
 
 static ssize_t
-arcmsr_attr_host_fw_hd_channels(struct class_device *cdev, char *buf) {
-       struct Scsi_Host *host = class_to_shost(cdev);
-       struct AdapterControlBlock *acb = (struct AdapterControlBlock *) host->hostdata;
+arcmsr_attr_host_fw_hd_channels(struct device *dev,
+                               struct device_attribute *attr, char *buf)
+{
+       struct Scsi_Host *host = class_to_shost(dev);
+       struct AdapterControlBlock *acb =
+               (struct AdapterControlBlock *) host->hostdata;
 
        return snprintf(buf, PAGE_SIZE,
                        "%4d\n",
                        acb->firm_hd_channels);
 }
 
-static CLASS_DEVICE_ATTR(host_driver_version, S_IRUGO, arcmsr_attr_host_driver_version, NULL);
-static CLASS_DEVICE_ATTR(host_driver_posted_cmd, S_IRUGO, arcmsr_attr_host_driver_posted_cmd, NULL);
-static CLASS_DEVICE_ATTR(host_driver_reset, S_IRUGO, arcmsr_attr_host_driver_reset, NULL);
-static CLASS_DEVICE_ATTR(host_driver_abort, S_IRUGO, arcmsr_attr_host_driver_abort, NULL);
-static CLASS_DEVICE_ATTR(host_fw_model, S_IRUGO, arcmsr_attr_host_fw_model, NULL);
-static CLASS_DEVICE_ATTR(host_fw_version, S_IRUGO, arcmsr_attr_host_fw_version, NULL);
-static CLASS_DEVICE_ATTR(host_fw_request_len, S_IRUGO, arcmsr_attr_host_fw_request_len, NULL);
-static CLASS_DEVICE_ATTR(host_fw_numbers_queue, S_IRUGO, arcmsr_attr_host_fw_numbers_queue, NULL);
-static CLASS_DEVICE_ATTR(host_fw_sdram_size, S_IRUGO, arcmsr_attr_host_fw_sdram_size, NULL);
-static CLASS_DEVICE_ATTR(host_fw_hd_channels, S_IRUGO, arcmsr_attr_host_fw_hd_channels, NULL);
-
-struct class_device_attribute *arcmsr_host_attrs[] = {
-       &class_device_attr_host_driver_version,
-       &class_device_attr_host_driver_posted_cmd,
-       &class_device_attr_host_driver_reset,
-       &class_device_attr_host_driver_abort,
-       &class_device_attr_host_fw_model,
-       &class_device_attr_host_fw_version,
-       &class_device_attr_host_fw_request_len,
-       &class_device_attr_host_fw_numbers_queue,
-       &class_device_attr_host_fw_sdram_size,
-       &class_device_attr_host_fw_hd_channels,
+static DEVICE_ATTR(host_driver_version, S_IRUGO, arcmsr_attr_host_driver_version, NULL);
+static DEVICE_ATTR(host_driver_posted_cmd, S_IRUGO, arcmsr_attr_host_driver_posted_cmd, NULL);
+static DEVICE_ATTR(host_driver_reset, S_IRUGO, arcmsr_attr_host_driver_reset, NULL);
+static DEVICE_ATTR(host_driver_abort, S_IRUGO, arcmsr_attr_host_driver_abort, NULL);
+static DEVICE_ATTR(host_fw_model, S_IRUGO, arcmsr_attr_host_fw_model, NULL);
+static DEVICE_ATTR(host_fw_version, S_IRUGO, arcmsr_attr_host_fw_version, NULL);
+static DEVICE_ATTR(host_fw_request_len, S_IRUGO, arcmsr_attr_host_fw_request_len, NULL);
+static DEVICE_ATTR(host_fw_numbers_queue, S_IRUGO, arcmsr_attr_host_fw_numbers_queue, NULL);
+static DEVICE_ATTR(host_fw_sdram_size, S_IRUGO, arcmsr_attr_host_fw_sdram_size, NULL);
+static DEVICE_ATTR(host_fw_hd_channels, S_IRUGO, arcmsr_attr_host_fw_hd_channels, NULL);
+
+struct device_attribute *arcmsr_host_attrs[] = {
+       &dev_attr_host_driver_version,
+       &dev_attr_host_driver_posted_cmd,
+       &dev_attr_host_driver_reset,
+       &dev_attr_host_driver_abort,
+       &dev_attr_host_fw_model,
+       &dev_attr_host_fw_version,
+       &dev_attr_host_fw_request_len,
+       &dev_attr_host_fw_numbers_queue,
+       &dev_attr_host_fw_sdram_size,
+       &dev_attr_host_fw_hd_channels,
        NULL,
 };
index 92d1cb1b21cb1d419043f24dc557799014978b33..75c84d7b9ce84068d7d99db19105c0b51863cdd8 100644 (file)
@@ -881,7 +881,7 @@ static long ch_ioctl_compat(struct file * file,
 static int ch_probe(struct device *dev)
 {
        struct scsi_device *sd = to_scsi_device(dev);
-       struct class_device *class_dev;
+       struct device *class_dev;
        int minor, ret = -ENOMEM;
        scsi_changer *ch;
 
@@ -910,11 +910,11 @@ static int ch_probe(struct device *dev)
        ch->minor = minor;
        sprintf(ch->name,"ch%d",ch->minor);
 
-       class_dev = class_device_create(ch_sysfs_class, NULL,
-                                       MKDEV(SCSI_CHANGER_MAJOR, ch->minor),
-                                       dev, "s%s", ch->name);
+       class_dev = device_create(ch_sysfs_class, dev,
+                                 MKDEV(SCSI_CHANGER_MAJOR,ch->minor),
+                                 "s%s", ch->name);
        if (IS_ERR(class_dev)) {
-               printk(KERN_WARNING "ch%d: class_device_create failed\n",
+               printk(KERN_WARNING "ch%d: device_create failed\n",
                       ch->minor);
                ret = PTR_ERR(class_dev);
                goto remove_idr;
@@ -945,8 +945,7 @@ static int ch_remove(struct device *dev)
        idr_remove(&ch_index_idr, ch->minor);
        spin_unlock(&ch_index_lock);
 
-       class_device_destroy(ch_sysfs_class,
-                            MKDEV(SCSI_CHANGER_MAJOR,ch->minor));
+       device_destroy(ch_sysfs_class, MKDEV(SCSI_CHANGER_MAJOR,ch->minor));
        kfree(ch->dt);
        kfree(ch);
        return 0;
index 100b49baca7f0e8873b611a4d1d01d784874231b..19406cea6d6a3800356b5598df151d3c26af47fb 100644 (file)
@@ -21,7 +21,6 @@
 
 #include <linux/i2o-dev.h>
 
-#include <asm/semaphore.h> /* Needed for MUTEX init macros */
 #include <linux/version.h>
 #include <linux/notifier.h>
 #include <asm/atomic.h>
index 1592640a87b5404e14119b411596f80196468c81..c264a8c5f01e1f362284476f1513a38f38b56ed1 100644 (file)
 static int scsi_host_next_hn;          /* host_no for next new host */
 
 
-static void scsi_host_cls_release(struct class_device *class_dev)
+static void scsi_host_cls_release(struct device *dev)
 {
-       put_device(&class_to_shost(class_dev)->shost_gendev);
+       put_device(&class_to_shost(dev)->shost_gendev);
 }
 
 static struct class shost_class = {
        .name           = "scsi_host",
-       .release        = scsi_host_cls_release,
+       .dev_release    = scsi_host_cls_release,
 };
 
 /**
@@ -174,7 +174,7 @@ void scsi_remove_host(struct Scsi_Host *shost)
        spin_unlock_irqrestore(shost->host_lock, flags);
 
        transport_unregister_device(&shost->shost_gendev);
-       class_device_unregister(&shost->shost_classdev);
+       device_unregister(&shost->shost_dev);
        device_del(&shost->shost_gendev);
        scsi_proc_hostdir_rm(shost->hostt);
 }
@@ -212,7 +212,7 @@ int scsi_add_host(struct Scsi_Host *shost, struct device *dev)
        scsi_host_set_state(shost, SHOST_RUNNING);
        get_device(shost->shost_gendev.parent);
 
-       error = class_device_add(&shost->shost_classdev);
+       error = device_add(&shost->shost_dev);
        if (error)
                goto out_del_gendev;
 
@@ -223,7 +223,7 @@ int scsi_add_host(struct Scsi_Host *shost, struct device *dev)
                                         GFP_KERNEL);
                if (shost->shost_data == NULL) {
                        error = -ENOMEM;
-                       goto out_del_classdev;
+                       goto out_del_dev;
                }
        }
 
@@ -250,8 +250,8 @@ int scsi_add_host(struct Scsi_Host *shost, struct device *dev)
                destroy_workqueue(shost->work_q);
  out_free_shost_data:
        kfree(shost->shost_data);
- out_del_classdev:
-       class_device_del(&shost->shost_classdev);
+ out_del_dev:
+       device_del(&shost->shost_dev);
  out_del_gendev:
        device_del(&shost->shost_gendev);
  out:
@@ -385,11 +385,11 @@ struct Scsi_Host *scsi_host_alloc(struct scsi_host_template *sht, int privsize)
                shost->host_no);
        shost->shost_gendev.release = scsi_host_dev_release;
 
-       class_device_initialize(&shost->shost_classdev);
-       shost->shost_classdev.dev = &shost->shost_gendev;
-       shost->shost_classdev.class = &shost_class;
-       snprintf(shost->shost_classdev.class_id, BUS_ID_SIZE, "host%d",
-                 shost->host_no);
+       device_initialize(&shost->shost_dev);
+       shost->shost_dev.parent = &shost->shost_gendev;
+       shost->shost_dev.class = &shost_class;
+       snprintf(shost->shost_dev.bus_id, BUS_ID_SIZE, "host%d",
+                shost->host_no);
 
        shost->ehandler = kthread_run(scsi_error_handler, shost,
                        "scsi_eh_%d", shost->host_no);
@@ -432,12 +432,12 @@ void scsi_unregister(struct Scsi_Host *shost)
 }
 EXPORT_SYMBOL(scsi_unregister);
 
-static int __scsi_host_match(struct class_device *cdev, void *data)
+static int __scsi_host_match(struct device *dev, void *data)
 {
        struct Scsi_Host *p;
        unsigned short *hostnum = (unsigned short *)data;
 
-       p = class_to_shost(cdev);
+       p = class_to_shost(dev);
        return p->host_no == *hostnum;
 }
 
@@ -450,10 +450,10 @@ static int __scsi_host_match(struct class_device *cdev, void *data)
  **/
 struct Scsi_Host *scsi_host_lookup(unsigned short hostnum)
 {
-       struct class_device *cdev;
+       struct device *cdev;
        struct Scsi_Host *shost = ERR_PTR(-ENXIO);
 
-       cdev = class_find_child(&shost_class, &hostnum, __scsi_host_match);
+       cdev = class_find_device(&shost_class, &hostnum, __scsi_host_match);
        if (cdev)
                shost = scsi_host_get(class_to_shost(cdev));
 
index beecda991682c9984d93b727d7c17867bdbebd9b..5b7be1e9841c23da55fd007390c90bbd237ff79a 100644 (file)
@@ -859,14 +859,16 @@ static int hptiop_adjust_disk_queue_depth(struct scsi_device *sdev,
        return queue_depth;
 }
 
-static ssize_t hptiop_show_version(struct class_device *class_dev, char *buf)
+static ssize_t hptiop_show_version(struct device *dev,
+                                  struct device_attribute *attr, char *buf)
 {
        return snprintf(buf, PAGE_SIZE, "%s\n", driver_ver);
 }
 
-static ssize_t hptiop_show_fw_version(struct class_device *class_dev, char *buf)
+static ssize_t hptiop_show_fw_version(struct device *dev,
+                                     struct device_attribute *attr, char *buf)
 {
-       struct Scsi_Host *host = class_to_shost(class_dev);
+       struct Scsi_Host *host = class_to_shost(dev);
        struct hptiop_hba *hba = (struct hptiop_hba *)host->hostdata;
 
        return snprintf(buf, PAGE_SIZE, "%d.%d.%d.%d\n",
@@ -876,7 +878,7 @@ static ssize_t hptiop_show_fw_version(struct class_device *class_dev, char *buf)
                                hba->firmware_version & 0xff);
 }
 
-static struct class_device_attribute hptiop_attr_version = {
+static struct device_attribute hptiop_attr_version = {
        .attr = {
                .name = "driver-version",
                .mode = S_IRUGO,
@@ -884,7 +886,7 @@ static struct class_device_attribute hptiop_attr_version = {
        .show = hptiop_show_version,
 };
 
-static struct class_device_attribute hptiop_attr_fw_version = {
+static struct device_attribute hptiop_attr_fw_version = {
        .attr = {
                .name = "firmware-version",
                .mode = S_IRUGO,
@@ -892,7 +894,7 @@ static struct class_device_attribute hptiop_attr_fw_version = {
        .show = hptiop_show_fw_version,
 };
 
-static struct class_device_attribute *hptiop_attrs[] = {
+static struct device_attribute *hptiop_attrs[] = {
        &hptiop_attr_version,
        &hptiop_attr_fw_version,
        NULL
index 78d46a900bb51a5e43d8877bb0882f983e6ae13f..4a922c57125ef1403e074d32eb85309c84002e6d 100644 (file)
@@ -1456,9 +1456,10 @@ static int ibmvscsi_change_queue_depth(struct scsi_device *sdev, int qdepth)
 /* ------------------------------------------------------------
  * sysfs attributes
  */
-static ssize_t show_host_srp_version(struct class_device *class_dev, char *buf)
+static ssize_t show_host_srp_version(struct device *dev,
+                                    struct device_attribute *attr, char *buf)
 {
-       struct Scsi_Host *shost = class_to_shost(class_dev);
+       struct Scsi_Host *shost = class_to_shost(dev);
        struct ibmvscsi_host_data *hostdata = shost_priv(shost);
        int len;
 
@@ -1467,7 +1468,7 @@ static ssize_t show_host_srp_version(struct class_device *class_dev, char *buf)
        return len;
 }
 
-static struct class_device_attribute ibmvscsi_host_srp_version = {
+static struct device_attribute ibmvscsi_host_srp_version = {
        .attr = {
                 .name = "srp_version",
                 .mode = S_IRUGO,
@@ -1475,10 +1476,11 @@ static struct class_device_attribute ibmvscsi_host_srp_version = {
        .show = show_host_srp_version,
 };
 
-static ssize_t show_host_partition_name(struct class_device *class_dev,
+static ssize_t show_host_partition_name(struct device *dev,
+                                       struct device_attribute *attr,
                                        char *buf)
 {
-       struct Scsi_Host *shost = class_to_shost(class_dev);
+       struct Scsi_Host *shost = class_to_shost(dev);
        struct ibmvscsi_host_data *hostdata = shost_priv(shost);
        int len;
 
@@ -1487,7 +1489,7 @@ static ssize_t show_host_partition_name(struct class_device *class_dev,
        return len;
 }
 
-static struct class_device_attribute ibmvscsi_host_partition_name = {
+static struct device_attribute ibmvscsi_host_partition_name = {
        .attr = {
                 .name = "partition_name",
                 .mode = S_IRUGO,
@@ -1495,10 +1497,11 @@ static struct class_device_attribute ibmvscsi_host_partition_name = {
        .show = show_host_partition_name,
 };
 
-static ssize_t show_host_partition_number(struct class_device *class_dev,
+static ssize_t show_host_partition_number(struct device *dev,
+                                         struct device_attribute *attr,
                                          char *buf)
 {
-       struct Scsi_Host *shost = class_to_shost(class_dev);
+       struct Scsi_Host *shost = class_to_shost(dev);
        struct ibmvscsi_host_data *hostdata = shost_priv(shost);
        int len;
 
@@ -1507,7 +1510,7 @@ static ssize_t show_host_partition_number(struct class_device *class_dev,
        return len;
 }
 
-static struct class_device_attribute ibmvscsi_host_partition_number = {
+static struct device_attribute ibmvscsi_host_partition_number = {
        .attr = {
                 .name = "partition_number",
                 .mode = S_IRUGO,
@@ -1515,9 +1518,10 @@ static struct class_device_attribute ibmvscsi_host_partition_number = {
        .show = show_host_partition_number,
 };
 
-static ssize_t show_host_mad_version(struct class_device *class_dev, char *buf)
+static ssize_t show_host_mad_version(struct device *dev,
+                                    struct device_attribute *attr, char *buf)
 {
-       struct Scsi_Host *shost = class_to_shost(class_dev);
+       struct Scsi_Host *shost = class_to_shost(dev);
        struct ibmvscsi_host_data *hostdata = shost_priv(shost);
        int len;
 
@@ -1526,7 +1530,7 @@ static ssize_t show_host_mad_version(struct class_device *class_dev, char *buf)
        return len;
 }
 
-static struct class_device_attribute ibmvscsi_host_mad_version = {
+static struct device_attribute ibmvscsi_host_mad_version = {
        .attr = {
                 .name = "mad_version",
                 .mode = S_IRUGO,
@@ -1534,9 +1538,10 @@ static struct class_device_attribute ibmvscsi_host_mad_version = {
        .show = show_host_mad_version,
 };
 
-static ssize_t show_host_os_type(struct class_device *class_dev, char *buf)
+static ssize_t show_host_os_type(struct device *dev,
+                                struct device_attribute *attr, char *buf)
 {
-       struct Scsi_Host *shost = class_to_shost(class_dev);
+       struct Scsi_Host *shost = class_to_shost(dev);
        struct ibmvscsi_host_data *hostdata = shost_priv(shost);
        int len;
 
@@ -1544,7 +1549,7 @@ static ssize_t show_host_os_type(struct class_device *class_dev, char *buf)
        return len;
 }
 
-static struct class_device_attribute ibmvscsi_host_os_type = {
+static struct device_attribute ibmvscsi_host_os_type = {
        .attr = {
                 .name = "os_type",
                 .mode = S_IRUGO,
@@ -1552,9 +1557,10 @@ static struct class_device_attribute ibmvscsi_host_os_type = {
        .show = show_host_os_type,
 };
 
-static ssize_t show_host_config(struct class_device *class_dev, char *buf)
+static ssize_t show_host_config(struct device *dev,
+                               struct device_attribute *attr, char *buf)
 {
-       struct Scsi_Host *shost = class_to_shost(class_dev);
+       struct Scsi_Host *shost = class_to_shost(dev);
        struct ibmvscsi_host_data *hostdata = shost_priv(shost);
 
        /* returns null-terminated host config data */
@@ -1564,7 +1570,7 @@ static ssize_t show_host_config(struct class_device *class_dev, char *buf)
                return 0;
 }
 
-static struct class_device_attribute ibmvscsi_host_config = {
+static struct device_attribute ibmvscsi_host_config = {
        .attr = {
                 .name = "config",
                 .mode = S_IRUGO,
@@ -1572,7 +1578,7 @@ static struct class_device_attribute ibmvscsi_host_config = {
        .show = show_host_config,
 };
 
-static struct class_device_attribute *ibmvscsi_attrs[] = {
+static struct device_attribute *ibmvscsi_attrs[] = {
        &ibmvscsi_host_srp_version,
        &ibmvscsi_host_partition_name,
        &ibmvscsi_host_partition_number,
index e5881e92d0fb29f730d93f79b8c554e629a72dfa..3b9514c8f1f17321a2b3532b9572336f81cf9c74 100644 (file)
@@ -780,32 +780,35 @@ static int ibmvstgt_it_nexus_response(struct Scsi_Host *shost, u64 itn_id,
        return 0;
 }
 
-static ssize_t system_id_show(struct class_device *cdev, char *buf)
+static ssize_t system_id_show(struct device *dev,
+                             struct device_attribute *attr, char *buf)
 {
        return snprintf(buf, PAGE_SIZE, "%s\n", system_id);
 }
 
-static ssize_t partition_number_show(struct class_device *cdev, char *buf)
+static ssize_t partition_number_show(struct device *dev,
+                                    struct device_attribute *attr, char *buf)
 {
        return snprintf(buf, PAGE_SIZE, "%x\n", partition_number);
 }
 
-static ssize_t unit_address_show(struct class_device *cdev, char *buf)
+static ssize_t unit_address_show(struct device *dev,
+                                 struct device_attribute *attr, char *buf)
 {
-       struct Scsi_Host *shost = class_to_shost(cdev);
+       struct Scsi_Host *shost = class_to_shost(dev);
        struct srp_target *target = host_to_srp_target(shost);
        struct vio_port *vport = target_to_port(target);
        return snprintf(buf, PAGE_SIZE, "%x\n", vport->dma_dev->unit_address);
 }
 
-static CLASS_DEVICE_ATTR(system_id, S_IRUGO, system_id_show, NULL);
-static CLASS_DEVICE_ATTR(partition_number, S_IRUGO, partition_number_show, NULL);
-static CLASS_DEVICE_ATTR(unit_address, S_IRUGO, unit_address_show, NULL);
+static DEVICE_ATTR(system_id, S_IRUGO, system_id_show, NULL);
+static DEVICE_ATTR(partition_number, S_IRUGO, partition_number_show, NULL);
+static DEVICE_ATTR(unit_address, S_IRUGO, unit_address_show, NULL);
 
-static struct class_device_attribute *ibmvstgt_attrs[] = {
-       &class_device_attr_system_id,
-       &class_device_attr_partition_number,
-       &class_device_attr_unit_address,
+static struct device_attribute *ibmvstgt_attrs[] = {
+       &dev_attr_system_id,
+       &dev_attr_partition_number,
+       &dev_attr_unit_address,
        NULL,
 };
 
index 65dc18dea845fd17e26777301da92041a71f77f6..de5ae6a65029ffbd1efc31911ecf3d660e5f2320 100644 (file)
@@ -2431,7 +2431,7 @@ restart:
        }
 
        spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags);
-       kobject_uevent(&ioa_cfg->host->shost_classdev.kobj, KOBJ_CHANGE);
+       kobject_uevent(&ioa_cfg->host->shost_dev.kobj, KOBJ_CHANGE);
        LEAVE;
 }
 
@@ -2451,8 +2451,8 @@ static ssize_t ipr_read_trace(struct kobject *kobj,
                              struct bin_attribute *bin_attr,
                              char *buf, loff_t off, size_t count)
 {
-       struct class_device *cdev = container_of(kobj,struct class_device,kobj);
-       struct Scsi_Host *shost = class_to_shost(cdev);
+       struct device *dev = container_of(kobj, struct device, kobj);
+       struct Scsi_Host *shost = class_to_shost(dev);
        struct ipr_ioa_cfg *ioa_cfg = (struct ipr_ioa_cfg *)shost->hostdata;
        unsigned long lock_flags = 0;
        int size = IPR_TRACE_SIZE;
@@ -2492,15 +2492,16 @@ static const struct {
 
 /**
  * ipr_show_write_caching - Show the write caching attribute
- * @class_dev: class device struct
- * @buf:               buffer
+ * @dev:       device struct
+ * @buf:       buffer
  *
  * Return value:
  *     number of bytes printed to buffer
  **/
-static ssize_t ipr_show_write_caching(struct class_device *class_dev, char *buf)
+static ssize_t ipr_show_write_caching(struct device *dev,
+                                     struct device_attribute *attr, char *buf)
 {
-       struct Scsi_Host *shost = class_to_shost(class_dev);
+       struct Scsi_Host *shost = class_to_shost(dev);
        struct ipr_ioa_cfg *ioa_cfg = (struct ipr_ioa_cfg *)shost->hostdata;
        unsigned long lock_flags = 0;
        int i, len = 0;
@@ -2519,19 +2520,20 @@ static ssize_t ipr_show_write_caching(struct class_device *class_dev, char *buf)
 
 /**
  * ipr_store_write_caching - Enable/disable adapter write cache
- * @class_dev: class_device struct
- * @buf:               buffer
- * @count:             buffer size
+ * @dev:       device struct
+ * @buf:       buffer
+ * @count:     buffer size
  *
  * This function will enable/disable adapter write cache.
  *
  * Return value:
  *     count on success / other on failure
  **/
-static ssize_t ipr_store_write_caching(struct class_device *class_dev,
-                                       const char *buf, size_t count)
+static ssize_t ipr_store_write_caching(struct device *dev,
+                                      struct device_attribute *attr,
+                                      const char *buf, size_t count)
 {
-       struct Scsi_Host *shost = class_to_shost(class_dev);
+       struct Scsi_Host *shost = class_to_shost(dev);
        struct ipr_ioa_cfg *ioa_cfg = (struct ipr_ioa_cfg *)shost->hostdata;
        unsigned long lock_flags = 0;
        enum ipr_cache_state new_state = CACHE_INVALID;
@@ -2569,7 +2571,7 @@ static ssize_t ipr_store_write_caching(struct class_device *class_dev,
        return count;
 }
 
-static struct class_device_attribute ipr_ioa_cache_attr = {
+static struct device_attribute ipr_ioa_cache_attr = {
        .attr = {
                .name =         "write_cache",
                .mode =         S_IRUGO | S_IWUSR,
@@ -2580,15 +2582,16 @@ static struct class_device_attribute ipr_ioa_cache_attr = {
 
 /**
  * ipr_show_fw_version - Show the firmware version
- * @class_dev: class device struct
- * @buf:               buffer
+ * @dev:       class device struct
+ * @buf:       buffer
  *
  * Return value:
  *     number of bytes printed to buffer
  **/
-static ssize_t ipr_show_fw_version(struct class_device *class_dev, char *buf)
+static ssize_t ipr_show_fw_version(struct device *dev,
+                                  struct device_attribute *attr, char *buf)
 {
-       struct Scsi_Host *shost = class_to_shost(class_dev);
+       struct Scsi_Host *shost = class_to_shost(dev);
        struct ipr_ioa_cfg *ioa_cfg = (struct ipr_ioa_cfg *)shost->hostdata;
        struct ipr_inquiry_page3 *ucode_vpd = &ioa_cfg->vpd_cbs->page3_data;
        unsigned long lock_flags = 0;
@@ -2603,7 +2606,7 @@ static ssize_t ipr_show_fw_version(struct class_device *class_dev, char *buf)
        return len;
 }
 
-static struct class_device_attribute ipr_fw_version_attr = {
+static struct device_attribute ipr_fw_version_attr = {
        .attr = {
                .name =         "fw_version",
                .mode =         S_IRUGO,
@@ -2613,15 +2616,16 @@ static struct class_device_attribute ipr_fw_version_attr = {
 
 /**
  * ipr_show_log_level - Show the adapter's error logging level
- * @class_dev: class device struct
- * @buf:               buffer
+ * @dev:       class device struct
+ * @buf:       buffer
  *
  * Return value:
  *     number of bytes printed to buffer
  **/
-static ssize_t ipr_show_log_level(struct class_device *class_dev, char *buf)
+static ssize_t ipr_show_log_level(struct device *dev,
+                                  struct device_attribute *attr, char *buf)
 {
-       struct Scsi_Host *shost = class_to_shost(class_dev);
+       struct Scsi_Host *shost = class_to_shost(dev);
        struct ipr_ioa_cfg *ioa_cfg = (struct ipr_ioa_cfg *)shost->hostdata;
        unsigned long lock_flags = 0;
        int len;
@@ -2634,16 +2638,17 @@ static ssize_t ipr_show_log_level(struct class_device *class_dev, char *buf)
 
 /**
  * ipr_store_log_level - Change the adapter's error logging level
- * @class_dev: class device struct
- * @buf:               buffer
+ * @dev:       class device struct
+ * @buf:       buffer
  *
  * Return value:
  *     number of bytes printed to buffer
  **/
-static ssize_t ipr_store_log_level(struct class_device *class_dev,
+static ssize_t ipr_store_log_level(struct device *dev,
+                                  struct device_attribute *attr,
                                   const char *buf, size_t count)
 {
-       struct Scsi_Host *shost = class_to_shost(class_dev);
+       struct Scsi_Host *shost = class_to_shost(dev);
        struct ipr_ioa_cfg *ioa_cfg = (struct ipr_ioa_cfg *)shost->hostdata;
        unsigned long lock_flags = 0;
 
@@ -2653,7 +2658,7 @@ static ssize_t ipr_store_log_level(struct class_device *class_dev,
        return strlen(buf);
 }
 
-static struct class_device_attribute ipr_log_level_attr = {
+static struct device_attribute ipr_log_level_attr = {
        .attr = {
                .name =         "log_level",
                .mode =         S_IRUGO | S_IWUSR,
@@ -2664,9 +2669,9 @@ static struct class_device_attribute ipr_log_level_attr = {
 
 /**
  * ipr_store_diagnostics - IOA Diagnostics interface
- * @class_dev: class_device struct
- * @buf:               buffer
- * @count:             buffer size
+ * @dev:       device struct
+ * @buf:       buffer
+ * @count:     buffer size
  *
  * This function will reset the adapter and wait a reasonable
  * amount of time for any errors that the adapter might log.
@@ -2674,10 +2679,11 @@ static struct class_device_attribute ipr_log_level_attr = {
  * Return value:
  *     count on success / other on failure
  **/
-static ssize_t ipr_store_diagnostics(struct class_device *class_dev,
+static ssize_t ipr_store_diagnostics(struct device *dev,
+                                    struct device_attribute *attr,
                                     const char *buf, size_t count)
 {
-       struct Scsi_Host *shost = class_to_shost(class_dev);
+       struct Scsi_Host *shost = class_to_shost(dev);
        struct ipr_ioa_cfg *ioa_cfg = (struct ipr_ioa_cfg *)shost->hostdata;
        unsigned long lock_flags = 0;
        int rc = count;
@@ -2714,7 +2720,7 @@ static ssize_t ipr_store_diagnostics(struct class_device *class_dev,
        return rc;
 }
 
-static struct class_device_attribute ipr_diagnostics_attr = {
+static struct device_attribute ipr_diagnostics_attr = {
        .attr = {
                .name =         "run_diagnostics",
                .mode =         S_IWUSR,
@@ -2724,15 +2730,16 @@ static struct class_device_attribute ipr_diagnostics_attr = {
 
 /**
  * ipr_show_adapter_state - Show the adapter's state
- * @class_dev: class device struct
- * @buf:               buffer
+ * @class_dev: device struct
+ * @buf:       buffer
  *
  * Return value:
  *     number of bytes printed to buffer
  **/
-static ssize_t ipr_show_adapter_state(struct class_device *class_dev, char *buf)
+static ssize_t ipr_show_adapter_state(struct device *dev,
+                                     struct device_attribute *attr, char *buf)
 {
-       struct Scsi_Host *shost = class_to_shost(class_dev);
+       struct Scsi_Host *shost = class_to_shost(dev);
        struct ipr_ioa_cfg *ioa_cfg = (struct ipr_ioa_cfg *)shost->hostdata;
        unsigned long lock_flags = 0;
        int len;
@@ -2748,19 +2755,20 @@ static ssize_t ipr_show_adapter_state(struct class_device *class_dev, char *buf)
 
 /**
  * ipr_store_adapter_state - Change adapter state
- * @class_dev: class_device struct
- * @buf:               buffer
- * @count:             buffer size
+ * @dev:       device struct
+ * @buf:       buffer
+ * @count:     buffer size
  *
  * This function will change the adapter's state.
  *
  * Return value:
  *     count on success / other on failure
  **/
-static ssize_t ipr_store_adapter_state(struct class_device *class_dev,
+static ssize_t ipr_store_adapter_state(struct device *dev,
+                                      struct device_attribute *attr,
                                       const char *buf, size_t count)
 {
-       struct Scsi_Host *shost = class_to_shost(class_dev);
+       struct Scsi_Host *shost = class_to_shost(dev);
        struct ipr_ioa_cfg *ioa_cfg = (struct ipr_ioa_cfg *)shost->hostdata;
        unsigned long lock_flags;
        int result = count;
@@ -2781,7 +2789,7 @@ static ssize_t ipr_store_adapter_state(struct class_device *class_dev,
        return result;
 }
 
-static struct class_device_attribute ipr_ioa_state_attr = {
+static struct device_attribute ipr_ioa_state_attr = {
        .attr = {
                .name =         "state",
                .mode =         S_IRUGO | S_IWUSR,
@@ -2792,19 +2800,20 @@ static struct class_device_attribute ipr_ioa_state_attr = {
 
 /**
  * ipr_store_reset_adapter - Reset the adapter
- * @class_dev: class_device struct
- * @buf:               buffer
- * @count:             buffer size
+ * @dev:       device struct
+ * @buf:       buffer
+ * @count:     buffer size
  *
  * This function will reset the adapter.
  *
  * Return value:
  *     count on success / other on failure
  **/
-static ssize_t ipr_store_reset_adapter(struct class_device *class_dev,
+static ssize_t ipr_store_reset_adapter(struct device *dev,
+                                      struct device_attribute *attr,
                                       const char *buf, size_t count)
 {
-       struct Scsi_Host *shost = class_to_shost(class_dev);
+       struct Scsi_Host *shost = class_to_shost(dev);
        struct ipr_ioa_cfg *ioa_cfg = (struct ipr_ioa_cfg *)shost->hostdata;
        unsigned long lock_flags;
        int result = count;
@@ -2821,7 +2830,7 @@ static ssize_t ipr_store_reset_adapter(struct class_device *class_dev,
        return result;
 }
 
-static struct class_device_attribute ipr_ioa_reset_attr = {
+static struct device_attribute ipr_ioa_reset_attr = {
        .attr = {
                .name =         "reset_host",
                .mode =         S_IWUSR,
@@ -3054,19 +3063,20 @@ static int ipr_update_ioa_ucode(struct ipr_ioa_cfg *ioa_cfg,
 
 /**
  * ipr_store_update_fw - Update the firmware on the adapter
- * @class_dev: class_device struct
- * @buf:               buffer
- * @count:             buffer size
+ * @class_dev: device struct
+ * @buf:       buffer
+ * @count:     buffer size
  *
  * This function will update the firmware on the adapter.
  *
  * Return value:
  *     count on success / other on failure
  **/
-static ssize_t ipr_store_update_fw(struct class_device *class_dev,
-                                      const char *buf, size_t count)
+static ssize_t ipr_store_update_fw(struct device *dev,
+                                  struct device_attribute *attr,
+                                  const char *buf, size_t count)
 {
-       struct Scsi_Host *shost = class_to_shost(class_dev);
+       struct Scsi_Host *shost = class_to_shost(dev);
        struct ipr_ioa_cfg *ioa_cfg = (struct ipr_ioa_cfg *)shost->hostdata;
        struct ipr_ucode_image_header *image_hdr;
        const struct firmware *fw_entry;
@@ -3124,7 +3134,7 @@ out:
        return result;
 }
 
-static struct class_device_attribute ipr_update_fw_attr = {
+static struct device_attribute ipr_update_fw_attr = {
        .attr = {
                .name =         "update_fw",
                .mode =         S_IWUSR,
@@ -3132,7 +3142,7 @@ static struct class_device_attribute ipr_update_fw_attr = {
        .store = ipr_store_update_fw
 };
 
-static struct class_device_attribute *ipr_ioa_attrs[] = {
+static struct device_attribute *ipr_ioa_attrs[] = {
        &ipr_fw_version_attr,
        &ipr_log_level_attr,
        &ipr_diagnostics_attr,
@@ -3159,7 +3169,7 @@ static ssize_t ipr_read_dump(struct kobject *kobj,
                             struct bin_attribute *bin_attr,
                             char *buf, loff_t off, size_t count)
 {
-       struct class_device *cdev = container_of(kobj,struct class_device,kobj);
+       struct device *cdev = container_of(kobj, struct device, kobj);
        struct Scsi_Host *shost = class_to_shost(cdev);
        struct ipr_ioa_cfg *ioa_cfg = (struct ipr_ioa_cfg *)shost->hostdata;
        struct ipr_dump *dump;
@@ -3322,7 +3332,7 @@ static ssize_t ipr_write_dump(struct kobject *kobj,
                              struct bin_attribute *bin_attr,
                              char *buf, loff_t off, size_t count)
 {
-       struct class_device *cdev = container_of(kobj,struct class_device,kobj);
+       struct device *cdev = container_of(kobj, struct device, kobj);
        struct Scsi_Host *shost = class_to_shost(cdev);
        struct ipr_ioa_cfg *ioa_cfg = (struct ipr_ioa_cfg *)shost->hostdata;
        int rc;
@@ -7671,9 +7681,9 @@ static void ipr_remove(struct pci_dev *pdev)
 
        ENTER;
 
-       ipr_remove_trace_file(&ioa_cfg->host->shost_classdev.kobj,
+       ipr_remove_trace_file(&ioa_cfg->host->shost_dev.kobj,
                              &ipr_trace_attr);
-       ipr_remove_dump_file(&ioa_cfg->host->shost_classdev.kobj,
+       ipr_remove_dump_file(&ioa_cfg->host->shost_dev.kobj,
                             &ipr_dump_attr);
        scsi_remove_host(ioa_cfg->host);
 
@@ -7714,7 +7724,7 @@ static int __devinit ipr_probe(struct pci_dev *pdev,
                return rc;
        }
 
-       rc = ipr_create_trace_file(&ioa_cfg->host->shost_classdev.kobj,
+       rc = ipr_create_trace_file(&ioa_cfg->host->shost_dev.kobj,
                                   &ipr_trace_attr);
 
        if (rc) {
@@ -7723,11 +7733,11 @@ static int __devinit ipr_probe(struct pci_dev *pdev,
                return rc;
        }
 
-       rc = ipr_create_dump_file(&ioa_cfg->host->shost_classdev.kobj,
+       rc = ipr_create_dump_file(&ioa_cfg->host->shost_dev.kobj,
                                   &ipr_dump_attr);
 
        if (rc) {
-               ipr_remove_trace_file(&ioa_cfg->host->shost_classdev.kobj,
+               ipr_remove_trace_file(&ioa_cfg->host->shost_dev.kobj,
                                      &ipr_trace_attr);
                scsi_remove_host(ioa_cfg->host);
                __ipr_remove(pdev);
index 74c9fc204211056204e9cb207cb06271642c43fc..a9fbb3f88659bb7bbcb117d9f268df77fb786f61 100644 (file)
@@ -66,23 +66,26 @@ lpfc_jedec_to_ascii(int incr, char hdw[])
 }
 
 static ssize_t
-lpfc_drvr_version_show(struct class_device *cdev, char *buf)
+lpfc_drvr_version_show(struct device *dev, struct device_attribute *attr,
+                      char *buf)
 {
        return snprintf(buf, PAGE_SIZE, LPFC_MODULE_DESC "\n");
 }
 
 static ssize_t
-lpfc_info_show(struct class_device *cdev, char *buf)
+lpfc_info_show(struct device *dev, struct device_attribute *attr,
+              char *buf)
 {
-       struct Scsi_Host *host = class_to_shost(cdev);
+       struct Scsi_Host *host = class_to_shost(dev);
 
        return snprintf(buf, PAGE_SIZE, "%s\n",lpfc_info(host));
 }
 
 static ssize_t
-lpfc_serialnum_show(struct class_device *cdev, char *buf)
+lpfc_serialnum_show(struct device *dev, struct device_attribute *attr,
+                   char *buf)
 {
-       struct Scsi_Host  *shost = class_to_shost(cdev);
+       struct Scsi_Host  *shost = class_to_shost(dev);
        struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata;
        struct lpfc_hba   *phba = vport->phba;
 
@@ -90,18 +93,20 @@ lpfc_serialnum_show(struct class_device *cdev, char *buf)
 }
 
 static ssize_t
-lpfc_temp_sensor_show(struct class_device *cdev, char *buf)
+lpfc_temp_sensor_show(struct device *dev, struct device_attribute *attr,
+                     char *buf)
 {
-       struct Scsi_Host *shost = class_to_shost(cdev);
+       struct Scsi_Host *shost = class_to_shost(dev);
        struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata;
        struct lpfc_hba   *phba = vport->phba;
        return snprintf(buf, PAGE_SIZE, "%d\n",phba->temp_sensor_support);
 }
 
 static ssize_t
-lpfc_modeldesc_show(struct class_device *cdev, char *buf)
+lpfc_modeldesc_show(struct device *dev, struct device_attribute *attr,
+                   char *buf)
 {
-       struct Scsi_Host  *shost = class_to_shost(cdev);
+       struct Scsi_Host  *shost = class_to_shost(dev);
        struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata;
        struct lpfc_hba   *phba = vport->phba;
 
@@ -109,9 +114,10 @@ lpfc_modeldesc_show(struct class_device *cdev, char *buf)
 }
 
 static ssize_t
-lpfc_modelname_show(struct class_device *cdev, char *buf)
+lpfc_modelname_show(struct device *dev, struct device_attribute *attr,
+                   char *buf)
 {
-       struct Scsi_Host  *shost = class_to_shost(cdev);
+       struct Scsi_Host  *shost = class_to_shost(dev);
        struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata;
        struct lpfc_hba   *phba = vport->phba;
 
@@ -119,9 +125,10 @@ lpfc_modelname_show(struct class_device *cdev, char *buf)
 }
 
 static ssize_t
-lpfc_programtype_show(struct class_device *cdev, char *buf)
+lpfc_programtype_show(struct device *dev, struct device_attribute *attr,
+                     char *buf)
 {
-       struct Scsi_Host  *shost = class_to_shost(cdev);
+       struct Scsi_Host  *shost = class_to_shost(dev);
        struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata;
        struct lpfc_hba   *phba = vport->phba;
 
@@ -129,9 +136,10 @@ lpfc_programtype_show(struct class_device *cdev, char *buf)
 }
 
 static ssize_t
-lpfc_vportnum_show(struct class_device *cdev, char *buf)
+lpfc_vportnum_show(struct device *dev, struct device_attribute *attr,
+                  char *buf)
 {
-       struct Scsi_Host  *shost = class_to_shost(cdev);
+       struct Scsi_Host  *shost = class_to_shost(dev);
        struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata;
        struct lpfc_hba   *phba = vport->phba;
 
@@ -139,9 +147,10 @@ lpfc_vportnum_show(struct class_device *cdev, char *buf)
 }
 
 static ssize_t
-lpfc_fwrev_show(struct class_device *cdev, char *buf)
+lpfc_fwrev_show(struct device *dev, struct device_attribute *attr,
+               char *buf)
 {
-       struct Scsi_Host  *shost = class_to_shost(cdev);
+       struct Scsi_Host  *shost = class_to_shost(dev);
        struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata;
        struct lpfc_hba   *phba = vport->phba;
        char fwrev[32];
@@ -151,10 +160,10 @@ lpfc_fwrev_show(struct class_device *cdev, char *buf)
 }
 
 static ssize_t
-lpfc_hdw_show(struct class_device *cdev, char *buf)
+lpfc_hdw_show(struct device *dev, struct device_attribute *attr, char *buf)
 {
        char hdw[9];
-       struct Scsi_Host  *shost = class_to_shost(cdev);
+       struct Scsi_Host  *shost = class_to_shost(dev);
        struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata;
        struct lpfc_hba   *phba = vport->phba;
        lpfc_vpd_t *vp = &phba->vpd;
@@ -163,18 +172,20 @@ lpfc_hdw_show(struct class_device *cdev, char *buf)
        return snprintf(buf, PAGE_SIZE, "%s\n", hdw);
 }
 static ssize_t
-lpfc_option_rom_version_show(struct class_device *cdev, char *buf)
+lpfc_option_rom_version_show(struct device *dev, struct device_attribute *attr,
+                            char *buf)
 {
-       struct Scsi_Host  *shost = class_to_shost(cdev);
+       struct Scsi_Host  *shost = class_to_shost(dev);
        struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata;
        struct lpfc_hba   *phba = vport->phba;
 
        return snprintf(buf, PAGE_SIZE, "%s\n", phba->OptionROMVersion);
 }
 static ssize_t
-lpfc_state_show(struct class_device *cdev, char *buf)
+lpfc_state_show(struct device *dev, struct device_attribute *attr,
+               char *buf)
 {
-       struct Scsi_Host  *shost = class_to_shost(cdev);
+       struct Scsi_Host  *shost = class_to_shost(dev);
        struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata;
        struct lpfc_hba   *phba = vport->phba;
        int  len = 0;
@@ -243,9 +254,10 @@ lpfc_state_show(struct class_device *cdev, char *buf)
 }
 
 static ssize_t
-lpfc_num_discovered_ports_show(struct class_device *cdev, char *buf)
+lpfc_num_discovered_ports_show(struct device *dev,
+                              struct device_attribute *attr, char *buf)
 {
-       struct Scsi_Host  *shost = class_to_shost(cdev);
+       struct Scsi_Host  *shost = class_to_shost(dev);
        struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata;
 
        return snprintf(buf, PAGE_SIZE, "%d\n",
@@ -367,9 +379,10 @@ lpfc_selective_reset(struct lpfc_hba *phba)
 }
 
 static ssize_t
-lpfc_issue_reset(struct class_device *cdev, const char *buf, size_t count)
+lpfc_issue_reset(struct device *dev, struct device_attribute *attr,
+                const char *buf, size_t count)
 {
-       struct Scsi_Host  *shost = class_to_shost(cdev);
+       struct Scsi_Host  *shost = class_to_shost(dev);
        struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata;
        struct lpfc_hba   *phba = vport->phba;
 
@@ -385,9 +398,10 @@ lpfc_issue_reset(struct class_device *cdev, const char *buf, size_t count)
 }
 
 static ssize_t
-lpfc_nport_evt_cnt_show(struct class_device *cdev, char *buf)
+lpfc_nport_evt_cnt_show(struct device *dev, struct device_attribute *attr,
+                       char *buf)
 {
-       struct Scsi_Host  *shost = class_to_shost(cdev);
+       struct Scsi_Host  *shost = class_to_shost(dev);
        struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata;
        struct lpfc_hba   *phba = vport->phba;
 
@@ -395,9 +409,10 @@ lpfc_nport_evt_cnt_show(struct class_device *cdev, char *buf)
 }
 
 static ssize_t
-lpfc_board_mode_show(struct class_device *cdev, char *buf)
+lpfc_board_mode_show(struct device *dev, struct device_attribute *attr,
+                    char *buf)
 {
-       struct Scsi_Host  *shost = class_to_shost(cdev);
+       struct Scsi_Host  *shost = class_to_shost(dev);
        struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata;
        struct lpfc_hba   *phba = vport->phba;
        char  * state;
@@ -415,9 +430,10 @@ lpfc_board_mode_show(struct class_device *cdev, char *buf)
 }
 
 static ssize_t
-lpfc_board_mode_store(struct class_device *cdev, const char *buf, size_t count)
+lpfc_board_mode_store(struct device *dev, struct device_attribute *attr,
+                     const char *buf, size_t count)
 {
-       struct Scsi_Host  *shost = class_to_shost(cdev);
+       struct Scsi_Host  *shost = class_to_shost(dev);
        struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata;
        struct lpfc_hba   *phba = vport->phba;
        struct completion online_compl;
@@ -509,9 +525,10 @@ lpfc_get_hba_info(struct lpfc_hba *phba,
 }
 
 static ssize_t
-lpfc_max_rpi_show(struct class_device *cdev, char *buf)
+lpfc_max_rpi_show(struct device *dev, struct device_attribute *attr,
+                 char *buf)
 {
-       struct Scsi_Host  *shost = class_to_shost(cdev);
+       struct Scsi_Host  *shost = class_to_shost(dev);
        struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata;
        struct lpfc_hba   *phba = vport->phba;
        uint32_t cnt;
@@ -522,9 +539,10 @@ lpfc_max_rpi_show(struct class_device *cdev, char *buf)
 }
 
 static ssize_t
-lpfc_used_rpi_show(struct class_device *cdev, char *buf)
+lpfc_used_rpi_show(struct device *dev, struct device_attribute *attr,
+                  char *buf)
 {
-       struct Scsi_Host  *shost = class_to_shost(cdev);
+       struct Scsi_Host  *shost = class_to_shost(dev);
        struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata;
        struct lpfc_hba   *phba = vport->phba;
        uint32_t cnt, acnt;
@@ -535,9 +553,10 @@ lpfc_used_rpi_show(struct class_device *cdev, char *buf)
 }
 
 static ssize_t
-lpfc_max_xri_show(struct class_device *cdev, char *buf)
+lpfc_max_xri_show(struct device *dev, struct device_attribute *attr,
+                 char *buf)
 {
-       struct Scsi_Host  *shost = class_to_shost(cdev);
+       struct Scsi_Host  *shost = class_to_shost(dev);
        struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata;
        struct lpfc_hba   *phba = vport->phba;
        uint32_t cnt;
@@ -548,9 +567,10 @@ lpfc_max_xri_show(struct class_device *cdev, char *buf)
 }
 
 static ssize_t
-lpfc_used_xri_show(struct class_device *cdev, char *buf)
+lpfc_used_xri_show(struct device *dev, struct device_attribute *attr,
+                  char *buf)
 {
-       struct Scsi_Host  *shost = class_to_shost(cdev);
+       struct Scsi_Host  *shost = class_to_shost(dev);
        struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata;
        struct lpfc_hba   *phba = vport->phba;
        uint32_t cnt, acnt;
@@ -561,9 +581,10 @@ lpfc_used_xri_show(struct class_device *cdev, char *buf)
 }
 
 static ssize_t
-lpfc_max_vpi_show(struct class_device *cdev, char *buf)
+lpfc_max_vpi_show(struct device *dev, struct device_attribute *attr,
+                 char *buf)
 {
-       struct Scsi_Host  *shost = class_to_shost(cdev);
+       struct Scsi_Host  *shost = class_to_shost(dev);
        struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata;
        struct lpfc_hba   *phba = vport->phba;
        uint32_t cnt;
@@ -574,9 +595,10 @@ lpfc_max_vpi_show(struct class_device *cdev, char *buf)
 }
 
 static ssize_t
-lpfc_used_vpi_show(struct class_device *cdev, char *buf)
+lpfc_used_vpi_show(struct device *dev, struct device_attribute *attr,
+                  char *buf)
 {
-       struct Scsi_Host  *shost = class_to_shost(cdev);
+       struct Scsi_Host  *shost = class_to_shost(dev);
        struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata;
        struct lpfc_hba   *phba = vport->phba;
        uint32_t cnt, acnt;
@@ -587,9 +609,10 @@ lpfc_used_vpi_show(struct class_device *cdev, char *buf)
 }
 
 static ssize_t
-lpfc_npiv_info_show(struct class_device *cdev, char *buf)
+lpfc_npiv_info_show(struct device *dev, struct device_attribute *attr,
+                   char *buf)
 {
-       struct Scsi_Host  *shost = class_to_shost(cdev);
+       struct Scsi_Host  *shost = class_to_shost(dev);
        struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata;
        struct lpfc_hba   *phba = vport->phba;
 
@@ -601,9 +624,10 @@ lpfc_npiv_info_show(struct class_device *cdev, char *buf)
 }
 
 static ssize_t
-lpfc_poll_show(struct class_device *cdev, char *buf)
+lpfc_poll_show(struct device *dev, struct device_attribute *attr,
+              char *buf)
 {
-       struct Scsi_Host  *shost = class_to_shost(cdev);
+       struct Scsi_Host  *shost = class_to_shost(dev);
        struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata;
        struct lpfc_hba   *phba = vport->phba;
 
@@ -611,10 +635,10 @@ lpfc_poll_show(struct class_device *cdev, char *buf)
 }
 
 static ssize_t
-lpfc_poll_store(struct class_device *cdev, const char *buf,
-               size_t count)
+lpfc_poll_store(struct device *dev, struct device_attribute *attr,
+               const char *buf, size_t count)
 {
-       struct Scsi_Host  *shost = class_to_shost(cdev);
+       struct Scsi_Host  *shost = class_to_shost(dev);
        struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata;
        struct lpfc_hba   *phba = vport->phba;
        uint32_t creg_val;
@@ -670,9 +694,10 @@ lpfc_poll_store(struct class_device *cdev, const char *buf,
 
 #define lpfc_param_show(attr)  \
 static ssize_t \
-lpfc_##attr##_show(struct class_device *cdev, char *buf) \
+lpfc_##attr##_show(struct device *dev, struct device_attribute *attr, \
+                  char *buf) \
 { \
-       struct Scsi_Host  *shost = class_to_shost(cdev);\
+       struct Scsi_Host  *shost = class_to_shost(dev);\
        struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata;\
        struct lpfc_hba   *phba = vport->phba;\
        int val = 0;\
@@ -683,9 +708,10 @@ lpfc_##attr##_show(struct class_device *cdev, char *buf) \
 
 #define lpfc_param_hex_show(attr)      \
 static ssize_t \
-lpfc_##attr##_show(struct class_device *cdev, char *buf) \
+lpfc_##attr##_show(struct device *dev, struct device_attribute *attr, \
+                  char *buf) \
 { \
-       struct Scsi_Host  *shost = class_to_shost(cdev);\
+       struct Scsi_Host  *shost = class_to_shost(dev);\
        struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata;\
        struct lpfc_hba   *phba = vport->phba;\
        int val = 0;\
@@ -725,9 +751,10 @@ lpfc_##attr##_set(struct lpfc_hba *phba, int val) \
 
 #define lpfc_param_store(attr) \
 static ssize_t \
-lpfc_##attr##_store(struct class_device *cdev, const char *buf, size_t count) \
+lpfc_##attr##_store(struct device *dev, struct device_attribute *attr, \
+                   const char *buf, size_t count) \
 { \
-       struct Scsi_Host  *shost = class_to_shost(cdev);\
+       struct Scsi_Host  *shost = class_to_shost(dev);\
        struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata;\
        struct lpfc_hba   *phba = vport->phba;\
        int val=0;\
@@ -743,9 +770,10 @@ lpfc_##attr##_store(struct class_device *cdev, const char *buf, size_t count) \
 
 #define lpfc_vport_param_show(attr)    \
 static ssize_t \
-lpfc_##attr##_show(struct class_device *cdev, char *buf) \
+lpfc_##attr##_show(struct device *dev, struct device_attribute *attr, \
+                  char *buf) \
 { \
-       struct Scsi_Host  *shost = class_to_shost(cdev);\
+       struct Scsi_Host  *shost = class_to_shost(dev);\
        struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata;\
        int val = 0;\
        val = vport->cfg_##attr;\
@@ -754,9 +782,10 @@ lpfc_##attr##_show(struct class_device *cdev, char *buf) \
 
 #define lpfc_vport_param_hex_show(attr)        \
 static ssize_t \
-lpfc_##attr##_show(struct class_device *cdev, char *buf) \
+lpfc_##attr##_show(struct device *dev, struct device_attribute *attr, \
+                  char *buf) \
 { \
-       struct Scsi_Host  *shost = class_to_shost(cdev);\
+       struct Scsi_Host  *shost = class_to_shost(dev);\
        struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata;\
        int val = 0;\
        val = vport->cfg_##attr;\
@@ -794,9 +823,10 @@ lpfc_##attr##_set(struct lpfc_vport *vport, int val) \
 
 #define lpfc_vport_param_store(attr)   \
 static ssize_t \
-lpfc_##attr##_store(struct class_device *cdev, const char *buf, size_t count) \
+lpfc_##attr##_store(struct device *dev, struct device_attribute *attr, \
+                   const char *buf, size_t count) \
 { \
-       struct Scsi_Host  *shost = class_to_shost(cdev);\
+       struct Scsi_Host  *shost = class_to_shost(dev);\
        struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata;\
        int val=0;\
        if (!isdigit(buf[0]))\
@@ -822,7 +852,7 @@ module_param(lpfc_##name, int, 0);\
 MODULE_PARM_DESC(lpfc_##name, desc);\
 lpfc_param_show(name)\
 lpfc_param_init(name, defval, minval, maxval)\
-static CLASS_DEVICE_ATTR(lpfc_##name, S_IRUGO , lpfc_##name##_show, NULL)
+static DEVICE_ATTR(lpfc_##name, S_IRUGO , lpfc_##name##_show, NULL)
 
 #define LPFC_ATTR_RW(name, defval, minval, maxval, desc) \
 static int lpfc_##name = defval;\
@@ -832,8 +862,8 @@ lpfc_param_show(name)\
 lpfc_param_init(name, defval, minval, maxval)\
 lpfc_param_set(name, defval, minval, maxval)\
 lpfc_param_store(name)\
-static CLASS_DEVICE_ATTR(lpfc_##name, S_IRUGO | S_IWUSR,\
-                        lpfc_##name##_show, lpfc_##name##_store)
+static DEVICE_ATTR(lpfc_##name, S_IRUGO | S_IWUSR,\
+                  lpfc_##name##_show, lpfc_##name##_store)
 
 #define LPFC_ATTR_HEX_R(name, defval, minval, maxval, desc) \
 static int lpfc_##name = defval;\
@@ -841,7 +871,7 @@ module_param(lpfc_##name, int, 0);\
 MODULE_PARM_DESC(lpfc_##name, desc);\
 lpfc_param_hex_show(name)\
 lpfc_param_init(name, defval, minval, maxval)\
-static CLASS_DEVICE_ATTR(lpfc_##name, S_IRUGO , lpfc_##name##_show, NULL)
+static DEVICE_ATTR(lpfc_##name, S_IRUGO , lpfc_##name##_show, NULL)
 
 #define LPFC_ATTR_HEX_RW(name, defval, minval, maxval, desc) \
 static int lpfc_##name = defval;\
@@ -851,8 +881,8 @@ lpfc_param_hex_show(name)\
 lpfc_param_init(name, defval, minval, maxval)\
 lpfc_param_set(name, defval, minval, maxval)\
 lpfc_param_store(name)\
-static CLASS_DEVICE_ATTR(lpfc_##name, S_IRUGO | S_IWUSR,\
-                        lpfc_##name##_show, lpfc_##name##_store)
+static DEVICE_ATTR(lpfc_##name, S_IRUGO | S_IWUSR,\
+                  lpfc_##name##_show, lpfc_##name##_store)
 
 #define LPFC_VPORT_ATTR(name, defval, minval, maxval, desc) \
 static int lpfc_##name = defval;\
@@ -866,7 +896,7 @@ module_param(lpfc_##name, int, 0);\
 MODULE_PARM_DESC(lpfc_##name, desc);\
 lpfc_vport_param_show(name)\
 lpfc_vport_param_init(name, defval, minval, maxval)\
-static CLASS_DEVICE_ATTR(lpfc_##name, S_IRUGO , lpfc_##name##_show, NULL)
+static DEVICE_ATTR(lpfc_##name, S_IRUGO , lpfc_##name##_show, NULL)
 
 #define LPFC_VPORT_ATTR_RW(name, defval, minval, maxval, desc) \
 static int lpfc_##name = defval;\
@@ -876,8 +906,8 @@ lpfc_vport_param_show(name)\
 lpfc_vport_param_init(name, defval, minval, maxval)\
 lpfc_vport_param_set(name, defval, minval, maxval)\
 lpfc_vport_param_store(name)\
-static CLASS_DEVICE_ATTR(lpfc_##name, S_IRUGO | S_IWUSR,\
-                        lpfc_##name##_show, lpfc_##name##_store)
+static DEVICE_ATTR(lpfc_##name, S_IRUGO | S_IWUSR,\
+                  lpfc_##name##_show, lpfc_##name##_store)
 
 #define LPFC_VPORT_ATTR_HEX_R(name, defval, minval, maxval, desc) \
 static int lpfc_##name = defval;\
@@ -885,7 +915,7 @@ module_param(lpfc_##name, int, 0);\
 MODULE_PARM_DESC(lpfc_##name, desc);\
 lpfc_vport_param_hex_show(name)\
 lpfc_vport_param_init(name, defval, minval, maxval)\
-static CLASS_DEVICE_ATTR(lpfc_##name, S_IRUGO , lpfc_##name##_show, NULL)
+static DEVICE_ATTR(lpfc_##name, S_IRUGO , lpfc_##name##_show, NULL)
 
 #define LPFC_VPORT_ATTR_HEX_RW(name, defval, minval, maxval, desc) \
 static int lpfc_##name = defval;\
@@ -895,46 +925,44 @@ lpfc_vport_param_hex_show(name)\
 lpfc_vport_param_init(name, defval, minval, maxval)\
 lpfc_vport_param_set(name, defval, minval, maxval)\
 lpfc_vport_param_store(name)\
-static CLASS_DEVICE_ATTR(lpfc_##name, S_IRUGO | S_IWUSR,\
-                        lpfc_##name##_show, lpfc_##name##_store)
-
-static CLASS_DEVICE_ATTR(info, S_IRUGO, lpfc_info_show, NULL);
-static CLASS_DEVICE_ATTR(serialnum, S_IRUGO, lpfc_serialnum_show, NULL);
-static CLASS_DEVICE_ATTR(modeldesc, S_IRUGO, lpfc_modeldesc_show, NULL);
-static CLASS_DEVICE_ATTR(modelname, S_IRUGO, lpfc_modelname_show, NULL);
-static CLASS_DEVICE_ATTR(programtype, S_IRUGO, lpfc_programtype_show, NULL);
-static CLASS_DEVICE_ATTR(portnum, S_IRUGO, lpfc_vportnum_show, NULL);
-static CLASS_DEVICE_ATTR(fwrev, S_IRUGO, lpfc_fwrev_show, NULL);
-static CLASS_DEVICE_ATTR(hdw, S_IRUGO, lpfc_hdw_show, NULL);
-static CLASS_DEVICE_ATTR(state, S_IRUGO, lpfc_state_show, NULL);
-static CLASS_DEVICE_ATTR(option_rom_version, S_IRUGO,
-                                       lpfc_option_rom_version_show, NULL);
-static CLASS_DEVICE_ATTR(num_discovered_ports, S_IRUGO,
-                                       lpfc_num_discovered_ports_show, NULL);
-static CLASS_DEVICE_ATTR(nport_evt_cnt, S_IRUGO, lpfc_nport_evt_cnt_show, NULL);
-static CLASS_DEVICE_ATTR(lpfc_drvr_version, S_IRUGO, lpfc_drvr_version_show,
-                        NULL);
-static CLASS_DEVICE_ATTR(board_mode, S_IRUGO | S_IWUSR,
-                        lpfc_board_mode_show, lpfc_board_mode_store);
-static CLASS_DEVICE_ATTR(issue_reset, S_IWUSR, NULL, lpfc_issue_reset);
-static CLASS_DEVICE_ATTR(max_vpi, S_IRUGO, lpfc_max_vpi_show, NULL);
-static CLASS_DEVICE_ATTR(used_vpi, S_IRUGO, lpfc_used_vpi_show, NULL);
-static CLASS_DEVICE_ATTR(max_rpi, S_IRUGO, lpfc_max_rpi_show, NULL);
-static CLASS_DEVICE_ATTR(used_rpi, S_IRUGO, lpfc_used_rpi_show, NULL);
-static CLASS_DEVICE_ATTR(max_xri, S_IRUGO, lpfc_max_xri_show, NULL);
-static CLASS_DEVICE_ATTR(used_xri, S_IRUGO, lpfc_used_xri_show, NULL);
-static CLASS_DEVICE_ATTR(npiv_info, S_IRUGO, lpfc_npiv_info_show, NULL);
-static CLASS_DEVICE_ATTR(lpfc_temp_sensor, S_IRUGO, lpfc_temp_sensor_show,
-                        NULL);
+static DEVICE_ATTR(lpfc_##name, S_IRUGO | S_IWUSR,\
+                  lpfc_##name##_show, lpfc_##name##_store)
+
+static DEVICE_ATTR(info, S_IRUGO, lpfc_info_show, NULL);
+static DEVICE_ATTR(serialnum, S_IRUGO, lpfc_serialnum_show, NULL);
+static DEVICE_ATTR(modeldesc, S_IRUGO, lpfc_modeldesc_show, NULL);
+static DEVICE_ATTR(modelname, S_IRUGO, lpfc_modelname_show, NULL);
+static DEVICE_ATTR(programtype, S_IRUGO, lpfc_programtype_show, NULL);
+static DEVICE_ATTR(portnum, S_IRUGO, lpfc_vportnum_show, NULL);
+static DEVICE_ATTR(fwrev, S_IRUGO, lpfc_fwrev_show, NULL);
+static DEVICE_ATTR(hdw, S_IRUGO, lpfc_hdw_show, NULL);
+static DEVICE_ATTR(state, S_IRUGO, lpfc_state_show, NULL);
+static DEVICE_ATTR(option_rom_version, S_IRUGO,
+                  lpfc_option_rom_version_show, NULL);
+static DEVICE_ATTR(num_discovered_ports, S_IRUGO,
+                  lpfc_num_discovered_ports_show, NULL);
+static DEVICE_ATTR(nport_evt_cnt, S_IRUGO, lpfc_nport_evt_cnt_show, NULL);
+static DEVICE_ATTR(lpfc_drvr_version, S_IRUGO, lpfc_drvr_version_show, NULL);
+static DEVICE_ATTR(board_mode, S_IRUGO | S_IWUSR,
+                  lpfc_board_mode_show, lpfc_board_mode_store);
+static DEVICE_ATTR(issue_reset, S_IWUSR, NULL, lpfc_issue_reset);
+static DEVICE_ATTR(max_vpi, S_IRUGO, lpfc_max_vpi_show, NULL);
+static DEVICE_ATTR(used_vpi, S_IRUGO, lpfc_used_vpi_show, NULL);
+static DEVICE_ATTR(max_rpi, S_IRUGO, lpfc_max_rpi_show, NULL);
+static DEVICE_ATTR(used_rpi, S_IRUGO, lpfc_used_rpi_show, NULL);
+static DEVICE_ATTR(max_xri, S_IRUGO, lpfc_max_xri_show, NULL);
+static DEVICE_ATTR(used_xri, S_IRUGO, lpfc_used_xri_show, NULL);
+static DEVICE_ATTR(npiv_info, S_IRUGO, lpfc_npiv_info_show, NULL);
+static DEVICE_ATTR(lpfc_temp_sensor, S_IRUGO, lpfc_temp_sensor_show, NULL);
 
 
 static char *lpfc_soft_wwn_key = "C99G71SL8032A";
 
 static ssize_t
-lpfc_soft_wwn_enable_store(struct class_device *cdev, const char *buf,
-                               size_t count)
+lpfc_soft_wwn_enable_store(struct device *dev, struct device_attribute *attr,
+                          const char *buf, size_t count)
 {
-       struct Scsi_Host  *shost = class_to_shost(cdev);
+       struct Scsi_Host  *shost = class_to_shost(dev);
        struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata;
        struct lpfc_hba   *phba = vport->phba;
        unsigned int cnt = count;
@@ -963,13 +991,14 @@ lpfc_soft_wwn_enable_store(struct class_device *cdev, const char *buf,
        phba->soft_wwn_enable = 1;
        return count;
 }
-static CLASS_DEVICE_ATTR(lpfc_soft_wwn_enable, S_IWUSR, NULL,
-                               lpfc_soft_wwn_enable_store);
+static DEVICE_ATTR(lpfc_soft_wwn_enable, S_IWUSR, NULL,
+                  lpfc_soft_wwn_enable_store);
 
 static ssize_t
-lpfc_soft_wwpn_show(struct class_device *cdev, char *buf)
+lpfc_soft_wwpn_show(struct device *dev, struct device_attribute *attr,
+                   char *buf)
 {
-       struct Scsi_Host  *shost = class_to_shost(cdev);
+       struct Scsi_Host  *shost = class_to_shost(dev);
        struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata;
        struct lpfc_hba   *phba = vport->phba;
 
@@ -979,9 +1008,10 @@ lpfc_soft_wwpn_show(struct class_device *cdev, char *buf)
 
 
 static ssize_t
-lpfc_soft_wwpn_store(struct class_device *cdev, const char *buf, size_t count)
+lpfc_soft_wwpn_store(struct device *dev, struct device_attribute *attr,
+                    const char *buf, size_t count)
 {
-       struct Scsi_Host  *shost = class_to_shost(cdev);
+       struct Scsi_Host  *shost = class_to_shost(dev);
        struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata;
        struct lpfc_hba   *phba = vport->phba;
        struct completion online_compl;
@@ -1047,13 +1077,14 @@ lpfc_soft_wwpn_store(struct class_device *cdev, const char *buf, size_t count)
                                "reinit adapter - %d\n", stat2);
        return (stat1 || stat2) ? -EIO : count;
 }
-static CLASS_DEVICE_ATTR(lpfc_soft_wwpn, S_IRUGO | S_IWUSR,\
-                        lpfc_soft_wwpn_show, lpfc_soft_wwpn_store);
+static DEVICE_ATTR(lpfc_soft_wwpn, S_IRUGO | S_IWUSR,\
+                  lpfc_soft_wwpn_show, lpfc_soft_wwpn_store);
 
 static ssize_t
-lpfc_soft_wwnn_show(struct class_device *cdev, char *buf)
+lpfc_soft_wwnn_show(struct device *dev, struct device_attribute *attr,
+                   char *buf)
 {
-       struct Scsi_Host *shost = class_to_shost(cdev);
+       struct Scsi_Host *shost = class_to_shost(dev);
        struct lpfc_hba *phba = ((struct lpfc_vport *)shost->hostdata)->phba;
        return snprintf(buf, PAGE_SIZE, "0x%llx\n",
                        (unsigned long long)phba->cfg_soft_wwnn);
@@ -1061,9 +1092,10 @@ lpfc_soft_wwnn_show(struct class_device *cdev, char *buf)
 
 
 static ssize_t
-lpfc_soft_wwnn_store(struct class_device *cdev, const char *buf, size_t count)
+lpfc_soft_wwnn_store(struct device *dev, struct device_attribute *attr,
+                    const char *buf, size_t count)
 {
-       struct Scsi_Host *shost = class_to_shost(cdev);
+       struct Scsi_Host *shost = class_to_shost(dev);
        struct lpfc_hba *phba = ((struct lpfc_vport *)shost->hostdata)->phba;
        unsigned int i, j, cnt=count;
        u8 wwnn[8];
@@ -1107,8 +1139,8 @@ lpfc_soft_wwnn_store(struct class_device *cdev, const char *buf, size_t count)
 
        return count;
 }
-static CLASS_DEVICE_ATTR(lpfc_soft_wwnn, S_IRUGO | S_IWUSR,\
-                        lpfc_soft_wwnn_show, lpfc_soft_wwnn_store);
+static DEVICE_ATTR(lpfc_soft_wwnn, S_IRUGO | S_IWUSR,\
+                  lpfc_soft_wwnn_show, lpfc_soft_wwnn_store);
 
 
 static int lpfc_poll = 0;
@@ -1118,8 +1150,8 @@ MODULE_PARM_DESC(lpfc_poll, "FCP ring polling mode control:"
                 " 1 - poll with interrupts enabled"
                 " 3 - poll and disable FCP ring interrupts");
 
-static CLASS_DEVICE_ATTR(lpfc_poll, S_IRUGO | S_IWUSR,
-                        lpfc_poll_show, lpfc_poll_store);
+static DEVICE_ATTR(lpfc_poll, S_IRUGO | S_IWUSR,
+                  lpfc_poll_show, lpfc_poll_store);
 
 int  lpfc_sli_mode = 0;
 module_param(lpfc_sli_mode, int, 0);
@@ -1133,7 +1165,7 @@ module_param(lpfc_enable_npiv, int, 0);
 MODULE_PARM_DESC(lpfc_enable_npiv, "Enable NPIV functionality");
 lpfc_param_show(enable_npiv);
 lpfc_param_init(enable_npiv, 0, 0, 1);
-static CLASS_DEVICE_ATTR(lpfc_enable_npiv, S_IRUGO,
+static DEVICE_ATTR(lpfc_enable_npiv, S_IRUGO,
                         lpfc_enable_npiv_show, NULL);
 
 /*
@@ -1147,9 +1179,10 @@ MODULE_PARM_DESC(lpfc_nodev_tmo,
                 "Seconds driver will hold I/O waiting "
                 "for a device to come back");
 static ssize_t
-lpfc_nodev_tmo_show(struct class_device *cdev, char *buf)
+lpfc_nodev_tmo_show(struct device *dev, struct device_attribute *attr,
+                   char *buf)
 {
-       struct Scsi_Host  *shost = class_to_shost(cdev);
+       struct Scsi_Host  *shost = class_to_shost(dev);
        struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata;
        int val = 0;
        val = vport->cfg_devloss_tmo;
@@ -1221,8 +1254,8 @@ lpfc_nodev_tmo_set(struct lpfc_vport *vport, int val)
 
 lpfc_vport_param_store(nodev_tmo)
 
-static CLASS_DEVICE_ATTR(lpfc_nodev_tmo, S_IRUGO | S_IWUSR,
-                        lpfc_nodev_tmo_show, lpfc_nodev_tmo_store);
+static DEVICE_ATTR(lpfc_nodev_tmo, S_IRUGO | S_IWUSR,
+                  lpfc_nodev_tmo_show, lpfc_nodev_tmo_store);
 
 /*
 # lpfc_devloss_tmo: If set, it will hold all I/O errors on devices that
@@ -1255,8 +1288,8 @@ lpfc_devloss_tmo_set(struct lpfc_vport *vport, int val)
 }
 
 lpfc_vport_param_store(devloss_tmo)
-static CLASS_DEVICE_ATTR(lpfc_devloss_tmo, S_IRUGO | S_IWUSR,
-       lpfc_devloss_tmo_show, lpfc_devloss_tmo_store);
+static DEVICE_ATTR(lpfc_devloss_tmo, S_IRUGO | S_IWUSR,
+                  lpfc_devloss_tmo_show, lpfc_devloss_tmo_store);
 
 /*
 # lpfc_log_verbose: Only turn this flag on if you are willing to risk being
@@ -1374,8 +1407,8 @@ lpfc_restrict_login_set(struct lpfc_vport *vport, int val)
        return 0;
 }
 lpfc_vport_param_store(restrict_login);
-static CLASS_DEVICE_ATTR(lpfc_restrict_login, S_IRUGO | S_IWUSR,
-                        lpfc_restrict_login_show, lpfc_restrict_login_store);
+static DEVICE_ATTR(lpfc_restrict_login, S_IRUGO | S_IWUSR,
+                  lpfc_restrict_login_show, lpfc_restrict_login_store);
 
 /*
 # Some disk devices have a "select ID" or "select Target" capability.
@@ -1433,7 +1466,7 @@ MODULE_PARM_DESC(lpfc_topology, "Select Fibre Channel topology");
 lpfc_param_show(topology)
 lpfc_param_init(topology, 0, 0, 6)
 lpfc_param_store(topology)
-static CLASS_DEVICE_ATTR(lpfc_topology, S_IRUGO | S_IWUSR,
+static DEVICE_ATTR(lpfc_topology, S_IRUGO | S_IWUSR,
                lpfc_topology_show, lpfc_topology_store);
 
 /*
@@ -1497,7 +1530,7 @@ lpfc_link_speed_init(struct lpfc_hba *phba, int val)
 }
 
 lpfc_param_store(link_speed)
-static CLASS_DEVICE_ATTR(lpfc_link_speed, S_IRUGO | S_IWUSR,
+static DEVICE_ATTR(lpfc_link_speed, S_IRUGO | S_IWUSR,
                lpfc_link_speed_show, lpfc_link_speed_store);
 
 /*
@@ -1623,82 +1656,81 @@ LPFC_ATTR_R(enable_hba_heartbeat, 1, 0, 1, "Enable HBA Heartbeat.");
 LPFC_ATTR_R(sg_seg_cnt, LPFC_DEFAULT_SG_SEG_CNT, LPFC_DEFAULT_SG_SEG_CNT,
            LPFC_MAX_SG_SEG_CNT, "Max Scatter Gather Segment Count");
 
-struct class_device_attribute *lpfc_hba_attrs[] = {
-       &class_device_attr_info,
-       &class_device_attr_serialnum,
-       &class_device_attr_modeldesc,
-       &class_device_attr_modelname,
-       &class_device_attr_programtype,
-       &class_device_attr_portnum,
-       &class_device_attr_fwrev,
-       &class_device_attr_hdw,
-       &class_device_attr_option_rom_version,
-       &class_device_attr_state,
-       &class_device_attr_num_discovered_ports,
-       &class_device_attr_lpfc_drvr_version,
-       &class_device_attr_lpfc_temp_sensor,
-       &class_device_attr_lpfc_log_verbose,
-       &class_device_attr_lpfc_lun_queue_depth,
-       &class_device_attr_lpfc_hba_queue_depth,
-       &class_device_attr_lpfc_peer_port_login,
-       &class_device_attr_lpfc_nodev_tmo,
-       &class_device_attr_lpfc_devloss_tmo,
-       &class_device_attr_lpfc_fcp_class,
-       &class_device_attr_lpfc_use_adisc,
-       &class_device_attr_lpfc_ack0,
-       &class_device_attr_lpfc_topology,
-       &class_device_attr_lpfc_scan_down,
-       &class_device_attr_lpfc_link_speed,
-       &class_device_attr_lpfc_cr_delay,
-       &class_device_attr_lpfc_cr_count,
-       &class_device_attr_lpfc_multi_ring_support,
-       &class_device_attr_lpfc_multi_ring_rctl,
-       &class_device_attr_lpfc_multi_ring_type,
-       &class_device_attr_lpfc_fdmi_on,
-       &class_device_attr_lpfc_max_luns,
-       &class_device_attr_lpfc_enable_npiv,
-       &class_device_attr_nport_evt_cnt,
-       &class_device_attr_board_mode,
-       &class_device_attr_max_vpi,
-       &class_device_attr_used_vpi,
-       &class_device_attr_max_rpi,
-       &class_device_attr_used_rpi,
-       &class_device_attr_max_xri,
-       &class_device_attr_used_xri,
-       &class_device_attr_npiv_info,
-       &class_device_attr_issue_reset,
-       &class_device_attr_lpfc_poll,
-       &class_device_attr_lpfc_poll_tmo,
-       &class_device_attr_lpfc_use_msi,
-       &class_device_attr_lpfc_soft_wwnn,
-       &class_device_attr_lpfc_soft_wwpn,
-       &class_device_attr_lpfc_soft_wwn_enable,
-       &class_device_attr_lpfc_enable_hba_reset,
-       &class_device_attr_lpfc_enable_hba_heartbeat,
-       &class_device_attr_lpfc_sg_seg_cnt,
+struct device_attribute *lpfc_hba_attrs[] = {
+       &dev_attr_info,
+       &dev_attr_serialnum,
+       &dev_attr_modeldesc,
+       &dev_attr_modelname,
+       &dev_attr_programtype,
+       &dev_attr_portnum,
+       &dev_attr_fwrev,
+       &dev_attr_hdw,
+       &dev_attr_option_rom_version,
+       &dev_attr_state,
+       &dev_attr_num_discovered_ports,
+       &dev_attr_lpfc_drvr_version,
+       &dev_attr_lpfc_temp_sensor,
+       &dev_attr_lpfc_log_verbose,
+       &dev_attr_lpfc_lun_queue_depth,
+       &dev_attr_lpfc_hba_queue_depth,
+       &dev_attr_lpfc_peer_port_login,
+       &dev_attr_lpfc_nodev_tmo,
+       &dev_attr_lpfc_devloss_tmo,
+       &dev_attr_lpfc_fcp_class,
+       &dev_attr_lpfc_use_adisc,
+       &dev_attr_lpfc_ack0,
+       &dev_attr_lpfc_topology,
+       &dev_attr_lpfc_scan_down,
+       &dev_attr_lpfc_link_speed,
+       &dev_attr_lpfc_cr_delay,
+       &dev_attr_lpfc_cr_count,
+       &dev_attr_lpfc_multi_ring_support,
+       &dev_attr_lpfc_multi_ring_rctl,
+       &dev_attr_lpfc_multi_ring_type,
+       &dev_attr_lpfc_fdmi_on,
+       &dev_attr_lpfc_max_luns,
+       &dev_attr_lpfc_enable_npiv,
+       &dev_attr_nport_evt_cnt,
+       &dev_attr_board_mode,
+       &dev_attr_max_vpi,
+       &dev_attr_used_vpi,
+       &dev_attr_max_rpi,
+       &dev_attr_used_rpi,
+       &dev_attr_max_xri,
+       &dev_attr_used_xri,
+       &dev_attr_npiv_info,
+       &dev_attr_issue_reset,
+       &dev_attr_lpfc_poll,
+       &dev_attr_lpfc_poll_tmo,
+       &dev_attr_lpfc_use_msi,
+       &dev_attr_lpfc_soft_wwnn,
+       &dev_attr_lpfc_soft_wwpn,
+       &dev_attr_lpfc_soft_wwn_enable,
+       &dev_attr_lpfc_enable_hba_reset,
+       &dev_attr_lpfc_enable_hba_heartbeat,
+       &dev_attr_lpfc_sg_seg_cnt,
        NULL,
 };
 
-struct class_device_attribute *lpfc_vport_attrs[] = {
-       &class_device_attr_info,
-       &class_device_attr_state,
-       &class_device_attr_num_discovered_ports,
-       &class_device_attr_lpfc_drvr_version,
-
-       &class_device_attr_lpfc_log_verbose,
-       &class_device_attr_lpfc_lun_queue_depth,
-       &class_device_attr_lpfc_nodev_tmo,
-       &class_device_attr_lpfc_devloss_tmo,
-       &class_device_attr_lpfc_hba_queue_depth,
-       &class_device_attr_lpfc_peer_port_login,
-       &class_device_attr_lpfc_restrict_login,
-       &class_device_attr_lpfc_fcp_class,
-       &class_device_attr_lpfc_use_adisc,
-       &class_device_attr_lpfc_fdmi_on,
-       &class_device_attr_lpfc_max_luns,
-       &class_device_attr_nport_evt_cnt,
-       &class_device_attr_npiv_info,
-       &class_device_attr_lpfc_enable_da_id,
+struct device_attribute *lpfc_vport_attrs[] = {
+       &dev_attr_info,
+       &dev_attr_state,
+       &dev_attr_num_discovered_ports,
+       &dev_attr_lpfc_drvr_version,
+       &dev_attr_lpfc_log_verbose,
+       &dev_attr_lpfc_lun_queue_depth,
+       &dev_attr_lpfc_nodev_tmo,
+       &dev_attr_lpfc_devloss_tmo,
+       &dev_attr_lpfc_hba_queue_depth,
+       &dev_attr_lpfc_peer_port_login,
+       &dev_attr_lpfc_restrict_login,
+       &dev_attr_lpfc_fcp_class,
+       &dev_attr_lpfc_use_adisc,
+       &dev_attr_lpfc_fdmi_on,
+       &dev_attr_lpfc_max_luns,
+       &dev_attr_nport_evt_cnt,
+       &dev_attr_npiv_info,
+       &dev_attr_lpfc_enable_da_id,
        NULL,
 };
 
@@ -1707,9 +1739,8 @@ sysfs_ctlreg_write(struct kobject *kobj, struct bin_attribute *bin_attr,
                   char *buf, loff_t off, size_t count)
 {
        size_t buf_off;
-       struct class_device *cdev = container_of(kobj, struct class_device,
-                                                kobj);
-       struct Scsi_Host  *shost = class_to_shost(cdev);
+       struct device *dev = container_of(kobj, struct device, kobj);
+       struct Scsi_Host  *shost = class_to_shost(dev);
        struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata;
        struct lpfc_hba   *phba = vport->phba;
 
@@ -1741,9 +1772,8 @@ sysfs_ctlreg_read(struct kobject *kobj, struct bin_attribute *bin_attr,
 {
        size_t buf_off;
        uint32_t * tmp_ptr;
-       struct class_device *cdev = container_of(kobj, struct class_device,
-                                                kobj);
-       struct Scsi_Host  *shost = class_to_shost(cdev);
+       struct device *dev = container_of(kobj, struct device, kobj);
+       struct Scsi_Host  *shost = class_to_shost(dev);
        struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata;
        struct lpfc_hba   *phba = vport->phba;
 
@@ -1798,9 +1828,8 @@ static ssize_t
 sysfs_mbox_write(struct kobject *kobj, struct bin_attribute *bin_attr,
                 char *buf, loff_t off, size_t count)
 {
-       struct class_device *cdev = container_of(kobj, struct class_device,
-                                                kobj);
-       struct Scsi_Host  *shost = class_to_shost(cdev);
+       struct device *dev = container_of(kobj, struct device, kobj);
+       struct Scsi_Host  *shost = class_to_shost(dev);
        struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata;
        struct lpfc_hba   *phba = vport->phba;
        struct lpfcMboxq  *mbox = NULL;
@@ -1853,9 +1882,8 @@ static ssize_t
 sysfs_mbox_read(struct kobject *kobj, struct bin_attribute *bin_attr,
                char *buf, loff_t off, size_t count)
 {
-       struct class_device *cdev = container_of(kobj, struct class_device,
-                                                kobj);
-       struct Scsi_Host  *shost = class_to_shost(cdev);
+       struct device *dev = container_of(kobj, struct device, kobj);
+       struct Scsi_Host  *shost = class_to_shost(dev);
        struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata;
        struct lpfc_hba   *phba = vport->phba;
        int rc;
@@ -2038,19 +2066,19 @@ lpfc_alloc_sysfs_attr(struct lpfc_vport *vport)
        struct Scsi_Host *shost = lpfc_shost_from_vport(vport);
        int error;
 
-       error = sysfs_create_bin_file(&shost->shost_classdev.kobj,
+       error = sysfs_create_bin_file(&shost->shost_dev.kobj,
                                      &sysfs_ctlreg_attr);
        if (error)
                goto out;
 
-       error = sysfs_create_bin_file(&shost->shost_classdev.kobj,
+       error = sysfs_create_bin_file(&shost->shost_dev.kobj,
                                      &sysfs_mbox_attr);
        if (error)
                goto out_remove_ctlreg_attr;
 
        return 0;
 out_remove_ctlreg_attr:
-       sysfs_remove_bin_file(&shost->shost_classdev.kobj, &sysfs_ctlreg_attr);
+       sysfs_remove_bin_file(&shost->shost_dev.kobj, &sysfs_ctlreg_attr);
 out:
        return error;
 }
@@ -2060,8 +2088,8 @@ lpfc_free_sysfs_attr(struct lpfc_vport *vport)
 {
        struct Scsi_Host *shost = lpfc_shost_from_vport(vport);
 
-       sysfs_remove_bin_file(&shost->shost_classdev.kobj, &sysfs_mbox_attr);
-       sysfs_remove_bin_file(&shost->shost_classdev.kobj, &sysfs_ctlreg_attr);
+       sysfs_remove_bin_file(&shost->shost_dev.kobj, &sysfs_mbox_attr);
+       sysfs_remove_bin_file(&shost->shost_dev.kobj, &sysfs_ctlreg_attr);
 }
 
 
@@ -2443,9 +2471,11 @@ lpfc_set_rport_loss_tmo(struct fc_rport *rport, uint32_t timeout)
 
 #define lpfc_rport_show_function(field, format_string, sz, cast)       \
 static ssize_t                                                         \
-lpfc_show_rport_##field (struct class_device *cdev, char *buf)         \
+lpfc_show_rport_##field (struct device *dev,                           \
+                        struct device_attribute *attr,                 \
+                        char *buf)                                     \
 {                                                                      \
-       struct fc_rport *rport = transport_class_to_rport(cdev);        \
+       struct fc_rport *rport = transport_class_to_rport(dev);         \
        struct lpfc_rport_data *rdata = rport->hostdata;                \
        return snprintf(buf, sz, format_string,                         \
                (rdata->target) ? cast rdata->target->field : 0);       \
index 0819f5f39de509e9d2547a71045cbe02fdf09ef7..7c9f8317d9728e2d02875de4ab2c25eca925b538 100644 (file)
@@ -253,8 +253,8 @@ void lpfc_get_cfgparam(struct lpfc_hba *);
 void lpfc_get_vport_cfgparam(struct lpfc_vport *);
 int lpfc_alloc_sysfs_attr(struct lpfc_vport *);
 void lpfc_free_sysfs_attr(struct lpfc_vport *);
-extern struct class_device_attribute *lpfc_hba_attrs[];
-extern struct class_device_attribute *lpfc_vport_attrs[];
+extern struct device_attribute *lpfc_hba_attrs[];
+extern struct device_attribute *lpfc_vport_attrs[];
 extern struct scsi_host_template lpfc_template;
 extern struct scsi_host_template lpfc_vport_template;
 extern struct fc_function_template lpfc_transport_functions;
index fef9ac95875475438665315c1a5624f979fcacff..f62ed468ada0bc5ce44ce371a42f708310f3d9d7 100644 (file)
@@ -28,7 +28,6 @@
 #include <linux/list.h>
 #include <linux/moduleparam.h>
 #include <linux/dma-mapping.h>
-#include <asm/semaphore.h>
 #include <scsi/scsi.h>
 #include <scsi/scsi_cmnd.h>
 #include <scsi/scsi_device.h>
index 706fa05a187af715c9abc50fbf47cac4f8fcd2f2..05f6e4ec345396931c5edfd374ef146c1eb340d4 100644 (file)
@@ -18,7 +18,7 @@
 #define _MEGARAID_IOCTL_H_
 
 #include <linux/types.h>
-#include <asm/semaphore.h>
+#include <linux/semaphore.h>
 
 #include "mbox_defs.h"
 
index 9f041929aca52ee1d978c2652c995125798fa9ce..820f91fb63ba55dcd4384e0fb4184744199d1deb 100644 (file)
@@ -125,7 +125,7 @@ static irqreturn_t megaraid_isr(int, void *);
 
 static void megaraid_mbox_dpc(unsigned long);
 
-static ssize_t megaraid_sysfs_show_app_hndl(struct class_device *, char *);
+static ssize_t megaraid_sysfs_show_app_hndl(struct device *, struct device_attribute *attr, char *);
 static ssize_t megaraid_sysfs_show_ldnum(struct device *, struct device_attribute *attr, char *);
 
 static int megaraid_cmm_register(adapter_t *);
@@ -313,12 +313,12 @@ static struct pci_driver megaraid_pci_driver = {
 // definitions for the device attributes for exporting logical drive number
 // for a scsi address (Host, Channel, Id, Lun)
 
-CLASS_DEVICE_ATTR(megaraid_mbox_app_hndl, S_IRUSR, megaraid_sysfs_show_app_hndl,
+DEVICE_ATTR(megaraid_mbox_app_hndl, S_IRUSR, megaraid_sysfs_show_app_hndl,
                NULL);
 
 // Host template initializer for megaraid mbox sysfs device attributes
-static struct class_device_attribute *megaraid_shost_attrs[] = {
-       &class_device_attr_megaraid_mbox_app_hndl,
+static struct device_attribute *megaraid_shost_attrs[] = {
+       &dev_attr_megaraid_mbox_app_hndl,
        NULL,
 };
 
@@ -4063,9 +4063,10 @@ megaraid_sysfs_get_ldmap(adapter_t *adapter)
  * handle, since we do not interface with applications directly.
  */
 static ssize_t
-megaraid_sysfs_show_app_hndl(struct class_device *cdev, char *buf)
+megaraid_sysfs_show_app_hndl(struct device *dev, struct device_attribute *attr,
+                            char *buf)
 {
-       struct Scsi_Host *shost = class_to_shost(cdev);
+       struct Scsi_Host *shost = class_to_shost(dev);
        adapter_t       *adapter = (adapter_t *)SCSIHOST2ADAP(shost);
        uint32_t        app_hndl;
 
index c5ebf018b378fc3d026b3bb02eda29f8731be27a..d8928940042557b46d1000e005546d99db914daf 100644 (file)
@@ -8243,7 +8243,8 @@ static void process_waiting_list(struct ncb *np, int sts)
 
 #undef next_wcmd
 
-static ssize_t show_ncr53c8xx_revision(struct class_device *dev, char *buf)
+static ssize_t show_ncr53c8xx_revision(struct device *dev,
+                                      struct device_attribute *attr, char *buf)
 {
        struct Scsi_Host *host = class_to_shost(dev);
        struct host_data *host_data = (struct host_data *)host->hostdata;
@@ -8251,12 +8252,12 @@ static ssize_t show_ncr53c8xx_revision(struct class_device *dev, char *buf)
        return snprintf(buf, 20, "0x%x\n", host_data->ncb->revision_id);
 }
   
-static struct class_device_attribute ncr53c8xx_revision_attr = {
+static struct device_attribute ncr53c8xx_revision_attr = {
        .attr   = { .name = "revision", .mode = S_IRUGO, },
        .show   = show_ncr53c8xx_revision,
 };
   
-static struct class_device_attribute *ncr53c8xx_host_attrs[] = {
+static struct device_attribute *ncr53c8xx_host_attrs[] = {
        &ncr53c8xx_revision_attr,
        NULL
 };
index abef7048f25b32dffb1586cab131c7cac1817438..31f7aec44d90ff4515327e679137ed418eb66b10 100644 (file)
@@ -5591,9 +5591,10 @@ static void osst_remove_sysfs_files(struct device_driver *sysfs)
  * sysfs support for accessing ADR header information
  */
 
-static ssize_t osst_adr_rev_show(struct class_device *class_dev, char *buf)
+static ssize_t osst_adr_rev_show(struct device *dev,
+                                struct device_attribute *attr, char *buf)
 {
-       struct osst_tape * STp = (struct osst_tape *) class_get_devdata (class_dev);
+       struct osst_tape * STp = (struct osst_tape *) dev_get_drvdata (dev);
        ssize_t l = 0;
 
        if (STp && STp->header_ok && STp->linux_media)
@@ -5601,11 +5602,13 @@ static ssize_t osst_adr_rev_show(struct class_device *class_dev, char *buf)
        return l;
 }
 
-CLASS_DEVICE_ATTR(ADR_rev, S_IRUGO, osst_adr_rev_show, NULL);
+DEVICE_ATTR(ADR_rev, S_IRUGO, osst_adr_rev_show, NULL);
 
-static ssize_t osst_linux_media_version_show(struct class_device *class_dev, char *buf)
+static ssize_t osst_linux_media_version_show(struct device *dev,
+                                            struct device_attribute *attr,
+                                            char *buf)
 {
-       struct osst_tape * STp = (struct osst_tape *) class_get_devdata (class_dev);
+       struct osst_tape * STp = (struct osst_tape *) dev_get_drvdata (dev);
        ssize_t l = 0;
 
        if (STp && STp->header_ok && STp->linux_media)
@@ -5613,11 +5616,12 @@ static ssize_t osst_linux_media_version_show(struct class_device *class_dev, cha
        return l;
 }
 
-CLASS_DEVICE_ATTR(media_version, S_IRUGO, osst_linux_media_version_show, NULL);
+DEVICE_ATTR(media_version, S_IRUGO, osst_linux_media_version_show, NULL);
 
-static ssize_t osst_capacity_show(struct class_device *class_dev, char *buf)
+static ssize_t osst_capacity_show(struct device *dev,
+                                 struct device_attribute *attr, char *buf)
 {
-       struct osst_tape * STp = (struct osst_tape *) class_get_devdata (class_dev);
+       struct osst_tape * STp = (struct osst_tape *) dev_get_drvdata (dev);
        ssize_t l = 0;
 
        if (STp && STp->header_ok && STp->linux_media)
@@ -5625,11 +5629,13 @@ static ssize_t osst_capacity_show(struct class_device *class_dev, char *buf)
        return l;
 }
 
-CLASS_DEVICE_ATTR(capacity, S_IRUGO, osst_capacity_show, NULL);
+DEVICE_ATTR(capacity, S_IRUGO, osst_capacity_show, NULL);
 
-static ssize_t osst_first_data_ppos_show(struct class_device *class_dev, char *buf)
+static ssize_t osst_first_data_ppos_show(struct device *dev,
+                                        struct device_attribute *attr,
+                                        char *buf)
 {
-       struct osst_tape * STp = (struct osst_tape *) class_get_devdata (class_dev);
+       struct osst_tape * STp = (struct osst_tape *) dev_get_drvdata (dev);
        ssize_t l = 0;
 
        if (STp && STp->header_ok && STp->linux_media)
@@ -5637,11 +5643,13 @@ static ssize_t osst_first_data_ppos_show(struct class_device *class_dev, char *b
        return l;
 }
 
-CLASS_DEVICE_ATTR(BOT_frame, S_IRUGO, osst_first_data_ppos_show, NULL);
+DEVICE_ATTR(BOT_frame, S_IRUGO, osst_first_data_ppos_show, NULL);
 
-static ssize_t osst_eod_frame_ppos_show(struct class_device *class_dev, char *buf)
+static ssize_t osst_eod_frame_ppos_show(struct device *dev,
+                                       struct device_attribute *attr,
+                                       char *buf)
 {
-       struct osst_tape * STp = (struct osst_tape *) class_get_devdata (class_dev);
+       struct osst_tape * STp = (struct osst_tape *) dev_get_drvdata (dev);
        ssize_t l = 0;
 
        if (STp && STp->header_ok && STp->linux_media)
@@ -5649,11 +5657,12 @@ static ssize_t osst_eod_frame_ppos_show(struct class_device *class_dev, char *bu
        return l;
 }
 
-CLASS_DEVICE_ATTR(EOD_frame, S_IRUGO, osst_eod_frame_ppos_show, NULL);
+DEVICE_ATTR(EOD_frame, S_IRUGO, osst_eod_frame_ppos_show, NULL);
 
-static ssize_t osst_filemark_cnt_show(struct class_device *class_dev, char *buf)
+static ssize_t osst_filemark_cnt_show(struct device *dev,
+                                     struct device_attribute *attr, char *buf)
 {
-       struct osst_tape * STp = (struct osst_tape *) class_get_devdata (class_dev);
+       struct osst_tape * STp = (struct osst_tape *) dev_get_drvdata (dev);
        ssize_t l = 0;
 
        if (STp && STp->header_ok && STp->linux_media)
@@ -5661,7 +5670,7 @@ static ssize_t osst_filemark_cnt_show(struct class_device *class_dev, char *buf)
        return l;
 }
 
-CLASS_DEVICE_ATTR(file_count, S_IRUGO, osst_filemark_cnt_show, NULL);
+DEVICE_ATTR(file_count, S_IRUGO, osst_filemark_cnt_show, NULL);
 
 static struct class *osst_sysfs_class;
 
@@ -5678,44 +5687,37 @@ static int osst_sysfs_init(void)
 
 static void osst_sysfs_destroy(dev_t dev)
 {
-       class_device_destroy(osst_sysfs_class, dev);
+       device_destroy(osst_sysfs_class, dev);
 }
 
 static int osst_sysfs_add(dev_t dev, struct device *device, struct osst_tape * STp, char * name)
 {
-       struct class_device *osst_class_member;
+       struct device *osst_member;
        int err;
 
-       osst_class_member = class_device_create(osst_sysfs_class, NULL, dev,
-                                               device, "%s", name);
-       if (IS_ERR(osst_class_member)) {
+       osst_member = device_create(osst_sysfs_class, device, dev, "%s", name);
+       if (IS_ERR(osst_member)) {
                printk(KERN_WARNING "osst :W: Unable to add sysfs class member %s\n", name);
-               return PTR_ERR(osst_class_member);
+               return PTR_ERR(osst_member);
        }
 
-       class_set_devdata(osst_class_member, STp);
-       err = class_device_create_file(osst_class_member,
-                                      &class_device_attr_ADR_rev);
+       dev_set_drvdata(osst_member, STp);
+       err = device_create_file(osst_member, &dev_attr_ADR_rev);
        if (err)
                goto err_out;
-       err = class_device_create_file(osst_class_member,
-                                      &class_device_attr_media_version);
+       err = device_create_file(osst_member, &dev_attr_media_version);
        if (err)
                goto err_out;
-       err = class_device_create_file(osst_class_member,
-                                      &class_device_attr_capacity);
+       err = device_create_file(osst_member, &dev_attr_capacity);
        if (err)
                goto err_out;
-       err = class_device_create_file(osst_class_member,
-                                      &class_device_attr_BOT_frame);
+       err = device_create_file(osst_member, &dev_attr_BOT_frame);
        if (err)
                goto err_out;
-       err = class_device_create_file(osst_class_member,
-                                      &class_device_attr_EOD_frame);
+       err = device_create_file(osst_member, &dev_attr_EOD_frame);
        if (err)
                goto err_out;
-       err = class_device_create_file(osst_class_member,
-                                      &class_device_attr_file_count);
+       err = device_create_file(osst_member, &dev_attr_file_count);
        if (err)
                goto err_out;
 
index 3454a57147496cddc1d012699fbd8334b8e8e2e8..0be232b58ffb795e5d878f3aa400eee8dab5b673 100644 (file)
@@ -632,9 +632,10 @@ SYM53C500_biosparm(struct scsi_device *disk,
 }
 
 static ssize_t
-SYM53C500_show_pio(struct class_device *cdev, char *buf)
+SYM53C500_show_pio(struct device *dev, struct device_attribute *attr,
+                  char *buf)
 {
-       struct Scsi_Host *SHp = class_to_shost(cdev);
+       struct Scsi_Host *SHp = class_to_shost(dev);
        struct sym53c500_data *data =
            (struct sym53c500_data *)SHp->hostdata;
 
@@ -642,10 +643,11 @@ SYM53C500_show_pio(struct class_device *cdev, char *buf)
 }
 
 static ssize_t
-SYM53C500_store_pio(struct class_device *cdev, const char *buf, size_t count)
+SYM53C500_store_pio(struct device *dev, struct device_attribute *attr,
+                   const char *buf, size_t count)
 {
        int pio;
-       struct Scsi_Host *SHp = class_to_shost(cdev);
+       struct Scsi_Host *SHp = class_to_shost(dev);
        struct sym53c500_data *data =
            (struct sym53c500_data *)SHp->hostdata;
 
@@ -662,7 +664,7 @@ SYM53C500_store_pio(struct class_device *cdev, const char *buf, size_t count)
 *  SCSI HBA device attributes we want to
 *  make available via sysfs.
 */
-static struct class_device_attribute SYM53C500_pio_attr = {
+static struct device_attribute SYM53C500_pio_attr = {
        .attr = {
                .name = "fast_pio",
                .mode = (S_IRUGO | S_IWUSR),
@@ -671,7 +673,7 @@ static struct class_device_attribute SYM53C500_pio_attr = {
        .store = SYM53C500_store_pio,
 };
 
-static struct class_device_attribute *SYM53C500_shost_attrs[] = {
+static struct device_attribute *SYM53C500_shost_attrs[] = {
        &SYM53C500_pio_attr,
        NULL,
 };
index 413d8cd6a3247c6365e2e77a83198f167dbbe8c1..d61df036910c1f46579807e5a17b9fee1ff73417 100644 (file)
@@ -530,15 +530,17 @@ qla2x00_free_sysfs_attr(scsi_qla_host_t *ha)
 /* Scsi_Host attributes. */
 
 static ssize_t
-qla2x00_drvr_version_show(struct class_device *cdev, char *buf)
+qla2x00_drvr_version_show(struct device *dev,
+                         struct device_attribute *attr, char *buf)
 {
        return snprintf(buf, PAGE_SIZE, "%s\n", qla2x00_version_str);
 }
 
 static ssize_t
-qla2x00_fw_version_show(struct class_device *cdev, char *buf)
+qla2x00_fw_version_show(struct device *dev,
+                       struct device_attribute *attr, char *buf)
 {
-       scsi_qla_host_t *ha = shost_priv(class_to_shost(cdev));
+       scsi_qla_host_t *ha = shost_priv(class_to_shost(dev));
        char fw_str[30];
 
        return snprintf(buf, PAGE_SIZE, "%s\n",
@@ -546,9 +548,10 @@ qla2x00_fw_version_show(struct class_device *cdev, char *buf)
 }
 
 static ssize_t
-qla2x00_serial_num_show(struct class_device *cdev, char *buf)
+qla2x00_serial_num_show(struct device *dev, struct device_attribute *attr,
+                       char *buf)
 {
-       scsi_qla_host_t *ha = shost_priv(class_to_shost(cdev));
+       scsi_qla_host_t *ha = shost_priv(class_to_shost(dev));
        uint32_t sn;
 
        if (IS_FWI2_CAPABLE(ha))
@@ -560,40 +563,45 @@ qla2x00_serial_num_show(struct class_device *cdev, char *buf)
 }
 
 static ssize_t
-qla2x00_isp_name_show(struct class_device *cdev, char *buf)
+qla2x00_isp_name_show(struct device *dev, struct device_attribute *attr,
+                     char *buf)
 {
-       scsi_qla_host_t *ha = shost_priv(class_to_shost(cdev));
+       scsi_qla_host_t *ha = shost_priv(class_to_shost(dev));
        return snprintf(buf, PAGE_SIZE, "ISP%04X\n", ha->pdev->device);
 }
 
 static ssize_t
-qla2x00_isp_id_show(struct class_device *cdev, char *buf)
+qla2x00_isp_id_show(struct device *dev, struct device_attribute *attr,
+                   char *buf)
 {
-       scsi_qla_host_t *ha = shost_priv(class_to_shost(cdev));
+       scsi_qla_host_t *ha = shost_priv(class_to_shost(dev));
        return snprintf(buf, PAGE_SIZE, "%04x %04x %04x %04x\n",
            ha->product_id[0], ha->product_id[1], ha->product_id[2],
            ha->product_id[3]);
 }
 
 static ssize_t
-qla2x00_model_name_show(struct class_device *cdev, char *buf)
+qla2x00_model_name_show(struct device *dev, struct device_attribute *attr,
+                       char *buf)
 {
-       scsi_qla_host_t *ha = shost_priv(class_to_shost(cdev));
+       scsi_qla_host_t *ha = shost_priv(class_to_shost(dev));
        return snprintf(buf, PAGE_SIZE, "%s\n", ha->model_number);
 }
 
 static ssize_t
-qla2x00_model_desc_show(struct class_device *cdev, char *buf)
+qla2x00_model_desc_show(struct device *dev, struct device_attribute *attr,
+                       char *buf)
 {
-       scsi_qla_host_t *ha = shost_priv(class_to_shost(cdev));
+       scsi_qla_host_t *ha = shost_priv(class_to_shost(dev));
        return snprintf(buf, PAGE_SIZE, "%s\n",
            ha->model_desc ? ha->model_desc: "");
 }
 
 static ssize_t
-qla2x00_pci_info_show(struct class_device *cdev, char *buf)
+qla2x00_pci_info_show(struct device *dev, struct device_attribute *attr,
+                     char *buf)
 {
-       scsi_qla_host_t *ha = shost_priv(class_to_shost(cdev));
+       scsi_qla_host_t *ha = shost_priv(class_to_shost(dev));
        char pci_info[30];
 
        return snprintf(buf, PAGE_SIZE, "%s\n",
@@ -601,9 +609,10 @@ qla2x00_pci_info_show(struct class_device *cdev, char *buf)
 }
 
 static ssize_t
-qla2x00_state_show(struct class_device *cdev, char *buf)
+qla2x00_state_show(struct device *dev, struct device_attribute *attr,
+                  char *buf)
 {
-       scsi_qla_host_t *ha = shost_priv(class_to_shost(cdev));
+       scsi_qla_host_t *ha = shost_priv(class_to_shost(dev));
        int len = 0;
 
        if (atomic_read(&ha->loop_state) == LOOP_DOWN ||
@@ -639,9 +648,10 @@ qla2x00_state_show(struct class_device *cdev, char *buf)
 }
 
 static ssize_t
-qla2x00_zio_show(struct class_device *cdev, char *buf)
+qla2x00_zio_show(struct device *dev, struct device_attribute *attr,
+                char *buf)
 {
-       scsi_qla_host_t *ha = shost_priv(class_to_shost(cdev));
+       scsi_qla_host_t *ha = shost_priv(class_to_shost(dev));
        int len = 0;
 
        switch (ha->zio_mode) {
@@ -656,9 +666,10 @@ qla2x00_zio_show(struct class_device *cdev, char *buf)
 }
 
 static ssize_t
-qla2x00_zio_store(struct class_device *cdev, const char *buf, size_t count)
+qla2x00_zio_store(struct device *dev, struct device_attribute *attr,
+                 const char *buf, size_t count)
 {
-       scsi_qla_host_t *ha = shost_priv(class_to_shost(cdev));
+       scsi_qla_host_t *ha = shost_priv(class_to_shost(dev));
        int val = 0;
        uint16_t zio_mode;
 
@@ -682,18 +693,19 @@ qla2x00_zio_store(struct class_device *cdev, const char *buf, size_t count)
 }
 
 static ssize_t
-qla2x00_zio_timer_show(struct class_device *cdev, char *buf)
+qla2x00_zio_timer_show(struct device *dev, struct device_attribute *attr,
+                      char *buf)
 {
-       scsi_qla_host_t *ha = shost_priv(class_to_shost(cdev));
+       scsi_qla_host_t *ha = shost_priv(class_to_shost(dev));
 
        return snprintf(buf, PAGE_SIZE, "%d us\n", ha->zio_timer * 100);
 }
 
 static ssize_t
-qla2x00_zio_timer_store(struct class_device *cdev, const char *buf,
-    size_t count)
+qla2x00_zio_timer_store(struct device *dev, struct device_attribute *attr,
+                       const char *buf, size_t count)
 {
-       scsi_qla_host_t *ha = shost_priv(class_to_shost(cdev));
+       scsi_qla_host_t *ha = shost_priv(class_to_shost(dev));
        int val = 0;
        uint16_t zio_timer;
 
@@ -709,9 +721,10 @@ qla2x00_zio_timer_store(struct class_device *cdev, const char *buf,
 }
 
 static ssize_t
-qla2x00_beacon_show(struct class_device *cdev, char *buf)
+qla2x00_beacon_show(struct device *dev, struct device_attribute *attr,
+                   char *buf)
 {
-       scsi_qla_host_t *ha = shost_priv(class_to_shost(cdev));
+       scsi_qla_host_t *ha = shost_priv(class_to_shost(dev));
        int len = 0;
 
        if (ha->beacon_blink_led)
@@ -722,10 +735,10 @@ qla2x00_beacon_show(struct class_device *cdev, char *buf)
 }
 
 static ssize_t
-qla2x00_beacon_store(struct class_device *cdev, const char *buf,
-    size_t count)
+qla2x00_beacon_store(struct device *dev, struct device_attribute *attr,
+                    const char *buf, size_t count)
 {
-       scsi_qla_host_t *ha = shost_priv(class_to_shost(cdev));
+       scsi_qla_host_t *ha = shost_priv(class_to_shost(dev));
        int val = 0;
        int rval;
 
@@ -753,84 +766,86 @@ qla2x00_beacon_store(struct class_device *cdev, const char *buf,
 }
 
 static ssize_t
-qla2x00_optrom_bios_version_show(struct class_device *cdev, char *buf)
+qla2x00_optrom_bios_version_show(struct device *dev,
+                                struct device_attribute *attr, char *buf)
 {
-       scsi_qla_host_t *ha = shost_priv(class_to_shost(cdev));
+       scsi_qla_host_t *ha = shost_priv(class_to_shost(dev));
 
        return snprintf(buf, PAGE_SIZE, "%d.%02d\n", ha->bios_revision[1],
            ha->bios_revision[0]);
 }
 
 static ssize_t
-qla2x00_optrom_efi_version_show(struct class_device *cdev, char *buf)
+qla2x00_optrom_efi_version_show(struct device *dev,
+                               struct device_attribute *attr, char *buf)
 {
-       scsi_qla_host_t *ha = shost_priv(class_to_shost(cdev));
+       scsi_qla_host_t *ha = shost_priv(class_to_shost(dev));
 
        return snprintf(buf, PAGE_SIZE, "%d.%02d\n", ha->efi_revision[1],
            ha->efi_revision[0]);
 }
 
 static ssize_t
-qla2x00_optrom_fcode_version_show(struct class_device *cdev, char *buf)
+qla2x00_optrom_fcode_version_show(struct device *dev,
+                                 struct device_attribute *attr, char *buf)
 {
-       scsi_qla_host_t *ha = shost_priv(class_to_shost(cdev));
+       scsi_qla_host_t *ha = shost_priv(class_to_shost(dev));
 
        return snprintf(buf, PAGE_SIZE, "%d.%02d\n", ha->fcode_revision[1],
            ha->fcode_revision[0]);
 }
 
 static ssize_t
-qla2x00_optrom_fw_version_show(struct class_device *cdev, char *buf)
+qla2x00_optrom_fw_version_show(struct device *dev,
+                              struct device_attribute *attr, char *buf)
 {
-       scsi_qla_host_t *ha = shost_priv(class_to_shost(cdev));
+       scsi_qla_host_t *ha = shost_priv(class_to_shost(dev));
 
        return snprintf(buf, PAGE_SIZE, "%d.%02d.%02d %d\n",
            ha->fw_revision[0], ha->fw_revision[1], ha->fw_revision[2],
            ha->fw_revision[3]);
 }
 
-static CLASS_DEVICE_ATTR(driver_version, S_IRUGO, qla2x00_drvr_version_show,
-       NULL);
-static CLASS_DEVICE_ATTR(fw_version, S_IRUGO, qla2x00_fw_version_show, NULL);
-static CLASS_DEVICE_ATTR(serial_num, S_IRUGO, qla2x00_serial_num_show, NULL);
-static CLASS_DEVICE_ATTR(isp_name, S_IRUGO, qla2x00_isp_name_show, NULL);
-static CLASS_DEVICE_ATTR(isp_id, S_IRUGO, qla2x00_isp_id_show, NULL);
-static CLASS_DEVICE_ATTR(model_name, S_IRUGO, qla2x00_model_name_show, NULL);
-static CLASS_DEVICE_ATTR(model_desc, S_IRUGO, qla2x00_model_desc_show, NULL);
-static CLASS_DEVICE_ATTR(pci_info, S_IRUGO, qla2x00_pci_info_show, NULL);
-static CLASS_DEVICE_ATTR(state, S_IRUGO, qla2x00_state_show, NULL);
-static CLASS_DEVICE_ATTR(zio, S_IRUGO | S_IWUSR, qla2x00_zio_show,
-    qla2x00_zio_store);
-static CLASS_DEVICE_ATTR(zio_timer, S_IRUGO | S_IWUSR, qla2x00_zio_timer_show,
-    qla2x00_zio_timer_store);
-static CLASS_DEVICE_ATTR(beacon, S_IRUGO | S_IWUSR, qla2x00_beacon_show,
-    qla2x00_beacon_store);
-static CLASS_DEVICE_ATTR(optrom_bios_version, S_IRUGO,
-    qla2x00_optrom_bios_version_show, NULL);
-static CLASS_DEVICE_ATTR(optrom_efi_version, S_IRUGO,
-    qla2x00_optrom_efi_version_show, NULL);
-static CLASS_DEVICE_ATTR(optrom_fcode_version, S_IRUGO,
-    qla2x00_optrom_fcode_version_show, NULL);
-static CLASS_DEVICE_ATTR(optrom_fw_version, S_IRUGO,
-    qla2x00_optrom_fw_version_show, NULL);
-
-struct class_device_attribute *qla2x00_host_attrs[] = {
-       &class_device_attr_driver_version,
-       &class_device_attr_fw_version,
-       &class_device_attr_serial_num,
-       &class_device_attr_isp_name,
-       &class_device_attr_isp_id,
-       &class_device_attr_model_name,
-       &class_device_attr_model_desc,
-       &class_device_attr_pci_info,
-       &class_device_attr_state,
-       &class_device_attr_zio,
-       &class_device_attr_zio_timer,
-       &class_device_attr_beacon,
-       &class_device_attr_optrom_bios_version,
-       &class_device_attr_optrom_efi_version,
-       &class_device_attr_optrom_fcode_version,
-       &class_device_attr_optrom_fw_version,
+static DEVICE_ATTR(driver_version, S_IRUGO, qla2x00_drvr_version_show, NULL);
+static DEVICE_ATTR(fw_version, S_IRUGO, qla2x00_fw_version_show, NULL);
+static DEVICE_ATTR(serial_num, S_IRUGO, qla2x00_serial_num_show, NULL);
+static DEVICE_ATTR(isp_name, S_IRUGO, qla2x00_isp_name_show, NULL);
+static DEVICE_ATTR(isp_id, S_IRUGO, qla2x00_isp_id_show, NULL);
+static DEVICE_ATTR(model_name, S_IRUGO, qla2x00_model_name_show, NULL);
+static DEVICE_ATTR(model_desc, S_IRUGO, qla2x00_model_desc_show, NULL);
+static DEVICE_ATTR(pci_info, S_IRUGO, qla2x00_pci_info_show, NULL);
+static DEVICE_ATTR(state, S_IRUGO, qla2x00_state_show, NULL);
+static DEVICE_ATTR(zio, S_IRUGO | S_IWUSR, qla2x00_zio_show, qla2x00_zio_store);
+static DEVICE_ATTR(zio_timer, S_IRUGO | S_IWUSR, qla2x00_zio_timer_show,
+                  qla2x00_zio_timer_store);
+static DEVICE_ATTR(beacon, S_IRUGO | S_IWUSR, qla2x00_beacon_show,
+                  qla2x00_beacon_store);
+static DEVICE_ATTR(optrom_bios_version, S_IRUGO,
+                  qla2x00_optrom_bios_version_show, NULL);
+static DEVICE_ATTR(optrom_efi_version, S_IRUGO,
+                  qla2x00_optrom_efi_version_show, NULL);
+static DEVICE_ATTR(optrom_fcode_version, S_IRUGO,
+                  qla2x00_optrom_fcode_version_show, NULL);
+static DEVICE_ATTR(optrom_fw_version, S_IRUGO, qla2x00_optrom_fw_version_show,
+                  NULL);
+
+struct device_attribute *qla2x00_host_attrs[] = {
+       &dev_attr_driver_version,
+       &dev_attr_fw_version,
+       &dev_attr_serial_num,
+       &dev_attr_isp_name,
+       &dev_attr_isp_id,
+       &dev_attr_model_name,
+       &dev_attr_model_desc,
+       &dev_attr_pci_info,
+       &dev_attr_state,
+       &dev_attr_zio,
+       &dev_attr_zio_timer,
+       &dev_attr_beacon,
+       &dev_attr_optrom_bios_version,
+       &dev_attr_optrom_efi_version,
+       &dev_attr_optrom_fcode_version,
+       &dev_attr_optrom_fw_version,
        NULL,
 };
 
index 094d95f0764c6027cb421e4d3e5da9bf17012dfd..299eccf6cabde6f5572dec66691885591c2a00af 100644 (file)
@@ -25,7 +25,7 @@
 #include <linux/firmware.h>
 #include <linux/aer.h>
 #include <linux/mutex.h>
-#include <asm/semaphore.h>
+#include <linux/semaphore.h>
 
 #include <scsi/scsi.h>
 #include <scsi/scsi_host.h>
index a9571c214a9e5cd9f0711dc37bf4b1273a570ed5..76eb4fecce656109bcb0ca5464e8c0150d9496e8 100644 (file)
@@ -347,8 +347,8 @@ extern void qla2x00_get_sym_node_name(scsi_qla_host_t *, uint8_t *);
 /*
  * Global Function Prototypes in qla_attr.c source file.
  */
-struct class_device_attribute;
-extern struct class_device_attribute *qla2x00_host_attrs[];
+struct device_attribute;
+extern struct device_attribute *qla2x00_host_attrs[];
 struct fc_function_template;
 extern struct fc_function_template qla2xxx_transport_functions;
 extern struct fc_function_template qla2xxx_transport_vport_functions;
index 52182a744ba652fbee765293f576b37fd4c95b7d..913a931176eff74a049786eaf84ffaf9b419051d 100644 (file)
@@ -24,15 +24,15 @@ struct raid_internal {
        struct raid_template r;
        struct raid_function_template *f;
        /* The actual attributes */
-       struct class_device_attribute private_attrs[RAID_NUM_ATTRS];
+       struct device_attribute private_attrs[RAID_NUM_ATTRS];
        /* The array of null terminated pointers to attributes 
         * needed by scsi_sysfs.c */
-       struct class_device_attribute *attrs[RAID_NUM_ATTRS + 1];
+       struct device_attribute *attrs[RAID_NUM_ATTRS + 1];
 };
 
 struct raid_component {
        struct list_head node;
-       struct class_device cdev;
+       struct device dev;
        int num;
 };
 
@@ -50,9 +50,9 @@ struct raid_component {
        tc_to_raid_internal(tc);                                        \
 })
 
-#define class_device_to_raid_internal(cdev) ({                         \
+#define device_to_raid_internal(dev) ({                                \
        struct attribute_container *ac =                                \
-               attribute_container_classdev_to_container(cdev);        \
+               attribute_container_classdev_to_container(dev); \
        ac_to_raid_internal(ac);                                        \
 })
        
@@ -76,33 +76,33 @@ static int raid_match(struct attribute_container *cont, struct device *dev)
 }
 
 static int raid_setup(struct transport_container *tc, struct device *dev,
-                      struct class_device *cdev)
+                      struct device *cdev)
 {
        struct raid_data *rd;
 
-       BUG_ON(class_get_devdata(cdev));
+       BUG_ON(dev_get_drvdata(cdev));
 
        rd = kzalloc(sizeof(*rd), GFP_KERNEL);
        if (!rd)
                return -ENOMEM;
 
        INIT_LIST_HEAD(&rd->component_list);
-       class_set_devdata(cdev, rd);
+       dev_set_drvdata(cdev, rd);
                
        return 0;
 }
 
 static int raid_remove(struct transport_container *tc, struct device *dev,
-                      struct class_device *cdev)
+                      struct device *cdev)
 {
-       struct raid_data *rd = class_get_devdata(cdev);
+       struct raid_data *rd = dev_get_drvdata(cdev);
        struct raid_component *rc, *next;
        dev_printk(KERN_ERR, dev, "RAID REMOVE\n");
-       class_set_devdata(cdev, NULL);
+       dev_set_drvdata(cdev, NULL);
        list_for_each_entry_safe(rc, next, &rd->component_list, node) {
                list_del(&rc->node);
-               dev_printk(KERN_ERR, rc->cdev.dev, "RAID COMPONENT REMOVE\n");
-               class_device_unregister(&rc->cdev);
+               dev_printk(KERN_ERR, rc->dev.parent, "RAID COMPONENT REMOVE\n");
+               device_unregister(&rc->dev);
        }
        dev_printk(KERN_ERR, dev, "RAID REMOVE DONE\n");
        kfree(rd);
@@ -171,9 +171,11 @@ static const char *raid_level_name(enum raid_level level)
 }
 
 #define raid_attr_show_internal(attr, fmt, var, code)                  \
-static ssize_t raid_show_##attr(struct class_device *cdev, char *buf)  \
+static ssize_t raid_show_##attr(struct device *dev,                    \
+                               struct device_attribute *attr,          \
+                               char *buf)                              \
 {                                                                      \
-       struct raid_data *rd = class_get_devdata(cdev);                 \
+       struct raid_data *rd = dev_get_drvdata(dev);                    \
        code                                                            \
        return snprintf(buf, 20, #fmt "\n", var);                       \
 }
@@ -184,17 +186,17 @@ raid_attr_show_internal(attr, %s, name,                                   \
        code                                                            \
        name = raid_##states##_name(rd->attr);                          \
 )                                                                      \
-static CLASS_DEVICE_ATTR(attr, S_IRUGO, raid_show_##attr, NULL)
+static DEVICE_ATTR(attr, S_IRUGO, raid_show_##attr, NULL)
 
 
 #define raid_attr_ro_internal(attr, code)                              \
 raid_attr_show_internal(attr, %d, rd->attr, code)                      \
-static CLASS_DEVICE_ATTR(attr, S_IRUGO, raid_show_##attr, NULL)
+static DEVICE_ATTR(attr, S_IRUGO, raid_show_##attr, NULL)
 
 #define ATTR_CODE(attr)                                                        \
-       struct raid_internal *i = class_device_to_raid_internal(cdev);  \
+       struct raid_internal *i = device_to_raid_internal(dev);         \
        if (i->f->get_##attr)                                           \
-               i->f->get_##attr(cdev->dev);
+               i->f->get_##attr(dev->parent);
 
 #define raid_attr_ro(attr)     raid_attr_ro_internal(attr, )
 #define raid_attr_ro_fn(attr)  raid_attr_ro_internal(attr, ATTR_CODE(attr))
@@ -206,23 +208,23 @@ raid_attr_ro_state(level);
 raid_attr_ro_fn(resync);
 raid_attr_ro_state_fn(state);
 
-static void raid_component_release(struct class_device *cdev)
+static void raid_component_release(struct device *dev)
 {
-       struct raid_component *rc = container_of(cdev, struct raid_component,
-                                                cdev);
-       dev_printk(KERN_ERR, rc->cdev.dev, "COMPONENT RELEASE\n");
-       put_device(rc->cdev.dev);
+       struct raid_component *rc =
+               container_of(dev, struct raid_component, dev);
+       dev_printk(KERN_ERR, rc->dev.parent, "COMPONENT RELEASE\n");
+       put_device(rc->dev.parent);
        kfree(rc);
 }
 
 int raid_component_add(struct raid_template *r,struct device *raid_dev,
                       struct device *component_dev)
 {
-       struct class_device *cdev =
+       struct device *cdev =
                attribute_container_find_class_device(&r->raid_attrs.ac,
                                                      raid_dev);
        struct raid_component *rc;
-       struct raid_data *rd = class_get_devdata(cdev);
+       struct raid_data *rd = dev_get_drvdata(cdev);
        int err;
 
        rc = kzalloc(sizeof(*rc), GFP_KERNEL);
@@ -230,17 +232,16 @@ int raid_component_add(struct raid_template *r,struct device *raid_dev,
                return -ENOMEM;
 
        INIT_LIST_HEAD(&rc->node);
-       class_device_initialize(&rc->cdev);
-       rc->cdev.release = raid_component_release;
-       rc->cdev.dev = get_device(component_dev);
+       device_initialize(&rc->dev);
+       rc->dev.release = raid_component_release;
+       rc->dev.parent = get_device(component_dev);
        rc->num = rd->component_count++;
 
-       snprintf(rc->cdev.class_id, sizeof(rc->cdev.class_id),
+       snprintf(rc->dev.bus_id, sizeof(rc->dev.bus_id),
                 "component-%d", rc->num);
        list_add_tail(&rc->node, &rd->component_list);
-       rc->cdev.parent = cdev;
-       rc->cdev.class = &raid_class.class;
-       err = class_device_add(&rc->cdev);
+       rc->dev.class = &raid_class.class;
+       err = device_add(&rc->dev);
        if (err)
                goto err_out;
 
@@ -273,9 +274,9 @@ raid_class_attach(struct raid_function_template *ft)
 
        attribute_container_register(&i->r.raid_attrs.ac);
 
-       i->attrs[count++] = &class_device_attr_level;
-       i->attrs[count++] = &class_device_attr_resync;
-       i->attrs[count++] = &class_device_attr_state;
+       i->attrs[count++] = &dev_attr_level;
+       i->attrs[count++] = &dev_attr_resync;
+       i->attrs[count++] = &dev_attr_state;
 
        i->attrs[count] = NULL;
        BUG_ON(count > RAID_NUM_ATTRS);
index e1edab45a37bead9919b3657dc8014cbcbb1572b..998cb5be6833041fbaf2c1c32bfd58127ab6fa64 100644 (file)
@@ -13,12 +13,12 @@ struct sas_internal {
        struct sas_function_template *f;
        struct sas_domain_function_template *dft;
 
-       struct class_device_attribute private_host_attrs[SAS_HOST_ATTRS];
-       struct class_device_attribute private_phy_attrs[SAS_PHY_ATTRS];
-       struct class_device_attribute private_port_attrs[SAS_PORT_ATTRS];
-       struct class_device_attribute private_rphy_attrs[SAS_RPORT_ATTRS];
-       struct class_device_attribute private_end_dev_attrs[SAS_END_DEV_ATTRS];
-       struct class_device_attribute private_expander_attrs[SAS_EXPANDER_ATTRS];
+       struct device_attribute private_host_attrs[SAS_HOST_ATTRS];
+       struct device_attribute private_phy_attrs[SAS_PHY_ATTRS];
+       struct device_attribute private_port_attrs[SAS_PORT_ATTRS];
+       struct device_attribute private_rphy_attrs[SAS_RPORT_ATTRS];
+       struct device_attribute private_end_dev_attrs[SAS_END_DEV_ATTRS];
+       struct device_attribute private_expander_attrs[SAS_EXPANDER_ATTRS];
 
        struct transport_container phy_attr_cont;
        struct transport_container port_attr_cont;
@@ -30,12 +30,12 @@ struct sas_internal {
         * The array of null terminated pointers to attributes
         * needed by scsi_sysfs.c
         */
-       struct class_device_attribute *host_attrs[SAS_HOST_ATTRS + 1];
-       struct class_device_attribute *phy_attrs[SAS_PHY_ATTRS + 1];
-       struct class_device_attribute *port_attrs[SAS_PORT_ATTRS + 1];
-       struct class_device_attribute *rphy_attrs[SAS_RPORT_ATTRS + 1];
-       struct class_device_attribute *end_dev_attrs[SAS_END_DEV_ATTRS + 1];
-       struct class_device_attribute *expander_attrs[SAS_EXPANDER_ATTRS + 1];
+       struct device_attribute *host_attrs[SAS_HOST_ATTRS + 1];
+       struct device_attribute *phy_attrs[SAS_PHY_ATTRS + 1];
+       struct device_attribute *port_attrs[SAS_PORT_ATTRS + 1];
+       struct device_attribute *rphy_attrs[SAS_RPORT_ATTRS + 1];
+       struct device_attribute *end_dev_attrs[SAS_END_DEV_ATTRS + 1];
+       struct device_attribute *expander_attrs[SAS_EXPANDER_ATTRS + 1];
 };
 #define to_sas_internal(tmpl)  container_of(tmpl, struct sas_internal, t)
 
index ed83cdb6e67dfbdb5c829238c91ed861b124a426..67bb20ed45d23ef431280a2c63a03e14ea252731 100644 (file)
@@ -119,9 +119,10 @@ static int scsi_scan(struct Scsi_Host *shost, const char *str)
  */
 #define shost_show_function(name, field, format_string)                        \
 static ssize_t                                                         \
-show_##name (struct class_device *class_dev, char *buf)                        \
+show_##name (struct device *dev, struct device_attribute *attr,        \
+            char *buf)                                                 \
 {                                                                      \
-       struct Scsi_Host *shost = class_to_shost(class_dev);            \
+       struct Scsi_Host *shost = class_to_shost(dev);                  \
        return snprintf (buf, 20, format_string, shost->field);         \
 }
 
@@ -131,7 +132,7 @@ show_##name (struct class_device *class_dev, char *buf)                     \
  */
 #define shost_rd_attr2(name, field, format_string)                     \
        shost_show_function(name, field, format_string)                 \
-static CLASS_DEVICE_ATTR(name, S_IRUGO, show_##name, NULL);
+static DEVICE_ATTR(name, S_IRUGO, show_##name, NULL);
 
 #define shost_rd_attr(field, format_string) \
 shost_rd_attr2(field, field, format_string)
@@ -140,10 +141,11 @@ shost_rd_attr2(field, field, format_string)
  * Create the actual show/store functions and data structures.
  */
 
-static ssize_t store_scan(struct class_device *class_dev, const char *buf,
-                         size_t count)
+static ssize_t
+store_scan(struct device *dev, struct device_attribute *attr,
+          const char *buf, size_t count)
 {
-       struct Scsi_Host *shost = class_to_shost(class_dev);
+       struct Scsi_Host *shost = class_to_shost(dev);
        int res;
 
        res = scsi_scan(shost, buf);
@@ -151,13 +153,14 @@ static ssize_t store_scan(struct class_device *class_dev, const char *buf,
                res = count;
        return res;
 };
-static CLASS_DEVICE_ATTR(scan, S_IWUSR, NULL, store_scan);
+static DEVICE_ATTR(scan, S_IWUSR, NULL, store_scan);
 
 static ssize_t
-store_shost_state(struct class_device *class_dev, const char *buf, size_t count)
+store_shost_state(struct device *dev, struct device_attribute *attr,
+                 const char *buf, size_t count)
 {
        int i;
-       struct Scsi_Host *shost = class_to_shost(class_dev);
+       struct Scsi_Host *shost = class_to_shost(dev);
        enum scsi_host_state state = 0;
 
        for (i = 0; i < ARRAY_SIZE(shost_states); i++) {
@@ -177,9 +180,9 @@ store_shost_state(struct class_device *class_dev, const char *buf, size_t count)
 }
 
 static ssize_t
-show_shost_state(struct class_device *class_dev, char *buf)
+show_shost_state(struct device *dev, struct device_attribute *attr, char *buf)
 {
-       struct Scsi_Host *shost = class_to_shost(class_dev);
+       struct Scsi_Host *shost = class_to_shost(dev);
        const char *name = scsi_host_state_name(shost->shost_state);
 
        if (!name)
@@ -188,7 +191,9 @@ show_shost_state(struct class_device *class_dev, char *buf)
        return snprintf(buf, 20, "%s\n", name);
 }
 
-static CLASS_DEVICE_ATTR(state, S_IRUGO | S_IWUSR, show_shost_state, store_shost_state);
+/* DEVICE_ATTR(state) clashes with dev_attr_state for sdev */
+struct device_attribute dev_attr_hstate =
+       __ATTR(state, S_IRUGO | S_IWUSR, show_shost_state, store_shost_state);
 
 static ssize_t
 show_shost_mode(unsigned int mode, char *buf)
@@ -206,9 +211,11 @@ show_shost_mode(unsigned int mode, char *buf)
        return len;
 }
 
-static ssize_t show_shost_supported_mode(struct class_device *class_dev, char *buf)
+static ssize_t
+show_shost_supported_mode(struct device *dev, struct device_attribute *attr,
+                         char *buf)
 {
-       struct Scsi_Host *shost = class_to_shost(class_dev);
+       struct Scsi_Host *shost = class_to_shost(dev);
        unsigned int supported_mode = shost->hostt->supported_mode;
 
        if (supported_mode == MODE_UNKNOWN)
@@ -218,11 +225,13 @@ static ssize_t show_shost_supported_mode(struct class_device *class_dev, char *b
        return show_shost_mode(supported_mode, buf);
 }
 
-static CLASS_DEVICE_ATTR(supported_mode, S_IRUGO | S_IWUSR, show_shost_supported_mode, NULL);
+static DEVICE_ATTR(supported_mode, S_IRUGO | S_IWUSR, show_shost_supported_mode, NULL);
 
-static ssize_t show_shost_active_mode(struct class_device *class_dev, char *buf)
+static ssize_t
+show_shost_active_mode(struct device *dev,
+                      struct device_attribute *attr, char *buf)
 {
-       struct Scsi_Host *shost = class_to_shost(class_dev);
+       struct Scsi_Host *shost = class_to_shost(dev);
 
        if (shost->active_mode == MODE_UNKNOWN)
                return snprintf(buf, 20, "unknown\n");
@@ -230,7 +239,7 @@ static ssize_t show_shost_active_mode(struct class_device *class_dev, char *buf)
                return show_shost_mode(shost->active_mode, buf);
 }
 
-static CLASS_DEVICE_ATTR(active_mode, S_IRUGO | S_IWUSR, show_shost_active_mode, NULL);
+static DEVICE_ATTR(active_mode, S_IRUGO | S_IWUSR, show_shost_active_mode, NULL);
 
 shost_rd_attr(unique_id, "%u\n");
 shost_rd_attr(host_busy, "%hu\n");
@@ -240,22 +249,22 @@ shost_rd_attr(sg_tablesize, "%hu\n");
 shost_rd_attr(unchecked_isa_dma, "%d\n");
 shost_rd_attr2(proc_name, hostt->proc_name, "%s\n");
 
-static struct class_device_attribute *scsi_sysfs_shost_attrs[] = {
-       &class_device_attr_unique_id,
-       &class_device_attr_host_busy,
-       &class_device_attr_cmd_per_lun,
-       &class_device_attr_can_queue,
-       &class_device_attr_sg_tablesize,
-       &class_device_attr_unchecked_isa_dma,
-       &class_device_attr_proc_name,
-       &class_device_attr_scan,
-       &class_device_attr_state,
-       &class_device_attr_supported_mode,
-       &class_device_attr_active_mode,
+static struct device_attribute *scsi_sysfs_shost_attrs[] = {
+       &dev_attr_unique_id,
+       &dev_attr_host_busy,
+       &dev_attr_cmd_per_lun,
+       &dev_attr_can_queue,
+       &dev_attr_sg_tablesize,
+       &dev_attr_unchecked_isa_dma,
+       &dev_attr_proc_name,
+       &dev_attr_scan,
+       &dev_attr_hstate,
+       &dev_attr_supported_mode,
+       &dev_attr_active_mode,
        NULL
 };
 
-static void scsi_device_cls_release(struct class_device *class_dev)
+static void scsi_device_cls_release(struct device *class_dev)
 {
        struct scsi_device *sdev;
 
@@ -320,7 +329,7 @@ static void scsi_device_dev_release(struct device *dev)
 
 static struct class sdev_class = {
        .name           = "scsi_device",
-       .release        = scsi_device_cls_release,
+       .dev_release    = scsi_device_cls_release,
 };
 
 /* all probing is done in the individual ->probe routines */
@@ -424,7 +433,8 @@ void scsi_sysfs_unregister(void)
  */
 #define sdev_show_function(field, format_string)                               \
 static ssize_t                                                         \
-sdev_show_##field (struct device *dev, struct device_attribute *attr, char *buf)                               \
+sdev_show_##field (struct device *dev, struct device_attribute *attr,  \
+                  char *buf)                                           \
 {                                                                      \
        struct scsi_device *sdev;                                       \
        sdev = to_scsi_device(dev);                                     \
@@ -448,7 +458,8 @@ static DEVICE_ATTR(field, S_IRUGO, sdev_show_##field, NULL);
        sdev_show_function(field, format_string)                                \
                                                                        \
 static ssize_t                                                         \
-sdev_store_##field (struct device *dev, struct device_attribute *attr, const char *buf, size_t count)  \
+sdev_store_##field (struct device *dev, struct device_attribute *attr, \
+                   const char *buf, size_t count)                      \
 {                                                                      \
        struct scsi_device *sdev;                                       \
        sdev = to_scsi_device(dev);                                     \
@@ -468,7 +479,8 @@ static DEVICE_ATTR(field, S_IRUGO | S_IWUSR, sdev_show_##field, sdev_store_##fie
        sdev_show_function(field, "%d\n")                                       \
                                                                        \
 static ssize_t                                                         \
-sdev_store_##field (struct device *dev, struct device_attribute *attr, const char *buf, size_t count)  \
+sdev_store_##field (struct device *dev, struct device_attribute *attr, \
+                   const char *buf, size_t count)                      \
 {                                                                      \
        int ret;                                                        \
        struct scsi_device *sdev;                                       \
@@ -519,7 +531,8 @@ sdev_show_timeout (struct device *dev, struct device_attribute *attr, char *buf)
 }
 
 static ssize_t
-sdev_store_timeout (struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
+sdev_store_timeout (struct device *dev, struct device_attribute *attr,
+                   const char *buf, size_t count)
 {
        struct scsi_device *sdev;
        int timeout;
@@ -531,7 +544,8 @@ sdev_store_timeout (struct device *dev, struct device_attribute *attr, const cha
 static DEVICE_ATTR(timeout, S_IRUGO | S_IWUSR, sdev_show_timeout, sdev_store_timeout);
 
 static ssize_t
-store_rescan_field (struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
+store_rescan_field (struct device *dev, struct device_attribute *attr,
+                   const char *buf, size_t count)
 {
        scsi_rescan_device(dev);
        return count;
@@ -543,8 +557,9 @@ static void sdev_store_delete_callback(struct device *dev)
        scsi_remove_device(to_scsi_device(dev));
 }
 
-static ssize_t sdev_store_delete(struct device *dev, struct device_attribute *attr, const char *buf,
-                                size_t count)
+static ssize_t
+sdev_store_delete(struct device *dev, struct device_attribute *attr,
+                 const char *buf, size_t count)
 {
        int rc;
 
@@ -559,7 +574,8 @@ static ssize_t sdev_store_delete(struct device *dev, struct device_attribute *at
 static DEVICE_ATTR(delete, S_IWUSR, NULL, sdev_store_delete);
 
 static ssize_t
-store_state_field(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
+store_state_field(struct device *dev, struct device_attribute *attr,
+                 const char *buf, size_t count)
 {
        int i;
        struct scsi_device *sdev = to_scsi_device(dev);
@@ -596,7 +612,8 @@ show_state_field(struct device *dev, struct device_attribute *attr, char *buf)
 static DEVICE_ATTR(state, S_IRUGO | S_IWUSR, show_state_field, store_state_field);
 
 static ssize_t
-show_queue_type_field(struct device *dev, struct device_attribute *attr, char *buf)
+show_queue_type_field(struct device *dev, struct device_attribute *attr,
+                     char *buf)
 {
        struct scsi_device *sdev = to_scsi_device(dev);
        const char *name = "none";
@@ -612,7 +629,7 @@ show_queue_type_field(struct device *dev, struct device_attribute *attr, char *b
 static DEVICE_ATTR(queue_type, S_IRUGO, show_queue_type_field, NULL);
 
 static ssize_t
-show_iostat_counterbits(struct device *dev, struct device_attribute *attr, char *buf)
+show_iostat_counterbits(struct device *dev, struct device_attribute *attr,                             char *buf)
 {
        return snprintf(buf, 20, "%d\n", (int)sizeof(atomic_t) * 8);
 }
@@ -621,7 +638,8 @@ static DEVICE_ATTR(iocounterbits, S_IRUGO, show_iostat_counterbits, NULL);
 
 #define show_sdev_iostat(field)                                                \
 static ssize_t                                                         \
-show_iostat_##field(struct device *dev, struct device_attribute *attr, char *buf)                      \
+show_iostat_##field(struct device *dev, struct device_attribute *attr, \
+                   char *buf)                                          \
 {                                                                      \
        struct scsi_device *sdev = to_scsi_device(dev);                 \
        unsigned long long count = atomic_read(&sdev->field);           \
@@ -645,7 +663,7 @@ static DEVICE_ATTR(modalias, S_IRUGO, sdev_show_modalias, NULL);
 #define DECLARE_EVT_SHOW(name, Cap_name)                               \
 static ssize_t                                                         \
 sdev_show_evt_##name(struct device *dev, struct device_attribute *attr,        \
-                               char *buf)                              \
+                    char *buf)                                         \
 {                                                                      \
        struct scsi_device *sdev = to_scsi_device(dev);                 \
        int val = test_bit(SDEV_EVT_##Cap_name, sdev->supported_events);\
@@ -654,7 +672,7 @@ sdev_show_evt_##name(struct device *dev, struct device_attribute *attr,     \
 
 #define DECLARE_EVT_STORE(name, Cap_name)                              \
 static ssize_t                                                         \
-sdev_store_evt_##name(struct device *dev, struct device_attribute *attr, \
+sdev_store_evt_##name(struct device *dev, struct device_attribute *attr,\
                      const char *buf, size_t count)                    \
 {                                                                      \
        struct scsi_device *sdev = to_scsi_device(dev);                 \
@@ -707,8 +725,9 @@ static struct attribute_group *scsi_sdev_attr_groups[] = {
        NULL
 };
 
-static ssize_t sdev_store_queue_depth_rw(struct device *dev, struct device_attribute *attr, const char *buf,
-                                        size_t count)
+static ssize_t
+sdev_store_queue_depth_rw(struct device *dev, struct device_attribute *attr,
+                         const char *buf, size_t count)
 {
        int depth, retval;
        struct scsi_device *sdev = to_scsi_device(dev);
@@ -733,8 +752,9 @@ static struct device_attribute sdev_attr_queue_depth_rw =
        __ATTR(queue_depth, S_IRUGO | S_IWUSR, sdev_show_queue_depth,
               sdev_store_queue_depth_rw);
 
-static ssize_t sdev_store_queue_type_rw(struct device *dev, struct device_attribute *attr, const char *buf,
-                                       size_t count)
+static ssize_t
+sdev_store_queue_type_rw(struct device *dev, struct device_attribute *attr,
+                        const char *buf, size_t count)
 {
        struct scsi_device *sdev = to_scsi_device(dev);
        struct scsi_host_template *sht = sdev->host->hostt;
@@ -786,13 +806,13 @@ int scsi_sysfs_add_sdev(struct scsi_device *sdev)
                printk(KERN_INFO "error 1\n");
                return error;
        }
-       error = class_device_add(&sdev->sdev_classdev);
+       error = device_add(&sdev->sdev_dev);
        if (error) {
                printk(KERN_INFO "error 2\n");
                goto clean_device;
        }
 
-       /* take a reference for the sdev_classdev; this is
+       /* take a reference for the sdev_dev; this is
         * released by the sdev_class .release */
        get_device(&sdev->sdev_gendev);
 
@@ -858,7 +878,7 @@ void __scsi_remove_device(struct scsi_device *sdev)
                return;
 
        bsg_unregister_queue(sdev->request_queue);
-       class_device_unregister(&sdev->sdev_classdev);
+       device_unregister(&sdev->sdev_dev);
        transport_remove_device(dev);
        device_del(dev);
        scsi_device_set_state(sdev, SDEV_DEL);
@@ -952,9 +972,9 @@ int scsi_register_interface(struct class_interface *intf)
 EXPORT_SYMBOL(scsi_register_interface);
 
 
-static struct class_device_attribute *class_attr_overridden(
-               struct class_device_attribute **attrs,
-               struct class_device_attribute *attr)
+static struct device_attribute *class_attr_overridden(
+               struct device_attribute **attrs,
+               struct device_attribute *attr)
 {
        int i;
 
@@ -966,10 +986,10 @@ static struct class_device_attribute *class_attr_overridden(
        return NULL;
 }
 
-static int class_attr_add(struct class_device *classdev,
-               struct class_device_attribute *attr)
+static int class_attr_add(struct device *classdev,
+               struct device_attribute *attr)
 {
-       struct class_device_attribute *base_attr;
+       struct device_attribute *base_attr;
 
        /*
         * Spare the caller from having to copy things it's not interested in.
@@ -986,7 +1006,7 @@ static int class_attr_add(struct class_device *classdev,
                        attr->store = base_attr->store;
        }
 
-       return class_device_create_file(classdev, attr);
+       return device_create_file(classdev, attr);
 }
 
 /**
@@ -1000,7 +1020,7 @@ int scsi_sysfs_add_host(struct Scsi_Host *shost)
 
        if (shost->hostt->shost_attrs) {
                for (i = 0; shost->hostt->shost_attrs[i]; i++) {
-                       error = class_attr_add(&shost->shost_classdev,
+                       error = class_attr_add(&shost->shost_dev,
                                        shost->hostt->shost_attrs[i]);
                        if (error)
                                return error;
@@ -1010,7 +1030,7 @@ int scsi_sysfs_add_host(struct Scsi_Host *shost)
        for (i = 0; scsi_sysfs_shost_attrs[i]; i++) {
                if (!class_attr_overridden(shost->hostt->shost_attrs,
                                        scsi_sysfs_shost_attrs[i])) {
-                       error = class_device_create_file(&shost->shost_classdev,
+                       error = device_create_file(&shost->shost_dev,
                                        scsi_sysfs_shost_attrs[i]);
                        if (error)
                                return error;
@@ -1041,10 +1061,10 @@ void scsi_sysfs_device_initialize(struct scsi_device *sdev)
                sdev->host->host_no, sdev->channel, sdev->id,
                sdev->lun);
        
-       class_device_initialize(&sdev->sdev_classdev);
-       sdev->sdev_classdev.dev = &sdev->sdev_gendev;
-       sdev->sdev_classdev.class = &sdev_class;
-       snprintf(sdev->sdev_classdev.class_id, BUS_ID_SIZE,
+       device_initialize(&sdev->sdev_dev);
+       sdev->sdev_dev.parent = &sdev->sdev_gendev;
+       sdev->sdev_dev.class = &sdev_class;
+       snprintf(sdev->sdev_dev.bus_id, BUS_ID_SIZE,
                 "%d:%d:%d:%d", sdev->host->host_no,
                 sdev->channel, sdev->id, sdev->lun);
        sdev->scsi_level = starget->scsi_level;
index b1119da6e88c902d9469c28690dc4101e1c42dc5..6b092a6c295d52d0b63b7d5659b880c63c07ed7a 100644 (file)
@@ -72,8 +72,8 @@ static int fc_vport_create(struct Scsi_Host *shost, int channel,
  * Redefine so that we can have same named attributes in the
  * sdev/starget/host objects.
  */
-#define FC_CLASS_DEVICE_ATTR(_prefix,_name,_mode,_show,_store)         \
-struct class_device_attribute class_device_attr_##_prefix##_##_name =  \
+#define FC_DEVICE_ATTR(_prefix,_name,_mode,_show,_store)               \
+struct device_attribute device_attr_##_prefix##_##_name =      \
        __ATTR(_name,_mode,_show,_store)
 
 #define fc_enum_name_search(title, table_type, table)                  \
@@ -326,26 +326,26 @@ struct fc_internal {
         * part of the midlayer. As the remote port is specific to the
         * fc transport, we must provide the attribute container.
         */
-       struct class_device_attribute private_starget_attrs[
+       struct device_attribute private_starget_attrs[
                                                        FC_STARGET_NUM_ATTRS];
-       struct class_device_attribute *starget_attrs[FC_STARGET_NUM_ATTRS + 1];
+       struct device_attribute *starget_attrs[FC_STARGET_NUM_ATTRS + 1];
 
-       struct class_device_attribute private_host_attrs[FC_HOST_NUM_ATTRS];
-       struct class_device_attribute *host_attrs[FC_HOST_NUM_ATTRS + 1];
+       struct device_attribute private_host_attrs[FC_HOST_NUM_ATTRS];
+       struct device_attribute *host_attrs[FC_HOST_NUM_ATTRS + 1];
 
        struct transport_container rport_attr_cont;
-       struct class_device_attribute private_rport_attrs[FC_RPORT_NUM_ATTRS];
-       struct class_device_attribute *rport_attrs[FC_RPORT_NUM_ATTRS + 1];
+       struct device_attribute private_rport_attrs[FC_RPORT_NUM_ATTRS];
+       struct device_attribute *rport_attrs[FC_RPORT_NUM_ATTRS + 1];
 
        struct transport_container vport_attr_cont;
-       struct class_device_attribute private_vport_attrs[FC_VPORT_NUM_ATTRS];
-       struct class_device_attribute *vport_attrs[FC_VPORT_NUM_ATTRS + 1];
+       struct device_attribute private_vport_attrs[FC_VPORT_NUM_ATTRS];
+       struct device_attribute *vport_attrs[FC_VPORT_NUM_ATTRS + 1];
 };
 
 #define to_fc_internal(tmpl)   container_of(tmpl, struct fc_internal, t)
 
 static int fc_target_setup(struct transport_container *tc, struct device *dev,
-                          struct class_device *cdev)
+                          struct device *cdev)
 {
        struct scsi_target *starget = to_scsi_target(dev);
        struct fc_rport *rport = starget_to_rport(starget);
@@ -375,7 +375,7 @@ static DECLARE_TRANSPORT_CLASS(fc_transport_class,
                               NULL);
 
 static int fc_host_setup(struct transport_container *tc, struct device *dev,
-                        struct class_device *cdev)
+                        struct device *cdev)
 {
        struct Scsi_Host *shost = dev_to_shost(dev);
        struct fc_host_attrs *fc_host = shost_to_fc_host(shost);
@@ -682,9 +682,10 @@ static void __exit fc_transport_exit(void)
 
 #define fc_rport_show_function(field, format_string, sz, cast)         \
 static ssize_t                                                         \
-show_fc_rport_##field (struct class_device *cdev, char *buf)           \
+show_fc_rport_##field (struct device *dev,                             \
+                      struct device_attribute *attr, char *buf)        \
 {                                                                      \
-       struct fc_rport *rport = transport_class_to_rport(cdev);        \
+       struct fc_rport *rport = transport_class_to_rport(dev);         \
        struct Scsi_Host *shost = rport_to_shost(rport);                \
        struct fc_internal *i = to_fc_internal(shost->transportt);      \
        if ((i->f->get_rport_##field) &&                                \
@@ -697,11 +698,12 @@ show_fc_rport_##field (struct class_device *cdev, char *buf)              \
 
 #define fc_rport_store_function(field)                                 \
 static ssize_t                                                         \
-store_fc_rport_##field(struct class_device *cdev, const char *buf,     \
-                          size_t count)                                \
+store_fc_rport_##field(struct device *dev,                             \
+                      struct device_attribute *attr,                   \
+                      const char *buf, size_t count)                   \
 {                                                                      \
        int val;                                                        \
-       struct fc_rport *rport = transport_class_to_rport(cdev);        \
+       struct fc_rport *rport = transport_class_to_rport(dev);         \
        struct Scsi_Host *shost = rport_to_shost(rport);                \
        struct fc_internal *i = to_fc_internal(shost->transportt);      \
        char *cp;                                                       \
@@ -718,58 +720,60 @@ store_fc_rport_##field(struct class_device *cdev, const char *buf,        \
 
 #define fc_rport_rd_attr(field, format_string, sz)                     \
        fc_rport_show_function(field, format_string, sz, )              \
-static FC_CLASS_DEVICE_ATTR(rport, field, S_IRUGO,                     \
+static FC_DEVICE_ATTR(rport, field, S_IRUGO,                   \
                         show_fc_rport_##field, NULL)
 
 #define fc_rport_rd_attr_cast(field, format_string, sz, cast)          \
        fc_rport_show_function(field, format_string, sz, (cast))        \
-static FC_CLASS_DEVICE_ATTR(rport, field, S_IRUGO,                     \
+static FC_DEVICE_ATTR(rport, field, S_IRUGO,                   \
                          show_fc_rport_##field, NULL)
 
 #define fc_rport_rw_attr(field, format_string, sz)                     \
        fc_rport_show_function(field, format_string, sz, )              \
        fc_rport_store_function(field)                                  \
-static FC_CLASS_DEVICE_ATTR(rport, field, S_IRUGO | S_IWUSR,           \
+static FC_DEVICE_ATTR(rport, field, S_IRUGO | S_IWUSR,         \
                        show_fc_rport_##field,                          \
                        store_fc_rport_##field)
 
 
 #define fc_private_rport_show_function(field, format_string, sz, cast) \
 static ssize_t                                                         \
-show_fc_rport_##field (struct class_device *cdev, char *buf)           \
+show_fc_rport_##field (struct device *dev,                             \
+                      struct device_attribute *attr, char *buf)        \
 {                                                                      \
-       struct fc_rport *rport = transport_class_to_rport(cdev);        \
+       struct fc_rport *rport = transport_class_to_rport(dev);         \
        return snprintf(buf, sz, format_string, cast rport->field);     \
 }
 
 #define fc_private_rport_rd_attr(field, format_string, sz)             \
        fc_private_rport_show_function(field, format_string, sz, )      \
-static FC_CLASS_DEVICE_ATTR(rport, field, S_IRUGO,                     \
+static FC_DEVICE_ATTR(rport, field, S_IRUGO,                   \
                         show_fc_rport_##field, NULL)
 
 #define fc_private_rport_rd_attr_cast(field, format_string, sz, cast)  \
        fc_private_rport_show_function(field, format_string, sz, (cast)) \
-static FC_CLASS_DEVICE_ATTR(rport, field, S_IRUGO,                     \
+static FC_DEVICE_ATTR(rport, field, S_IRUGO,                   \
                          show_fc_rport_##field, NULL)
 
 
 #define fc_private_rport_rd_enum_attr(title, maxlen)                   \
 static ssize_t                                                         \
-show_fc_rport_##title (struct class_device *cdev, char *buf)           \
+show_fc_rport_##title (struct device *dev,                             \
+                      struct device_attribute *attr, char *buf)        \
 {                                                                      \
-       struct fc_rport *rport = transport_class_to_rport(cdev);        \
+       struct fc_rport *rport = transport_class_to_rport(dev);         \
        const char *name;                                               \
        name = get_fc_##title##_name(rport->title);                     \
        if (!name)                                                      \
                return -EINVAL;                                         \
        return snprintf(buf, maxlen, "%s\n", name);                     \
 }                                                                      \
-static FC_CLASS_DEVICE_ATTR(rport, title, S_IRUGO,                     \
+static FC_DEVICE_ATTR(rport, title, S_IRUGO,                   \
                        show_fc_rport_##title, NULL)
 
 
 #define SETUP_RPORT_ATTRIBUTE_RD(field)                                        \
-       i->private_rport_attrs[count] = class_device_attr_rport_##field; \
+       i->private_rport_attrs[count] = device_attr_rport_##field; \
        i->private_rport_attrs[count].attr.mode = S_IRUGO;              \
        i->private_rport_attrs[count].store = NULL;                     \
        i->rport_attrs[count] = &i->private_rport_attrs[count];         \
@@ -777,14 +781,14 @@ static FC_CLASS_DEVICE_ATTR(rport, title, S_IRUGO,                        \
                count++
 
 #define SETUP_PRIVATE_RPORT_ATTRIBUTE_RD(field)                                \
-       i->private_rport_attrs[count] = class_device_attr_rport_##field; \
+       i->private_rport_attrs[count] = device_attr_rport_##field; \
        i->private_rport_attrs[count].attr.mode = S_IRUGO;              \
        i->private_rport_attrs[count].store = NULL;                     \
        i->rport_attrs[count] = &i->private_rport_attrs[count];         \
        count++
 
 #define SETUP_RPORT_ATTRIBUTE_RW(field)                                        \
-       i->private_rport_attrs[count] = class_device_attr_rport_##field; \
+       i->private_rport_attrs[count] = device_attr_rport_##field; \
        if (!i->f->set_rport_##field) {                                 \
                i->private_rport_attrs[count].attr.mode = S_IRUGO;      \
                i->private_rport_attrs[count].store = NULL;             \
@@ -795,7 +799,7 @@ static FC_CLASS_DEVICE_ATTR(rport, title, S_IRUGO,                  \
 
 #define SETUP_PRIVATE_RPORT_ATTRIBUTE_RW(field)                                \
 {                                                                      \
-       i->private_rport_attrs[count] = class_device_attr_rport_##field; \
+       i->private_rport_attrs[count] = device_attr_rport_##field; \
        i->rport_attrs[count] = &i->private_rport_attrs[count];         \
        count++;                                                        \
 }
@@ -808,14 +812,15 @@ static FC_CLASS_DEVICE_ATTR(rport, title, S_IRUGO,                        \
 fc_private_rport_rd_attr(maxframe_size, "%u bytes\n", 20);
 
 static ssize_t
-show_fc_rport_supported_classes (struct class_device *cdev, char *buf)
+show_fc_rport_supported_classes (struct device *dev,
+                                struct device_attribute *attr, char *buf)
 {
-       struct fc_rport *rport = transport_class_to_rport(cdev);
+       struct fc_rport *rport = transport_class_to_rport(dev);
        if (rport->supported_classes == FC_COS_UNSPECIFIED)
                return snprintf(buf, 20, "unspecified\n");
        return get_fc_cos_names(rport->supported_classes, buf);
 }
-static FC_CLASS_DEVICE_ATTR(rport, supported_classes, S_IRUGO,
+static FC_DEVICE_ATTR(rport, supported_classes, S_IRUGO,
                show_fc_rport_supported_classes, NULL);
 
 /* Dynamic Remote Port Attributes */
@@ -825,11 +830,11 @@ static FC_CLASS_DEVICE_ATTR(rport, supported_classes, S_IRUGO,
  */
 fc_rport_show_function(dev_loss_tmo, "%d\n", 20, )
 static ssize_t
-store_fc_rport_dev_loss_tmo(struct class_device *cdev, const char *buf,
-                          size_t count)
+store_fc_rport_dev_loss_tmo(struct device *dev, struct device_attribute *attr,
+                           const char *buf, size_t count)
 {
        int val;
-       struct fc_rport *rport = transport_class_to_rport(cdev);
+       struct fc_rport *rport = transport_class_to_rport(dev);
        struct Scsi_Host *shost = rport_to_shost(rport);
        struct fc_internal *i = to_fc_internal(shost->transportt);
        char *cp;
@@ -844,7 +849,7 @@ store_fc_rport_dev_loss_tmo(struct class_device *cdev, const char *buf,
        i->f->set_rport_dev_loss_tmo(rport, val);
        return count;
 }
-static FC_CLASS_DEVICE_ATTR(rport, dev_loss_tmo, S_IRUGO | S_IWUSR,
+static FC_DEVICE_ATTR(rport, dev_loss_tmo, S_IRUGO | S_IWUSR,
                show_fc_rport_dev_loss_tmo, store_fc_rport_dev_loss_tmo);
 
 
@@ -855,9 +860,10 @@ fc_private_rport_rd_attr_cast(port_name, "0x%llx\n", 20, unsigned long long);
 fc_private_rport_rd_attr(port_id, "0x%06x\n", 20);
 
 static ssize_t
-show_fc_rport_roles (struct class_device *cdev, char *buf)
+show_fc_rport_roles (struct device *dev, struct device_attribute *attr,
+                    char *buf)
 {
-       struct fc_rport *rport = transport_class_to_rport(cdev);
+       struct fc_rport *rport = transport_class_to_rport(dev);
 
        /* identify any roles that are port_id specific */
        if ((rport->port_id != -1) &&
@@ -883,7 +889,7 @@ show_fc_rport_roles (struct class_device *cdev, char *buf)
                return get_fc_port_roles_names(rport->roles, buf);
        }
 }
-static FC_CLASS_DEVICE_ATTR(rport, roles, S_IRUGO,
+static FC_DEVICE_ATTR(rport, roles, S_IRUGO,
                show_fc_rport_roles, NULL);
 
 fc_private_rport_rd_enum_attr(port_state, FC_PORTSTATE_MAX_NAMELEN);
@@ -893,9 +899,10 @@ fc_private_rport_rd_attr(scsi_target_id, "%d\n", 20);
  * fast_io_fail_tmo attribute
  */
 static ssize_t
-show_fc_rport_fast_io_fail_tmo (struct class_device *cdev, char *buf)
+show_fc_rport_fast_io_fail_tmo (struct device *dev,
+                               struct device_attribute *attr, char *buf)
 {
-       struct fc_rport *rport = transport_class_to_rport(cdev);
+       struct fc_rport *rport = transport_class_to_rport(dev);
 
        if (rport->fast_io_fail_tmo == -1)
                return snprintf(buf, 5, "off\n");
@@ -903,12 +910,13 @@ show_fc_rport_fast_io_fail_tmo (struct class_device *cdev, char *buf)
 }
 
 static ssize_t
-store_fc_rport_fast_io_fail_tmo(struct class_device *cdev, const char *buf,
-                          size_t count)
+store_fc_rport_fast_io_fail_tmo(struct device *dev,
+                               struct device_attribute *attr, const char *buf,
+                               size_t count)
 {
        int val;
        char *cp;
-       struct fc_rport *rport = transport_class_to_rport(cdev);
+       struct fc_rport *rport = transport_class_to_rport(dev);
 
        if ((rport->port_state == FC_PORTSTATE_BLOCKED) ||
            (rport->port_state == FC_PORTSTATE_DELETED) ||
@@ -925,7 +933,7 @@ store_fc_rport_fast_io_fail_tmo(struct class_device *cdev, const char *buf,
        }
        return count;
 }
-static FC_CLASS_DEVICE_ATTR(rport, fast_io_fail_tmo, S_IRUGO | S_IWUSR,
+static FC_DEVICE_ATTR(rport, fast_io_fail_tmo, S_IRUGO | S_IWUSR,
        show_fc_rport_fast_io_fail_tmo, store_fc_rport_fast_io_fail_tmo);
 
 
@@ -941,9 +949,10 @@ static FC_CLASS_DEVICE_ATTR(rport, fast_io_fail_tmo, S_IRUGO | S_IWUSR,
  */
 #define fc_starget_show_function(field, format_string, sz, cast)       \
 static ssize_t                                                         \
-show_fc_starget_##field (struct class_device *cdev, char *buf)         \
+show_fc_starget_##field (struct device *dev,                           \
+                        struct device_attribute *attr, char *buf)      \
 {                                                                      \
-       struct scsi_target *starget = transport_class_to_starget(cdev); \
+       struct scsi_target *starget = transport_class_to_starget(dev);  \
        struct Scsi_Host *shost = dev_to_shost(starget->dev.parent);    \
        struct fc_internal *i = to_fc_internal(shost->transportt);      \
        struct fc_rport *rport = starget_to_rport(starget);             \
@@ -957,16 +966,16 @@ show_fc_starget_##field (struct class_device *cdev, char *buf)            \
 
 #define fc_starget_rd_attr(field, format_string, sz)                   \
        fc_starget_show_function(field, format_string, sz, )            \
-static FC_CLASS_DEVICE_ATTR(starget, field, S_IRUGO,                   \
+static FC_DEVICE_ATTR(starget, field, S_IRUGO,                 \
                         show_fc_starget_##field, NULL)
 
 #define fc_starget_rd_attr_cast(field, format_string, sz, cast)                \
        fc_starget_show_function(field, format_string, sz, (cast))      \
-static FC_CLASS_DEVICE_ATTR(starget, field, S_IRUGO,                   \
+static FC_DEVICE_ATTR(starget, field, S_IRUGO,                 \
                          show_fc_starget_##field, NULL)
 
 #define SETUP_STARGET_ATTRIBUTE_RD(field)                              \
-       i->private_starget_attrs[count] = class_device_attr_starget_##field; \
+       i->private_starget_attrs[count] = device_attr_starget_##field; \
        i->private_starget_attrs[count].attr.mode = S_IRUGO;            \
        i->private_starget_attrs[count].store = NULL;                   \
        i->starget_attrs[count] = &i->private_starget_attrs[count];     \
@@ -974,7 +983,7 @@ static FC_CLASS_DEVICE_ATTR(starget, field, S_IRUGO,                        \
                count++
 
 #define SETUP_STARGET_ATTRIBUTE_RW(field)                              \
-       i->private_starget_attrs[count] = class_device_attr_starget_##field; \
+       i->private_starget_attrs[count] = device_attr_starget_##field; \
        if (!i->f->set_starget_##field) {                               \
                i->private_starget_attrs[count].attr.mode = S_IRUGO;    \
                i->private_starget_attrs[count].store = NULL;           \
@@ -995,9 +1004,10 @@ fc_starget_rd_attr(port_id, "0x%06x\n", 20);
 
 #define fc_vport_show_function(field, format_string, sz, cast)         \
 static ssize_t                                                         \
-show_fc_vport_##field (struct class_device *cdev, char *buf)           \
+show_fc_vport_##field (struct device *dev,                             \
+                      struct device_attribute *attr, char *buf)        \
 {                                                                      \
-       struct fc_vport *vport = transport_class_to_vport(cdev);        \
+       struct fc_vport *vport = transport_class_to_vport(dev);         \
        struct Scsi_Host *shost = vport_to_shost(vport);                \
        struct fc_internal *i = to_fc_internal(shost->transportt);      \
        if ((i->f->get_vport_##field) &&                                \
@@ -1008,11 +1018,12 @@ show_fc_vport_##field (struct class_device *cdev, char *buf)            \
 
 #define fc_vport_store_function(field)                                 \
 static ssize_t                                                         \
-store_fc_vport_##field(struct class_device *cdev, const char *buf,     \
-                          size_t count)                                \
+store_fc_vport_##field(struct device *dev,                             \
+                      struct device_attribute *attr,                   \
+                      const char *buf, size_t count)                   \
 {                                                                      \
        int val;                                                        \
-       struct fc_vport *vport = transport_class_to_vport(cdev);        \
+       struct fc_vport *vport = transport_class_to_vport(dev);         \
        struct Scsi_Host *shost = vport_to_shost(vport);                \
        struct fc_internal *i = to_fc_internal(shost->transportt);      \
        char *cp;                                                       \
@@ -1027,10 +1038,11 @@ store_fc_vport_##field(struct class_device *cdev, const char *buf,      \
 
 #define fc_vport_store_str_function(field, slen)                       \
 static ssize_t                                                         \
-store_fc_vport_##field(struct class_device *cdev, const char *buf,     \
-                          size_t count)                                \
+store_fc_vport_##field(struct device *dev,                             \
+                      struct device_attribute *attr,                   \
+                      const char *buf, size_t count)                   \
 {                                                                      \
-       struct fc_vport *vport = transport_class_to_vport(cdev);        \
+       struct fc_vport *vport = transport_class_to_vport(dev);         \
        struct Scsi_Host *shost = vport_to_shost(vport);                \
        struct fc_internal *i = to_fc_internal(shost->transportt);      \
        unsigned int cnt=count;                                         \
@@ -1047,36 +1059,38 @@ store_fc_vport_##field(struct class_device *cdev, const char *buf,      \
 
 #define fc_vport_rd_attr(field, format_string, sz)                     \
        fc_vport_show_function(field, format_string, sz, )              \
-static FC_CLASS_DEVICE_ATTR(vport, field, S_IRUGO,                     \
+static FC_DEVICE_ATTR(vport, field, S_IRUGO,                   \
                         show_fc_vport_##field, NULL)
 
 #define fc_vport_rd_attr_cast(field, format_string, sz, cast)          \
        fc_vport_show_function(field, format_string, sz, (cast))        \
-static FC_CLASS_DEVICE_ATTR(vport, field, S_IRUGO,                     \
+static FC_DEVICE_ATTR(vport, field, S_IRUGO,                   \
                          show_fc_vport_##field, NULL)
 
 #define fc_vport_rw_attr(field, format_string, sz)                     \
        fc_vport_show_function(field, format_string, sz, )              \
        fc_vport_store_function(field)                                  \
-static FC_CLASS_DEVICE_ATTR(vport, field, S_IRUGO | S_IWUSR,           \
+static FC_DEVICE_ATTR(vport, field, S_IRUGO | S_IWUSR,         \
                        show_fc_vport_##field,                          \
                        store_fc_vport_##field)
 
 #define fc_private_vport_show_function(field, format_string, sz, cast) \
 static ssize_t                                                         \
-show_fc_vport_##field (struct class_device *cdev, char *buf)           \
+show_fc_vport_##field (struct device *dev,                             \
+                      struct device_attribute *attr, char *buf)        \
 {                                                                      \
-       struct fc_vport *vport = transport_class_to_vport(cdev);        \
+       struct fc_vport *vport = transport_class_to_vport(dev);         \
        return snprintf(buf, sz, format_string, cast vport->field);     \
 }
 
 #define fc_private_vport_store_u32_function(field)                     \
 static ssize_t                                                         \
-store_fc_vport_##field(struct class_device *cdev, const char *buf,     \
-                          size_t count)                                \
+store_fc_vport_##field(struct device *dev,                             \
+                      struct device_attribute *attr,                   \
+                      const char *buf, size_t count)                   \
 {                                                                      \
        u32 val;                                                        \
-       struct fc_vport *vport = transport_class_to_vport(cdev);        \
+       struct fc_vport *vport = transport_class_to_vport(dev);         \
        char *cp;                                                       \
        if (vport->flags & (FC_VPORT_DEL | FC_VPORT_CREATING))          \
                return -EBUSY;                                          \
@@ -1090,39 +1104,41 @@ store_fc_vport_##field(struct class_device *cdev, const char *buf,      \
 
 #define fc_private_vport_rd_attr(field, format_string, sz)             \
        fc_private_vport_show_function(field, format_string, sz, )      \
-static FC_CLASS_DEVICE_ATTR(vport, field, S_IRUGO,                     \
+static FC_DEVICE_ATTR(vport, field, S_IRUGO,                   \
                         show_fc_vport_##field, NULL)
 
 #define fc_private_vport_rd_attr_cast(field, format_string, sz, cast)  \
        fc_private_vport_show_function(field, format_string, sz, (cast)) \
-static FC_CLASS_DEVICE_ATTR(vport, field, S_IRUGO,                     \
+static FC_DEVICE_ATTR(vport, field, S_IRUGO,                   \
                          show_fc_vport_##field, NULL)
 
 #define fc_private_vport_rw_u32_attr(field, format_string, sz)         \
        fc_private_vport_show_function(field, format_string, sz, )      \
        fc_private_vport_store_u32_function(field)                      \
-static FC_CLASS_DEVICE_ATTR(vport, field, S_IRUGO | S_IWUSR,           \
+static FC_DEVICE_ATTR(vport, field, S_IRUGO | S_IWUSR,         \
                        show_fc_vport_##field,                          \
                        store_fc_vport_##field)
 
 
 #define fc_private_vport_rd_enum_attr(title, maxlen)                   \
 static ssize_t                                                         \
-show_fc_vport_##title (struct class_device *cdev, char *buf)           \
+show_fc_vport_##title (struct device *dev,                             \
+                      struct device_attribute *attr,                   \
+                      char *buf)                                       \
 {                                                                      \
-       struct fc_vport *vport = transport_class_to_vport(cdev);        \
+       struct fc_vport *vport = transport_class_to_vport(dev);         \
        const char *name;                                               \
        name = get_fc_##title##_name(vport->title);                     \
        if (!name)                                                      \
                return -EINVAL;                                         \
        return snprintf(buf, maxlen, "%s\n", name);                     \
 }                                                                      \
-static FC_CLASS_DEVICE_ATTR(vport, title, S_IRUGO,                     \
+static FC_DEVICE_ATTR(vport, title, S_IRUGO,                   \
                        show_fc_vport_##title, NULL)
 
 
 #define SETUP_VPORT_ATTRIBUTE_RD(field)                                        \
-       i->private_vport_attrs[count] = class_device_attr_vport_##field; \
+       i->private_vport_attrs[count] = device_attr_vport_##field; \
        i->private_vport_attrs[count].attr.mode = S_IRUGO;              \
        i->private_vport_attrs[count].store = NULL;                     \
        i->vport_attrs[count] = &i->private_vport_attrs[count];         \
@@ -1131,21 +1147,21 @@ static FC_CLASS_DEVICE_ATTR(vport, title, S_IRUGO,                      \
        /* NOTE: Above MACRO differs: checks function not show bit */
 
 #define SETUP_PRIVATE_VPORT_ATTRIBUTE_RD(field)                                \
-       i->private_vport_attrs[count] = class_device_attr_vport_##field; \
+       i->private_vport_attrs[count] = device_attr_vport_##field; \
        i->private_vport_attrs[count].attr.mode = S_IRUGO;              \
        i->private_vport_attrs[count].store = NULL;                     \
        i->vport_attrs[count] = &i->private_vport_attrs[count];         \
        count++
 
 #define SETUP_VPORT_ATTRIBUTE_WR(field)                                        \
-       i->private_vport_attrs[count] = class_device_attr_vport_##field; \
+       i->private_vport_attrs[count] = device_attr_vport_##field; \
        i->vport_attrs[count] = &i->private_vport_attrs[count];         \
        if (i->f->field)                                                \
                count++
        /* NOTE: Above MACRO differs: checks function */
 
 #define SETUP_VPORT_ATTRIBUTE_RW(field)                                        \
-       i->private_vport_attrs[count] = class_device_attr_vport_##field; \
+       i->private_vport_attrs[count] = device_attr_vport_##field; \
        if (!i->f->set_vport_##field) {                                 \
                i->private_vport_attrs[count].attr.mode = S_IRUGO;      \
                i->private_vport_attrs[count].store = NULL;             \
@@ -1156,7 +1172,7 @@ static FC_CLASS_DEVICE_ATTR(vport, title, S_IRUGO,                        \
 
 #define SETUP_PRIVATE_VPORT_ATTRIBUTE_RW(field)                                \
 {                                                                      \
-       i->private_vport_attrs[count] = class_device_attr_vport_##field; \
+       i->private_vport_attrs[count] = device_attr_vport_##field; \
        i->vport_attrs[count] = &i->private_vport_attrs[count];         \
        count++;                                                        \
 }
@@ -1176,35 +1192,36 @@ fc_private_vport_rd_attr_cast(node_name, "0x%llx\n", 20, unsigned long long);
 fc_private_vport_rd_attr_cast(port_name, "0x%llx\n", 20, unsigned long long);
 
 static ssize_t
-show_fc_vport_roles (struct class_device *cdev, char *buf)
+show_fc_vport_roles (struct device *dev, struct device_attribute *attr,
+                    char *buf)
 {
-       struct fc_vport *vport = transport_class_to_vport(cdev);
+       struct fc_vport *vport = transport_class_to_vport(dev);
 
        if (vport->roles == FC_PORT_ROLE_UNKNOWN)
                return snprintf(buf, 20, "unknown\n");
        return get_fc_port_roles_names(vport->roles, buf);
 }
-static FC_CLASS_DEVICE_ATTR(vport, roles, S_IRUGO, show_fc_vport_roles, NULL);
+static FC_DEVICE_ATTR(vport, roles, S_IRUGO, show_fc_vport_roles, NULL);
 
 fc_private_vport_rd_enum_attr(vport_type, FC_PORTTYPE_MAX_NAMELEN);
 
 fc_private_vport_show_function(symbolic_name, "%s\n",
                FC_VPORT_SYMBOLIC_NAMELEN + 1, )
 fc_vport_store_str_function(symbolic_name, FC_VPORT_SYMBOLIC_NAMELEN)
-static FC_CLASS_DEVICE_ATTR(vport, symbolic_name, S_IRUGO | S_IWUSR,
+static FC_DEVICE_ATTR(vport, symbolic_name, S_IRUGO | S_IWUSR,
                show_fc_vport_symbolic_name, store_fc_vport_symbolic_name);
 
 static ssize_t
-store_fc_vport_delete(struct class_device *cdev, const char *buf,
-                          size_t count)
+store_fc_vport_delete(struct device *dev, struct device_attribute *attr,
+                     const char *buf, size_t count)
 {
-       struct fc_vport *vport = transport_class_to_vport(cdev);
+       struct fc_vport *vport = transport_class_to_vport(dev);
        struct Scsi_Host *shost = vport_to_shost(vport);
 
        fc_queue_work(shost, &vport->vport_delete_work);
        return count;
 }
-static FC_CLASS_DEVICE_ATTR(vport, vport_delete, S_IWUSR,
+static FC_DEVICE_ATTR(vport, vport_delete, S_IWUSR,
                        NULL, store_fc_vport_delete);
 
 
@@ -1213,10 +1230,11 @@ static FC_CLASS_DEVICE_ATTR(vport, vport_delete, S_IWUSR,
  *  Write "1" to disable, write "0" to enable
  */
 static ssize_t
-store_fc_vport_disable(struct class_device *cdev, const char *buf,
+store_fc_vport_disable(struct device *dev, struct device_attribute *attr,
+                      const char *buf,
                           size_t count)
 {
-       struct fc_vport *vport = transport_class_to_vport(cdev);
+       struct fc_vport *vport = transport_class_to_vport(dev);
        struct Scsi_Host *shost = vport_to_shost(vport);
        struct fc_internal *i = to_fc_internal(shost->transportt);
        int stat;
@@ -1236,7 +1254,7 @@ store_fc_vport_disable(struct class_device *cdev, const char *buf,
        stat = i->f->vport_disable(vport, ((*buf == '0') ? false : true));
        return stat ? stat : count;
 }
-static FC_CLASS_DEVICE_ATTR(vport, vport_disable, S_IWUSR,
+static FC_DEVICE_ATTR(vport, vport_disable, S_IWUSR,
                        NULL, store_fc_vport_disable);
 
 
@@ -1246,9 +1264,10 @@ static FC_CLASS_DEVICE_ATTR(vport, vport_disable, S_IWUSR,
 
 #define fc_host_show_function(field, format_string, sz, cast)          \
 static ssize_t                                                         \
-show_fc_host_##field (struct class_device *cdev, char *buf)            \
+show_fc_host_##field (struct device *dev,                              \
+                     struct device_attribute *attr, char *buf)         \
 {                                                                      \
-       struct Scsi_Host *shost = transport_class_to_shost(cdev);       \
+       struct Scsi_Host *shost = transport_class_to_shost(dev);        \
        struct fc_internal *i = to_fc_internal(shost->transportt);      \
        if (i->f->get_host_##field)                                     \
                i->f->get_host_##field(shost);                          \
@@ -1257,11 +1276,12 @@ show_fc_host_##field (struct class_device *cdev, char *buf)             \
 
 #define fc_host_store_function(field)                                  \
 static ssize_t                                                         \
-store_fc_host_##field(struct class_device *cdev, const char *buf,      \
-                          size_t count)                                \
+store_fc_host_##field(struct device *dev,                              \
+                     struct device_attribute *attr,                    \
+                     const char *buf,  size_t count)                   \
 {                                                                      \
        int val;                                                        \
-       struct Scsi_Host *shost = transport_class_to_shost(cdev);       \
+       struct Scsi_Host *shost = transport_class_to_shost(dev);        \
        struct fc_internal *i = to_fc_internal(shost->transportt);      \
        char *cp;                                                       \
                                                                        \
@@ -1274,10 +1294,11 @@ store_fc_host_##field(struct class_device *cdev, const char *buf,       \
 
 #define fc_host_store_str_function(field, slen)                                \
 static ssize_t                                                         \
-store_fc_host_##field(struct class_device *cdev, const char *buf,      \
-                          size_t count)                                \
+store_fc_host_##field(struct device *dev,                              \
+                     struct device_attribute *attr,                    \
+                     const char *buf, size_t count)                    \
 {                                                                      \
-       struct Scsi_Host *shost = transport_class_to_shost(cdev);       \
+       struct Scsi_Host *shost = transport_class_to_shost(dev);        \
        struct fc_internal *i = to_fc_internal(shost->transportt);      \
        unsigned int cnt=count;                                         \
                                                                        \
@@ -1293,26 +1314,27 @@ store_fc_host_##field(struct class_device *cdev, const char *buf,       \
 
 #define fc_host_rd_attr(field, format_string, sz)                      \
        fc_host_show_function(field, format_string, sz, )               \
-static FC_CLASS_DEVICE_ATTR(host, field, S_IRUGO,                      \
+static FC_DEVICE_ATTR(host, field, S_IRUGO,                    \
                         show_fc_host_##field, NULL)
 
 #define fc_host_rd_attr_cast(field, format_string, sz, cast)           \
        fc_host_show_function(field, format_string, sz, (cast))         \
-static FC_CLASS_DEVICE_ATTR(host, field, S_IRUGO,                      \
+static FC_DEVICE_ATTR(host, field, S_IRUGO,                    \
                          show_fc_host_##field, NULL)
 
 #define fc_host_rw_attr(field, format_string, sz)                      \
        fc_host_show_function(field, format_string, sz, )               \
        fc_host_store_function(field)                                   \
-static FC_CLASS_DEVICE_ATTR(host, field, S_IRUGO | S_IWUSR,            \
+static FC_DEVICE_ATTR(host, field, S_IRUGO | S_IWUSR,          \
                        show_fc_host_##field,                           \
                        store_fc_host_##field)
 
 #define fc_host_rd_enum_attr(title, maxlen)                            \
 static ssize_t                                                         \
-show_fc_host_##title (struct class_device *cdev, char *buf)            \
+show_fc_host_##title (struct device *dev,                              \
+                     struct device_attribute *attr, char *buf)         \
 {                                                                      \
-       struct Scsi_Host *shost = transport_class_to_shost(cdev);       \
+       struct Scsi_Host *shost = transport_class_to_shost(dev);        \
        struct fc_internal *i = to_fc_internal(shost->transportt);      \
        const char *name;                                               \
        if (i->f->get_host_##title)                                     \
@@ -1322,10 +1344,10 @@ show_fc_host_##title (struct class_device *cdev, char *buf)             \
                return -EINVAL;                                         \
        return snprintf(buf, maxlen, "%s\n", name);                     \
 }                                                                      \
-static FC_CLASS_DEVICE_ATTR(host, title, S_IRUGO, show_fc_host_##title, NULL)
+static FC_DEVICE_ATTR(host, title, S_IRUGO, show_fc_host_##title, NULL)
 
 #define SETUP_HOST_ATTRIBUTE_RD(field)                                 \
-       i->private_host_attrs[count] = class_device_attr_host_##field;  \
+       i->private_host_attrs[count] = device_attr_host_##field;        \
        i->private_host_attrs[count].attr.mode = S_IRUGO;               \
        i->private_host_attrs[count].store = NULL;                      \
        i->host_attrs[count] = &i->private_host_attrs[count];           \
@@ -1333,14 +1355,14 @@ static FC_CLASS_DEVICE_ATTR(host, title, S_IRUGO, show_fc_host_##title, NULL)
                count++
 
 #define SETUP_HOST_ATTRIBUTE_RD_NS(field)                              \
-       i->private_host_attrs[count] = class_device_attr_host_##field;  \
+       i->private_host_attrs[count] = device_attr_host_##field;        \
        i->private_host_attrs[count].attr.mode = S_IRUGO;               \
        i->private_host_attrs[count].store = NULL;                      \
        i->host_attrs[count] = &i->private_host_attrs[count];           \
        count++
 
 #define SETUP_HOST_ATTRIBUTE_RW(field)                                 \
-       i->private_host_attrs[count] = class_device_attr_host_##field;  \
+       i->private_host_attrs[count] = device_attr_host_##field;        \
        if (!i->f->set_host_##field) {                                  \
                i->private_host_attrs[count].attr.mode = S_IRUGO;       \
                i->private_host_attrs[count].store = NULL;              \
@@ -1352,24 +1374,25 @@ static FC_CLASS_DEVICE_ATTR(host, title, S_IRUGO, show_fc_host_##title, NULL)
 
 #define fc_private_host_show_function(field, format_string, sz, cast)  \
 static ssize_t                                                         \
-show_fc_host_##field (struct class_device *cdev, char *buf)            \
+show_fc_host_##field (struct device *dev,                              \
+                     struct device_attribute *attr, char *buf)         \
 {                                                                      \
-       struct Scsi_Host *shost = transport_class_to_shost(cdev);       \
+       struct Scsi_Host *shost = transport_class_to_shost(dev);        \
        return snprintf(buf, sz, format_string, cast fc_host_##field(shost)); \
 }
 
 #define fc_private_host_rd_attr(field, format_string, sz)              \
        fc_private_host_show_function(field, format_string, sz, )       \
-static FC_CLASS_DEVICE_ATTR(host, field, S_IRUGO,                      \
+static FC_DEVICE_ATTR(host, field, S_IRUGO,                    \
                         show_fc_host_##field, NULL)
 
 #define fc_private_host_rd_attr_cast(field, format_string, sz, cast)   \
        fc_private_host_show_function(field, format_string, sz, (cast)) \
-static FC_CLASS_DEVICE_ATTR(host, field, S_IRUGO,                      \
+static FC_DEVICE_ATTR(host, field, S_IRUGO,                    \
                          show_fc_host_##field, NULL)
 
 #define SETUP_PRIVATE_HOST_ATTRIBUTE_RD(field)                 \
-       i->private_host_attrs[count] = class_device_attr_host_##field;  \
+       i->private_host_attrs[count] = device_attr_host_##field;        \
        i->private_host_attrs[count].attr.mode = S_IRUGO;               \
        i->private_host_attrs[count].store = NULL;                      \
        i->host_attrs[count] = &i->private_host_attrs[count];           \
@@ -1377,7 +1400,7 @@ static FC_CLASS_DEVICE_ATTR(host, field, S_IRUGO,                 \
 
 #define SETUP_PRIVATE_HOST_ATTRIBUTE_RW(field)                 \
 {                                                                      \
-       i->private_host_attrs[count] = class_device_attr_host_##field;  \
+       i->private_host_attrs[count] = device_attr_host_##field;        \
        i->host_attrs[count] = &i->private_host_attrs[count];           \
        count++;                                                        \
 }
@@ -1386,38 +1409,41 @@ static FC_CLASS_DEVICE_ATTR(host, field, S_IRUGO,                       \
 /* Fixed Host Attributes */
 
 static ssize_t
-show_fc_host_supported_classes (struct class_device *cdev, char *buf)
+show_fc_host_supported_classes (struct device *dev,
+                               struct device_attribute *attr, char *buf)
 {
-       struct Scsi_Host *shost = transport_class_to_shost(cdev);
+       struct Scsi_Host *shost = transport_class_to_shost(dev);
 
        if (fc_host_supported_classes(shost) == FC_COS_UNSPECIFIED)
                return snprintf(buf, 20, "unspecified\n");
 
        return get_fc_cos_names(fc_host_supported_classes(shost), buf);
 }
-static FC_CLASS_DEVICE_ATTR(host, supported_classes, S_IRUGO,
+static FC_DEVICE_ATTR(host, supported_classes, S_IRUGO,
                show_fc_host_supported_classes, NULL);
 
 static ssize_t
-show_fc_host_supported_fc4s (struct class_device *cdev, char *buf)
+show_fc_host_supported_fc4s (struct device *dev,
+                            struct device_attribute *attr, char *buf)
 {
-       struct Scsi_Host *shost = transport_class_to_shost(cdev);
+       struct Scsi_Host *shost = transport_class_to_shost(dev);
        return (ssize_t)show_fc_fc4s(buf, fc_host_supported_fc4s(shost));
 }
-static FC_CLASS_DEVICE_ATTR(host, supported_fc4s, S_IRUGO,
+static FC_DEVICE_ATTR(host, supported_fc4s, S_IRUGO,
                show_fc_host_supported_fc4s, NULL);
 
 static ssize_t
-show_fc_host_supported_speeds (struct class_device *cdev, char *buf)
+show_fc_host_supported_speeds (struct device *dev,
+                              struct device_attribute *attr, char *buf)
 {
-       struct Scsi_Host *shost = transport_class_to_shost(cdev);
+       struct Scsi_Host *shost = transport_class_to_shost(dev);
 
        if (fc_host_supported_speeds(shost) == FC_PORTSPEED_UNKNOWN)
                return snprintf(buf, 20, "unknown\n");
 
        return get_fc_port_speed_names(fc_host_supported_speeds(shost), buf);
 }
-static FC_CLASS_DEVICE_ATTR(host, supported_speeds, S_IRUGO,
+static FC_DEVICE_ATTR(host, supported_speeds, S_IRUGO,
                show_fc_host_supported_speeds, NULL);
 
 
@@ -1433,9 +1459,10 @@ fc_private_host_rd_attr(serial_number, "%s\n", (FC_SERIAL_NUMBER_SIZE +1));
 /* Dynamic Host Attributes */
 
 static ssize_t
-show_fc_host_active_fc4s (struct class_device *cdev, char *buf)
+show_fc_host_active_fc4s (struct device *dev,
+                         struct device_attribute *attr, char *buf)
 {
-       struct Scsi_Host *shost = transport_class_to_shost(cdev);
+       struct Scsi_Host *shost = transport_class_to_shost(dev);
        struct fc_internal *i = to_fc_internal(shost->transportt);
 
        if (i->f->get_host_active_fc4s)
@@ -1443,13 +1470,14 @@ show_fc_host_active_fc4s (struct class_device *cdev, char *buf)
 
        return (ssize_t)show_fc_fc4s(buf, fc_host_active_fc4s(shost));
 }
-static FC_CLASS_DEVICE_ATTR(host, active_fc4s, S_IRUGO,
+static FC_DEVICE_ATTR(host, active_fc4s, S_IRUGO,
                show_fc_host_active_fc4s, NULL);
 
 static ssize_t
-show_fc_host_speed (struct class_device *cdev, char *buf)
+show_fc_host_speed (struct device *dev,
+                   struct device_attribute *attr, char *buf)
 {
-       struct Scsi_Host *shost = transport_class_to_shost(cdev);
+       struct Scsi_Host *shost = transport_class_to_shost(dev);
        struct fc_internal *i = to_fc_internal(shost->transportt);
 
        if (i->f->get_host_speed)
@@ -1460,7 +1488,7 @@ show_fc_host_speed (struct class_device *cdev, char *buf)
 
        return get_fc_port_speed_names(fc_host_speed(shost), buf);
 }
-static FC_CLASS_DEVICE_ATTR(host, speed, S_IRUGO,
+static FC_DEVICE_ATTR(host, speed, S_IRUGO,
                show_fc_host_speed, NULL);
 
 
@@ -1473,16 +1501,17 @@ fc_host_rd_attr(symbolic_name, "%s\n", FC_SYMBOLIC_NAME_SIZE + 1);
 fc_private_host_show_function(system_hostname, "%s\n",
                FC_SYMBOLIC_NAME_SIZE + 1, )
 fc_host_store_str_function(system_hostname, FC_SYMBOLIC_NAME_SIZE)
-static FC_CLASS_DEVICE_ATTR(host, system_hostname, S_IRUGO | S_IWUSR,
+static FC_DEVICE_ATTR(host, system_hostname, S_IRUGO | S_IWUSR,
                show_fc_host_system_hostname, store_fc_host_system_hostname);
 
 
 /* Private Host Attributes */
 
 static ssize_t
-show_fc_private_host_tgtid_bind_type(struct class_device *cdev, char *buf)
+show_fc_private_host_tgtid_bind_type(struct device *dev,
+                                    struct device_attribute *attr, char *buf)
 {
-       struct Scsi_Host *shost = transport_class_to_shost(cdev);
+       struct Scsi_Host *shost = transport_class_to_shost(dev);
        const char *name;
 
        name = get_fc_tgtid_bind_type_name(fc_host_tgtid_bind_type(shost));
@@ -1495,10 +1524,10 @@ show_fc_private_host_tgtid_bind_type(struct class_device *cdev, char *buf)
        pos = list_entry((head)->next, typeof(*pos), member)
 
 static ssize_t
-store_fc_private_host_tgtid_bind_type(struct class_device *cdev,
-       const char *buf, size_t count)
+store_fc_private_host_tgtid_bind_type(struct device *dev,
+       struct device_attribute *attr, const char *buf, size_t count)
 {
-       struct Scsi_Host *shost = transport_class_to_shost(cdev);
+       struct Scsi_Host *shost = transport_class_to_shost(dev);
        struct fc_rport *rport;
        enum fc_tgtid_binding_type val;
        unsigned long flags;
@@ -1523,15 +1552,15 @@ store_fc_private_host_tgtid_bind_type(struct class_device *cdev,
        return count;
 }
 
-static FC_CLASS_DEVICE_ATTR(host, tgtid_bind_type, S_IRUGO | S_IWUSR,
+static FC_DEVICE_ATTR(host, tgtid_bind_type, S_IRUGO | S_IWUSR,
                        show_fc_private_host_tgtid_bind_type,
                        store_fc_private_host_tgtid_bind_type);
 
 static ssize_t
-store_fc_private_host_issue_lip(struct class_device *cdev,
-       const char *buf, size_t count)
+store_fc_private_host_issue_lip(struct device *dev,
+       struct device_attribute *attr, const char *buf, size_t count)
 {
-       struct Scsi_Host *shost = transport_class_to_shost(cdev);
+       struct Scsi_Host *shost = transport_class_to_shost(dev);
        struct fc_internal *i = to_fc_internal(shost->transportt);
        int ret;
 
@@ -1544,7 +1573,7 @@ store_fc_private_host_issue_lip(struct class_device *cdev,
        return -ENOENT;
 }
 
-static FC_CLASS_DEVICE_ATTR(host, issue_lip, S_IWUSR, NULL,
+static FC_DEVICE_ATTR(host, issue_lip, S_IWUSR, NULL,
                        store_fc_private_host_issue_lip);
 
 fc_private_host_rd_attr(npiv_vports_inuse, "%u\n", 20);
@@ -1556,9 +1585,9 @@ fc_private_host_rd_attr(npiv_vports_inuse, "%u\n", 20);
 
 /* Show a given an attribute in the statistics group */
 static ssize_t
-fc_stat_show(const struct class_device *cdev, char *buf, unsigned long offset)
+fc_stat_show(const struct device *dev, char *buf, unsigned long offset)
 {
-       struct Scsi_Host *shost = transport_class_to_shost(cdev);
+       struct Scsi_Host *shost = transport_class_to_shost(dev);
        struct fc_internal *i = to_fc_internal(shost->transportt);
        struct fc_host_statistics *stats;
        ssize_t ret = -ENOENT;
@@ -1579,12 +1608,14 @@ fc_stat_show(const struct class_device *cdev, char *buf, unsigned long offset)
 
 /* generate a read-only statistics attribute */
 #define fc_host_statistic(name)                                                \
-static ssize_t show_fcstat_##name(struct class_device *cd, char *buf)  \
+static ssize_t show_fcstat_##name(struct device *cd,                   \
+                                 struct device_attribute *attr,        \
+                                 char *buf)                            \
 {                                                                      \
        return fc_stat_show(cd, buf,                                    \
                            offsetof(struct fc_host_statistics, name)); \
 }                                                                      \
-static FC_CLASS_DEVICE_ATTR(host, name, S_IRUGO, show_fcstat_##name, NULL)
+static FC_DEVICE_ATTR(host, name, S_IRUGO, show_fcstat_##name, NULL)
 
 fc_host_statistic(seconds_since_last_reset);
 fc_host_statistic(tx_frames);
@@ -1608,10 +1639,10 @@ fc_host_statistic(fcp_input_megabytes);
 fc_host_statistic(fcp_output_megabytes);
 
 static ssize_t
-fc_reset_statistics(struct class_device *cdev, const char *buf,
-                          size_t count)
+fc_reset_statistics(struct device *dev, struct device_attribute *attr,
+                   const char *buf, size_t count)
 {
-       struct Scsi_Host *shost = transport_class_to_shost(cdev);
+       struct Scsi_Host *shost = transport_class_to_shost(dev);
        struct fc_internal *i = to_fc_internal(shost->transportt);
 
        /* ignore any data value written to the attribute */
@@ -1622,31 +1653,31 @@ fc_reset_statistics(struct class_device *cdev, const char *buf,
 
        return -ENOENT;
 }
-static FC_CLASS_DEVICE_ATTR(host, reset_statistics, S_IWUSR, NULL,
+static FC_DEVICE_ATTR(host, reset_statistics, S_IWUSR, NULL,
                                fc_reset_statistics);
 
 static struct attribute *fc_statistics_attrs[] = {
-       &class_device_attr_host_seconds_since_last_reset.attr,
-       &class_device_attr_host_tx_frames.attr,
-       &class_device_attr_host_tx_words.attr,
-       &class_device_attr_host_rx_frames.attr,
-       &class_device_attr_host_rx_words.attr,
-       &class_device_attr_host_lip_count.attr,
-       &class_device_attr_host_nos_count.attr,
-       &class_device_attr_host_error_frames.attr,
-       &class_device_attr_host_dumped_frames.attr,
-       &class_device_attr_host_link_failure_count.attr,
-       &class_device_attr_host_loss_of_sync_count.attr,
-       &class_device_attr_host_loss_of_signal_count.attr,
-       &class_device_attr_host_prim_seq_protocol_err_count.attr,
-       &class_device_attr_host_invalid_tx_word_count.attr,
-       &class_device_attr_host_invalid_crc_count.attr,
-       &class_device_attr_host_fcp_input_requests.attr,
-       &class_device_attr_host_fcp_output_requests.attr,
-       &class_device_attr_host_fcp_control_requests.attr,
-       &class_device_attr_host_fcp_input_megabytes.attr,
-       &class_device_attr_host_fcp_output_megabytes.attr,
-       &class_device_attr_host_reset_statistics.attr,
+       &device_attr_host_seconds_since_last_reset.attr,
+       &device_attr_host_tx_frames.attr,
+       &device_attr_host_tx_words.attr,
+       &device_attr_host_rx_frames.attr,
+       &device_attr_host_rx_words.attr,
+       &device_attr_host_lip_count.attr,
+       &device_attr_host_nos_count.attr,
+       &device_attr_host_error_frames.attr,
+       &device_attr_host_dumped_frames.attr,
+       &device_attr_host_link_failure_count.attr,
+       &device_attr_host_loss_of_sync_count.attr,
+       &device_attr_host_loss_of_signal_count.attr,
+       &device_attr_host_prim_seq_protocol_err_count.attr,
+       &device_attr_host_invalid_tx_word_count.attr,
+       &device_attr_host_invalid_crc_count.attr,
+       &device_attr_host_fcp_input_requests.attr,
+       &device_attr_host_fcp_output_requests.attr,
+       &device_attr_host_fcp_control_requests.attr,
+       &device_attr_host_fcp_input_megabytes.attr,
+       &device_attr_host_fcp_output_megabytes.attr,
+       &device_attr_host_reset_statistics.attr,
        NULL
 };
 
@@ -1695,10 +1726,10 @@ fc_parse_wwn(const char *ns, u64 *nm)
  * as hex characters, and may *not* contain any prefixes (e.g. 0x, x, etc)
  */
 static ssize_t
-store_fc_host_vport_create(struct class_device *cdev, const char *buf,
-                          size_t count)
+store_fc_host_vport_create(struct device *dev, struct device_attribute *attr,
+                          const char *buf, size_t count)
 {
-       struct Scsi_Host *shost = transport_class_to_shost(cdev);
+       struct Scsi_Host *shost = transport_class_to_shost(dev);
        struct fc_vport_identifiers vid;
        struct fc_vport *vport;
        unsigned int cnt=count;
@@ -1731,7 +1762,7 @@ store_fc_host_vport_create(struct class_device *cdev, const char *buf,
        stat = fc_vport_create(shost, 0, &shost->shost_gendev, &vid, &vport);
        return stat ? stat : count;
 }
-static FC_CLASS_DEVICE_ATTR(host, vport_create, S_IWUSR, NULL,
+static FC_DEVICE_ATTR(host, vport_create, S_IWUSR, NULL,
                        store_fc_host_vport_create);
 
 
@@ -1742,10 +1773,10 @@ static FC_CLASS_DEVICE_ATTR(host, vport_create, S_IWUSR, NULL,
  * any prefixes (e.g. 0x, x, etc)
  */
 static ssize_t
-store_fc_host_vport_delete(struct class_device *cdev, const char *buf,
-                          size_t count)
+store_fc_host_vport_delete(struct device *dev, struct device_attribute *attr,
+                          const char *buf, size_t count)
 {
-       struct Scsi_Host *shost = transport_class_to_shost(cdev);
+       struct Scsi_Host *shost = transport_class_to_shost(dev);
        struct fc_host_attrs *fc_host = shost_to_fc_host(shost);
        struct fc_vport *vport;
        u64 wwpn, wwnn;
@@ -1787,7 +1818,7 @@ store_fc_host_vport_delete(struct class_device *cdev, const char *buf,
        stat = fc_vport_terminate(vport);
        return stat ? stat : count;
 }
-static FC_CLASS_DEVICE_ATTR(host, vport_delete, S_IWUSR, NULL,
+static FC_DEVICE_ATTR(host, vport_delete, S_IWUSR, NULL,
                        store_fc_host_vport_delete);
 
 
index ca7bb6f63bdeb6bcee801e8588b5d339c47a6f57..65d1737eb664663735e1090133fcfd41a76824ce 100644 (file)
@@ -40,13 +40,13 @@ struct iscsi_internal {
        struct scsi_transport_template t;
        struct iscsi_transport *iscsi_transport;
        struct list_head list;
-       struct class_device cdev;
+       struct device dev;
 
-       struct class_device_attribute *host_attrs[ISCSI_HOST_ATTRS + 1];
+       struct device_attribute *host_attrs[ISCSI_HOST_ATTRS + 1];
        struct transport_container conn_cont;
-       struct class_device_attribute *conn_attrs[ISCSI_CONN_ATTRS + 1];
+       struct device_attribute *conn_attrs[ISCSI_CONN_ATTRS + 1];
        struct transport_container session_cont;
-       struct class_device_attribute *session_attrs[ISCSI_SESSION_ATTRS + 1];
+       struct device_attribute *session_attrs[ISCSI_SESSION_ATTRS + 1];
 };
 
 static atomic_t iscsi_session_nr; /* sysfs session id for next new session */
@@ -63,12 +63,12 @@ static DEFINE_SPINLOCK(iscsi_transport_lock);
 #define to_iscsi_internal(tmpl) \
        container_of(tmpl, struct iscsi_internal, t)
 
-#define cdev_to_iscsi_internal(_cdev) \
-       container_of(_cdev, struct iscsi_internal, cdev)
+#define dev_to_iscsi_internal(_dev) \
+       container_of(_dev, struct iscsi_internal, dev)
 
-static void iscsi_transport_release(struct class_device *cdev)
+static void iscsi_transport_release(struct device *dev)
 {
-       struct iscsi_internal *priv = cdev_to_iscsi_internal(cdev);
+       struct iscsi_internal *priv = dev_to_iscsi_internal(dev);
        kfree(priv);
 }
 
@@ -78,25 +78,27 @@ static void iscsi_transport_release(struct class_device *cdev)
  */
 static struct class iscsi_transport_class = {
        .name = "iscsi_transport",
-       .release = iscsi_transport_release,
+       .dev_release = iscsi_transport_release,
 };
 
 static ssize_t
-show_transport_handle(struct class_device *cdev, char *buf)
+show_transport_handle(struct device *dev, struct device_attribute *attr,
+                     char *buf)
 {
-       struct iscsi_internal *priv = cdev_to_iscsi_internal(cdev);
+       struct iscsi_internal *priv = dev_to_iscsi_internal(dev);
        return sprintf(buf, "%llu\n", (unsigned long long)iscsi_handle(priv->iscsi_transport));
 }
-static CLASS_DEVICE_ATTR(handle, S_IRUGO, show_transport_handle, NULL);
+static DEVICE_ATTR(handle, S_IRUGO, show_transport_handle, NULL);
 
 #define show_transport_attr(name, format)                              \
 static ssize_t                                                         \
-show_transport_##name(struct class_device *cdev, char *buf)            \
+show_transport_##name(struct device *dev,                              \
+                     struct device_attribute *attr,char *buf)          \
 {                                                                      \
-       struct iscsi_internal *priv = cdev_to_iscsi_internal(cdev);     \
+       struct iscsi_internal *priv = dev_to_iscsi_internal(dev);       \
        return sprintf(buf, format"\n", priv->iscsi_transport->name);   \
 }                                                                      \
-static CLASS_DEVICE_ATTR(name, S_IRUGO, show_transport_##name, NULL);
+static DEVICE_ATTR(name, S_IRUGO, show_transport_##name, NULL);
 
 show_transport_attr(caps, "0x%x");
 show_transport_attr(max_lun, "%d");
@@ -104,11 +106,11 @@ show_transport_attr(max_conn, "%d");
 show_transport_attr(max_cmd_len, "%d");
 
 static struct attribute *iscsi_transport_attrs[] = {
-       &class_device_attr_handle.attr,
-       &class_device_attr_caps.attr,
-       &class_device_attr_max_lun.attr,
-       &class_device_attr_max_conn.attr,
-       &class_device_attr_max_cmd_len.attr,
+       &dev_attr_handle.attr,
+       &dev_attr_caps.attr,
+       &dev_attr_max_lun.attr,
+       &dev_attr_max_conn.attr,
+       &dev_attr_max_cmd_len.attr,
        NULL,
 };
 
@@ -119,7 +121,7 @@ static struct attribute_group iscsi_transport_group = {
 
 
 static int iscsi_setup_host(struct transport_container *tc, struct device *dev,
-                           struct class_device *cdev)
+                           struct device *cdev)
 {
        struct Scsi_Host *shost = dev_to_shost(dev);
        struct iscsi_host *ihost = shost->shost_data;
@@ -139,7 +141,7 @@ static int iscsi_setup_host(struct transport_container *tc, struct device *dev,
 }
 
 static int iscsi_remove_host(struct transport_container *tc, struct device *dev,
-                            struct class_device *cdev)
+                            struct device *cdev)
 {
        struct Scsi_Host *shost = dev_to_shost(dev);
        struct iscsi_host *ihost = shost->shost_data;
@@ -1337,11 +1339,8 @@ iscsi_if_rx(struct sk_buff *skb)
        mutex_unlock(&rx_queue_mutex);
 }
 
-#define iscsi_cdev_to_conn(_cdev) \
-       iscsi_dev_to_conn(_cdev->dev)
-
 #define ISCSI_CLASS_ATTR(_prefix,_name,_mode,_show,_store)             \
-struct class_device_attribute class_device_attr_##_prefix##_##_name =  \
+struct device_attribute dev_attr_##_prefix##_##_name = \
        __ATTR(_name,_mode,_show,_store)
 
 /*
@@ -1349,9 +1348,10 @@ struct class_device_attribute class_device_attr_##_prefix##_##_name =    \
  */
 #define iscsi_conn_attr_show(param)                                    \
 static ssize_t                                                         \
-show_conn_param_##param(struct class_device *cdev, char *buf)          \
+show_conn_param_##param(struct device *dev,                            \
+                       struct device_attribute *attr, char *buf)       \
 {                                                                      \
-       struct iscsi_cls_conn *conn = iscsi_cdev_to_conn(cdev);         \
+       struct iscsi_cls_conn *conn = iscsi_dev_to_conn(dev->parent);   \
        struct iscsi_transport *t = conn->transport;                    \
        return t->get_conn_param(conn, param, buf);                     \
 }
@@ -1375,17 +1375,16 @@ iscsi_conn_attr(address, ISCSI_PARAM_CONN_ADDRESS);
 iscsi_conn_attr(ping_tmo, ISCSI_PARAM_PING_TMO);
 iscsi_conn_attr(recv_tmo, ISCSI_PARAM_RECV_TMO);
 
-#define iscsi_cdev_to_session(_cdev) \
-       iscsi_dev_to_session(_cdev->dev)
-
 /*
  * iSCSI session attrs
  */
 #define iscsi_session_attr_show(param, perm)                           \
 static ssize_t                                                         \
-show_session_param_##param(struct class_device *cdev, char *buf)       \
+show_session_param_##param(struct device *dev,                         \
+                          struct device_attribute *attr, char *buf)    \
 {                                                                      \
-       struct iscsi_cls_session *session = iscsi_cdev_to_session(cdev); \
+       struct iscsi_cls_session *session =                             \
+               iscsi_dev_to_session(dev->parent);                      \
        struct iscsi_transport *t = session->transport;                 \
                                                                        \
        if (perm && !capable(CAP_SYS_ADMIN))                            \
@@ -1417,9 +1416,10 @@ iscsi_session_attr(abort_tmo, ISCSI_PARAM_ABORT_TMO, 0);
 iscsi_session_attr(lu_reset_tmo, ISCSI_PARAM_LU_RESET_TMO, 0);
 
 static ssize_t
-show_priv_session_state(struct class_device *cdev, char *buf)
+show_priv_session_state(struct device *dev, struct device_attribute *attr,
+                       char *buf)
 {
-       struct iscsi_cls_session *session = iscsi_cdev_to_session(cdev);
+       struct iscsi_cls_session *session = iscsi_dev_to_session(dev->parent);
        return sprintf(buf, "%s\n", iscsi_session_state_name(session->state));
 }
 static ISCSI_CLASS_ATTR(priv_sess, state, S_IRUGO, show_priv_session_state,
@@ -1427,9 +1427,11 @@ static ISCSI_CLASS_ATTR(priv_sess, state, S_IRUGO, show_priv_session_state,
 
 #define iscsi_priv_session_attr_show(field, format)                    \
 static ssize_t                                                         \
-show_priv_session_##field(struct class_device *cdev, char *buf)                \
+show_priv_session_##field(struct device *dev,                          \
+                         struct device_attribute *attr, char *buf)     \
 {                                                                      \
-       struct iscsi_cls_session *session = iscsi_cdev_to_session(cdev);\
+       struct iscsi_cls_session *session =                             \
+                       iscsi_dev_to_session(dev->parent);              \
        return sprintf(buf, format"\n", session->field);                \
 }
 
@@ -1444,9 +1446,10 @@ iscsi_priv_session_attr(recovery_tmo, "%d");
  */
 #define iscsi_host_attr_show(param)                                    \
 static ssize_t                                                         \
-show_host_param_##param(struct class_device *cdev, char *buf)          \
+show_host_param_##param(struct device *dev,                            \
+                       struct device_attribute *attr, char *buf)       \
 {                                                                      \
-       struct Scsi_Host *shost = transport_class_to_shost(cdev);       \
+       struct Scsi_Host *shost = transport_class_to_shost(dev);        \
        struct iscsi_internal *priv = to_iscsi_internal(shost->transportt); \
        return priv->iscsi_transport->get_host_param(shost, param, buf); \
 }
@@ -1463,7 +1466,7 @@ iscsi_host_attr(initiatorname, ISCSI_HOST_PARAM_INITIATOR_NAME);
 
 #define SETUP_PRIV_SESSION_RD_ATTR(field)                              \
 do {                                                                   \
-       priv->session_attrs[count] = &class_device_attr_priv_sess_##field; \
+       priv->session_attrs[count] = &dev_attr_priv_sess_##field; \
        count++;                                                        \
 } while (0)
 
@@ -1471,7 +1474,7 @@ do {                                                                      \
 #define SETUP_SESSION_RD_ATTR(field, param_flag)                       \
 do {                                                                   \
        if (tt->param_mask & param_flag) {                              \
-               priv->session_attrs[count] = &class_device_attr_sess_##field; \
+               priv->session_attrs[count] = &dev_attr_sess_##field; \
                count++;                                                \
        }                                                               \
 } while (0)
@@ -1479,7 +1482,7 @@ do {                                                                      \
 #define SETUP_CONN_RD_ATTR(field, param_flag)                          \
 do {                                                                   \
        if (tt->param_mask & param_flag) {                              \
-               priv->conn_attrs[count] = &class_device_attr_conn_##field; \
+               priv->conn_attrs[count] = &dev_attr_conn_##field; \
                count++;                                                \
        }                                                               \
 } while (0)
@@ -1487,7 +1490,7 @@ do {                                                                      \
 #define SETUP_HOST_RD_ATTR(field, param_flag)                          \
 do {                                                                   \
        if (tt->host_param_mask & param_flag) {                         \
-               priv->host_attrs[count] = &class_device_attr_host_##field; \
+               priv->host_attrs[count] = &dev_attr_host_##field; \
                count++;                                                \
        }                                                               \
 } while (0)
@@ -1578,15 +1581,15 @@ iscsi_register_transport(struct iscsi_transport *tt)
        priv->iscsi_transport = tt;
        priv->t.user_scan = iscsi_user_scan;
 
-       priv->cdev.class = &iscsi_transport_class;
-       snprintf(priv->cdev.class_id, BUS_ID_SIZE, "%s", tt->name);
-       err = class_device_register(&priv->cdev);
+       priv->dev.class = &iscsi_transport_class;
+       snprintf(priv->dev.bus_id, BUS_ID_SIZE, "%s", tt->name);
+       err = device_register(&priv->dev);
        if (err)
                goto free_priv;
 
-       err = sysfs_create_group(&priv->cdev.kobj, &iscsi_transport_group);
+       err = sysfs_create_group(&priv->dev.kobj, &iscsi_transport_group);
        if (err)
-               goto unregister_cdev;
+               goto unregister_dev;
 
        /* host parameters */
        priv->t.host_attrs.ac.attrs = &priv->host_attrs[0];
@@ -1663,8 +1666,8 @@ iscsi_register_transport(struct iscsi_transport *tt)
        printk(KERN_NOTICE "iscsi: registered transport (%s)\n", tt->name);
        return &priv->t;
 
-unregister_cdev:
-       class_device_unregister(&priv->cdev);
+unregister_dev:
+       device_unregister(&priv->dev);
 free_priv:
        kfree(priv);
        return NULL;
@@ -1691,8 +1694,8 @@ int iscsi_unregister_transport(struct iscsi_transport *tt)
        transport_container_unregister(&priv->session_cont);
        transport_container_unregister(&priv->t.host_attrs);
 
-       sysfs_remove_group(&priv->cdev.kobj, &iscsi_transport_group);
-       class_device_unregister(&priv->cdev);
+       sysfs_remove_group(&priv->dev.kobj, &iscsi_transport_group);
+       device_unregister(&priv->dev);
        mutex_unlock(&rx_queue_mutex);
 
        return 0;
index 43a964d635b4e19b30d5d76c4dafcc090e8a5a14..27ec625ab7719a2cdf59931ed1ecb6ce77431de5 100644 (file)
@@ -53,8 +53,8 @@ struct sas_host_attrs {
 /*
  * Hack to allow attributes of the same name in different objects.
  */
-#define SAS_CLASS_DEVICE_ATTR(_prefix,_name,_mode,_show,_store) \
-       struct class_device_attribute class_device_attr_##_prefix##_##_name = \
+#define SAS_DEVICE_ATTR(_prefix,_name,_mode,_show,_store) \
+       struct device_attribute dev_attr_##_prefix##_##_name = \
        __ATTR(_name,_mode,_show,_store)
 
 
@@ -261,7 +261,7 @@ static void sas_bsg_remove(struct Scsi_Host *shost, struct sas_rphy *rphy)
  */
 
 static int sas_host_setup(struct transport_container *tc, struct device *dev,
-                         struct class_device *cdev)
+                         struct device *cdev)
 {
        struct Scsi_Host *shost = dev_to_shost(dev);
        struct sas_host_attrs *sas_host = to_sas_host_attrs(shost);
@@ -280,7 +280,7 @@ static int sas_host_setup(struct transport_container *tc, struct device *dev,
 }
 
 static int sas_host_remove(struct transport_container *tc, struct device *dev,
-                          struct class_device *cdev)
+                          struct device *cdev)
 {
        struct Scsi_Host *shost = dev_to_shost(dev);
 
@@ -356,22 +356,24 @@ EXPORT_SYMBOL(sas_remove_host);
 
 #define sas_phy_show_simple(field, name, format_string, cast)          \
 static ssize_t                                                         \
-show_sas_phy_##name(struct class_device *cdev, char *buf)              \
+show_sas_phy_##name(struct device *dev,                                \
+                   struct device_attribute *attr, char *buf)           \
 {                                                                      \
-       struct sas_phy *phy = transport_class_to_phy(cdev);             \
+       struct sas_phy *phy = transport_class_to_phy(dev);              \
                                                                        \
        return snprintf(buf, 20, format_string, cast phy->field);       \
 }
 
 #define sas_phy_simple_attr(field, name, format_string, type)          \
        sas_phy_show_simple(field, name, format_string, (type)) \
-static CLASS_DEVICE_ATTR(name, S_IRUGO, show_sas_phy_##name, NULL)
+static DEVICE_ATTR(name, S_IRUGO, show_sas_phy_##name, NULL)
 
 #define sas_phy_show_protocol(field, name)                             \
 static ssize_t                                                         \
-show_sas_phy_##name(struct class_device *cdev, char *buf)              \
+show_sas_phy_##name(struct device *dev,                                \
+                   struct device_attribute *attr, char *buf)           \
 {                                                                      \
-       struct sas_phy *phy = transport_class_to_phy(cdev);             \
+       struct sas_phy *phy = transport_class_to_phy(dev);              \
                                                                        \
        if (!phy->field)                                                \
                return snprintf(buf, 20, "none\n");                     \
@@ -380,13 +382,14 @@ show_sas_phy_##name(struct class_device *cdev, char *buf)         \
 
 #define sas_phy_protocol_attr(field, name)                             \
        sas_phy_show_protocol(field, name)                              \
-static CLASS_DEVICE_ATTR(name, S_IRUGO, show_sas_phy_##name, NULL)
+static DEVICE_ATTR(name, S_IRUGO, show_sas_phy_##name, NULL)
 
 #define sas_phy_show_linkspeed(field)                                  \
 static ssize_t                                                         \
-show_sas_phy_##field(struct class_device *cdev, char *buf)             \
+show_sas_phy_##field(struct device *dev,                               \
+                    struct device_attribute *attr, char *buf)          \
 {                                                                      \
-       struct sas_phy *phy = transport_class_to_phy(cdev);             \
+       struct sas_phy *phy = transport_class_to_phy(dev);              \
                                                                        \
        return get_sas_linkspeed_names(phy->field, buf);                \
 }
@@ -394,10 +397,11 @@ show_sas_phy_##field(struct class_device *cdev, char *buf)                \
 /* Fudge to tell if we're minimum or maximum */
 #define sas_phy_store_linkspeed(field)                                 \
 static ssize_t                                                         \
-store_sas_phy_##field(struct class_device *cdev, const char *buf,      \
-                     size_t count)                                     \
+store_sas_phy_##field(struct device *dev,                              \
+                     struct device_attribute *attr,                    \
+                     const char *buf,  size_t count)                   \
 {                                                                      \
-       struct sas_phy *phy = transport_class_to_phy(cdev);             \
+       struct sas_phy *phy = transport_class_to_phy(dev);              \
        struct Scsi_Host *shost = dev_to_shost(phy->dev.parent);        \
        struct sas_internal *i = to_sas_internal(shost->transportt);    \
        u32 value;                                                      \
@@ -416,19 +420,20 @@ store_sas_phy_##field(struct class_device *cdev, const char *buf, \
 #define sas_phy_linkspeed_rw_attr(field)                               \
        sas_phy_show_linkspeed(field)                                   \
        sas_phy_store_linkspeed(field)                                  \
-static CLASS_DEVICE_ATTR(field, S_IRUGO, show_sas_phy_##field,         \
+static DEVICE_ATTR(field, S_IRUGO, show_sas_phy_##field,               \
        store_sas_phy_##field)
 
 #define sas_phy_linkspeed_attr(field)                                  \
        sas_phy_show_linkspeed(field)                                   \
-static CLASS_DEVICE_ATTR(field, S_IRUGO, show_sas_phy_##field, NULL)
+static DEVICE_ATTR(field, S_IRUGO, show_sas_phy_##field, NULL)
 
 
 #define sas_phy_show_linkerror(field)                                  \
 static ssize_t                                                         \
-show_sas_phy_##field(struct class_device *cdev, char *buf)             \
+show_sas_phy_##field(struct device *dev,                               \
+                    struct device_attribute *attr, char *buf)          \
 {                                                                      \
-       struct sas_phy *phy = transport_class_to_phy(cdev);             \
+       struct sas_phy *phy = transport_class_to_phy(dev);              \
        struct Scsi_Host *shost = dev_to_shost(phy->dev.parent);        \
        struct sas_internal *i = to_sas_internal(shost->transportt);    \
        int error;                                                      \
@@ -441,24 +446,25 @@ show_sas_phy_##field(struct class_device *cdev, char *buf)                \
 
 #define sas_phy_linkerror_attr(field)                                  \
        sas_phy_show_linkerror(field)                                   \
-static CLASS_DEVICE_ATTR(field, S_IRUGO, show_sas_phy_##field, NULL)
+static DEVICE_ATTR(field, S_IRUGO, show_sas_phy_##field, NULL)
 
 
 static ssize_t
-show_sas_device_type(struct class_device *cdev, char *buf)
+show_sas_device_type(struct device *dev,
+                    struct device_attribute *attr, char *buf)
 {
-       struct sas_phy *phy = transport_class_to_phy(cdev);
+       struct sas_phy *phy = transport_class_to_phy(dev);
 
        if (!phy->identify.device_type)
                return snprintf(buf, 20, "none\n");
        return get_sas_device_type_names(phy->identify.device_type, buf);
 }
-static CLASS_DEVICE_ATTR(device_type, S_IRUGO, show_sas_device_type, NULL);
+static DEVICE_ATTR(device_type, S_IRUGO, show_sas_device_type, NULL);
 
-static ssize_t do_sas_phy_enable(struct class_device *cdev,
+static ssize_t do_sas_phy_enable(struct device *dev,
                size_t count, int enable)
 {
-       struct sas_phy *phy = transport_class_to_phy(cdev);
+       struct sas_phy *phy = transport_class_to_phy(dev);
        struct Scsi_Host *shost = dev_to_shost(phy->dev.parent);
        struct sas_internal *i = to_sas_internal(shost->transportt);
        int error;
@@ -470,18 +476,19 @@ static ssize_t do_sas_phy_enable(struct class_device *cdev,
        return count;
 };
 
-static ssize_t store_sas_phy_enable(struct class_device *cdev,
-               const char *buf, size_t count)
+static ssize_t
+store_sas_phy_enable(struct device *dev, struct device_attribute *attr,
+                    const char *buf, size_t count)
 {
        if (count < 1)
                return -EINVAL;
 
        switch (buf[0]) {
        case '0':
-               do_sas_phy_enable(cdev, count, 0);
+               do_sas_phy_enable(dev, count, 0);
                break;
        case '1':
-               do_sas_phy_enable(cdev, count, 1);
+               do_sas_phy_enable(dev, count, 1);
                break;
        default:
                return -EINVAL;
@@ -490,20 +497,22 @@ static ssize_t store_sas_phy_enable(struct class_device *cdev,
        return count;
 }
 
-static ssize_t show_sas_phy_enable(struct class_device *cdev, char *buf)
+static ssize_t
+show_sas_phy_enable(struct device *dev, struct device_attribute *attr,
+                   char *buf)
 {
-       struct sas_phy *phy = transport_class_to_phy(cdev);
+       struct sas_phy *phy = transport_class_to_phy(dev);
 
        return snprintf(buf, 20, "%d", phy->enabled);
 }
 
-static CLASS_DEVICE_ATTR(enable, S_IRUGO | S_IWUSR, show_sas_phy_enable,
+static DEVICE_ATTR(enable, S_IRUGO | S_IWUSR, show_sas_phy_enable,
                         store_sas_phy_enable);
 
-static ssize_t do_sas_phy_reset(struct class_device *cdev,
-               size_t count, int hard_reset)
+static ssize_t
+do_sas_phy_reset(struct device *dev, size_t count, int hard_reset)
 {
-       struct sas_phy *phy = transport_class_to_phy(cdev);
+       struct sas_phy *phy = transport_class_to_phy(dev);
        struct Scsi_Host *shost = dev_to_shost(phy->dev.parent);
        struct sas_internal *i = to_sas_internal(shost->transportt);
        int error;
@@ -514,19 +523,21 @@ static ssize_t do_sas_phy_reset(struct class_device *cdev,
        return count;
 };
 
-static ssize_t store_sas_link_reset(struct class_device *cdev,
-               const char *buf, size_t count)
+static ssize_t
+store_sas_link_reset(struct device *dev, struct device_attribute *attr,
+                    const char *buf, size_t count)
 {
-       return do_sas_phy_reset(cdev, count, 0);
+       return do_sas_phy_reset(dev, count, 0);
 }
-static CLASS_DEVICE_ATTR(link_reset, S_IWUSR, NULL, store_sas_link_reset);
+static DEVICE_ATTR(link_reset, S_IWUSR, NULL, store_sas_link_reset);
 
-static ssize_t store_sas_hard_reset(struct class_device *cdev,
-               const char *buf, size_t count)
+static ssize_t
+store_sas_hard_reset(struct device *dev, struct device_attribute *attr,
+                    const char *buf, size_t count)
 {
-       return do_sas_phy_reset(cdev, count, 1);
+       return do_sas_phy_reset(dev, count, 1);
 }
-static CLASS_DEVICE_ATTR(hard_reset, S_IWUSR, NULL, store_sas_hard_reset);
+static DEVICE_ATTR(hard_reset, S_IWUSR, NULL, store_sas_hard_reset);
 
 sas_phy_protocol_attr(identify.initiator_port_protocols,
                initiator_port_protocols);
@@ -695,16 +706,17 @@ EXPORT_SYMBOL(scsi_is_sas_phy);
  */
 #define sas_port_show_simple(field, name, format_string, cast)         \
 static ssize_t                                                         \
-show_sas_port_##name(struct class_device *cdev, char *buf)             \
+show_sas_port_##name(struct device *dev,                               \
+                    struct device_attribute *attr, char *buf)          \
 {                                                                      \
-       struct sas_port *port = transport_class_to_sas_port(cdev);      \
+       struct sas_port *port = transport_class_to_sas_port(dev);       \
                                                                        \
        return snprintf(buf, 20, format_string, cast port->field);      \
 }
 
 #define sas_port_simple_attr(field, name, format_string, type)         \
        sas_port_show_simple(field, name, format_string, (type))        \
-static CLASS_DEVICE_ATTR(name, S_IRUGO, show_sas_port_##name, NULL)
+static DEVICE_ATTR(name, S_IRUGO, show_sas_port_##name, NULL)
 
 sas_port_simple_attr(num_phys, num_phys, "%d\n", int);
 
@@ -1017,23 +1029,25 @@ EXPORT_SYMBOL(sas_port_mark_backlink);
 
 #define sas_rphy_show_simple(field, name, format_string, cast)         \
 static ssize_t                                                         \
-show_sas_rphy_##name(struct class_device *cdev, char *buf)             \
+show_sas_rphy_##name(struct device *dev,                               \
+                    struct device_attribute *attr, char *buf)          \
 {                                                                      \
-       struct sas_rphy *rphy = transport_class_to_rphy(cdev);  \
+       struct sas_rphy *rphy = transport_class_to_rphy(dev);           \
                                                                        \
        return snprintf(buf, 20, format_string, cast rphy->field);      \
 }
 
 #define sas_rphy_simple_attr(field, name, format_string, type)         \
        sas_rphy_show_simple(field, name, format_string, (type))        \
-static SAS_CLASS_DEVICE_ATTR(rphy, name, S_IRUGO,                      \
+static SAS_DEVICE_ATTR(rphy, name, S_IRUGO,                    \
                show_sas_rphy_##name, NULL)
 
 #define sas_rphy_show_protocol(field, name)                            \
 static ssize_t                                                         \
-show_sas_rphy_##name(struct class_device *cdev, char *buf)             \
+show_sas_rphy_##name(struct device *dev,                               \
+                    struct device_attribute *attr, char *buf)          \
 {                                                                      \
-       struct sas_rphy *rphy = transport_class_to_rphy(cdev);  \
+       struct sas_rphy *rphy = transport_class_to_rphy(dev);           \
                                                                        \
        if (!rphy->field)                                       \
                return snprintf(buf, 20, "none\n");                     \
@@ -1042,13 +1056,14 @@ show_sas_rphy_##name(struct class_device *cdev, char *buf)              \
 
 #define sas_rphy_protocol_attr(field, name)                            \
        sas_rphy_show_protocol(field, name)                             \
-static SAS_CLASS_DEVICE_ATTR(rphy, name, S_IRUGO,                      \
+static SAS_DEVICE_ATTR(rphy, name, S_IRUGO,                    \
                show_sas_rphy_##name, NULL)
 
 static ssize_t
-show_sas_rphy_device_type(struct class_device *cdev, char *buf)
+show_sas_rphy_device_type(struct device *dev,
+                         struct device_attribute *attr, char *buf)
 {
-       struct sas_rphy *rphy = transport_class_to_rphy(cdev);
+       struct sas_rphy *rphy = transport_class_to_rphy(dev);
 
        if (!rphy->identify.device_type)
                return snprintf(buf, 20, "none\n");
@@ -1056,13 +1071,14 @@ show_sas_rphy_device_type(struct class_device *cdev, char *buf)
                        rphy->identify.device_type, buf);
 }
 
-static SAS_CLASS_DEVICE_ATTR(rphy, device_type, S_IRUGO,
+static SAS_DEVICE_ATTR(rphy, device_type, S_IRUGO,
                show_sas_rphy_device_type, NULL);
 
 static ssize_t
-show_sas_rphy_enclosure_identifier(struct class_device *cdev, char *buf)
+show_sas_rphy_enclosure_identifier(struct device *dev,
+                                  struct device_attribute *attr, char *buf)
 {
-       struct sas_rphy *rphy = transport_class_to_rphy(cdev);
+       struct sas_rphy *rphy = transport_class_to_rphy(dev);
        struct sas_phy *phy = dev_to_phy(rphy->dev.parent);
        struct Scsi_Host *shost = dev_to_shost(phy->dev.parent);
        struct sas_internal *i = to_sas_internal(shost->transportt);
@@ -1082,13 +1098,14 @@ show_sas_rphy_enclosure_identifier(struct class_device *cdev, char *buf)
        return sprintf(buf, "0x%llx\n", (unsigned long long)identifier);
 }
 
-static SAS_CLASS_DEVICE_ATTR(rphy, enclosure_identifier, S_IRUGO,
+static SAS_DEVICE_ATTR(rphy, enclosure_identifier, S_IRUGO,
                show_sas_rphy_enclosure_identifier, NULL);
 
 static ssize_t
-show_sas_rphy_bay_identifier(struct class_device *cdev, char *buf)
+show_sas_rphy_bay_identifier(struct device *dev,
+                            struct device_attribute *attr, char *buf)
 {
-       struct sas_rphy *rphy = transport_class_to_rphy(cdev);
+       struct sas_rphy *rphy = transport_class_to_rphy(dev);
        struct sas_phy *phy = dev_to_phy(rphy->dev.parent);
        struct Scsi_Host *shost = dev_to_shost(phy->dev.parent);
        struct sas_internal *i = to_sas_internal(shost->transportt);
@@ -1103,7 +1120,7 @@ show_sas_rphy_bay_identifier(struct class_device *cdev, char *buf)
        return sprintf(buf, "%d\n", val);
 }
 
-static SAS_CLASS_DEVICE_ATTR(rphy, bay_identifier, S_IRUGO,
+static SAS_DEVICE_ATTR(rphy, bay_identifier, S_IRUGO,
                show_sas_rphy_bay_identifier, NULL);
 
 sas_rphy_protocol_attr(identify.initiator_port_protocols,
@@ -1161,9 +1178,10 @@ static DECLARE_TRANSPORT_CLASS(sas_end_dev_class,
 
 #define sas_end_dev_show_simple(field, name, format_string, cast)      \
 static ssize_t                                                         \
-show_sas_end_dev_##name(struct class_device *cdev, char *buf)          \
+show_sas_end_dev_##name(struct device *dev,                            \
+                       struct device_attribute *attr, char *buf)       \
 {                                                                      \
-       struct sas_rphy *rphy = transport_class_to_rphy(cdev);          \
+       struct sas_rphy *rphy = transport_class_to_rphy(dev);           \
        struct sas_end_device *rdev = rphy_to_end_device(rphy);         \
                                                                        \
        return snprintf(buf, 20, format_string, cast rdev->field);      \
@@ -1171,7 +1189,7 @@ show_sas_end_dev_##name(struct class_device *cdev, char *buf)             \
 
 #define sas_end_dev_simple_attr(field, name, format_string, type)      \
        sas_end_dev_show_simple(field, name, format_string, (type))     \
-static SAS_CLASS_DEVICE_ATTR(end_dev, name, S_IRUGO,                   \
+static SAS_DEVICE_ATTR(end_dev, name, S_IRUGO,                         \
                show_sas_end_dev_##name, NULL)
 
 sas_end_dev_simple_attr(ready_led_meaning, ready_led_meaning, "%d\n", int);
@@ -1185,9 +1203,10 @@ static DECLARE_TRANSPORT_CLASS(sas_expander_class,
 
 #define sas_expander_show_simple(field, name, format_string, cast)     \
 static ssize_t                                                         \
-show_sas_expander_##name(struct class_device *cdev, char *buf)         \
+show_sas_expander_##name(struct device *dev,                           \
+                        struct device_attribute *attr, char *buf)      \
 {                                                                      \
-       struct sas_rphy *rphy = transport_class_to_rphy(cdev);          \
+       struct sas_rphy *rphy = transport_class_to_rphy(dev);           \
        struct sas_expander_device *edev = rphy_to_expander_device(rphy); \
                                                                        \
        return snprintf(buf, 20, format_string, cast edev->field);      \
@@ -1195,7 +1214,7 @@ show_sas_expander_##name(struct class_device *cdev, char *buf)            \
 
 #define sas_expander_simple_attr(field, name, format_string, type)     \
        sas_expander_show_simple(field, name, format_string, (type))    \
-static SAS_CLASS_DEVICE_ATTR(expander, name, S_IRUGO,                  \
+static SAS_DEVICE_ATTR(expander, name, S_IRUGO,                        \
                show_sas_expander_##name, NULL)
 
 sas_expander_simple_attr(vendor_id, vendor_id, "%s\n", char *);
@@ -1554,14 +1573,14 @@ static int sas_user_scan(struct Scsi_Host *shost, uint channel,
  */
 
 #define SETUP_TEMPLATE(attrb, field, perm, test)                       \
-       i->private_##attrb[count] = class_device_attr_##field;          \
+       i->private_##attrb[count] = dev_attr_##field;           \
        i->private_##attrb[count].attr.mode = perm;                     \
        i->attrb[count] = &i->private_##attrb[count];                   \
        if (test)                                                       \
                count++
 
 #define SETUP_TEMPLATE_RW(attrb, field, perm, test, ro_test, ro_perm)  \
-       i->private_##attrb[count] = class_device_attr_##field;          \
+       i->private_##attrb[count] = dev_attr_##field;           \
        i->private_##attrb[count].attr.mode = perm;                     \
        if (ro_test) {                                                  \
                i->private_##attrb[count].attr.mode = ro_perm;          \
index 1fb60313a516fcd971538b0ebf17271357d5ed48..bc12b5d5d676df7ab733fd23ea0ef8e929241363 100644 (file)
@@ -158,7 +158,7 @@ static inline enum spi_signal_type spi_signal_to_value(const char *name)
 }
 
 static int spi_host_setup(struct transport_container *tc, struct device *dev,
-                         struct class_device *cdev)
+                         struct device *cdev)
 {
        struct Scsi_Host *shost = dev_to_shost(dev);
 
@@ -169,7 +169,7 @@ static int spi_host_setup(struct transport_container *tc, struct device *dev,
 
 static int spi_host_configure(struct transport_container *tc,
                              struct device *dev,
-                             struct class_device *cdev);
+                             struct device *cdev);
 
 static DECLARE_TRANSPORT_CLASS(spi_host_class,
                               "spi_host",
@@ -195,11 +195,11 @@ static int spi_host_match(struct attribute_container *cont,
 
 static int spi_target_configure(struct transport_container *tc,
                                struct device *dev,
-                               struct class_device *cdev);
+                               struct device *cdev);
 
 static int spi_device_configure(struct transport_container *tc,
                                struct device *dev,
-                               struct class_device *cdev)
+                               struct device *cdev)
 {
        struct scsi_device *sdev = to_scsi_device(dev);
        struct scsi_target *starget = sdev->sdev_target;
@@ -219,7 +219,7 @@ static int spi_device_configure(struct transport_container *tc,
 
 static int spi_setup_transport_attrs(struct transport_container *tc,
                                     struct device *dev,
-                                    struct class_device *cdev)
+                                    struct device *cdev)
 {
        struct scsi_target *starget = to_scsi_target(dev);
 
@@ -248,9 +248,10 @@ static int spi_setup_transport_attrs(struct transport_container *tc,
 #define spi_transport_show_simple(field, format_string)                        \
                                                                        \
 static ssize_t                                                         \
-show_spi_transport_##field(struct class_device *cdev, char *buf)       \
+show_spi_transport_##field(struct device *dev,                         \
+                          struct device_attribute *attr, char *buf)    \
 {                                                                      \
-       struct scsi_target *starget = transport_class_to_starget(cdev); \
+       struct scsi_target *starget = transport_class_to_starget(dev);  \
        struct spi_transport_attrs *tp;                                 \
                                                                        \
        tp = (struct spi_transport_attrs *)&starget->starget_data;      \
@@ -260,11 +261,12 @@ show_spi_transport_##field(struct class_device *cdev, char *buf)  \
 #define spi_transport_store_simple(field, format_string)               \
                                                                        \
 static ssize_t                                                         \
-store_spi_transport_##field(struct class_device *cdev, const char *buf, \
-                           size_t count)                               \
+store_spi_transport_##field(struct device *dev,                        \
+                           struct device_attribute *attr,              \
+                           const char *buf, size_t count)              \
 {                                                                      \
        int val;                                                        \
-       struct scsi_target *starget = transport_class_to_starget(cdev); \
+       struct scsi_target *starget = transport_class_to_starget(dev);  \
        struct spi_transport_attrs *tp;                                 \
                                                                        \
        tp = (struct spi_transport_attrs *)&starget->starget_data;      \
@@ -276,9 +278,10 @@ store_spi_transport_##field(struct class_device *cdev, const char *buf, \
 #define spi_transport_show_function(field, format_string)              \
                                                                        \
 static ssize_t                                                         \
-show_spi_transport_##field(struct class_device *cdev, char *buf)       \
+show_spi_transport_##field(struct device *dev,                         \
+                          struct device_attribute *attr, char *buf)    \
 {                                                                      \
-       struct scsi_target *starget = transport_class_to_starget(cdev); \
+       struct scsi_target *starget = transport_class_to_starget(dev);  \
        struct Scsi_Host *shost = dev_to_shost(starget->dev.parent);    \
        struct spi_transport_attrs *tp;                                 \
        struct spi_internal *i = to_spi_internal(shost->transportt);    \
@@ -290,11 +293,12 @@ show_spi_transport_##field(struct class_device *cdev, char *buf)  \
 
 #define spi_transport_store_function(field, format_string)             \
 static ssize_t                                                         \
-store_spi_transport_##field(struct class_device *cdev, const char *buf, \
-                           size_t count)                               \
+store_spi_transport_##field(struct device *dev,                        \
+                           struct device_attribute *attr,              \
+                           const char *buf, size_t count)              \
 {                                                                      \
        int val;                                                        \
-       struct scsi_target *starget = transport_class_to_starget(cdev); \
+       struct scsi_target *starget = transport_class_to_starget(dev);  \
        struct Scsi_Host *shost = dev_to_shost(starget->dev.parent);    \
        struct spi_internal *i = to_spi_internal(shost->transportt);    \
                                                                        \
@@ -307,11 +311,12 @@ store_spi_transport_##field(struct class_device *cdev, const char *buf, \
 
 #define spi_transport_store_max(field, format_string)                  \
 static ssize_t                                                         \
-store_spi_transport_##field(struct class_device *cdev, const char *buf, \
-                           size_t count)                               \
+store_spi_transport_##field(struct device *dev,                        \
+                           struct device_attribute *attr,              \
+                           const char *buf, size_t count)              \
 {                                                                      \
        int val;                                                        \
-       struct scsi_target *starget = transport_class_to_starget(cdev); \
+       struct scsi_target *starget = transport_class_to_starget(dev);  \
        struct Scsi_Host *shost = dev_to_shost(starget->dev.parent);    \
        struct spi_internal *i = to_spi_internal(shost->transportt);    \
        struct spi_transport_attrs *tp                                  \
@@ -329,24 +334,24 @@ store_spi_transport_##field(struct class_device *cdev, const char *buf, \
 #define spi_transport_rd_attr(field, format_string)                    \
        spi_transport_show_function(field, format_string)               \
        spi_transport_store_function(field, format_string)              \
-static CLASS_DEVICE_ATTR(field, S_IRUGO,                               \
-                        show_spi_transport_##field,                    \
-                        store_spi_transport_##field);
+static DEVICE_ATTR(field, S_IRUGO,                             \
+                  show_spi_transport_##field,                  \
+                  store_spi_transport_##field);
 
 #define spi_transport_simple_attr(field, format_string)                        \
        spi_transport_show_simple(field, format_string)                 \
        spi_transport_store_simple(field, format_string)                \
-static CLASS_DEVICE_ATTR(field, S_IRUGO,                               \
-                        show_spi_transport_##field,                    \
-                        store_spi_transport_##field);
+static DEVICE_ATTR(field, S_IRUGO,                             \
+                  show_spi_transport_##field,                  \
+                  store_spi_transport_##field);
 
 #define spi_transport_max_attr(field, format_string)                   \
        spi_transport_show_function(field, format_string)               \
        spi_transport_store_max(field, format_string)                   \
        spi_transport_simple_attr(max_##field, format_string)           \
-static CLASS_DEVICE_ATTR(field, S_IRUGO,                               \
-                        show_spi_transport_##field,                    \
-                        store_spi_transport_##field);
+static DEVICE_ATTR(field, S_IRUGO,                             \
+                  show_spi_transport_##field,                  \
+                  store_spi_transport_##field);
 
 /* The Parallel SCSI Tranport Attributes: */
 spi_transport_max_attr(offset, "%d\n");
@@ -370,14 +375,15 @@ static int child_iter(struct device *dev, void *data)
 }
 
 static ssize_t
-store_spi_revalidate(struct class_device *cdev, const char *buf, size_t count)
+store_spi_revalidate(struct device *dev, struct device_attribute *attr,
+                    const char *buf, size_t count)
 {
-       struct scsi_target *starget = transport_class_to_starget(cdev);
+       struct scsi_target *starget = transport_class_to_starget(dev);
 
        device_for_each_child(&starget->dev, NULL, child_iter);
        return count;
 }
-static CLASS_DEVICE_ATTR(revalidate, S_IWUSR, NULL, store_spi_revalidate);
+static DEVICE_ATTR(revalidate, S_IWUSR, NULL, store_spi_revalidate);
 
 /* Translate the period into ns according to the current spec
  * for SDTR/PPR messages */
@@ -412,7 +418,7 @@ show_spi_transport_period_helper(char *buf, int period)
 }
 
 static ssize_t
-store_spi_transport_period_helper(struct class_device *cdev, const char *buf,
+store_spi_transport_period_helper(struct device *dev, const char *buf,
                                  size_t count, int *periodp)
 {
        int j, picosec, period = -1;
@@ -449,9 +455,10 @@ store_spi_transport_period_helper(struct class_device *cdev, const char *buf,
 }
 
 static ssize_t
-show_spi_transport_period(struct class_device *cdev, char *buf)
+show_spi_transport_period(struct device *dev,
+                         struct device_attribute *attr, char *buf)
 {
-       struct scsi_target *starget = transport_class_to_starget(cdev);
+       struct scsi_target *starget = transport_class_to_starget(dev);
        struct Scsi_Host *shost = dev_to_shost(starget->dev.parent);
        struct spi_internal *i = to_spi_internal(shost->transportt);
        struct spi_transport_attrs *tp =
@@ -464,8 +471,8 @@ show_spi_transport_period(struct class_device *cdev, char *buf)
 }
 
 static ssize_t
-store_spi_transport_period(struct class_device *cdev, const char *buf,
-                           size_t count)
+store_spi_transport_period(struct device *cdev, struct device_attribute *attr,
+                          const char *buf, size_t count)
 {
        struct scsi_target *starget = transport_class_to_starget(cdev);
        struct Scsi_Host *shost = dev_to_shost(starget->dev.parent);
@@ -487,12 +494,13 @@ store_spi_transport_period(struct class_device *cdev, const char *buf,
        return retval;
 }
 
-static CLASS_DEVICE_ATTR(period, S_IRUGO,
-                        show_spi_transport_period,
-                        store_spi_transport_period);
+static DEVICE_ATTR(period, S_IRUGO,
+                  show_spi_transport_period,
+                  store_spi_transport_period);
 
 static ssize_t
-show_spi_transport_min_period(struct class_device *cdev, char *buf)
+show_spi_transport_min_period(struct device *cdev,
+                             struct device_attribute *attr, char *buf)
 {
        struct scsi_target *starget = transport_class_to_starget(cdev);
        struct Scsi_Host *shost = dev_to_shost(starget->dev.parent);
@@ -507,8 +515,9 @@ show_spi_transport_min_period(struct class_device *cdev, char *buf)
 }
 
 static ssize_t
-store_spi_transport_min_period(struct class_device *cdev, const char *buf,
-                           size_t count)
+store_spi_transport_min_period(struct device *cdev,
+                              struct device_attribute *attr,
+                              const char *buf, size_t count)
 {
        struct scsi_target *starget = transport_class_to_starget(cdev);
        struct spi_transport_attrs *tp =
@@ -519,12 +528,14 @@ store_spi_transport_min_period(struct class_device *cdev, const char *buf,
 }
 
 
-static CLASS_DEVICE_ATTR(min_period, S_IRUGO,
-                        show_spi_transport_min_period,
-                        store_spi_transport_min_period);
+static DEVICE_ATTR(min_period, S_IRUGO,
+                  show_spi_transport_min_period,
+                  store_spi_transport_min_period);
 
 
-static ssize_t show_spi_host_signalling(struct class_device *cdev, char *buf)
+static ssize_t show_spi_host_signalling(struct device *cdev,
+                                       struct device_attribute *attr,
+                                       char *buf)
 {
        struct Scsi_Host *shost = transport_class_to_shost(cdev);
        struct spi_internal *i = to_spi_internal(shost->transportt);
@@ -534,10 +545,11 @@ static ssize_t show_spi_host_signalling(struct class_device *cdev, char *buf)
 
        return sprintf(buf, "%s\n", spi_signal_to_string(spi_signalling(shost)));
 }
-static ssize_t store_spi_host_signalling(struct class_device *cdev,
+static ssize_t store_spi_host_signalling(struct device *dev,
+                                        struct device_attribute *attr,
                                         const char *buf, size_t count)
 {
-       struct Scsi_Host *shost = transport_class_to_shost(cdev);
+       struct Scsi_Host *shost = transport_class_to_shost(dev);
        struct spi_internal *i = to_spi_internal(shost->transportt);
        enum spi_signal_type type = spi_signal_to_value(buf);
 
@@ -549,9 +561,9 @@ static ssize_t store_spi_host_signalling(struct class_device *cdev,
 
        return count;
 }
-static CLASS_DEVICE_ATTR(signalling, S_IRUGO,
-                        show_spi_host_signalling,
-                        store_spi_host_signalling);
+static DEVICE_ATTR(signalling, S_IRUGO,
+                  show_spi_host_signalling,
+                  store_spi_host_signalling);
 
 #define DV_SET(x, y)                   \
        if(i->f->set_##x)               \
@@ -1334,7 +1346,7 @@ static DECLARE_ANON_TRANSPORT_CLASS(spi_device_class,
                                    spi_device_configure);
 
 static struct attribute *host_attributes[] = {
-       &class_device_attr_signalling.attr,
+       &dev_attr_signalling.attr,
        NULL
 };
 
@@ -1344,12 +1356,12 @@ static struct attribute_group host_attribute_group = {
 
 static int spi_host_configure(struct transport_container *tc,
                              struct device *dev,
-                             struct class_device *cdev)
+                             struct device *cdev)
 {
        struct kobject *kobj = &cdev->kobj;
        struct Scsi_Host *shost = transport_class_to_shost(cdev);
        struct spi_internal *si = to_spi_internal(shost->transportt);
-       struct attribute *attr = &class_device_attr_signalling.attr;
+       struct attribute *attr = &dev_attr_signalling.attr;
        int rc = 0;
 
        if (si->f->set_signalling)
@@ -1368,76 +1380,75 @@ static int spi_host_configure(struct transport_container *tc,
 static int target_attribute_is_visible(struct kobject *kobj,
                                       struct attribute *attr, int i)
 {
-       struct class_device *cdev =
-               container_of(kobj, struct class_device, kobj);
+       struct device *cdev = container_of(kobj, struct device, kobj);
        struct scsi_target *starget = transport_class_to_starget(cdev);
        struct Scsi_Host *shost = transport_class_to_shost(cdev);
        struct spi_internal *si = to_spi_internal(shost->transportt);
 
-       if (attr == &class_device_attr_period.attr &&
+       if (attr == &dev_attr_period.attr &&
            spi_support_sync(starget))
                return TARGET_ATTRIBUTE_HELPER(period);
-       else if (attr == &class_device_attr_min_period.attr &&
+       else if (attr == &dev_attr_min_period.attr &&
                 spi_support_sync(starget))
                return TARGET_ATTRIBUTE_HELPER(period);
-       else if (attr == &class_device_attr_offset.attr &&
+       else if (attr == &dev_attr_offset.attr &&
                 spi_support_sync(starget))
                return TARGET_ATTRIBUTE_HELPER(offset);
-       else if (attr == &class_device_attr_max_offset.attr &&
+       else if (attr == &dev_attr_max_offset.attr &&
                 spi_support_sync(starget))
                return TARGET_ATTRIBUTE_HELPER(offset);
-       else if (attr == &class_device_attr_width.attr &&
+       else if (attr == &dev_attr_width.attr &&
                 spi_support_wide(starget))
                return TARGET_ATTRIBUTE_HELPER(width);
-       else if (attr == &class_device_attr_max_width.attr &&
+       else if (attr == &dev_attr_max_width.attr &&
                 spi_support_wide(starget))
                return TARGET_ATTRIBUTE_HELPER(width);
-       else if (attr == &class_device_attr_iu.attr &&
+       else if (attr == &dev_attr_iu.attr &&
                 spi_support_ius(starget))
                return TARGET_ATTRIBUTE_HELPER(iu);
-       else if (attr == &class_device_attr_dt.attr &&
+       else if (attr == &dev_attr_dt.attr &&
                 spi_support_dt(starget))
                return TARGET_ATTRIBUTE_HELPER(dt);
-       else if (attr == &class_device_attr_qas.attr &&
+       else if (attr == &dev_attr_qas.attr &&
                 spi_support_qas(starget))
                return TARGET_ATTRIBUTE_HELPER(qas);
-       else if (attr == &class_device_attr_wr_flow.attr &&
+       else if (attr == &dev_attr_wr_flow.attr &&
                 spi_support_ius(starget))
                return TARGET_ATTRIBUTE_HELPER(wr_flow);
-       else if (attr == &class_device_attr_rd_strm.attr &&
+       else if (attr == &dev_attr_rd_strm.attr &&
                 spi_support_ius(starget))
                return TARGET_ATTRIBUTE_HELPER(rd_strm);
-       else if (attr == &class_device_attr_rti.attr &&
+       else if (attr == &dev_attr_rti.attr &&
                 spi_support_ius(starget))
                return TARGET_ATTRIBUTE_HELPER(rti);
-       else if (attr == &class_device_attr_pcomp_en.attr &&
+       else if (attr == &dev_attr_pcomp_en.attr &&
                 spi_support_ius(starget))
                return TARGET_ATTRIBUTE_HELPER(pcomp_en);
-       else if (attr == &class_device_attr_hold_mcs.attr &&
+       else if (attr == &dev_attr_hold_mcs.attr &&
                 spi_support_ius(starget))
                return TARGET_ATTRIBUTE_HELPER(hold_mcs);
-       else if (attr == &class_device_attr_revalidate.attr)
+       else if (attr == &dev_attr_revalidate.attr)
                return 1;
 
        return 0;
 }
 
 static struct attribute *target_attributes[] = {
-       &class_device_attr_period.attr,
-       &class_device_attr_min_period.attr,
-       &class_device_attr_offset.attr,
-       &class_device_attr_max_offset.attr,
-       &class_device_attr_width.attr,
-       &class_device_attr_max_width.attr,
-       &class_device_attr_iu.attr,
-       &class_device_attr_dt.attr,
-       &class_device_attr_qas.attr,
-       &class_device_attr_wr_flow.attr,
-       &class_device_attr_rd_strm.attr,
-       &class_device_attr_rti.attr,
-       &class_device_attr_pcomp_en.attr,
-       &class_device_attr_hold_mcs.attr,
-       &class_device_attr_revalidate.attr,
+       &dev_attr_period.attr,
+       &dev_attr_min_period.attr,
+       &dev_attr_offset.attr,
+       &dev_attr_max_offset.attr,
+       &dev_attr_width.attr,
+       &dev_attr_max_width.attr,
+       &dev_attr_iu.attr,
+       &dev_attr_dt.attr,
+       &dev_attr_qas.attr,
+       &dev_attr_wr_flow.attr,
+       &dev_attr_rd_strm.attr,
+       &dev_attr_rti.attr,
+       &dev_attr_pcomp_en.attr,
+       &dev_attr_hold_mcs.attr,
+       &dev_attr_revalidate.attr,
        NULL
 };
 
@@ -1448,7 +1459,7 @@ static struct attribute_group target_attribute_group = {
 
 static int spi_target_configure(struct transport_container *tc,
                                struct device *dev,
-                               struct class_device *cdev)
+                               struct device *cdev)
 {
        struct kobject *kobj = &cdev->kobj;
        int i;
@@ -1462,7 +1473,7 @@ static int spi_target_configure(struct transport_container *tc,
                 * to ignore, sysfs also does a WARN_ON and dumps a trace,
                 * which is bad, so temporarily, skip attributes that are
                 * already visible (the revalidate one) */
-               if (j && attr != &class_device_attr_revalidate.attr)
+               if (j && attr != &dev_attr_revalidate.attr)
                        rc = sysfs_add_file_to_group(kobj, attr,
                                                target_attribute_group.name);
                /* and make the attribute writeable if we have a set
index 2445c98ae95e804e3c4b8e29d0fda4577cd1d7e8..8a7af951d98adfd0adcbd63f453837133981e171 100644 (file)
@@ -44,20 +44,20 @@ struct srp_internal {
        struct scsi_transport_template t;
        struct srp_function_template *f;
 
-       struct class_device_attribute *host_attrs[SRP_HOST_ATTRS + 1];
+       struct device_attribute *host_attrs[SRP_HOST_ATTRS + 1];
 
-       struct class_device_attribute *rport_attrs[SRP_RPORT_ATTRS + 1];
-       struct class_device_attribute private_rport_attrs[SRP_RPORT_ATTRS];
+       struct device_attribute *rport_attrs[SRP_RPORT_ATTRS + 1];
+       struct device_attribute private_rport_attrs[SRP_RPORT_ATTRS];
        struct transport_container rport_attr_cont;
 };
 
 #define to_srp_internal(tmpl) container_of(tmpl, struct srp_internal, t)
 
 #define        dev_to_rport(d) container_of(d, struct srp_rport, dev)
-#define transport_class_to_srp_rport(cdev) dev_to_rport((cdev)->dev)
+#define transport_class_to_srp_rport(dev) dev_to_rport((dev)->parent)
 
 static int srp_host_setup(struct transport_container *tc, struct device *dev,
-                         struct class_device *cdev)
+                         struct device *cdev)
 {
        struct Scsi_Host *shost = dev_to_shost(dev);
        struct srp_host_attrs *srp_host = to_srp_host_attrs(shost);
@@ -73,7 +73,7 @@ static DECLARE_TRANSPORT_CLASS(srp_rport_class, "srp_remote_ports",
                               NULL, NULL, NULL);
 
 #define SETUP_TEMPLATE(attrb, field, perm, test, ro_test, ro_perm)     \
-       i->private_##attrb[count] = class_device_attr_##field;          \
+       i->private_##attrb[count] = dev_attr_##field;           \
        i->private_##attrb[count].attr.mode = perm;                     \
        if (ro_test) {                                                  \
                i->private_##attrb[count].attr.mode = ro_perm;          \
@@ -100,13 +100,14 @@ static DECLARE_TRANSPORT_CLASS(srp_rport_class, "srp_remote_ports",
        "%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x"
 
 static ssize_t
-show_srp_rport_id(struct class_device *cdev, char *buf)
+show_srp_rport_id(struct device *dev, struct device_attribute *attr,
+                 char *buf)
 {
-       struct srp_rport *rport = transport_class_to_srp_rport(cdev);
+       struct srp_rport *rport = transport_class_to_srp_rport(dev);
        return sprintf(buf, SRP_PID_FMT "\n", SRP_PID(rport));
 }
 
-static CLASS_DEVICE_ATTR(port_id, S_IRUGO, show_srp_rport_id, NULL);
+static DEVICE_ATTR(port_id, S_IRUGO, show_srp_rport_id, NULL);
 
 static const struct {
        u32 value;
@@ -117,9 +118,10 @@ static const struct {
 };
 
 static ssize_t
-show_srp_rport_roles(struct class_device *cdev, char *buf)
+show_srp_rport_roles(struct device *dev, struct device_attribute *attr,
+                    char *buf)
 {
-       struct srp_rport *rport = transport_class_to_srp_rport(cdev);
+       struct srp_rport *rport = transport_class_to_srp_rport(dev);
        int i;
        char *name = NULL;
 
@@ -131,7 +133,7 @@ show_srp_rport_roles(struct class_device *cdev, char *buf)
        return sprintf(buf, "%s\n", name ? : "unknown");
 }
 
-static CLASS_DEVICE_ATTR(roles, S_IRUGO, show_srp_rport_roles, NULL);
+static DEVICE_ATTR(roles, S_IRUGO, show_srp_rport_roles, NULL);
 
 static void srp_rport_release(struct device *dev)
 {
index 5fe7aaed904c3230c08a3a02e6c7a8cc082760a0..3cea17dd5dbac5b80619e9ee7a34732401ee586d 100644 (file)
@@ -95,7 +95,7 @@ static int sd_resume(struct device *);
 static void sd_rescan(struct device *);
 static int sd_done(struct scsi_cmnd *);
 static void sd_read_capacity(struct scsi_disk *sdkp, unsigned char *buffer);
-static void scsi_disk_release(struct class_device *cdev);
+static void scsi_disk_release(struct device *cdev);
 static void sd_print_sense_hdr(struct scsi_disk *, struct scsi_sense_hdr *);
 static void sd_print_result(struct scsi_disk *, int);
 
@@ -112,11 +112,12 @@ static const char *sd_cache_types[] = {
        "write back, no read (daft)"
 };
 
-static ssize_t sd_store_cache_type(struct class_device *cdev, const char *buf,
-                                  size_t count)
+static ssize_t
+sd_store_cache_type(struct device *dev, struct device_attribute *attr,
+                   const char *buf, size_t count)
 {
        int i, ct = -1, rcd, wce, sp;
-       struct scsi_disk *sdkp = to_scsi_disk(cdev);
+       struct scsi_disk *sdkp = to_scsi_disk(dev);
        struct scsi_device *sdp = sdkp->device;
        char buffer[64];
        char *buffer_data;
@@ -163,10 +164,11 @@ static ssize_t sd_store_cache_type(struct class_device *cdev, const char *buf,
        return count;
 }
 
-static ssize_t sd_store_manage_start_stop(struct class_device *cdev,
-                                         const char *buf, size_t count)
+static ssize_t
+sd_store_manage_start_stop(struct device *dev, struct device_attribute *attr,
+                          const char *buf, size_t count)
 {
-       struct scsi_disk *sdkp = to_scsi_disk(cdev);
+       struct scsi_disk *sdkp = to_scsi_disk(dev);
        struct scsi_device *sdp = sdkp->device;
 
        if (!capable(CAP_SYS_ADMIN))
@@ -177,10 +179,11 @@ static ssize_t sd_store_manage_start_stop(struct class_device *cdev,
        return count;
 }
 
-static ssize_t sd_store_allow_restart(struct class_device *cdev, const char *buf,
-                                     size_t count)
+static ssize_t
+sd_store_allow_restart(struct device *dev, struct device_attribute *attr,
+                      const char *buf, size_t count)
 {
-       struct scsi_disk *sdkp = to_scsi_disk(cdev);
+       struct scsi_disk *sdkp = to_scsi_disk(dev);
        struct scsi_device *sdp = sdkp->device;
 
        if (!capable(CAP_SYS_ADMIN))
@@ -194,37 +197,44 @@ static ssize_t sd_store_allow_restart(struct class_device *cdev, const char *buf
        return count;
 }
 
-static ssize_t sd_show_cache_type(struct class_device *cdev, char *buf)
+static ssize_t
+sd_show_cache_type(struct device *dev, struct device_attribute *attr,
+                  char *buf)
 {
-       struct scsi_disk *sdkp = to_scsi_disk(cdev);
+       struct scsi_disk *sdkp = to_scsi_disk(dev);
        int ct = sdkp->RCD + 2*sdkp->WCE;
 
        return snprintf(buf, 40, "%s\n", sd_cache_types[ct]);
 }
 
-static ssize_t sd_show_fua(struct class_device *cdev, char *buf)
+static ssize_t
+sd_show_fua(struct device *dev, struct device_attribute *attr, char *buf)
 {
-       struct scsi_disk *sdkp = to_scsi_disk(cdev);
+       struct scsi_disk *sdkp = to_scsi_disk(dev);
 
        return snprintf(buf, 20, "%u\n", sdkp->DPOFUA);
 }
 
-static ssize_t sd_show_manage_start_stop(struct class_device *cdev, char *buf)
+static ssize_t
+sd_show_manage_start_stop(struct device *dev, struct device_attribute *attr,
+                         char *buf)
 {
-       struct scsi_disk *sdkp = to_scsi_disk(cdev);
+       struct scsi_disk *sdkp = to_scsi_disk(dev);
        struct scsi_device *sdp = sdkp->device;
 
        return snprintf(buf, 20, "%u\n", sdp->manage_start_stop);
 }
 
-static ssize_t sd_show_allow_restart(struct class_device *cdev, char *buf)
+static ssize_t
+sd_show_allow_restart(struct device *dev, struct device_attribute *attr,
+                     char *buf)
 {
-       struct scsi_disk *sdkp = to_scsi_disk(cdev);
+       struct scsi_disk *sdkp = to_scsi_disk(dev);
 
        return snprintf(buf, 40, "%d\n", sdkp->device->allow_restart);
 }
 
-static struct class_device_attribute sd_disk_attrs[] = {
+static struct device_attribute sd_disk_attrs[] = {
        __ATTR(cache_type, S_IRUGO|S_IWUSR, sd_show_cache_type,
               sd_store_cache_type),
        __ATTR(FUA, S_IRUGO, sd_show_fua, NULL),
@@ -238,8 +248,8 @@ static struct class_device_attribute sd_disk_attrs[] = {
 static struct class sd_disk_class = {
        .name           = "scsi_disk",
        .owner          = THIS_MODULE,
-       .release        = scsi_disk_release,
-       .class_dev_attrs = sd_disk_attrs,
+       .dev_release    = scsi_disk_release,
+       .dev_attrs      = sd_disk_attrs,
 };
 
 static struct scsi_driver sd_template = {
@@ -297,7 +307,7 @@ static struct scsi_disk *__scsi_disk_get(struct gendisk *disk)
        if (disk->private_data) {
                sdkp = scsi_disk(disk);
                if (scsi_device_get(sdkp->device) == 0)
-                       class_device_get(&sdkp->cdev);
+                       get_device(&sdkp->dev);
                else
                        sdkp = NULL;
        }
@@ -331,7 +341,7 @@ static void scsi_disk_put(struct scsi_disk *sdkp)
        struct scsi_device *sdev = sdkp->device;
 
        mutex_lock(&sd_ref_mutex);
-       class_device_put(&sdkp->cdev);
+       put_device(&sdkp->dev);
        scsi_device_put(sdev);
        mutex_unlock(&sd_ref_mutex);
 }
@@ -1663,12 +1673,12 @@ static int sd_probe(struct device *dev)
                        sdp->timeout = SD_MOD_TIMEOUT;
        }
 
-       class_device_initialize(&sdkp->cdev);
-       sdkp->cdev.dev = &sdp->sdev_gendev;
-       sdkp->cdev.class = &sd_disk_class;
-       strncpy(sdkp->cdev.class_id, sdp->sdev_gendev.bus_id, BUS_ID_SIZE);
+       device_initialize(&sdkp->dev);
+       sdkp->dev.parent = &sdp->sdev_gendev;
+       sdkp->dev.class = &sd_disk_class;
+       strncpy(sdkp->dev.bus_id, sdp->sdev_gendev.bus_id, BUS_ID_SIZE);
 
-       if (class_device_add(&sdkp->cdev))
+       if (device_add(&sdkp->dev))
                goto out_put;
 
        get_device(&sdp->sdev_gendev);
@@ -1734,13 +1744,13 @@ static int sd_remove(struct device *dev)
 {
        struct scsi_disk *sdkp = dev_get_drvdata(dev);
 
-       class_device_del(&sdkp->cdev);
+       device_del(&sdkp->dev);
        del_gendisk(sdkp->disk);
        sd_shutdown(dev);
 
        mutex_lock(&sd_ref_mutex);
        dev_set_drvdata(dev, NULL);
-       class_device_put(&sdkp->cdev);
+       put_device(&sdkp->dev);
        mutex_unlock(&sd_ref_mutex);
 
        return 0;
@@ -1748,16 +1758,16 @@ static int sd_remove(struct device *dev)
 
 /**
  *     scsi_disk_release - Called to free the scsi_disk structure
- *     @cdev: pointer to embedded class device
+ *     @dev: pointer to embedded class device
  *
  *     sd_ref_mutex must be held entering this routine.  Because it is
  *     called on last put, you should always use the scsi_disk_get()
  *     scsi_disk_put() helpers which manipulate the semaphore directly
- *     and never do a direct class_device_put().
+ *     and never do a direct put_device.
  **/
-static void scsi_disk_release(struct class_device *cdev)
+static void scsi_disk_release(struct device *dev)
 {
-       struct scsi_disk *sdkp = to_scsi_disk(cdev);
+       struct scsi_disk *sdkp = to_scsi_disk(dev);
        struct gendisk *disk = sdkp->disk;
        
        spin_lock(&sd_index_lock);
index a6d96694d0a508bf086825225a78bce05879e803..45df83b9d847122abac77e2d7a9d5a59eb2cfb95 100644 (file)
@@ -107,7 +107,7 @@ static int ses_set_page2_descriptor(struct enclosure_device *edev,
                                      unsigned char *desc)
 {
        int i, j, count = 0, descriptor = ecomp->number;
-       struct scsi_device *sdev = to_scsi_device(edev->cdev.dev);
+       struct scsi_device *sdev = to_scsi_device(edev->edev.parent);
        struct ses_device *ses_dev = edev->scratch;
        unsigned char *type_ptr = ses_dev->page1 + 12 + ses_dev->page1[11];
        unsigned char *desc_ptr = ses_dev->page2 + 8;
@@ -137,7 +137,7 @@ static unsigned char *ses_get_page2_descriptor(struct enclosure_device *edev,
                                      struct enclosure_component *ecomp)
 {
        int i, j, count = 0, descriptor = ecomp->number;
-       struct scsi_device *sdev = to_scsi_device(edev->cdev.dev);
+       struct scsi_device *sdev = to_scsi_device(edev->edev.parent);
        struct ses_device *ses_dev = edev->scratch;
        unsigned char *type_ptr = ses_dev->page1 + 12 + ses_dev->page1[11];
        unsigned char *desc_ptr = ses_dev->page2 + 8;
@@ -269,10 +269,10 @@ int ses_match_host(struct enclosure_device *edev, void *data)
        struct ses_host_edev *sed = data;
        struct scsi_device *sdev;
 
-       if (!scsi_is_sdev_device(edev->cdev.dev))
+       if (!scsi_is_sdev_device(edev->edev.parent))
                return 0;
 
-       sdev = to_scsi_device(edev->cdev.dev);
+       sdev = to_scsi_device(edev->edev.parent);
 
        if (sdev->host != sed->shost)
                return 0;
@@ -407,10 +407,10 @@ static void ses_match_to_enclosure(struct enclosure_device *edev,
 
 #define INIT_ALLOC_SIZE 32
 
-static int ses_intf_add(struct class_device *cdev,
+static int ses_intf_add(struct device *cdev,
                        struct class_interface *intf)
 {
-       struct scsi_device *sdev = to_scsi_device(cdev->dev);
+       struct scsi_device *sdev = to_scsi_device(cdev->parent);
        struct scsi_device *tmp_sdev;
        unsigned char *buf = NULL, *hdr_buf, *type_ptr, *desc_ptr = NULL,
                *addl_desc_ptr = NULL;
@@ -426,7 +426,7 @@ static int ses_intf_add(struct class_device *cdev,
                edev = enclosure_find(&sdev->host->shost_gendev);
                if (edev) {
                        ses_match_to_enclosure(edev, sdev);
-                       class_device_put(&edev->cdev);
+                       put_device(&edev->edev);
                }
                return -ENODEV;
        }
@@ -515,7 +515,7 @@ static int ses_intf_add(struct class_device *cdev,
        if (!scomp)
                goto err_free;
 
-       edev = enclosure_register(cdev->dev, sdev->sdev_gendev.bus_id,
+       edev = enclosure_register(cdev->parent, sdev->sdev_gendev.bus_id,
                                  components, &ses_enclosure_callbacks);
        if (IS_ERR(edev)) {
                err = PTR_ERR(edev);
@@ -625,17 +625,17 @@ static int ses_remove(struct device *dev)
        return 0;
 }
 
-static void ses_intf_remove(struct class_device *cdev,
+static void ses_intf_remove(struct device *cdev,
                            struct class_interface *intf)
 {
-       struct scsi_device *sdev = to_scsi_device(cdev->dev);
+       struct scsi_device *sdev = to_scsi_device(cdev->parent);
        struct enclosure_device *edev;
        struct ses_device *ses_dev;
 
        if (!scsi_device_enclosure(sdev))
                return;
 
-       edev = enclosure_find(cdev->dev);
+       edev = enclosure_find(cdev->parent);
        if (!edev)
                return;
 
@@ -649,13 +649,13 @@ static void ses_intf_remove(struct class_device *cdev,
 
        kfree(edev->component[0].scratch);
 
-       class_device_put(&edev->cdev);
+       put_device(&edev->edev);
        enclosure_unregister(edev);
 }
 
 static struct class_interface ses_interface = {
-       .add    = ses_intf_add,
-       .remove = ses_intf_remove,
+       .add_dev        = ses_intf_add,
+       .remove_dev     = ses_intf_remove,
 };
 
 static struct scsi_driver ses_template = {
index e5156aa6dd203d850209dc78a16b8d7b548360ab..2029422bc04d099ba081df55b73cd94a940390d5 100644 (file)
@@ -101,16 +101,16 @@ static int scatter_elem_sz_prev = SG_SCATTER_SZ;
 #define SG_SECTOR_SZ 512
 #define SG_SECTOR_MSK (SG_SECTOR_SZ - 1)
 
-static int sg_add(struct class_device *, struct class_interface *);
-static void sg_remove(struct class_device *, struct class_interface *);
+static int sg_add(struct device *, struct class_interface *);
+static void sg_remove(struct device *, struct class_interface *);
 
 static DEFINE_IDR(sg_index_idr);
 static DEFINE_RWLOCK(sg_index_lock);   /* Also used to lock
                                                           file descriptor list for device */
 
 static struct class_interface sg_interface = {
-       .add            = sg_add,
-       .remove         = sg_remove,
+       .add_dev        = sg_add,
+       .remove_dev     = sg_remove,
 };
 
 typedef struct sg_scatter_hold { /* holding area for scsi scatter gather info */
@@ -1401,9 +1401,9 @@ static Sg_device *sg_alloc(struct gendisk *disk, struct scsi_device *scsidp)
 }
 
 static int
-sg_add(struct class_device *cl_dev, struct class_interface *cl_intf)
+sg_add(struct device *cl_dev, struct class_interface *cl_intf)
 {
-       struct scsi_device *scsidp = to_scsi_device(cl_dev->dev);
+       struct scsi_device *scsidp = to_scsi_device(cl_dev->parent);
        struct gendisk *disk;
        Sg_device *sdp = NULL;
        struct cdev * cdev = NULL;
@@ -1439,19 +1439,19 @@ sg_add(struct class_device *cl_dev, struct class_interface *cl_intf)
 
        sdp->cdev = cdev;
        if (sg_sysfs_valid) {
-               struct class_device * sg_class_member;
+               struct device *sg_class_member;
 
-               sg_class_member = class_device_create(sg_sysfs_class, NULL,
-                               MKDEV(SCSI_GENERIC_MAJOR, sdp->index),
-                               cl_dev->dev, "%s",
-                               disk->disk_name);
+               sg_class_member = device_create(sg_sysfs_class, cl_dev->parent,
+                                               MKDEV(SCSI_GENERIC_MAJOR,
+                                                     sdp->index),
+                                               "%s", disk->disk_name);
                if (IS_ERR(sg_class_member)) {
                        printk(KERN_ERR "sg_add: "
-                              "class_device_create failed\n");
+                              "device_create failed\n");
                        error = PTR_ERR(sg_class_member);
                        goto cdev_add_err;
                }
-               class_set_devdata(sg_class_member, sdp);
+               dev_set_drvdata(sg_class_member, sdp);
                error = sysfs_create_link(&scsidp->sdev_gendev.kobj,
                                          &sg_class_member->kobj, "generic");
                if (error)
@@ -1464,7 +1464,7 @@ sg_add(struct class_device *cl_dev, struct class_interface *cl_intf)
                    "Attached scsi generic sg%d type %d\n", sdp->index,
                    scsidp->type);
 
-       class_set_devdata(cl_dev, sdp);
+       dev_set_drvdata(cl_dev, sdp);
 
        return 0;
 
@@ -1482,10 +1482,10 @@ out:
 }
 
 static void
-sg_remove(struct class_device *cl_dev, struct class_interface *cl_intf)
+sg_remove(struct device *cl_dev, struct class_interface *cl_intf)
 {
-       struct scsi_device *scsidp = to_scsi_device(cl_dev->dev);
-       Sg_device *sdp = class_get_devdata(cl_dev);
+       struct scsi_device *scsidp = to_scsi_device(cl_dev->parent);
+       Sg_device *sdp = dev_get_drvdata(cl_dev);
        unsigned long iflags;
        Sg_fd *sfp;
        Sg_fd *tsfp;
@@ -1528,7 +1528,7 @@ sg_remove(struct class_device *cl_dev, struct class_interface *cl_intf)
        write_unlock_irqrestore(&sg_index_lock, iflags);
 
        sysfs_remove_link(&scsidp->sdev_gendev.kobj, "generic");
-       class_device_destroy(sg_sysfs_class, MKDEV(SCSI_GENERIC_MAJOR, sdp->index));
+       device_destroy(sg_sysfs_class, MKDEV(SCSI_GENERIC_MAJOR, sdp->index));
        cdev_del(sdp->cdev);
        sdp->cdev = NULL;
        put_disk(sdp->disk);
index df83bea2c62029fff5d13122c3d7e9059ca76ad8..a860c3a9ae9902b1b935802400f29c1b53903b5c 100644 (file)
@@ -4108,9 +4108,9 @@ out_free_tape:
                        if (STm->cdevs[j]) {
                                if (cdev == STm->cdevs[j])
                                        cdev = NULL;
-                               class_device_destroy(st_sysfs_class,
-                                                    MKDEV(SCSI_TAPE_MAJOR,
-                                                          TAPE_MINOR(i, mode, j)));
+                                       device_destroy(st_sysfs_class,
+                                                      MKDEV(SCSI_TAPE_MAJOR,
+                                                            TAPE_MINOR(i, mode, j)));
                                cdev_del(STm->cdevs[j]);
                        }
                }
@@ -4148,9 +4148,9 @@ static int st_remove(struct device *dev)
                                          "tape");
                        for (mode = 0; mode < ST_NBR_MODES; ++mode) {
                                for (j=0; j < 2; j++) {
-                                       class_device_destroy(st_sysfs_class,
-                                                            MKDEV(SCSI_TAPE_MAJOR,
-                                                                  TAPE_MINOR(i, mode, j)));
+                                       device_destroy(st_sysfs_class,
+                                                      MKDEV(SCSI_TAPE_MAJOR,
+                                                            TAPE_MINOR(i, mode, j)));
                                        cdev_del(tpnt->modes[mode].cdevs[j]);
                                        tpnt->modes[mode].cdevs[j] = NULL;
                                }
@@ -4319,31 +4319,34 @@ static void do_remove_sysfs_files(void)
 
 
 /* The sysfs simple class interface */
-static ssize_t st_defined_show(struct class_device *class_dev, char *buf)
+static ssize_t
+st_defined_show(struct device *dev, struct device_attribute *attr, char *buf)
 {
-       struct st_modedef *STm = (struct st_modedef *)class_get_devdata(class_dev);
+       struct st_modedef *STm = (struct st_modedef *)dev_get_drvdata(dev);
        ssize_t l = 0;
 
        l = snprintf(buf, PAGE_SIZE, "%d\n", STm->defined);
        return l;
 }
 
-CLASS_DEVICE_ATTR(defined, S_IRUGO, st_defined_show, NULL);
+DEVICE_ATTR(defined, S_IRUGO, st_defined_show, NULL);
 
-static ssize_t st_defblk_show(struct class_device *class_dev, char *buf)
+static ssize_t
+st_defblk_show(struct device *dev, struct device_attribute *attr, char *buf)
 {
-       struct st_modedef *STm = (struct st_modedef *)class_get_devdata(class_dev);
+       struct st_modedef *STm = (struct st_modedef *)dev_get_drvdata(dev);
        ssize_t l = 0;
 
        l = snprintf(buf, PAGE_SIZE, "%d\n", STm->default_blksize);
        return l;
 }
 
-CLASS_DEVICE_ATTR(default_blksize, S_IRUGO, st_defblk_show, NULL);
+DEVICE_ATTR(default_blksize, S_IRUGO, st_defblk_show, NULL);
 
-static ssize_t st_defdensity_show(struct class_device *class_dev, char *buf)
+static ssize_t
+st_defdensity_show(struct device *dev, struct device_attribute *attr, char *buf)
 {
-       struct st_modedef *STm = (struct st_modedef *)class_get_devdata(class_dev);
+       struct st_modedef *STm = (struct st_modedef *)dev_get_drvdata(dev);
        ssize_t l = 0;
        char *fmt;
 
@@ -4352,22 +4355,25 @@ static ssize_t st_defdensity_show(struct class_device *class_dev, char *buf)
        return l;
 }
 
-CLASS_DEVICE_ATTR(default_density, S_IRUGO, st_defdensity_show, NULL);
+DEVICE_ATTR(default_density, S_IRUGO, st_defdensity_show, NULL);
 
-static ssize_t st_defcompression_show(struct class_device *class_dev, char *buf)
+static ssize_t
+st_defcompression_show(struct device *dev, struct device_attribute *attr,
+                      char *buf)
 {
-       struct st_modedef *STm = (struct st_modedef *)class_get_devdata(class_dev);
+       struct st_modedef *STm = (struct st_modedef *)dev_get_drvdata(dev);
        ssize_t l = 0;
 
        l = snprintf(buf, PAGE_SIZE, "%d\n", STm->default_compression - 1);
        return l;
 }
 
-CLASS_DEVICE_ATTR(default_compression, S_IRUGO, st_defcompression_show, NULL);
+DEVICE_ATTR(default_compression, S_IRUGO, st_defcompression_show, NULL);
 
-static ssize_t st_options_show(struct class_device *class_dev, char *buf)
+static ssize_t
+st_options_show(struct device *dev, struct device_attribute *attr, char *buf)
 {
-       struct st_modedef *STm = (struct st_modedef *)class_get_devdata(class_dev);
+       struct st_modedef *STm = (struct st_modedef *)dev_get_drvdata(dev);
        struct scsi_tape *STp;
        int i, j, options;
        ssize_t l = 0;
@@ -4403,13 +4409,13 @@ static ssize_t st_options_show(struct class_device *class_dev, char *buf)
        return l;
 }
 
-CLASS_DEVICE_ATTR(options, S_IRUGO, st_options_show, NULL);
+DEVICE_ATTR(options, S_IRUGO, st_options_show, NULL);
 
 static int do_create_class_files(struct scsi_tape *STp, int dev_num, int mode)
 {
        int i, rew, error;
        char name[10];
-       struct class_device *st_class_member;
+       struct device *st_class_member;
 
        for (rew=0; rew < 2; rew++) {
                /* Make sure that the minor numbers corresponding to the four
@@ -4418,32 +4424,32 @@ static int do_create_class_files(struct scsi_tape *STp, int dev_num, int mode)
                snprintf(name, 10, "%s%s%s", rew ? "n" : "",
                         STp->disk->disk_name, st_formats[i]);
                st_class_member =
-                       class_device_create(st_sysfs_class, NULL,
-                                           MKDEV(SCSI_TAPE_MAJOR,
-                                                 TAPE_MINOR(dev_num, mode, rew)),
-                                           &STp->device->sdev_gendev, "%s", name);
+                       device_create(st_sysfs_class, &STp->device->sdev_gendev,
+                                     MKDEV(SCSI_TAPE_MAJOR,
+                                               TAPE_MINOR(dev_num, mode, rew)),
+                                     "%s", name);
                if (IS_ERR(st_class_member)) {
-                       printk(KERN_WARNING "st%d: class_device_create failed\n",
+                       printk(KERN_WARNING "st%d: device_create failed\n",
                               dev_num);
                        error = PTR_ERR(st_class_member);
                        goto out;
                }
-               class_set_devdata(st_class_member, &STp->modes[mode]);
+               dev_set_drvdata(st_class_member, &STp->modes[mode]);
 
-               error = class_device_create_file(st_class_member,
-                                              &class_device_attr_defined);
+               error = device_create_file(st_class_member,
+                                          &dev_attr_defined);
                if (error) goto out;
-               error = class_device_create_file(st_class_member,
-                                           &class_device_attr_default_blksize);
+               error = device_create_file(st_class_member,
+                                          &dev_attr_default_blksize);
                if (error) goto out;
-               error = class_device_create_file(st_class_member,
-                                           &class_device_attr_default_density);
+               error = device_create_file(st_class_member,
+                                          &dev_attr_default_density);
                if (error) goto out;
-               error = class_device_create_file(st_class_member,
-                                       &class_device_attr_default_compression);
+               error = device_create_file(st_class_member,
+                                          &dev_attr_default_compression);
                if (error) goto out;
-               error = class_device_create_file(st_class_member,
-                                       &class_device_attr_options);
+               error = device_create_file(st_class_member,
+                                          &dev_attr_options);
                if (error) goto out;
 
                if (mode == 0 && rew == 0) {
index 32b9737759c45fdd3045cba8db1318d4d711ed86..0cc39f82d7c5ca3452112393f9138367d8ca4cad 100644 (file)
@@ -92,6 +92,9 @@ extern struct uart_cpm_port cpm_uart_ports[UART_NR];
 
 /* these are located in their respective files */
 void cpm_line_cr_cmd(struct uart_cpm_port *port, int cmd);
+void __iomem *cpm_uart_map_pram(struct uart_cpm_port *port,
+                               struct device_node *np);
+void cpm_uart_unmap_pram(struct uart_cpm_port *port, void __iomem *pram);
 int cpm_uart_init_portdesc(void);
 int cpm_uart_allocbuf(struct uart_cpm_port *pinfo, unsigned int is_con);
 void cpm_uart_freebuf(struct uart_cpm_port *pinfo);
index 236af9d3385123897985a84ff215cf395b3a2ff0..a638ba0679ac0f5f2342b4867c1cb5457a5e7c23 100644 (file)
@@ -966,24 +966,23 @@ static int cpm_uart_init_port(struct device_node *np,
        if (!mem)
                return -ENOMEM;
 
-       pram = of_iomap(np, 1);
-       if (!pram) {
-               ret = -ENOMEM;
-               goto out_mem;
-       }
-
        if (of_device_is_compatible(np, "fsl,cpm1-scc-uart") ||
            of_device_is_compatible(np, "fsl,cpm2-scc-uart")) {
                pinfo->sccp = mem;
-               pinfo->sccup = pram;
+               pinfo->sccup = pram = cpm_uart_map_pram(pinfo, np);
        } else if (of_device_is_compatible(np, "fsl,cpm1-smc-uart") ||
                   of_device_is_compatible(np, "fsl,cpm2-smc-uart")) {
                pinfo->flags |= FLAG_SMC;
                pinfo->smcp = mem;
-               pinfo->smcup = pram;
+               pinfo->smcup = pram = cpm_uart_map_pram(pinfo, np);
        } else {
                ret = -ENODEV;
-               goto out_pram;
+               goto out_mem;
+       }
+
+       if (!pram) {
+               ret = -ENOMEM;
+               goto out_mem;
        }
 
        pinfo->tx_nrfifos = TX_NUM_FIFO;
@@ -1007,7 +1006,7 @@ static int cpm_uart_init_port(struct device_node *np,
        return cpm_uart_request_port(&pinfo->port);
 
 out_pram:
-       iounmap(pram);
+       cpm_uart_unmap_pram(pinfo, pram);
 out_mem:
        iounmap(mem);
        return ret;
index 6ea0366e26ae68ab52f05c915c53058e4817942f..74f1432bb248e5ec5b7232d5f19318152e4e0a35 100644 (file)
@@ -45,6 +45,8 @@
 #include <linux/serial_core.h>
 #include <linux/kernel.h>
 
+#include <linux/of.h>
+
 #include "cpm_uart.h"
 
 /**************************************************************/
@@ -54,6 +56,18 @@ void cpm_line_cr_cmd(struct uart_cpm_port *port, int cmd)
 {
        cpm_command(port->command, cmd);
 }
+
+void __iomem *cpm_uart_map_pram(struct uart_cpm_port *port,
+                               struct device_node *np)
+{
+       return of_iomap(np, 1);
+}
+
+void cpm_uart_unmap_pram(struct uart_cpm_port *port, void __iomem *pram)
+{
+       iounmap(pram);
+}
+
 #else
 void cpm_line_cr_cmd(struct uart_cpm_port *port, int cmd)
 {
index d9af06a791ba51b77bbb9af8bb93d35299fc9d7d..bb862e2f54cfdbdd98d0243dbaebc33df4bcb4e1 100644 (file)
@@ -41,6 +41,9 @@
 #include <asm/io.h>
 #include <asm/irq.h>
 #include <asm/fs_pd.h>
+#ifdef CONFIG_PPC_CPM_NEW_BINDING
+#include <asm/prom.h>
+#endif
 
 #include <linux/serial_core.h>
 #include <linux/kernel.h>
@@ -54,6 +57,55 @@ void cpm_line_cr_cmd(struct uart_cpm_port *port, int cmd)
 {
        cpm_command(port->command, cmd);
 }
+
+void __iomem *cpm_uart_map_pram(struct uart_cpm_port *port,
+                               struct device_node *np)
+{
+       void __iomem *pram;
+       unsigned long offset;
+       struct resource res;
+       unsigned long len;
+
+       /* Don't remap parameter RAM if it has already been initialized
+        * during console setup.
+        */
+       if (IS_SMC(port) && port->smcup)
+               return port->smcup;
+       else if (!IS_SMC(port) && port->sccup)
+               return port->sccup;
+
+       if (of_address_to_resource(np, 1, &res))
+               return NULL;
+
+       len = 1 + res.end - res.start;
+       pram = ioremap(res.start, len);
+       if (!pram)
+               return NULL;
+
+       if (!IS_SMC(port))
+               return pram;
+
+       if (len != 2) {
+               printk(KERN_WARNING "cpm_uart[%d]: device tree references "
+                       "SMC pram, using boot loader/wrapper pram mapping. "
+                       "Please fix your device tree to reference the pram "
+                       "base register instead.\n",
+                       port->port.line);
+               return pram;
+       }
+
+       offset = cpm_dpalloc(PROFF_SMC_SIZE, 64);
+       out_be16(pram, offset);
+       iounmap(pram);
+       return cpm_muram_addr(offset);
+}
+
+void cpm_uart_unmap_pram(struct uart_cpm_port *port, void __iomem *pram)
+{
+       if (!IS_SMC(port))
+               iounmap(pram);
+}
+
 #else
 void cpm_line_cr_cmd(struct uart_cpm_port *port, int cmd)
 {
index 16ba9ac7a566b29ce016b0703f217897adc0a3ed..5a375bf0ebf4ab7756bf5ed3529f4f04b44acfde 100644 (file)
 #define SERIAL_IMX_MAJOR       204
 #define MINOR_START            41
 
-#define NR_PORTS               2
-
-#define IMX_ISR_PASS_LIMIT     256
-
-/*
- * This is the size of our serial port register set.
- */
-#define UART_PORT_SIZE 0x100
-
 /*
  * This determines how often we check the modem status signals
  * for any change.  They generally aren't connected to an IRQ
@@ -358,66 +349,60 @@ static irqreturn_t imx_rxint(int irq, void *dev_id)
        struct tty_struct *tty = sport->port.info->tty;
        unsigned long flags, temp;
 
-       rx = readl(sport->port.membase + URXD0);
        spin_lock_irqsave(&sport->port.lock,flags);
 
-       do {
+       while (readl(sport->port.membase + USR2) & USR2_RDR) {
                flg = TTY_NORMAL;
                sport->port.icount.rx++;
 
+               rx = readl(sport->port.membase + URXD0);
+
                temp = readl(sport->port.membase + USR2);
-               if( temp & USR2_BRCD ) {
+               if (temp & USR2_BRCD) {
                        writel(temp | USR2_BRCD, sport->port.membase + USR2);
-                       if(uart_handle_break(&sport->port))
-                               goto ignore_char;
+                       if (uart_handle_break(&sport->port))
+                               continue;
                }
 
                if (uart_handle_sysrq_char
                            (&sport->port, (unsigned char)rx))
-                       goto ignore_char;
+                       continue;
+
+               if (rx & (URXD_PRERR | URXD_OVRRUN | URXD_FRMERR) ) {
+                       if (rx & URXD_PRERR)
+                               sport->port.icount.parity++;
+                       else if (rx & URXD_FRMERR)
+                               sport->port.icount.frame++;
+                       if (rx & URXD_OVRRUN)
+                               sport->port.icount.overrun++;
+
+                       if (rx & sport->port.ignore_status_mask) {
+                               if (++ignored > 100)
+                                       goto out;
+                               continue;
+                       }
+
+                       rx &= sport->port.read_status_mask;
+
+                       if (rx & URXD_PRERR)
+                               flg = TTY_PARITY;
+                       else if (rx & URXD_FRMERR)
+                               flg = TTY_FRAME;
+                       if (rx & URXD_OVRRUN)
+                               flg = TTY_OVERRUN;
 
-               if( rx & (URXD_PRERR | URXD_OVRRUN | URXD_FRMERR) )
-                       goto handle_error;
+#ifdef SUPPORT_SYSRQ
+                       sport->port.sysrq = 0;
+#endif
+               }
 
-       error_return:
                tty_insert_flip_char(tty, rx, flg);
-
-       ignore_char:
-               rx = readl(sport->port.membase + URXD0);
-       } while(rx & URXD_CHARRDY);
+       }
 
 out:
        spin_unlock_irqrestore(&sport->port.lock,flags);
        tty_flip_buffer_push(tty);
        return IRQ_HANDLED;
-
-handle_error:
-       if (rx & URXD_PRERR)
-               sport->port.icount.parity++;
-       else if (rx & URXD_FRMERR)
-               sport->port.icount.frame++;
-       if (rx & URXD_OVRRUN)
-               sport->port.icount.overrun++;
-
-       if (rx & sport->port.ignore_status_mask) {
-               if (++ignored > 100)
-                       goto out;
-               goto ignore_char;
-       }
-
-       rx &= sport->port.read_status_mask;
-
-       if (rx & URXD_PRERR)
-               flg = TTY_PARITY;
-       else if (rx & URXD_FRMERR)
-               flg = TTY_FRAME;
-       if (rx & URXD_OVRRUN)
-               flg = TTY_OVERRUN;
-
-#ifdef SUPPORT_SYSRQ
-       sport->port.sysrq = 0;
-#endif
-       goto error_return;
 }
 
 /*
@@ -546,7 +531,7 @@ static int imx_startup(struct uart_port *port)
        writel(USR1_RTSD, sport->port.membase + USR1);
 
        temp = readl(sport->port.membase + UCR1);
-       temp |= (UCR1_TXMPTYEN | UCR1_RRDYEN | UCR1_RTSDEN | UCR1_UARTEN);
+       temp |= UCR1_RRDYEN | UCR1_RTSDEN | UCR1_UARTEN;
        writel(temp, sport->port.membase + UCR1);
 
        temp = readl(sport->port.membase + UCR2);
@@ -731,9 +716,11 @@ static const char *imx_type(struct uart_port *port)
  */
 static void imx_release_port(struct uart_port *port)
 {
-       struct imx_port *sport = (struct imx_port *)port;
+       struct platform_device *pdev = to_platform_device(port->dev);
+       struct resource *mmres;
 
-       release_mem_region(sport->port.mapbase, UART_PORT_SIZE);
+       mmres = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+       release_mem_region(mmres->start, mmres->end - mmres->start + 1);
 }
 
 /*
@@ -741,10 +728,18 @@ static void imx_release_port(struct uart_port *port)
  */
 static int imx_request_port(struct uart_port *port)
 {
-       struct imx_port *sport = (struct imx_port *)port;
+       struct platform_device *pdev = to_platform_device(port->dev);
+       struct resource *mmres;
+       void *ret;
+
+       mmres = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+       if (!mmres)
+               return -ENODEV;
+
+       ret = request_mem_region(mmres->start, mmres->end - mmres->start + 1,
+                       "imx-uart");
 
-       return request_mem_region(sport->port.mapbase, UART_PORT_SIZE,
-                       "imx-uart") != NULL ? 0 : -EBUSY;
+       return  ret ? 0 : -EBUSY;
 }
 
 /*
@@ -815,7 +810,7 @@ static struct imx_port imx_ports[] = {
                .type           = PORT_IMX,
                .iotype         = UPIO_MEM,
                .membase        = (void *)IMX_UART1_BASE,
-               .mapbase        = IMX_UART1_BASE, /* FIXME */
+               .mapbase        = 0x00206000,
                .irq            = UART1_MINT_RX,
                .uartclk        = 16000000,
                .fifosize       = 32,
@@ -831,7 +826,7 @@ static struct imx_port imx_ports[] = {
                .type           = PORT_IMX,
                .iotype         = UPIO_MEM,
                .membase        = (void *)IMX_UART2_BASE,
-               .mapbase        = IMX_UART2_BASE, /* FIXME */
+               .mapbase        = 0x00207000,
                .irq            = UART2_MINT_RX,
                .uartclk        = 16000000,
                .fifosize       = 32,
index 99af084c7cecdfadc5f32205c05cc97daec48eda..ddd3aa50d4adef5de5e136df8fbd5fa3a8738ad8 100644 (file)
@@ -40,7 +40,6 @@
 #include <asm/io.h>
 #include <asm/irq.h>
 #include <asm/system.h>
-#include <asm/semaphore.h>
 #include <asm/delay.h>
 #include <asm/coldfire.h>
 #include <asm/mcfsim.h>
index c0e50a461055b85a5b4dd8e6996692679e62c1c1..8aacfb78deabe03e08ca8d8b4df0e6235eff35ee 100644 (file)
@@ -56,7 +56,9 @@ static int __devinit of_platform_serial_setup(struct of_device *ofdev,
        port->flags = UPF_SHARE_IRQ | UPF_BOOT_AUTOCONF | UPF_IOREMAP
                | UPF_FIXED_PORT;
        port->dev = &ofdev->dev;
-       port->custom_divisor = *clk / (16 * (*spd));
+       /* If current-speed was set, then try not to change it. */
+       if (spd)
+               port->custom_divisor = *clk / (16 * (*spd));
 
        return 0;
 }
index c32c1ca75f631c09dc5a348d7218f0d9c805e481..a9ca03ead3e5dc0337b9b7a1eecdf8bb4ce1569a 100644 (file)
@@ -2422,7 +2422,7 @@ int uart_add_one_port(struct uart_driver *drv, struct uart_port *port)
         */
        tty_dev = tty_register_device(drv->tty_driver, port->line, port->dev);
        if (likely(!IS_ERR(tty_dev))) {
-               device_can_wakeup(tty_dev) = 1;
+               device_init_wakeup(tty_dev, 1);
                device_set_wakeup_enable(tty_dev, 0);
        } else
                printk(KERN_ERR "Cannot register tty device on line %d\n",
index eff593080d4fe8358886fd02e88672704d21bfa8..c2ea5d4df44a07c5aab6ae01bb86b9a73cade4d0 100644 (file)
@@ -333,7 +333,6 @@ static void sci_init_pins_scif(struct uart_port *port, unsigned int cflag)
        }
        sci_out(port, SCFCR, fcr_val);
 }
-
 #elif defined(CONFIG_CPU_SH3)
 /* For SH7705, SH7706, SH7707, SH7709, SH7709A, SH7729 */
 static void sci_init_pins_scif(struct uart_port *port, unsigned int cflag)
@@ -384,6 +383,12 @@ static void sci_init_pins_scif(struct uart_port *port, unsigned int cflag)
 
        sci_out(port, SCFCR, fcr_val);
 }
+#elif defined(CONFIG_CPU_SUBTYPE_SH7723)
+static void sci_init_pins_scif(struct uart_port *port, unsigned int cflag)
+{
+       /* Nothing to do here.. */
+       sci_out(port, SCFCR, 0);
+}
 #else
 /* For SH7750 */
 static void sci_init_pins_scif(struct uart_port *port, unsigned int cflag)
index 01a9dd715f5d5bc26c3dae1fe0ce71e334ccac04..fa8700a968fc4be01018a1a916e0660fed6e6530 100644 (file)
@@ -1,20 +1,5 @@
-/* $Id: sh-sci.h,v 1.4 2004/02/19 16:43:56 lethal Exp $
- *
- *  linux/drivers/serial/sh-sci.h
- *
- *  SuperH on-chip serial module support.  (SCI with no FIFO / with FIFO)
- *  Copyright (C) 1999, 2000  Niibe Yutaka
- *  Copyright (C) 2000  Greg Banks
- *  Copyright (C) 2002, 2003  Paul Mundt
- *  Modified to support multiple serial ports. Stuart Menefy (May 2000).
- *  Modified to support SH7300(SH-Mobile) SCIF. Takashi Kusuda (Jun 2003).
- *  Modified to support H8/300 Series Yoshinori Sato (Feb 2004).
- *  Removed SH7300 support (Jul 2007).
- *  Modified to support SH7720 SCIF. Markus Brunner, Mark Jonas (Aug 2007).
- */
 #include <linux/serial_core.h>
 #include <asm/io.h>
-
 #include <asm/gpio.h>
 
 #if defined(CONFIG_H83007) || defined(CONFIG_H83068)
 # define SCSPTR0               SCPDR0
 # define SCIF_ORER             0x0001  /* overrun error bit */
 # define SCSCR_INIT(port)      0x0038  /* TIE=0,RIE=0,TE=1,RE=1,REIE=1 */
+#elif defined(CONFIG_CPU_SUBTYPE_SH7723)
+# define SCSPTR0                0xa4050160
+# define SCSPTR1                0xa405013e
+# define SCSPTR2                0xa4050160
+# define SCSPTR3                0xa405013e
+# define SCSPTR4                0xa4050128
+# define SCSPTR5                0xa4050128
+# define SCIF_ORER              0x0001  /* overrun error bit */
+# define SCSCR_INIT(port)       0x0038  /* TIE=0,RIE=0,TE=1,RE=1,REIE=1 */
 # define SCIF_ONLY
 #elif defined(CONFIG_CPU_SUBTYPE_SH4_202)
 # define SCSPTR2 0xffe80020 /* 16 bit SCIF */
                  h8_sci_offset, h8_sci_size) \
   CPU_SCI_FNS(name, h8_sci_offset, h8_sci_size)
 #define SCIF_FNS(name, sh3_scif_offset, sh3_scif_size, sh4_scif_offset, sh4_scif_size)
+#elif defined(CONFIG_CPU_SUBTYPE_SH7723)
+        #define SCIx_FNS(name, sh4_scifa_offset, sh4_scifa_size, sh4_scif_offset, sh4_scif_size) \
+                CPU_SCIx_FNS(name, sh4_scifa_offset, sh4_scifa_size, sh4_scif_offset, sh4_scif_size)
+        #define SCIF_FNS(name, sh4_scif_offset, sh4_scif_size) \
+                CPU_SCIF_FNS(name, sh4_scif_offset, sh4_scif_size)
 #else
 #define SCIx_FNS(name, sh3_sci_offset, sh3_sci_size, sh4_sci_offset, sh4_sci_size, \
                 sh3_scif_offset, sh3_scif_size, sh4_scif_offset, sh4_scif_size, \
@@ -419,6 +418,18 @@ SCIF_FNS(SCFDR,  0x1c, 16)
 SCIF_FNS(SCxTDR, 0x20,  8)
 SCIF_FNS(SCxRDR, 0x24,  8)
 SCIF_FNS(SCLSR,  0x24, 16)
+#elif defined(CONFIG_CPU_SUBTYPE_SH7723)
+SCIx_FNS(SCSMR,  0x00, 16, 0x00, 16)
+SCIx_FNS(SCBRR,  0x04,  8, 0x04,  8)
+SCIx_FNS(SCSCR,  0x08, 16, 0x08, 16)
+SCIx_FNS(SCxTDR, 0x20,  8, 0x0c,  8)
+SCIx_FNS(SCxSR,  0x14, 16, 0x10, 16)
+SCIx_FNS(SCxRDR, 0x24,  8, 0x14,  8)
+SCIF_FNS(SCTDSR, 0x0c,  8)
+SCIF_FNS(SCFER,  0x10, 16)
+SCIF_FNS(SCFCR,  0x18, 16)
+SCIF_FNS(SCFDR,  0x1c, 16)
+SCIF_FNS(SCLSR,  0x24, 16)
 #else
 /*      reg      SCI/SH3   SCI/SH4  SCIF/SH3   SCIF/SH4  SCI/H8*/
 /*      name     off  sz   off  sz   off  sz   off  sz   off  sz*/
@@ -589,6 +600,23 @@ static inline int sci_rxd_in(struct uart_port *port)
                return ctrl_inb(SCPDR0) & 0x0001 ? 1 : 0; /* SCIF0 */
        return 1;
 }
+#elif defined(CONFIG_CPU_SUBTYPE_SH7723)
+static inline int sci_rxd_in(struct uart_port *port)
+{
+        if (port->mapbase == 0xffe00000)
+                return ctrl_inb(SCSPTR0) & 0x0008 ? 1 : 0; /* SCIF0 */
+        if (port->mapbase == 0xffe10000)
+                return ctrl_inb(SCSPTR1) & 0x0020 ? 1 : 0; /* SCIF1 */
+        if (port->mapbase == 0xffe20000)
+                return ctrl_inb(SCSPTR2) & 0x0001 ? 1 : 0; /* SCIF2 */
+        if (port->mapbase == 0xa4e30000)
+                return ctrl_inb(SCSPTR3) & 0x0001 ? 1 : 0; /* SCIF3 */
+        if (port->mapbase == 0xa4e40000)
+                return ctrl_inb(SCSPTR4) & 0x0001 ? 1 : 0; /* SCIF4 */
+        if (port->mapbase == 0xa4e50000)
+                return ctrl_inb(SCSPTR5) & 0x0008 ? 1 : 0; /* SCIF5 */
+        return 1;
+}
 #elif defined(CONFIG_CPU_SUBTYPE_SH5_101) || defined(CONFIG_CPU_SUBTYPE_SH5_103)
 static inline int sci_rxd_in(struct uart_port *port)
 {
@@ -727,6 +755,8 @@ static inline int sci_rxd_in(struct uart_port *port)
       defined(CONFIG_CPU_SUBTYPE_SH7720) || \
       defined(CONFIG_CPU_SUBTYPE_SH7721)
 #define SCBRR_VALUE(bps, clk) (((clk*2)+16*bps)/(32*bps)-1)
+#elif defined(CONFIG_CPU_SUBTYPE_SH7723)
+#define SCBRR_VALUE(bps, clk) (((clk*2)+16*bps)/(16*bps)-1)
 #elif defined(__H8300H__) || defined(__H8300S__)
 #define SCBRR_VALUE(bps) (((CONFIG_CPU_CLOCK*1000/32)/bps)-1)
 #elif defined(CONFIG_SUPERH64)
index e0994f0610018838310cc43196632c5d24045540..5e4310ccd5914ecc26983a8ad51bc3bd5fd61624 100644 (file)
@@ -1270,10 +1270,18 @@ static int ucc_uart_probe(struct of_device *ofdev,
 
        /* Get the UCC number (device ID) */
        /* UCCs are numbered 1-7 */
-       iprop = of_get_property(np, "device-id", NULL);
-       if (!iprop || (*iprop < 1) || (*iprop > UCC_MAX_NUM)) {
-               dev_err(&ofdev->dev,
-                       "missing or invalid UCC specified in device tree\n");
+       iprop = of_get_property(np, "cell-index", NULL);
+       if (!iprop) {
+               iprop = of_get_property(np, "device-id", NULL);
+               if (!iprop) {
+                       dev_err(&ofdev->dev, "UCC is unspecified in "
+                               "device tree\n");
+                       return -EINVAL;
+               }
+       }
+
+       if ((*iprop < 1) || (*iprop > UCC_MAX_NUM)) {
+               dev_err(&ofdev->dev, "no support for UCC%u\n", *iprop);
                kfree(qe_port);
                return -ENODEV;
        }
index b778ed71f636164dc721fd85a23a8dfb5594cc2f..a4aaab9c7ddcd3f1a5546175a262ad0b84310a73 100644 (file)
@@ -1,8 +1,6 @@
-menu "Userspace I/O"
-       depends on !S390
-
-config UIO
+menuconfig UIO
        tristate "Userspace I/O drivers"
+       depends on !S390
        default n
        help
          Enable this to allow the userspace driver core code to be
@@ -13,6 +11,8 @@ config UIO
 
          If you don't know what to do here, say N.
 
+if UIO
+
 config UIO_CIF
        tristate "generic Hilscher CIF Card driver"
        depends on UIO && PCI
@@ -26,4 +26,17 @@ config UIO_CIF
          To compile this driver as a module, choose M here: the module
          will be called uio_cif.
 
-endmenu
+config UIO_SMX
+       tristate "SMX cryptengine UIO interface"
+       depends on UIO
+       default n
+       help
+         Userspace IO interface to the Cryptography engine found on the
+         Nias Digital SMX boards.  These will be available from Q4 2008
+         from http://www.niasdigital.com.  The userspace part of this
+         driver will be released under the GPL at the same time as the
+         hardware and will be able to be downloaded from the same site.
+
+         If you compile this as a module, it will be called uio_smx.
+
+endif
index 7fecfb459da52d13137e922d04589777416378aa..18c45662431e302fe1b5014b3b9ca8968643f3ba 100644 (file)
@@ -1,2 +1,3 @@
 obj-$(CONFIG_UIO)      += uio.o
 obj-$(CONFIG_UIO_CIF)  += uio_cif.o
+obj-$(CONFIG_UIO_SMX)  += uio_smx.o
index 11759080ca547058809b516aaacbc8f979ff77d5..55cc7b80422a0617dab71e8adbf34c9d854cc5ac 100644 (file)
@@ -301,23 +301,33 @@ static int uio_open(struct inode *inode, struct file *filep)
        if (!idev)
                return -ENODEV;
 
+       if (!try_module_get(idev->owner))
+               return -ENODEV;
+
        listener = kmalloc(sizeof(*listener), GFP_KERNEL);
-       if (!listener)
-               return -ENOMEM;
+       if (!listener) {
+               ret = -ENOMEM;
+               goto err_alloc_listener;
+       }
 
        listener->dev = idev;
        listener->event_count = atomic_read(&idev->event);
        filep->private_data = listener;
 
        if (idev->info->open) {
-               if (!try_module_get(idev->owner))
-                       return -ENODEV;
                ret = idev->info->open(idev->info, inode);
-               module_put(idev->owner);
+               if (ret)
+                       goto err_infoopen;
        }
 
-       if (ret)
-               kfree(listener);
+       return 0;
+
+err_infoopen:
+
+       kfree(listener);
+err_alloc_listener:
+
+       module_put(idev->owner);
 
        return ret;
 }
@@ -336,12 +346,11 @@ static int uio_release(struct inode *inode, struct file *filep)
        struct uio_listener *listener = filep->private_data;
        struct uio_device *idev = listener->dev;
 
-       if (idev->info->release) {
-               if (!try_module_get(idev->owner))
-                       return -ENODEV;
+       if (idev->info->release)
                ret = idev->info->release(idev->info, inode);
-               module_put(idev->owner);
-       }
+
+       module_put(idev->owner);
+
        if (filep->f_flags & FASYNC)
                ret = uio_fasync(-1, filep, 0);
        kfree(listener);
@@ -510,10 +519,7 @@ static int uio_mmap(struct file *filep, struct vm_area_struct *vma)
                return -EINVAL;
 
        if (idev->info->mmap) {
-               if (!try_module_get(idev->owner))
-                       return -ENODEV;
                ret = idev->info->mmap(idev->info, vma);
-               module_put(idev->owner);
                return ret;
        }
 
index 838bae4608318857df5ac5500fe9e69dd7b30f24..57376060b97858d3afb10fa9f1ab494cf8a8f34f 100644 (file)
 
 #include <asm/io.h>
 
-#ifndef PCI_DEVICE_ID_PLX_9030
-#define PCI_DEVICE_ID_PLX_9030 0x9030
-#endif
-
 #define PLX9030_INTCSR         0x4C
 #define INTSCR_INT1_ENABLE     0x01
 #define INTSCR_INT1_STATUS     0x04
@@ -116,7 +112,7 @@ static void hilscher_pci_remove(struct pci_dev *dev)
        kfree (info);
 }
 
-static struct pci_device_id hilscher_pci_ids[] = {
+static struct pci_device_id hilscher_pci_ids[] __devinitdata = {
        {
                .vendor =       PCI_VENDOR_ID_PLX,
                .device =       PCI_DEVICE_ID_PLX_9030,
diff --git a/drivers/uio/uio_smx.c b/drivers/uio/uio_smx.c
new file mode 100644 (file)
index 0000000..44054a6
--- /dev/null
@@ -0,0 +1,140 @@
+/*
+ * UIO SMX Cryptengine driver.
+ *
+ * (C) 2008 Nias Digital P/L <bn@niasdigital.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ */
+
+#include <linux/device.h>
+#include <linux/module.h>
+#include <linux/platform_device.h>
+#include <linux/uio_driver.h>
+#include <linux/io.h>
+
+#define DRV_NAME "smx-ce"
+#define DRV_VERSION "0.03"
+
+#define SMX_CSR  0x00000000
+#define SMX_EnD  0x00000001
+#define SMX_RUN  0x00000002
+#define SMX_DRDY 0x00000004
+#define SMX_ERR  0x00000008
+
+static irqreturn_t smx_handler(int irq, struct uio_info *dev_info)
+{
+       void __iomem *csr = dev_info->mem[0].internal_addr + SMX_CSR;
+
+       u32 status = ioread32(csr);
+
+       if (!(status & SMX_DRDY))
+               return IRQ_NONE;
+
+       /* Disable interrupt */
+       iowrite32(status & ~SMX_DRDY, csr);
+       return IRQ_HANDLED;
+}
+
+static int __devinit smx_ce_probe(struct platform_device *dev)
+{
+
+       int ret = -ENODEV;
+       struct uio_info *info;
+       struct resource *regs;
+
+       info = kzalloc(sizeof(struct uio_info), GFP_KERNEL);
+       if (!info)
+               return -ENOMEM;
+
+       regs = platform_get_resource(dev, IORESOURCE_MEM, 0);
+       if (!regs) {
+               dev_err(&dev->dev, "No memory resource specified\n");
+               goto out_free;
+       }
+
+       info->mem[0].addr = regs->start;
+       if (!info->mem[0].addr) {
+               dev_err(&dev->dev, "Invalid memory resource\n");
+               goto out_free;
+       }
+
+       info->mem[0].size = regs->end - regs->start + 1;
+       info->mem[0].internal_addr = ioremap(regs->start, info->mem[0].size);
+
+       if (!info->mem[0].internal_addr) {
+               dev_err(&dev->dev, "Can't remap memory address range\n");
+               goto out_free;
+       }
+
+       info->mem[0].memtype = UIO_MEM_PHYS;
+
+       info->name = "smx-ce";
+       info->version = "0.03";
+
+       info->irq = platform_get_irq(dev, 0);
+       if (info->irq < 0) {
+               ret = info->irq;
+               dev_err(&dev->dev, "No (or invalid) IRQ resource specified\n");
+               goto out_unmap;
+       }
+
+       info->irq_flags = IRQF_SHARED;
+       info->handler = smx_handler;
+
+       platform_set_drvdata(dev, info);
+
+       ret = uio_register_device(&dev->dev, info);
+
+       if (ret)
+               goto out_unmap;
+
+       return 0;
+
+out_unmap:
+       iounmap(info->mem[0].internal_addr);
+out_free:
+       kfree(info);
+
+       return ret;
+}
+
+static int __devexit smx_ce_remove(struct platform_device *dev)
+{
+       struct uio_info *info = platform_get_drvdata(dev);
+
+       uio_unregister_device(info);
+       platform_set_drvdata(dev, NULL);
+       iounmap(info->mem[0].internal_addr);
+
+       kfree(info);
+
+       return 0;
+}
+
+static struct platform_driver smx_ce_driver = {
+       .probe          = smx_ce_probe,
+       .remove         = __devexit_p(smx_ce_remove),
+       .driver         = {
+               .name   = DRV_NAME,
+               .owner  = THIS_MODULE,
+       },
+};
+
+static int __init smx_ce_init_module(void)
+{
+       return platform_driver_register(&smx_ce_driver);
+}
+module_init(smx_ce_init_module);
+
+static void __exit smx_ce_exit_module(void)
+{
+       platform_driver_unregister(&smx_ce_driver);
+}
+module_exit(smx_ce_exit_module);
+
+MODULE_LICENSE("GPL v2");
+MODULE_VERSION(DRV_VERSION);
+MODULE_AUTHOR("Ben Nizette <bn@niasdigital.com>");
index ff8551e933723c25e16f9524a88458e413e4454b..fc6c2be5999c04574e506db1b01f80b07857db6f 100644 (file)
@@ -24,7 +24,6 @@
 #ifndef        _USBATM_H_
 #define        _USBATM_H_
 
-#include <asm/semaphore.h>
 #include <linux/atm.h>
 #include <linux/atmdev.h>
 #include <linux/completion.h>
index 68fc5219ca152ae45144cd541f85ff0f0008a8d4..57aeca160f3837a6cc39b580a8192d086cc15e9b 100644 (file)
@@ -23,7 +23,6 @@
 #include <linux/mutex.h>
 #include <linux/freezer.h>
 
-#include <asm/semaphore.h>
 #include <asm/uaccess.h>
 #include <asm/byteorder.h>
 
index 6f45dd669b3378a3f4bd0c9970fe65fdcdae6cbb..d681bb27fa5815a10cd49cfda60812e7f1cd2bd8 100644 (file)
@@ -118,10 +118,10 @@ config USB_AMD5536UDC
 config USB_GADGET_ATMEL_USBA
        boolean "Atmel USBA"
        select USB_GADGET_DUALSPEED
-       depends on AVR32
+       depends on AVR32 || ARCH_AT91CAP9
        help
          USBA is the integrated high-speed USB Device controller on
-         the AT32AP700x processors from Atmel.
+         the AT32AP700x and AT91CAP9 processors from Atmel.
 
 config USB_ATMEL_USBA
        tristate
index b0db4c31d01854984a9b5b1e6f84d9d6fe88bc1a..e756023362c26e0429059764ee1630d867624a0f 100644 (file)
@@ -18,6 +18,7 @@
 #include <linux/platform_device.h>
 #include <linux/usb/ch9.h>
 #include <linux/usb/gadget.h>
+#include <linux/usb/atmel_usba_udc.h>
 #include <linux/delay.h>
 
 #include <asm/gpio.h>
@@ -27,6 +28,7 @@
 
 
 static struct usba_udc the_udc;
+static struct usba_ep *usba_ep;
 
 #ifdef CONFIG_USB_GADGET_DEBUG_FS
 #include <linux/debugfs.h>
@@ -324,53 +326,28 @@ static int vbus_is_present(struct usba_udc *udc)
        return 1;
 }
 
-static void copy_to_fifo(void __iomem *fifo, const void *buf, int len)
+#if defined(CONFIG_AVR32)
+
+static void toggle_bias(int is_on)
 {
-       unsigned long tmp;
-
-       DBG(DBG_FIFO, "copy to FIFO (len %d):\n", len);
-       for (; len > 0; len -= 4, buf += 4, fifo += 4) {
-               tmp = *(unsigned long *)buf;
-               if (len >= 4) {
-                       DBG(DBG_FIFO, "  -> %08lx\n", tmp);
-                       __raw_writel(tmp, fifo);
-               } else {
-                       do {
-                               DBG(DBG_FIFO, "  -> %02lx\n", tmp >> 24);
-                               __raw_writeb(tmp >> 24, fifo);
-                               fifo++;
-                               tmp <<= 8;
-                       } while (--len);
-                       break;
-               }
-       }
 }
 
-static void copy_from_fifo(void *buf, void __iomem *fifo, int len)
+#elif defined(CONFIG_ARCH_AT91)
+
+#include <asm/arch/at91_pmc.h>
+
+static void toggle_bias(int is_on)
 {
-       union {
-               unsigned long *w;
-               unsigned char *b;
-       } p;
-       unsigned long tmp;
-
-       DBG(DBG_FIFO, "copy from FIFO (len %d):\n", len);
-       for (p.w = buf; len > 0; len -= 4, p.w++, fifo += 4) {
-               if (len >= 4) {
-                       tmp = __raw_readl(fifo);
-                       *p.w = tmp;
-                       DBG(DBG_FIFO, "  -> %08lx\n", tmp);
-               } else {
-                       do {
-                               tmp = __raw_readb(fifo);
-                               *p.b = tmp;
-                               DBG(DBG_FIFO, " -> %02lx\n", tmp);
-                               fifo++, p.b++;
-                       } while (--len);
-               }
-       }
+       unsigned int uckr = at91_sys_read(AT91_CKGR_UCKR);
+
+       if (is_on)
+               at91_sys_write(AT91_CKGR_UCKR, uckr | AT91_PMC_BIASEN);
+       else
+               at91_sys_write(AT91_CKGR_UCKR, uckr & ~(AT91_PMC_BIASEN));
 }
 
+#endif /* CONFIG_ARCH_AT91 */
+
 static void next_fifo_transaction(struct usba_ep *ep, struct usba_request *req)
 {
        unsigned int transaction_len;
@@ -387,7 +364,7 @@ static void next_fifo_transaction(struct usba_ep *ep, struct usba_request *req)
                ep->ep.name, req, transaction_len,
                req->last_transaction ? ", done" : "");
 
-       copy_to_fifo(ep->fifo, req->req.buf + req->req.actual, transaction_len);
+       memcpy_toio(ep->fifo, req->req.buf + req->req.actual, transaction_len);
        usba_ep_writel(ep, SET_STA, USBA_TX_PK_RDY);
        req->req.actual += transaction_len;
 }
@@ -476,7 +453,7 @@ static void receive_data(struct usba_ep *ep)
                        bytecount = req->req.length - req->req.actual;
                }
 
-               copy_from_fifo(req->req.buf + req->req.actual,
+               memcpy_fromio(req->req.buf + req->req.actual,
                                ep->fifo, bytecount);
                req->req.actual += bytecount;
 
@@ -1029,33 +1006,6 @@ static const struct usb_gadget_ops usba_udc_ops = {
        .set_selfpowered        = usba_udc_set_selfpowered,
 };
 
-#define EP(nam, idx, maxpkt, maxbk, dma, isoc)                 \
-{                                                              \
-       .ep     = {                                             \
-               .ops            = &usba_ep_ops,                 \
-               .name           = nam,                          \
-               .maxpacket      = maxpkt,                       \
-       },                                                      \
-       .udc            = &the_udc,                             \
-       .queue          = LIST_HEAD_INIT(usba_ep[idx].queue),   \
-       .fifo_size      = maxpkt,                               \
-       .nr_banks       = maxbk,                                \
-       .index          = idx,                                  \
-       .can_dma        = dma,                                  \
-       .can_isoc       = isoc,                                 \
-}
-
-static struct usba_ep usba_ep[] = {
-       EP("ep0", 0, 64, 1, 0, 0),
-       EP("ep1in-bulk", 1, 512, 2, 1, 1),
-       EP("ep2out-bulk", 2, 512, 2, 1, 1),
-       EP("ep3in-int", 3, 64, 3, 1, 0),
-       EP("ep4out-int", 4, 64, 3, 1, 0),
-       EP("ep5in-iso", 5, 1024, 3, 1, 1),
-       EP("ep6out-iso", 6, 1024, 3, 1, 1),
-};
-#undef EP
-
 static struct usb_endpoint_descriptor usba_ep0_desc = {
        .bLength = USB_DT_ENDPOINT_SIZE,
        .bDescriptorType = USB_DT_ENDPOINT,
@@ -1074,7 +1024,6 @@ static void nop_release(struct device *dev)
 static struct usba_udc the_udc = {
        .gadget = {
                .ops            = &usba_udc_ops,
-               .ep0            = &usba_ep[0].ep,
                .ep_list        = LIST_HEAD_INIT(the_udc.gadget.ep_list),
                .is_dualspeed   = 1,
                .name           = "atmel_usba_udc",
@@ -1231,7 +1180,7 @@ static int do_test_mode(struct usba_udc *udc)
                } else {
                        usba_ep_writel(ep, CTL_ENB, USBA_EPT_ENABLE);
                        usba_writel(udc, TST, USBA_TST_PKT_MODE);
-                       copy_to_fifo(ep->fifo, test_packet_buffer,
+                       memcpy_toio(ep->fifo, test_packet_buffer,
                                        sizeof(test_packet_buffer));
                        usba_ep_writel(ep, SET_STA, USBA_TX_PK_RDY);
                        dev_info(dev, "Entering Test_Packet mode...\n");
@@ -1530,13 +1479,13 @@ restart:
                DBG(DBG_HW, "Packet length: %u\n", pkt_len);
                if (pkt_len != sizeof(crq)) {
                        pr_warning("udc: Invalid packet length %u "
-                               "(expected %lu)\n", pkt_len, sizeof(crq));
+                               "(expected %zu)\n", pkt_len, sizeof(crq));
                        set_protocol_stall(udc, ep);
                        return;
                }
 
                DBG(DBG_FIFO, "Copying ctrl request from 0x%p:\n", ep->fifo);
-               copy_from_fifo(crq.data, ep->fifo, sizeof(crq));
+               memcpy_fromio(crq.data, ep->fifo, sizeof(crq));
 
                /* Free up one bank in the FIFO so that we can
                 * generate or receive a reply right away. */
@@ -1688,6 +1637,7 @@ static irqreturn_t usba_udc_irq(int irq, void *devid)
        DBG(DBG_INT, "irq, status=%#08x\n", status);
 
        if (status & USBA_DET_SUSPEND) {
+               toggle_bias(0);
                usba_writel(udc, INT_CLR, USBA_DET_SUSPEND);
                DBG(DBG_BUS, "Suspend detected\n");
                if (udc->gadget.speed != USB_SPEED_UNKNOWN
@@ -1699,6 +1649,7 @@ static irqreturn_t usba_udc_irq(int irq, void *devid)
        }
 
        if (status & USBA_WAKE_UP) {
+               toggle_bias(1);
                usba_writel(udc, INT_CLR, USBA_WAKE_UP);
                DBG(DBG_BUS, "Wake Up CPU detected\n");
        }
@@ -1792,12 +1743,14 @@ static irqreturn_t usba_vbus_irq(int irq, void *devid)
        vbus = gpio_get_value(udc->vbus_pin);
        if (vbus != udc->vbus_prev) {
                if (vbus) {
-                       usba_writel(udc, CTRL, USBA_EN_USBA);
+                       toggle_bias(1);
+                       usba_writel(udc, CTRL, USBA_ENABLE_MASK);
                        usba_writel(udc, INT_ENB, USBA_END_OF_RESET);
                } else {
                        udc->gadget.speed = USB_SPEED_UNKNOWN;
                        reset_all_endpoints(udc);
-                       usba_writel(udc, CTRL, 0);
+                       toggle_bias(0);
+                       usba_writel(udc, CTRL, USBA_DISABLE_MASK);
                        spin_unlock(&udc->lock);
                        udc->driver->disconnect(&udc->gadget);
                        spin_lock(&udc->lock);
@@ -1850,7 +1803,8 @@ int usb_gadget_register_driver(struct usb_gadget_driver *driver)
        /* If Vbus is present, enable the controller and wait for reset */
        spin_lock_irqsave(&udc->lock, flags);
        if (vbus_is_present(udc) && udc->vbus_prev == 0) {
-               usba_writel(udc, CTRL, USBA_EN_USBA);
+               toggle_bias(1);
+               usba_writel(udc, CTRL, USBA_ENABLE_MASK);
                usba_writel(udc, INT_ENB, USBA_END_OF_RESET);
        }
        spin_unlock_irqrestore(&udc->lock, flags);
@@ -1883,7 +1837,8 @@ int usb_gadget_unregister_driver(struct usb_gadget_driver *driver)
        spin_unlock_irqrestore(&udc->lock, flags);
 
        /* This will also disable the DP pullup */
-       usba_writel(udc, CTRL, 0);
+       toggle_bias(0);
+       usba_writel(udc, CTRL, USBA_DISABLE_MASK);
 
        driver->unbind(&udc->gadget);
        udc->gadget.dev.driver = NULL;
@@ -1908,7 +1863,7 @@ static int __init usba_udc_probe(struct platform_device *pdev)
 
        regs = platform_get_resource(pdev, IORESOURCE_MEM, CTRL_IOMEM_ID);
        fifo = platform_get_resource(pdev, IORESOURCE_MEM, FIFO_IOMEM_ID);
-       if (!regs || !fifo)
+       if (!regs || !fifo || !pdata)
                return -ENXIO;
 
        irq = platform_get_irq(pdev, 0);
@@ -1953,19 +1908,48 @@ static int __init usba_udc_probe(struct platform_device *pdev)
 
        /* Make sure we start from a clean slate */
        clk_enable(pclk);
-       usba_writel(udc, CTRL, 0);
+       toggle_bias(0);
+       usba_writel(udc, CTRL, USBA_DISABLE_MASK);
        clk_disable(pclk);
 
+       usba_ep = kmalloc(sizeof(struct usba_ep) * pdata->num_ep,
+                         GFP_KERNEL);
+       if (!usba_ep)
+               goto err_alloc_ep;
+
+       the_udc.gadget.ep0 = &usba_ep[0].ep;
+
        INIT_LIST_HEAD(&usba_ep[0].ep.ep_list);
        usba_ep[0].ep_regs = udc->regs + USBA_EPT_BASE(0);
        usba_ep[0].dma_regs = udc->regs + USBA_DMA_BASE(0);
        usba_ep[0].fifo = udc->fifo + USBA_FIFO_BASE(0);
-       for (i = 1; i < ARRAY_SIZE(usba_ep); i++) {
+       usba_ep[0].ep.ops = &usba_ep_ops;
+       usba_ep[0].ep.name = pdata->ep[0].name;
+       usba_ep[0].ep.maxpacket = pdata->ep[0].fifo_size;
+       usba_ep[0].udc = &the_udc;
+       INIT_LIST_HEAD(&usba_ep[0].queue);
+       usba_ep[0].fifo_size = pdata->ep[0].fifo_size;
+       usba_ep[0].nr_banks = pdata->ep[0].nr_banks;
+       usba_ep[0].index = pdata->ep[0].index;
+       usba_ep[0].can_dma = pdata->ep[0].can_dma;
+       usba_ep[0].can_isoc = pdata->ep[0].can_isoc;
+
+       for (i = 1; i < pdata->num_ep; i++) {
                struct usba_ep *ep = &usba_ep[i];
 
                ep->ep_regs = udc->regs + USBA_EPT_BASE(i);
                ep->dma_regs = udc->regs + USBA_DMA_BASE(i);
                ep->fifo = udc->fifo + USBA_FIFO_BASE(i);
+               ep->ep.ops = &usba_ep_ops;
+               ep->ep.name = pdata->ep[i].name;
+               ep->ep.maxpacket = pdata->ep[i].fifo_size;
+               ep->udc = &the_udc;
+               INIT_LIST_HEAD(&ep->queue);
+               ep->fifo_size = pdata->ep[i].fifo_size;
+               ep->nr_banks = pdata->ep[i].nr_banks;
+               ep->index = pdata->ep[i].index;
+               ep->can_dma = pdata->ep[i].can_dma;
+               ep->can_isoc = pdata->ep[i].can_isoc;
 
                list_add_tail(&ep->ep.ep_list, &udc->gadget.ep_list);
        }
@@ -1984,7 +1968,7 @@ static int __init usba_udc_probe(struct platform_device *pdev)
                goto err_device_add;
        }
 
-       if (pdata && pdata->vbus_pin != GPIO_PIN_NONE) {
+       if (pdata->vbus_pin >= 0) {
                if (!gpio_request(pdata->vbus_pin, "atmel_usba_udc")) {
                        udc->vbus_pin = pdata->vbus_pin;
 
@@ -2004,7 +1988,7 @@ static int __init usba_udc_probe(struct platform_device *pdev)
        }
 
        usba_init_debugfs(udc);
-       for (i = 1; i < ARRAY_SIZE(usba_ep); i++)
+       for (i = 1; i < pdata->num_ep; i++)
                usba_ep_init_debugfs(udc, &usba_ep[i]);
 
        return 0;
@@ -2012,6 +1996,8 @@ static int __init usba_udc_probe(struct platform_device *pdev)
 err_device_add:
        free_irq(irq, udc);
 err_request_irq:
+       kfree(usba_ep);
+err_alloc_ep:
        iounmap(udc->fifo);
 err_map_fifo:
        iounmap(udc->regs);
@@ -2029,10 +2015,11 @@ static int __exit usba_udc_remove(struct platform_device *pdev)
 {
        struct usba_udc *udc;
        int i;
+       struct usba_platform_data *pdata = pdev->dev.platform_data;
 
        udc = platform_get_drvdata(pdev);
 
-       for (i = 1; i < ARRAY_SIZE(usba_ep); i++)
+       for (i = 1; i < pdata->num_ep; i++)
                usba_ep_cleanup_debugfs(&usba_ep[i]);
        usba_cleanup_debugfs(udc);
 
@@ -2040,6 +2027,7 @@ static int __exit usba_udc_remove(struct platform_device *pdev)
                gpio_free(udc->vbus_pin);
 
        free_irq(udc->irq, udc);
+       kfree(usba_ep);
        iounmap(udc->fifo);
        iounmap(udc->regs);
        clk_put(udc->hclk);
index 08bf6f9aaf7ee32ed1cb167da98f42e13fa17c40..f7baea307f0d00be4433c2df62a1f64c6b7b5567 100644 (file)
 #define USBA_EN_USBA                           (1 <<  8)
 #define USBA_DETACH                            (1 <<  9)
 #define USBA_REMOTE_WAKE_UP                    (1 << 10)
+#define USBA_PULLD_DIS                         (1 << 11)
+
+#if defined(CONFIG_AVR32)
+#define USBA_ENABLE_MASK                       USBA_EN_USBA
+#define USBA_DISABLE_MASK                      0
+#elif defined(CONFIG_ARCH_AT91)
+#define USBA_ENABLE_MASK                       (USBA_EN_USBA | USBA_PULLD_DIS)
+#define USBA_DISABLE_MASK                      USBA_DETACH
+#endif /* CONFIG_ARCH_AT91 */
 
 /* Bitfields in FNUM */
 #define USBA_MICRO_FRAME_NUM_OFFSET            0
index 46ee7f4c091232f54c16de95e241e5a160ea5e67..85074cb36f38001ac5d4faa8543c8e8bf7eda175 100644 (file)
@@ -1033,7 +1033,7 @@ MODULE_LICENSE ("GPL");
 #define OF_PLATFORM_DRIVER     ehci_hcd_ppc_of_driver
 #endif
 
-#ifdef CONFIG_ARCH_ORION
+#ifdef CONFIG_PLAT_ORION
 #include "ehci-orion.c"
 #define        PLATFORM_DRIVER         ehci_orion_driver
 #endif
index e129981f139f7a87f6be48e974abbe5768209c8b..d187d03137423dcc562377df7e18f1b20916f4ba 100644 (file)
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/platform_device.h>
-#include <asm/arch/orion.h>
+#include <linux/mbus.h>
+#include <asm/plat-orion/ehci-orion.h>
 
 #define rdl(off)       __raw_readl(hcd->regs + (off))
 #define wrl(off, val)  __raw_writel((val), hcd->regs + (off))
 
-#define USB_CAUSE              0x310
-#define USB_MASK               0x314
 #define USB_CMD                        0x140
 #define USB_MODE               0x1a8
+#define USB_CAUSE              0x310
+#define USB_MASK               0x314
+#define USB_WINDOW_CTRL(i)     (0x320 + ((i) << 4))
+#define USB_WINDOW_BASE(i)     (0x324 + ((i) << 4))
 #define USB_IPG                        0x360
 #define USB_PHY_PWR_CTRL       0x400
 #define USB_PHY_TX_CTRL                0x420
@@ -162,8 +165,30 @@ static const struct hc_driver ehci_orion_hc_driver = {
        .bus_resume = ehci_bus_resume,
 };
 
+static void __init
+ehci_orion_conf_mbus_windows(struct usb_hcd *hcd,
+                               struct mbus_dram_target_info *dram)
+{
+       int i;
+
+       for (i = 0; i < 4; i++) {
+               wrl(USB_WINDOW_CTRL(i), 0);
+               wrl(USB_WINDOW_BASE(i), 0);
+       }
+
+       for (i = 0; i < dram->num_cs; i++) {
+               struct mbus_dram_window *cs = dram->cs + i;
+
+               wrl(USB_WINDOW_CTRL(i), ((cs->size - 1) & 0xffff0000) |
+                                       (cs->mbus_attr << 8) |
+                                       (dram->mbus_dram_target_id << 4) | 1);
+               wrl(USB_WINDOW_BASE(i), cs->base);
+       }
+}
+
 static int __init ehci_orion_drv_probe(struct platform_device *pdev)
 {
+       struct orion_ehci_data *pd = pdev->dev.platform_data;
        struct resource *res;
        struct usb_hcd *hcd;
        struct ehci_hcd *ehci;
@@ -226,6 +251,12 @@ static int __init ehci_orion_drv_probe(struct platform_device *pdev)
        ehci->is_tdi_rh_tt = 1;
        ehci->sbrn = 0x20;
 
+       /*
+        * (Re-)program MBUS remapping windows if we are asked to.
+        */
+       if (pd != NULL && pd->dram != NULL)
+               ehci_orion_conf_mbus_windows(hcd, pd->dram);
+
        /*
         * setup Orion USB controller
         */
index 1cb56f2d5c8421df8036cf09bc00d9405fb97c32..a5e4c3545c72a4194921cc3f1ec138b1dc5b465f 100644 (file)
@@ -29,7 +29,6 @@
 #include <linux/timer.h>
 #include <linux/workqueue.h>
 #include <asm/atomic.h>
-#include <asm/semaphore.h>
 
 #define APPLE_VENDOR_ID                0x05AC
 
index cd3405953f741a4b4e103d482a0009db59453550..e5ea5ef6335d1acc42e3049fe507eb92b35a3222 100644 (file)
@@ -38,7 +38,6 @@
 #include <linux/serial.h>
 #include <linux/ioctl.h>
 #include <asm/uaccess.h>
-#include <asm/semaphore.h>
 #include <linux/usb.h>
 #include <linux/usb/serial.h>
 
index e3d241f67afc39996d95d4d2ac76c290e4cc9c29..3a3776677339bd7e546ea05a1acc62e0abc3aa85 100644 (file)
@@ -82,7 +82,6 @@
 #include <linux/circ_buf.h>
 #include <linux/mutex.h>
 #include <asm/uaccess.h>
-#include <asm/semaphore.h>
 #include <linux/usb.h>
 #include <linux/usb/serial.h>
 
index 97facb121c738d1a864696a8e4d0e5f08357fe03..757651954e6cf81bebba98cda2bf36ce910f824d 100644 (file)
@@ -45,6 +45,7 @@
 #include <asm/irq.h>
 #include <asm/div64.h>
 #include <asm/arch/pxa-regs.h>
+#include <asm/arch/pxa2xx-gpio.h>
 #include <asm/arch/bitfield.h>
 #include <asm/arch/pxafb.h>
 
index 32ccd7c89c7dae5a38e94d3533d0e3fbcce8de46..35cddff7020fe081c6401253a76b1a21cf94797d 100644 (file)
@@ -38,8 +38,8 @@
 #include <linux/init.h>
 #include <linux/pnp.h>
 #include <linux/fs.h>
+#include <linux/semaphore.h>
 
-#include <asm/semaphore.h>
 #include <asm/io.h>
 #include <asm/uaccess.h>
 
index dfebdbe7440e6f31f627fdd41718cf55c459a55d..3031e3233dd625302715ff10c3e49ddc4b1aa7f7 100644 (file)
@@ -26,7 +26,6 @@
 #include <linux/fs.h>
 #include <linux/sched.h>
 #include <linux/idr.h>
-#include <asm/semaphore.h>
 #include <net/9p/9p.h>
 #include <net/9p/client.h>
 
index 350680fd7da7db367f7f8699a2dc78a50dce6696..0c3b618c15b3f05bd1adee50fada78b7561a36dc 100644 (file)
@@ -23,7 +23,6 @@
 #include <linux/buffer_head.h>
 #include <linux/vfs.h>
 #include <linux/mutex.h>
-#include <asm/semaphore.h>
 
 #include <asm/uaccess.h>
 
index d30ea8b433a289b9040e49b0af37e8757fe13376..7a8824f475f2c84029f921a1542a90b0eb700fb9 100644 (file)
@@ -37,7 +37,6 @@
 #include <linux/jhash.h>
 #include <linux/miscdevice.h>
 #include <linux/mutex.h>
-#include <asm/semaphore.h>
 #include <asm/uaccess.h>
 
 #include <linux/dlm.h>
index b8ea11fee5c6fc36e059f9dc873564e82a464ab0..de876fa793e1d140386f8bd9693785943f706c09 100644 (file)
@@ -12,6 +12,7 @@
 #include <linux/time.h>
 #include <linux/sched.h>
 #include <linux/compat.h>
+#include <linux/mount.h>
 #include <linux/smp_lock.h>
 #include <asm/current.h>
 #include <asm/uaccess.h>
@@ -23,6 +24,7 @@ long ext2_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
        struct ext2_inode_info *ei = EXT2_I(inode);
        unsigned int flags;
        unsigned short rsv_window_size;
+       int ret;
 
        ext2_debug ("cmd = %u, arg = %lu\n", cmd, arg);
 
@@ -34,14 +36,19 @@ long ext2_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
        case EXT2_IOC_SETFLAGS: {
                unsigned int oldflags;
 
-               if (IS_RDONLY(inode))
-                       return -EROFS;
+               ret = mnt_want_write(filp->f_path.mnt);
+               if (ret)
+                       return ret;
 
-               if (!is_owner_or_cap(inode))
-                       return -EACCES;
+               if (!is_owner_or_cap(inode)) {
+                       ret = -EACCES;
+                       goto setflags_out;
+               }
 
-               if (get_user(flags, (int __user *) arg))
-                       return -EFAULT;
+               if (get_user(flags, (int __user *) arg)) {
+                       ret = -EFAULT;
+                       goto setflags_out;
+               }
 
                if (!S_ISDIR(inode->i_mode))
                        flags &= ~EXT2_DIRSYNC_FL;
@@ -50,7 +57,8 @@ long ext2_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
                /* Is it quota file? Do not allow user to mess with it */
                if (IS_NOQUOTA(inode)) {
                        mutex_unlock(&inode->i_mutex);
-                       return -EPERM;
+                       ret = -EPERM;
+                       goto setflags_out;
                }
                oldflags = ei->i_flags;
 
@@ -63,7 +71,8 @@ long ext2_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
                if ((flags ^ oldflags) & (EXT2_APPEND_FL | EXT2_IMMUTABLE_FL)) {
                        if (!capable(CAP_LINUX_IMMUTABLE)) {
                                mutex_unlock(&inode->i_mutex);
-                               return -EPERM;
+                               ret = -EPERM;
+                               goto setflags_out;
                        }
                }
 
@@ -75,20 +84,26 @@ long ext2_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
                ext2_set_inode_flags(inode);
                inode->i_ctime = CURRENT_TIME_SEC;
                mark_inode_dirty(inode);
-               return 0;
+setflags_out:
+               mnt_drop_write(filp->f_path.mnt);
+               return ret;
        }
        case EXT2_IOC_GETVERSION:
                return put_user(inode->i_generation, (int __user *) arg);
        case EXT2_IOC_SETVERSION:
                if (!is_owner_or_cap(inode))
                        return -EPERM;
-               if (IS_RDONLY(inode))
-                       return -EROFS;
-               if (get_user(inode->i_generation, (int __user *) arg))
-                       return -EFAULT; 
-               inode->i_ctime = CURRENT_TIME_SEC;
-               mark_inode_dirty(inode);
-               return 0;
+               ret = mnt_want_write(filp->f_path.mnt);
+               if (ret)
+                       return ret;
+               if (get_user(inode->i_generation, (int __user *) arg)) {
+                       ret = -EFAULT;
+               } else {
+                       inode->i_ctime = CURRENT_TIME_SEC;
+                       mark_inode_dirty(inode);
+               }
+               mnt_drop_write(filp->f_path.mnt);
+               return ret;
        case EXT2_IOC_GETRSVSZ:
                if (test_opt(inode->i_sb, RESERVATION)
                        && S_ISREG(inode->i_mode)
@@ -102,15 +117,16 @@ long ext2_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
                if (!test_opt(inode->i_sb, RESERVATION) ||!S_ISREG(inode->i_mode))
                        return -ENOTTY;
 
-               if (IS_RDONLY(inode))
-                       return -EROFS;
-
-               if ((current->fsuid != inode->i_uid) && !capable(CAP_FOWNER))
+               if (!is_owner_or_cap(inode))
                        return -EACCES;
 
                if (get_user(rsv_window_size, (int __user *)arg))
                        return -EFAULT;
 
+               ret = mnt_want_write(filp->f_path.mnt);
+               if (ret)
+                       return ret;
+
                if (rsv_window_size > EXT2_MAX_RESERVE_BLOCKS)
                        rsv_window_size = EXT2_MAX_RESERVE_BLOCKS;
 
@@ -131,6 +147,7 @@ long ext2_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
                        rsv->rsv_goal_size = rsv_window_size;
                }
                mutex_unlock(&ei->truncate_mutex);
+               mnt_drop_write(filp->f_path.mnt);
                return 0;
        }
        default:
index 023a070f55f18fac29cfddafa08557085ad6b2fa..0d0c70151642faf026c98d53b4179c6395e1b645 100644 (file)
@@ -12,6 +12,7 @@
 #include <linux/capability.h>
 #include <linux/ext3_fs.h>
 #include <linux/ext3_jbd.h>
+#include <linux/mount.h>
 #include <linux/time.h>
 #include <linux/compat.h>
 #include <linux/smp_lock.h>
@@ -38,14 +39,19 @@ int ext3_ioctl (struct inode * inode, struct file * filp, unsigned int cmd,
                unsigned int oldflags;
                unsigned int jflag;
 
-               if (IS_RDONLY(inode))
-                       return -EROFS;
+               err = mnt_want_write(filp->f_path.mnt);
+               if (err)
+                       return err;
 
-               if (!is_owner_or_cap(inode))
-                       return -EACCES;
+               if (!is_owner_or_cap(inode)) {
+                       err = -EACCES;
+                       goto flags_out;
+               }
 
-               if (get_user(flags, (int __user *) arg))
-                       return -EFAULT;
+               if (get_user(flags, (int __user *) arg)) {
+                       err = -EFAULT;
+                       goto flags_out;
+               }
 
                if (!S_ISDIR(inode->i_mode))
                        flags &= ~EXT3_DIRSYNC_FL;
@@ -54,7 +60,8 @@ int ext3_ioctl (struct inode * inode, struct file * filp, unsigned int cmd,
                /* Is it quota file? Do not allow user to mess with it */
                if (IS_NOQUOTA(inode)) {
                        mutex_unlock(&inode->i_mutex);
-                       return -EPERM;
+                       err = -EPERM;
+                       goto flags_out;
                }
                oldflags = ei->i_flags;
 
@@ -70,7 +77,8 @@ int ext3_ioctl (struct inode * inode, struct file * filp, unsigned int cmd,
                if ((flags ^ oldflags) & (EXT3_APPEND_FL | EXT3_IMMUTABLE_FL)) {
                        if (!capable(CAP_LINUX_IMMUTABLE)) {
                                mutex_unlock(&inode->i_mutex);
-                               return -EPERM;
+                               err = -EPERM;
+                               goto flags_out;
                        }
                }
 
@@ -81,7 +89,8 @@ int ext3_ioctl (struct inode * inode, struct file * filp, unsigned int cmd,
                if ((jflag ^ oldflags) & (EXT3_JOURNAL_DATA_FL)) {
                        if (!capable(CAP_SYS_RESOURCE)) {
                                mutex_unlock(&inode->i_mutex);
-                               return -EPERM;
+                               err = -EPERM;
+                               goto flags_out;
                        }
                }
 
@@ -89,7 +98,8 @@ int ext3_ioctl (struct inode * inode, struct file * filp, unsigned int cmd,
                handle = ext3_journal_start(inode, 1);
                if (IS_ERR(handle)) {
                        mutex_unlock(&inode->i_mutex);
-                       return PTR_ERR(handle);
+                       err = PTR_ERR(handle);
+                       goto flags_out;
                }
                if (IS_SYNC(inode))
                        handle->h_sync = 1;
@@ -115,6 +125,8 @@ flags_err:
                if ((jflag ^ oldflags) & (EXT3_JOURNAL_DATA_FL))
                        err = ext3_change_inode_journal_flag(inode, jflag);
                mutex_unlock(&inode->i_mutex);
+flags_out:
+               mnt_drop_write(filp->f_path.mnt);
                return err;
        }
        case EXT3_IOC_GETVERSION:
@@ -129,14 +141,18 @@ flags_err:
 
                if (!is_owner_or_cap(inode))
                        return -EPERM;
-               if (IS_RDONLY(inode))
-                       return -EROFS;
-               if (get_user(generation, (int __user *) arg))
-                       return -EFAULT;
-
+               err = mnt_want_write(filp->f_path.mnt);
+               if (err)
+                       return err;
+               if (get_user(generation, (int __user *) arg)) {
+                       err = -EFAULT;
+                       goto setversion_out;
+               }
                handle = ext3_journal_start(inode, 1);
-               if (IS_ERR(handle))
-                       return PTR_ERR(handle);
+               if (IS_ERR(handle)) {
+                       err = PTR_ERR(handle);
+                       goto setversion_out;
+               }
                err = ext3_reserve_inode_write(handle, inode, &iloc);
                if (err == 0) {
                        inode->i_ctime = CURRENT_TIME_SEC;
@@ -144,6 +160,8 @@ flags_err:
                        err = ext3_mark_iloc_dirty(handle, inode, &iloc);
                }
                ext3_journal_stop(handle);
+setversion_out:
+               mnt_drop_write(filp->f_path.mnt);
                return err;
        }
 #ifdef CONFIG_JBD_DEBUG
@@ -179,18 +197,24 @@ flags_err:
                }
                return -ENOTTY;
        case EXT3_IOC_SETRSVSZ: {
+               int err;
 
                if (!test_opt(inode->i_sb, RESERVATION) ||!S_ISREG(inode->i_mode))
                        return -ENOTTY;
 
-               if (IS_RDONLY(inode))
-                       return -EROFS;
+               err = mnt_want_write(filp->f_path.mnt);
+               if (err)
+                       return err;
 
-               if (!is_owner_or_cap(inode))
-                       return -EACCES;
+               if (!is_owner_or_cap(inode)) {
+                       err = -EACCES;
+                       goto setrsvsz_out;
+               }
 
-               if (get_user(rsv_window_size, (int __user *)arg))
-                       return -EFAULT;
+               if (get_user(rsv_window_size, (int __user *)arg)) {
+                       err = -EFAULT;
+                       goto setrsvsz_out;
+               }
 
                if (rsv_window_size > EXT3_MAX_RESERVE_BLOCKS)
                        rsv_window_size = EXT3_MAX_RESERVE_BLOCKS;
@@ -208,7 +232,9 @@ flags_err:
                        rsv->rsv_goal_size = rsv_window_size;
                }
                mutex_unlock(&ei->truncate_mutex);
-               return 0;
+setrsvsz_out:
+               mnt_drop_write(filp->f_path.mnt);
+               return err;
        }
        case EXT3_IOC_GROUP_EXTEND: {
                ext3_fsblk_t n_blocks_count;
@@ -218,17 +244,20 @@ flags_err:
                if (!capable(CAP_SYS_RESOURCE))
                        return -EPERM;
 
-               if (IS_RDONLY(inode))
-                       return -EROFS;
-
-               if (get_user(n_blocks_count, (__u32 __user *)arg))
-                       return -EFAULT;
+               err = mnt_want_write(filp->f_path.mnt);
+               if (err)
+                       return err;
 
+               if (get_user(n_blocks_count, (__u32 __user *)arg)) {
+                       err = -EFAULT;
+                       goto group_extend_out;
+               }
                err = ext3_group_extend(sb, EXT3_SB(sb)->s_es, n_blocks_count);
                journal_lock_updates(EXT3_SB(sb)->s_journal);
                journal_flush(EXT3_SB(sb)->s_journal);
                journal_unlock_updates(EXT3_SB(sb)->s_journal);
-
+group_extend_out:
+               mnt_drop_write(filp->f_path.mnt);
                return err;
        }
        case EXT3_IOC_GROUP_ADD: {
@@ -239,18 +268,22 @@ flags_err:
                if (!capable(CAP_SYS_RESOURCE))
                        return -EPERM;
 
-               if (IS_RDONLY(inode))
-                       return -EROFS;
+               err = mnt_want_write(filp->f_path.mnt);
+               if (err)
+                       return err;
 
                if (copy_from_user(&input, (struct ext3_new_group_input __user *)arg,
-                               sizeof(input)))
-                       return -EFAULT;
+                               sizeof(input))) {
+                       err = -EFAULT;
+                       goto group_add_out;
+               }
 
                err = ext3_group_add(sb, &input);
                journal_lock_updates(EXT3_SB(sb)->s_journal);
                journal_flush(EXT3_SB(sb)->s_journal);
                journal_unlock_updates(EXT3_SB(sb)->s_journal);
-
+group_add_out:
+               mnt_drop_write(filp->f_path.mnt);
                return err;
        }
 
index 2ed7c37f897e79f0b9c6d6af3a5c2aad79fa7f59..25b13ede8086c606a4b1320c2a364889434c7b7c 100644 (file)
@@ -15,6 +15,7 @@
 #include <linux/time.h>
 #include <linux/compat.h>
 #include <linux/smp_lock.h>
+#include <linux/mount.h>
 #include <asm/uaccess.h>
 
 int ext4_ioctl (struct inode * inode, struct file * filp, unsigned int cmd,
@@ -38,24 +39,25 @@ int ext4_ioctl (struct inode * inode, struct file * filp, unsigned int cmd,
                unsigned int oldflags;
                unsigned int jflag;
 
-               if (IS_RDONLY(inode))
-                       return -EROFS;
-
                if (!is_owner_or_cap(inode))
                        return -EACCES;
 
                if (get_user(flags, (int __user *) arg))
                        return -EFAULT;
 
+               err = mnt_want_write(filp->f_path.mnt);
+               if (err)
+                       return err;
+
                if (!S_ISDIR(inode->i_mode))
                        flags &= ~EXT4_DIRSYNC_FL;
 
+               err = -EPERM;
                mutex_lock(&inode->i_mutex);
                /* Is it quota file? Do not allow user to mess with it */
-               if (IS_NOQUOTA(inode)) {
-                       mutex_unlock(&inode->i_mutex);
-                       return -EPERM;
-               }
+               if (IS_NOQUOTA(inode))
+                       goto flags_out;
+
                oldflags = ei->i_flags;
 
                /* The JOURNAL_DATA flag is modifiable only by root */
@@ -68,10 +70,8 @@ int ext4_ioctl (struct inode * inode, struct file * filp, unsigned int cmd,
                 * This test looks nicer. Thanks to Pauline Middelink
                 */
                if ((flags ^ oldflags) & (EXT4_APPEND_FL | EXT4_IMMUTABLE_FL)) {
-                       if (!capable(CAP_LINUX_IMMUTABLE)) {
-                               mutex_unlock(&inode->i_mutex);
-                               return -EPERM;
-                       }
+                       if (!capable(CAP_LINUX_IMMUTABLE))
+                               goto flags_out;
                }
 
                /*
@@ -79,17 +79,14 @@ int ext4_ioctl (struct inode * inode, struct file * filp, unsigned int cmd,
                 * the relevant capability.
                 */
                if ((jflag ^ oldflags) & (EXT4_JOURNAL_DATA_FL)) {
-                       if (!capable(CAP_SYS_RESOURCE)) {
-                               mutex_unlock(&inode->i_mutex);
-                               return -EPERM;
-                       }
+                       if (!capable(CAP_SYS_RESOURCE))
+                               goto flags_out;
                }
 
-
                handle = ext4_journal_start(inode, 1);
                if (IS_ERR(handle)) {
-                       mutex_unlock(&inode->i_mutex);
-                       return PTR_ERR(handle);
+                       err = PTR_ERR(handle);
+                       goto flags_out;
                }
                if (IS_SYNC(inode))
                        handle->h_sync = 1;
@@ -107,14 +104,14 @@ int ext4_ioctl (struct inode * inode, struct file * filp, unsigned int cmd,
                err = ext4_mark_iloc_dirty(handle, inode, &iloc);
 flags_err:
                ext4_journal_stop(handle);
-               if (err) {
-                       mutex_unlock(&inode->i_mutex);
-                       return err;
-               }
+               if (err)
+                       goto flags_out;
 
                if ((jflag ^ oldflags) & (EXT4_JOURNAL_DATA_FL))
                        err = ext4_change_inode_journal_flag(inode, jflag);
+flags_out:
                mutex_unlock(&inode->i_mutex);
+               mnt_drop_write(filp->f_path.mnt);
                return err;
        }
        case EXT4_IOC_GETVERSION:
@@ -129,14 +126,20 @@ flags_err:
 
                if (!is_owner_or_cap(inode))
                        return -EPERM;
-               if (IS_RDONLY(inode))
-                       return -EROFS;
-               if (get_user(generation, (int __user *) arg))
-                       return -EFAULT;
+
+               err = mnt_want_write(filp->f_path.mnt);
+               if (err)
+                       return err;
+               if (get_user(generation, (int __user *) arg)) {
+                       err = -EFAULT;
+                       goto setversion_out;
+               }
 
                handle = ext4_journal_start(inode, 1);
-               if (IS_ERR(handle))
-                       return PTR_ERR(handle);
+               if (IS_ERR(handle)) {
+                       err = PTR_ERR(handle);
+                       goto setversion_out;
+               }
                err = ext4_reserve_inode_write(handle, inode, &iloc);
                if (err == 0) {
                        inode->i_ctime = ext4_current_time(inode);
@@ -144,6 +147,8 @@ flags_err:
                        err = ext4_mark_iloc_dirty(handle, inode, &iloc);
                }
                ext4_journal_stop(handle);
+setversion_out:
+               mnt_drop_write(filp->f_path.mnt);
                return err;
        }
 #ifdef CONFIG_JBD2_DEBUG
@@ -179,19 +184,21 @@ flags_err:
                }
                return -ENOTTY;
        case EXT4_IOC_SETRSVSZ: {
+               int err;
 
                if (!test_opt(inode->i_sb, RESERVATION) ||!S_ISREG(inode->i_mode))
                        return -ENOTTY;
 
-               if (IS_RDONLY(inode))
-                       return -EROFS;
-
                if (!is_owner_or_cap(inode))
                        return -EACCES;
 
                if (get_user(rsv_window_size, (int __user *)arg))
                        return -EFAULT;
 
+               err = mnt_want_write(filp->f_path.mnt);
+               if (err)
+                       return err;
+
                if (rsv_window_size > EXT4_MAX_RESERVE_BLOCKS)
                        rsv_window_size = EXT4_MAX_RESERVE_BLOCKS;
 
@@ -208,6 +215,7 @@ flags_err:
                        rsv->rsv_goal_size = rsv_window_size;
                }
                up_write(&ei->i_data_sem);
+               mnt_drop_write(filp->f_path.mnt);
                return 0;
        }
        case EXT4_IOC_GROUP_EXTEND: {
@@ -218,16 +226,18 @@ flags_err:
                if (!capable(CAP_SYS_RESOURCE))
                        return -EPERM;
 
-               if (IS_RDONLY(inode))
-                       return -EROFS;
-
                if (get_user(n_blocks_count, (__u32 __user *)arg))
                        return -EFAULT;
 
+               err = mnt_want_write(filp->f_path.mnt);
+               if (err)
+                       return err;
+
                err = ext4_group_extend(sb, EXT4_SB(sb)->s_es, n_blocks_count);
                jbd2_journal_lock_updates(EXT4_SB(sb)->s_journal);
                jbd2_journal_flush(EXT4_SB(sb)->s_journal);
                jbd2_journal_unlock_updates(EXT4_SB(sb)->s_journal);
+               mnt_drop_write(filp->f_path.mnt);
 
                return err;
        }
@@ -239,17 +249,19 @@ flags_err:
                if (!capable(CAP_SYS_RESOURCE))
                        return -EPERM;
 
-               if (IS_RDONLY(inode))
-                       return -EROFS;
-
                if (copy_from_user(&input, (struct ext4_new_group_input __user *)arg,
                                sizeof(input)))
                        return -EFAULT;
 
+               err = mnt_want_write(filp->f_path.mnt);
+               if (err)
+                       return err;
+
                err = ext4_group_add(sb, &input);
                jbd2_journal_lock_updates(EXT4_SB(sb)->s_journal);
                jbd2_journal_flush(EXT4_SB(sb)->s_journal);
                jbd2_journal_unlock_updates(EXT4_SB(sb)->s_journal);
+               mnt_drop_write(filp->f_path.mnt);
 
                return err;
        }
index c614175876e09316ea0a36566dc072fe6819169c..2a3bed96704148c1377537677c4c7d9edd9372a3 100644 (file)
@@ -8,6 +8,7 @@
 
 #include <linux/capability.h>
 #include <linux/module.h>
+#include <linux/mount.h>
 #include <linux/time.h>
 #include <linux/msdos_fs.h>
 #include <linux/smp_lock.h>
@@ -46,10 +47,9 @@ int fat_generic_ioctl(struct inode *inode, struct file *filp,
 
                mutex_lock(&inode->i_mutex);
 
-               if (IS_RDONLY(inode)) {
-                       err = -EROFS;
-                       goto up;
-               }
+               err = mnt_want_write(filp->f_path.mnt);
+               if (err)
+                       goto up_no_drop_write;
 
                /*
                 * ATTR_VOLUME and ATTR_DIR cannot be changed; this also
@@ -105,7 +105,9 @@ int fat_generic_ioctl(struct inode *inode, struct file *filp,
 
                MSDOS_I(inode)->i_attrs = attr & ATTR_UNUSED;
                mark_inode_dirty(inode);
-       up:
+up:
+               mnt_drop_write(filp->f_path.mnt);
+up_no_drop_write:
                mutex_unlock(&inode->i_mutex);
                return err;
        }
index 986ff4ed0a7cbf56d258b290635c32203284c565..7a0a9b8722513faae34fc0f145c06f241f2630f7 100644 (file)
@@ -42,6 +42,7 @@ static inline void file_free_rcu(struct rcu_head *head)
 static inline void file_free(struct file *f)
 {
        percpu_counter_dec(&nr_files);
+       file_check_state(f);
        call_rcu(&f->f_u.fu_rcuhead, file_free_rcu);
 }
 
@@ -199,6 +200,18 @@ int init_file(struct file *file, struct vfsmount *mnt, struct dentry *dentry,
        file->f_mapping = dentry->d_inode->i_mapping;
        file->f_mode = mode;
        file->f_op = fop;
+
+       /*
+        * These mounts don't really matter in practice
+        * for r/o bind mounts.  They aren't userspace-
+        * visible.  We do this for consistency, and so
+        * that we can do debugging checks at __fput()
+        */
+       if ((mode & FMODE_WRITE) && !special_file(dentry->d_inode->i_mode)) {
+               file_take_write(file);
+               error = mnt_want_write(mnt);
+               WARN_ON(error);
+       }
        return error;
 }
 EXPORT_SYMBOL(init_file);
@@ -211,6 +224,31 @@ void fput(struct file *file)
 
 EXPORT_SYMBOL(fput);
 
+/**
+ * drop_file_write_access - give up ability to write to a file
+ * @file: the file to which we will stop writing
+ *
+ * This is a central place which will give up the ability
+ * to write to @file, along with access to write through
+ * its vfsmount.
+ */
+void drop_file_write_access(struct file *file)
+{
+       struct vfsmount *mnt = file->f_path.mnt;
+       struct dentry *dentry = file->f_path.dentry;
+       struct inode *inode = dentry->d_inode;
+
+       put_write_access(inode);
+
+       if (special_file(inode->i_mode))
+               return;
+       if (file_check_writeable(file) != 0)
+               return;
+       mnt_drop_write(mnt);
+       file_release_write(file);
+}
+EXPORT_SYMBOL_GPL(drop_file_write_access);
+
 /* __fput is called from task context when aio completion releases the last
  * last use of a struct file *.  Do not use otherwise.
  */
@@ -236,10 +274,10 @@ void __fput(struct file *file)
        if (unlikely(S_ISCHR(inode->i_mode) && inode->i_cdev != NULL))
                cdev_put(inode->i_cdev);
        fops_put(file->f_op);
-       if (file->f_mode & FMODE_WRITE)
-               put_write_access(inode);
        put_pid(file->f_owner.pid);
        file_kill(file);
+       if (file->f_mode & FMODE_WRITE)
+               drop_file_write_access(file);
        file->f_path.dentry = NULL;
        file->f_path.mnt = NULL;
        file_free(file);
index b60c0affbec58af68e45fd063692a933949ad457..f457d2ca51ab8e68a3e60cd9028620fa029f8f18 100644 (file)
@@ -14,6 +14,7 @@
 
 #include <linux/capability.h>
 #include <linux/fs.h>
+#include <linux/mount.h>
 #include <linux/sched.h>
 #include <linux/xattr.h>
 #include <asm/uaccess.h>
@@ -35,25 +36,32 @@ int hfsplus_ioctl(struct inode *inode, struct file *filp, unsigned int cmd,
                        flags |= FS_NODUMP_FL; /* EXT2_NODUMP_FL */
                return put_user(flags, (int __user *)arg);
        case HFSPLUS_IOC_EXT2_SETFLAGS: {
-               if (IS_RDONLY(inode))
-                       return -EROFS;
-
-               if (!is_owner_or_cap(inode))
-                       return -EACCES;
-
-               if (get_user(flags, (int __user *)arg))
-                       return -EFAULT;
-
+               int err = 0;
+               err = mnt_want_write(filp->f_path.mnt);
+               if (err)
+                       return err;
+
+               if (!is_owner_or_cap(inode)) {
+                       err = -EACCES;
+                       goto setflags_out;
+               }
+               if (get_user(flags, (int __user *)arg)) {
+                       err = -EFAULT;
+                       goto setflags_out;
+               }
                if (flags & (FS_IMMUTABLE_FL|FS_APPEND_FL) ||
                    HFSPLUS_I(inode).rootflags & (HFSPLUS_FLG_IMMUTABLE|HFSPLUS_FLG_APPEND)) {
-                       if (!capable(CAP_LINUX_IMMUTABLE))
-                               return -EPERM;
+                       if (!capable(CAP_LINUX_IMMUTABLE)) {
+                               err = -EPERM;
+                               goto setflags_out;
+                       }
                }
 
                /* don't silently ignore unsupported ext2 flags */
-               if (flags & ~(FS_IMMUTABLE_FL|FS_APPEND_FL|FS_NODUMP_FL))
-                       return -EOPNOTSUPP;
-
+               if (flags & ~(FS_IMMUTABLE_FL|FS_APPEND_FL|FS_NODUMP_FL)) {
+                       err = -EOPNOTSUPP;
+                       goto setflags_out;
+               }
                if (flags & FS_IMMUTABLE_FL) { /* EXT2_IMMUTABLE_FL */
                        inode->i_flags |= S_IMMUTABLE;
                        HFSPLUS_I(inode).rootflags |= HFSPLUS_FLG_IMMUTABLE;
@@ -75,7 +83,9 @@ int hfsplus_ioctl(struct inode *inode, struct file *filp, unsigned int cmd,
 
                inode->i_ctime = CURRENT_TIME_SEC;
                mark_inode_dirty(inode);
-               return 0;
+setflags_out:
+               mnt_drop_write(filp->f_path.mnt);
+               return err;
        }
        default:
                return -ENOTTY;
index 53245ffcf93dc8a4dd4d852257e5cc2e52ed64d6..27ee1af50d02c6537febbaed5cf7bd60debc832d 100644 (file)
@@ -1199,42 +1199,37 @@ void touch_atime(struct vfsmount *mnt, struct dentry *dentry)
        struct inode *inode = dentry->d_inode;
        struct timespec now;
 
-       if (inode->i_flags & S_NOATIME)
+       if (mnt_want_write(mnt))
                return;
+       if (inode->i_flags & S_NOATIME)
+               goto out;
        if (IS_NOATIME(inode))
-               return;
+               goto out;
        if ((inode->i_sb->s_flags & MS_NODIRATIME) && S_ISDIR(inode->i_mode))
-               return;
+               goto out;
 
-       /*
-        * We may have a NULL vfsmount when coming from NFSD
-        */
-       if (mnt) {
-               if (mnt->mnt_flags & MNT_NOATIME)
-                       return;
-               if ((mnt->mnt_flags & MNT_NODIRATIME) && S_ISDIR(inode->i_mode))
-                       return;
-
-               if (mnt->mnt_flags & MNT_RELATIME) {
-                       /*
-                        * With relative atime, only update atime if the
-                        * previous atime is earlier than either the ctime or
-                        * mtime.
-                        */
-                       if (timespec_compare(&inode->i_mtime,
-                                               &inode->i_atime) < 0 &&
-                           timespec_compare(&inode->i_ctime,
-                                               &inode->i_atime) < 0)
-                               return;
-               }
+       if (mnt->mnt_flags & MNT_NOATIME)
+               goto out;
+       if ((mnt->mnt_flags & MNT_NODIRATIME) && S_ISDIR(inode->i_mode))
+               goto out;
+       if (mnt->mnt_flags & MNT_RELATIME) {
+               /*
+                * With relative atime, only update atime if the previous
+                * atime is earlier than either the ctime or mtime.
+                */
+               if (timespec_compare(&inode->i_mtime, &inode->i_atime) < 0 &&
+                   timespec_compare(&inode->i_ctime, &inode->i_atime) < 0)
+                       goto out;
        }
 
        now = current_fs_time(inode->i_sb);
        if (timespec_equal(&inode->i_atime, &now))
-               return;
+               goto out;
 
        inode->i_atime = now;
        mark_inode_dirty_sync(inode);
+out:
+       mnt_drop_write(mnt);
 }
 EXPORT_SYMBOL(touch_atime);
 
@@ -1255,10 +1250,13 @@ void file_update_time(struct file *file)
        struct inode *inode = file->f_path.dentry->d_inode;
        struct timespec now;
        int sync_it = 0;
+       int err;
 
        if (IS_NOCMTIME(inode))
                return;
-       if (IS_RDONLY(inode))
+
+       err = mnt_want_write(file->f_path.mnt);
+       if (err)
                return;
 
        now = current_fs_time(inode->i_sb);
@@ -1279,6 +1277,7 @@ void file_update_time(struct file *file)
 
        if (sync_it)
                mark_inode_dirty_sync(inode);
+       mnt_drop_write(file->f_path.mnt);
 }
 
 EXPORT_SYMBOL(file_update_time);
index 0b78fdc9773b3c7cea2056e1b9cc52f34abfce1d..a841f4973a74824667b94e16f0cf7fe343ac82fa 100644 (file)
@@ -15,7 +15,7 @@
 #include <linux/version.h>
 #include <linux/rbtree.h>
 #include <linux/posix_acl.h>
-#include <asm/semaphore.h>
+#include <linux/semaphore.h>
 
 struct jffs2_inode_info {
        /* We need an internal mutex similar to inode->i_mutex.
index 3a2197f3c812727a06fafdbb552fa9218e2058f7..18fca2b9e53192355fe26ca16f71c76b7af35d93 100644 (file)
@@ -16,7 +16,7 @@
 #include <linux/spinlock.h>
 #include <linux/workqueue.h>
 #include <linux/completion.h>
-#include <asm/semaphore.h>
+#include <linux/semaphore.h>
 #include <linux/timer.h>
 #include <linux/wait.h>
 #include <linux/list.h>
index a1f8e375ad2114f2e75669f7a817bdf20baa6fdc..afe222bf300fc90f0931492b45969c1d09fcc9bc 100644 (file)
@@ -8,6 +8,7 @@
 #include <linux/fs.h>
 #include <linux/ctype.h>
 #include <linux/capability.h>
+#include <linux/mount.h>
 #include <linux/time.h>
 #include <linux/sched.h>
 #include <asm/current.h>
@@ -65,23 +66,30 @@ long jfs_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
                return put_user(flags, (int __user *) arg);
        case JFS_IOC_SETFLAGS: {
                unsigned int oldflags;
+               int err;
 
-               if (IS_RDONLY(inode))
-                       return -EROFS;
+               err = mnt_want_write(filp->f_path.mnt);
+               if (err)
+                       return err;
 
-               if (!is_owner_or_cap(inode))
-                       return -EACCES;
-
-               if (get_user(flags, (int __user *) arg))
-                       return -EFAULT;
+               if (!is_owner_or_cap(inode)) {
+                       err = -EACCES;
+                       goto setflags_out;
+               }
+               if (get_user(flags, (int __user *) arg)) {
+                       err = -EFAULT;
+                       goto setflags_out;
+               }
 
                flags = jfs_map_ext2(flags, 1);
                if (!S_ISDIR(inode->i_mode))
                        flags &= ~JFS_DIRSYNC_FL;
 
                /* Is it quota file? Do not allow user to mess with it */
-               if (IS_NOQUOTA(inode))
-                       return -EPERM;
+               if (IS_NOQUOTA(inode)) {
+                       err = -EPERM;
+                       goto setflags_out;
+               }
 
                /* Lock against other parallel changes of flags */
                mutex_lock(&inode->i_mutex);
@@ -98,7 +106,8 @@ long jfs_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
                        (JFS_APPEND_FL | JFS_IMMUTABLE_FL))) {
                        if (!capable(CAP_LINUX_IMMUTABLE)) {
                                mutex_unlock(&inode->i_mutex);
-                               return -EPERM;
+                               err = -EPERM;
+                               goto setflags_out;
                        }
                }
 
@@ -110,7 +119,9 @@ long jfs_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
                mutex_unlock(&inode->i_mutex);
                inode->i_ctime = CURRENT_TIME_SEC;
                mark_inode_dirty(inode);
-               return 0;
+setflags_out:
+               mnt_drop_write(filp->f_path.mnt);
+               return err;
        }
        default:
                return -ENOTTY;
index 43c0af21a0c5fb563ceb12073d085e5ed45e2ddf..592faadbcec12f19b2f6ea158e956e2a3b01c838 100644 (file)
 #include <linux/rcupdate.h>
 #include <linux/pid_namespace.h>
 
-#include <asm/semaphore.h>
 #include <asm/uaccess.h>
 
 #define IS_POSIX(fl)   (fl->fl_flags & FL_POSIX)
index 8cf9bb9c2fc0b0133d85f0f6ff0f3e35a9fb8e07..e179f71bfcb058df613f83cb1ff923d47ffc4618 100644 (file)
@@ -1623,8 +1623,7 @@ int may_open(struct nameidata *nd, int acc_mode, int flag)
                        return -EACCES;
 
                flag &= ~O_TRUNC;
-       } else if (IS_RDONLY(inode) && (acc_mode & MAY_WRITE))
-               return -EROFS;
+       }
 
        error = vfs_permission(nd, acc_mode);
        if (error)
@@ -1677,7 +1676,12 @@ int may_open(struct nameidata *nd, int acc_mode, int flag)
        return 0;
 }
 
-static int open_namei_create(struct nameidata *nd, struct path *path,
+/*
+ * Be careful about ever adding any more callers of this
+ * function.  Its flags must be in the namei format, not
+ * what get passed to sys_open().
+ */
+static int __open_namei_create(struct nameidata *nd, struct path *path,
                                int flag, int mode)
 {
        int error;
@@ -1696,26 +1700,56 @@ static int open_namei_create(struct nameidata *nd, struct path *path,
 }
 
 /*
- *     open_namei()
+ * Note that while the flag value (low two bits) for sys_open means:
+ *     00 - read-only
+ *     01 - write-only
+ *     10 - read-write
+ *     11 - special
+ * it is changed into
+ *     00 - no permissions needed
+ *     01 - read-permission
+ *     10 - write-permission
+ *     11 - read-write
+ * for the internal routines (ie open_namei()/follow_link() etc)
+ * This is more logical, and also allows the 00 "no perm needed"
+ * to be used for symlinks (where the permissions are checked
+ * later).
  *
- * namei for open - this is in fact almost the whole open-routine.
- *
- * Note that the low bits of "flag" aren't the same as in the open
- * system call - they are 00 - no permissions needed
- *                       01 - read permission needed
- *                       10 - write permission needed
- *                       11 - read/write permissions needed
- * which is a lot more logical, and also allows the "no perm" needed
- * for symlinks (where the permissions are checked later).
- * SMP-safe
+*/
+static inline int open_to_namei_flags(int flag)
+{
+       if ((flag+1) & O_ACCMODE)
+               flag++;
+       return flag;
+}
+
+static int open_will_write_to_fs(int flag, struct inode *inode)
+{
+       /*
+        * We'll never write to the fs underlying
+        * a device file.
+        */
+       if (special_file(inode->i_mode))
+               return 0;
+       return (flag & O_TRUNC);
+}
+
+/*
+ * Note that the low bits of the passed in "open_flag"
+ * are not the same as in the local variable "flag". See
+ * open_to_namei_flags() for more details.
  */
-int open_namei(int dfd, const char *pathname, int flag,
-               int mode, struct nameidata *nd)
+struct file *do_filp_open(int dfd, const char *pathname,
+               int open_flag, int mode)
 {
+       struct file *filp;
+       struct nameidata nd;
        int acc_mode, error;
        struct path path;
        struct dentry *dir;
        int count = 0;
+       int will_write;
+       int flag = open_to_namei_flags(open_flag);
 
        acc_mode = ACC_MODE(flag);
 
@@ -1733,18 +1767,19 @@ int open_namei(int dfd, const char *pathname, int flag,
         */
        if (!(flag & O_CREAT)) {
                error = path_lookup_open(dfd, pathname, lookup_flags(flag),
-                                        nd, flag);
+                                        &nd, flag);
                if (error)
-                       return error;
+                       return ERR_PTR(error);
                goto ok;
        }
 
        /*
         * Create - we need to know the parent.
         */
-       error = path_lookup_create(dfd,pathname,LOOKUP_PARENT,nd,flag,mode);
+       error = path_lookup_create(dfd, pathname, LOOKUP_PARENT,
+                                  &nd, flag, mode);
        if (error)
-               return error;
+               return ERR_PTR(error);
 
        /*
         * We have the parent and last component. First of all, check
@@ -1752,14 +1787,14 @@ int open_namei(int dfd, const char *pathname, int flag,
         * will not do.
         */
        error = -EISDIR;
-       if (nd->last_type != LAST_NORM || nd->last.name[nd->last.len])
+       if (nd.last_type != LAST_NORM || nd.last.name[nd.last.len])
                goto exit;
 
-       dir = nd->path.dentry;
-       nd->flags &= ~LOOKUP_PARENT;
+       dir = nd.path.dentry;
+       nd.flags &= ~LOOKUP_PARENT;
        mutex_lock(&dir->d_inode->i_mutex);
-       path.dentry = lookup_hash(nd);
-       path.mnt = nd->path.mnt;
+       path.dentry = lookup_hash(&nd);
+       path.mnt = nd.path.mnt;
 
 do_last:
        error = PTR_ERR(path.dentry);
@@ -1768,18 +1803,31 @@ do_last:
                goto exit;
        }
 
-       if (IS_ERR(nd->intent.open.file)) {
-               mutex_unlock(&dir->d_inode->i_mutex);
-               error = PTR_ERR(nd->intent.open.file);
-               goto exit_dput;
+       if (IS_ERR(nd.intent.open.file)) {
+               error = PTR_ERR(nd.intent.open.file);
+               goto exit_mutex_unlock;
        }
 
        /* Negative dentry, just create the file */
        if (!path.dentry->d_inode) {
-               error = open_namei_create(nd, &path, flag, mode);
+               /*
+                * This write is needed to ensure that a
+                * ro->rw transition does not occur between
+                * the time when the file is created and when
+                * a permanent write count is taken through
+                * the 'struct file' in nameidata_to_filp().
+                */
+               error = mnt_want_write(nd.path.mnt);
                if (error)
+                       goto exit_mutex_unlock;
+               error = __open_namei_create(&nd, &path, flag, mode);
+               if (error) {
+                       mnt_drop_write(nd.path.mnt);
                        goto exit;
-               return 0;
+               }
+               filp = nameidata_to_filp(&nd, open_flag);
+               mnt_drop_write(nd.path.mnt);
+               return filp;
        }
 
        /*
@@ -1804,23 +1852,52 @@ do_last:
        if (path.dentry->d_inode->i_op && path.dentry->d_inode->i_op->follow_link)
                goto do_link;
 
-       path_to_nameidata(&path, nd);
+       path_to_nameidata(&path, &nd);
        error = -EISDIR;
        if (path.dentry->d_inode && S_ISDIR(path.dentry->d_inode->i_mode))
                goto exit;
 ok:
-       error = may_open(nd, acc_mode, flag);
-       if (error)
+       /*
+        * Consider:
+        * 1. may_open() truncates a file
+        * 2. a rw->ro mount transition occurs
+        * 3. nameidata_to_filp() fails due to
+        *    the ro mount.
+        * That would be inconsistent, and should
+        * be avoided. Taking this mnt write here
+        * ensures that (2) can not occur.
+        */
+       will_write = open_will_write_to_fs(flag, nd.path.dentry->d_inode);
+       if (will_write) {
+               error = mnt_want_write(nd.path.mnt);
+               if (error)
+                       goto exit;
+       }
+       error = may_open(&nd, acc_mode, flag);
+       if (error) {
+               if (will_write)
+                       mnt_drop_write(nd.path.mnt);
                goto exit;
-       return 0;
+       }
+       filp = nameidata_to_filp(&nd, open_flag);
+       /*
+        * It is now safe to drop the mnt write
+        * because the filp has had a write taken
+        * on its behalf.
+        */
+       if (will_write)
+               mnt_drop_write(nd.path.mnt);
+       return filp;
 
+exit_mutex_unlock:
+       mutex_unlock(&dir->d_inode->i_mutex);
 exit_dput:
-       path_put_conditional(&path, nd);
+       path_put_conditional(&path, &nd);
 exit:
-       if (!IS_ERR(nd->intent.open.file))
-               release_open_intent(nd);
-       path_put(&nd->path);
-       return error;
+       if (!IS_ERR(nd.intent.open.file))
+               release_open_intent(&nd);
+       path_put(&nd.path);
+       return ERR_PTR(error);
 
 do_link:
        error = -ELOOP;
@@ -1836,42 +1913,59 @@ do_link:
         * stored in nd->last.name and we will have to putname() it when we
         * are done. Procfs-like symlinks just set LAST_BIND.
         */
-       nd->flags |= LOOKUP_PARENT;
-       error = security_inode_follow_link(path.dentry, nd);
+       nd.flags |= LOOKUP_PARENT;
+       error = security_inode_follow_link(path.dentry, &nd);
        if (error)
                goto exit_dput;
-       error = __do_follow_link(&path, nd);
+       error = __do_follow_link(&path, &nd);
        if (error) {
                /* Does someone understand code flow here? Or it is only
                 * me so stupid? Anathema to whoever designed this non-sense
                 * with "intent.open".
                 */
-               release_open_intent(nd);
-               return error;
+               release_open_intent(&nd);
+               return ERR_PTR(error);
        }
-       nd->flags &= ~LOOKUP_PARENT;
-       if (nd->last_type == LAST_BIND)
+       nd.flags &= ~LOOKUP_PARENT;
+       if (nd.last_type == LAST_BIND)
                goto ok;
        error = -EISDIR;
-       if (nd->last_type != LAST_NORM)
+       if (nd.last_type != LAST_NORM)
                goto exit;
-       if (nd->last.name[nd->last.len]) {
-               __putname(nd->last.name);
+       if (nd.last.name[nd.last.len]) {
+               __putname(nd.last.name);
                goto exit;
        }
        error = -ELOOP;
        if (count++==32) {
-               __putname(nd->last.name);
+               __putname(nd.last.name);
                goto exit;
        }
-       dir = nd->path.dentry;
+       dir = nd.path.dentry;
        mutex_lock(&dir->d_inode->i_mutex);
-       path.dentry = lookup_hash(nd);
-       path.mnt = nd->path.mnt;
-       __putname(nd->last.name);
+       path.dentry = lookup_hash(&nd);
+       path.mnt = nd.path.mnt;
+       __putname(nd.last.name);
        goto do_last;
 }
 
+/**
+ * filp_open - open file and return file pointer
+ *
+ * @filename:  path to open
+ * @flags:     open flags as per the open(2) second argument
+ * @mode:      mode for the new file if O_CREAT is set, else ignored
+ *
+ * This is the helper to open a file from kernelspace if you really
+ * have to.  But in generally you should not do this, so please move
+ * along, nothing to see here..
+ */
+struct file *filp_open(const char *filename, int flags, int mode)
+{
+       return do_filp_open(AT_FDCWD, filename, flags, mode);
+}
+EXPORT_SYMBOL(filp_open);
+
 /**
  * lookup_create - lookup a dentry, creating it if it doesn't exist
  * @nd: nameidata info
@@ -1945,6 +2039,23 @@ int vfs_mknod(struct inode *dir, struct dentry *dentry, int mode, dev_t dev)
        return error;
 }
 
+static int may_mknod(mode_t mode)
+{
+       switch (mode & S_IFMT) {
+       case S_IFREG:
+       case S_IFCHR:
+       case S_IFBLK:
+       case S_IFIFO:
+       case S_IFSOCK:
+       case 0: /* zero mode translates to S_IFREG */
+               return 0;
+       case S_IFDIR:
+               return -EPERM;
+       default:
+               return -EINVAL;
+       }
+}
+
 asmlinkage long sys_mknodat(int dfd, const char __user *filename, int mode,
                                unsigned dev)
 {
@@ -1963,12 +2074,19 @@ asmlinkage long sys_mknodat(int dfd, const char __user *filename, int mode,
        if (error)
                goto out;
        dentry = lookup_create(&nd, 0);
-       error = PTR_ERR(dentry);
-
+       if (IS_ERR(dentry)) {
+               error = PTR_ERR(dentry);
+               goto out_unlock;
+       }
        if (!IS_POSIXACL(nd.path.dentry->d_inode))
                mode &= ~current->fs->umask;
-       if (!IS_ERR(dentry)) {
-               switch (mode & S_IFMT) {
+       error = may_mknod(mode);
+       if (error)
+               goto out_dput;
+       error = mnt_want_write(nd.path.mnt);
+       if (error)
+               goto out_dput;
+       switch (mode & S_IFMT) {
                case 0: case S_IFREG:
                        error = vfs_create(nd.path.dentry->d_inode,dentry,mode,&nd);
                        break;
@@ -1979,14 +2097,11 @@ asmlinkage long sys_mknodat(int dfd, const char __user *filename, int mode,
                case S_IFIFO: case S_IFSOCK:
                        error = vfs_mknod(nd.path.dentry->d_inode,dentry,mode,0);
                        break;
-               case S_IFDIR:
-                       error = -EPERM;
-                       break;
-               default:
-                       error = -EINVAL;
-               }
-               dput(dentry);
        }
+       mnt_drop_write(nd.path.mnt);
+out_dput:
+       dput(dentry);
+out_unlock:
        mutex_unlock(&nd.path.dentry->d_inode->i_mutex);
        path_put(&nd.path);
 out:
@@ -2044,7 +2159,12 @@ asmlinkage long sys_mkdirat(int dfd, const char __user *pathname, int mode)
 
        if (!IS_POSIXACL(nd.path.dentry->d_inode))
                mode &= ~current->fs->umask;
+       error = mnt_want_write(nd.path.mnt);
+       if (error)
+               goto out_dput;
        error = vfs_mkdir(nd.path.dentry->d_inode, dentry, mode);
+       mnt_drop_write(nd.path.mnt);
+out_dput:
        dput(dentry);
 out_unlock:
        mutex_unlock(&nd.path.dentry->d_inode->i_mutex);
@@ -2151,7 +2271,12 @@ static long do_rmdir(int dfd, const char __user *pathname)
        error = PTR_ERR(dentry);
        if (IS_ERR(dentry))
                goto exit2;
+       error = mnt_want_write(nd.path.mnt);
+       if (error)
+               goto exit3;
        error = vfs_rmdir(nd.path.dentry->d_inode, dentry);
+       mnt_drop_write(nd.path.mnt);
+exit3:
        dput(dentry);
 exit2:
        mutex_unlock(&nd.path.dentry->d_inode->i_mutex);
@@ -2232,7 +2357,11 @@ static long do_unlinkat(int dfd, const char __user *pathname)
                inode = dentry->d_inode;
                if (inode)
                        atomic_inc(&inode->i_count);
+               error = mnt_want_write(nd.path.mnt);
+               if (error)
+                       goto exit2;
                error = vfs_unlink(nd.path.dentry->d_inode, dentry);
+               mnt_drop_write(nd.path.mnt);
        exit2:
                dput(dentry);
        }
@@ -2313,7 +2442,12 @@ asmlinkage long sys_symlinkat(const char __user *oldname,
        if (IS_ERR(dentry))
                goto out_unlock;
 
+       error = mnt_want_write(nd.path.mnt);
+       if (error)
+               goto out_dput;
        error = vfs_symlink(nd.path.dentry->d_inode, dentry, from, S_IALLUGO);
+       mnt_drop_write(nd.path.mnt);
+out_dput:
        dput(dentry);
 out_unlock:
        mutex_unlock(&nd.path.dentry->d_inode->i_mutex);
@@ -2408,7 +2542,12 @@ asmlinkage long sys_linkat(int olddfd, const char __user *oldname,
        error = PTR_ERR(new_dentry);
        if (IS_ERR(new_dentry))
                goto out_unlock;
+       error = mnt_want_write(nd.path.mnt);
+       if (error)
+               goto out_dput;
        error = vfs_link(old_nd.path.dentry, nd.path.dentry->d_inode, new_dentry);
+       mnt_drop_write(nd.path.mnt);
+out_dput:
        dput(new_dentry);
 out_unlock:
        mutex_unlock(&nd.path.dentry->d_inode->i_mutex);
@@ -2634,8 +2773,12 @@ static int do_rename(int olddfd, const char *oldname,
        if (new_dentry == trap)
                goto exit5;
 
+       error = mnt_want_write(oldnd.path.mnt);
+       if (error)
+               goto exit5;
        error = vfs_rename(old_dir->d_inode, old_dentry,
                                   new_dir->d_inode, new_dentry);
+       mnt_drop_write(oldnd.path.mnt);
 exit5:
        dput(new_dentry);
 exit4:
index 94f026ec990ae24548eb02754f221b844abe0c2b..678f7ce060f2d69addc3af5110f6048b322dead7 100644 (file)
@@ -17,6 +17,7 @@
 #include <linux/quotaops.h>
 #include <linux/acct.h>
 #include <linux/capability.h>
+#include <linux/cpumask.h>
 #include <linux/module.h>
 #include <linux/sysfs.h>
 #include <linux/seq_file.h>
@@ -55,6 +56,8 @@ static inline unsigned long hash(struct vfsmount *mnt, struct dentry *dentry)
        return tmp & (HASH_SIZE - 1);
 }
 
+#define MNT_WRITER_UNDERFLOW_LIMIT -(1<<16)
+
 struct vfsmount *alloc_vfsmnt(const char *name)
 {
        struct vfsmount *mnt = kmem_cache_zalloc(mnt_cache, GFP_KERNEL);
@@ -68,6 +71,7 @@ struct vfsmount *alloc_vfsmnt(const char *name)
                INIT_LIST_HEAD(&mnt->mnt_share);
                INIT_LIST_HEAD(&mnt->mnt_slave_list);
                INIT_LIST_HEAD(&mnt->mnt_slave);
+               atomic_set(&mnt->__mnt_writers, 0);
                if (name) {
                        int size = strlen(name) + 1;
                        char *newname = kmalloc(size, GFP_KERNEL);
@@ -80,6 +84,263 @@ struct vfsmount *alloc_vfsmnt(const char *name)
        return mnt;
 }
 
+/*
+ * Most r/o checks on a fs are for operations that take
+ * discrete amounts of time, like a write() or unlink().
+ * We must keep track of when those operations start
+ * (for permission checks) and when they end, so that
+ * we can determine when writes are able to occur to
+ * a filesystem.
+ */
+/*
+ * __mnt_is_readonly: check whether a mount is read-only
+ * @mnt: the mount to check for its write status
+ *
+ * This shouldn't be used directly ouside of the VFS.
+ * It does not guarantee that the filesystem will stay
+ * r/w, just that it is right *now*.  This can not and
+ * should not be used in place of IS_RDONLY(inode).
+ * mnt_want/drop_write() will _keep_ the filesystem
+ * r/w.
+ */
+int __mnt_is_readonly(struct vfsmount *mnt)
+{
+       if (mnt->mnt_flags & MNT_READONLY)
+               return 1;
+       if (mnt->mnt_sb->s_flags & MS_RDONLY)
+               return 1;
+       return 0;
+}
+EXPORT_SYMBOL_GPL(__mnt_is_readonly);
+
+struct mnt_writer {
+       /*
+        * If holding multiple instances of this lock, they
+        * must be ordered by cpu number.
+        */
+       spinlock_t lock;
+       struct lock_class_key lock_class; /* compiles out with !lockdep */
+       unsigned long count;
+       struct vfsmount *mnt;
+} ____cacheline_aligned_in_smp;
+static DEFINE_PER_CPU(struct mnt_writer, mnt_writers);
+
+static int __init init_mnt_writers(void)
+{
+       int cpu;
+       for_each_possible_cpu(cpu) {
+               struct mnt_writer *writer = &per_cpu(mnt_writers, cpu);
+               spin_lock_init(&writer->lock);
+               lockdep_set_class(&writer->lock, &writer->lock_class);
+               writer->count = 0;
+       }
+       return 0;
+}
+fs_initcall(init_mnt_writers);
+
+static void unlock_mnt_writers(void)
+{
+       int cpu;
+       struct mnt_writer *cpu_writer;
+
+       for_each_possible_cpu(cpu) {
+               cpu_writer = &per_cpu(mnt_writers, cpu);
+               spin_unlock(&cpu_writer->lock);
+       }
+}
+
+static inline void __clear_mnt_count(struct mnt_writer *cpu_writer)
+{
+       if (!cpu_writer->mnt)
+               return;
+       /*
+        * This is in case anyone ever leaves an invalid,
+        * old ->mnt and a count of 0.
+        */
+       if (!cpu_writer->count)
+               return;
+       atomic_add(cpu_writer->count, &cpu_writer->mnt->__mnt_writers);
+       cpu_writer->count = 0;
+}
+ /*
+ * must hold cpu_writer->lock
+ */
+static inline void use_cpu_writer_for_mount(struct mnt_writer *cpu_writer,
+                                         struct vfsmount *mnt)
+{
+       if (cpu_writer->mnt == mnt)
+               return;
+       __clear_mnt_count(cpu_writer);
+       cpu_writer->mnt = mnt;
+}
+
+/*
+ * Most r/o checks on a fs are for operations that take
+ * discrete amounts of time, like a write() or unlink().
+ * We must keep track of when those operations start
+ * (for permission checks) and when they end, so that
+ * we can determine when writes are able to occur to
+ * a filesystem.
+ */
+/**
+ * mnt_want_write - get write access to a mount
+ * @mnt: the mount on which to take a write
+ *
+ * This tells the low-level filesystem that a write is
+ * about to be performed to it, and makes sure that
+ * writes are allowed before returning success.  When
+ * the write operation is finished, mnt_drop_write()
+ * must be called.  This is effectively a refcount.
+ */
+int mnt_want_write(struct vfsmount *mnt)
+{
+       int ret = 0;
+       struct mnt_writer *cpu_writer;
+
+       cpu_writer = &get_cpu_var(mnt_writers);
+       spin_lock(&cpu_writer->lock);
+       if (__mnt_is_readonly(mnt)) {
+               ret = -EROFS;
+               goto out;
+       }
+       use_cpu_writer_for_mount(cpu_writer, mnt);
+       cpu_writer->count++;
+out:
+       spin_unlock(&cpu_writer->lock);
+       put_cpu_var(mnt_writers);
+       return ret;
+}
+EXPORT_SYMBOL_GPL(mnt_want_write);
+
+static void lock_mnt_writers(void)
+{
+       int cpu;
+       struct mnt_writer *cpu_writer;
+
+       for_each_possible_cpu(cpu) {
+               cpu_writer = &per_cpu(mnt_writers, cpu);
+               spin_lock(&cpu_writer->lock);
+               __clear_mnt_count(cpu_writer);
+               cpu_writer->mnt = NULL;
+       }
+}
+
+/*
+ * These per-cpu write counts are not guaranteed to have
+ * matched increments and decrements on any given cpu.
+ * A file open()ed for write on one cpu and close()d on
+ * another cpu will imbalance this count.  Make sure it
+ * does not get too far out of whack.
+ */
+static void handle_write_count_underflow(struct vfsmount *mnt)
+{
+       if (atomic_read(&mnt->__mnt_writers) >=
+           MNT_WRITER_UNDERFLOW_LIMIT)
+               return;
+       /*
+        * It isn't necessary to hold all of the locks
+        * at the same time, but doing it this way makes
+        * us share a lot more code.
+        */
+       lock_mnt_writers();
+       /*
+        * vfsmount_lock is for mnt_flags.
+        */
+       spin_lock(&vfsmount_lock);
+       /*
+        * If coalescing the per-cpu writer counts did not
+        * get us back to a positive writer count, we have
+        * a bug.
+        */
+       if ((atomic_read(&mnt->__mnt_writers) < 0) &&
+           !(mnt->mnt_flags & MNT_IMBALANCED_WRITE_COUNT)) {
+               printk(KERN_DEBUG "leak detected on mount(%p) writers "
+                               "count: %d\n",
+                       mnt, atomic_read(&mnt->__mnt_writers));
+               WARN_ON(1);
+               /* use the flag to keep the dmesg spam down */
+               mnt->mnt_flags |= MNT_IMBALANCED_WRITE_COUNT;
+       }
+       spin_unlock(&vfsmount_lock);
+       unlock_mnt_writers();
+}
+
+/**
+ * mnt_drop_write - give up write access to a mount
+ * @mnt: the mount on which to give up write access
+ *
+ * Tells the low-level filesystem that we are done
+ * performing writes to it.  Must be matched with
+ * mnt_want_write() call above.
+ */
+void mnt_drop_write(struct vfsmount *mnt)
+{
+       int must_check_underflow = 0;
+       struct mnt_writer *cpu_writer;
+
+       cpu_writer = &get_cpu_var(mnt_writers);
+       spin_lock(&cpu_writer->lock);
+
+       use_cpu_writer_for_mount(cpu_writer, mnt);
+       if (cpu_writer->count > 0) {
+               cpu_writer->count--;
+       } else {
+               must_check_underflow = 1;
+               atomic_dec(&mnt->__mnt_writers);
+       }
+
+       spin_unlock(&cpu_writer->lock);
+       /*
+        * Logically, we could call this each time,
+        * but the __mnt_writers cacheline tends to
+        * be cold, and makes this expensive.
+        */
+       if (must_check_underflow)
+               handle_write_count_underflow(mnt);
+       /*
+        * This could be done right after the spinlock
+        * is taken because the spinlock keeps us on
+        * the cpu, and disables preemption.  However,
+        * putting it here bounds the amount that
+        * __mnt_writers can underflow.  Without it,
+        * we could theoretically wrap __mnt_writers.
+        */
+       put_cpu_var(mnt_writers);
+}
+EXPORT_SYMBOL_GPL(mnt_drop_write);
+
+static int mnt_make_readonly(struct vfsmount *mnt)
+{
+       int ret = 0;
+
+       lock_mnt_writers();
+       /*
+        * With all the locks held, this value is stable
+        */
+       if (atomic_read(&mnt->__mnt_writers) > 0) {
+               ret = -EBUSY;
+               goto out;
+       }
+       /*
+        * nobody can do a successful mnt_want_write() with all
+        * of the counts in MNT_DENIED_WRITE and the locks held.
+        */
+       spin_lock(&vfsmount_lock);
+       if (!ret)
+               mnt->mnt_flags |= MNT_READONLY;
+       spin_unlock(&vfsmount_lock);
+out:
+       unlock_mnt_writers();
+       return ret;
+}
+
+static void __mnt_unmake_readonly(struct vfsmount *mnt)
+{
+       spin_lock(&vfsmount_lock);
+       mnt->mnt_flags &= ~MNT_READONLY;
+       spin_unlock(&vfsmount_lock);
+}
+
 int simple_set_mnt(struct vfsmount *mnt, struct super_block *sb)
 {
        mnt->mnt_sb = sb;
@@ -271,7 +532,36 @@ static struct vfsmount *clone_mnt(struct vfsmount *old, struct dentry *root,
 
 static inline void __mntput(struct vfsmount *mnt)
 {
+       int cpu;
        struct super_block *sb = mnt->mnt_sb;
+       /*
+        * We don't have to hold all of the locks at the
+        * same time here because we know that we're the
+        * last reference to mnt and that no new writers
+        * can come in.
+        */
+       for_each_possible_cpu(cpu) {
+               struct mnt_writer *cpu_writer = &per_cpu(mnt_writers, cpu);
+               if (cpu_writer->mnt != mnt)
+                       continue;
+               spin_lock(&cpu_writer->lock);
+               atomic_add(cpu_writer->count, &mnt->__mnt_writers);
+               cpu_writer->count = 0;
+               /*
+                * Might as well do this so that no one
+                * ever sees the pointer and expects
+                * it to be valid.
+                */
+               cpu_writer->mnt = NULL;
+               spin_unlock(&cpu_writer->lock);
+       }
+       /*
+        * This probably indicates that somebody messed
+        * up a mnt_want/drop_write() pair.  If this
+        * happens, the filesystem was probably unable
+        * to make r/w->r/o transitions.
+        */
+       WARN_ON(atomic_read(&mnt->__mnt_writers));
        dput(mnt->mnt_root);
        free_vfsmnt(mnt);
        deactivate_super(sb);
@@ -417,7 +707,7 @@ static int show_vfsmnt(struct seq_file *m, void *v)
                seq_putc(m, '.');
                mangle(m, mnt->mnt_sb->s_subtype);
        }
-       seq_puts(m, mnt->mnt_sb->s_flags & MS_RDONLY ? " ro" : " rw");
+       seq_puts(m, __mnt_is_readonly(mnt) ? " ro" : " rw");
        for (fs_infop = fs_info; fs_infop->flag; fs_infop++) {
                if (mnt->mnt_sb->s_flags & fs_infop->flag)
                        seq_puts(m, fs_infop->str);
@@ -1019,6 +1309,23 @@ out:
        return err;
 }
 
+static int change_mount_flags(struct vfsmount *mnt, int ms_flags)
+{
+       int error = 0;
+       int readonly_request = 0;
+
+       if (ms_flags & MS_RDONLY)
+               readonly_request = 1;
+       if (readonly_request == __mnt_is_readonly(mnt))
+               return 0;
+
+       if (readonly_request)
+               error = mnt_make_readonly(mnt);
+       else
+               __mnt_unmake_readonly(mnt);
+       return error;
+}
+
 /*
  * change filesystem flags. dir should be a physical root of filesystem.
  * If you've mounted a non-root directory somewhere and want to do remount
@@ -1041,7 +1348,10 @@ static noinline int do_remount(struct nameidata *nd, int flags, int mnt_flags,
                return -EINVAL;
 
        down_write(&sb->s_umount);
-       err = do_remount_sb(sb, flags, data, 0);
+       if (flags & MS_BIND)
+               err = change_mount_flags(nd->path.mnt, flags);
+       else
+               err = do_remount_sb(sb, flags, data, 0);
        if (!err)
                nd->path.mnt->mnt_flags = mnt_flags;
        up_write(&sb->s_umount);
@@ -1425,6 +1735,8 @@ long do_mount(char *dev_name, char *dir_name, char *type_page,
                mnt_flags |= MNT_NODIRATIME;
        if (flags & MS_RELATIME)
                mnt_flags |= MNT_RELATIME;
+       if (flags & MS_RDONLY)
+               mnt_flags |= MNT_READONLY;
 
        flags &= ~(MS_NOSUID | MS_NOEXEC | MS_NODEV | MS_ACTIVE |
                   MS_NOATIME | MS_NODIRATIME | MS_RELATIME| MS_KERNMOUNT);
index c67b4bdcf719d0e02e86272962f22156c1f5ff25..ad8f167e54bc5e6069526b7406d26ed72fddb2ec 100644 (file)
@@ -14,6 +14,7 @@
 #include <linux/ioctl.h>
 #include <linux/time.h>
 #include <linux/mm.h>
+#include <linux/mount.h>
 #include <linux/highuid.h>
 #include <linux/smp_lock.h>
 #include <linux/vmalloc.h>
@@ -261,7 +262,7 @@ ncp_get_charsets(struct ncp_server* server, struct ncp_nls_ioctl __user *arg)
 }
 #endif /* CONFIG_NCPFS_NLS */
 
-int ncp_ioctl(struct inode *inode, struct file *filp,
+static int __ncp_ioctl(struct inode *inode, struct file *filp,
              unsigned int cmd, unsigned long arg)
 {
        struct ncp_server *server = NCP_SERVER(inode);
@@ -822,6 +823,57 @@ outrel:
        return -EINVAL;
 }
 
+static int ncp_ioctl_need_write(unsigned int cmd)
+{
+       switch (cmd) {
+       case NCP_IOC_GET_FS_INFO:
+       case NCP_IOC_GET_FS_INFO_V2:
+       case NCP_IOC_NCPREQUEST:
+       case NCP_IOC_SETDENTRYTTL:
+       case NCP_IOC_SIGN_INIT:
+       case NCP_IOC_LOCKUNLOCK:
+       case NCP_IOC_SET_SIGN_WANTED:
+               return 1;
+       case NCP_IOC_GETOBJECTNAME:
+       case NCP_IOC_SETOBJECTNAME:
+       case NCP_IOC_GETPRIVATEDATA:
+       case NCP_IOC_SETPRIVATEDATA:
+       case NCP_IOC_SETCHARSETS:
+       case NCP_IOC_GETCHARSETS:
+       case NCP_IOC_CONN_LOGGED_IN:
+       case NCP_IOC_GETDENTRYTTL:
+       case NCP_IOC_GETMOUNTUID2:
+       case NCP_IOC_SIGN_WANTED:
+       case NCP_IOC_GETROOT:
+       case NCP_IOC_SETROOT:
+               return 0;
+       default:
+               /* unkown IOCTL command, assume write */
+               return 1;
+       }
+}
+
+int ncp_ioctl(struct inode *inode, struct file *filp,
+             unsigned int cmd, unsigned long arg)
+{
+       int ret;
+
+       if (ncp_ioctl_need_write(cmd)) {
+               /*
+                * inside the ioctl(), any failures which
+                * are because of file_permission() are
+                * -EACCESS, so it seems consistent to keep
+                *  that here.
+                */
+               if (mnt_want_write(filp->f_path.mnt))
+                       return -EACCES;
+       }
+       ret = __ncp_ioctl(inode, filp, cmd, arg);
+       if (ncp_ioctl_need_write(cmd))
+               mnt_drop_write(filp->f_path.mnt);
+       return ret;
+}
+
 #ifdef CONFIG_COMPAT
 long ncp_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 {
index 6cea7479c5b4d13136fb753eecc453f19dc43229..d9e30ac2798dc1d79ac46ad1a9b6b385252d4ab3 100644 (file)
@@ -967,7 +967,8 @@ static int is_atomic_open(struct inode *dir, struct nameidata *nd)
        if (nd->flags & LOOKUP_DIRECTORY)
                return 0;
        /* Are we trying to write to a read only partition? */
-       if (IS_RDONLY(dir) && (nd->intent.open.flags & (O_CREAT|O_TRUNC|FMODE_WRITE)))
+       if (__mnt_is_readonly(nd->path.mnt) &&
+           (nd->intent.open.flags & (O_CREAT|O_TRUNC|FMODE_WRITE)))
                return 0;
        return 1;
 }
index c593db047d8bbd51babb22bbacc765f65636ff68..c309c881bd4e4e7a88500ad4c757d8c378216d99 100644 (file)
@@ -658,14 +658,19 @@ nfsd4_setattr(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
                        return status;
                }
        }
+       status = mnt_want_write(cstate->current_fh.fh_export->ex_path.mnt);
+       if (status)
+               return status;
        status = nfs_ok;
        if (setattr->sa_acl != NULL)
                status = nfsd4_set_nfs4_acl(rqstp, &cstate->current_fh,
                                            setattr->sa_acl);
        if (status)
-               return status;
+               goto out;
        status = nfsd_setattr(rqstp, &cstate->current_fh, &setattr->sa_iattr,
                                0, (time_t)0);
+out:
+       mnt_drop_write(cstate->current_fh.fh_export->ex_path.mnt);
        return status;
 }
 
index 1ff90625860f712397e9251d328ac3708d43b5b8..145b3c877a27c222984f3671f29b004c84db9cfd 100644 (file)
@@ -46,6 +46,7 @@
 #include <linux/scatterlist.h>
 #include <linux/crypto.h>
 #include <linux/sched.h>
+#include <linux/mount.h>
 
 #define NFSDDBG_FACILITY                NFSDDBG_PROC
 
@@ -154,7 +155,11 @@ nfsd4_create_clid_dir(struct nfs4_client *clp)
                dprintk("NFSD: nfsd4_create_clid_dir: DIRECTORY EXISTS\n");
                goto out_put;
        }
+       status = mnt_want_write(rec_dir.path.mnt);
+       if (status)
+               goto out_put;
        status = vfs_mkdir(rec_dir.path.dentry->d_inode, dentry, S_IRWXU);
+       mnt_drop_write(rec_dir.path.mnt);
 out_put:
        dput(dentry);
 out_unlock:
@@ -313,12 +318,17 @@ nfsd4_remove_clid_dir(struct nfs4_client *clp)
        if (!rec_dir_init || !clp->cl_firststate)
                return;
 
+       status = mnt_want_write(rec_dir.path.mnt);
+       if (status)
+               goto out;
        clp->cl_firststate = 0;
        nfs4_save_user(&uid, &gid);
        status = nfsd4_unlink_clid_dir(clp->cl_recdir, HEXDIR_LEN-1);
        nfs4_reset_user(uid, gid);
        if (status == 0)
                nfsd4_sync_rec_dir();
+       mnt_drop_write(rec_dir.path.mnt);
+out:
        if (status)
                printk("NFSD: Failed to remove expired client state directory"
                                " %.*s\n", HEXDIR_LEN, clp->cl_recdir);
@@ -347,13 +357,17 @@ nfsd4_recdir_purge_old(void) {
 
        if (!rec_dir_init)
                return;
+       status = mnt_want_write(rec_dir.path.mnt);
+       if (status)
+               goto out;
        status = nfsd4_list_rec_dir(rec_dir.path.dentry, purge_old);
        if (status == 0)
                nfsd4_sync_rec_dir();
+       mnt_drop_write(rec_dir.path.mnt);
+out:
        if (status)
                printk("nfsd4: failed to purge old clients from recovery"
                        " directory %s\n", rec_dir.path.dentry->d_name.name);
-       return;
 }
 
 static int
index bcb97d8e8b8bd6791a6161eb216ecba76a6e712d..81a75f3081f434891ad5e39ad7514182853bd837 100644 (file)
@@ -41,6 +41,7 @@
 #include <linux/sunrpc/svc.h>
 #include <linux/nfsd/nfsd.h>
 #include <linux/nfsd/cache.h>
+#include <linux/file.h>
 #include <linux/mount.h>
 #include <linux/workqueue.h>
 #include <linux/smp_lock.h>
@@ -1239,7 +1240,7 @@ static inline void
 nfs4_file_downgrade(struct file *filp, unsigned int share_access)
 {
        if (share_access & NFS4_SHARE_ACCESS_WRITE) {
-               put_write_access(filp->f_path.dentry->d_inode);
+               drop_file_write_access(filp);
                filp->f_mode = (filp->f_mode | FMODE_READ) & ~FMODE_WRITE;
        }
 }
index 46f59d5365a0d49986512c54a25ecdc6daeb54f1..304bf5f643c944e5dae2607798310ff3299aff22 100644 (file)
@@ -1255,23 +1255,35 @@ nfsd_create(struct svc_rqst *rqstp, struct svc_fh *fhp,
        err = 0;
        switch (type) {
        case S_IFREG:
+               host_err = mnt_want_write(fhp->fh_export->ex_path.mnt);
+               if (host_err)
+                       goto out_nfserr;
                host_err = vfs_create(dirp, dchild, iap->ia_mode, NULL);
                break;
        case S_IFDIR:
+               host_err = mnt_want_write(fhp->fh_export->ex_path.mnt);
+               if (host_err)
+                       goto out_nfserr;
                host_err = vfs_mkdir(dirp, dchild, iap->ia_mode);
                break;
        case S_IFCHR:
        case S_IFBLK:
        case S_IFIFO:
        case S_IFSOCK:
+               host_err = mnt_want_write(fhp->fh_export->ex_path.mnt);
+               if (host_err)
+                       goto out_nfserr;
                host_err = vfs_mknod(dirp, dchild, iap->ia_mode, rdev);
                break;
        default:
                printk("nfsd: bad file type %o in nfsd_create\n", type);
                host_err = -EINVAL;
+               goto out_nfserr;
        }
-       if (host_err < 0)
+       if (host_err < 0) {
+               mnt_drop_write(fhp->fh_export->ex_path.mnt);
                goto out_nfserr;
+       }
 
        if (EX_ISSYNC(fhp->fh_export)) {
                err = nfserrno(nfsd_sync_dir(dentry));
@@ -1282,6 +1294,7 @@ nfsd_create(struct svc_rqst *rqstp, struct svc_fh *fhp,
        err2 = nfsd_create_setattr(rqstp, resfhp, iap);
        if (err2)
                err = err2;
+       mnt_drop_write(fhp->fh_export->ex_path.mnt);
        /*
         * Update the file handle to get the new inode info.
         */
@@ -1359,6 +1372,9 @@ nfsd_create_v3(struct svc_rqst *rqstp, struct svc_fh *fhp,
                v_atime = verifier[1]&0x7fffffff;
        }
        
+       host_err = mnt_want_write(fhp->fh_export->ex_path.mnt);
+       if (host_err)
+               goto out_nfserr;
        if (dchild->d_inode) {
                err = 0;
 
@@ -1390,12 +1406,15 @@ nfsd_create_v3(struct svc_rqst *rqstp, struct svc_fh *fhp,
                case NFS3_CREATE_GUARDED:
                        err = nfserr_exist;
                }
+               mnt_drop_write(fhp->fh_export->ex_path.mnt);
                goto out;
        }
 
        host_err = vfs_create(dirp, dchild, iap->ia_mode, NULL);
-       if (host_err < 0)
+       if (host_err < 0) {
+               mnt_drop_write(fhp->fh_export->ex_path.mnt);
                goto out_nfserr;
+       }
        if (created)
                *created = 1;
 
@@ -1420,6 +1439,7 @@ nfsd_create_v3(struct svc_rqst *rqstp, struct svc_fh *fhp,
        if (err2)
                err = err2;
 
+       mnt_drop_write(fhp->fh_export->ex_path.mnt);
        /*
         * Update the filehandle to get the new inode info.
         */
@@ -1522,6 +1542,10 @@ nfsd_symlink(struct svc_rqst *rqstp, struct svc_fh *fhp,
        if (iap && (iap->ia_valid & ATTR_MODE))
                mode = iap->ia_mode & S_IALLUGO;
 
+       host_err = mnt_want_write(fhp->fh_export->ex_path.mnt);
+       if (host_err)
+               goto out_nfserr;
+
        if (unlikely(path[plen] != 0)) {
                char *path_alloced = kmalloc(plen+1, GFP_KERNEL);
                if (path_alloced == NULL)
@@ -1542,6 +1566,8 @@ nfsd_symlink(struct svc_rqst *rqstp, struct svc_fh *fhp,
        err = nfserrno(host_err);
        fh_unlock(fhp);
 
+       mnt_drop_write(fhp->fh_export->ex_path.mnt);
+
        cerr = fh_compose(resfhp, fhp->fh_export, dnew, fhp);
        dput(dnew);
        if (err==0) err = cerr;
@@ -1592,6 +1618,11 @@ nfsd_link(struct svc_rqst *rqstp, struct svc_fh *ffhp,
        dold = tfhp->fh_dentry;
        dest = dold->d_inode;
 
+       host_err = mnt_want_write(tfhp->fh_export->ex_path.mnt);
+       if (host_err) {
+               err = nfserrno(host_err);
+               goto out_dput;
+       }
        host_err = vfs_link(dold, dirp, dnew);
        if (!host_err) {
                if (EX_ISSYNC(ffhp->fh_export)) {
@@ -1605,7 +1636,8 @@ nfsd_link(struct svc_rqst *rqstp, struct svc_fh *ffhp,
                else
                        err = nfserrno(host_err);
        }
-
+       mnt_drop_write(tfhp->fh_export->ex_path.mnt);
+out_dput:
        dput(dnew);
 out_unlock:
        fh_unlock(ffhp);
@@ -1678,13 +1710,20 @@ nfsd_rename(struct svc_rqst *rqstp, struct svc_fh *ffhp, char *fname, int flen,
        if (ndentry == trap)
                goto out_dput_new;
 
-#ifdef MSNFS
-       if ((ffhp->fh_export->ex_flags & NFSEXP_MSNFS) &&
+       if (svc_msnfs(ffhp) &&
                ((atomic_read(&odentry->d_count) > 1)
                 || (atomic_read(&ndentry->d_count) > 1))) {
                        host_err = -EPERM;
-       } else
-#endif
+                       goto out_dput_new;
+       }
+
+       host_err = -EXDEV;
+       if (ffhp->fh_export->ex_path.mnt != tfhp->fh_export->ex_path.mnt)
+               goto out_dput_new;
+       host_err = mnt_want_write(ffhp->fh_export->ex_path.mnt);
+       if (host_err)
+               goto out_dput_new;
+
        host_err = vfs_rename(fdir, odentry, tdir, ndentry);
        if (!host_err && EX_ISSYNC(tfhp->fh_export)) {
                host_err = nfsd_sync_dir(tdentry);
@@ -1692,6 +1731,8 @@ nfsd_rename(struct svc_rqst *rqstp, struct svc_fh *ffhp, char *fname, int flen,
                        host_err = nfsd_sync_dir(fdentry);
        }
 
+       mnt_drop_write(ffhp->fh_export->ex_path.mnt);
+
  out_dput_new:
        dput(ndentry);
  out_dput_old:
@@ -1750,6 +1791,10 @@ nfsd_unlink(struct svc_rqst *rqstp, struct svc_fh *fhp, int type,
        if (!type)
                type = rdentry->d_inode->i_mode & S_IFMT;
 
+       host_err = mnt_want_write(fhp->fh_export->ex_path.mnt);
+       if (host_err)
+               goto out_nfserr;
+
        if (type != S_IFDIR) { /* It's UNLINK */
 #ifdef MSNFS
                if ((fhp->fh_export->ex_flags & NFSEXP_MSNFS) &&
@@ -1765,10 +1810,12 @@ nfsd_unlink(struct svc_rqst *rqstp, struct svc_fh *fhp, int type,
        dput(rdentry);
 
        if (host_err)
-               goto out_nfserr;
+               goto out_drop;
        if (EX_ISSYNC(fhp->fh_export))
                host_err = nfsd_sync_dir(dentry);
 
+out_drop:
+       mnt_drop_write(fhp->fh_export->ex_path.mnt);
 out_nfserr:
        err = nfserrno(host_err);
 out:
@@ -1865,7 +1912,7 @@ nfsd_permission(struct svc_rqst *rqstp, struct svc_export *exp,
                inode->i_mode,
                IS_IMMUTABLE(inode)?    " immut" : "",
                IS_APPEND(inode)?       " append" : "",
-               IS_RDONLY(inode)?       " ro" : "");
+               __mnt_is_readonly(exp->ex_path.mnt)?    " ro" : "");
        dprintk("      owner %d/%d user %d/%d\n",
                inode->i_uid, inode->i_gid, current->fsuid, current->fsgid);
 #endif
@@ -1876,7 +1923,8 @@ nfsd_permission(struct svc_rqst *rqstp, struct svc_export *exp,
         */
        if (!(acc & MAY_LOCAL_ACCESS))
                if (acc & (MAY_WRITE | MAY_SATTR | MAY_TRUNC)) {
-                       if (exp_rdonly(rqstp, exp) || IS_RDONLY(inode))
+                       if (exp_rdonly(rqstp, exp) ||
+                           __mnt_is_readonly(exp->ex_path.mnt))
                                return nfserr_rofs;
                        if (/* (acc & MAY_WRITE) && */ IS_IMMUTABLE(inode))
                                return nfserr_perm;
@@ -2039,6 +2087,9 @@ nfsd_set_posix_acl(struct svc_fh *fhp, int type, struct posix_acl *acl)
        } else
                size = 0;
 
+       error = mnt_want_write(fhp->fh_export->ex_path.mnt);
+       if (error)
+               goto getout;
        if (size)
                error = vfs_setxattr(fhp->fh_dentry, name, value, size, 0);
        else {
@@ -2050,6 +2101,7 @@ nfsd_set_posix_acl(struct svc_fh *fhp, int type, struct posix_acl *acl)
                                error = 0;
                }
        }
+       mnt_drop_write(fhp->fh_export->ex_path.mnt);
 
 getout:
        kfree(value);
index b413166dd16340c0a159abbbf24efdd71d69ad2c..7b142f0ce995bd07a5116567a0b2b56e65b8dd1b 100644 (file)
@@ -60,10 +60,6 @@ static int ocfs2_set_inode_attr(struct inode *inode, unsigned flags,
                goto bail;
        }
 
-       status = -EROFS;
-       if (IS_RDONLY(inode))
-               goto bail_unlock;
-
        status = -EACCES;
        if (!is_owner_or_cap(inode))
                goto bail_unlock;
@@ -134,8 +130,13 @@ long ocfs2_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
                if (get_user(flags, (int __user *) arg))
                        return -EFAULT;
 
-               return ocfs2_set_inode_attr(inode, flags,
+               status = mnt_want_write(filp->f_path.mnt);
+               if (status)
+                       return status;
+               status = ocfs2_set_inode_attr(inode, flags,
                        OCFS2_FL_MODIFIABLE);
+               mnt_drop_write(filp->f_path.mnt);
+               return status;
        case OCFS2_IOC_RESVSP:
        case OCFS2_IOC_RESVSP64:
        case OCFS2_IOC_UNRESVSP:
index 3fa4e4ffce4cb4ba69862703f90d289731809eab..b70e7666bb2c3f725a761b268b2370e5c151ba63 100644 (file)
--- a/fs/open.c
+++ b/fs/open.c
@@ -244,21 +244,21 @@ static long do_sys_truncate(const char __user * path, loff_t length)
        if (!S_ISREG(inode->i_mode))
                goto dput_and_out;
 
-       error = vfs_permission(&nd, MAY_WRITE);
+       error = mnt_want_write(nd.path.mnt);
        if (error)
                goto dput_and_out;
 
-       error = -EROFS;
-       if (IS_RDONLY(inode))
-               goto dput_and_out;
+       error = vfs_permission(&nd, MAY_WRITE);
+       if (error)
+               goto mnt_drop_write_and_out;
 
        error = -EPERM;
        if (IS_IMMUTABLE(inode) || IS_APPEND(inode))
-               goto dput_and_out;
+               goto mnt_drop_write_and_out;
 
        error = get_write_access(inode);
        if (error)
-               goto dput_and_out;
+               goto mnt_drop_write_and_out;
 
        /*
         * Make sure that there are no leases.  get_write_access() protects
@@ -276,6 +276,8 @@ static long do_sys_truncate(const char __user * path, loff_t length)
 
 put_write_and_out:
        put_write_access(inode);
+mnt_drop_write_and_out:
+       mnt_drop_write(nd.path.mnt);
 dput_and_out:
        path_put(&nd.path);
 out:
@@ -457,8 +459,17 @@ asmlinkage long sys_faccessat(int dfd, const char __user *filename, int mode)
        if(res || !(mode & S_IWOTH) ||
           special_file(nd.path.dentry->d_inode->i_mode))
                goto out_path_release;
-
-       if(IS_RDONLY(nd.path.dentry->d_inode))
+       /*
+        * This is a rare case where using __mnt_is_readonly()
+        * is OK without a mnt_want/drop_write() pair.  Since
+        * no actual write to the fs is performed here, we do
+        * not need to telegraph to that to anyone.
+        *
+        * By doing this, we accept that this access is
+        * inherently racy and know that the fs may change
+        * state before we even see this result.
+        */
+       if (__mnt_is_readonly(nd.path.mnt))
                res = -EROFS;
 
 out_path_release:
@@ -567,12 +578,12 @@ asmlinkage long sys_fchmod(unsigned int fd, mode_t mode)
 
        audit_inode(NULL, dentry);
 
-       err = -EROFS;
-       if (IS_RDONLY(inode))
+       err = mnt_want_write(file->f_path.mnt);
+       if (err)
                goto out_putf;
        err = -EPERM;
        if (IS_IMMUTABLE(inode) || IS_APPEND(inode))
-               goto out_putf;
+               goto out_drop_write;
        mutex_lock(&inode->i_mutex);
        if (mode == (mode_t) -1)
                mode = inode->i_mode;
@@ -581,6 +592,8 @@ asmlinkage long sys_fchmod(unsigned int fd, mode_t mode)
        err = notify_change(dentry, &newattrs);
        mutex_unlock(&inode->i_mutex);
 
+out_drop_write:
+       mnt_drop_write(file->f_path.mnt);
 out_putf:
        fput(file);
 out:
@@ -600,13 +613,13 @@ asmlinkage long sys_fchmodat(int dfd, const char __user *filename,
                goto out;
        inode = nd.path.dentry->d_inode;
 
-       error = -EROFS;
-       if (IS_RDONLY(inode))
+       error = mnt_want_write(nd.path.mnt);
+       if (error)
                goto dput_and_out;
 
        error = -EPERM;
        if (IS_IMMUTABLE(inode) || IS_APPEND(inode))
-               goto dput_and_out;
+               goto out_drop_write;
 
        mutex_lock(&inode->i_mutex);
        if (mode == (mode_t) -1)
@@ -616,6 +629,8 @@ asmlinkage long sys_fchmodat(int dfd, const char __user *filename,
        error = notify_change(nd.path.dentry, &newattrs);
        mutex_unlock(&inode->i_mutex);
 
+out_drop_write:
+       mnt_drop_write(nd.path.mnt);
 dput_and_out:
        path_put(&nd.path);
 out:
@@ -638,9 +653,6 @@ static int chown_common(struct dentry * dentry, uid_t user, gid_t group)
                printk(KERN_ERR "chown_common: NULL inode\n");
                goto out;
        }
-       error = -EROFS;
-       if (IS_RDONLY(inode))
-               goto out;
        error = -EPERM;
        if (IS_IMMUTABLE(inode) || IS_APPEND(inode))
                goto out;
@@ -671,7 +683,12 @@ asmlinkage long sys_chown(const char __user * filename, uid_t user, gid_t group)
        error = user_path_walk(filename, &nd);
        if (error)
                goto out;
+       error = mnt_want_write(nd.path.mnt);
+       if (error)
+               goto out_release;
        error = chown_common(nd.path.dentry, user, group);
+       mnt_drop_write(nd.path.mnt);
+out_release:
        path_put(&nd.path);
 out:
        return error;
@@ -691,7 +708,12 @@ asmlinkage long sys_fchownat(int dfd, const char __user *filename, uid_t user,
        error = __user_walk_fd(dfd, filename, follow, &nd);
        if (error)
                goto out;
+       error = mnt_want_write(nd.path.mnt);
+       if (error)
+               goto out_release;
        error = chown_common(nd.path.dentry, user, group);
+       mnt_drop_write(nd.path.mnt);
+out_release:
        path_put(&nd.path);
 out:
        return error;
@@ -705,7 +727,12 @@ asmlinkage long sys_lchown(const char __user * filename, uid_t user, gid_t group
        error = user_path_walk_link(filename, &nd);
        if (error)
                goto out;
+       error = mnt_want_write(nd.path.mnt);
+       if (error)
+               goto out_release;
        error = chown_common(nd.path.dentry, user, group);
+       mnt_drop_write(nd.path.mnt);
+out_release:
        path_put(&nd.path);
 out:
        return error;
@@ -722,14 +749,48 @@ asmlinkage long sys_fchown(unsigned int fd, uid_t user, gid_t group)
        if (!file)
                goto out;
 
+       error = mnt_want_write(file->f_path.mnt);
+       if (error)
+               goto out_fput;
        dentry = file->f_path.dentry;
        audit_inode(NULL, dentry);
        error = chown_common(dentry, user, group);
+       mnt_drop_write(file->f_path.mnt);
+out_fput:
        fput(file);
 out:
        return error;
 }
 
+/*
+ * You have to be very careful that these write
+ * counts get cleaned up in error cases and
+ * upon __fput().  This should probably never
+ * be called outside of __dentry_open().
+ */
+static inline int __get_file_write_access(struct inode *inode,
+                                         struct vfsmount *mnt)
+{
+       int error;
+       error = get_write_access(inode);
+       if (error)
+               return error;
+       /*
+        * Do not take mount writer counts on
+        * special files since no writes to
+        * the mount itself will occur.
+        */
+       if (!special_file(inode->i_mode)) {
+               /*
+                * Balanced in __fput()
+                */
+               error = mnt_want_write(mnt);
+               if (error)
+                       put_write_access(inode);
+       }
+       return error;
+}
+
 static struct file *__dentry_open(struct dentry *dentry, struct vfsmount *mnt,
                                        int flags, struct file *f,
                                        int (*open)(struct inode *, struct file *))
@@ -742,9 +803,11 @@ static struct file *__dentry_open(struct dentry *dentry, struct vfsmount *mnt,
                                FMODE_PREAD | FMODE_PWRITE;
        inode = dentry->d_inode;
        if (f->f_mode & FMODE_WRITE) {
-               error = get_write_access(inode);
+               error = __get_file_write_access(inode, mnt);
                if (error)
                        goto cleanup_file;
+               if (!special_file(inode->i_mode))
+                       file_take_write(f);
        }
 
        f->f_mapping = inode->i_mapping;
@@ -784,8 +847,19 @@ static struct file *__dentry_open(struct dentry *dentry, struct vfsmount *mnt,
 
 cleanup_all:
        fops_put(f->f_op);
-       if (f->f_mode & FMODE_WRITE)
+       if (f->f_mode & FMODE_WRITE) {
                put_write_access(inode);
+               if (!special_file(inode->i_mode)) {
+                       /*
+                        * We don't consider this a real
+                        * mnt_want/drop_write() pair
+                        * because it all happenend right
+                        * here, so just reset the state.
+                        */
+                       file_reset_write(f);
+                       mnt_drop_write(mnt);
+               }
+       }
        file_kill(f);
        f->f_path.dentry = NULL;
        f->f_path.mnt = NULL;
@@ -796,43 +870,6 @@ cleanup_file:
        return ERR_PTR(error);
 }
 
-/*
- * Note that while the flag value (low two bits) for sys_open means:
- *     00 - read-only
- *     01 - write-only
- *     10 - read-write
- *     11 - special
- * it is changed into
- *     00 - no permissions needed
- *     01 - read-permission
- *     10 - write-permission
- *     11 - read-write
- * for the internal routines (ie open_namei()/follow_link() etc). 00 is
- * used by symlinks.
- */
-static struct file *do_filp_open(int dfd, const char *filename, int flags,
-                                int mode)
-{
-       int namei_flags, error;
-       struct nameidata nd;
-
-       namei_flags = flags;
-       if ((namei_flags+1) & O_ACCMODE)
-               namei_flags++;
-
-       error = open_namei(dfd, filename, namei_flags, mode, &nd);
-       if (!error)
-               return nameidata_to_filp(&nd, flags);
-
-       return ERR_PTR(error);
-}
-
-struct file *filp_open(const char *filename, int flags, int mode)
-{
-       return do_filp_open(AT_FDCWD, filename, flags, mode);
-}
-EXPORT_SYMBOL(filp_open);
-
 /**
  * lookup_instantiate_filp - instantiates the open intent filp
  * @nd: pointer to nameidata
index 03f808c5b79d4733e55b2c017ff8a5ab399c45fc..6149e4b58c887a62cd11e4776650b1880745af2a 100644 (file)
@@ -473,6 +473,10 @@ int rescan_partitions(struct gendisk *disk, struct block_device *bdev)
                return 0;
        if (IS_ERR(state))      /* I/O error reading the partition table */
                return -EIO;
+
+       /* tell userspace that the media / partition table may have changed */
+       kobject_uevent(&disk->dev.kobj, KOBJ_CHANGE);
+
        for (p = 1; p < state->limit; p++) {
                sector_t size = state->parts[p].size;
                sector_t from = state->parts[p].from;
index e0f0f098a523a8d1c3a41099ab76b411989a23a0..74363a7aacbcb64154c81b1f6bcb832e0fee8727 100644 (file)
@@ -4,6 +4,7 @@
 
 #include <linux/capability.h>
 #include <linux/fs.h>
+#include <linux/mount.h>
 #include <linux/reiserfs_fs.h>
 #include <linux/time.h>
 #include <asm/uaccess.h>
@@ -25,6 +26,7 @@ int reiserfs_ioctl(struct inode *inode, struct file *filp, unsigned int cmd,
                   unsigned long arg)
 {
        unsigned int flags;
+       int err = 0;
 
        switch (cmd) {
        case REISERFS_IOC_UNPACK:
@@ -48,50 +50,67 @@ int reiserfs_ioctl(struct inode *inode, struct file *filp, unsigned int cmd,
                        if (!reiserfs_attrs(inode->i_sb))
                                return -ENOTTY;
 
-                       if (IS_RDONLY(inode))
-                               return -EROFS;
+                       err = mnt_want_write(filp->f_path.mnt);
+                       if (err)
+                               return err;
 
-                       if (!is_owner_or_cap(inode))
-                               return -EPERM;
-
-                       if (get_user(flags, (int __user *)arg))
-                               return -EFAULT;
-
-                       /* Is it quota file? Do not allow user to mess with it. */
-                       if (IS_NOQUOTA(inode))
-                               return -EPERM;
+                       if (!is_owner_or_cap(inode)) {
+                               err = -EPERM;
+                               goto setflags_out;
+                       }
+                       if (get_user(flags, (int __user *)arg)) {
+                               err = -EFAULT;
+                               goto setflags_out;
+                       }
+                       /*
+                        * Is it quota file? Do not allow user to mess with it
+                        */
+                       if (IS_NOQUOTA(inode)) {
+                               err = -EPERM;
+                               goto setflags_out;
+                       }
                        if (((flags ^ REISERFS_I(inode)->
                              i_attrs) & (REISERFS_IMMUTABLE_FL |
                                          REISERFS_APPEND_FL))
-                           && !capable(CAP_LINUX_IMMUTABLE))
-                               return -EPERM;
-
+                           && !capable(CAP_LINUX_IMMUTABLE)) {
+                               err = -EPERM;
+                               goto setflags_out;
+                       }
                        if ((flags & REISERFS_NOTAIL_FL) &&
                            S_ISREG(inode->i_mode)) {
                                int result;
 
                                result = reiserfs_unpack(inode, filp);
-                               if (result)
-                                       return result;
+                               if (result) {
+                                       err = result;
+                                       goto setflags_out;
+                               }
                        }
                        sd_attrs_to_i_attrs(flags, inode);
                        REISERFS_I(inode)->i_attrs = flags;
                        inode->i_ctime = CURRENT_TIME_SEC;
                        mark_inode_dirty(inode);
-                       return 0;
+setflags_out:
+                       mnt_drop_write(filp->f_path.mnt);
+                       return err;
                }
        case REISERFS_IOC_GETVERSION:
                return put_user(inode->i_generation, (int __user *)arg);
        case REISERFS_IOC_SETVERSION:
                if (!is_owner_or_cap(inode))
                        return -EPERM;
-               if (IS_RDONLY(inode))
-                       return -EROFS;
-               if (get_user(inode->i_generation, (int __user *)arg))
-                       return -EFAULT;
+               err = mnt_want_write(filp->f_path.mnt);
+               if (err)
+                       return err;
+               if (get_user(inode->i_generation, (int __user *)arg)) {
+                       err = -EFAULT;
+                       goto setversion_out;
+               }
                inode->i_ctime = CURRENT_TIME_SEC;
                mark_inode_dirty(inode);
-               return 0;
+setversion_out:
+               mnt_drop_write(filp->f_path.mnt);
+               return err;
        default:
                return -ENOTTY;
        }
index bb05a3e51b93ba709a01135d940e8c3c0fa8f320..060eb3f598e7d58b90d9595a9e9d4dcac33c4046 100644 (file)
@@ -38,7 +38,7 @@
 #include <asm/system.h>
 
 #include <linux/time.h>
-#include <asm/semaphore.h>
+#include <linux/semaphore.h>
 
 #include <linux/vmalloc.h>
 #include <linux/reiserfs_fs.h>
index 344b9b96cc56ecd10f0612300e844948b0892d90..d7c4935c1034b58d8a5399dcd22d63b2d645cc41 100644 (file)
@@ -44,7 +44,6 @@
 #include <net/checksum.h>
 #include <linux/smp_lock.h>
 #include <linux/stat.h>
-#include <asm/semaphore.h>
 
 #define FL_READONLY 128
 #define FL_DIR_SEM_HELD 256
index 09008dbd264e731411c6da60def6648888cc6b52..1f8f05ede437067cadcfb00b77baa47bd09e9a5e 100644 (file)
@@ -37,6 +37,7 @@
 #include <linux/idr.h>
 #include <linux/kobject.h>
 #include <linux/mutex.h>
+#include <linux/file.h>
 #include <asm/uaccess.h>
 
 
@@ -567,10 +568,29 @@ static void mark_files_ro(struct super_block *sb)
 {
        struct file *f;
 
+retry:
        file_list_lock();
        list_for_each_entry(f, &sb->s_files, f_u.fu_list) {
-               if (S_ISREG(f->f_path.dentry->d_inode->i_mode) && file_count(f))
-                       f->f_mode &= ~FMODE_WRITE;
+               struct vfsmount *mnt;
+               if (!S_ISREG(f->f_path.dentry->d_inode->i_mode))
+                      continue;
+               if (!file_count(f))
+                       continue;
+               if (!(f->f_mode & FMODE_WRITE))
+                       continue;
+               f->f_mode &= ~FMODE_WRITE;
+               if (file_check_writeable(f) != 0)
+                       continue;
+               file_release_write(f);
+               mnt = mntget(f->f_path.mnt);
+               file_list_unlock();
+               /*
+                * This can sleep, so we can't hold
+                * the file_list_lock() spinlock.
+                */
+               mnt_drop_write(mnt);
+               mntput(mnt);
+               goto retry;
        }
        file_list_unlock();
 }
index 4948d9bc405dfbdb23f30dcd5ad47d103f4e5514..a1c3a1fab7f01d591ea571dc99974b21abfd3c27 100644 (file)
@@ -20,6 +20,7 @@
 #include <linux/idr.h>
 #include <linux/completion.h>
 #include <linux/mutex.h>
+#include <linux/slab.h>
 #include "sysfs.h"
 
 DEFINE_MUTEX(sysfs_mutex);
index baa663e69388aeb623aeb667f86ff12540b741e8..ade9a7e6a75763cd11304a638113f86e18f09d01 100644 (file)
@@ -13,6 +13,7 @@
 #include <linux/module.h>
 #include <linux/kobject.h>
 #include <linux/kallsyms.h>
+#include <linux/slab.h>
 #include <linux/namei.h>
 #include <linux/poll.h>
 #include <linux/list.h>
@@ -128,7 +129,7 @@ sysfs_read_file(struct file *file, char __user *buf, size_t count, loff_t *ppos)
        ssize_t retval = 0;
 
        mutex_lock(&buffer->mutex);
-       if (buffer->needs_read_fill) {
+       if (buffer->needs_read_fill || *ppos == 0) {
                retval = fill_read_buffer(file->f_path.dentry,buffer);
                if (retval)
                        goto out;
@@ -409,8 +410,7 @@ static int sysfs_release(struct inode *inode, struct file *filp)
  * return POLLERR|POLLPRI, and select will return the fd whether
  * it is waiting for read, write, or exceptions.
  * Once poll/select indicates that the value has changed, you
- * need to close and re-open the file, as simply seeking and reading
- * again will not get new data, or reset the state of 'poll'.
+ * need to close and re-open the file, or seek to 0 and read again.
  * Reminder: this only works for attributes which actively support
  * it, and it is not possible to test an attribute from userspace
  * to see if it supports poll (Neither 'poll' nor 'select' return
index b18da9c0b97f5f03185b13678ac0ca16932d9c70..a2bef77dc9c9878c3f93684acf86548f443d989f 100644 (file)
@@ -2,6 +2,7 @@
 #include <linux/file.h>
 #include <linux/fs.h>
 #include <linux/linkage.h>
+#include <linux/mount.h>
 #include <linux/namei.h>
 #include <linux/sched.h>
 #include <linux/stat.h>
@@ -59,6 +60,7 @@ long do_utimes(int dfd, char __user *filename, struct timespec *times, int flags
        struct inode *inode;
        struct iattr newattrs;
        struct file *f = NULL;
+       struct vfsmount *mnt;
 
        error = -EINVAL;
        if (times && (!nsec_valid(times[0].tv_nsec) ||
@@ -79,18 +81,20 @@ long do_utimes(int dfd, char __user *filename, struct timespec *times, int flags
                if (!f)
                        goto out;
                dentry = f->f_path.dentry;
+               mnt = f->f_path.mnt;
        } else {
                error = __user_walk_fd(dfd, filename, (flags & AT_SYMLINK_NOFOLLOW) ? 0 : LOOKUP_FOLLOW, &nd);
                if (error)
                        goto out;
 
                dentry = nd.path.dentry;
+               mnt = nd.path.mnt;
        }
 
        inode = dentry->d_inode;
 
-       error = -EROFS;
-       if (IS_RDONLY(inode))
+       error = mnt_want_write(mnt);
+       if (error)
                goto dput_and_out;
 
        /* Don't worry, the checks are done in inode_change_ok() */
@@ -98,7 +102,7 @@ long do_utimes(int dfd, char __user *filename, struct timespec *times, int flags
        if (times) {
                error = -EPERM;
                 if (IS_APPEND(inode) || IS_IMMUTABLE(inode))
-                        goto dput_and_out;
+                       goto mnt_drop_write_and_out;
 
                if (times[0].tv_nsec == UTIME_OMIT)
                        newattrs.ia_valid &= ~ATTR_ATIME;
@@ -118,22 +122,24 @@ long do_utimes(int dfd, char __user *filename, struct timespec *times, int flags
        } else {
                error = -EACCES;
                 if (IS_IMMUTABLE(inode))
-                        goto dput_and_out;
+                       goto mnt_drop_write_and_out;
 
                if (!is_owner_or_cap(inode)) {
                        if (f) {
                                if (!(f->f_mode & FMODE_WRITE))
-                                       goto dput_and_out;
+                                       goto mnt_drop_write_and_out;
                        } else {
                                error = vfs_permission(&nd, MAY_WRITE);
                                if (error)
-                                       goto dput_and_out;
+                                       goto mnt_drop_write_and_out;
                        }
                }
        }
        mutex_lock(&inode->i_mutex);
        error = notify_change(dentry, &newattrs);
        mutex_unlock(&inode->i_mutex);
+mnt_drop_write_and_out:
+       mnt_drop_write(mnt);
 dput_and_out:
        if (f)
                fput(f);
index 3acab16154608724f5558458eea5cac2a00b0b5a..f7062da505d4b1a6d64fc5d686a98ed8cea5e7f4 100644 (file)
@@ -11,6 +11,7 @@
 #include <linux/slab.h>
 #include <linux/file.h>
 #include <linux/xattr.h>
+#include <linux/mount.h>
 #include <linux/namei.h>
 #include <linux/security.h>
 #include <linux/syscalls.h>
@@ -32,8 +33,6 @@ xattr_permission(struct inode *inode, const char *name, int mask)
         * filesystem  or on an immutable / append-only inode.
         */
        if (mask & MAY_WRITE) {
-               if (IS_RDONLY(inode))
-                       return -EROFS;
                if (IS_IMMUTABLE(inode) || IS_APPEND(inode))
                        return -EPERM;
        }
@@ -262,7 +261,11 @@ sys_setxattr(char __user *path, char __user *name, void __user *value,
        error = user_path_walk(path, &nd);
        if (error)
                return error;
-       error = setxattr(nd.path.dentry, name, value, size, flags);
+       error = mnt_want_write(nd.path.mnt);
+       if (!error) {
+               error = setxattr(nd.path.dentry, name, value, size, flags);
+               mnt_drop_write(nd.path.mnt);
+       }
        path_put(&nd.path);
        return error;
 }
@@ -277,7 +280,11 @@ sys_lsetxattr(char __user *path, char __user *name, void __user *value,
        error = user_path_walk_link(path, &nd);
        if (error)
                return error;
-       error = setxattr(nd.path.dentry, name, value, size, flags);
+       error = mnt_want_write(nd.path.mnt);
+       if (!error) {
+               error = setxattr(nd.path.dentry, name, value, size, flags);
+               mnt_drop_write(nd.path.mnt);
+       }
        path_put(&nd.path);
        return error;
 }
@@ -295,7 +302,12 @@ sys_fsetxattr(int fd, char __user *name, void __user *value,
                return error;
        dentry = f->f_path.dentry;
        audit_inode(NULL, dentry);
-       error = setxattr(dentry, name, value, size, flags);
+       error = mnt_want_write(f->f_path.mnt);
+       if (!error) {
+               error = setxattr(dentry, name, value, size, flags);
+               mnt_drop_write(f->f_path.mnt);
+       }
+out_fput:
        fput(f);
        return error;
 }
@@ -482,7 +494,11 @@ sys_removexattr(char __user *path, char __user *name)
        error = user_path_walk(path, &nd);
        if (error)
                return error;
-       error = removexattr(nd.path.dentry, name);
+       error = mnt_want_write(nd.path.mnt);
+       if (!error) {
+               error = removexattr(nd.path.dentry, name);
+               mnt_drop_write(nd.path.mnt);
+       }
        path_put(&nd.path);
        return error;
 }
@@ -496,7 +512,11 @@ sys_lremovexattr(char __user *path, char __user *name)
        error = user_path_walk_link(path, &nd);
        if (error)
                return error;
-       error = removexattr(nd.path.dentry, name);
+       error = mnt_want_write(nd.path.mnt);
+       if (!error) {
+               error = removexattr(nd.path.dentry, name);
+               mnt_drop_write(nd.path.mnt);
+       }
        path_put(&nd.path);
        return error;
 }
@@ -513,7 +533,11 @@ sys_fremovexattr(int fd, char __user *name)
                return error;
        dentry = f->f_path.dentry;
        audit_inode(NULL, dentry);
-       error = removexattr(dentry, name);
+       error = mnt_want_write(f->f_path.mnt);
+       if (!error) {
+               error = removexattr(dentry, name);
+               mnt_drop_write(f->f_path.mnt);
+       }
        fput(f);
        return error;
 }
index 2009e6d922ce5161304813b82a7ea7ca47c2351a..3abe7e9ceb33f25bdbbba82ee4907a475cf05d52 100644 (file)
@@ -20,8 +20,8 @@
 
 #include <linux/time.h>
 #include <linux/wait.h>
+#include <linux/semaphore.h>
 #include <asm/atomic.h>
-#include <asm/semaphore.h>
 
 /*
  * sema_t structure just maps to struct semaphore in Linux kernel.
index bf77597938564d1b498c10e90440ff3339495684..4ddb86b73c6b537034b09d2632c7d2061432a736 100644 (file)
@@ -535,8 +535,6 @@ xfs_attrmulti_attr_set(
        char                    *kbuf;
        int                     error = EFAULT;
 
-       if (IS_RDONLY(inode))
-               return -EROFS;
        if (IS_IMMUTABLE(inode) || IS_APPEND(inode))
                return EPERM;
        if (len > XATTR_SIZE_MAX)
@@ -562,8 +560,6 @@ xfs_attrmulti_attr_remove(
        char                    *name,
        __uint32_t              flags)
 {
-       if (IS_RDONLY(inode))
-               return -EROFS;
        if (IS_IMMUTABLE(inode) || IS_APPEND(inode))
                return EPERM;
        return xfs_attr_remove(XFS_I(inode), name, flags);
@@ -573,6 +569,7 @@ STATIC int
 xfs_attrmulti_by_handle(
        xfs_mount_t             *mp,
        void                    __user *arg,
+       struct file             *parfilp,
        struct inode            *parinode)
 {
        int                     error;
@@ -626,13 +623,21 @@ xfs_attrmulti_by_handle(
                                        &ops[i].am_length, ops[i].am_flags);
                        break;
                case ATTR_OP_SET:
+                       ops[i].am_error = mnt_want_write(parfilp->f_path.mnt);
+                       if (ops[i].am_error)
+                               break;
                        ops[i].am_error = xfs_attrmulti_attr_set(inode,
                                        attr_name, ops[i].am_attrvalue,
                                        ops[i].am_length, ops[i].am_flags);
+                       mnt_drop_write(parfilp->f_path.mnt);
                        break;
                case ATTR_OP_REMOVE:
+                       ops[i].am_error = mnt_want_write(parfilp->f_path.mnt);
+                       if (ops[i].am_error)
+                               break;
                        ops[i].am_error = xfs_attrmulti_attr_remove(inode,
                                        attr_name, ops[i].am_flags);
+                       mnt_drop_write(parfilp->f_path.mnt);
                        break;
                default:
                        ops[i].am_error = EINVAL;
@@ -1133,7 +1138,7 @@ xfs_ioctl(
                return xfs_attrlist_by_handle(mp, arg, inode);
 
        case XFS_IOC_ATTRMULTI_BY_HANDLE:
-               return xfs_attrmulti_by_handle(mp, arg, inode);
+               return xfs_attrmulti_by_handle(mp, arg, filp, inode);
 
        case XFS_IOC_SWAPEXT: {
                error = xfs_swapext((struct xfs_swapext __user *)arg);
index 0c958cf7775880ce0a8004d38caa424887387edd..a1237dad6430b28221be1dc033f6f0a4e599f2cf 100644 (file)
@@ -155,13 +155,6 @@ xfs_ichgtime_fast(
         */
        ASSERT((flags & XFS_ICHGTIME_ACC) == 0);
 
-       /*
-        * We're not supposed to change timestamps in readonly-mounted
-        * filesystems.  Throw it away if anyone asks us.
-        */
-       if (unlikely(IS_RDONLY(inode)))
-               return;
-
        if (flags & XFS_ICHGTIME_MOD) {
                tvp = &inode->i_mtime;
                ip->i_d.di_mtime.t_sec = (__int32_t)tvp->tv_sec;
index 21c0dbc74093b2bcf62971d58ff3a6b0168d27f1..1ebd8004469c1d3a70a0afc0f8a34f8400ea5011 100644 (file)
@@ -51,6 +51,7 @@
 #include "xfs_vnodeops.h"
 
 #include <linux/capability.h>
+#include <linux/mount.h>
 #include <linux/writeback.h>
 
 
@@ -670,10 +671,16 @@ start:
        if (new_size > xip->i_size)
                xip->i_new_size = new_size;
 
-       if (likely(!(ioflags & IO_INVIS))) {
+       /*
+        * We're not supposed to change timestamps in readonly-mounted
+        * filesystems.  Throw it away if anyone asks us.
+        */
+       if (likely(!(ioflags & IO_INVIS) &&
+                  !mnt_want_write(file->f_path.mnt))) {
                file_update_time(file);
                xfs_ichgtime_fast(xip, inode,
                                  XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG);
+               mnt_drop_write(file->f_path.mnt);
        }
 
        /*
index 420ccde6b916a31f8d601d46e601a3062bfc658b..149532e162c4f4293decb64e8e73aab339c13521 100644 (file)
@@ -41,8 +41,7 @@ static inline cpumask_t node_to_cpumask(int node)
 
 #define pcibus_to_cpumask(bus) (cpu_online_map)
 
-#else /* CONFIG_NUMA */
-# include <asm-generic/topology.h>
 #endif /* !CONFIG_NUMA */
+# include <asm-generic/topology.h>
 
 #endif /* _ASM_ALPHA_TOPOLOGY_H */
index ff93df516d6df11c419bf4767c3860aa941d392a..1e5a8caca2d15bf42470d52a5dbb489a472093d3 100644 (file)
 #ifndef AT91_ECC_H
 #define AT91_ECC_H
 
-#define AT91_ECC_CR            (AT91_ECC + 0x00)       /* Control register */
+#define AT91_ECC_CR            0x00                    /* Control register */
 #define                AT91_ECC_RST            (1 << 0)                /* Reset parity */
 
-#define AT91_ECC_MR            (AT91_ECC + 0x04)       /* Mode register */
+#define AT91_ECC_MR            0x04                    /* Mode register */
 #define                AT91_ECC_PAGESIZE       (3 << 0)                /* Page Size */
 #define                        AT91_ECC_PAGESIZE_528           (0)
 #define                        AT91_ECC_PAGESIZE_1056          (1)
 #define                        AT91_ECC_PAGESIZE_2112          (2)
 #define                        AT91_ECC_PAGESIZE_4224          (3)
 
-#define AT91_ECC_SR            (AT91_ECC + 0x08)       /* Status register */
+#define AT91_ECC_SR            0x08                    /* Status register */
 #define                AT91_ECC_RECERR         (1 << 0)                /* Recoverable Error */
 #define                AT91_ECC_ECCERR         (1 << 1)                /* ECC Single Bit Error */
 #define                AT91_ECC_MULERR         (1 << 2)                /* Multiple Errors */
 
-#define AT91_ECC_PR            (AT91_ECC + 0x0c)       /* Parity register */
+#define AT91_ECC_PR            0x0c                    /* Parity register */
 #define                AT91_ECC_BITADDR        (0xf << 0)              /* Bit Error Address */
 #define                AT91_ECC_WORDADDR       (0xfff << 4)            /* Word Error Address */
 
-#define AT91_ECC_NPR           (AT91_ECC + 0x10)       /* NParity register */
+#define AT91_ECC_NPR           0x10                    /* NParity register */
 #define                AT91_ECC_NPARITY        (0xffff << 0)           /* NParity */
 
 #endif
index 52cd8e5dabc996823368b60797e4a43d6764ec1d..c2b13c2801557c83490eee49e8d524db9793b638 100644 (file)
 #define                        AT91_PMC_PRES_32                (5 << 2)
 #define                        AT91_PMC_PRES_64                (6 << 2)
 #define                AT91_PMC_MDIV           (3 <<  8)               /* Master Clock Division */
-#define                        AT91_PMC_MDIV_1                 (0 << 8)
-#define                        AT91_PMC_MDIV_2                 (1 << 8)
-#define                        AT91_PMC_MDIV_3                 (2 << 8)
-#define                        AT91_PMC_MDIV_4                 (3 << 8)
+#define                        AT91RM9200_PMC_MDIV_1           (0 << 8)        /* [AT91RM9200 only] */
+#define                        AT91RM9200_PMC_MDIV_2           (1 << 8)
+#define                        AT91RM9200_PMC_MDIV_3           (2 << 8)
+#define                        AT91RM9200_PMC_MDIV_4           (3 << 8)
+#define                        AT91SAM9_PMC_MDIV_1             (0 << 8)        /* [SAM9,CAP9 only] */
+#define                        AT91SAM9_PMC_MDIV_2             (1 << 8)
+#define                        AT91SAM9_PMC_MDIV_4             (2 << 8)
+#define                        AT91SAM9_PMC_MDIV_6             (3 << 8)
+#define                AT91_PMC_PDIV           (1 << 12)               /* Processor Clock Division [some SAM9 only] */
+#define                        AT91_PMC_PDIV_1                 (0 << 12)
+#define                        AT91_PMC_PDIV_2                 (1 << 12)
 
 #define        AT91_PMC_PCKR(n)        (AT91_PMC + 0x40 + ((n) * 4))   /* Programmable Clock 0-3 Registers */
 
index 01b433de22726baabddcfa1ff461a9718cacf60a..581fa41d90e8ac4111764885e20228a312bb5aec 100644 (file)
 #define                        AT91_SHDW_WKMODE0_LOW           2
 #define                        AT91_SHDW_WKMODE0_ANYLEVEL      3
 #define                AT91_SHDW_CPTWK0        (0xf << 4)              /* Counter On Wake Up 0 */
+#define                        AT91_SHDW_CPTWK0_(x)    ((x) << 4)
 #define                AT91_SHDW_RTTWKEN       (1   << 16)             /* Real Time Timer Wake-up Enable */
 
 #define AT91_SHDW_SR           (AT91_SHDWC + 0x08)     /* Shut Down Status Register */
 #define                AT91_SHDW_WAKEUP0       (1 <<  0)               /* Wake-up 0 Status */
 #define                AT91_SHDW_RTTWK         (1 << 16)               /* Real-time Timer Wake-up */
+#define                AT91_SHDW_RTCWK         (1 << 17)               /* Real-time Clock Wake-up [SAM9RL] */
 
 #endif
diff --git a/include/asm-arm/arch-at91/at91cap9_ddrsdr.h b/include/asm-arm/arch-at91/at91cap9_ddrsdr.h
new file mode 100644 (file)
index 0000000..efdb23a
--- /dev/null
@@ -0,0 +1,100 @@
+/*
+ * include/asm-arm/arch-at91/at91cap9_ddrsdr.h
+ *
+ * DDR/SDR Controller (DDRSDRC) - System peripherals registers.
+ * Based on AT91CAP9 datasheet revision B.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ */
+
+#ifndef AT91CAP9_DDRSDR_H
+#define AT91CAP9_DDRSDR_H
+
+#define AT91_DDRSDRC_MR                (AT91_DDRSDRC + 0x00)   /* Mode Register */
+#define                AT91_DDRSDRC_MODE       (0xf << 0)              /* Command Mode */
+#define                        AT91_DDRSDRC_MODE_NORMAL                0
+#define                        AT91_DDRSDRC_MODE_NOP           1
+#define                        AT91_DDRSDRC_MODE_PRECHARGE     2
+#define                        AT91_DDRSDRC_MODE_LMR           3
+#define                        AT91_DDRSDRC_MODE_REFRESH       4
+#define                        AT91_DDRSDRC_MODE_EXT_LMR       5
+#define                        AT91_DDRSDRC_MODE_DEEP          6
+
+#define AT91_DDRSDRC_RTR       (AT91_DDRSDRC + 0x04)   /* Refresh Timer Register */
+#define                AT91_DDRSDRC_COUNT      (0xfff << 0)            /* Refresh Timer Counter */
+
+#define AT91_DDRSDRC_CR                (AT91_DDRSDRC + 0x08)   /* Configuration Register */
+#define                AT91_DDRSDRC_NC         (3 << 0)                /* Number of Column Bits */
+#define                        AT91_DDRSDRC_NC_SDR8    (0 << 0)
+#define                        AT91_DDRSDRC_NC_SDR9    (1 << 0)
+#define                        AT91_DDRSDRC_NC_SDR10   (2 << 0)
+#define                        AT91_DDRSDRC_NC_SDR11   (3 << 0)
+#define                        AT91_DDRSDRC_NC_DDR9    (0 << 0)
+#define                        AT91_DDRSDRC_NC_DDR10   (1 << 0)
+#define                        AT91_DDRSDRC_NC_DDR11   (2 << 0)
+#define                        AT91_DDRSDRC_NC_DDR12   (3 << 0)
+#define                AT91_DDRSDRC_NR         (3 << 2)                /* Number of Row Bits */
+#define                        AT91_DDRSDRC_NR_11      (0 << 2)
+#define                        AT91_DDRSDRC_NR_12      (1 << 2)
+#define                        AT91_DDRSDRC_NR_13      (2 << 2)
+#define                AT91_DDRSDRC_CAS        (7 << 4)                /* CAS Latency */
+#define                        AT91_DDRSDRC_CAS_2      (2 << 4)
+#define                        AT91_DDRSDRC_CAS_3      (3 << 4)
+#define                        AT91_DDRSDRC_CAS_25     (6 << 4)
+#define                AT91_DDRSDRC_DLL        (1 << 7)                /* Reset DLL */
+#define                AT91_DDRSDRC_DICDS      (1 << 8)                /* Output impedance control */
+
+#define AT91_DDRSDRC_T0PR      (AT91_DDRSDRC + 0x0C)   /* Timing 0 Register */
+#define                AT91_DDRSDRC_TRAS       (0xf <<  0)             /* Active to Precharge delay */
+#define                AT91_DDRSDRC_TRCD       (0xf <<  4)             /* Row to Column delay */
+#define                AT91_DDRSDRC_TWR        (0xf <<  8)             /* Write recovery delay */
+#define                AT91_DDRSDRC_TRC        (0xf << 12)             /* Row cycle delay */
+#define                AT91_DDRSDRC_TRP        (0xf << 16)             /* Row precharge delay */
+#define                AT91_DDRSDRC_TRRD       (0xf << 20)             /* Active BankA to BankB */
+#define                AT91_DDRSDRC_TWTR       (1   << 24)             /* Internal Write to Read delay */
+#define                AT91_DDRSDRC_TMRD       (0xf << 28)             /* Load mode to active/refresh delay */
+
+#define AT91_DDRSDRC_T1PR      (AT91_DDRSDRC + 0x10)   /* Timing 1 Register */
+#define                AT91_DDRSDRC_TRFC       (0x1f << 0)             /* Row Cycle Delay */
+#define                AT91_DDRSDRC_TXSNR      (0xff << 8)             /* Exit self-refresh to non-read */
+#define                AT91_DDRSDRC_TXSRD      (0xff << 16)            /* Exit self-refresh to read */
+#define                AT91_DDRSDRC_TXP        (0xf  << 24)            /* Exit power-down delay */
+
+#define AT91_DDRSDRC_LPR       (AT91_DDRSDRC + 0x18)   /* Low Power Register */
+#define                AT91_DDRSDRC_LPCB               (3 << 0)        /* Low-power Configurations */
+#define                        AT91_DDRSDRC_LPCB_DISABLE               0
+#define                        AT91_DDRSDRC_LPCB_SELF_REFRESH          1
+#define                        AT91_DDRSDRC_LPCB_POWER_DOWN            2
+#define                        AT91_DDRSDRC_LPCB_DEEP_POWER_DOWN       3
+#define                AT91_DDRSDRC_CLKFR              (1 << 2)        /* Clock Frozen */
+#define                AT91_DDRSDRC_PASR               (7 << 4)        /* Partial Array Self Refresh */
+#define                AT91_DDRSDRC_TCSR               (3 << 8)        /* Temperature Compensated Self Refresh */
+#define                AT91_DDRSDRC_DS                 (3 << 10)       /* Drive Strength */
+#define                AT91_DDRSDRC_TIMEOUT            (3 << 12)       /* Time to define when Low Power Mode is enabled */
+#define                        AT91_DDRSDRC_TIMEOUT_0_CLK_CYCLES       (0 << 12)
+#define                        AT91_DDRSDRC_TIMEOUT_64_CLK_CYCLES      (1 << 12)
+#define                        AT91_DDRSDRC_TIMEOUT_128_CLK_CYCLES     (2 << 12)
+
+#define AT91_DDRSDRC_MDR       (AT91_DDRSDRC + 0x1C)   /* Memory Device Register */
+#define                AT91_DDRSDRC_MD         (3 << 0)                /* Memory Device Type */
+#define                        AT91_DDRSDRC_MD_SDR             0
+#define                        AT91_DDRSDRC_MD_LOW_POWER_SDR   1
+#define                        AT91_DDRSDRC_MD_DDR             2
+#define                        AT91_DDRSDRC_MD_LOW_POWER_DDR   3
+
+#define AT91_DDRSDRC_DLLR      (AT91_DDRSDRC + 0x20)   /* DLL Information Register */
+#define                AT91_DDRSDRC_MDINC      (1 << 0)                /* Master Delay increment */
+#define                AT91_DDRSDRC_MDDEC      (1 << 1)                /* Master Delay decrement */
+#define                AT91_DDRSDRC_MDOVF      (1 << 2)                /* Master Delay Overflow */
+#define                AT91_DDRSDRC_SDCOVF     (1 << 3)                /* Slave Delay Correction Overflow */
+#define                AT91_DDRSDRC_SDCUDF     (1 << 4)                /* Slave Delay Correction Underflow */
+#define                AT91_DDRSDRC_SDERF      (1 << 5)                /* Slave Delay Correction error */
+#define                AT91_DDRSDRC_MDVAL      (0xff <<  8)            /* Master Delay value */
+#define                AT91_DDRSDRC_SDVAL      (0xff << 16)            /* Slave Delay value */
+#define                AT91_DDRSDRC_SDCVAL     (0xff << 24)            /* Slave Delay Correction value */
+
+
+#endif
similarity index 52%
rename from include/asm-arm/arch-at91/at91sam926x_mc.h
rename to include/asm-arm/arch-at91/at91sam9_sdramc.h
index d82631c251f1b14af7eb2638be5b3652aec12188..d3b8b3da6b4d783030990eb2fede7ab892e89d36 100644 (file)
@@ -1,7 +1,7 @@
 /*
- * include/asm-arm/arch-at91/at91sam926x_mc.h
+ * include/asm-arm/arch-at91/at91sam9_sdramc.h
  *
- * Memory Controllers (SMC, SDRAMC) - System peripherals registers.
+ * SDRAM Controllers (SDRAMC) - System peripherals registers.
  * Based on AT91SAM9261 datasheet revision D.
  *
  * This program is free software; you can redistribute it and/or modify
@@ -10,8 +10,8 @@
  * (at your option) any later version.
  */
 
-#ifndef AT91SAM926x_MC_H
-#define AT91SAM926x_MC_H
+#ifndef AT91SAM9_SDRAMC_H
+#define AT91SAM9_SDRAMC_H
 
 /* SDRAM Controller (SDRAMC) registers */
 #define AT91_SDRAMC_MR         (AT91_SDRAMC + 0x00)    /* SDRAM Controller Mode Register */
@@ -62,7 +62,7 @@
 #define                        AT91_SDRAMC_LPCB_DEEP_POWER_DOWN        3
 #define                AT91_SDRAMC_PASR                (7 << 4)        /* Partial Array Self Refresh */
 #define                AT91_SDRAMC_TCSR                (3 << 8)        /* Temperature Compensated Self Refresh */
-#define                AT91_SDRAMC_DS                  (3 << 10)       /* Drive Strenght */
+#define                AT91_SDRAMC_DS                  (3 << 10)       /* Drive Strength */
 #define                AT91_SDRAMC_TIMEOUT             (3 << 12)       /* Time to define when Low Power Mode is enabled */
 #define                        AT91_SDRAMC_TIMEOUT_0_CLK_CYCLES        (0 << 12)
 #define                        AT91_SDRAMC_TIMEOUT_64_CLK_CYCLES       (1 << 12)
 #define                        AT91_SDRAMC_MD_LOW_POWER_SDRAM  1
 
 
-/* Static Memory Controller (SMC) registers */
-#define AT91_SMC_SETUP(n)      (AT91_SMC + 0x00 + ((n)*0x10))  /* Setup Register for CS n */
-#define                AT91_SMC_NWESETUP       (0x3f << 0)                     /* NWE Setup Length */
-#define                        AT91_SMC_NWESETUP_(x)   ((x) << 0)
-#define                AT91_SMC_NCS_WRSETUP    (0x3f << 8)                     /* NCS Setup Length in Write Access */
-#define                        AT91_SMC_NCS_WRSETUP_(x)        ((x) << 8)
-#define                AT91_SMC_NRDSETUP       (0x3f << 16)                    /* NRD Setup Length */
-#define                        AT91_SMC_NRDSETUP_(x)   ((x) << 16)
-#define                AT91_SMC_NCS_RDSETUP    (0x3f << 24)                    /* NCS Setup Length in Read Access */
-#define                        AT91_SMC_NCS_RDSETUP_(x)        ((x) << 24)
-
-#define AT91_SMC_PULSE(n)      (AT91_SMC + 0x04 + ((n)*0x10))  /* Pulse Register for CS n */
-#define                AT91_SMC_NWEPULSE       (0x7f <<  0)                    /* NWE Pulse Length */
-#define                        AT91_SMC_NWEPULSE_(x)   ((x) << 0)
-#define                AT91_SMC_NCS_WRPULSE    (0x7f <<  8)                    /* NCS Pulse Length in Write Access */
-#define                        AT91_SMC_NCS_WRPULSE_(x)((x) << 8)
-#define                AT91_SMC_NRDPULSE       (0x7f << 16)                    /* NRD Pulse Length */
-#define                        AT91_SMC_NRDPULSE_(x)   ((x) << 16)
-#define                AT91_SMC_NCS_RDPULSE    (0x7f << 24)                    /* NCS Pulse Length in Read Access */
-#define                        AT91_SMC_NCS_RDPULSE_(x)((x) << 24)
-
-#define AT91_SMC_CYCLE(n)      (AT91_SMC + 0x08 + ((n)*0x10))  /* Cycle Register for CS n */
-#define                AT91_SMC_NWECYCLE       (0x1ff << 0 )                   /* Total Write Cycle Length */
-#define                        AT91_SMC_NWECYCLE_(x)   ((x) << 0)
-#define                AT91_SMC_NRDCYCLE       (0x1ff << 16)                   /* Total Read Cycle Length */
-#define                        AT91_SMC_NRDCYCLE_(x)   ((x) << 16)
-
-#define AT91_SMC_MODE(n)       (AT91_SMC + 0x0c + ((n)*0x10))  /* Mode Register for CS n */
-#define                AT91_SMC_READMODE       (1 <<  0)                       /* Read Mode */
-#define                AT91_SMC_WRITEMODE      (1 <<  1)                       /* Write Mode */
-#define                AT91_SMC_EXNWMODE       (3 <<  4)                       /* NWAIT Mode */
-#define                        AT91_SMC_EXNWMODE_DISABLE       (0 << 4)
-#define                        AT91_SMC_EXNWMODE_FROZEN        (2 << 4)
-#define                        AT91_SMC_EXNWMODE_READY         (3 << 4)
-#define                AT91_SMC_BAT            (1 <<  8)                       /* Byte Access Type */
-#define                        AT91_SMC_BAT_SELECT             (0 << 8)
-#define                        AT91_SMC_BAT_WRITE              (1 << 8)
-#define                AT91_SMC_DBW            (3 << 12)                       /* Data Bus Width */
-#define                        AT91_SMC_DBW_8                  (0 << 12)
-#define                        AT91_SMC_DBW_16                 (1 << 12)
-#define                        AT91_SMC_DBW_32                 (2 << 12)
-#define                AT91_SMC_TDF            (0xf << 16)                     /* Data Float Time. */
-#define                        AT91_SMC_TDF_(x)                ((x) << 16)
-#define                AT91_SMC_TDFMODE        (1 << 20)                       /* TDF Optimization - Enabled */
-#define                AT91_SMC_PMEN           (1 << 24)                       /* Page Mode Enabled */
-#define                AT91_SMC_PS             (3 << 28)                       /* Page Size */
-#define                        AT91_SMC_PS_4                   (0 << 28)
-#define                        AT91_SMC_PS_8                   (1 << 28)
-#define                        AT91_SMC_PS_16                  (2 << 28)
-#define                        AT91_SMC_PS_32                  (3 << 28)
-
-#if defined(AT91_SMC1)         /* The AT91SAM9263 has 2 Static Memory contollers */
-#define AT91_SMC1_SETUP(n)     (AT91_SMC1 + 0x00 + ((n)*0x10)) /* Setup Register for CS n */
-#define AT91_SMC1_PULSE(n)     (AT91_SMC1 + 0x04 + ((n)*0x10)) /* Pulse Register for CS n */
-#define AT91_SMC1_CYCLE(n)     (AT91_SMC1 + 0x08 + ((n)*0x10)) /* Cycle Register for CS n */
-#define AT91_SMC1_MODE(n)      (AT91_SMC1 + 0x0c + ((n)*0x10)) /* Mode Register for CS n */
-#endif
-
 #endif
diff --git a/include/asm-arm/arch-at91/at91sam9_smc.h b/include/asm-arm/arch-at91/at91sam9_smc.h
new file mode 100644 (file)
index 0000000..9e49eed
--- /dev/null
@@ -0,0 +1,73 @@
+/*
+ * include/asm-arm/arch-at91/at91sam9_smc.h
+ *
+ * Static Memory Controllers (SMC) - System peripherals registers.
+ * Based on AT91SAM9261 datasheet revision D.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ */
+
+#ifndef AT91SAM9_SMC_H
+#define AT91SAM9_SMC_H
+
+#define AT91_SMC_SETUP(n)      (AT91_SMC + 0x00 + ((n)*0x10))  /* Setup Register for CS n */
+#define                AT91_SMC_NWESETUP       (0x3f << 0)                     /* NWE Setup Length */
+#define                        AT91_SMC_NWESETUP_(x)   ((x) << 0)
+#define                AT91_SMC_NCS_WRSETUP    (0x3f << 8)                     /* NCS Setup Length in Write Access */
+#define                        AT91_SMC_NCS_WRSETUP_(x)        ((x) << 8)
+#define                AT91_SMC_NRDSETUP       (0x3f << 16)                    /* NRD Setup Length */
+#define                        AT91_SMC_NRDSETUP_(x)   ((x) << 16)
+#define                AT91_SMC_NCS_RDSETUP    (0x3f << 24)                    /* NCS Setup Length in Read Access */
+#define                        AT91_SMC_NCS_RDSETUP_(x)        ((x) << 24)
+
+#define AT91_SMC_PULSE(n)      (AT91_SMC + 0x04 + ((n)*0x10))  /* Pulse Register for CS n */
+#define                AT91_SMC_NWEPULSE       (0x7f <<  0)                    /* NWE Pulse Length */
+#define                        AT91_SMC_NWEPULSE_(x)   ((x) << 0)
+#define                AT91_SMC_NCS_WRPULSE    (0x7f <<  8)                    /* NCS Pulse Length in Write Access */
+#define                        AT91_SMC_NCS_WRPULSE_(x)((x) << 8)
+#define                AT91_SMC_NRDPULSE       (0x7f << 16)                    /* NRD Pulse Length */
+#define                        AT91_SMC_NRDPULSE_(x)   ((x) << 16)
+#define                AT91_SMC_NCS_RDPULSE    (0x7f << 24)                    /* NCS Pulse Length in Read Access */
+#define                        AT91_SMC_NCS_RDPULSE_(x)((x) << 24)
+
+#define AT91_SMC_CYCLE(n)      (AT91_SMC + 0x08 + ((n)*0x10))  /* Cycle Register for CS n */
+#define                AT91_SMC_NWECYCLE       (0x1ff << 0 )                   /* Total Write Cycle Length */
+#define                        AT91_SMC_NWECYCLE_(x)   ((x) << 0)
+#define                AT91_SMC_NRDCYCLE       (0x1ff << 16)                   /* Total Read Cycle Length */
+#define                        AT91_SMC_NRDCYCLE_(x)   ((x) << 16)
+
+#define AT91_SMC_MODE(n)       (AT91_SMC + 0x0c + ((n)*0x10))  /* Mode Register for CS n */
+#define                AT91_SMC_READMODE       (1 <<  0)                       /* Read Mode */
+#define                AT91_SMC_WRITEMODE      (1 <<  1)                       /* Write Mode */
+#define                AT91_SMC_EXNWMODE       (3 <<  4)                       /* NWAIT Mode */
+#define                        AT91_SMC_EXNWMODE_DISABLE       (0 << 4)
+#define                        AT91_SMC_EXNWMODE_FROZEN        (2 << 4)
+#define                        AT91_SMC_EXNWMODE_READY         (3 << 4)
+#define                AT91_SMC_BAT            (1 <<  8)                       /* Byte Access Type */
+#define                        AT91_SMC_BAT_SELECT             (0 << 8)
+#define                        AT91_SMC_BAT_WRITE              (1 << 8)
+#define                AT91_SMC_DBW            (3 << 12)                       /* Data Bus Width */
+#define                        AT91_SMC_DBW_8                  (0 << 12)
+#define                        AT91_SMC_DBW_16                 (1 << 12)
+#define                        AT91_SMC_DBW_32                 (2 << 12)
+#define                AT91_SMC_TDF            (0xf << 16)                     /* Data Float Time. */
+#define                        AT91_SMC_TDF_(x)                ((x) << 16)
+#define                AT91_SMC_TDFMODE        (1 << 20)                       /* TDF Optimization - Enabled */
+#define                AT91_SMC_PMEN           (1 << 24)                       /* Page Mode Enabled */
+#define                AT91_SMC_PS             (3 << 28)                       /* Page Size */
+#define                        AT91_SMC_PS_4                   (0 << 28)
+#define                        AT91_SMC_PS_8                   (1 << 28)
+#define                        AT91_SMC_PS_16                  (2 << 28)
+#define                        AT91_SMC_PS_32                  (3 << 28)
+
+#if defined(AT91_SMC1)         /* The AT91SAM9263 has 2 Static Memory contollers */
+#define AT91_SMC1_SETUP(n)     (AT91_SMC1 + 0x00 + ((n)*0x10)) /* Setup Register for CS n */
+#define AT91_SMC1_PULSE(n)     (AT91_SMC1 + 0x04 + ((n)*0x10)) /* Pulse Register for CS n */
+#define AT91_SMC1_CYCLE(n)     (AT91_SMC1 + 0x08 + ((n)*0x10)) /* Cycle Register for CS n */
+#define AT91_SMC1_MODE(n)      (AT91_SMC1 + 0x0c + ((n)*0x10)) /* Mode Register for CS n */
+#endif
+
+#endif
index 9b1864bbd9a87bf12a1d7bed1d703f35b1e81442..186e7c715f8afdb734e1b16a9ed9848a619fdbb4 100644 (file)
 
 /* new generic GPIO API - see Documentation/gpio.txt */
 
-static inline int gpio_request(unsigned gpio, const char *label)
-{
-       if (gpio > EP93XX_GPIO_LINE_MAX)
-               return -EINVAL;
-       return 0;
-}
+#include <asm-generic/gpio.h>
 
-static inline void gpio_free(unsigned gpio)
-{
-}
-
-int gpio_direction_input(unsigned gpio);
-int gpio_direction_output(unsigned gpio, int value);
-int gpio_get_value(unsigned gpio);
-void gpio_set_value(unsigned gpio, int value);
-
-#include <asm-generic/gpio.h> /* cansleep wrappers */
+#define gpio_get_value __gpio_get_value
+#define gpio_set_value __gpio_set_value
+#define gpio_cansleep  __gpio_cansleep
 
 /*
  * Map GPIO A0..A7  (0..7)  to irq 64..71,
  *          B0..B7  (7..15) to irq 72..79, and
  *          F0..F7 (16..24) to irq 80..87.
  */
-
 static inline int gpio_to_irq(unsigned gpio)
 {
        if (gpio <= EP93XX_GPIO_LINE_MAX_IRQ)
index b0364dce463fd82f3ef1055e392e51a4da029d50..7ad2c656e162bf436fc729242ee6b8915122a8a0 100644 (file)
@@ -18,6 +18,11 @@ extern void __init ks8695_add_device_wan(void);
 extern void __init ks8695_add_device_lan(void);
 extern void __init ks8695_add_device_hpna(void);
 
+ /* LEDs */
+extern short ks8695_leds_cpu;
+extern short ks8695_leds_timer;
+extern void __init ks8695_init_leds(u8 cpu_led, u8 timer_led);
+
  /* PCI */
 #define KS8695_MODE_PCI                0
 #define KS8695_MODE_MINIPCI    1
index be29b83ad4ae1c281a6052c66d75434ea87384e3..8590127760a85df6b236763758fb2bfc8070ad69 100644 (file)
 #ifndef __ASM_ARCH_MXC_BOARD_MX31ADS_H__
 #define __ASM_ARCH_MXC_BOARD_MX31ADS_H__
 
-/*!
- * @name PBC Controller parameters
- */
-/*! @{ */
-/*!
- * Base address of PBC controller
- */
+/* Base address of PBC controller */
 #define PBC_BASE_ADDRESS        IO_ADDRESS(CS4_BASE_ADDR)
 /* Offsets for the PBC Controller register */
-/*!
- * PBC Board status register offset
- */
+
+/* PBC Board status register offset */
 #define PBC_BSTAT               0x000002
-/*!
- * PBC Board control register 1 set address.
- */
+
+/* PBC Board control register 1 set address */
 #define PBC_BCTRL1_SET          0x000004
-/*!
- * PBC Board control register 1 clear address.
- */
+
+/* PBC Board control register 1 clear address */
 #define PBC_BCTRL1_CLEAR        0x000006
-/*!
- * PBC Board control register 2 set address.
- */
+
+/* PBC Board control register 2 set address */
 #define PBC_BCTRL2_SET          0x000008
-/*!
- * PBC Board control register 2 clear address.
- */
+
+/* PBC Board control register 2 clear address */
 #define PBC_BCTRL2_CLEAR        0x00000A
-/*!
- * PBC Board control register 3 set address.
- */
+
+/* PBC Board control register 3 set address */
 #define PBC_BCTRL3_SET          0x00000C
-/*!
- * PBC Board control register 3 clear address.
- */
+
+/* PBC Board control register 3 clear address */
 #define PBC_BCTRL3_CLEAR        0x00000E
-/*!
- * PBC Board control register 4 set address.
- */
+
+/* PBC Board control register 4 set address */
 #define PBC_BCTRL4_SET          0x000010
-/*!
- * PBC Board control register 4 clear address.
- */
+
+/* PBC Board control register 4 clear address */
 #define PBC_BCTRL4_CLEAR        0x000012
-/*!
- * PBC Board status register 1.
- */
+
+/* PBC Board status register 1 */
 #define PBC_BSTAT1              0x000014
-/*!
- * PBC Board interrupt status register.
- */
+
+/* PBC Board interrupt status register */
 #define PBC_INTSTATUS           0x000016
-/*!
- * PBC Board interrupt current status register.
- */
+
+/* PBC Board interrupt current status register */
 #define PBC_INTCURR_STATUS      0x000018
-/*!
- * PBC Interrupt mask register set address.
- */
+
+/* PBC Interrupt mask register set address */
 #define PBC_INTMASK_SET         0x00001A
-/*!
- * PBC Interrupt mask register clear address.
- */
+
+/* PBC Interrupt mask register clear address */
 #define PBC_INTMASK_CLEAR       0x00001C
 
-/*!
- * External UART A.
- */
+/* External UART A */
 #define PBC_SC16C652_UARTA      0x010000
-/*!
- * External UART B.
- */
+
+/* External UART B */
 #define PBC_SC16C652_UARTB      0x010010
-/*!
- * Ethernet Controller IO base address.
- */
+
+/* Ethernet Controller IO base address */
 #define PBC_CS8900A_IOBASE      0x020000
-/*!
- * Ethernet Controller Memory base address.
- */
+
+/* Ethernet Controller Memory base address */
 #define PBC_CS8900A_MEMBASE     0x021000
-/*!
- * Ethernet Controller DMA base address.
- */
+
+/* Ethernet Controller DMA base address */
 #define PBC_CS8900A_DMABASE     0x022000
-/*!
- * External chip select 0.
- */
+
+/* External chip select 0 */
 #define PBC_XCS0                0x040000
-/*!
- * LCD Display enable.
- */
+
+/* LCD Display enable */
 #define PBC_LCD_EN_B            0x060000
-/*!
- * Code test debug enable.
- */
+
+/* Code test debug enable */
 #define PBC_CODE_B              0x070000
-/*!
- * PSRAM memory select.
- */
+
+/* PSRAM memory select */
 #define PBC_PSRAM_B             0x5000000
 
 #define PBC_INTSTATUS_REG      (PBC_INTSTATUS + PBC_BASE_ADDRESS)
 
 #define MXC_MAX_EXP_IO_LINES   16
 
-#endif                         /* __ASM_ARCH_MXC_BOARD_MX31ADS_H__ */
+#endif /* __ASM_ARCH_MXC_BOARD_MX31ADS_H__ */
index 65e639d51d2b97d414db43c43099d2459c08b330..c822d569a05ea757f9a06686e346787bf5c7abdc 100644 (file)
 #ifndef __ASM_ARCH_MXC_DMA_H__
 #define __ASM_ARCH_MXC_DMA_H__
 
-/*!
- * @file dma.h
- * @brief This file contains Unified DMA API for all MXC platforms.
- * The API is platform independent.
- *
- * @ingroup SDMA
- */
 #endif
index 3c09b92fef0dbb84033077011108beaf7d25eb5a..e87ff0679d5ecaccd77cad9de7d8ee1433ff860e 100644 (file)
@@ -8,45 +8,24 @@
  * published by the Free Software Foundation.
  */
 
-/*!
- * @file hardware.h
- * @brief This file contains the hardware definitions of the board.
- *
- * @ingroup System
- */
 #ifndef __ASM_ARCH_MXC_HARDWARE_H__
 #define __ASM_ARCH_MXC_HARDWARE_H__
 
 #include <asm/sizes.h>
 
-#include <asm/arch/mx31.h>
+#ifdef CONFIG_ARCH_MX3
+# include <asm/arch/mx31.h>
+#endif
 
 #include <asm/arch/mxc.h>
 
-#define MXC_MAX_GPIO_LINES      (GPIO_NUM_PIN * GPIO_PORT_NUM)
-
 /*
  * ---------------------------------------------------------------------------
  * Board specific defines
  * ---------------------------------------------------------------------------
  */
-#define MXC_EXP_IO_BASE         (MXC_GPIO_INT_BASE + MXC_MAX_GPIO_LINES)
-
-#include <asm/arch/board-mx31ads.h>
-
-#ifndef MXC_MAX_EXP_IO_LINES
-#define MXC_MAX_EXP_IO_LINES 0
+#ifdef CONFIG_MACH_MX31ADS
+# include <asm/arch/board-mx31ads.h>
 #endif
 
-#define MXC_MAX_VIRTUAL_INTS   16
-#define MXC_VIRTUAL_INTS_BASE  (MXC_EXP_IO_BASE + MXC_MAX_EXP_IO_LINES)
-#define MXC_SDIO1_CARD_IRQ     MXC_VIRTUAL_INTS_BASE
-#define MXC_SDIO2_CARD_IRQ     (MXC_VIRTUAL_INTS_BASE + 1)
-#define MXC_SDIO3_CARD_IRQ     (MXC_VIRTUAL_INTS_BASE + 2)
-
-#define MXC_MAX_INTS            (MXC_MAX_INT_LINES + \
-                                MXC_MAX_GPIO_LINES + \
-                                MXC_MAX_EXP_IO_LINES + \
-                                MXC_MAX_VIRTUAL_INTS)
-
-#endif                         /* __ASM_ARCH_MXC_HARDWARE_H__ */
+#endif /* __ASM_ARCH_MXC_HARDWARE_H__ */
index cf6c83a4b9f7fc7fb98e05a1aa299c5992140ad4..65b6810124c1604adb43d0adb3ba3803de6e9951 100644 (file)
@@ -8,24 +8,13 @@
  * published by the Free Software Foundation.
  */
 
-/*!
- * @file io.h
- * @brief This file contains some memory mapping macros.
- * @note There is no real ISA or PCI buses. But have to define these macros
- * for some drivers to compile.
- *
- * @ingroup System
- */
-
 #ifndef __ASM_ARCH_MXC_IO_H__
 #define __ASM_ARCH_MXC_IO_H__
 
-/*! Allow IO space to be anywhere in the memory */
+/* Allow IO space to be anywhere in the memory */
 #define IO_SPACE_LIMIT 0xffffffff
 
-/*!
- * io address mapping macro
- */
+/* io address mapping macro */
 #define __io(a)                        ((void __iomem *)(a))
 
 #define __mem_pci(a)           (a)
index e4686c6bc4bf22f02d7b374b8dfbc34fc58e1807..b2c5205e196298b8806778cdd5089f9e53282078 100644 (file)
 
 #include <asm/hardware.h>
 
-/*!
- * @file irqs.h
- * @brief This file defines the number of normal interrupts and fast interrupts
- *
- * @ingroup Interrupt
- */
-
 #define MXC_IRQ_TO_EXPIO(irq)  ((irq) - MXC_EXP_IO_BASE)
 
 #define MXC_IRQ_TO_GPIO(irq)   ((irq) - MXC_GPIO_INT_BASE)
 #define MXC_GPIO_TO_IRQ(x)     (MXC_GPIO_INT_BASE + x)
 
-/*!
- * Number of normal interrupts
- */
-#define NR_IRQS                MXC_MAX_INTS
+/* Number of normal interrupts */
+#define NR_IRQS                (MXC_MAX_INT_LINES + \
+                       MXC_MAX_GPIO_LINES + \
+                       MXC_MAX_VIRTUAL_INTS)
 
-/*!
- * Number of fast interrupts
- */
+/* Number of fast interrupts */
 #define NR_FIQS                MXC_MAX_INTS
 
-#endif                         /* __ASM_ARCH_MXC_IRQS_H__ */
+#endif /* __ASM_ARCH_MXC_IRQS_H__ */
index c89aac83a40712c2420bf04a252c899a470f9664..059f83023a102136a22917c3c39c69761d214f1d 100644 (file)
 
 #include <asm/hardware.h>
 
-/*!
- * @file memory.h
- * @brief This file contains macros needed by the Linux kernel and drivers.
- *
- * @ingroup Memory
- */
-
-/*!
+/*
  * Virtual view <-> DMA view memory address translations
  * This macro is used to translate the virtual address to an address
  * suitable to be passed to set_dma_addr()
  */
 #define __virt_to_bus(a)       __virt_to_phys(a)
 
-/*!
+/*
  * Used to convert an address for DMA operations to an address that the
  * kernel can use.
  */
 #define __bus_to_virt(a)       __phys_to_virt(a)
 
-#endif                         /* __ASM_ARCH_MXC_MEMORY_H__ */
+#endif /* __ASM_ARCH_MXC_MEMORY_H__ */
index 85c49c9e5d158b39f3dc37de0a1f0f2f3851727c..36a1af495bb3eb74f4a02385df32600a7e755538 100644 (file)
 #define MXC_MAX_INT_LINES      64
 
 #define MXC_GPIO_INT_BASE      MXC_MAX_INT_LINES
+#define MXC_MAX_GPIO_LINES      (GPIO_NUM_PIN * GPIO_PORT_NUM)
+#define MXC_MAX_VIRTUAL_INTS   16
 
 /*!
  * Number of GPIO port as defined in the IC Spec
 
 #define PROD_SIGNATURE         0x1     /* For MX31 */
 
+/* silicon revisions specific to i.MX31 */
+#define CHIP_REV_1_0           0x10
+#define CHIP_REV_1_1           0x11
+#define CHIP_REV_1_2           0x12
+#define CHIP_REV_1_3           0x13
+#define CHIP_REV_2_0           0x20
+#define CHIP_REV_2_1           0x21
+#define CHIP_REV_2_2           0x22
+#define CHIP_REV_2_3           0x23
+#define CHIP_REV_3_0           0x30
+#define CHIP_REV_3_1           0x31
+#define CHIP_REV_3_2           0x32
+
 #define SYSTEM_REV_MIN         CHIP_REV_1_0
 #define SYSTEM_REV_NUM         3
 
-#endif                 /*  __ASM_ARCH_MXC_MX31_H__ */
+#if !defined(__ASSEMBLY__) && !defined(__MXC_BOOT_UNCOMPRESS)
+
+/* this is a i.MX31 CPU */
+#define cpu_is_mx31()          (1)
+
+extern unsigned int system_rev;
+
+static inline int mx31_revision(void)
+{
+       return system_rev;
+}
+#endif
+
+#endif /*  __ASM_ARCH_MXC_MX31_H__ */
index 0837f1f9ca31d430c334f29d3f800fb7c46e1d0b..146d3f60951a5e6340d8139a3f2e29b74a229ce7 100644 (file)
 #error "Do not include directly."
 #endif
 
+/* clean up all things that are not used */
+#ifndef CONFIG_ARCH_MX3
+# define cpu_is_mx31() (0)
+#endif
+
 /*
  *****************************************
  * GPT  Register definitions             *
@@ -31,9 +36,7 @@
 #define MXC_GPT_GPTICR2                IO_ADDRESS(GPT1_BASE_ADDR + 0x20)
 #define MXC_GPT_GPTCNT         IO_ADDRESS(GPT1_BASE_ADDR + 0x24)
 
-/*!
- * GPT Control register bit definitions
- */
+/* GPT Control register bit definitions */
 #define GPTCR_FO3                      (1 << 31)
 #define GPTCR_FO2                      (1 << 30)
 #define GPTCR_FO1                      (1 << 29)
 #define IIM_PROD_REV_SH                3
 #define IIM_PROD_REV_LEN       5
 
-#endif                         /*  __ASM_ARCH_MXC_H__ */
+#endif /*  __ASM_ARCH_MXC_H__ */
index 109956b41acad697ff84ddbd4c5f4bb7df2f9dfa..bbfc37465fc597943ec1944ddd416157713526d1 100644 (file)
 #ifndef __ASM_ARCH_MXC_SYSTEM_H__
 #define __ASM_ARCH_MXC_SYSTEM_H__
 
-/*!
- * @file system.h
- * @brief This file contains idle and reset functions.
- *
- * @ingroup System
- */
-
-/*!
- * This function puts the CPU into idle mode. It is called by default_idle()
- * in process.c file.
- */
 static inline void arch_idle(void)
 {
        cpu_do_idle();
 }
 
-/*
- * This function resets the system. It is called by machine_restart().
- *
- * @param  mode         indicates different kinds of resets
- */
 static inline void arch_reset(char mode)
 {
        cpu_reset(0);
 }
 
-#endif                         /* __ASM_ARCH_MXC_SYSTEM_H__ */
+#endif /* __ASM_ARCH_MXC_SYSTEM_H__ */
index 83a73da895eb09f180267fbff16ec5f1f2af518e..62d97623412f1061cee30d249823c5e98416f37f 100644 (file)
 #ifndef __ASM_ARCH_MXC_VMALLOC_H__
 #define __ASM_ARCH_MXC_VMALLOC_H__
 
-/*!
- * @file vmalloc.h
- *
- * @brief This file contains platform specific macros for vmalloc.
- *
- * @ingroup System
- */
-
-/*!
- * vmalloc ending address
- */
+/* vmalloc ending address */
 #define VMALLOC_END       0xF4000000
 
-#endif                         /* __ASM_ARCH_MXC_VMALLOC_H__ */
+#endif /* __ASM_ARCH_MXC_VMALLOC_H__ */
index 716f34fdb7169b78b60359ab76b9430f2a5c8726..e57443bdbbd900160bedd722231f94219a85cbff 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * include/asm-arm/arch-ns9xxx/board.h
  *
- * Copyright (C) 2006 by Digi International Inc.
+ * Copyright (C) 2006,2007 by Digi International Inc.
  * All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
 
 #include <asm/mach-types.h>
 
-#define board_is_a9m9750dev()  (machine_is_cc9p9360dev())
+#define board_is_a9m9750dev()  (0                      \
+               || machine_is_cc9p9360dev()             \
+               || machine_is_cc9p9750dev()             \
+               )
 
-#define board_is_jscc9p9360()  (machine_is_cc9p9360js())
+#define board_is_a9mvali()     (0                      \
+               || machine_is_cc9p9360val()             \
+               || machine_is_cc9p9750val()             \
+               )
+
+#define board_is_jscc9p9210()  (0                      \
+               || machine_is_cc9p9210js()              \
+               )
+
+#define board_is_jscc9p9215()  (0                      \
+               || machine_is_cc9p9215js()              \
+               )
+
+#define board_is_jscc9p9360()  (0                      \
+               || machine_is_cc9p9360js()              \
+               )
+
+#define board_is_uncbas()      (0                      \
+               || machine_is_cc7ucamry()               \
+               )
 
 #endif /* ifndef __ASM_ARCH_BOARD_H */
diff --git a/include/asm-arm/arch-ns9xxx/clock.h b/include/asm-arm/arch-ns9xxx/clock.h
deleted file mode 100644 (file)
index b943d3a..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * include/asm-arm/arch-ns9xxx/clock.h
- *
- * Copyright (C) 2007 by Digi International Inc.
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 as published by
- * the Free Software Foundation.
- */
-#ifndef __ASM_ARCH_CLOCK_H
-#define __ASM_ARCH_CLOCK_H
-
-#include <asm/arch-ns9xxx/regs-sys.h>
-
-#define CRYSTAL 29491200 /* Hz */
-
-/* The HRM calls this value f_vco */
-static inline u32 ns9xxx_systemclock(void) __attribute__((const));
-static inline u32 ns9xxx_systemclock(void)
-{
-       u32 pll = __raw_readl(SYS_PLL);
-
-       /*
-        * The system clock should be a multiple of HZ * TIMERCLOCKSELECT (in
-        * time.c).
-        *
-        * The following values are given:
-        *   - TIMERCLOCKSELECT == 2^i for an i in {0 .. 6}
-        *   - CRYSTAL == 29491200 == 2^17 * 3^2 * 5^2
-        *   - ND in {0 .. 31}
-        *   - FS in {0 .. 3}
-        *
-        * Assuming the worst, we consider:
-        *   - TIMERCLOCKSELECT == 64
-        *   - ND == 0
-        *   - FS == 3
-        *
-        * So HZ should be a divisor of:
-        *      (CRYSTAL * (ND + 1) >> FS) / TIMERCLOCKSELECT
-        *   == (2^17 * 3^2 * 5^2 * 1 >> 3) / 64
-        *   == 2^8 * 3^2 * 5^2
-        *   == 57600
-        *
-        * Currently HZ is defined to be 100 for this platform.
-        *
-        * Fine.
-        */
-       return CRYSTAL * (REGGETIM(pll, SYS_PLL, ND) + 1)
-               >> REGGETIM(pll, SYS_PLL, FS);
-}
-
-static inline u32 ns9xxx_cpuclock(void) __attribute__((const));
-static inline u32 ns9xxx_cpuclock(void)
-{
-       return ns9xxx_systemclock() / 2;
-}
-
-static inline u32 ns9xxx_ahbclock(void) __attribute__((const));
-static inline u32 ns9xxx_ahbclock(void)
-{
-       return ns9xxx_systemclock() / 4;
-}
-
-static inline u32 ns9xxx_bbusclock(void) __attribute__((const));
-static inline u32 ns9xxx_bbusclock(void)
-{
-       return ns9xxx_systemclock() / 8;
-}
-
-#endif /* ifndef __ASM_ARCH_CLOCK_H */
index 86aec87303e46c2d2b1be533348d6d745f050731..89a21c530468a4773916d92727ae4401fc501bd1 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * include/asm-arm/arch-ns9xxx/entry-macro.S
  *
- * Copyright (C) 2006 by Digi International Inc.
+ * Copyright (C) 2006,2007 by Digi International Inc.
  * All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
@@ -9,16 +9,16 @@
  * the Free Software Foundation.
  */
 #include <asm/hardware.h>
-#include <asm/arch-ns9xxx/regs-sys.h>
+#include <asm/arch-ns9xxx/regs-sys-common.h>
 
                .macro  get_irqnr_preamble, base, tmp
+               ldr     \base, =SYS_ISRADDR
                .endm
 
                .macro  arch_ret_to_user, tmp1, tmp2
                .endm
 
                .macro  get_irqnr_and_base, irqnr, irqstat, base, tmp
-               ldr     \base, =SYS_ISRADDR
                ldr     \irqstat, [\base, #(SYS_ISA - SYS_ISRADDR)]
                cmp     \irqstat, #0
                ldrne   \irqnr, [\base]
index 25d8d28b27f3b131ec5a943619caaf50e86b2643..e83d48ec42c9baab2b2bc9d8554462976d5e3a33 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * include/asm-arm/arch-ns9xxx/irqs.h
  *
- * Copyright (C) 2006 by Digi International Inc.
+ * Copyright (C) 2006,2007 by Digi International Inc.
  * All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
 #ifndef __ASM_ARCH_IRQS_H
 #define __ASM_ARCH_IRQS_H
 
-#define IRQ_WATCHDOG   0
-#define IRQ_AHBBUSERR  1
-#define IRQ_BBUSAGG    2
+/* NetSilicon 9360 */
+#define IRQ_NS9XXX_WATCHDOG    0
+#define IRQ_NS9XXX_AHBBUSERR   1
+#define IRQ_NS9360_BBUSAGG     2
 /* irq 3 is reserved for NS9360 */
-#define IRQ_ETHRX      4
-#define IRQ_ETHTX      5
-#define IRQ_ETHPHY     6
-#define IRQ_LCD                7
-#define IRQ_SERBRX     8
-#define IRQ_SERBTX     9
-#define IRQ_SERARX     10
-#define IRQ_SERATX     11
-#define IRQ_SERCRX     12
-#define IRQ_SERCTX     13
-#define IRQ_I2C                14
-#define IRQ_BBUSDMA    15
-#define IRQ_TIMER0     16
-#define IRQ_TIMER1     17
-#define IRQ_TIMER2     18
-#define IRQ_TIMER3     19
-#define IRQ_TIMER4     20
-#define IRQ_TIMER5     21
-#define IRQ_TIMER6     22
-#define IRQ_TIMER7     23
-#define IRQ_RTC                24
-#define IRQ_USBHOST    25
-#define IRQ_USBDEVICE  26
-#define IRQ_IEEE1284   27
-#define IRQ_EXT0       28
-#define IRQ_EXT1       29
-#define IRQ_EXT2       30
-#define IRQ_EXT3       31
+#define IRQ_NS9XXX_ETHRX       4
+#define IRQ_NS9XXX_ETHTX       5
+#define IRQ_NS9XXX_ETHPHY      6
+#define IRQ_NS9360_LCD         7
+#define IRQ_NS9360_SERBRX      8
+#define IRQ_NS9360_SERBTX      9
+#define IRQ_NS9360_SERARX      10
+#define IRQ_NS9360_SERATX      11
+#define IRQ_NS9360_SERCRX      12
+#define IRQ_NS9360_SERCTX      13
+#define IRQ_NS9360_I2C         14
+#define IRQ_NS9360_BBUSDMA     15
+#define IRQ_NS9360_TIMER0      16
+#define IRQ_NS9360_TIMER1      17
+#define IRQ_NS9360_TIMER2      18
+#define IRQ_NS9360_TIMER3      19
+#define IRQ_NS9360_TIMER4      20
+#define IRQ_NS9360_TIMER5      21
+#define IRQ_NS9360_TIMER6      22
+#define IRQ_NS9360_TIMER7      23
+#define IRQ_NS9360_RTC         24
+#define IRQ_NS9360_USBHOST     25
+#define IRQ_NS9360_USBDEVICE   26
+#define IRQ_NS9360_IEEE1284    27
+#define IRQ_NS9XXX_EXT0                28
+#define IRQ_NS9XXX_EXT1                29
+#define IRQ_NS9XXX_EXT2                30
+#define IRQ_NS9XXX_EXT3                31
 
 #define BBUS_IRQ(irq)  (32 + irq)
 
@@ -67,7 +68,7 @@
 /*
  * these Interrupts are specific for the a9m9750dev board.
  * They are generated by an FPGA that interrupts the CPU on
- * IRQ_EXT2
+ * IRQ_NS9360_EXT2
  */
 #define FPGA_IRQ(irq)  (64 + irq)
 
diff --git a/include/asm-arm/arch-ns9xxx/module.h b/include/asm-arm/arch-ns9xxx/module.h
new file mode 100644 (file)
index 0000000..ac08a31
--- /dev/null
@@ -0,0 +1,60 @@
+/*
+ * include/asm-arm/arch-ns9xxx/module.h
+ *
+ * Copyright (C) 2007 by Digi International Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published by
+ * the Free Software Foundation.
+ */
+#ifndef __ASM_ARCH_MODULE_H
+#define __ASM_ARCH_MODULE_H
+
+#include <asm/mach-types.h>
+
+#define module_is_cc7ucamry()  (0                      \
+               || machine_is_cc7ucamry()               \
+               )
+
+#define module_is_cc9c()       (0                      \
+               || machine_is_cc9c()                    \
+               )
+
+#define module_is_cc9p9210()   (0                      \
+               || machine_is_cc9p9210()                \
+               || machine_is_cc9p9210js()              \
+               )
+
+#define module_is_cc9p9215()   (0                      \
+               || machine_is_cc9p9215()                \
+               || machine_is_cc9p9215js()              \
+               )
+
+#define module_is_cc9p9360()   (0                      \
+               || machine_is_a9m9360()                 \
+               || machine_is_cc9p9360dev()             \
+               || machine_is_cc9p9360js()              \
+               || machine_is_cc9p9360val()             \
+               )
+
+#define module_is_cc9p9750()   (0                      \
+               || machine_is_a9m9750()                 \
+               || machine_is_cc9p9750dev()             \
+               || machine_is_cc9p9750js()              \
+               || machine_is_cc9p9750val()             \
+               )
+
+#define module_is_ccw9c()      (0                      \
+               || machine_is_ccw9c()                   \
+               )
+
+#define module_is_inc20otter() (0                      \
+               || machine_is_inc20otter()              \
+               )
+
+#define module_is_otter()      (0                      \
+               || machine_is_otter()                   \
+               )
+
+#endif /* ifndef __ASM_ARCH_MODULE_H */
diff --git a/include/asm-arm/arch-ns9xxx/processor-ns9360.h b/include/asm-arm/arch-ns9xxx/processor-ns9360.h
new file mode 100644 (file)
index 0000000..f3aa6c5
--- /dev/null
@@ -0,0 +1,32 @@
+/*
+ * include/asm-arm/arch-ns9xxx/processor-ns9360.h
+ *
+ * Copyright (C) 2007 by Digi International Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published by
+ * the Free Software Foundation.
+ */
+#ifndef __ASM_ARCH_PROCESSORNS9360_H
+#define __ASM_ARCH_PROCESSORNS9360_H
+
+#include <linux/init.h>
+
+void ns9360_reset(char mode);
+
+unsigned long ns9360_systemclock(void) __attribute__((const));
+
+static inline unsigned long ns9360_cpuclock(void) __attribute__((const));
+static inline unsigned long ns9360_cpuclock(void)
+{
+       return ns9360_systemclock() / 2;
+}
+
+void __init ns9360_map_io(void);
+
+extern struct sys_timer ns9360_timer;
+
+int ns9360_gpio_configure(unsigned gpio, int inv, int func);
+
+#endif /* ifndef __ASM_ARCH_PROCESSORNS9360_H */
index 223e51b8e104f3075bedbedb51a8180831a43d79..f7b53b65de8199af284734422138bf2aa076ab5c 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * include/asm-arm/arch-ns9xxx/processor.h
  *
- * Copyright (C) 2006 by Digi International Inc.
+ * Copyright (C) 2006,2007 by Digi International Inc.
  * All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
 #ifndef __ASM_ARCH_PROCESSOR_H
 #define __ASM_ARCH_PROCESSOR_H
 
-#include <asm/mach-types.h>
+#include <asm/arch-ns9xxx/module.h>
 
-#define processor_is_ns9360()  (machine_is_cc9p9360dev()               \
-               || machine_is_cc9p9360js())
+#define processor_is_ns9210()  (0                      \
+               || module_is_cc7ucamry()                \
+               || module_is_cc9p9210()                 \
+               || module_is_inc20otter()               \
+               || module_is_otter()                    \
+               )
+
+#define processor_is_ns9215()  (0                      \
+               || module_is_cc9p9215()                 \
+               )
+
+#define processor_is_ns9360()  (0                      \
+               || module_is_cc9p9360()                 \
+               || module_is_cc9c()                     \
+               || module_is_ccw9c()                    \
+               )
+
+#define processor_is_ns9750()  (0                      \
+               || module_is_cc9p9750()                 \
+               )
+
+#define processor_is_ns921x()  (0                      \
+               || processor_is_ns9210()                \
+               || processor_is_ns9215()                \
+               )
 
 #endif /* ifndef __ASM_ARCH_PROCESSOR_H */
diff --git a/include/asm-arm/arch-ns9xxx/regs-sys-common.h b/include/asm-arm/arch-ns9xxx/regs-sys-common.h
new file mode 100644 (file)
index 0000000..956c57c
--- /dev/null
@@ -0,0 +1,31 @@
+/*
+ * include/asm-arm/arch-ns9xxx/regs-sys-common.h
+ *
+ * Copyright (C) 2007 by Digi International Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published by
+ * the Free Software Foundation.
+ */
+
+#ifndef __ASM_ARCH_REGSSYSCOMMON_H
+#define __ASM_ARCH_REGSSYSCOMMON_H
+#include <asm/hardware.h>
+
+/* Interrupt Vector Address Register Level x */
+#define SYS_IVA(x)     __REG2(0xa09000c4, (x))
+
+/* Interrupt Configuration registers */
+#define SYS_IC(x)      __REG2(0xa0900144, (x))
+
+/* ISRADDR */
+#define SYS_ISRADDR     __REG(0xa0900164)
+
+/* Interrupt Status Active */
+#define SYS_ISA                __REG(0xa0900168)
+
+/* Interrupt Status Raw */
+#define SYS_ISR                __REG(0xa090016c)
+
+#endif /* ifndef __ASM_ARCH_REGSSYSCOMMON_H */
similarity index 90%
rename from include/asm-arm/arch-ns9xxx/regs-sys.h
rename to include/asm-arm/arch-ns9xxx/regs-sys-ns9360.h
index 749262f86204ea4ad365ee267f0ee243f1f0a327..318b6945afb6ba81f7beca2af999c9b498ed695d 100644 (file)
@@ -1,15 +1,15 @@
 /*
- * include/asm-arm/arch-ns9xxx/regs-sys.h
+ * include/asm-arm/arch-ns9xxx/regs-sys-ns9360.h
  *
- * Copyright (C) 2006 by Digi International Inc.
+ * Copyright (C) 2006,2007 by Digi International Inc.
  * All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 as published by
  * the Free Software Foundation.
  */
-#ifndef __ASM_ARCH_REGSSYS_H
-#define __ASM_ARCH_REGSSYS_H
+#ifndef __ASM_ARCH_REGSSYSNS9360_H
+#define __ASM_ARCH_REGSSYSNS9360_H
 
 #include <asm/hardware.h>
 
 /* Timer x Read register */
 #define SYS_TR(x)      __REG2(0xa0900084, (x))
 
-/* Interrupt Vector Address Register Level x */
-#define SYS_IVA(x)     __REG2(0xa09000c4, (x))
-
-/* Interrupt Configuration registers */
-#define SYS_IC(x)      __REG2(0xa0900144, (x))
-
-/* ISRADDR */
-#define SYS_ISRADDR    __REG(0xa0900164)
-
-/* Interrupt Status Active */
-#define SYS_ISA                __REG(0xa0900168)
-
-/* Interrupt Status Raw */
-#define SYS_ISR                __REG(0xa090016c)
-
 /* Timer Interrupt Status register */
 #define SYS_TIS                __REG(0xa0900170)
 
 #define SYS_EIC_LVEDG_LEVEL            __REGVAL(SYS_EIC_LVEDG, 0)
 #define SYS_EIC_LVEDG_EDGE             __REGVAL(SYS_EIC_LVEDG, 1)
 
-#endif /* ifndef __ASM_ARCH_REGSSYS_H */
+#endif /* ifndef __ASM_ARCH_REGSSYSNS9360_H */
index c1082bd8977c73428dd0798b42c2eaf3c61371bd..1348073afe48f0258331170f77df724eec02c6d5 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * include/asm-arm/arch-ns9xxx/system.h
  *
- * Copyright (C) 2006 by Digi International Inc.
+ * Copyright (C) 2006,2007 by Digi International Inc.
  * All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
@@ -12,8 +12,8 @@
 #define __ASM_ARCH_SYSTEM_H
 
 #include <asm/proc-fns.h>
-#include <asm/arch-ns9xxx/regs-sys.h>
-#include <asm/mach-types.h>
+#include <asm/arch-ns9xxx/processor.h>
+#include <asm/arch-ns9xxx/processor-ns9360.h>
 
 static inline void arch_idle(void)
 {
@@ -22,11 +22,12 @@ static inline void arch_idle(void)
 
 static inline void arch_reset(char mode)
 {
-       u32 reg;
-
-       reg = __raw_readl(SYS_PLL) >> 16;
-       REGSET(reg, SYS_PLL, SWC, YES);
-       __raw_writel(reg, SYS_PLL);
+#ifdef CONFIG_PROCESSOR_NS9360
+       if (processor_is_ns9360())
+               ns9360_reset(mode);
+       else
+#endif
+               BUG();
 
        BUG();
 }
index 961ca7dc99543b3a5fac4a4d92e571a0b4c9e671..71066baceab7eacb8fa6dbdd6cc3e14a61dcf1f9 100644 (file)
 #ifndef __ASM_ARCH_UNCOMPRESS_H
 #define __ASM_ARCH_UNCOMPRESS_H
 
-static void putc(char c)
+#include <asm/io.h>
+
+#define __REG(x)       ((void __iomem __force *)(x))
+
+static void putc_dummy(char c, void __iomem *base)
 {
-       volatile u8 *base = (volatile u8 *)0x40000000;
-       int t = 0x10000;
+       /* nothing */
+}
 
+static void putc_ns9360(char c, void __iomem *base)
+{
+       static int t = 0x10000;
+       do {
+               if (t)
+                       --t;
+
+               if (__raw_readl(base + 8) & (1 << 3)) {
+                       __raw_writeb(c, base + 16);
+                       t = 0x10000;
+                       break;
+               }
+       } while (t);
+}
+
+static void putc_a9m9750dev(char c, void __iomem *base)
+{
+       static int t = 0x10000;
+       do {
+               if (t)
+                       --t;
+
+               if (__raw_readb(base + 5) & (1 << 5)) {
+                       __raw_writeb(c, base);
+                       t = 0x10000;
+                       break;
+               }
+       } while (t);
+
+}
+
+static void putc_ns921x(char c, void __iomem *base)
+{
+       static int t = 0x10000;
        do {
-               if (base[5] & 0x20) {
-                       base[0] = c;
+               if (t)
+                       --t;
+
+               if (!(__raw_readl(base) & (1 << 11))) {
+                       __raw_writeb(c, base + 0x0028);
+                       t = 0x10000;
                        break;
                }
-       } while (--t);
+       } while (t);
 }
 
-#define arch_decomp_setup()
+#define MSCS __REG(0xA0900184)
+
+#define NS9360_UARTA   __REG(0x90200040)
+#define NS9360_UARTB   __REG(0x90200000)
+#define NS9360_UARTC   __REG(0x90300000)
+#define NS9360_UARTD   __REG(0x90300040)
+
+#define NS9360_UART_ENABLED(base)                                      \
+               (__raw_readl(NS9360_UARTA) & (1 << 31))
+
+#define A9M9750DEV_UARTA       __REG(0x40000000)
+
+#define NS921XSYS_CLOCK        __REG(0xa090017c)
+#define NS921X_UARTA   __REG(0x90010000)
+#define NS921X_UARTB   __REG(0x90018000)
+#define NS921X_UARTC   __REG(0x90020000)
+#define NS921X_UARTD   __REG(0x90028000)
+
+#define NS921X_UART_ENABLED(base)                                      \
+               (__raw_readl((base) + 0x1000) & (1 << 29))
+
+static void autodetect(void (**putc)(char, void __iomem *), void __iomem **base)
+{
+       if (((__raw_readl(MSCS) >> 16) & 0xfe) == 0x00) {
+               /* ns9360 or ns9750 */
+               if (NS9360_UART_ENABLED(NS9360_UARTA)) {
+                       *putc = putc_ns9360;
+                       *base = NS9360_UARTA;
+                       return;
+               } else if (NS9360_UART_ENABLED(NS9360_UARTB)) {
+                       *putc = putc_ns9360;
+                       *base = NS9360_UARTB;
+                       return;
+               } else if (NS9360_UART_ENABLED(NS9360_UARTC)) {
+                       *putc = putc_ns9360;
+                       *base = NS9360_UARTC;
+                       return;
+               } else if (NS9360_UART_ENABLED(NS9360_UARTD)) {
+                       *putc = putc_ns9360;
+                       *base = NS9360_UARTD;
+                       return;
+               } else if (__raw_readl(__REG(0xa09001f4)) == 0xfffff001) {
+                       *putc = putc_a9m9750dev;
+                       *base = A9M9750DEV_UARTA;
+                       return;
+               }
+       } else if (((__raw_readl(MSCS) >> 16) & 0xfe) == 0x02) {
+               /* ns921x */
+               u32 clock = __raw_readl(NS921XSYS_CLOCK);
+
+               if ((clock & (1 << 1)) &&
+                               NS921X_UART_ENABLED(NS921X_UARTA)) {
+                       *putc = putc_ns921x;
+                       *base = NS921X_UARTA;
+                       return;
+               } else if ((clock & (1 << 2)) &&
+                               NS921X_UART_ENABLED(NS921X_UARTB)) {
+                       *putc = putc_ns921x;
+                       *base = NS921X_UARTB;
+                       return;
+               } else if ((clock & (1 << 3)) &&
+                               NS921X_UART_ENABLED(NS921X_UARTC)) {
+                       *putc = putc_ns921x;
+                       *base = NS921X_UARTC;
+                       return;
+               } else if ((clock & (1 << 4)) &&
+                               NS921X_UART_ENABLED(NS921X_UARTD)) {
+                       *putc = putc_ns921x;
+                       *base = NS921X_UARTD;
+                       return;
+               }
+       }
+
+       *putc = putc_dummy;
+}
+
+void (*myputc)(char, void __iomem *);
+void __iomem *base;
+
+static void putc(char c)
+{
+       myputc(c, base);
+}
+
+static void arch_decomp_setup(void)
+{
+       autodetect(&myputc, &base);
+}
 #define arch_decomp_wdog()
 
 static void flush(void)
index 2b1a8a4fe44ed21b9a69a3d65ecc7bbe29ff0b4a..94926090e475a715e4af75b77fbc2c35472100c2 100644 (file)
 /* At OMAP5912 OSK the Ethernet is directly connected to CS1 */
 #define OMAP_OSK_ETHR_START            0x04800300
 
+/* TPS65010 has four GPIOs.  nPG and LED2 can be treated like GPIOs with
+ * alternate pin configurations for hardware-controlled blinking.
+ */
+#define OSK_TPS_GPIO_BASE              (OMAP_MAX_GPIO_LINES + 16 /* MPUIO */)
+#      define OSK_TPS_GPIO_USB_PWR_EN  (OSK_TPS_GPIO_BASE + 0)
+#      define OSK_TPS_GPIO_LED_D3      (OSK_TPS_GPIO_BASE + 1)
+#      define OSK_TPS_GPIO_LAN_RESET   (OSK_TPS_GPIO_BASE + 2)
+#      define OSK_TPS_GPIO_DSP_PWR_EN  (OSK_TPS_GPIO_BASE + 3)
+#      define OSK_TPS_GPIO_LED_D9      (OSK_TPS_GPIO_BASE + 4)
+#      define OSK_TPS_GPIO_LED_D2      (OSK_TPS_GPIO_BASE + 5)
+
 #endif /*  __ASM_ARCH_OMAP_OSK_H */
 
index fa68810499034057f5b8544606a8579dd8d58eee..57523bdb642bc7cac7018fab195d88d374073350 100644 (file)
 #define __ARCH_ARM_OMAP_CLOCK_H
 
 struct module;
+struct clk;
+
+#if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3)
+
+struct clksel_rate {
+       u8                      div;
+       u32                     val;
+       u8                      flags;
+};
+
+struct clksel {
+       struct clk               *parent;
+       const struct clksel_rate *rates;
+};
+
+struct dpll_data {
+       void __iomem            *mult_div1_reg;
+       u32                     mult_mask;
+       u32                     div1_mask;
+#  if defined(CONFIG_ARCH_OMAP3)
+       void __iomem            *control_reg;
+       u32                     enable_mask;
+       u8                      auto_recal_bit;
+       u8                      recal_en_bit;
+       u8                      recal_st_bit;
+#  endif
+};
+
+#endif
 
 struct clk {
        struct list_head        node;
@@ -25,8 +54,6 @@ struct clk {
        __u32                   flags;
        void __iomem            *enable_reg;
        __u8                    enable_bit;
-       __u8                    rate_offset;
-       __u8                    src_offset;
        __s8                    usecount;
        void                    (*recalc)(struct clk *);
        int                     (*set_rate)(struct clk *, unsigned long);
@@ -34,6 +61,16 @@ struct clk {
        void                    (*init)(struct clk *);
        int                     (*enable)(struct clk *);
        void                    (*disable)(struct clk *);
+#if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3)
+       u8                      fixed_div;
+       void __iomem            *clksel_reg;
+       u32                     clksel_mask;
+       const struct clksel     *clksel;
+       const struct dpll_data  *dpll_data;
+#else
+       __u8                    rate_offset;
+       __u8                    src_offset;
+#endif
 };
 
 struct clk_functions {
@@ -54,10 +91,12 @@ extern int clk_init(struct clk_functions * custom_clocks);
 extern int clk_register(struct clk *clk);
 extern void clk_unregister(struct clk *clk);
 extern void propagate_rate(struct clk *clk);
+extern void recalculate_root_clocks(void);
 extern void followparent_recalc(struct clk * clk);
 extern void clk_allow_idle(struct clk *clk);
 extern void clk_deny_idle(struct clk *clk);
 extern int clk_get_usecount(struct clk *clk);
+extern void clk_enable_init_clocks(void);
 
 /* Clock flags */
 #define RATE_CKCTL             (1 << 0)        /* Main fixed ratio clocks */
@@ -71,21 +110,33 @@ extern int clk_get_usecount(struct clk *clk);
 #define CLOCK_NO_IDLE_PARENT   (1 << 8)
 #define DELAYED_APP            (1 << 9)        /* Delay application of clock */
 #define CONFIG_PARTICIPANT     (1 << 10)       /* Fundamental clock */
-#define CM_MPU_SEL1            (1 << 11)       /* Domain divider/source */
-#define CM_DSP_SEL1            (1 << 12)
-#define CM_GFX_SEL1            (1 << 13)
-#define CM_MODEM_SEL1          (1 << 14)
-#define CM_CORE_SEL1           (1 << 15)       /* Sets divider for many */
-#define CM_CORE_SEL2           (1 << 16)       /* sets parent for GPT */
-#define CM_WKUP_SEL1           (1 << 17)
-#define CM_PLL_SEL1            (1 << 18)
-#define CM_PLL_SEL2            (1 << 19)
-#define CM_SYSCLKOUT_SEL1      (1 << 20)
+#define ENABLE_ON_INIT         (1 << 11)       /* Enable upon framework init */
+#define INVERT_ENABLE           (1 << 12)       /* 0 enables, 1 disables */
+/* bits 13-20 are currently free */
 #define CLOCK_IN_OMAP310       (1 << 21)
 #define CLOCK_IN_OMAP730       (1 << 22)
 #define CLOCK_IN_OMAP1510      (1 << 23)
 #define CLOCK_IN_OMAP16XX      (1 << 24)
 #define CLOCK_IN_OMAP242X      (1 << 25)
 #define CLOCK_IN_OMAP243X      (1 << 26)
+#define CLOCK_IN_OMAP343X      (1 << 27)       /* clocks common to all 343X */
+#define PARENT_CONTROLS_CLOCK  (1 << 28)
+#define CLOCK_IN_OMAP3430ES1   (1 << 29)       /* 3430ES1 clocks only */
+#define CLOCK_IN_OMAP3430ES2   (1 << 30)       /* 3430ES2 clocks only */
+
+/* Clksel_rate flags */
+#define DEFAULT_RATE           (1 << 0)
+#define RATE_IN_242X           (1 << 1)
+#define RATE_IN_243X           (1 << 2)
+#define RATE_IN_343X           (1 << 3)        /* rates common to all 343X */
+#define RATE_IN_3430ES2                (1 << 4)        /* 3430ES2 rates only */
+
+#define RATE_IN_24XX           (RATE_IN_242X | RATE_IN_243X)
+
+
+/* CM_CLKSEL2_PLL.CORE_CLK_SRC options (24XX) */
+#define CORE_CLK_SRC_32K               0
+#define CORE_CLK_SRC_DPLL              1
+#define CORE_CLK_SRC_DPLL_X2           2
 
 #endif
diff --git a/include/asm-arm/arch-omap/control.h b/include/asm-arm/arch-omap/control.h
new file mode 100644 (file)
index 0000000..9944bb5
--- /dev/null
@@ -0,0 +1,191 @@
+#ifndef __ASM_ARCH_CONTROL_H
+#define __ASM_ARCH_CONTROL_H
+
+/*
+ * include/asm-arm/arch-omap/control.h
+ *
+ * OMAP2/3 System Control Module definitions
+ *
+ * Copyright (C) 2007 Texas Instruments, Inc.
+ * Copyright (C) 2007 Nokia Corporation
+ *
+ * Written by Paul Walmsley
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation.
+ */
+
+#include <asm/arch/io.h>
+
+#define OMAP242X_CTRL_REGADDR(reg)                                     \
+       (void __iomem *)IO_ADDRESS(OMAP242X_CTRL_BASE + (reg))
+#define OMAP243X_CTRL_REGADDR(reg)                                     \
+       (void __iomem *)IO_ADDRESS(OMAP243X_CTRL_BASE + (reg))
+#define OMAP343X_CTRL_REGADDR(reg)                                     \
+       (void __iomem *)IO_ADDRESS(OMAP343X_CTRL_BASE + (reg))
+
+/*
+ * As elsewhere, the "OMAP2_" prefix indicates that the macro is valid for
+ * OMAP24XX and OMAP34XX.
+ */
+
+/* Control submodule offsets */
+
+#define OMAP2_CONTROL_INTERFACE                0x000
+#define OMAP2_CONTROL_PADCONFS         0x030
+#define OMAP2_CONTROL_GENERAL          0x270
+#define OMAP343X_CONTROL_MEM_WKUP      0x600
+#define OMAP343X_CONTROL_PADCONFS_WKUP 0xa00
+#define OMAP343X_CONTROL_GENERAL_WKUP  0xa60
+
+/* Control register offsets - read/write with omap_ctrl_{read,write}{bwl}() */
+
+#define OMAP2_CONTROL_SYSCONFIG                (OMAP2_CONTROL_INTERFACE + 0x10)
+
+/* CONTROL_GENERAL register offsets common to OMAP2 & 3 */
+#define OMAP2_CONTROL_DEVCONF0         (OMAP2_CONTROL_GENERAL + 0x0004)
+#define OMAP2_CONTROL_MSUSPENDMUX_0    (OMAP2_CONTROL_GENERAL + 0x0020)
+#define OMAP2_CONTROL_MSUSPENDMUX_1    (OMAP2_CONTROL_GENERAL + 0x0024)
+#define OMAP2_CONTROL_MSUSPENDMUX_2    (OMAP2_CONTROL_GENERAL + 0x0028)
+#define OMAP2_CONTROL_MSUSPENDMUX_3    (OMAP2_CONTROL_GENERAL + 0x002c)
+#define OMAP2_CONTROL_MSUSPENDMUX_4    (OMAP2_CONTROL_GENERAL + 0x0030)
+#define OMAP2_CONTROL_MSUSPENDMUX_5    (OMAP2_CONTROL_GENERAL + 0x0034)
+#define OMAP2_CONTROL_SEC_CTRL         (OMAP2_CONTROL_GENERAL + 0x0040)
+#define OMAP2_CONTROL_RPUB_KEY_H_0     (OMAP2_CONTROL_GENERAL + 0x0090)
+#define OMAP2_CONTROL_RPUB_KEY_H_1     (OMAP2_CONTROL_GENERAL + 0x0094)
+#define OMAP2_CONTROL_RPUB_KEY_H_2     (OMAP2_CONTROL_GENERAL + 0x0098)
+#define OMAP2_CONTROL_RPUB_KEY_H_3     (OMAP2_CONTROL_GENERAL + 0x009c)
+
+/* 242x-only CONTROL_GENERAL register offsets */
+#define OMAP242X_CONTROL_DEVCONF       OMAP2_CONTROL_DEVCONF0 /* match TRM */
+#define OMAP242X_CONTROL_OCM_RAM_PERM  (OMAP2_CONTROL_GENERAL + 0x0068)
+
+/* 243x-only CONTROL_GENERAL register offsets */
+/* CONTROL_IVA2_BOOT{ADDR,MOD} are at the same place on 343x - noted below */
+#define OMAP243X_CONTROL_DEVCONF1      (OMAP2_CONTROL_GENERAL + 0x0078)
+#define OMAP243X_CONTROL_CSIRXFE       (OMAP2_CONTROL_GENERAL + 0x007c)
+#define OMAP243X_CONTROL_IVA2_BOOTADDR (OMAP2_CONTROL_GENERAL + 0x0190)
+#define OMAP243X_CONTROL_IVA2_BOOTMOD  (OMAP2_CONTROL_GENERAL + 0x0194)
+#define OMAP243X_CONTROL_IVA2_GEMCFG   (OMAP2_CONTROL_GENERAL + 0x0198)
+
+/* 24xx-only CONTROL_GENERAL register offsets */
+#define OMAP24XX_CONTROL_DEBOBS                (OMAP2_CONTROL_GENERAL + 0x0000)
+#define OMAP24XX_CONTROL_EMU_SUPPORT   (OMAP2_CONTROL_GENERAL + 0x0008)
+#define OMAP24XX_CONTROL_SEC_TEST      (OMAP2_CONTROL_GENERAL + 0x0044)
+#define OMAP24XX_CONTROL_PSA_CTRL      (OMAP2_CONTROL_GENERAL + 0x0048)
+#define OMAP24XX_CONTROL_PSA_CMD       (OMAP2_CONTROL_GENERAL + 0x004c)
+#define OMAP24XX_CONTROL_PSA_VALUE     (OMAP2_CONTROL_GENERAL + 0x0050)
+#define OMAP24XX_CONTROL_SEC_EMU       (OMAP2_CONTROL_GENERAL + 0x0060)
+#define OMAP24XX_CONTROL_SEC_TAP       (OMAP2_CONTROL_GENERAL + 0x0064)
+#define OMAP24XX_CONTROL_OCM_PUB_RAM_ADD       (OMAP2_CONTROL_GENERAL + 0x006c)
+#define OMAP24XX_CONTROL_EXT_SEC_RAM_START_ADD (OMAP2_CONTROL_GENERAL + 0x0070)
+#define OMAP24XX_CONTROL_EXT_SEC_RAM_STOP_ADD  (OMAP2_CONTROL_GENERAL + 0x0074
+#define OMAP24XX_CONTROL_SEC_STATUS            (OMAP2_CONTROL_GENERAL + 0x0080)
+#define OMAP24XX_CONTROL_SEC_ERR_STATUS                (OMAP2_CONTROL_GENERAL + 0x0084)
+#define OMAP24XX_CONTROL_STATUS                        (OMAP2_CONTROL_GENERAL + 0x0088)
+#define OMAP24XX_CONTROL_GENERAL_PURPOSE_STATUS        (OMAP2_CONTROL_GENERAL + 0x008c)
+#define OMAP24XX_CONTROL_RAND_KEY_0    (OMAP2_CONTROL_GENERAL + 0x00a0)
+#define OMAP24XX_CONTROL_RAND_KEY_1    (OMAP2_CONTROL_GENERAL + 0x00a4)
+#define OMAP24XX_CONTROL_RAND_KEY_2    (OMAP2_CONTROL_GENERAL + 0x00a8)
+#define OMAP24XX_CONTROL_RAND_KEY_3    (OMAP2_CONTROL_GENERAL + 0x00ac)
+#define OMAP24XX_CONTROL_CUST_KEY_0    (OMAP2_CONTROL_GENERAL + 0x00b0)
+#define OMAP24XX_CONTROL_CUST_KEY_1    (OMAP2_CONTROL_GENERAL + 0x00b4)
+#define OMAP24XX_CONTROL_TEST_KEY_0    (OMAP2_CONTROL_GENERAL + 0x00c0)
+#define OMAP24XX_CONTROL_TEST_KEY_1    (OMAP2_CONTROL_GENERAL + 0x00c4)
+#define OMAP24XX_CONTROL_TEST_KEY_2    (OMAP2_CONTROL_GENERAL + 0x00c8)
+#define OMAP24XX_CONTROL_TEST_KEY_3    (OMAP2_CONTROL_GENERAL + 0x00cc)
+#define OMAP24XX_CONTROL_TEST_KEY_4    (OMAP2_CONTROL_GENERAL + 0x00d0)
+#define OMAP24XX_CONTROL_TEST_KEY_5    (OMAP2_CONTROL_GENERAL + 0x00d4)
+#define OMAP24XX_CONTROL_TEST_KEY_6    (OMAP2_CONTROL_GENERAL + 0x00d8)
+#define OMAP24XX_CONTROL_TEST_KEY_7    (OMAP2_CONTROL_GENERAL + 0x00dc)
+#define OMAP24XX_CONTROL_TEST_KEY_8    (OMAP2_CONTROL_GENERAL + 0x00e0)
+#define OMAP24XX_CONTROL_TEST_KEY_9    (OMAP2_CONTROL_GENERAL + 0x00e4)
+
+/* 34xx-only CONTROL_GENERAL register offsets */
+#define OMAP343X_CONTROL_PADCONF_OFF   (OMAP2_CONTROL_GENERAL + 0x0000)
+#define OMAP343X_CONTROL_MEM_DFTRW0    (OMAP2_CONTROL_GENERAL + 0x0008)
+#define OMAP343X_CONTROL_MEM_DFTRW1    (OMAP2_CONTROL_GENERAL + 0x000c)
+#define OMAP343X_CONTROL_DEVCONF1      (OMAP2_CONTROL_GENERAL + 0x0068)
+#define OMAP343X_CONTROL_CSIRXFE               (OMAP2_CONTROL_GENERAL + 0x006c)
+#define OMAP343X_CONTROL_SEC_STATUS            (OMAP2_CONTROL_GENERAL + 0x0070)
+#define OMAP343X_CONTROL_SEC_ERR_STATUS                (OMAP2_CONTROL_GENERAL + 0x0074)
+#define OMAP343X_CONTROL_SEC_ERR_STATUS_DEBUG  (OMAP2_CONTROL_GENERAL + 0x0078)
+#define OMAP343X_CONTROL_STATUS                        (OMAP2_CONTROL_GENERAL + 0x0080)
+#define OMAP343X_CONTROL_GENERAL_PURPOSE_STATUS        (OMAP2_CONTROL_GENERAL + 0x0084)
+#define OMAP343X_CONTROL_RPUB_KEY_H_4  (OMAP2_CONTROL_GENERAL + 0x00a0)
+#define OMAP343X_CONTROL_RAND_KEY_0    (OMAP2_CONTROL_GENERAL + 0x00a8)
+#define OMAP343X_CONTROL_RAND_KEY_1    (OMAP2_CONTROL_GENERAL + 0x00ac)
+#define OMAP343X_CONTROL_RAND_KEY_2    (OMAP2_CONTROL_GENERAL + 0x00b0)
+#define OMAP343X_CONTROL_RAND_KEY_3    (OMAP2_CONTROL_GENERAL + 0x00b4)
+#define OMAP343X_CONTROL_TEST_KEY_0    (OMAP2_CONTROL_GENERAL + 0x00c8)
+#define OMAP343X_CONTROL_TEST_KEY_1    (OMAP2_CONTROL_GENERAL + 0x00cc)
+#define OMAP343X_CONTROL_TEST_KEY_2    (OMAP2_CONTROL_GENERAL + 0x00d0)
+#define OMAP343X_CONTROL_TEST_KEY_3    (OMAP2_CONTROL_GENERAL + 0x00d4)
+#define OMAP343X_CONTROL_TEST_KEY_4    (OMAP2_CONTROL_GENERAL + 0x00d8)
+#define OMAP343X_CONTROL_TEST_KEY_5    (OMAP2_CONTROL_GENERAL + 0x00dc)
+#define OMAP343X_CONTROL_TEST_KEY_6    (OMAP2_CONTROL_GENERAL + 0x00e0)
+#define OMAP343X_CONTROL_TEST_KEY_7    (OMAP2_CONTROL_GENERAL + 0x00e4)
+#define OMAP343X_CONTROL_TEST_KEY_8    (OMAP2_CONTROL_GENERAL + 0x00e8)
+#define OMAP343X_CONTROL_TEST_KEY_9    (OMAP2_CONTROL_GENERAL + 0x00ec)
+#define OMAP343X_CONTROL_TEST_KEY_10   (OMAP2_CONTROL_GENERAL + 0x00f0)
+#define OMAP343X_CONTROL_TEST_KEY_11   (OMAP2_CONTROL_GENERAL + 0x00f4)
+#define OMAP343X_CONTROL_TEST_KEY_12   (OMAP2_CONTROL_GENERAL + 0x00f8)
+#define OMAP343X_CONTROL_TEST_KEY_13   (OMAP2_CONTROL_GENERAL + 0x00fc)
+#define OMAP343X_CONTROL_IVA2_BOOTADDR (OMAP2_CONTROL_GENERAL + 0x0190)
+#define OMAP343X_CONTROL_IVA2_BOOTMOD  (OMAP2_CONTROL_GENERAL + 0x0194)
+
+/*
+ * REVISIT: This list of registers is not comprehensive - there are more
+ * that should be added.
+ */
+
+/*
+ * Control module register bit defines - these should eventually go into
+ * their own regbits file.  Some of these will be complicated, depending
+ * on the device type (general-purpose, emulator, test, secure, bad, other)
+ * and the security mode (secure, non-secure, don't care)
+ */
+/* CONTROL_DEVCONF0 bits */
+#define OMAP24XX_USBSTANDBYCTRL                (1 << 15)
+#define OMAP2_MCBSP2_CLKS_MASK         (1 << 6)
+#define OMAP2_MCBSP1_CLKS_MASK         (1 << 2)
+
+/* CONTROL_DEVCONF1 bits */
+#define OMAP2_MCBSP5_CLKS_MASK         (1 << 4) /* > 242x */
+#define OMAP2_MCBSP4_CLKS_MASK         (1 << 2) /* > 242x */
+#define OMAP2_MCBSP3_CLKS_MASK         (1 << 0) /* > 242x */
+
+/* CONTROL_STATUS bits */
+#define OMAP2_DEVICETYPE_MASK          (0x7 << 8)
+#define OMAP2_SYSBOOT_5_MASK           (1 << 5)
+#define OMAP2_SYSBOOT_4_MASK           (1 << 4)
+#define OMAP2_SYSBOOT_3_MASK           (1 << 3)
+#define OMAP2_SYSBOOT_2_MASK           (1 << 2)
+#define OMAP2_SYSBOOT_1_MASK           (1 << 1)
+#define OMAP2_SYSBOOT_0_MASK           (1 << 0)
+
+#ifndef __ASSEMBLY__
+#if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3)
+extern void omap_ctrl_base_set(u32 base);
+extern u32 omap_ctrl_base_get(void);
+extern u8 omap_ctrl_readb(u16 offset);
+extern u16 omap_ctrl_readw(u16 offset);
+extern u32 omap_ctrl_readl(u16 offset);
+extern void omap_ctrl_writeb(u8 val, u16 offset);
+extern void omap_ctrl_writew(u16 val, u16 offset);
+extern void omap_ctrl_writel(u32 val, u16 offset);
+#else
+#define omap_ctrl_base_set(x)          WARN_ON(1)
+#define omap_ctrl_base_get()           0
+#define omap_ctrl_readb(x)             0
+#define omap_ctrl_readw(x)             0
+#define omap_ctrl_readl(x)             0
+#define omap_ctrl_writeb(x, y)         WARN_ON(1)
+#define omap_ctrl_writew(x, y)         WARN_ON(1)
+#define omap_ctrl_writel(x, y)         WARN_ON(1)
+#endif
+#endif /* __ASSEMBLY__ */
+
+#endif /* __ASM_ARCH_CONTROL_H */
+
index f6967c8df32336c6d780005e6ff3251dcb6e79ea..74cd57221c8ee14a6845b0ed55ef0f5d6fb851ae 100644 (file)
@@ -68,7 +68,7 @@
                .endm
 
                .macro  get_irqnr_and_base, irqnr, irqstat, base, tmp
-               ldr     \base, =VA_IC_BASE
+               ldr     \base, =OMAP2_VA_IC_BASE
                ldr     \irqnr, [\base, #0x98] /* IRQ pending reg 1 */
                cmp     \irqnr, #0x0
                bne     2222f
index 164da09be09550fe8e45b91a8f09687d9b59047c..86621a04cd8f98939a943a1f2cdea463b2777894 100644 (file)
@@ -82,62 +82,35 @@ extern void omap_set_gpio_debounce_time(int gpio, int enable);
 
 /*-------------------------------------------------------------------------*/
 
-/* wrappers for "new style" GPIO calls. the old OMAP-specfic ones should
- * eventually be removed (along with this errno.h inclusion), and maybe
- * gpios should put MPUIOs last too.
+/* Wrappers for "new style" GPIO calls, using the new infrastructure
+ * which lets us plug in FPGA, I2C, and other implementations.
+ * *
+ * The original OMAP-specfic calls should eventually be removed.
  */
 
-#include <asm/errno.h>
-
-static inline int gpio_request(unsigned gpio, const char *label)
-{
-       return omap_request_gpio(gpio);
-}
-
-static inline void gpio_free(unsigned gpio)
-{
-       omap_free_gpio(gpio);
-}
-
-static inline int __gpio_set_direction(unsigned gpio, int is_input)
-{
-       if (cpu_class_is_omap2()) {
-               if (gpio > OMAP_MAX_GPIO_LINES)
-                       return -EINVAL;
-       } else {
-               if (gpio > (OMAP_MAX_GPIO_LINES + 16 /* MPUIO */))
-                       return -EINVAL;
-       }
-       omap_set_gpio_direction(gpio, is_input);
-       return 0;
-}
-
-static inline int gpio_direction_input(unsigned gpio)
-{
-       return __gpio_set_direction(gpio, 1);
-}
-
-static inline int gpio_direction_output(unsigned gpio, int value)
-{
-       omap_set_gpio_dataout(gpio, value);
-       return __gpio_set_direction(gpio, 0);
-}
+#include <linux/errno.h>
+#include <asm-generic/gpio.h>
 
 static inline int gpio_get_value(unsigned gpio)
 {
-       return omap_get_gpio_datain(gpio);
+       return __gpio_get_value(gpio);
 }
 
 static inline void gpio_set_value(unsigned gpio, int value)
 {
-       omap_set_gpio_dataout(gpio, value);
+       __gpio_set_value(gpio, value);
 }
 
-#include <asm-generic/gpio.h>          /* cansleep wrappers */
+static inline int gpio_cansleep(unsigned gpio)
+{
+       return __gpio_cansleep(gpio);
+}
 
 static inline int gpio_to_irq(unsigned gpio)
 {
-       return OMAP_GPIO_IRQ(gpio);
+       if (gpio < (OMAP_MAX_GPIO_LINES + 16))
+               return OMAP_GPIO_IRQ(gpio);
+       return -EINVAL;
 }
 
 static inline int irq_to_gpio(unsigned irq)
index 289082d07f14ec284e7cf7d54cf61b229074acf8..160578e1f5578640b16af0720d1857ad14358ef4 100644 (file)
 #define OMAP243X_GPMC_PHYS     OMAP243X_GPMC_BASE      /* 0x49000000 */
 #define OMAP243X_GPMC_VIRT     0xFE000000
 #define OMAP243X_GPMC_SIZE     SZ_1M
+#define OMAP243X_SDRC_PHYS     OMAP243X_SDRC_BASE
+#define OMAP243X_SDRC_VIRT     0xFD000000
+#define OMAP243X_SDRC_SIZE     SZ_1M
+#define OMAP243X_SMS_PHYS      OMAP243X_SMS_BASE
+#define OMAP243X_SMS_VIRT      0xFC000000
+#define OMAP243X_SMS_SIZE      SZ_1M
+
 #endif
 
 #define IO_OFFSET      0x90000000
 #define io_v2p(va)     ((va) - IO_OFFSET)      /* Works for L3 and L4 */
 
 /* DSP */
-#define DSP_MEM_24XX_PHYS      OMAP24XX_DSP_MEM_BASE   /* 0x58000000 */
+#define DSP_MEM_24XX_PHYS      OMAP2420_DSP_MEM_BASE   /* 0x58000000 */
 #define DSP_MEM_24XX_VIRT      0xe0000000
 #define DSP_MEM_24XX_SIZE      0x28000
-#define DSP_IPI_24XX_PHYS      OMAP24XX_DSP_IPI_BASE   /* 0x59000000 */
+#define DSP_IPI_24XX_PHYS      OMAP2420_DSP_IPI_BASE   /* 0x59000000 */
 #define DSP_IPI_24XX_VIRT      0xe1000000
 #define DSP_IPI_24XX_SIZE      SZ_4K
-#define DSP_MMU_24XX_PHYS      OMAP24XX_DSP_MMU_BASE   /* 0x5a000000 */
+#define DSP_MMU_24XX_PHYS      OMAP2420_DSP_MMU_BASE   /* 0x5a000000 */
 #define DSP_MMU_24XX_VIRT      0xe2000000
 #define DSP_MMU_24XX_SIZE      SZ_4K
 
+#elif defined(CONFIG_ARCH_OMAP3)
+
+/* We map both L3 and L4 on OMAP3 */
+#define L3_34XX_PHYS           L3_34XX_BASE    /* 0x68000000 */
+#define L3_34XX_VIRT           0xf8000000
+#define L3_34XX_SIZE           SZ_1M   /* 44kB of 128MB used, want 1MB sect */
+
+#define L4_34XX_PHYS           L4_34XX_BASE    /* 0x48000000 */
+#define L4_34XX_VIRT           0xd8000000
+#define L4_34XX_SIZE           SZ_4M   /* 1MB of 128MB used, want 1MB sect */
+
+/*
+ * Need to look at the Size 4M for L4.
+ * VPOM3430 was not working for Int controller
+ */
+
+#define L4_WK_34XX_PHYS                L4_WK_34XX_BASE /* 0x48300000 */
+#define L4_WK_34XX_VIRT                0xd8300000
+#define L4_WK_34XX_SIZE                SZ_1M
+
+#define L4_PER_34XX_PHYS       L4_PER_34XX_BASE /* 0x49000000 */
+#define L4_PER_34XX_VIRT       0xd9000000
+#define L4_PER_34XX_SIZE       SZ_1M
+
+#define L4_EMU_34XX_PHYS       L4_EMU_34XX_BASE /* 0x54000000 */
+#define L4_EMU_34XX_VIRT       0xe4000000
+#define L4_EMU_34XX_SIZE       SZ_64M
+
+#define OMAP34XX_GPMC_PHYS     OMAP34XX_GPMC_BASE /* 0x6E000000 */
+#define OMAP34XX_GPMC_VIRT     0xFE000000
+#define OMAP34XX_GPMC_SIZE     SZ_1M
+
+#define OMAP343X_SMS_PHYS      OMAP343X_SMS_BASE /* 0x6C000000 */
+#define OMAP343X_SMS_VIRT      0xFC000000
+#define OMAP343X_SMS_SIZE      SZ_1M
+
+#define OMAP343X_SDRC_PHYS     OMAP343X_SDRC_BASE /* 0x6D000000 */
+#define OMAP343X_SDRC_VIRT     0xFD000000
+#define OMAP343X_SDRC_SIZE     SZ_1M
+
+
+#define IO_OFFSET              0x90000000
+#define IO_ADDRESS(pa)         ((pa) + IO_OFFSET)/* Works for L3 and L4 */
+#define io_p2v(pa)             ((pa) + IO_OFFSET)/* Works for L3 and L4 */
+#define io_v2p(va)             ((va) - IO_OFFSET)/* Works for L3 and L4 */
+
+/* DSP */
+#define DSP_MEM_34XX_PHYS      OMAP34XX_DSP_MEM_BASE   /* 0x58000000 */
+#define DSP_MEM_34XX_VIRT      0xe0000000
+#define DSP_MEM_34XX_SIZE      0x28000
+#define DSP_IPI_34XX_PHYS      OMAP34XX_DSP_IPI_BASE   /* 0x59000000 */
+#define DSP_IPI_34XX_VIRT      0xe1000000
+#define DSP_IPI_34XX_SIZE      SZ_4K
+#define DSP_MMU_34XX_PHYS      OMAP34XX_DSP_MMU_BASE   /* 0x5a000000 */
+#define DSP_MMU_34XX_VIRT      0xe2000000
+#define DSP_MMU_34XX_SIZE      SZ_4K
+
 #endif
 
 #ifndef __ASSEMBLER__
index b8fff50e6a87acd6399eb4f24249fbbbf01f6fb2..ff9a5b5575fd4952ecbeef65362d7172195582c0 100644 (file)
@@ -4,9 +4,10 @@
  * Table of the Omap register configurations for the FUNC_MUX and
  * PULL_DWN combinations.
  *
- * Copyright (C) 2003 - 2005 Nokia Corporation
+ * Copyright (C) 2004 - 2008 Texas Instruments Inc.
+ * Copyright (C) 2003 - 2008 Nokia Corporation
  *
- * Written by Tony Lindgren <tony.lindgren@nokia.com>
+ * Written by Tony Lindgren
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  *      - W8        = ball
  *      - 1610      = 1510 or 1610, none if common for both 1510 and 1610
  *      - MMC2_DAT0 = function
- *
- * Change log:
- *   Added entry for the I2C interface. (02Feb 2004)
- *   Copyright (C) 2004 Texas Instruments
- *
- *   Added entry for the keypad and uwire CS1. (09Mar 2004)
- *   Copyright (C) 2004 Texas Instruments
- *
  */
 
 #ifndef __ASM_ARCH_MUX_H
@@ -469,7 +462,12 @@ enum omap24xx_index {
        AA8_242X_GPIO58,
        Y20_24XX_GPIO60,
        W4__24XX_GPIO74,
+       N15_24XX_GPIO85,
        M15_24XX_GPIO92,
+       P20_24XX_GPIO93,
+       P18_24XX_GPIO95,
+       M18_24XX_GPIO96,
+       L14_24XX_GPIO97,
        J15_24XX_GPIO99,
        V14_24XX_GPIO117,
        P14_24XX_GPIO125,
@@ -494,8 +492,6 @@ enum omap24xx_index {
        D3_242X_DMAREQ4,
        E3_242X_DMAREQ5,
 
-       P20_24XX_TSC_IRQ,
-
        /* UART3 */
        K15_24XX_UART3_TX,
        K14_24XX_UART3_RX,
@@ -557,13 +553,57 @@ enum omap24xx_index {
        B3__24XX_KBR5,
        AA4_24XX_KBC2,
        B13_24XX_KBC6,
+
+       /* 2430 USB */
+       AD9_2430_USB0_PUEN,
+       Y11_2430_USB0_VP,
+       AD7_2430_USB0_VM,
+       AE7_2430_USB0_RCV,
+       AD4_2430_USB0_TXEN,
+       AF9_2430_USB0_SE0,
+       AE6_2430_USB0_DAT,
+       AD24_2430_USB1_SE0,
+       AB24_2430_USB1_RCV,
+       Y25_2430_USB1_TXEN,
+       AA26_2430_USB1_DAT,
+
+       /* 2430 HS-USB */
+       AD9_2430_USB0HS_DATA3,
+       Y11_2430_USB0HS_DATA4,
+       AD7_2430_USB0HS_DATA5,
+       AE7_2430_USB0HS_DATA6,
+       AD4_2430_USB0HS_DATA2,
+       AF9_2430_USB0HS_DATA0,
+       AE6_2430_USB0HS_DATA1,
+       AE8_2430_USB0HS_CLK,
+       AD8_2430_USB0HS_DIR,
+       AE5_2430_USB0HS_STP,
+       AE9_2430_USB0HS_NXT,
+       AC7_2430_USB0HS_DATA7,
+
+       /* 2430 McBSP */
+       AC10_2430_MCBSP2_FSX,
+       AD16_2430_MCBSP2_CLX,
+       AE13_2430_MCBSP2_DX,
+       AD13_2430_MCBSP2_DR,
+       AC10_2430_MCBSP2_FSX_OFF,
+       AD16_2430_MCBSP2_CLX_OFF,
+       AE13_2430_MCBSP2_DX_OFF,
+       AD13_2430_MCBSP2_DR_OFF,
+
+};
+
+struct omap_mux_cfg {
+       struct pin_config       *pins;
+       unsigned long           size;
+       int                     (*cfg_reg)(const struct pin_config *cfg);
 };
 
 #ifdef CONFIG_OMAP_MUX
 /* setup pin muxing in Linux */
 extern int omap1_mux_init(void);
 extern int omap2_mux_init(void);
-extern int omap_mux_register(struct pin_config * pins, unsigned long size);
+extern int omap_mux_register(struct omap_mux_cfg *);
 extern int omap_cfg_reg(unsigned long reg_cfg);
 #else
 /* boot loader does it all (no warnings from CONFIG_OMAP_MUX_WARNINGS) */
index 14c0f94965795d4019adc8d4fe2b1654cdaf71b5..b9fcaae287c8a1e3865fd72bd6527d1090e56809 100644 (file)
@@ -1,3 +1,28 @@
+/*
+ * include/asm-arm/arch-omap/omap24xx.h
+ *
+ * This file contains the processor specific definitions
+ * of the TI OMAP24XX.
+ *
+ * Copyright (C) 2007 Texas Instruments.
+ * Copyright (C) 2007 Nokia Corporation.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ */
+
 #ifndef __ASM_ARCH_OMAP24XX_H
 #define __ASM_ARCH_OMAP24XX_H
 
 
 /* interrupt controller */
 #define OMAP24XX_IC_BASE       (L4_24XX_BASE + 0xfe000)
-#define VA_IC_BASE             IO_ADDRESS(OMAP24XX_IC_BASE)
 #define OMAP24XX_IVA_INTC_BASE 0x40000000
 #define IRQ_SIR_IRQ            0x0040
 
-#ifdef CONFIG_ARCH_OMAP2420
-#define OMAP24XX_32KSYNCT_BASE (L4_24XX_BASE + 0x4000)
-#define OMAP24XX_PRCM_BASE     (L4_24XX_BASE + 0x8000)
-#define OMAP24XX_SDRC_BASE     (L3_24XX_BASE + 0x9000)
-#define OMAP242X_CONTROL_STATUS        (L4_24XX_BASE + 0x2f8)
-#endif
+#define OMAP2420_CTRL_BASE     L4_24XX_BASE
+#define OMAP2420_32KSYNCT_BASE (L4_24XX_BASE + 0x4000)
+#define OMAP2420_PRCM_BASE     (L4_24XX_BASE + 0x8000)
+#define OMAP2420_CM_BASE       (L4_24XX_BASE + 0x8000)
+#define OMAP2420_PRM_BASE      OMAP2420_CM_BASE
+#define OMAP2420_SDRC_BASE     (L3_24XX_BASE + 0x9000)
+#define OMAP2420_SMS_BASE      0x68008000
 
-#ifdef CONFIG_ARCH_OMAP2430
-#define OMAP24XX_32KSYNCT_BASE (L4_WK_243X_BASE + 0x20000)
-#define OMAP24XX_PRCM_BASE     (L4_WK_243X_BASE + 0x6000)
-#define OMAP24XX_SDRC_BASE     (0x6D000000)
-#define OMAP242X_CONTROL_STATUS        (L4_24XX_BASE + 0x2f8)
+#define OMAP2430_32KSYNCT_BASE (L4_WK_243X_BASE + 0x20000)
+#define OMAP2430_PRCM_BASE     (L4_WK_243X_BASE + 0x6000)
+#define OMAP2430_CM_BASE       (L4_WK_243X_BASE + 0x6000)
+#define OMAP2430_PRM_BASE      OMAP2430_CM_BASE
+
+#define OMAP243X_SMS_BASE      0x6C000000
+#define OMAP243X_SDRC_BASE     0x6D000000
 #define OMAP243X_GPMC_BASE     0x6E000000
-#endif
+#define OMAP243X_SCM_BASE      (L4_WK_243X_BASE + 0x2000)
+#define OMAP243X_CTRL_BASE     OMAP243X_SCM_BASE
+#define OMAP243X_HS_BASE       (L4_24XX_BASE + 0x000ac000)
 
 /* DSP SS */
-#define OMAP24XX_DSP_BASE      0x58000000
-#define OMAP24XX_DSP_MEM_BASE  (OMAP24XX_DSP_BASE + 0x0)
-#define OMAP24XX_DSP_IPI_BASE  (OMAP24XX_DSP_BASE + 0x1000000)
-#define OMAP24XX_DSP_MMU_BASE  (OMAP24XX_DSP_BASE + 0x2000000)
+#define OMAP2420_DSP_BASE      0x58000000
+#define OMAP2420_DSP_MEM_BASE  (OMAP2420_DSP_BASE + 0x0)
+#define OMAP2420_DSP_IPI_BASE  (OMAP2420_DSP_BASE + 0x1000000)
+#define OMAP2420_DSP_MMU_BASE  (OMAP2420_DSP_BASE + 0x2000000)
+
+#define OMAP243X_DSP_BASE      0x5C000000
+#define OMAP243X_DSP_MEM_BASE  (OMAP243X_DSP_BASE + 0x0)
+#define OMAP243X_DSP_MMU_BASE  (OMAP243X_DSP_BASE + 0x1000000)
 
 /* Mailbox */
 #define OMAP24XX_MAILBOX_BASE  (L4_24XX_BASE + 0x94000)
 
+/* Camera */
+#define OMAP24XX_CAMERA_BASE   (L4_24XX_BASE + 0x52000)
+
+/* Security */
+#define OMAP24XX_SEC_BASE      (L4_24XX_BASE + 0xA0000)
+#define OMAP24XX_SEC_RNG_BASE  (OMAP24XX_SEC_BASE + 0x0000)
+#define OMAP24XX_SEC_DES_BASE  (OMAP24XX_SEC_BASE + 0x2000)
+#define OMAP24XX_SEC_SHA1MD5_BASE (OMAP24XX_SEC_BASE + 0x4000)
+#define OMAP24XX_SEC_AES_BASE  (OMAP24XX_SEC_BASE + 0x6000)
+#define OMAP24XX_SEC_PKA_BASE  (OMAP24XX_SEC_BASE + 0x8000)
+
+#if defined(CONFIG_ARCH_OMAP2420)
+
+#define OMAP2_32KSYNCT_BASE    OMAP2420_32KSYNCT_BASE
+#define OMAP2_PRCM_BASE                OMAP2420_PRCM_BASE
+#define OMAP2_CM_BASE          OMAP2420_CM_BASE
+#define OMAP2_PRM_BASE         OMAP2420_PRM_BASE
+#define OMAP2_VA_IC_BASE       IO_ADDRESS(OMAP24XX_IC_BASE)
+
+#elif defined(CONFIG_ARCH_OMAP2430)
+
+#define OMAP2_32KSYNCT_BASE    OMAP2430_32KSYNCT_BASE
+#define OMAP2_PRCM_BASE                OMAP2430_PRCM_BASE
+#define OMAP2_CM_BASE          OMAP2430_CM_BASE
+#define OMAP2_PRM_BASE         OMAP2430_PRM_BASE
+#define OMAP2_VA_IC_BASE       IO_ADDRESS(OMAP24XX_IC_BASE)
+
+#endif
+
 #endif /* __ASM_ARCH_OMAP24XX_H */
 
diff --git a/include/asm-arm/arch-omap/sdrc.h b/include/asm-arm/arch-omap/sdrc.h
new file mode 100644 (file)
index 0000000..673b396
--- /dev/null
@@ -0,0 +1,75 @@
+#ifndef ____ASM_ARCH_SDRC_H
+#define ____ASM_ARCH_SDRC_H
+
+/*
+ * OMAP2/3 SDRC/SMS register definitions
+ *
+ * Copyright (C) 2007 Texas Instruments, Inc.
+ * Copyright (C) 2007 Nokia Corporation
+ *
+ * Written by Paul Walmsley
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <asm/arch/io.h>
+
+/* SDRC register offsets - read/write with sdrc_{read,write}_reg() */
+
+#define SDRC_SYSCONFIG         0x010
+#define SDRC_DLLA_CTRL         0x060
+#define SDRC_DLLA_STATUS       0x064
+#define SDRC_DLLB_CTRL         0x068
+#define SDRC_DLLB_STATUS       0x06C
+#define SDRC_POWER             0x070
+#define SDRC_MR_0              0x084
+#define SDRC_RFR_CTRL_0                0x0a4
+
+/*
+ * These values represent the number of memory clock cycles between
+ * autorefresh initiation.  They assume 1 refresh per 64 ms (JEDEC), 8192
+ * rows per device, and include a subtraction of a 50 cycle window in the
+ * event that the autorefresh command is delayed due to other SDRC activity.
+ * The '| 1' sets the ARE field to send one autorefresh when the autorefresh
+ * counter reaches 0.
+ *
+ * These represent optimal values for common parts, it won't work for all.
+ * As long as you scale down, most parameters are still work, they just
+ * become sub-optimal. The RFR value goes in the opposite direction. If you
+ * don't adjust it down as your clock period increases the refresh interval
+ * will not be met. Setting all parameters for complete worst case may work,
+ * but may cut memory performance by 2x. Due to errata the DLLs need to be
+ * unlocked and their value needs run time calibration.        A dynamic call is
+ * need for that as no single right value exists acorss production samples.
+ *
+ * Only the FULL speed values are given. Current code is such that rate
+ * changes must be made at DPLLoutx2. The actual value adjustment for low
+ * frequency operation will be handled by omap_set_performance()
+ *
+ * By having the boot loader boot up in the fastest L4 speed available likely
+ * will result in something which you can switch between.
+ */
+#define SDRC_RFR_CTRL_165MHz   (0x00044c00 | 1)
+#define SDRC_RFR_CTRL_133MHz   (0x0003de00 | 1)
+#define SDRC_RFR_CTRL_100MHz   (0x0002da01 | 1)
+#define SDRC_RFR_CTRL_110MHz   (0x0002da01 | 1) /* Need to calc */
+#define SDRC_RFR_CTRL_BYPASS   (0x00005000 | 1) /* Need to calc */
+
+
+/*
+ * SMS register access
+ */
+
+
+#define OMAP242X_SMS_REGADDR(reg)      (void __iomem *)IO_ADDRESS(OMAP2420_SMS_BASE + reg)
+#define OMAP243X_SMS_REGADDR(reg)      (void __iomem *)IO_ADDRESS(OMAP243X_SMS_BASE + reg)
+#define OMAP343X_SMS_REGADDR(reg)      (void __iomem *)IO_ADDRESS(OMAP343X_SMS_BASE + reg)
+
+/* SMS register offsets - read/write with sms_{read,write}_reg() */
+
+#define SMS_SYSCONFIG          0x010
+/* REVISIT: fill in other SMS registers here */
+
+#endif
index 99ae9eabaf71bb3740aabe11cc6b2667065d91f5..2147d18aaeaef1b85477cf77f602670df5b19aa1 100644 (file)
 #      define  CONF_USB_PWRDN_DP_R     (1 << 1)
 
 /* OMAP2 */
-#define        CONTROL_DEVCONF_REG             __REG32(L4_24XX_BASE + 0x0274)
 #      define  USB_UNIDIR                      0x0
 #      define  USB_UNIDIR_TLL                  0x1
 #      define  USB_BIDIR                       0x2
 #      define  USB_BIDIR_TLL                   0x3
-#      define  USBT0WRMODEI(x)         ((x) << 22)
-#      define  USBT1WRMODEI(x)         ((x) << 20)
-#      define  USBT2WRMODEI(x)         ((x) << 18)
+#      define  USBTXWRMODEI(port, x)   ((x) << (22 - (port * 2)))
 #      define  USBT2TLL5PI             (1 << 17)
 #      define  USB0PUENACTLOI          (1 << 16)
 #      define  USBSTANDBYCTRL          (1 << 15)
diff --git a/include/asm-arm/arch-orion/io.h b/include/asm-arm/arch-orion/io.h
deleted file mode 100644 (file)
index e0b8c39..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * include/asm-arm/arch-orion/io.h
- *
- * Tzachi Perelstein <tzachi@marvell.com>
- *
- * This file is licensed under  the terms of the GNU General Public
- * License version 2. This program is licensed "as is" without any
- * warranty of any kind, whether express or implied.
- */
-
-#ifndef __ASM_ARM_ARCH_IO_H
-#define __ASM_ARM_ARCH_IO_H
-
-#include "orion.h"
-
-#define IO_SPACE_LIMIT         0xffffffff
-#define IO_SPACE_REMAP         ORION_PCI_SYS_IO_BASE
-
-static inline void __iomem *__io(unsigned long addr)
-{
-       return (void __iomem *)addr;
-}
-
-#define __io(a)                        __io(a)
-#define __mem_pci(a)           (a)
-
-#endif
diff --git a/include/asm-arm/arch-orion/irqs.h b/include/asm-arm/arch-orion/irqs.h
deleted file mode 100644 (file)
index eea65ca..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * include/asm-arm/arch-orion/irqs.h
- *
- * IRQ definitions for Orion SoC
- *
- *  Maintainer: Tzachi Perelstein <tzachi@marvell.com>
- *
- *  This file is licensed under the terms of the GNU General Public
- *  License version 2. This program is licensed "as is" without any
- *  warranty of any kind, whether express or implied.
- */
-
-#ifndef __ASM_ARCH_IRQS_H__
-#define __ASM_ARCH_IRQS_H__
-
-#include "orion.h"     /* need GPIO_MAX */
-
-/*
- * Orion Main Interrupt Controller
- */
-#define IRQ_ORION_BRIDGE       0
-#define IRQ_ORION_DOORBELL_H2C 1
-#define IRQ_ORION_DOORBELL_C2H 2
-#define IRQ_ORION_UART0                3
-#define IRQ_ORION_UART1                4
-#define IRQ_ORION_I2C          5
-#define IRQ_ORION_GPIO_0_7     6
-#define IRQ_ORION_GPIO_8_15    7
-#define IRQ_ORION_GPIO_16_23   8
-#define IRQ_ORION_GPIO_24_31   9
-#define IRQ_ORION_PCIE0_ERR    10
-#define IRQ_ORION_PCIE0_INT    11
-#define IRQ_ORION_USB1_CTRL    12
-#define IRQ_ORION_DEV_BUS_ERR  14
-#define IRQ_ORION_PCI_ERR      15
-#define IRQ_ORION_USB_BR_ERR   16
-#define IRQ_ORION_USB0_CTRL    17
-#define IRQ_ORION_ETH_RX       18
-#define IRQ_ORION_ETH_TX       19
-#define IRQ_ORION_ETH_MISC     20
-#define IRQ_ORION_ETH_SUM      21
-#define IRQ_ORION_ETH_ERR      22
-#define IRQ_ORION_IDMA_ERR     23
-#define IRQ_ORION_IDMA_0       24
-#define IRQ_ORION_IDMA_1       25
-#define IRQ_ORION_IDMA_2       26
-#define IRQ_ORION_IDMA_3       27
-#define IRQ_ORION_CESA         28
-#define IRQ_ORION_SATA         29
-#define IRQ_ORION_XOR0         30
-#define IRQ_ORION_XOR1         31
-
-/*
- * Orion General Purpose Pins
- */
-#define IRQ_ORION_GPIO_START   32
-#define NR_GPIO_IRQS           GPIO_MAX
-
-#define NR_IRQS                        (IRQ_ORION_GPIO_START + NR_GPIO_IRQS)
-
-#endif /* __ASM_ARCH_IRQS_H__ */
diff --git a/include/asm-arm/arch-orion/orion.h b/include/asm-arm/arch-orion/orion.h
deleted file mode 100644 (file)
index 673a418..0000000
+++ /dev/null
@@ -1,165 +0,0 @@
-/*
- * include/asm-arm/arch-orion/orion.h
- *
- * Generic definitions of Orion SoC flavors:
- *  Orion-1, Orion-NAS, Orion-VoIP, and Orion-2.
- *
- * Maintainer: Tzachi Perelstein <tzachi@marvell.com>
- *
- * This file is licensed under the terms of the GNU General Public
- * License version 2. This program is licensed "as is" without any
- * warranty of any kind, whether express or implied.
- */
-
-#ifndef __ASM_ARCH_ORION_H__
-#define __ASM_ARCH_ORION_H__
-
-/*****************************************************************************
- * Orion Address Map
- *
- * virt                phys            size
- * fdd00000    f1000000        1M      on-chip peripheral registers
- * fde00000    f2000000        1M      PCIe I/O space
- * fdf00000    f2100000        1M      PCI I/O space
- * fe000000    f0000000        16M     PCIe WA space (Orion-NAS only)
- ****************************************************************************/
-#define ORION_REGS_PHYS_BASE   0xf1000000
-#define ORION_REGS_VIRT_BASE   0xfdd00000
-#define ORION_REGS_SIZE                SZ_1M
-
-#define ORION_PCIE_IO_PHYS_BASE        0xf2000000
-#define ORION_PCIE_IO_VIRT_BASE        0xfde00000
-#define ORION_PCIE_IO_BUS_BASE 0x00000000
-#define ORION_PCIE_IO_SIZE     SZ_1M
-
-#define ORION_PCI_IO_PHYS_BASE 0xf2100000
-#define ORION_PCI_IO_VIRT_BASE 0xfdf00000
-#define ORION_PCI_IO_BUS_BASE  0x00100000
-#define ORION_PCI_IO_SIZE      SZ_1M
-
-/* Relevant only for Orion-NAS */
-#define ORION_PCIE_WA_PHYS_BASE        0xf0000000
-#define ORION_PCIE_WA_VIRT_BASE        0xfe000000
-#define ORION_PCIE_WA_SIZE     SZ_16M
-
-#define ORION_PCIE_MEM_PHYS_BASE       0xe0000000
-#define ORION_PCIE_MEM_SIZE            SZ_128M
-
-#define ORION_PCI_MEM_PHYS_BASE                0xe8000000
-#define ORION_PCI_MEM_SIZE             SZ_128M
-
-/*******************************************************************************
- * Supported Devices & Revisions
- ******************************************************************************/
-/* Orion-1 (88F5181) */
-#define MV88F5181_DEV_ID       0x5181
-#define MV88F5181_REV_B1       3
-/* Orion-NAS (88F5182) */
-#define MV88F5182_DEV_ID       0x5182
-#define MV88F5182_REV_A2       2
-/* Orion-2 (88F5281) */
-#define MV88F5281_DEV_ID       0x5281
-#define MV88F5281_REV_D1       5
-#define MV88F5281_REV_D2       6
-
-/*******************************************************************************
- * Orion Registers Map
- ******************************************************************************/
-#define ORION_DDR_VIRT_BASE            (ORION_REGS_VIRT_BASE | 0x00000)
-#define ORION_DDR_REG(x)               (ORION_DDR_VIRT_BASE | (x))
-
-#define ORION_DEV_BUS_PHYS_BASE                (ORION_REGS_PHYS_BASE | 0x10000)
-#define ORION_DEV_BUS_VIRT_BASE                (ORION_REGS_VIRT_BASE | 0x10000)
-#define ORION_DEV_BUS_REG(x)           (ORION_DEV_BUS_VIRT_BASE | (x))
-#define  I2C_PHYS_BASE                 (ORION_DEV_BUS_PHYS_BASE | 0x1000)
-#define  UART0_PHYS_BASE               (ORION_DEV_BUS_PHYS_BASE | 0x2000)
-#define  UART0_VIRT_BASE               (ORION_DEV_BUS_VIRT_BASE | 0x2000)
-#define  UART1_PHYS_BASE               (ORION_DEV_BUS_PHYS_BASE | 0x2100)
-#define  UART1_VIRT_BASE               (ORION_DEV_BUS_VIRT_BASE | 0x2100)
-
-#define ORION_BRIDGE_VIRT_BASE         (ORION_REGS_VIRT_BASE | 0x20000)
-#define ORION_BRIDGE_REG(x)            (ORION_BRIDGE_VIRT_BASE | (x))
-
-#define ORION_PCI_VIRT_BASE            (ORION_REGS_VIRT_BASE | 0x30000)
-#define ORION_PCI_REG(x)               (ORION_PCI_VIRT_BASE | (x))
-
-#define ORION_PCIE_VIRT_BASE           (ORION_REGS_VIRT_BASE | 0x40000)
-#define ORION_PCIE_REG(x)              (ORION_PCIE_VIRT_BASE | (x))
-
-#define ORION_USB0_PHYS_BASE           (ORION_REGS_PHYS_BASE | 0x50000)
-#define ORION_USB0_VIRT_BASE           (ORION_REGS_VIRT_BASE | 0x50000)
-#define ORION_USB0_REG(x)              (ORION_USB0_VIRT_BASE | (x))
-
-#define ORION_ETH_PHYS_BASE            (ORION_REGS_PHYS_BASE | 0x70000)
-#define ORION_ETH_VIRT_BASE            (ORION_REGS_VIRT_BASE | 0x70000)
-#define ORION_ETH_REG(x)               (ORION_ETH_VIRT_BASE | (x))
-
-#define ORION_SATA_PHYS_BASE           (ORION_REGS_PHYS_BASE | 0x80000)
-#define ORION_SATA_VIRT_BASE           (ORION_REGS_VIRT_BASE | 0x80000)
-#define ORION_SATA_REG(x)              (ORION_SATA_VIRT_BASE | (x))
-
-#define ORION_USB1_PHYS_BASE           (ORION_REGS_PHYS_BASE | 0xa0000)
-#define ORION_USB1_VIRT_BASE           (ORION_REGS_VIRT_BASE | 0xa0000)
-#define ORION_USB1_REG(x)              (ORION_USB1_VIRT_BASE | (x))
-
-/*******************************************************************************
- * Device Bus Registers
- ******************************************************************************/
-#define MPP_0_7_CTRL           ORION_DEV_BUS_REG(0x000)
-#define MPP_8_15_CTRL          ORION_DEV_BUS_REG(0x004)
-#define MPP_16_19_CTRL         ORION_DEV_BUS_REG(0x050)
-#define MPP_DEV_CTRL           ORION_DEV_BUS_REG(0x008)
-#define MPP_RESET_SAMPLE       ORION_DEV_BUS_REG(0x010)
-#define GPIO_OUT               ORION_DEV_BUS_REG(0x100)
-#define GPIO_IO_CONF           ORION_DEV_BUS_REG(0x104)
-#define GPIO_BLINK_EN          ORION_DEV_BUS_REG(0x108)
-#define GPIO_IN_POL            ORION_DEV_BUS_REG(0x10c)
-#define GPIO_DATA_IN           ORION_DEV_BUS_REG(0x110)
-#define GPIO_EDGE_CAUSE                ORION_DEV_BUS_REG(0x114)
-#define GPIO_EDGE_MASK         ORION_DEV_BUS_REG(0x118)
-#define GPIO_LEVEL_MASK                ORION_DEV_BUS_REG(0x11c)
-#define DEV_BANK_0_PARAM       ORION_DEV_BUS_REG(0x45c)
-#define DEV_BANK_1_PARAM       ORION_DEV_BUS_REG(0x460)
-#define DEV_BANK_2_PARAM       ORION_DEV_BUS_REG(0x464)
-#define DEV_BANK_BOOT_PARAM    ORION_DEV_BUS_REG(0x46c)
-#define DEV_BUS_CTRL           ORION_DEV_BUS_REG(0x4c0)
-#define DEV_BUS_INT_CAUSE      ORION_DEV_BUS_REG(0x4d0)
-#define DEV_BUS_INT_MASK       ORION_DEV_BUS_REG(0x4d4)
-#define GPIO_MAX               32
-
-/***************************************************************************
- * Orion CPU Bridge Registers
- **************************************************************************/
-#define CPU_CONF               ORION_BRIDGE_REG(0x100)
-#define CPU_CTRL               ORION_BRIDGE_REG(0x104)
-#define CPU_RESET_MASK         ORION_BRIDGE_REG(0x108)
-#define CPU_SOFT_RESET         ORION_BRIDGE_REG(0x10c)
-#define POWER_MNG_CTRL_REG     ORION_BRIDGE_REG(0x11C)
-#define BRIDGE_CAUSE           ORION_BRIDGE_REG(0x110)
-#define BRIDGE_MASK            ORION_BRIDGE_REG(0x114)
-#define MAIN_IRQ_CAUSE         ORION_BRIDGE_REG(0x200)
-#define MAIN_IRQ_MASK          ORION_BRIDGE_REG(0x204)
-#define TIMER_CTRL             ORION_BRIDGE_REG(0x300)
-#define TIMER_VAL(x)           ORION_BRIDGE_REG(0x314 + ((x) * 8))
-#define TIMER_VAL_RELOAD(x)    ORION_BRIDGE_REG(0x310 + ((x) * 8))
-
-#ifndef __ASSEMBLY__
-
-/*******************************************************************************
- * Helpers to access Orion registers
- ******************************************************************************/
-#include <asm/types.h>
-#include <asm/io.h>
-
-#define orion_read(r)          __raw_readl(r)
-#define orion_write(r, val)    __raw_writel(val, r)
-
-/*
- * These are not preempt safe. Locks, if needed, must be taken care by caller.
- */
-#define orion_setbits(r, mask) orion_write((r), orion_read(r) | (mask))
-#define orion_clrbits(r, mask) orion_write((r), orion_read(r) & ~(mask))
-
-#endif /* __ASSEMBLY__ */
-
-#endif /* __ASM_ARCH_ORION_H__ */
diff --git a/include/asm-arm/arch-orion/timex.h b/include/asm-arm/arch-orion/timex.h
deleted file mode 100644 (file)
index 26c2c91..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-/*
- * include/asm-arm/arch-orion/timex.h
- *
- * Tzachi Perelstein <tzachi@marvell.com>
- *
- * This file is licensed under  the terms of the GNU General Public
- * License version 2. This program is licensed "as is" without any
- * warranty of any kind, whether express or implied.
- */
-
-#define ORION_TCLK             166666667
-#define CLOCK_TICK_RATE                ORION_TCLK
similarity index 73%
rename from include/asm-arm/arch-orion/debug-macro.S
rename to include/asm-arm/arch-orion5x/debug-macro.S
index 2746220f5d858ccf532f02a8f200d476450be3f0..4f98f3ba2929e59dcc427769a46ae76cf17d6cf4 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * linux/include/asm-arm/arch-orion/debug-macro.S
+ * include/asm-arm/arch-orion5x/debug-macro.S
  *
  * Debugging macro include header
  *
@@ -8,13 +8,13 @@
  * published by the Free Software Foundation.
 */
 
-#include <asm/arch/orion.h>
+#include <asm/arch/orion5x.h>
 
        .macro  addruart,rx
        mrc     p15, 0, \rx, c1, c0
        tst     \rx, #1                                 @ MMU enabled?
-       ldreq   \rx, =ORION_REGS_PHYS_BASE
-       ldrne   \rx, =ORION_REGS_VIRT_BASE
+       ldreq   \rx, =ORION5X_REGS_PHYS_BASE
+       ldrne   \rx, =ORION5X_REGS_VIRT_BASE
        orr     \rx, \rx, #0x00012000
        .endm
 
similarity index 90%
rename from include/asm-arm/arch-orion/entry-macro.S
rename to include/asm-arm/arch-orion5x/entry-macro.S
index cda096b2acfdda13221da932b82d610bb5973453..d8ef54c0ee9abdce2ee30ec2d30a866fccd35b0f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * include/asm-arm/arch-orion/entry-macro.S
+ * include/asm-arm/arch-orion5x/entry-macro.S
  *
  * Low-level IRQ helper macros for Orion platforms
  *
@@ -8,7 +8,7 @@
  * warranty of any kind, whether express or implied.
  */
 
-#include <asm/arch/orion.h>
+#include <asm/arch/orion5x.h>
 
        .macro  disable_fiq
        .endm
similarity index 79%
rename from include/asm-arm/arch-orion/gpio.h
rename to include/asm-arm/arch-orion5x/gpio.h
index d66284f9a14c10a90c1e89856b19b1057795c82c..c85e498388b60c1b8ed201c6fa4534ea2eb41ccf 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * include/asm-arm/arch-orion/gpio.h
+ * include/asm-arm/arch-orion5x/gpio.h
  *
  * This file is licensed under the terms of the GNU General Public
  * License version 2. This program is licensed "as is" without any
@@ -12,17 +12,17 @@ extern int gpio_direction_input(unsigned pin);
 extern int gpio_direction_output(unsigned pin, int value);
 extern int gpio_get_value(unsigned pin);
 extern void gpio_set_value(unsigned pin, int value);
-extern void orion_gpio_set_blink(unsigned pin, int blink);
+extern void orion5x_gpio_set_blink(unsigned pin, int blink);
 extern void gpio_display(void);                /* debug */
 
 static inline int gpio_to_irq(int pin)
 {
-       return pin + IRQ_ORION_GPIO_START;
+       return pin + IRQ_ORION5X_GPIO_START;
 }
 
 static inline int irq_to_gpio(int irq)
 {
-       return irq - IRQ_ORION_GPIO_START;
+       return irq - IRQ_ORION5X_GPIO_START;
 }
 
 #include <asm-generic/gpio.h>          /* cansleep wrappers */
similarity index 64%
rename from include/asm-arm/arch-orion/hardware.h
rename to include/asm-arm/arch-orion5x/hardware.h
index 65da374de73555e65da10f50e241198a4a973ba7..5d2d8e0b5630c8d3852598402569ef8768ff1d12 100644 (file)
@@ -1,21 +1,21 @@
 /*
- * include/asm-arm/arch-orion/hardware.h
+ * include/asm-arm/arch-orion5x/hardware.h
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
  */
 
-#ifndef __ASM_ARCH_HARDWARE_H__
-#define __ASM_ARCH_HARDWARE_H__
+#ifndef __ASM_ARCH_HARDWARE_H
+#define __ASM_ARCH_HARDWARE_H
 
-#include "orion.h"
+#include "orion5x.h"
 
 #define pcibios_assign_all_busses()    1
 
 #define PCIBIOS_MIN_IO         0x00001000
 #define PCIBIOS_MIN_MEM                0x01000000
-#define PCIMEM_BASE            ORION_PCIE_MEM_PHYS_BASE
+#define PCIMEM_BASE            ORION5X_PCIE_MEM_PHYS_BASE
 
 
 #endif
diff --git a/include/asm-arm/arch-orion5x/io.h b/include/asm-arm/arch-orion5x/io.h
new file mode 100644 (file)
index 0000000..5148ab7
--- /dev/null
@@ -0,0 +1,68 @@
+/*
+ * include/asm-arm/arch-orion5x/io.h
+ *
+ * Tzachi Perelstein <tzachi@marvell.com>
+ *
+ * This file is licensed under the terms of the GNU General Public
+ * License version 2.  This program is licensed "as is" without any
+ * warranty of any kind, whether express or implied.
+ */
+
+#ifndef __ASM_ARCH_IO_H
+#define __ASM_ARCH_IO_H
+
+#include "orion5x.h"
+
+#define IO_SPACE_LIMIT         0xffffffff
+#define IO_SPACE_REMAP         ORION5X_PCI_SYS_IO_BASE
+
+static inline void __iomem *
+__arch_ioremap(unsigned long paddr, size_t size, unsigned int mtype)
+{
+       void __iomem *retval;
+
+       if (mtype == MT_DEVICE && size && paddr >= ORION5X_REGS_PHYS_BASE &&
+           paddr + size <= ORION5X_REGS_PHYS_BASE + ORION5X_REGS_SIZE) {
+               retval = (void __iomem *)ORION5X_REGS_VIRT_BASE +
+                               (paddr - ORION5X_REGS_PHYS_BASE);
+       } else {
+               retval = __arm_ioremap(paddr, size, mtype);
+       }
+
+       return retval;
+}
+
+static inline void
+__arch_iounmap(void __iomem *addr)
+{
+       if (addr < (void __iomem *)ORION5X_REGS_VIRT_BASE ||
+           addr >= (void __iomem *)(ORION5X_REGS_VIRT_BASE + ORION5X_REGS_SIZE))
+               __iounmap(addr);
+}
+
+static inline void __iomem *__io(unsigned long addr)
+{
+       return (void __iomem *)addr;
+}
+
+#define __arch_ioremap(p, s, m)        __arch_ioremap(p, s, m)
+#define __arch_iounmap(a)      __arch_iounmap(a)
+#define __io(a)                        __io(a)
+#define __mem_pci(a)           (a)
+
+
+/*****************************************************************************
+ * Helpers to access Orion registers
+ ****************************************************************************/
+#define orion5x_read(r)                __raw_readl(r)
+#define orion5x_write(r, val)  __raw_writel(val, r)
+
+/*
+ * These are not preempt-safe.  Locks, if needed, must be taken
+ * care of by the caller.
+ */
+#define orion5x_setbits(r, mask)       orion5x_write((r), orion5x_read(r) | (mask))
+#define orion5x_clrbits(r, mask)       orion5x_write((r), orion5x_read(r) & ~(mask))
+
+
+#endif
diff --git a/include/asm-arm/arch-orion5x/irqs.h b/include/asm-arm/arch-orion5x/irqs.h
new file mode 100644 (file)
index 0000000..abdd61a
--- /dev/null
@@ -0,0 +1,62 @@
+/*
+ * include/asm-arm/arch-orion5x/irqs.h
+ *
+ * IRQ definitions for Orion SoC
+ *
+ *  Maintainer: Tzachi Perelstein <tzachi@marvell.com>
+ *
+ *  This file is licensed under the terms of the GNU General Public
+ *  License version 2. This program is licensed "as is" without any
+ *  warranty of any kind, whether express or implied.
+ */
+
+#ifndef __ASM_ARCH_IRQS_H
+#define __ASM_ARCH_IRQS_H
+
+#include "orion5x.h"   /* need GPIO_MAX */
+
+/*
+ * Orion Main Interrupt Controller
+ */
+#define IRQ_ORION5X_BRIDGE             0
+#define IRQ_ORION5X_DOORBELL_H2C       1
+#define IRQ_ORION5X_DOORBELL_C2H       2
+#define IRQ_ORION5X_UART0              3
+#define IRQ_ORION5X_UART1              4
+#define IRQ_ORION5X_I2C                        5
+#define IRQ_ORION5X_GPIO_0_7           6
+#define IRQ_ORION5X_GPIO_8_15          7
+#define IRQ_ORION5X_GPIO_16_23         8
+#define IRQ_ORION5X_GPIO_24_31         9
+#define IRQ_ORION5X_PCIE0_ERR          10
+#define IRQ_ORION5X_PCIE0_INT          11
+#define IRQ_ORION5X_USB1_CTRL          12
+#define IRQ_ORION5X_DEV_BUS_ERR                14
+#define IRQ_ORION5X_PCI_ERR            15
+#define IRQ_ORION5X_USB_BR_ERR         16
+#define IRQ_ORION5X_USB0_CTRL          17
+#define IRQ_ORION5X_ETH_RX             18
+#define IRQ_ORION5X_ETH_TX             19
+#define IRQ_ORION5X_ETH_MISC           20
+#define IRQ_ORION5X_ETH_SUM            21
+#define IRQ_ORION5X_ETH_ERR            22
+#define IRQ_ORION5X_IDMA_ERR           23
+#define IRQ_ORION5X_IDMA_0             24
+#define IRQ_ORION5X_IDMA_1             25
+#define IRQ_ORION5X_IDMA_2             26
+#define IRQ_ORION5X_IDMA_3             27
+#define IRQ_ORION5X_CESA               28
+#define IRQ_ORION5X_SATA               29
+#define IRQ_ORION5X_XOR0               30
+#define IRQ_ORION5X_XOR1               31
+
+/*
+ * Orion General Purpose Pins
+ */
+#define IRQ_ORION5X_GPIO_START 32
+#define NR_GPIO_IRQS           GPIO_MAX
+
+#define NR_IRQS                        (IRQ_ORION5X_GPIO_START + NR_GPIO_IRQS)
+
+
+#endif
similarity index 64%
rename from include/asm-arm/arch-orion/memory.h
rename to include/asm-arm/arch-orion5x/memory.h
index d954dba87ced8f1d6d497546f3a720d98614c984..80053a7afc7abd9418b221ae25dbd6c178f66b03 100644 (file)
@@ -1,15 +1,16 @@
 /*
- * include/asm-arm/arch-orion/memory.h
+ * include/asm-arm/arch-orion5x/memory.h
  *
  * Marvell Orion memory definitions
  */
 
-#ifndef __ASM_ARCH_MMU_H
-#define __ASM_ARCH_MMU_H
+#ifndef __ASM_ARCH_MEMORY_H
+#define __ASM_ARCH_MEMORY_H
 
 #define PHYS_OFFSET    UL(0x00000000)
 
 #define __virt_to_bus(x)       __virt_to_phys(x)
 #define __bus_to_virt(x)       __phys_to_virt(x)
 
+
 #endif
diff --git a/include/asm-arm/arch-orion5x/orion5x.h b/include/asm-arm/arch-orion5x/orion5x.h
new file mode 100644 (file)
index 0000000..206ddd7
--- /dev/null
@@ -0,0 +1,159 @@
+/*
+ * include/asm-arm/arch-orion5x/orion5x.h
+ *
+ * Generic definitions of Orion SoC flavors:
+ *  Orion-1, Orion-NAS, Orion-VoIP, and Orion-2.
+ *
+ * Maintainer: Tzachi Perelstein <tzachi@marvell.com>
+ *
+ * This file is licensed under the terms of the GNU General Public
+ * License version 2. This program is licensed "as is" without any
+ * warranty of any kind, whether express or implied.
+ */
+
+#ifndef __ASM_ARCH_ORION5X_H
+#define __ASM_ARCH_ORION5X_H
+
+/*****************************************************************************
+ * Orion Address Maps
+ *
+ * phys
+ * e0000000    PCIe MEM space
+ * e8000000    PCI MEM space
+ * f0000000    PCIe WA space (Orion-1/Orion-NAS only)
+ * f1000000    on-chip peripheral registers
+ * f2000000    PCIe I/O space
+ * f2100000    PCI I/O space
+ * f4000000    device bus mappings (boot)
+ * fa000000    device bus mappings (cs0)
+ * fa800000    device bus mappings (cs2)
+ * fc000000    device bus mappings (cs0/cs1)
+ *
+ * virt                phys            size
+ * fdd00000    f1000000        1M      on-chip peripheral registers
+ * fde00000    f2000000        1M      PCIe I/O space
+ * fdf00000    f2100000        1M      PCI I/O space
+ * fe000000    f0000000        16M     PCIe WA space (Orion-1/Orion-NAS only)
+ ****************************************************************************/
+#define ORION5X_REGS_PHYS_BASE         0xf1000000
+#define ORION5X_REGS_VIRT_BASE         0xfdd00000
+#define ORION5X_REGS_SIZE              SZ_1M
+
+#define ORION5X_PCIE_IO_PHYS_BASE      0xf2000000
+#define ORION5X_PCIE_IO_VIRT_BASE      0xfde00000
+#define ORION5X_PCIE_IO_BUS_BASE       0x00000000
+#define ORION5X_PCIE_IO_SIZE           SZ_1M
+
+#define ORION5X_PCI_IO_PHYS_BASE       0xf2100000
+#define ORION5X_PCI_IO_VIRT_BASE       0xfdf00000
+#define ORION5X_PCI_IO_BUS_BASE                0x00100000
+#define ORION5X_PCI_IO_SIZE            SZ_1M
+
+/* Relevant only for Orion-1/Orion-NAS */
+#define ORION5X_PCIE_WA_PHYS_BASE      0xf0000000
+#define ORION5X_PCIE_WA_VIRT_BASE      0xfe000000
+#define ORION5X_PCIE_WA_SIZE           SZ_16M
+
+#define ORION5X_PCIE_MEM_PHYS_BASE     0xe0000000
+#define ORION5X_PCIE_MEM_SIZE          SZ_128M
+
+#define ORION5X_PCI_MEM_PHYS_BASE      0xe8000000
+#define ORION5X_PCI_MEM_SIZE           SZ_128M
+
+/*******************************************************************************
+ * Supported Devices & Revisions
+ ******************************************************************************/
+/* Orion-1 (88F5181) */
+#define MV88F5181_DEV_ID       0x5181
+#define MV88F5181_REV_B1       3
+/* Orion-NAS (88F5182) */
+#define MV88F5182_DEV_ID       0x5182
+#define MV88F5182_REV_A2       2
+/* Orion-2 (88F5281) */
+#define MV88F5281_DEV_ID       0x5281
+#define MV88F5281_REV_D1       5
+#define MV88F5281_REV_D2       6
+
+/*******************************************************************************
+ * Orion Registers Map
+ ******************************************************************************/
+#define ORION5X_DDR_VIRT_BASE          (ORION5X_REGS_VIRT_BASE | 0x00000)
+#define ORION5X_DDR_REG(x)             (ORION5X_DDR_VIRT_BASE | (x))
+
+#define ORION5X_DEV_BUS_PHYS_BASE      (ORION5X_REGS_PHYS_BASE | 0x10000)
+#define ORION5X_DEV_BUS_VIRT_BASE      (ORION5X_REGS_VIRT_BASE | 0x10000)
+#define ORION5X_DEV_BUS_REG(x)         (ORION5X_DEV_BUS_VIRT_BASE | (x))
+#define  I2C_PHYS_BASE                 (ORION5X_DEV_BUS_PHYS_BASE | 0x1000)
+#define  UART0_PHYS_BASE               (ORION5X_DEV_BUS_PHYS_BASE | 0x2000)
+#define  UART0_VIRT_BASE               (ORION5X_DEV_BUS_VIRT_BASE | 0x2000)
+#define  UART1_PHYS_BASE               (ORION5X_DEV_BUS_PHYS_BASE | 0x2100)
+#define  UART1_VIRT_BASE               (ORION5X_DEV_BUS_VIRT_BASE | 0x2100)
+
+#define ORION5X_BRIDGE_VIRT_BASE       (ORION5X_REGS_VIRT_BASE | 0x20000)
+#define ORION5X_BRIDGE_REG(x)          (ORION5X_BRIDGE_VIRT_BASE | (x))
+#define  TIMER_VIRT_BASE               (ORION5X_BRIDGE_VIRT_BASE | 0x300)
+
+#define ORION5X_PCI_VIRT_BASE          (ORION5X_REGS_VIRT_BASE | 0x30000)
+#define ORION5X_PCI_REG(x)             (ORION5X_PCI_VIRT_BASE | (x))
+
+#define ORION5X_PCIE_VIRT_BASE         (ORION5X_REGS_VIRT_BASE | 0x40000)
+#define ORION5X_PCIE_REG(x)            (ORION5X_PCIE_VIRT_BASE | (x))
+
+#define ORION5X_USB0_PHYS_BASE         (ORION5X_REGS_PHYS_BASE | 0x50000)
+#define ORION5X_USB0_VIRT_BASE         (ORION5X_REGS_VIRT_BASE | 0x50000)
+#define ORION5X_USB0_REG(x)            (ORION5X_USB0_VIRT_BASE | (x))
+
+#define ORION5X_ETH_PHYS_BASE          (ORION5X_REGS_PHYS_BASE | 0x70000)
+#define ORION5X_ETH_VIRT_BASE          (ORION5X_REGS_VIRT_BASE | 0x70000)
+#define ORION5X_ETH_REG(x)             (ORION5X_ETH_VIRT_BASE | (x))
+
+#define ORION5X_SATA_PHYS_BASE         (ORION5X_REGS_PHYS_BASE | 0x80000)
+#define ORION5X_SATA_VIRT_BASE         (ORION5X_REGS_VIRT_BASE | 0x80000)
+#define ORION5X_SATA_REG(x)            (ORION5X_SATA_VIRT_BASE | (x))
+
+#define ORION5X_USB1_PHYS_BASE         (ORION5X_REGS_PHYS_BASE | 0xa0000)
+#define ORION5X_USB1_VIRT_BASE         (ORION5X_REGS_VIRT_BASE | 0xa0000)
+#define ORION5X_USB1_REG(x)            (ORION5X_USB1_VIRT_BASE | (x))
+
+/*******************************************************************************
+ * Device Bus Registers
+ ******************************************************************************/
+#define MPP_0_7_CTRL           ORION5X_DEV_BUS_REG(0x000)
+#define MPP_8_15_CTRL          ORION5X_DEV_BUS_REG(0x004)
+#define MPP_16_19_CTRL         ORION5X_DEV_BUS_REG(0x050)
+#define MPP_DEV_CTRL           ORION5X_DEV_BUS_REG(0x008)
+#define MPP_RESET_SAMPLE       ORION5X_DEV_BUS_REG(0x010)
+#define GPIO_OUT               ORION5X_DEV_BUS_REG(0x100)
+#define GPIO_IO_CONF           ORION5X_DEV_BUS_REG(0x104)
+#define GPIO_BLINK_EN          ORION5X_DEV_BUS_REG(0x108)
+#define GPIO_IN_POL            ORION5X_DEV_BUS_REG(0x10c)
+#define GPIO_DATA_IN           ORION5X_DEV_BUS_REG(0x110)
+#define GPIO_EDGE_CAUSE                ORION5X_DEV_BUS_REG(0x114)
+#define GPIO_EDGE_MASK         ORION5X_DEV_BUS_REG(0x118)
+#define GPIO_LEVEL_MASK                ORION5X_DEV_BUS_REG(0x11c)
+#define DEV_BANK_0_PARAM       ORION5X_DEV_BUS_REG(0x45c)
+#define DEV_BANK_1_PARAM       ORION5X_DEV_BUS_REG(0x460)
+#define DEV_BANK_2_PARAM       ORION5X_DEV_BUS_REG(0x464)
+#define DEV_BANK_BOOT_PARAM    ORION5X_DEV_BUS_REG(0x46c)
+#define DEV_BUS_CTRL           ORION5X_DEV_BUS_REG(0x4c0)
+#define DEV_BUS_INT_CAUSE      ORION5X_DEV_BUS_REG(0x4d0)
+#define DEV_BUS_INT_MASK       ORION5X_DEV_BUS_REG(0x4d4)
+#define GPIO_MAX               32
+
+/***************************************************************************
+ * Orion CPU Bridge Registers
+ **************************************************************************/
+#define CPU_CONF               ORION5X_BRIDGE_REG(0x100)
+#define CPU_CTRL               ORION5X_BRIDGE_REG(0x104)
+#define CPU_RESET_MASK         ORION5X_BRIDGE_REG(0x108)
+#define CPU_SOFT_RESET         ORION5X_BRIDGE_REG(0x10c)
+#define POWER_MNG_CTRL_REG     ORION5X_BRIDGE_REG(0x11C)
+#define BRIDGE_CAUSE           ORION5X_BRIDGE_REG(0x110)
+#define BRIDGE_MASK            ORION5X_BRIDGE_REG(0x114)
+#define  BRIDGE_INT_TIMER0     0x0002
+#define  BRIDGE_INT_TIMER1     0x0004
+#define MAIN_IRQ_CAUSE         ORION5X_BRIDGE_REG(0x200)
+#define MAIN_IRQ_MASK          ORION5X_BRIDGE_REG(0x204)
+
+
+#endif
similarity index 54%
rename from include/asm-arm/arch-orion/system.h
rename to include/asm-arm/arch-orion5x/system.h
index 17704c68f90ed7469d790a2743f730af60d3e5a3..3f1d1e2d38f8ae53ae88396e59ddde35f2f193f1 100644 (file)
@@ -1,10 +1,10 @@
 /*
- * include/asm-arm/arch-orion/system.h
+ * include/asm-arm/arch-orion5x/system.h
  *
  * Tzachi Perelstein <tzachi@marvell.com>
  *
- * This file is licensed under  the terms of the GNU General Public
- * License version 2. This program is licensed "as is" without any
+ * This file is licensed under the terms of the GNU General Public
+ * License version 2.  This program is licensed "as is" without any
  * warranty of any kind, whether express or implied.
  */
 
@@ -12,7 +12,7 @@
 #define __ASM_ARCH_SYSTEM_H
 
 #include <asm/arch/hardware.h>
-#include <asm/arch/orion.h>
+#include <asm/arch/orion5x.h>
 
 static inline void arch_idle(void)
 {
@@ -24,8 +24,9 @@ static inline void arch_reset(char mode)
        /*
         * Enable and issue soft reset
         */
-       orion_setbits(CPU_RESET_MASK, (1 << 2));
-       orion_setbits(CPU_SOFT_RESET, 1);
+       orion5x_setbits(CPU_RESET_MASK, (1 << 2));
+       orion5x_setbits(CPU_SOFT_RESET, 1);
 }
 
+
 #endif
diff --git a/include/asm-arm/arch-orion5x/timex.h b/include/asm-arm/arch-orion5x/timex.h
new file mode 100644 (file)
index 0000000..31c568e
--- /dev/null
@@ -0,0 +1,13 @@
+/*
+ * include/asm-arm/arch-orion5x/timex.h
+ *
+ * Tzachi Perelstein <tzachi@marvell.com>
+ *
+ * This file is licensed under the terms of the GNU General Public
+ * License version 2.  This program is licensed "as is" without any
+ * warranty of any kind, whether express or implied.
+ */
+
+#define CLOCK_TICK_RATE                (100 * HZ)
+
+#define ORION5X_TCLK           166666667
similarity index 71%
rename from include/asm-arm/arch-orion/uncompress.h
rename to include/asm-arm/arch-orion5x/uncompress.h
index 59f44039909a9b40e113d7fc55bba23c8eb997be..5c13d4fafb4e95c550eebcd42b69c2e063555f2e 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * include/asm-arm/arch-orion/uncompress.h
+ * include/asm-arm/arch-orion5x/uncompress.h
  *
  * Tzachi Perelstein <tzachi@marvell.com>
  *
- * This file is licensed under  the terms of the GNU General Public
- * License version 2. This program is licensed "as is" without any
+ * This file is licensed under the terms of the GNU General Public
+ * License version 2.  This program is licensed "as is" without any
  * warranty of any kind, whether express or implied.
  */
 
-#include <asm/arch/orion.h>
+#include <asm/arch/orion5x.h>
 
 #define MV_UART_THR    ((volatile unsigned char *)(UART0_PHYS_BASE + 0x0))
 #define MV_UART_LSR    ((volatile unsigned char *)(UART0_PHYS_BASE + 0x14))
similarity index 51%
rename from include/asm-arm/arch-orion/vmalloc.h
rename to include/asm-arm/arch-orion5x/vmalloc.h
index 9d580278d2bc2517c11ab2f13faab0715de8b406..2b3061e90dc125bf1d360bc63a58eb77a7397d1c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * include/asm-arm/arch-orion/vmalloc.h
+ * include/asm-arm/arch-orion5x/vmalloc.h
  */
 
 #define VMALLOC_END       0xfd800000
diff --git a/include/asm-arm/arch-pxa/camera.h b/include/asm-arm/arch-pxa/camera.h
new file mode 100644 (file)
index 0000000..39516ce
--- /dev/null
@@ -0,0 +1,48 @@
+/*
+    camera.h - PXA camera driver header file
+
+    Copyright (C) 2003, Intel Corporation
+    Copyright (C) 2008, Guennadi Liakhovetski <kernel@pengutronix.de>
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+*/
+
+#ifndef __ASM_ARCH_CAMERA_H_
+#define __ASM_ARCH_CAMERA_H_
+
+#define PXA_CAMERA_MASTER      1
+#define PXA_CAMERA_DATAWIDTH_4 2
+#define PXA_CAMERA_DATAWIDTH_5 4
+#define PXA_CAMERA_DATAWIDTH_8 8
+#define PXA_CAMERA_DATAWIDTH_9 0x10
+#define PXA_CAMERA_DATAWIDTH_10        0x20
+#define PXA_CAMERA_PCLK_EN     0x40
+#define PXA_CAMERA_MCLK_EN     0x80
+#define PXA_CAMERA_PCP         0x100
+#define PXA_CAMERA_HSP         0x200
+#define PXA_CAMERA_VSP         0x400
+
+struct pxacamera_platform_data {
+       int (*init)(struct device *);
+       int (*power)(struct device *, int);
+       int (*reset)(struct device *, int);
+
+       unsigned long flags;
+       unsigned long mclk_10khz;
+};
+
+extern void pxa_set_camera_info(struct pxacamera_platform_data *);
+
+#endif /* __ASM_ARCH_CAMERA_H_ */
diff --git a/include/asm-arm/arch-pxa/gumstix.h b/include/asm-arm/arch-pxa/gumstix.h
new file mode 100644 (file)
index 0000000..6fa85c4
--- /dev/null
@@ -0,0 +1,96 @@
+/*
+ *  linux/include/asm-arm/arch-pxa/gumstix.h
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+
+/* BTRESET - Reset line to Bluetooth module, active low signal. */
+#define GPIO_GUMSTIX_BTRESET          7
+#define GPIO_GUMSTIX_BTRESET_MD                (GPIO_GUMSTIX_BTRESET | GPIO_OUT)
+
+
+/*
+GPIOn - Input from MAX823 (or equiv), normalizing USB +5V into a clean
+interrupt signal for determining cable presence. On the original gumstix,
+this is GPIO81, and GPIO83 needs to be defined as well. On the gumstix F,
+this moves to GPIO17 and GPIO37. */
+
+/* GPIOx - Connects to USB D+ and used as a pull-up after GPIOn
+has detected a cable insertion; driven low otherwise. */
+
+#ifdef CONFIG_ARCH_GUMSTIX_ORIG
+
+#define GPIO_GUMSTIX_USB_GPIOn         81
+#define GPIO_GUMSTIX_USB_GPIOx         83
+
+#else
+
+#define GPIO_GUMSTIX_USB_GPIOn         35
+#define GPIO_GUMSTIX_USB_GPIOx         41
+
+#endif
+
+/* usb state change */
+#define GUMSTIX_USB_INTR_IRQ           IRQ_GPIO(GPIO_GUMSTIX_USB_GPIOn)
+
+#define GPIO_GUMSTIX_USB_GPIOn_MD      (GPIO_GUMSTIX_USB_GPIOn | GPIO_IN)
+#define GPIO_GUMSTIX_USB_GPIOx_CON_MD  (GPIO_GUMSTIX_USB_GPIOx | GPIO_OUT)
+#define GPIO_GUMSTIX_USB_GPIOx_DIS_MD  (GPIO_GUMSTIX_USB_GPIOx | GPIO_IN)
+
+/*
+ * SD/MMC definitions
+ */
+#define GUMSTIX_GPIO_nSD_WP            22 /* SD Write Protect */
+#define GUMSTIX_GPIO_nSD_DETECT                11 /* MMC/SD Card Detect */
+#define GUMSTIX_IRQ_GPIO_nSD_DETECT    IRQ_GPIO(GUMSTIX_GPIO_nSD_DETECT)
+
+/*
+ * SMC Ethernet definitions
+ * ETH_RST provides a hardware reset line to the ethernet chip
+ * ETH is the IRQ line in from the ethernet chip to the PXA
+ */
+#define GPIO_GUMSTIX_ETH0_RST          80
+#define GPIO_GUMSTIX_ETH0_RST_MD       (GPIO_GUMSTIX_ETH0_RST | GPIO_OUT)
+#define GPIO_GUMSTIX_ETH1_RST          52
+#define GPIO_GUMSTIX_ETH1_RST_MD       (GPIO_GUMSTIX_ETH1_RST | GPIO_OUT)
+
+#define GPIO_GUMSTIX_ETH0              36
+#define GPIO_GUMSTIX_ETH0_MD           (GPIO_GUMSTIX_ETH0 | GPIO_IN)
+#define GUMSTIX_ETH0_IRQ               IRQ_GPIO(GPIO_GUMSTIX_ETH0)
+#define GPIO_GUMSTIX_ETH1              27
+#define GPIO_GUMSTIX_ETH1_MD           (GPIO_GUMSTIX_ETH1 | GPIO_IN)
+#define GUMSTIX_ETH1_IRQ               IRQ_GPIO(GPIO_GUMSTIX_ETH1)
+
+
+/* CF reset line */
+#define GPIO8_RESET                    8
+
+/* CF slot 0 */
+#define GPIO4_nBVD1                    4
+#define GPIO4_nSTSCHG                  GPIO4_nBVD1
+#define GPIO11_nCD                     11
+#define GPIO26_PRDY_nBSY               26
+#define GUMSTIX_S0_nSTSCHG_IRQ         IRQ_GPIO(GPIO4_nSTSCHG)
+#define GUMSTIX_S0_nCD_IRQ             IRQ_GPIO(GPIO11_nCD)
+#define GUMSTIX_S0_PRDY_nBSY_IRQ       IRQ_GPIO(GPIO26_PRDY_nBSY)
+
+/* CF slot 1 */
+#define GPIO18_nBVD1                   18
+#define GPIO18_nSTSCHG                 GPIO18_nBVD1
+#define GPIO36_nCD                     36
+#define GPIO27_PRDY_nBSY               27
+#define GUMSTIX_S1_nSTSCHG_IRQ         IRQ_GPIO(GPIO18_nSTSCHG)
+#define GUMSTIX_S1_nCD_IRQ             IRQ_GPIO(GPIO36_nCD)
+#define GUMSTIX_S1_PRDY_nBSY_IRQ       IRQ_GPIO(GPIO27_PRDY_nBSY)
+
+/* CF GPIO line modes */
+#define GPIO4_nSTSCHG_MD               (GPIO4_nSTSCHG | GPIO_IN)
+#define GPIO8_RESET_MD                 (GPIO8_RESET | GPIO_OUT)
+#define GPIO11_nCD_MD                  (GPIO11_nCD | GPIO_IN)
+#define GPIO18_nSTSCHG_MD              (GPIO18_nSTSCHG | GPIO_IN)
+#define GPIO26_PRDY_nBSY_MD            (GPIO26_PRDY_nBSY | GPIO_IN)
+#define GPIO27_PRDY_nBSY_MD            (GPIO27_PRDY_nBSY | GPIO_IN)
+#define GPIO36_nCD_MD                  (GPIO36_nCD | GPIO_IN)
index 748406f384c2fd4c94ab6bfc06029ee52ea01e78..99f4f423a8e1bc3e6d3537dd64a47337dd76cfd8 100644 (file)
@@ -10,6 +10,8 @@
 struct pxaficp_platform_data {
        int transceiver_cap;
        void (*transceiver_mode)(struct device *dev, int mode);
+       int (*startup)(struct device *dev);
+       void (*shutdown)(struct device *dev);
 };
 
 extern void pxa_set_ficp_info(struct pxaficp_platform_data *info);
index c562b972a4a69c00f4f567cfef7029f0cc15892a..50c77eacbd5e435526ff36d1a5027181cfe19672 100644 (file)
 #elif defined(CONFIG_ARCH_LUBBOCK) || \
       defined(CONFIG_MACH_LOGICPD_PXA270) || \
       defined(CONFIG_MACH_MAINSTONE) || \
-      defined(CONFIG_MACH_PCM027)
+      defined(CONFIG_MACH_PCM027) || \
+      defined(CONFIG_MACH_MAGICIAN)
 #define NR_IRQS                        (IRQ_BOARD_END)
 #else
 #define NR_IRQS                        (IRQ_BOARD_START)
index 337f51f06b3ab3887205ae668b3cec30e340834c..b34fd5683e2d20876805e6b7abe25a8708babced 100644 (file)
@@ -12,7 +12,8 @@
 #ifndef _MAGICIAN_H_
 #define _MAGICIAN_H_
 
-#include <asm/arch/pxa-regs.h>
+#include <asm/arch/irqs.h>
+#include <asm/arch/pxa2xx-gpio.h>
 
 /*
  * PXA GPIOs
@@ -34,6 +35,7 @@
 #define GPIO48_MAGICIAN_UNKNOWN                        48
 #define GPIO56_MAGICIAN_UNKNOWN                        56
 #define GPIO57_MAGICIAN_CAM_RESET              57
+#define GPIO75_MAGICIAN_SAMSUNG_POWER          75
 #define GPIO83_MAGICIAN_nIR_EN                 83
 #define GPIO86_MAGICIAN_GSM_RESET              86
 #define GPIO87_MAGICIAN_GSM_SELECT             87
@@ -81,6 +83,7 @@
 #define GPIO48_MAGICIAN_UNKNOWN_MD             (48 | GPIO_OUT)
 #define GPIO56_MAGICIAN_UNKNOWN_MD             (56 | GPIO_OUT)
 #define GPIO57_MAGICIAN_CAM_RESET_MD           (57 | GPIO_OUT)
+#define GPIO75_MAGICIAN_SAMSUNG_POWER_MD       (75 | GPIO_OUT)
 #define GPIO83_MAGICIAN_nIR_EN_MD              (83 | GPIO_OUT)
 #define GPIO86_MAGICIAN_GSM_RESET_MD           (86 | GPIO_OUT)
 #define GPIO87_MAGICIAN_GSM_SELECT_MD          (87 | GPIO_OUT)
 #define GPIO119_MAGICIAN_UNKNOWN_MD            (119 | GPIO_OUT)
 #define GPIO120_MAGICIAN_UNKNOWN_MD            (120 | GPIO_OUT)
 
+/*
+ * CPLD IRQs
+ */
+
+#define IRQ_MAGICIAN_SD                (IRQ_BOARD_START + 0)
+#define IRQ_MAGICIAN_EP                (IRQ_BOARD_START + 1)
+#define IRQ_MAGICIAN_BT                (IRQ_BOARD_START + 2)
+#define IRQ_MAGICIAN_AC                (IRQ_BOARD_START + 3)
+
+/*
+ * CPLD EGPIOs
+ */
+
+#define MAGICIAN_EGPIO_BASE                    0x80 /* GPIO_BOARD_START */
+#define MAGICIAN_EGPIO(reg,bit) \
+       (MAGICIAN_EGPIO_BASE + 8*reg + bit)
+
+/* output */
+
+#define EGPIO_MAGICIAN_TOPPOLY_POWER           MAGICIAN_EGPIO(0, 2)
+#define EGPIO_MAGICIAN_LED_POWER               MAGICIAN_EGPIO(0, 5)
+#define EGPIO_MAGICIAN_GSM_RESET               MAGICIAN_EGPIO(0, 6)
+#define EGPIO_MAGICIAN_LCD_POWER               MAGICIAN_EGPIO(0, 7)
+#define EGPIO_MAGICIAN_SPK_POWER               MAGICIAN_EGPIO(1, 0)
+#define EGPIO_MAGICIAN_EP_POWER                        MAGICIAN_EGPIO(1, 1)
+#define EGPIO_MAGICIAN_IN_SEL0                 MAGICIAN_EGPIO(1, 2)
+#define EGPIO_MAGICIAN_IN_SEL1                 MAGICIAN_EGPIO(1, 3)
+#define EGPIO_MAGICIAN_MIC_POWER               MAGICIAN_EGPIO(1, 4)
+#define EGPIO_MAGICIAN_CODEC_RESET             MAGICIAN_EGPIO(1, 5)
+#define EGPIO_MAGICIAN_CODEC_POWER             MAGICIAN_EGPIO(1, 6)
+#define EGPIO_MAGICIAN_BL_POWER                        MAGICIAN_EGPIO(1, 7)
+#define EGPIO_MAGICIAN_SD_POWER                        MAGICIAN_EGPIO(2, 0)
+#define EGPIO_MAGICIAN_CARKIT_MIC              MAGICIAN_EGPIO(2, 1)
+#define EGPIO_MAGICIAN_UNKNOWN_WAVEDEV_DLL     MAGICIAN_EGPIO(2, 2)
+#define EGPIO_MAGICIAN_FLASH_VPP               MAGICIAN_EGPIO(2, 3)
+#define EGPIO_MAGICIAN_BL_POWER2               MAGICIAN_EGPIO(2, 4)
+#define EGPIO_MAGICIAN_CHARGE_EN               MAGICIAN_EGPIO(2, 5)
+#define EGPIO_MAGICIAN_GSM_POWER               MAGICIAN_EGPIO(2, 7)
+
+/* input */
+
+#define EGPIO_MAGICIAN_CABLE_STATE_AC          MAGICIAN_EGPIO(4, 0)
+#define EGPIO_MAGICIAN_CABLE_STATE_USB         MAGICIAN_EGPIO(4, 1)
+
+#define EGPIO_MAGICIAN_BOARD_ID0               MAGICIAN_EGPIO(5, 0)
+#define EGPIO_MAGICIAN_BOARD_ID1               MAGICIAN_EGPIO(5, 1)
+#define EGPIO_MAGICIAN_BOARD_ID2               MAGICIAN_EGPIO(5, 2)
+#define EGPIO_MAGICIAN_LCD_SELECT              MAGICIAN_EGPIO(5, 3)
+#define EGPIO_MAGICIAN_nSD_READONLY            MAGICIAN_EGPIO(5, 4)
+
+#define EGPIO_MAGICIAN_EP_INSERT               MAGICIAN_EGPIO(6, 1)
+
 #endif /* _MAGICIAN_H_ */
diff --git a/include/asm-arm/arch-pxa/mfp-pxa25x.h b/include/asm-arm/arch-pxa/mfp-pxa25x.h
new file mode 100644 (file)
index 0000000..0499323
--- /dev/null
@@ -0,0 +1,161 @@
+#ifndef __ASM_ARCH_MFP_PXA25X_H
+#define __ASM_ARCH_MFP_PXA25X_H
+
+#include <asm/arch/mfp.h>
+#include <asm/arch/mfp-pxa2xx.h>
+
+/* GPIO */
+#define GPIO2_GPIO             MFP_CFG_IN(GPIO2, AF0)
+#define GPIO3_GPIO             MFP_CFG_IN(GPIO3, AF0)
+#define GPIO4_GPIO             MFP_CFG_IN(GPIO4, AF0)
+#define GPIO5_GPIO             MFP_CFG_IN(GPIO5, AF0)
+#define GPIO6_GPIO             MFP_CFG_IN(GPIO6, AF0)
+#define GPIO7_GPIO             MFP_CFG_IN(GPIO7, AF0)
+#define GPIO8_GPIO             MFP_CFG_IN(GPIO8, AF0)
+
+#define GPIO1_RST              MFP_CFG_IN(GPIO1, AF1)
+
+/* Crystal and Clock Signals */
+#define GPIO10_RTCCLK          MFP_CFG_OUT(GPIO10, AF1, DRIVE_LOW)
+#define GPIO70_RTC_CLK         MFP_CFG_OUT(GPIO70, AF1, DRIVE_LOW)
+#define GPIO7_48MHz            MFP_CFG_OUT(GPIO7,  AF1, DRIVE_LOW)
+#define GPIO11_3_6MHz          MFP_CFG_OUT(GPIO11, AF1, DRIVE_LOW)
+#define GPIO71_3_6MHz          MFP_CFG_OUT(GPIO71, AF1, DRIVE_LOW)
+#define GPIO12_32KHz           MFP_CFG_OUT(GPIO12, AF1, DRIVE_LOW)
+#define GPIO72_32kHz           MFP_CFG_OUT(GPIO72, AF1, DRIVE_LOW)
+
+/* SDRAM and Static Memory I/O Signals */
+#define GPIO15_nCS_1           MFP_CFG_OUT(GPIO15, AF2, DRIVE_HIGH)
+#define GPIO78_nCS_2           MFP_CFG_OUT(GPIO78, AF2, DRIVE_HIGH)
+#define GPIO79_nCS_3           MFP_CFG_OUT(GPIO79, AF2, DRIVE_HIGH)
+#define GPIO80_nCS_4           MFP_CFG_OUT(GPIO80, AF2, DRIVE_HIGH)
+#define GPIO33_nCS_5           MFP_CFG_OUT(GPIO33, AF2, DRIVE_HIGH)
+
+/* Miscellaneous I/O and DMA Signals */
+#define GPIO18_RDY             MFP_CFG_IN(GPIO18, AF1)
+#define GPIO20_DREQ_0          MFP_CFG_IN(GPIO20, AF1)
+#define GPIO19_DREQ_1          MFP_CFG_IN(GPIO19, AF1)
+
+/* Alternate Bus Master Mode I/O Signals */
+#define GPIO13_MBGNT           MFP_CFG_OUT(GPIO13, AF2, DRIVE_LOW)
+#define GPIO73_MBGNT           MFP_CFG_OUT(GPIO73, AF1, DRIVE_LOW)
+#define GPIO14_MBREQ           MFP_CFG_IN(GPIO14, AF1)
+#define GPIO66_MBREQ           MFP_CFG_IN(GPIO66, AF1)
+
+/* PC CARD */
+#define GPIO52_nPCE_1          MFP_CFG_OUT(GPIO52, AF2, DRIVE_HIGH)
+#define GPIO53_nPCE_2          MFP_CFG_OUT(GPIO53, AF2, DRIVE_HIGH)
+#define GPIO55_nPREG           MFP_CFG_OUT(GPIO55, AF2, DRIVE_HIGH)
+#define GPIO50_nPIOR           MFP_CFG_OUT(GPIO50, AF2, DRIVE_HIGH)
+#define GPIO51_nPIOW           MFP_CFG_OUT(GPIO51, AF2, DRIVE_HIGH)
+#define GPIO49_nPWE            MFP_CFG_OUT(GPIO49, AF2, DRIVE_HIGH)
+#define GPIO48_nPOE            MFP_CFG_OUT(GPIO48, AF2, DRIVE_HIGH)
+#define GPIO57_nIOIS16         MFP_CFG_IN(GPIO57, AF1)
+#define GPIO56_nPWAIT          MFP_CFG_IN(GPIO56, AF1)
+#define GPIO54_nPSKTSEL                MFP_CFG_OUT(GPIO54, AF2, DRIVE_HIGH)
+
+/* FFUART */
+#define GPIO34_FFUART_RXD      MFP_CFG_IN(GPIO34, AF1)
+#define GPIO35_FFUART_CTS      MFP_CFG_IN(GPIO35, AF1)
+#define GPIO36_FFUART_DCD      MFP_CFG_IN(GPIO36, AF1)
+#define GPIO37_FFUART_DSR      MFP_CFG_IN(GPIO37, AF1)
+#define GPIO38_FFUART_RI       MFP_CFG_IN(GPIO38, AF1)
+#define GPIO39_FFUART_TXD      MFP_CFG_OUT(GPIO39, AF2, DRIVE_HIGH)
+#define GPIO40_FFUART_DTR      MFP_CFG_OUT(GPIO40, AF2, DRIVE_HIGH)
+#define GPIO41_FFUART_RTS      MFP_CFG_OUT(GPIO41, AF2, DRIVE_HIGH)
+
+/* BTUART */
+#define GPIO42_BTUART_RXD      MFP_CFG_IN(GPIO42, AF1)
+#define GPIO43_BTUART_TXD      MFP_CFG_OUT(GPIO43, AF2, DRIVE_HIGH)
+#define GPIO44_BTUART_CTS      MFP_CFG_IN(GPIO44, AF1)
+#define GPIO45_BTUART_RTS      MFP_CFG_OUT(GPIO45, AF2, DRIVE_HIGH)
+
+/* STUART */
+#define GPIO46_STUART_RXD      MFP_CFG_IN(GPIO46, AF2)
+#define GPIO47_STUART_TXD      MFP_CFG_OUT(GPIO47, AF1, DRIVE_HIGH)
+
+/* HWUART */
+#define GPIO42_HWUART_RXD      MFP_CFG_IN(GPIO42, AF3)
+#define GPIO43_HWUART_TXD      MFP_CFG_OUT(GPIO43, AF3, DRIVE_HIGH)
+#define GPIO44_HWUART_CTS      MFP_CFG_IN(GPIO44, AF3)
+#define GPIO45_HWUART_RTS      MFP_CFG_OUT(GPIO45, AF3, DRIVE_HIGH)
+#define GPIO48_HWUART_TXD      MFP_CFG_OUT(GPIO48, AF1, DRIVE_HIGH)
+#define GPIO49_HWUART_RXD      MFP_CFG_IN(GPIO49, AF1)
+#define GPIO50_HWUART_CTS      MFP_CFG_IN(GPIO50, AF1)
+#define GPIO51_HWUART_RTS      MFP_CFG_OUT(GPIO51, AF1, DRIVE_HIGH)
+
+/* FICP */
+#define GPIO46_FICP_RXD                MFP_CFG_IN(GPIO46, AF1)
+#define GPIO47_FICP_TXD                MFP_CFG_OUT(GPIO47, AF2, DRIVE_HIGH)
+
+/* PWM 0/1 */
+#define GPIO16_PWM0_OUT                MFP_CFG_OUT(GPIO16, AF2, DRIVE_LOW)
+#define GPIO17_PWM1_OUT                MFP_CFG_OUT(GPIO17, AF2, DRIVE_LOW)
+
+/* AC97 */
+#define GPIO28_AC97_BITCLK     MFP_CFG_IN(GPIO28, AF1)
+#define GPIO29_AC97_SDATA_IN_0 MFP_CFG_IN(GPIO29, AF1)
+#define GPIO30_AC97_SDATA_OUT  MFP_CFG_OUT(GPIO30, AF2, DRIVE_LOW)
+#define GPIO31_AC97_SYNC       MFP_CFG_OUT(GPIO31, AF2, DRIVE_LOW)
+#define GPIO32_AC97_SDATA_IN_1 MFP_CFG_IN(GPIO32, AF1)
+
+/* I2S */
+#define GPIO28_I2S_BITCLK_IN   MFP_CFG_IN(GPIO28, AF2)
+#define GPIO28_I2S_BITCLK_OUT  MFP_CFG_OUT(GPIO28, AF1, DRIVE_LOW)
+#define GPIO29_I2S_SDATA_IN    MFP_CFG_IN(GPIO29, AF2)
+#define GPIO30_I2S_SDATA_OUT   MFP_CFG_OUT(GPIO30, AF1, DRIVE_LOW)
+#define GPIO31_I2S_SYNC                MFP_CFG_OUT(GPIO31, AF1, DRIVE_LOW)
+#define GPIO32_I2S_SYSCLK      MFP_CFG_OUT(GPIO32, AF1, DRIVE_LOW)
+
+/* SSP 1 */
+#define GPIO23_SSP1_SCLK       MFP_CFG_OUT(GPIO23, AF2, DRIVE_LOW)
+#define GPIO24_SSP1_SFRM       MFP_CFG_OUT(GPIO24, AF2, DRIVE_LOW)
+#define GPIO25_SSP1_TXD                MFP_CFG_OUT(GPIO25, AF2, DRIVE_LOW)
+#define GPIO26_SSP1_RXD                MFP_CFG_IN(GPIO26, AF1)
+#define GPIO27_SSP1_EXTCLK     MFP_CFG_IN(GPIO27, AF1)
+
+/* SSP 2 - NSSP */
+#define GPIO81_SSP2_CLK_OUT    MFP_CFG_OUT(GPIO81, AF1, DRIVE_LOW)
+#define GPIO81_SSP2_CLK_IN     MFP_CFG_IN(GPIO81, AF1)
+#define GPIO82_SSP2_FRM_OUT    MFP_CFG_OUT(GPIO82, AF1, DRIVE_LOW)
+#define GPIO82_SSP2_FRM_IN     MFP_CFG_IN(GPIO82, AF1)
+#define GPIO83_SSP2_TXD        MFP_CFG_OUT(GPIO83, AF1, DRIVE_LOW)
+#define GPIO83_SSP2_RXD        MFP_CFG_IN(GPIO83, AF2)
+#define GPIO84_SSP2_TXD        MFP_CFG_OUT(GPIO84, AF1, DRIVE_LOW)
+#define GPIO84_SSP2_RXD        MFP_CFG_IN(GPIO84, AF2)
+
+/* MMC */
+#define GPIO6_MMC_CLK          MFP_CFG_OUT(GPIO6, AF1, DRIVE_LOW)
+#define GPIO8_MMC_CS0          MFP_CFG_OUT(GPIO8, AF1, DRIVE_LOW)
+#define GPIO9_MMC_CS1          MFP_CFG_OUT(GPIO9, AF1, DRIVE_LOW)
+#define GPIO34_MMC_CS0         MFP_CFG_OUT(GPIO34, AF2, DRIVE_LOW)
+#define GPIO39_MMC_CS1         MFP_CFG_OUT(GPIO39, AF1, DRIVE_LOW)
+#define GPIO53_MMC_CLK         MFP_CFG_OUT(GPIO53, AF1, DRIVE_LOW)
+#define GPIO54_MMC_CLK         MFP_CFG_OUT(GPIO54, AF1, DRIVE_LOW)
+#define GPIO69_MMC_CLK         MFP_CFG_OUT(GPIO69, AF1, DRIVE_LOW)
+#define GPIO67_MMC_CS0         MFP_CFG_OUT(GPIO67, AF1, DRIVE_LOW)
+#define GPIO68_MMC_CS1         MFP_CFG_OUT(GPIO68, AF1, DRIVE_LOW)
+
+/* LCD */
+#define GPIO58_LCD_LDD_0       MFP_CFG_OUT(GPIO58, AF2, DRIVE_LOW)
+#define GPIO59_LCD_LDD_1       MFP_CFG_OUT(GPIO59, AF2, DRIVE_LOW)
+#define GPIO60_LCD_LDD_2       MFP_CFG_OUT(GPIO60, AF2, DRIVE_LOW)
+#define GPIO61_LCD_LDD_3       MFP_CFG_OUT(GPIO61, AF2, DRIVE_LOW)
+#define GPIO62_LCD_LDD_4       MFP_CFG_OUT(GPIO62, AF2, DRIVE_LOW)
+#define GPIO63_LCD_LDD_5       MFP_CFG_OUT(GPIO63, AF2, DRIVE_LOW)
+#define GPIO64_LCD_LDD_6       MFP_CFG_OUT(GPIO64, AF2, DRIVE_LOW)
+#define GPIO65_LCD_LDD_7       MFP_CFG_OUT(GPIO65, AF2, DRIVE_LOW)
+#define GPIO66_LCD_LDD_8       MFP_CFG_OUT(GPIO66, AF2, DRIVE_LOW)
+#define GPIO67_LCD_LDD_9       MFP_CFG_OUT(GPIO67, AF2, DRIVE_LOW)
+#define GPIO68_LCD_LDD_10      MFP_CFG_OUT(GPIO68, AF2, DRIVE_LOW)
+#define GPIO69_LCD_LDD_11      MFP_CFG_OUT(GPIO69, AF2, DRIVE_LOW)
+#define GPIO70_LCD_LDD_12      MFP_CFG_OUT(GPIO70, AF2, DRIVE_LOW)
+#define GPIO71_LCD_LDD_13      MFP_CFG_OUT(GPIO71, AF2, DRIVE_LOW)
+#define GPIO72_LCD_LDD_14      MFP_CFG_OUT(GPIO72, AF2, DRIVE_LOW)
+#define GPIO73_LCD_LDD_15      MFP_CFG_OUT(GPIO73, AF2, DRIVE_LOW)
+#define GPIO74_LCD_FCLK                MFP_CFG_OUT(GPIO74, AF2, DRIVE_LOW)
+#define GPIO75_LCD_LCLK                MFP_CFG_OUT(GPIO75, AF2, DRIVE_LOW)
+#define GPIO76_LCD_PCLK                MFP_CFG_OUT(GPIO76, AF2, DRIVE_LOW)
+#define GPIO77_LCD_ACBIAS      MFP_CFG_OUT(GPIO77, AF2, DRIVE_LOW)
+
+#endif /* __ASM_ARCH_MFP_PXA25X_H */
diff --git a/include/asm-arm/arch-pxa/mfp-pxa27x.h b/include/asm-arm/arch-pxa/mfp-pxa27x.h
new file mode 100644 (file)
index 0000000..eb6eaa1
--- /dev/null
@@ -0,0 +1,432 @@
+#ifndef __ASM_ARCH_MFP_PXA27X_H
+#define __ASM_ARCH_MFP_PXA27X_H
+
+/*
+ * NOTE:  for those special-function bidirectional GPIOs, as described
+ * in the "PXA27x Developer's Manual" Section 24.4.2.1, only its input
+ * alternative is preserved, the direction is actually selected by the
+ * specific controller, and this should work in most cases.
+ */
+
+#include <asm/arch/mfp.h>
+#include <asm/arch/mfp-pxa2xx.h>
+
+/* GPIO */
+#define GPIO85_GPIO            MFP_CFG_IN(GPIO85, AF0)
+#define GPIO86_GPIO            MFP_CFG_IN(GPIO86, AF0)
+#define GPIO87_GPIO            MFP_CFG_IN(GPIO87, AF0)
+#define GPIO88_GPIO            MFP_CFG_IN(GPIO88, AF0)
+#define GPIO89_GPIO            MFP_CFG_IN(GPIO89, AF0)
+#define GPIO90_GPIO            MFP_CFG_IN(GPIO90, AF0)
+#define GPIO91_GPIO            MFP_CFG_IN(GPIO91, AF0)
+#define GPIO92_GPIO            MFP_CFG_IN(GPIO92, AF0)
+#define GPIO93_GPIO            MFP_CFG_IN(GPIO93, AF0)
+#define GPIO94_GPIO            MFP_CFG_IN(GPIO94, AF0)
+#define GPIO95_GPIO            MFP_CFG_IN(GPIO95, AF0)
+#define GPIO96_GPIO            MFP_CFG_IN(GPIO96, AF0)
+#define GPIO97_GPIO            MFP_CFG_IN(GPIO97, AF0)
+#define GPIO98_GPIO            MFP_CFG_IN(GPIO98, AF0)
+#define GPIO99_GPIO            MFP_CFG_IN(GPIO99, AF0)
+#define GPIO100_GPIO           MFP_CFG_IN(GPIO100, AF0)
+#define GPIO101_GPIO           MFP_CFG_IN(GPIO101, AF0)
+#define GPIO102_GPIO           MFP_CFG_IN(GPIO102, AF0)
+#define GPIO103_GPIO           MFP_CFG_IN(GPIO103, AF0)
+#define GPIO104_GPIO           MFP_CFG_IN(GPIO104, AF0)
+#define GPIO105_GPIO           MFP_CFG_IN(GPIO105, AF0)
+#define GPIO106_GPIO           MFP_CFG_IN(GPIO106, AF0)
+#define GPIO107_GPIO           MFP_CFG_IN(GPIO107, AF0)
+#define GPIO108_GPIO           MFP_CFG_IN(GPIO108, AF0)
+#define GPIO109_GPIO           MFP_CFG_IN(GPIO109, AF0)
+#define GPIO110_GPIO           MFP_CFG_IN(GPIO110, AF0)
+#define GPIO111_GPIO           MFP_CFG_IN(GPIO111, AF0)
+#define GPIO112_GPIO           MFP_CFG_IN(GPIO112, AF0)
+#define GPIO113_GPIO           MFP_CFG_IN(GPIO113, AF0)
+#define GPIO114_GPIO           MFP_CFG_IN(GPIO114, AF0)
+#define GPIO115_GPIO           MFP_CFG_IN(GPIO115, AF0)
+#define GPIO116_GPIO           MFP_CFG_IN(GPIO116, AF0)
+#define GPIO117_GPIO           MFP_CFG_IN(GPIO117, AF0)
+#define GPIO118_GPIO           MFP_CFG_IN(GPIO118, AF0)
+#define GPIO119_GPIO           MFP_CFG_IN(GPIO119, AF0)
+#define GPIO120_GPIO           MFP_CFG_IN(GPIO120, AF0)
+
+/* Crystal and Clock Signals */
+#define GPIO9_HZ_CLK           MFP_CFG_OUT(GPIO9,  AF1, DRIVE_LOW)
+#define GPIO10_HZ_CLK          MFP_CFG_OUT(GPIO10, AF1, DRIVE_LOW)
+#define GPIO11_48_MHz          MFP_CFG_OUT(GPIO11, AF3, DRIVE_LOW)
+#define GPIO12_48_MHz          MFP_CFG_OUT(GPIO12, AF3, DRIVE_LOW)
+#define GPIO13_CLK_EXT         MFP_CFG_IN(GPIO13, AF1)
+
+/* OS Timer Signals */
+#define GPIO11_EXT_SYNC_0      MFP_CFG_IN(GPIO11, AF1)
+#define GPIO12_EXT_SYNC_1      MFP_CFG_IN(GPIO12, AF1)
+#define GPIO9_CHOUT_0          MFP_CFG_OUT(GPIO9,  AF3, DRIVE_LOW)
+#define GPIO10_CHOUT_1         MFP_CFG_OUT(GPIO10, AF3, DRIVE_LOW)
+#define GPIO11_CHOUT_0         MFP_CFG_OUT(GPIO11, AF1, DRIVE_LOW)
+#define GPIO12_CHOUT_1         MFP_CFG_OUT(GPIO12, AF1, DRIVE_LOW)
+
+/* SDRAM and Static Memory I/O Signals */
+#define GPIO20_nSDCS_2         MFP_CFG_OUT(GPIO20, AF1, DRIVE_HIGH)
+#define GPIO21_nSDCS_3         MFP_CFG_OUT(GPIO21, AF1, DRIVE_HIGH)
+#define GPIO15_nCS_1           MFP_CFG_OUT(GPIO15, AF2, DRIVE_HIGH)
+#define GPIO78_nCS_2           MFP_CFG_OUT(GPIO78, AF2, DRIVE_HIGH)
+#define GPIO79_nCS_3           MFP_CFG_OUT(GPIO79, AF2, DRIVE_HIGH)
+#define GPIO80_nCS_4           MFP_CFG_OUT(GPIO80, AF2, DRIVE_HIGH)
+#define GPIO33_nCS_5           MFP_CFG_OUT(GPIO33, AF2, DRIVE_HIGH)
+
+/* Miscellaneous I/O and DMA Signals */
+#define GPIO21_DVAL_0          MFP_CFG_OUT(GPIO21, AF2, DRIVE_HIGH)
+#define GPIO116_DVAL_0         MFP_CFG_OUT(GPIO116, AF1, DRIVE_HIGH)
+#define GPIO33_DVAL_1          MFP_CFG_OUT(GPIO33, AF1, DRIVE_HIGH)
+#define GPIO96_DVAL_1          MFP_CFG_OUT(GPIO96, AF2, DRIVE_HIGH)
+#define GPIO18_RDY             MFP_CFG_IN(GPIO18, AF1)
+#define GPIO20_DREQ_0          MFP_CFG_IN(GPIO20, AF1)
+#define GPIO115_DREQ_0         MFP_CFG_IN(GPIO115, AF1)
+#define GPIO80_DREQ_1          MFP_CFG_IN(GPIO80, AF1)
+#define GPIO97_DREQ_1          MFP_CFG_IN(GPIO97, AF2)
+#define GPIO85_DREQ_2          MFP_CFG_IN(GPIO85, AF2)
+#define GPIO100_DREQ_2         MFP_CFG_IN(GPIO100, AF2)
+
+/* Alternate Bus Master Mode I/O Signals */
+#define GPIO20_MBREQ           MFP_CFG_IN(GPIO20, AF2)
+#define GPIO80_MBREQ           MFP_CFG_IN(GPIO80, AF2)
+#define GPIO96_MBREQ           MFP_CFG_IN(GPIO96, AF2)
+#define GPIO115_MBREQ          MFP_CFG_IN(GPIO115, AF3)
+#define GPIO21_MBGNT           MFP_CFG_OUT(GPIO21, AF3, DRIVE_LOW)
+#define GPIO33_MBGNT           MFP_CFG_OUT(GPIO33, AF3, DRIVE_LOW)
+#define GPIO97_MBGNT           MFP_CFG_OUT(GPIO97, AF2, DRIVE_LOW)
+#define GPIO116_MBGNT          MFP_CFG_OUT(GPIO116, AF3, DRIVE_LOW)
+
+/* PC CARD */
+#define GPIO15_nPCE_1          MFP_CFG_OUT(GPIO15, AF1, DRIVE_HIGH)
+#define GPIO85_nPCE_1          MFP_CFG_OUT(GPIO85, AF1, DRIVE_HIGH)
+#define GPIO86_nPCE_1          MFP_CFG_OUT(GPIO86, AF1, DRIVE_HIGH)
+#define GPIO102_nPCE_1         MFP_CFG_OUT(GPIO102, AF1, DRIVE_HIGH)
+#define GPIO54_nPCE_2          MFP_CFG_OUT(GPIO54, AF2, DRIVE_HIGH)
+#define GPIO78_nPCE_2          MFP_CFG_OUT(GPIO78, AF1, DRIVE_HIGH)
+#define GPIO87_nPCE_2          MFP_CFG_IN(GPIO87, AF1)
+#define GPIO55_nPREG           MFP_CFG_OUT(GPIO55, AF2, DRIVE_HIGH)
+#define GPIO50_nPIOR           MFP_CFG_OUT(GPIO50, AF2, DRIVE_HIGH)
+#define GPIO51_nPIOW           MFP_CFG_OUT(GPIO51, AF2, DRIVE_HIGH)
+#define GPIO49_nPWE            MFP_CFG_OUT(GPIO49, AF2, DRIVE_HIGH)
+#define GPIO48_nPOE            MFP_CFG_OUT(GPIO48, AF2, DRIVE_HIGH)
+#define GPIO57_nIOIS16         MFP_CFG_IN(GPIO57, AF1)
+#define GPIO56_nPWAIT          MFP_CFG_IN(GPIO56, AF1)
+#define GPIO79_PSKTSEL         MFP_CFG_OUT(GPIO79, AF1, DRIVE_HIGH)
+
+/* I2C */
+#define GPIO117_I2C_SCL                MFP_CFG_IN(GPIO117, AF1)
+#define GPIO118_I2C_SDA                MFP_CFG_IN(GPIO118, AF1)
+
+/* FFUART */
+#define GPIO9_FFUART_CTS       MFP_CFG_IN(GPIO9, AF3)
+#define GPIO26_FFUART_CTS      MFP_CFG_IN(GPIO26, AF3)
+#define GPIO35_FFUART_CTS      MFP_CFG_IN(GPIO35, AF1)
+#define GPIO100_FFUART_CTS     MFP_CFG_IN(GPIO100, AF3)
+#define GPIO10_FFUART_DCD      MFP_CFG_IN(GPIO10, AF1)
+#define GPIO36_FFUART_DCD      MFP_CFG_IN(GPIO36, AF1)
+#define GPIO33_FFUART_DSR      MFP_CFG_IN(GPIO33, AF2)
+#define GPIO37_FFUART_DSR      MFP_CFG_IN(GPIO37, AF1)
+#define GPIO38_FFUART_RI       MFP_CFG_IN(GPIO38, AF1)
+#define GPIO89_FFUART_RI       MFP_CFG_IN(GPIO89, AF3)
+#define GPIO19_FFUART_RXD      MFP_CFG_IN(GPIO19, AF3)
+#define GPIO33_FFUART_RXD      MFP_CFG_IN(GPIO33, AF1)
+#define GPIO34_FFUART_RXD      MFP_CFG_IN(GPIO34, AF1)
+#define GPIO41_FFUART_RXD      MFP_CFG_IN(GPIO41, AF1)
+#define GPIO53_FFUART_RXD      MFP_CFG_IN(GPIO53, AF1)
+#define GPIO85_FFUART_RXD      MFP_CFG_IN(GPIO85, AF1)
+#define GPIO96_FFUART_RXD      MFP_CFG_IN(GPIO96, AF3)
+#define GPIO102_FFUART_RXD     MFP_CFG_IN(GPIO102, AF3)
+#define GPIO16_FFUART_TXD      MFP_CFG_OUT(GPIO16, AF3, DRIVE_HIGH)
+#define GPIO37_FFUART_TXD      MFP_CFG_OUT(GPIO37, AF3, DRIVE_HIGH)
+#define GPIO39_FFUART_TXD      MFP_CFG_OUT(GPIO39, AF2, DRIVE_HIGH)
+#define GPIO83_FFUART_TXD      MFP_CFG_OUT(GPIO83, AF2, DRIVE_HIGH)
+#define GPIO99_FFUART_TXD      MFP_CFG_OUT(GPIO99, AF3, DRIVE_HIGH)
+#define GPIO27_FFUART_RTS      MFP_CFG_OUT(GPIO27, AF3, DRIVE_HIGH)
+#define GPIO41_FFUART_RTS      MFP_CFG_OUT(GPIO41, AF2, DRIVE_HIGH)
+#define GPIO83_FFUART_RTS      MFP_CFG_OUT(GPIO83, AF3, DRIVE_HIGH)
+#define GPIO98_FFUART_RTS      MFP_CFG_OUT(GPIO98, AF3, DRIVE_HIGH)
+#define GPIO40_FFUART_DTR      MFP_CFG_OUT(GPIO40, AF2, DRIVE_HIGH)
+#define GPIO82_FFUART_DTR      MFP_CFG_OUT(GPIO82, AF3, DRIVE_HIGH)
+
+/* BTUART */
+#define GPIO44_BTUART_CTS      MFP_CFG_IN(GPIO44, AF1)
+#define GPIO42_BTUART_RXD      MFP_CFG_IN(GPIO42, AF1)
+#define GPIO45_BTUART_RTS      MFP_CFG_OUT(GPIO45, AF2, DRIVE_HIGH)
+#define GPIO43_BTUART_TXD      MFP_CFG_OUT(GPIO43, AF2, DRIVE_HIGH)
+
+/* STUART */
+#define GPIO46_STUART_RXD      MFP_CFG_IN(GPIO46, AF2)
+#define GPIO47_STUART_TXD      MFP_CFG_OUT(GPIO47, AF1, DRIVE_HIGH)
+
+/* FICP */
+#define GPIO42_FICP_RXD                MFP_CFG_IN(GPIO42, AF2)
+#define GPIO46_FICP_RXD                MFP_CFG_IN(GPIO46, AF1)
+#define GPIO43_FICP_TXD                MFP_CFG_OUT(GPIO43, AF1, DRIVE_HIGH)
+#define GPIO47_FICP_TXD                MFP_CFG_OUT(GPIO47, AF2, DRIVE_HIGH)
+
+/* PWM 0/1/2/3 */
+#define GPIO11_PWM2_OUT                MFP_CFG_OUT(GPIO11, AF2, DRIVE_LOW)
+#define GPIO12_PWM3_OUT                MFP_CFG_OUT(GPIO12, AF2, DRIVE_LOW)
+#define GPIO16_PWM0_OUT                MFP_CFG_OUT(GPIO16, AF2, DRIVE_LOW)
+#define GPIO17_PWM1_OUT                MFP_CFG_OUT(GPIO17, AF2, DRIVE_LOW)
+#define GPIO38_PWM1_OUT                MFP_CFG_OUT(GPIO38, AF3, DRIVE_LOW)
+#define GPIO46_PWM2_OUT                MFP_CFG_OUT(GPIO46, AF2, DRIVE_LOW)
+#define GPIO47_PWM3_OUT                MFP_CFG_OUT(GPIO47, AF3, DRIVE_LOW)
+#define GPIO79_PWM2_OUT                MFP_CFG_OUT(GPIO79, AF3, DRIVE_LOW)
+#define GPIO80_PWM3_OUT                MFP_CFG_OUT(GPIO80, AF3, DRIVE_LOW)
+#define GPIO115_PWM1_OUT       MFP_CFG_OUT(GPIO115, AF3, DRIVE_LOW)
+
+/* AC97 */
+#define GPIO31_AC97_SYNC       MFP_CFG_OUT(GPIO31, AF2, DRIVE_LOW)
+#define GPIO94_AC97_SYNC       MFP_CFG_OUT(GPIO94, AF1, DRIVE_LOW)
+#define GPIO30_AC97_SDATA_OUT  MFP_CFG_OUT(GPIO30, AF2, DRIVE_LOW)
+#define GPIO93_AC97_SDATA_OUT  MFP_CFG_OUT(GPIO93, AF1, DRIVE_LOW)
+#define GPIO45_AC97_SYSCLK     MFP_CFG_OUT(GPIO45, AF1, DRIVE_LOW)
+#define GPIO89_AC97_SYSCLK     MFP_CFG_OUT(GPIO89, AF1, DRIVE_LOW)
+#define GPIO98_AC97_SYSCLK     MFP_CFG_OUT(GPIO98, AF1, DRIVE_LOW)
+#define GPIO95_AC97_nRESET     MFP_CFG_OUT(GPIO95, AF1, DRIVE_LOW)
+#define GPIO113_AC97_nRESET    MFP_CFG_OUT(GPIO113, AF2, DRIVE_LOW)
+#define GPIO28_AC97_BITCLK     MFP_CFG_IN(GPIO28, AF1)
+#define GPIO29_AC97_SDATA_IN_0 MFP_CFG_IN(GPIO29, AF1)
+#define GPIO116_AC97_SDATA_IN_0        MFP_CFG_IN(GPIO116, AF2)
+#define GPIO99_AC97_SDATA_IN_1 MFP_CFG_IN(GPIO99, AF2)
+
+/* I2S */
+#define GPIO28_I2S_BITCLK_IN   MFP_CFG_IN(GPIO28, AF2)
+#define GPIO28_I2S_BITCLK_OUT  MFP_CFG_OUT(GPIO28, AF1, DRIVE_LOW)
+#define GPIO29_I2S_SDATA_IN    MFP_CFG_IN(GPIO29, AF2)
+#define GPIO30_I2S_SDATA_OUT   MFP_CFG_OUT(GPIO30, AF1, DRIVE_LOW)
+#define GPIO31_I2S_SYNC                MFP_CFG_OUT(GPIO31, AF1, DRIVE_LOW)
+#define GPIO113_I2S_SYSCLK     MFP_CFG_OUT(GPIO113, AF1, DRIVE_LOW)
+
+/* SSP 1 */
+#define GPIO23_SSP1_SCLK       MFP_CFG_OUT(GPIO23, AF2, DRIVE_LOW)
+#define GPIO29_SSP1_SCLK       MFP_CFG_IN(GPIO29, AF3)
+#define GPIO27_SSP1_SYSCLK     MFP_CFG_OUT(GPIO27, AF1, DRIVE_LOW)
+#define GPIO53_SSP1_SYSCLK     MFP_CFG_OUT(GPIO53, AF3, DRIVE_LOW)
+#define GPIO24_SSP1_SFRM       MFP_CFG_IN(GPIO24, AF2)
+#define GPIO28_SSP1_SFRM       MFP_CFG_IN(GPIO28, AF3)
+#define GPIO25_SSP1_TXD                MFP_CFG_OUT(GPIO25, AF2, DRIVE_LOW)
+#define GPIO57_SSP1_TXD                MFP_CFG_OUT(GPIO57, AF3, DRIVE_LOW)
+#define GPIO26_SSP1_RXD                MFP_CFG_IN(GPIO26, AF1)
+#define GPIO27_SSP1_SCLKEN     MFP_CFG_IN(GPIO27, AF2)
+
+/* SSP 2 */
+#define GPIO19_SSP2_SCLK       MFP_CFG_IN(GPIO19, AF1)
+#define GPIO22_SSP2_SCLK       MFP_CFG_IN(GPIO22, AF3)
+#define GPIO29_SSP2_SCLK       MFP_CFG_OUT(GPIO29, AF3, DRIVE_LOW)
+#define GPIO36_SSP2_SCLK       MFP_CFG_IN(GPIO36, AF2)
+#define GPIO50_SSP2_SCLK       MFP_CFG_IN(GPIO50, AF3)
+#define GPIO22_SSP2_SYSCLK     MFP_CFG_OUT(GPIO22, AF2, DRIVE_LOW)
+#define GPIO14_SSP2_SFRM       MFP_CFG_IN(GPIO14, AF2)
+#define GPIO37_SSP2_SFRM       MFP_CFG_IN(GPIO37, AF2)
+#define GPIO87_SSP2_SFRM       MFP_CFG_OUT(GPIO87, AF3, DRIVE_LOW)
+#define GPIO88_SSP2_SFRM       MFP_CFG_IN(GPIO88, AF3)
+#define GPIO13_SSP2_TXD                MFP_CFG_OUT(GPIO13, AF1, DRIVE_LOW)
+#define GPIO38_SSP2_TXD                MFP_CFG_OUT(GPIO38, AF2, DRIVE_LOW)
+#define GPIO87_SSP2_TXD                MFP_CFG_OUT(GPIO87, AF1, DRIVE_LOW)
+#define GPIO89_SSP2_TXD                MFP_CFG_OUT(GPIO89, AF3, DRIVE_LOW)
+#define GPIO11_SSP2_RXD                MFP_CFG_IN(GPIO11, AF2)
+#define GPIO29_SSP2_RXD                MFP_CFG_OUT(GPIO29, AF1, DRIVE_LOW)
+#define GPIO40_SSP2_RXD                MFP_CFG_IN(GPIO40, AF1)
+#define GPIO86_SSP2_RXD                MFP_CFG_IN(GPIO86, AF1)
+#define GPIO88_SSP2_RXD                MFP_CFG_IN(GPIO88, AF2)
+#define GPIO22_SSP2_EXTCLK     MFP_CFG_IN(GPIO22, AF1)
+#define GPIO27_SSP2_EXTCLK     MFP_CFG_IN(GPIO27, AF1)
+#define GPIO22_SSP2_SCLKEN     MFP_CFG_IN(GPIO22, AF2)
+#define GPIO23_SSP2_SCLKEN     MFP_CFG_IN(GPIO23, AF2)
+
+/* SSP 3 */
+#define GPIO34_SSP3_SCLK       MFP_CFG_IN(GPIO34, AF3)
+#define GPIO40_SSP3_SCLK       MFP_CFG_OUT(GPIO40, AF3, DRIVE_LOW)
+#define GPIO52_SSP3_SCLK       MFP_CFG_IN(GPIO52, AF2)
+#define GPIO84_SSP3_SCLK       MFP_CFG_IN(GPIO84, AF1)
+#define GPIO45_SSP3_SYSCLK     MFP_CFG_OUT(GPIO45, AF3, DRIVE_LOW)
+#define GPIO35_SSP3_SFRM       MFP_CFG_IN(GPIO35, AF3)
+#define GPIO39_SSP3_SFRM       MFP_CFG_IN(GPIO39, AF3)
+#define GPIO83_SSP3_SFRM       MFP_CFG_IN(GPIO83, AF1)
+#define GPIO35_SSP3_TXD                MFP_CFG_OUT(GPIO35, AF3, DRIVE_LOW)
+#define GPIO38_SSP3_TXD                MFP_CFG_OUT(GPIO38, AF1, DRIVE_LOW)
+#define GPIO81_SSP3_TXD                MFP_CFG_OUT(GPIO81, AF1, DRIVE_LOW)
+#define GPIO41_SSP3_RXD                MFP_CFG_IN(GPIO41, AF3)
+#define GPIO82_SSP3_RXD                MFP_CFG_IN(GPIO82, AF1)
+#define GPIO89_SSP3_RXD                MFP_CFG_IN(GPIO89, AF1)
+
+/* MMC */
+#define GPIO32_MMC_CLK         MFP_CFG_OUT(GPIO32, AF2, DRIVE_LOW)
+#define GPIO92_MMC_DAT_0       MFP_CFG_IN(GPIO92, AF1)
+#define GPIO109_MMC_DAT_1      MFP_CFG_IN(GPIO109, AF1)
+#define GPIO110_MMC_DAT_2      MFP_CFG_IN(GPIO110, AF1)
+#define GPIO111_MMC_DAT_3      MFP_CFG_IN(GPIO111, AF1)
+#define GPIO112_MMC_CMD                MFP_CFG_IN(GPIO112, AF1)
+
+/* LCD */
+#define GPIO58_LCD_LDD_0       MFP_CFG_OUT(GPIO58, AF2, DRIVE_LOW)
+#define GPIO59_LCD_LDD_1       MFP_CFG_OUT(GPIO59, AF2, DRIVE_LOW)
+#define GPIO60_LCD_LDD_2       MFP_CFG_OUT(GPIO60, AF2, DRIVE_LOW)
+#define GPIO61_LCD_LDD_3       MFP_CFG_OUT(GPIO61, AF2, DRIVE_LOW)
+#define GPIO62_LCD_LDD_4       MFP_CFG_OUT(GPIO62, AF2, DRIVE_LOW)
+#define GPIO63_LCD_LDD_5       MFP_CFG_OUT(GPIO63, AF2, DRIVE_LOW)
+#define GPIO64_LCD_LDD_6       MFP_CFG_OUT(GPIO64, AF2, DRIVE_LOW)
+#define GPIO65_LCD_LDD_7       MFP_CFG_OUT(GPIO65, AF2, DRIVE_LOW)
+#define GPIO66_LCD_LDD_8       MFP_CFG_OUT(GPIO66, AF2, DRIVE_LOW)
+#define GPIO67_LCD_LDD_9       MFP_CFG_OUT(GPIO67, AF2, DRIVE_LOW)
+#define GPIO68_LCD_LDD_10      MFP_CFG_OUT(GPIO68, AF2, DRIVE_LOW)
+#define GPIO69_LCD_LDD_11      MFP_CFG_OUT(GPIO69, AF2, DRIVE_LOW)
+#define GPIO70_LCD_LDD_12      MFP_CFG_OUT(GPIO70, AF2, DRIVE_LOW)
+#define GPIO71_LCD_LDD_13      MFP_CFG_OUT(GPIO71, AF2, DRIVE_LOW)
+#define GPIO72_LCD_LDD_14      MFP_CFG_OUT(GPIO72, AF2, DRIVE_LOW)
+#define GPIO73_LCD_LDD_15      MFP_CFG_OUT(GPIO73, AF2, DRIVE_LOW)
+#define GPIO86_LCD_LDD_16      MFP_CFG_OUT(GPIO86, AF2, DRIVE_LOW)
+#define GPIO87_LCD_LDD_17      MFP_CFG_OUT(GPIO87, AF2, DRIVE_LOW)
+#define GPIO74_LCD_FCLK                MFP_CFG_OUT(GPIO74, AF2, DRIVE_LOW)
+#define GPIO75_LCD_LCLK                MFP_CFG_OUT(GPIO75, AF2, DRIVE_LOW)
+#define GPIO76_LCD_PCLK                MFP_CFG_OUT(GPIO76, AF2, DRIVE_LOW)
+#define GPIO77_LCD_BIAS                MFP_CFG_OUT(GPIO77, AF2, DRIVE_LOW)
+#define GPIO14_LCD_VSYNC       MFP_CFG_IN(GPIO14, AF1)
+#define GPIO19_LCD_CS          MFP_CFG_OUT(GPIO19, AF2, DRIVE_LOW)
+
+/* Keypad */
+#define GPIO93_KP_DKIN_0       MFP_CFG_IN(GPIO93, AF1)
+#define GPIO94_KP_DKIN_1       MFP_CFG_IN(GPIO94, AF1)
+#define GPIO95_KP_DKIN_2       MFP_CFG_IN(GPIO95, AF1)
+#define GPIO96_KP_DKIN_3       MFP_CFG_IN(GPIO96, AF1)
+#define GPIO97_KP_DKIN_4       MFP_CFG_IN(GPIO97, AF1)
+#define GPIO98_KP_DKIN_5       MFP_CFG_IN(GPIO98, AF1)
+#define GPIO99_KP_DKIN_6       MFP_CFG_IN(GPIO99, AF1)
+#define GPIO13_KP_KDIN_7       MFP_CFG_IN(GPIO13, AF2)
+#define GPIO100_KP_MKIN_0      MFP_CFG_IN(GPIO100, AF1)
+#define GPIO101_KP_MKIN_1      MFP_CFG_IN(GPIO101, AF1)
+#define GPIO102_KP_MKIN_2      MFP_CFG_IN(GPIO102, AF1)
+#define GPIO34_KP_MKIN_3       MFP_CFG_IN(GPIO34, AF2)
+#define GPIO37_KP_MKIN_3       MFP_CFG_IN(GPIO37, AF3)
+#define GPIO97_KP_MKIN_3       MFP_CFG_IN(GPIO97, AF3)
+#define GPIO98_KP_MKIN_4       MFP_CFG_IN(GPIO98, AF3)
+#define GPIO38_KP_MKIN_4       MFP_CFG_IN(GPIO38, AF2)
+#define GPIO39_KP_MKIN_4       MFP_CFG_IN(GPIO39, AF1)
+#define GPIO16_KP_MKIN_5       MFP_CFG_IN(GPIO16, AF1)
+#define GPIO90_KP_MKIN_5       MFP_CFG_IN(GPIO90, AF1)
+#define GPIO99_KP_MKIN_5       MFP_CFG_IN(GPIO99, AF3)
+#define GPIO17_KP_MKIN_6       MFP_CFG_IN(GPIO17, AF1)
+#define GPIO91_KP_MKIN_6       MFP_CFG_IN(GPIO91, AF1)
+#define GPIO95_KP_MKIN_6       MFP_CFG_IN(GPIO95, AF3)
+#define GPIO13_KP_MKIN_7       MFP_CFG_IN(GPIO13, AF3)
+#define GPIO36_KP_MKIN_7       MFP_CFG_IN(GPIO36, AF3)
+#define GPIO103_KP_MKOUT_0     MFP_CFG_OUT(GPIO103, AF2, DRIVE_HIGH)
+#define GPIO104_KP_MKOUT_1     MFP_CFG_OUT(GPIO104, AF2, DRIVE_HIGH)
+#define GPIO105_KP_MKOUT_2     MFP_CFG_OUT(GPIO105, AF2, DRIVE_HIGH)
+#define GPIO106_KP_MKOUT_3     MFP_CFG_OUT(GPIO106, AF2, DRIVE_HIGH)
+#define GPIO107_KP_MKOUT_4     MFP_CFG_OUT(GPIO107, AF2, DRIVE_HIGH)
+#define GPIO108_KP_MKOUT_5     MFP_CFG_OUT(GPIO108, AF2, DRIVE_HIGH)
+#define GPIO35_KP_MKOUT_6      MFP_CFG_OUT(GPIO35, AF2, DRIVE_HIGH)
+#define GPIO22_KP_MKOUT_7      MFP_CFG_OUT(GPIO22, AF1, DRIVE_HIGH)
+#define GPIO40_KP_MKOUT_6      MFP_CFG_OUT(GPIO40, AF1, DRIVE_HIGH)
+#define GPIO41_KP_MKOUT_7      MFP_CFG_OUT(GPIO41, AF1, DRIVE_HIGH)
+#define GPIO96_KP_MKOUT_6      MFP_CFG_OUT(GPIO96, AF3, DRIVE_HIGH)
+
+/* USB P3 */
+#define GPIO10_USB_P3_5                MFP_CFG_IN(GPIO10, AF3)
+#define GPIO11_USB_P3_1                MFP_CFG_IN(GPIO11, AF3)
+#define GPIO30_USB_P3_2                MFP_CFG_OUT(GPIO30, AF3, DRIVE_LOW)
+#define GPIO31_USB_P3_6                MFP_CFG_OUT(GPIO31, AF3, DRIVE_LOW)
+#define GPIO56_USB_P3_4                MFP_CFG_OUT(GPIO56, AF1, DRIVE_LOW)
+#define GPIO86_USB_P3_5                MFP_CFG_IN(GPIO86, AF3)
+#define GPIO87_USB_P3_1                MFP_CFG_IN(GPIO87, AF3)
+#define GPIO90_USB_P3_5                MFP_CFG_IN(GPIO90, AF2)
+#define GPIO91_USB_P3_1                MFP_CFG_IN(GPIO91, AF2)
+#define GPIO113_USB_P3_3       MFP_CFG_IN(GPIO113, AF3)
+
+/* USB P2 */
+#define GPIO34_USB_P2_2                MFP_CFG_OUT(GPIO34, AF1, DRIVE_LOW)
+#define GPIO35_USB_P2_1                MFP_CFG_IN(GPIO35, AF2)
+#define GPIO36_USB_P2_4                MFP_CFG_OUT(GPIO36, AF1, DRIVE_LOW)
+#define GPIO37_USB_P2_8                MFP_CFG_OUT(GPIO37, AF1, DRIVE_LOW)
+#define GPIO38_USB_P2_3                MFP_CFG_IN(GPIO38, AF3)
+#define GPIO39_USB_P2_6                MFP_CFG_OUT(GPIO39, AF1, DRIVE_LOW)
+#define GPIO40_USB_P2_5                MFP_CFG_IN(GPIO40, AF3)
+#define GPIO41_USB_P2_7                MFP_CFG_IN(GPIO41, AF2)
+#define GPIO53_USB_P2_3                MFP_CFG_IN(GPIO53, AF2)
+
+/* USB Host Port 1/2 */
+#define GPIO88_USBH1_PWR       MFP_CFG_IN(GPIO88, AF1)
+#define GPIO89_USBH1_PEN       MFP_CFG_OUT(GPIO89, AF2, DRIVE_LOW)
+#define GPIO119_USBH2_PWR      MFP_CFG_IN(GPIO119, AF1)
+#define GPIO120_USBH2_PEN      MFP_CFG_OUT(GPIO120, AF2, DRIVE_LOW)
+
+/* QCI - default to Master Mode: CIF_FV/CIF_LV Direction In */
+#define GPIO115_CIF_DD_3       MFP_CFG_IN(GPIO115, AF2)
+#define GPIO116_CIF_DD_2       MFP_CFG_IN(GPIO116, AF1)
+#define GPIO12_CIF_DD_7                MFP_CFG_IN(GPIO12, AF2)
+#define GPIO17_CIF_DD_6                MFP_CFG_IN(GPIO17, AF2)
+#define GPIO23_CIF_MCLK                MFP_CFG_OUT(GPIO23, AF1, DRIVE_LOW)
+#define GPIO24_CIF_FV          MFP_CFG_IN(GPIO24, AF1)
+#define GPIO25_CIF_LV          MFP_CFG_IN(GPIO25, AF1)
+#define GPIO26_CIF_PCLK                MFP_CFG_IN(GPIO26, AF2)
+#define GPIO27_CIF_DD_0                MFP_CFG_IN(GPIO27, AF3)
+#define GPIO42_CIF_MCLK                MFP_CFG_OUT(GPIO42, AF3, DRIVE_LOW)
+#define GPIO43_CIF_FV          MFP_CFG_IN(GPIO43, AF3)
+#define GPIO44_CIF_LV          MFP_CFG_IN(GPIO44, AF3)
+#define GPIO45_CIF_PCLK                MFP_CFG_IN(GPIO45, AF3)
+#define GPIO47_CIF_DD_0                MFP_CFG_IN(GPIO47, AF1)
+#define GPIO48_CIF_DD_5                MFP_CFG_IN(GPIO48, AF1)
+#define GPIO50_CIF_DD_3                MFP_CFG_IN(GPIO50, AF1)
+#define GPIO51_CIF_DD_2                MFP_CFG_IN(GPIO51, AF1)
+#define GPIO52_CIF_DD_4                MFP_CFG_IN(GPIO52, AF1)
+#define GPIO53_CIF_MCLK                MFP_CFG_OUT(GPIO53, AF2, DRIVE_LOW)
+#define GPIO54_CIF_PCLK                MFP_CFG_IN(GPIO54, AF3)
+#define GPIO55_CIF_DD_1                MFP_CFG_IN(GPIO55, AF1)
+#define GPIO81_CIF_DD_0                MFP_CFG_IN(GPIO81, AF2)
+#define GPIO82_CIF_DD_5                MFP_CFG_IN(GPIO82, AF3)
+#define GPIO83_CIF_DD_4                MFP_CFG_IN(GPIO83, AF3)
+#define GPIO84_CIF_FV          MFP_CFG_IN(GPIO84, AF3)
+#define GPIO85_CIF_LV          MFP_CFG_IN(GPIO85, AF3)
+#define GPIO90_CIF_DD_4                MFP_CFG_IN(GPIO90, AF3)
+#define GPIO91_CIF_DD_5                MFP_CFG_IN(GPIO91, AF3)
+#define GPIO93_CIF_DD_6                MFP_CFG_IN(GPIO93, AF2)
+#define GPIO94_CIF_DD_5                MFP_CFG_IN(GPIO94, AF2)
+#define GPIO95_CIF_DD_4                MFP_CFG_IN(GPIO95, AF2)
+#define GPIO98_CIF_DD_0                MFP_CFG_IN(GPIO98, AF2)
+#define GPIO103_CIF_DD_3       MFP_CFG_IN(GPIO103, AF1)
+#define GPIO104_CIF_DD_2       MFP_CFG_IN(GPIO104, AF1)
+#define GPIO105_CIF_DD_1       MFP_CFG_IN(GPIO105, AF1)
+#define GPIO106_CIF_DD_9       MFP_CFG_IN(GPIO106, AF1)
+#define GPIO107_CIF_DD_8       MFP_CFG_IN(GPIO107, AF1)
+#define GPIO108_CIF_DD_7       MFP_CFG_IN(GPIO108, AF1)
+#define GPIO114_CIF_DD_1       MFP_CFG_IN(GPIO114, AF1)
+
+/* Universal Subscriber ID Interface */
+#define GPIO114_UVS0           MFP_CFG_OUT(GPIO114, AF2, DRIVE_LOW)
+#define GPIO115_nUVS1          MFP_CFG_OUT(GPIO115, AF2, DRIVE_LOW)
+#define GPIO116_nUVS2          MFP_CFG_OUT(GPIO116, AF2, DRIVE_LOW)
+#define GPIO14_UCLK            MFP_CFG_OUT(GPIO14, AF3, DRIVE_LOW)
+#define GPIO91_UCLK            MFP_CFG_OUT(GPIO91, AF2, DRIVE_LOW)
+#define GPIO19_nURST           MFP_CFG_OUT(GPIO19, AF3, DRIVE_LOW)
+#define GPIO90_nURST           MFP_CFG_OUT(GPIO90, AF2, DRIVE_LOW)
+#define GPIO116_UDET           MFP_CFG_IN(GPIO116, AF3)
+#define GPIO114_UEN            MFP_CFG_OUT(GPIO114, AF1, DRIVE_LOW)
+#define GPIO115_UEN            MFP_CFG_OUT(GPIO115, AF1, DRIVE_LOW)
+
+/* Mobile Scalable Link (MSL) Interface */
+#define GPIO81_BB_OB_DAT_0     MFP_CFG_OUT(GPIO81, AF2, DRIVE_LOW)
+#define GPIO48_BB_OB_DAT_1     MFP_CFG_OUT(GPIO48, AF1, DRIVE_LOW)
+#define GPIO50_BB_OB_DAT_2     MFP_CFG_OUT(GPIO50, AF1, DRIVE_LOW)
+#define GPIO51_BB_OB_DAT_3     MFP_CFG_OUT(GPIO51, AF1, DRIVE_LOW)
+#define GPIO52_BB_OB_CLK       MFP_CFG_OUT(GPIO52, AF1, DRIVE_LOW)
+#define GPIO53_BB_OB_STB       MFP_CFG_OUT(GPIO53, AF1, DRIVE_LOW)
+#define GPIO54_BB_OB_WAIT      MFP_CFG_IN(GPIO54, AF2)
+#define GPIO82_BB_IB_DAT_0     MFP_CFG_IN(GPIO82, AF2)
+#define GPIO55_BB_IB_DAT_1     MFP_CFG_IN(GPIO55, AF2)
+#define GPIO56_BB_IB_DAT_2     MFP_CFG_IN(GPIO56, AF2)
+#define GPIO57_BB_IB_DAT_3     MFP_CFG_IN(GPIO57, AF2)
+#define GPIO83_BB_IB_CLK       MFP_CFG_IN(GPIO83, AF2)
+#define GPIO84_BB_IB_STB       MFP_CFG_IN(GPIO84, AF2)
+#define GPIO85_BB_IB_WAIT      MFP_CFG_OUT(GPIO85, AF2, DRIVE_LOW)
+
+/* Memory Stick Host Controller */
+#define GPIO92_MSBS            MFP_CFG_OUT(GPIO92, AF2, DRIVE_LOW)
+#define GPIO109_MSSDIO         MFP_CFG_IN(GPIO109, AF2)
+#define GPIO112_nMSINS         MFP_CFG_IN(GPIO112, AF2)
+#define GPIO32_MSSCLK          MFP_CFG_OUT(GPIO32, AF1, DRIVE_LOW)
+
+extern int keypad_set_wake(unsigned int on);
+#endif /* __ASM_ARCH_MFP_PXA27X_H */
diff --git a/include/asm-arm/arch-pxa/mfp-pxa2xx.h b/include/asm-arm/arch-pxa/mfp-pxa2xx.h
new file mode 100644 (file)
index 0000000..db8d890
--- /dev/null
@@ -0,0 +1,132 @@
+#ifndef __ASM_ARCH_MFP_PXA2XX_H
+#define __ASM_ARCH_MFP_PXA2XX_H
+
+#include <asm/arch/mfp.h>
+
+/*
+ * the following MFP_xxx bit definitions in mfp.h are re-used for pxa2xx:
+ *
+ *  MFP_PIN(x)
+ *  MFP_AFx
+ *  MFP_LPM_DRIVE_{LOW, HIGH}
+ *  MFP_LPM_EDGE_x
+ *
+ * other MFP_x bit definitions will be ignored
+ *
+ * and adds the below two bits specifically for pxa2xx:
+ *
+ * bit     23 - Input/Output (PXA2xx specific)
+ * bit     24 - Wakeup Enable(PXA2xx specific)
+ */
+
+#define MFP_DIR_IN             (0x0 << 23)
+#define MFP_DIR_OUT            (0x1 << 23)
+#define MFP_DIR_MASK           (0x1 << 23)
+#define MFP_DIR(x)             (((x) >> 23) & 0x1)
+
+#define MFP_LPM_CAN_WAKEUP     (0x1 << 24)
+#define WAKEUP_ON_EDGE_RISE    (MFP_LPM_CAN_WAKEUP | MFP_LPM_EDGE_RISE)
+#define WAKEUP_ON_EDGE_FALL    (MFP_LPM_CAN_WAKEUP | MFP_LPM_EDGE_FALL)
+#define WAKEUP_ON_EDGE_BOTH    (MFP_LPM_CAN_WAKEUP | MFP_LPM_EDGE_BOTH)
+
+/* specifically for enabling wakeup on keypad GPIOs */
+#define WAKEUP_ON_LEVEL_HIGH   (MFP_LPM_CAN_WAKEUP)
+
+#define MFP_CFG_IN(pin, af)            \
+       ((MFP_CFG_DEFAULT & ~(MFP_AF_MASK | MFP_DIR_MASK)) |\
+        (MFP_PIN(MFP_PIN_##pin) | MFP_##af | MFP_DIR_IN))
+
+/* NOTE:  pins configured as output _must_ provide a low power state,
+ * and this state should help to minimize the power dissipation.
+ */
+#define MFP_CFG_OUT(pin, af, state)    \
+       ((MFP_CFG_DEFAULT & ~(MFP_AF_MASK | MFP_DIR_MASK | MFP_LPM_STATE_MASK)) |\
+        (MFP_PIN(MFP_PIN_##pin) | MFP_##af | MFP_DIR_OUT | MFP_LPM_##state))
+
+/* Common configurations for pxa25x and pxa27x
+ *
+ * Note: pins configured as GPIO are always initialized to input
+ * so not to cause any side effect
+ */
+#define GPIO0_GPIO     MFP_CFG_IN(GPIO0, AF0)
+#define GPIO1_GPIO     MFP_CFG_IN(GPIO1, AF0)
+#define GPIO9_GPIO     MFP_CFG_IN(GPIO9, AF0)
+#define GPIO10_GPIO    MFP_CFG_IN(GPIO10, AF0)
+#define GPIO11_GPIO    MFP_CFG_IN(GPIO11, AF0)
+#define GPIO12_GPIO    MFP_CFG_IN(GPIO12, AF0)
+#define GPIO13_GPIO    MFP_CFG_IN(GPIO13, AF0)
+#define GPIO14_GPIO    MFP_CFG_IN(GPIO14, AF0)
+#define GPIO15_GPIO    MFP_CFG_IN(GPIO15, AF0)
+#define GPIO16_GPIO    MFP_CFG_IN(GPIO16, AF0)
+#define GPIO17_GPIO    MFP_CFG_IN(GPIO17, AF0)
+#define GPIO18_GPIO    MFP_CFG_IN(GPIO18, AF0)
+#define GPIO19_GPIO    MFP_CFG_IN(GPIO19, AF0)
+#define GPIO20_GPIO    MFP_CFG_IN(GPIO20, AF0)
+#define GPIO21_GPIO    MFP_CFG_IN(GPIO21, AF0)
+#define GPIO22_GPIO    MFP_CFG_IN(GPIO22, AF0)
+#define GPIO23_GPIO    MFP_CFG_IN(GPIO23, AF0)
+#define GPIO24_GPIO    MFP_CFG_IN(GPIO24, AF0)
+#define GPIO25_GPIO    MFP_CFG_IN(GPIO25, AF0)
+#define GPIO26_GPIO    MFP_CFG_IN(GPIO26, AF0)
+#define GPIO27_GPIO    MFP_CFG_IN(GPIO27, AF0)
+#define GPIO28_GPIO    MFP_CFG_IN(GPIO28, AF0)
+#define GPIO29_GPIO    MFP_CFG_IN(GPIO29, AF0)
+#define GPIO30_GPIO    MFP_CFG_IN(GPIO30, AF0)
+#define GPIO31_GPIO    MFP_CFG_IN(GPIO31, AF0)
+#define GPIO32_GPIO    MFP_CFG_IN(GPIO32, AF0)
+#define GPIO33_GPIO    MFP_CFG_IN(GPIO33, AF0)
+#define GPIO34_GPIO    MFP_CFG_IN(GPIO34, AF0)
+#define GPIO35_GPIO    MFP_CFG_IN(GPIO35, AF0)
+#define GPIO36_GPIO    MFP_CFG_IN(GPIO36, AF0)
+#define GPIO37_GPIO    MFP_CFG_IN(GPIO37, AF0)
+#define GPIO38_GPIO    MFP_CFG_IN(GPIO38, AF0)
+#define GPIO39_GPIO    MFP_CFG_IN(GPIO39, AF0)
+#define GPIO40_GPIO    MFP_CFG_IN(GPIO40, AF0)
+#define GPIO41_GPIO    MFP_CFG_IN(GPIO41, AF0)
+#define GPIO42_GPIO    MFP_CFG_IN(GPIO42, AF0)
+#define GPIO43_GPIO    MFP_CFG_IN(GPIO43, AF0)
+#define GPIO44_GPIO    MFP_CFG_IN(GPIO44, AF0)
+#define GPIO45_GPIO    MFP_CFG_IN(GPIO45, AF0)
+#define GPIO46_GPIO    MFP_CFG_IN(GPIO46, AF0)
+#define GPIO47_GPIO    MFP_CFG_IN(GPIO47, AF0)
+#define GPIO48_GPIO    MFP_CFG_IN(GPIO48, AF0)
+#define GPIO49_GPIO    MFP_CFG_IN(GPIO49, AF0)
+#define GPIO50_GPIO    MFP_CFG_IN(GPIO50, AF0)
+#define GPIO51_GPIO    MFP_CFG_IN(GPIO51, AF0)
+#define GPIO52_GPIO    MFP_CFG_IN(GPIO52, AF0)
+#define GPIO53_GPIO    MFP_CFG_IN(GPIO53, AF0)
+#define GPIO54_GPIO    MFP_CFG_IN(GPIO54, AF0)
+#define GPIO55_GPIO    MFP_CFG_IN(GPIO55, AF0)
+#define GPIO56_GPIO    MFP_CFG_IN(GPIO56, AF0)
+#define GPIO57_GPIO    MFP_CFG_IN(GPIO57, AF0)
+#define GPIO58_GPIO    MFP_CFG_IN(GPIO58, AF0)
+#define GPIO59_GPIO    MFP_CFG_IN(GPIO59, AF0)
+#define GPIO60_GPIO    MFP_CFG_IN(GPIO60, AF0)
+#define GPIO61_GPIO    MFP_CFG_IN(GPIO61, AF0)
+#define GPIO62_GPIO    MFP_CFG_IN(GPIO62, AF0)
+#define GPIO63_GPIO    MFP_CFG_IN(GPIO63, AF0)
+#define GPIO64_GPIO    MFP_CFG_IN(GPIO64, AF0)
+#define GPIO65_GPIO    MFP_CFG_IN(GPIO65, AF0)
+#define GPIO66_GPIO    MFP_CFG_IN(GPIO66, AF0)
+#define GPIO67_GPIO    MFP_CFG_IN(GPIO67, AF0)
+#define GPIO68_GPIO    MFP_CFG_IN(GPIO68, AF0)
+#define GPIO69_GPIO    MFP_CFG_IN(GPIO69, AF0)
+#define GPIO70_GPIO    MFP_CFG_IN(GPIO70, AF0)
+#define GPIO71_GPIO    MFP_CFG_IN(GPIO71, AF0)
+#define GPIO72_GPIO    MFP_CFG_IN(GPIO72, AF0)
+#define GPIO73_GPIO    MFP_CFG_IN(GPIO73, AF0)
+#define GPIO74_GPIO    MFP_CFG_IN(GPIO74, AF0)
+#define GPIO75_GPIO    MFP_CFG_IN(GPIO75, AF0)
+#define GPIO76_GPIO    MFP_CFG_IN(GPIO76, AF0)
+#define GPIO77_GPIO    MFP_CFG_IN(GPIO77, AF0)
+#define GPIO78_GPIO    MFP_CFG_IN(GPIO78, AF0)
+#define GPIO79_GPIO    MFP_CFG_IN(GPIO79, AF0)
+#define GPIO80_GPIO    MFP_CFG_IN(GPIO80, AF0)
+#define GPIO81_GPIO    MFP_CFG_IN(GPIO81, AF0)
+#define GPIO82_GPIO    MFP_CFG_IN(GPIO82, AF0)
+#define GPIO83_GPIO    MFP_CFG_IN(GPIO83, AF0)
+#define GPIO84_GPIO    MFP_CFG_IN(GPIO84, AF0)
+
+extern void pxa2xx_mfp_config(unsigned long *mfp_cfgs, int num);
+extern int gpio_set_wake(unsigned int gpio, unsigned int on);
+#endif /* __ASM_ARCH_MFP_PXA2XX_H */
index 2357a73340d4200c39743268fe930826d341a601..a322012f16acf55f66dd28fb3870fcb7bfed5505 100644 (file)
 #define ICPR           __REG(0x40D00010)  /* Interrupt Controller Pending Register */
 #define ICCR           __REG(0x40D00014)  /* Interrupt Controller Control Register */
 
+#define ICIP2          __REG(0x40D0009C)  /* Interrupt Controller IRQ Pending Register 2 */
+#define ICMR2          __REG(0x40D000A0)  /* Interrupt Controller Mask Register 2 */
+#define ICLR2          __REG(0x40D000A4)  /* Interrupt Controller Level Register 2 */
+#define ICFP2          __REG(0x40D000A8)  /* Interrupt Controller FIQ Pending Register 2 */
+#define ICPR2          __REG(0x40D000AC)  /* Interrupt Controller Pending Register 2 */
 
 /*
  * General Purpose I/O
 
 /* Interrupt Controller */
 
-#define ICIP2          __REG(0x40D0009C)  /* Interrupt Controller IRQ Pending Register 2 */
-#define ICMR2          __REG(0x40D000A0)  /* Interrupt Controller Mask Register 2 */
-#define ICLR2          __REG(0x40D000A4)  /* Interrupt Controller Level Register 2 */
-#define ICFP2          __REG(0x40D000A8)  /* Interrupt Controller FIQ Pending Register 2 */
-#define ICPR2          __REG(0x40D000AC)  /* Interrupt Controller Pending Register 2 */
-
 #define _GPLR(x)       __REG2(0x40E00000, ((x) & 0x60) >> 3)
 #define _GPDR(x)       __REG2(0x40E0000C, ((x) & 0x60) >> 3)
 #define _GPSR(x)       __REG2(0x40E00018, ((x) & 0x60) >> 3)
 
 #endif
 
-
-/* GPIO alternate function assignments */
-
-#define GPIO1_RST              1       /* reset */
-#define GPIO6_MMCCLK           6       /* MMC Clock */
-#define GPIO7_48MHz            7       /* 48 MHz clock output */
-#define GPIO8_MMCCS0           8       /* MMC Chip Select 0 */
-#define GPIO9_MMCCS1           9       /* MMC Chip Select 1 */
-#define GPIO10_RTCCLK          10      /* real time clock (1 Hz) */
-#define GPIO11_3_6MHz          11      /* 3.6 MHz oscillator out */
-#define GPIO12_32KHz           12      /* 32 kHz out */
-#define GPIO13_MBGNT           13      /* memory controller grant */
-#define GPIO14_MBREQ           14      /* alternate bus master request */
-#define GPIO15_nCS_1           15      /* chip select 1 */
-#define GPIO16_PWM0            16      /* PWM0 output */
-#define GPIO17_PWM1            17      /* PWM1 output */
-#define GPIO18_RDY             18      /* Ext. Bus Ready */
-#define GPIO19_DREQ1           19      /* External DMA Request */
-#define GPIO20_DREQ0           20      /* External DMA Request */
-#define GPIO23_SCLK            23      /* SSP clock */
-#define GPIO24_SFRM            24      /* SSP Frame */
-#define GPIO25_STXD            25      /* SSP transmit */
-#define GPIO26_SRXD            26      /* SSP receive */
-#define GPIO27_SEXTCLK         27      /* SSP ext_clk */
-#define GPIO28_BITCLK          28      /* AC97/I2S bit_clk */
-#define GPIO29_SDATA_IN                29      /* AC97 Sdata_in0 / I2S Sdata_in */
-#define GPIO30_SDATA_OUT       30      /* AC97/I2S Sdata_out */
-#define GPIO31_SYNC            31      /* AC97/I2S sync */
-#define GPIO32_SDATA_IN1       32      /* AC97 Sdata_in1 */
-#define GPIO32_SYSCLK          32      /* I2S System Clock */
-#define GPIO32_MMCCLK          32      /* MMC Clock (PXA270) */
-#define GPIO33_nCS_5           33      /* chip select 5 */
-#define GPIO34_FFRXD           34      /* FFUART receive */
-#define GPIO34_MMCCS0          34      /* MMC Chip Select 0 */
-#define GPIO35_FFCTS           35      /* FFUART Clear to send */
-#define GPIO36_FFDCD           36      /* FFUART Data carrier detect */
-#define GPIO37_FFDSR           37      /* FFUART data set ready */
-#define GPIO38_FFRI            38      /* FFUART Ring Indicator */
-#define GPIO39_MMCCS1          39      /* MMC Chip Select 1 */
-#define GPIO39_FFTXD           39      /* FFUART transmit data */
-#define GPIO40_FFDTR           40      /* FFUART data terminal Ready */
-#define GPIO41_FFRTS           41      /* FFUART request to send */
-#define GPIO42_BTRXD           42      /* BTUART receive data */
-#define GPIO42_HWRXD           42      /* HWUART receive data */
-#define GPIO43_BTTXD           43      /* BTUART transmit data */
-#define GPIO43_HWTXD           43      /* HWUART transmit data */
-#define GPIO44_BTCTS           44      /* BTUART clear to send */
-#define GPIO44_HWCTS           44      /* HWUART clear to send */
-#define GPIO45_BTRTS           45      /* BTUART request to send */
-#define GPIO45_HWRTS           45      /* HWUART request to send */
-#define GPIO45_AC97_SYSCLK     45      /* AC97 System Clock */
-#define GPIO46_ICPRXD          46      /* ICP receive data */
-#define GPIO46_STRXD           46      /* STD_UART receive data */
-#define GPIO47_ICPTXD          47      /* ICP transmit data */
-#define GPIO47_STTXD           47      /* STD_UART transmit data */
-#define GPIO48_nPOE            48      /* Output Enable for Card Space */
-#define GPIO49_nPWE            49      /* Write Enable for Card Space */
-#define GPIO50_nPIOR           50      /* I/O Read for Card Space */
-#define GPIO51_nPIOW           51      /* I/O Write for Card Space */
-#define GPIO52_nPCE_1          52      /* Card Enable for Card Space */
-#define GPIO53_nPCE_2          53      /* Card Enable for Card Space */
-#define GPIO53_MMCCLK          53      /* MMC Clock */
-#define GPIO54_MMCCLK          54      /* MMC Clock */
-#define GPIO54_pSKTSEL         54      /* Socket Select for Card Space */
-#define GPIO54_nPCE_2          54      /* Card Enable for Card Space (PXA27x) */
-#define GPIO55_nPREG           55      /* Card Address bit 26 */
-#define GPIO56_nPWAIT          56      /* Wait signal for Card Space */
-#define GPIO57_nIOIS16         57      /* Bus Width select for I/O Card Space */
-#define GPIO58_LDD_0           58      /* LCD data pin 0 */
-#define GPIO59_LDD_1           59      /* LCD data pin 1 */
-#define GPIO60_LDD_2           60      /* LCD data pin 2 */
-#define GPIO61_LDD_3           61      /* LCD data pin 3 */
-#define GPIO62_LDD_4           62      /* LCD data pin 4 */
-#define GPIO63_LDD_5           63      /* LCD data pin 5 */
-#define GPIO64_LDD_6           64      /* LCD data pin 6 */
-#define GPIO65_LDD_7           65      /* LCD data pin 7 */
-#define GPIO66_LDD_8           66      /* LCD data pin 8 */
-#define GPIO66_MBREQ           66      /* alternate bus master req */
-#define GPIO67_LDD_9           67      /* LCD data pin 9 */
-#define GPIO67_MMCCS0          67      /* MMC Chip Select 0 */
-#define GPIO68_LDD_10          68      /* LCD data pin 10 */
-#define GPIO68_MMCCS1          68      /* MMC Chip Select 1 */
-#define GPIO69_LDD_11          69      /* LCD data pin 11 */
-#define GPIO69_MMCCLK          69      /* MMC_CLK */
-#define GPIO70_LDD_12          70      /* LCD data pin 12 */
-#define GPIO70_RTCCLK          70      /* Real Time clock (1 Hz) */
-#define GPIO71_LDD_13          71      /* LCD data pin 13 */
-#define GPIO71_3_6MHz          71      /* 3.6 MHz Oscillator clock */
-#define GPIO72_LDD_14          72      /* LCD data pin 14 */
-#define GPIO72_32kHz           72      /* 32 kHz clock */
-#define GPIO73_LDD_15          73      /* LCD data pin 15 */
-#define GPIO73_MBGNT           73      /* Memory controller grant */
-#define GPIO74_LCD_FCLK                74      /* LCD Frame clock */
-#define GPIO75_LCD_LCLK                75      /* LCD line clock */
-#define GPIO76_LCD_PCLK                76      /* LCD Pixel clock */
-#define GPIO77_LCD_ACBIAS      77      /* LCD AC Bias */
-#define GPIO78_nCS_2           78      /* chip select 2 */
-#define GPIO79_nCS_3           79      /* chip select 3 */
-#define GPIO80_nCS_4           80      /* chip select 4 */
-#define GPIO81_NSCLK           81      /* NSSP clock */
-#define GPIO82_NSFRM           82      /* NSSP Frame */
-#define GPIO83_NSTXD           83      /* NSSP transmit */
-#define GPIO84_NSRXD           84      /* NSSP receive */
-#define GPIO85_nPCE_1          85      /* Card Enable for Card Space (PXA27x) */
-#define GPIO92_MMCDAT0         92      /* MMC DAT0 (PXA27x) */
-#define GPIO102_nPCE_1         102     /* PCMCIA (PXA27x) */
-#define GPIO109_MMCDAT1                109     /* MMC DAT1 (PXA27x) */
-#define GPIO110_MMCDAT2                110     /* MMC DAT2 (PXA27x) */
-#define GPIO110_MMCCS0         110     /* MMC Chip Select 0 (PXA27x) */
-#define GPIO111_MMCDAT3                111     /* MMC DAT3 (PXA27x) */
-#define GPIO111_MMCCS1         111     /* MMC Chip Select 1 (PXA27x) */
-#define GPIO112_MMCCMD         112     /* MMC CMD (PXA27x) */
-#define GPIO113_I2S_SYSCLK     113     /* I2S System Clock (PXA27x) */
-#define GPIO113_AC97_RESET_N   113     /* AC97 NRESET on (PXA27x) */
-
-/* GPIO alternate function mode & direction */
-
-#define GPIO_IN                        0x000
-#define GPIO_OUT               0x080
-#define GPIO_ALT_FN_1_IN       0x100
-#define GPIO_ALT_FN_1_OUT      0x180
-#define GPIO_ALT_FN_2_IN       0x200
-#define GPIO_ALT_FN_2_OUT      0x280
-#define GPIO_ALT_FN_3_IN       0x300
-#define GPIO_ALT_FN_3_OUT      0x380
-#define GPIO_MD_MASK_NR                0x07f
-#define GPIO_MD_MASK_DIR       0x080
-#define GPIO_MD_MASK_FN                0x300
-#define GPIO_DFLT_LOW          0x400
-#define GPIO_DFLT_HIGH         0x800
-
-#define GPIO1_RTS_MD           ( 1 | GPIO_ALT_FN_1_IN)
-#define GPIO6_MMCCLK_MD                ( 6 | GPIO_ALT_FN_1_OUT)
-#define GPIO7_48MHz_MD         ( 7 | GPIO_ALT_FN_1_OUT)
-#define GPIO8_MMCCS0_MD                ( 8 | GPIO_ALT_FN_1_OUT)
-#define GPIO9_MMCCS1_MD                ( 9 | GPIO_ALT_FN_1_OUT)
-#define GPIO10_RTCCLK_MD       (10 | GPIO_ALT_FN_1_OUT)
-#define GPIO11_3_6MHz_MD       (11 | GPIO_ALT_FN_1_OUT)
-#define GPIO12_32KHz_MD                (12 | GPIO_ALT_FN_1_OUT)
-#define GPIO13_MBGNT_MD                (13 | GPIO_ALT_FN_2_OUT)
-#define GPIO14_MBREQ_MD                (14 | GPIO_ALT_FN_1_IN)
-#define GPIO15_nCS_1_MD                (15 | GPIO_ALT_FN_2_OUT)
-#define GPIO16_PWM0_MD         (16 | GPIO_ALT_FN_2_OUT)
-#define GPIO17_PWM1_MD         (17 | GPIO_ALT_FN_2_OUT)
-#define GPIO18_RDY_MD          (18 | GPIO_ALT_FN_1_IN)
-#define GPIO19_DREQ1_MD                (19 | GPIO_ALT_FN_1_IN)
-#define GPIO20_DREQ0_MD                (20 | GPIO_ALT_FN_1_IN)
-#define GPIO23_SCLK_MD         (23 | GPIO_ALT_FN_2_OUT)
-#define GPIO24_SFRM_MD         (24 | GPIO_ALT_FN_2_OUT)
-#define GPIO25_STXD_MD         (25 | GPIO_ALT_FN_2_OUT)
-#define GPIO26_SRXD_MD         (26 | GPIO_ALT_FN_1_IN)
-#define GPIO27_SEXTCLK_MD      (27 | GPIO_ALT_FN_1_IN)
-#define GPIO28_BITCLK_AC97_MD  (28 | GPIO_ALT_FN_1_IN)
-#define GPIO28_BITCLK_IN_I2S_MD        (28 | GPIO_ALT_FN_2_IN)
-#define GPIO28_BITCLK_OUT_I2S_MD       (28 | GPIO_ALT_FN_1_OUT)
-#define GPIO29_SDATA_IN_AC97_MD        (29 | GPIO_ALT_FN_1_IN)
-#define GPIO29_SDATA_IN_I2S_MD (29 | GPIO_ALT_FN_2_IN)
-#define GPIO30_SDATA_OUT_AC97_MD       (30 | GPIO_ALT_FN_2_OUT)
-#define GPIO30_SDATA_OUT_I2S_MD        (30 | GPIO_ALT_FN_1_OUT)
-#define GPIO31_SYNC_I2S_MD     (31 | GPIO_ALT_FN_1_OUT)
-#define GPIO31_SYNC_AC97_MD    (31 | GPIO_ALT_FN_2_OUT)
-#define GPIO32_SDATA_IN1_AC97_MD       (32 | GPIO_ALT_FN_1_IN)
-#define GPIO32_SYSCLK_I2S_MD   (32 | GPIO_ALT_FN_1_OUT)
-#define GPIO32_MMCCLK_MD               ( 32 | GPIO_ALT_FN_2_OUT)
-#define GPIO33_nCS_5_MD                (33 | GPIO_ALT_FN_2_OUT)
-#define GPIO34_FFRXD_MD                (34 | GPIO_ALT_FN_1_IN)
-#define GPIO34_MMCCS0_MD       (34 | GPIO_ALT_FN_2_OUT)
-#define GPIO35_FFCTS_MD                (35 | GPIO_ALT_FN_1_IN)
-#define GPIO36_FFDCD_MD                (36 | GPIO_ALT_FN_1_IN)
-#define GPIO37_FFDSR_MD                (37 | GPIO_ALT_FN_1_IN)
-#define GPIO38_FFRI_MD         (38 | GPIO_ALT_FN_1_IN)
-#define GPIO39_MMCCS1_MD       (39 | GPIO_ALT_FN_1_OUT)
-#define GPIO39_FFTXD_MD                (39 | GPIO_ALT_FN_2_OUT)
-#define GPIO40_FFDTR_MD                (40 | GPIO_ALT_FN_2_OUT)
-#define GPIO41_FFRTS_MD                (41 | GPIO_ALT_FN_2_OUT)
-#define GPIO42_BTRXD_MD                (42 | GPIO_ALT_FN_1_IN)
-#define GPIO42_HWRXD_MD                (42 | GPIO_ALT_FN_3_IN)
-#define GPIO43_BTTXD_MD                (43 | GPIO_ALT_FN_2_OUT)
-#define GPIO43_HWTXD_MD                (43 | GPIO_ALT_FN_3_OUT)
-#define GPIO44_BTCTS_MD                (44 | GPIO_ALT_FN_1_IN)
-#define GPIO44_HWCTS_MD                (44 | GPIO_ALT_FN_3_IN)
-#define GPIO45_BTRTS_MD                (45 | GPIO_ALT_FN_2_OUT)
-#define GPIO45_HWRTS_MD                (45 | GPIO_ALT_FN_3_OUT)
-#define GPIO45_SYSCLK_AC97_MD          (45 | GPIO_ALT_FN_1_OUT)
-#define GPIO46_ICPRXD_MD       (46 | GPIO_ALT_FN_1_IN)
-#define GPIO46_STRXD_MD                (46 | GPIO_ALT_FN_2_IN)
-#define GPIO47_ICPTXD_MD       (47 | GPIO_ALT_FN_2_OUT)
-#define GPIO47_STTXD_MD                (47 | GPIO_ALT_FN_1_OUT)
-#define GPIO48_nPOE_MD         (48 | GPIO_ALT_FN_2_OUT)
-#define GPIO48_HWTXD_MD         (48 | GPIO_ALT_FN_1_OUT)
-#define GPIO48_nPOE_MD          (48 | GPIO_ALT_FN_2_OUT)
-#define GPIO49_HWRXD_MD                (49 | GPIO_ALT_FN_1_IN)
-#define GPIO49_nPWE_MD         (49 | GPIO_ALT_FN_2_OUT)
-#define GPIO50_nPIOR_MD                (50 | GPIO_ALT_FN_2_OUT)
-#define GPIO50_HWCTS_MD         (50 | GPIO_ALT_FN_1_IN)
-#define GPIO51_HWRTS_MD         (51 | GPIO_ALT_FN_1_OUT)
-#define GPIO51_nPIOW_MD                (51 | GPIO_ALT_FN_2_OUT)
-#define GPIO52_nPCE_1_MD       (52 | GPIO_ALT_FN_2_OUT)
-#define GPIO53_nPCE_2_MD       (53 | GPIO_ALT_FN_2_OUT)
-#define GPIO53_MMCCLK_MD       (53 | GPIO_ALT_FN_1_OUT)
-#define GPIO54_MMCCLK_MD       (54 | GPIO_ALT_FN_1_OUT)
-#define GPIO54_nPCE_2_MD       (54 | GPIO_ALT_FN_2_OUT)
-#define GPIO54_pSKTSEL_MD      (54 | GPIO_ALT_FN_2_OUT)
-#define GPIO55_nPREG_MD                (55 | GPIO_ALT_FN_2_OUT)
-#define GPIO56_nPWAIT_MD       (56 | GPIO_ALT_FN_1_IN)
-#define GPIO57_nIOIS16_MD      (57 | GPIO_ALT_FN_1_IN)
-#define GPIO58_LDD_0_MD                (58 | GPIO_ALT_FN_2_OUT)
-#define GPIO59_LDD_1_MD                (59 | GPIO_ALT_FN_2_OUT)
-#define GPIO60_LDD_2_MD                (60 | GPIO_ALT_FN_2_OUT)
-#define GPIO61_LDD_3_MD                (61 | GPIO_ALT_FN_2_OUT)
-#define GPIO62_LDD_4_MD                (62 | GPIO_ALT_FN_2_OUT)
-#define GPIO63_LDD_5_MD                (63 | GPIO_ALT_FN_2_OUT)
-#define GPIO64_LDD_6_MD                (64 | GPIO_ALT_FN_2_OUT)
-#define GPIO65_LDD_7_MD                (65 | GPIO_ALT_FN_2_OUT)
-#define GPIO66_LDD_8_MD                (66 | GPIO_ALT_FN_2_OUT)
-#define GPIO66_MBREQ_MD                (66 | GPIO_ALT_FN_1_IN)
-#define GPIO67_LDD_9_MD                (67 | GPIO_ALT_FN_2_OUT)
-#define GPIO67_MMCCS0_MD       (67 | GPIO_ALT_FN_1_OUT)
-#define GPIO68_LDD_10_MD       (68 | GPIO_ALT_FN_2_OUT)
-#define GPIO68_MMCCS1_MD       (68 | GPIO_ALT_FN_1_OUT)
-#define GPIO69_LDD_11_MD       (69 | GPIO_ALT_FN_2_OUT)
-#define GPIO69_MMCCLK_MD       (69 | GPIO_ALT_FN_1_OUT)
-#define GPIO70_LDD_12_MD       (70 | GPIO_ALT_FN_2_OUT)
-#define GPIO70_RTCCLK_MD       (70 | GPIO_ALT_FN_1_OUT)
-#define GPIO71_LDD_13_MD       (71 | GPIO_ALT_FN_2_OUT)
-#define GPIO71_3_6MHz_MD       (71 | GPIO_ALT_FN_1_OUT)
-#define GPIO72_LDD_14_MD       (72 | GPIO_ALT_FN_2_OUT)
-#define GPIO72_32kHz_MD                (72 | GPIO_ALT_FN_1_OUT)
-#define GPIO73_LDD_15_MD       (73 | GPIO_ALT_FN_2_OUT)
-#define GPIO73_MBGNT_MD                (73 | GPIO_ALT_FN_1_OUT)
-#define GPIO74_LCD_FCLK_MD     (74 | GPIO_ALT_FN_2_OUT)
-#define GPIO75_LCD_LCLK_MD     (75 | GPIO_ALT_FN_2_OUT)
-#define GPIO76_LCD_PCLK_MD     (76 | GPIO_ALT_FN_2_OUT)
-#define GPIO77_LCD_ACBIAS_MD   (77 | GPIO_ALT_FN_2_OUT)
-#define GPIO78_nCS_2_MD                (78 | GPIO_ALT_FN_2_OUT)
-#define GPIO79_nCS_3_MD                (79 | GPIO_ALT_FN_2_OUT)
-#define GPIO79_pSKTSEL_MD      (79 | GPIO_ALT_FN_1_OUT)
-#define GPIO80_nCS_4_MD                (80 | GPIO_ALT_FN_2_OUT)
-#define GPIO81_NSSP_CLK_OUT    (81 | GPIO_ALT_FN_1_OUT)
-#define GPIO81_NSSP_CLK_IN     (81 | GPIO_ALT_FN_1_IN)
-#define GPIO82_NSSP_FRM_OUT    (82 | GPIO_ALT_FN_1_OUT)
-#define GPIO82_NSSP_FRM_IN     (82 | GPIO_ALT_FN_1_IN)
-#define GPIO83_NSSP_TX         (83 | GPIO_ALT_FN_1_OUT)
-#define GPIO83_NSSP_RX         (83 | GPIO_ALT_FN_2_IN)
-#define GPIO84_NSSP_TX         (84 | GPIO_ALT_FN_1_OUT)
-#define GPIO84_NSSP_RX         (84 | GPIO_ALT_FN_2_IN)
-#define GPIO85_nPCE_1_MD       (85 | GPIO_ALT_FN_1_OUT)
-#define GPIO92_MMCDAT0_MD      (92 | GPIO_ALT_FN_1_OUT)
-#define GPIO102_nPCE_1_MD      (102 | GPIO_ALT_FN_1_OUT)
-#define GPIO104_pSKTSEL_MD     (104 | GPIO_ALT_FN_1_OUT)
-#define GPIO109_MMCDAT1_MD     (109 | GPIO_ALT_FN_1_OUT)
-#define GPIO110_MMCDAT2_MD     (110 | GPIO_ALT_FN_1_OUT)
-#define GPIO110_MMCCS0_MD      (110 | GPIO_ALT_FN_1_OUT)
-#define GPIO111_MMCDAT3_MD     (111 | GPIO_ALT_FN_1_OUT)
-#define GPIO110_MMCCS1_MD      (111 | GPIO_ALT_FN_1_OUT)
-#define GPIO112_MMCCMD_MD      (112 | GPIO_ALT_FN_1_OUT)
-#define GPIO113_I2S_SYSCLK_MD  (113 | GPIO_ALT_FN_1_OUT)
-#define GPIO113_AC97_RESET_N_MD        (113 | GPIO_ALT_FN_2_OUT)
-#define GPIO117_I2CSCL_MD      (117 | GPIO_ALT_FN_1_IN)
-#define GPIO118_I2CSDA_MD      (118 | GPIO_ALT_FN_1_IN)
-
 /*
  * Power Manager
  */
 
 #ifdef CONFIG_PXA27x
 
-/*
- * Keypad
- */
-#define KPC             __REG(0x41500000) /* Keypad Interface Control register */
-#define KPDK            __REG(0x41500008) /* Keypad Interface Direct Key register */
-#define KPREC           __REG(0x41500010) /* Keypad Interface Rotary Encoder register */
-#define KPMK            __REG(0x41500018) /* Keypad Interface Matrix Key register */
-#define KPAS            __REG(0x41500020) /* Keypad Interface Automatic Scan register */
-#define KPASMKP0        __REG(0x41500028) /* Keypad Interface Automatic Scan Multiple Key Presser register 0 */
-#define KPASMKP1        __REG(0x41500030) /* Keypad Interface Automatic Scan Multiple Key Presser register 1 */
-#define KPASMKP2        __REG(0x41500038) /* Keypad Interface Automatic Scan Multiple Key Presser register 2 */
-#define KPASMKP3        __REG(0x41500040) /* Keypad Interface Automatic Scan Multiple Key Presser register 3 */
-#define KPKDI           __REG(0x41500048) /* Keypad Interface Key Debounce Interval register */
-
-#define KPC_AS          (0x1 << 30)  /* Automatic Scan bit */
-#define KPC_ASACT       (0x1 << 29)  /* Automatic Scan on Activity */
-#define KPC_MI          (0x1 << 22)  /* Matrix interrupt bit */
-#define KPC_IMKP        (0x1 << 21)  /* Ignore Multiple Key Press */
-#define KPC_MS7         (0x1 << 20)  /* Matrix scan line 7 */
-#define KPC_MS6         (0x1 << 19)  /* Matrix scan line 6 */
-#define KPC_MS5         (0x1 << 18)  /* Matrix scan line 5 */
-#define KPC_MS4         (0x1 << 17)  /* Matrix scan line 4 */
-#define KPC_MS3         (0x1 << 16)  /* Matrix scan line 3 */
-#define KPC_MS2         (0x1 << 15)  /* Matrix scan line 2 */
-#define KPC_MS1         (0x1 << 14)  /* Matrix scan line 1 */
-#define KPC_MS0         (0x1 << 13)  /* Matrix scan line 0 */
-#define KPC_MS_ALL      (KPC_MS0 | KPC_MS1 | KPC_MS2 | KPC_MS3 | KPC_MS4 | KPC_MS5 | KPC_MS6 | KPC_MS7)
-#define KPC_ME          (0x1 << 12)  /* Matrix Keypad Enable */
-#define KPC_MIE         (0x1 << 11)  /* Matrix Interrupt Enable */
-#define KPC_DK_DEB_SEL (0x1 <<  9)  /* Direct Keypad Debounce Select */
-#define KPC_DI          (0x1 <<  5)  /* Direct key interrupt bit */
-#define KPC_RE_ZERO_DEB (0x1 <<  4)  /* Rotary Encoder Zero Debounce */
-#define KPC_REE1        (0x1 <<  3)  /* Rotary Encoder1 Enable */
-#define KPC_REE0        (0x1 <<  2)  /* Rotary Encoder0 Enable */
-#define KPC_DE          (0x1 <<  1)  /* Direct Keypad Enable */
-#define KPC_DIE         (0x1 <<  0)  /* Direct Keypad interrupt Enable */
-
-#define KPDK_DKP        (0x1 << 31)
-#define KPDK_DK7        (0x1 <<  7)
-#define KPDK_DK6        (0x1 <<  6)
-#define KPDK_DK5        (0x1 <<  5)
-#define KPDK_DK4        (0x1 <<  4)
-#define KPDK_DK3        (0x1 <<  3)
-#define KPDK_DK2        (0x1 <<  2)
-#define KPDK_DK1        (0x1 <<  1)
-#define KPDK_DK0        (0x1 <<  0)
-
-#define KPREC_OF1       (0x1 << 31)
-#define kPREC_UF1       (0x1 << 30)
-#define KPREC_OF0       (0x1 << 15)
-#define KPREC_UF0       (0x1 << 14)
-
-#define KPMK_MKP        (0x1 << 31)
-#define KPAS_SO         (0x1 << 31)
-#define KPASMKPx_SO     (0x1 << 31)
-
 /* Camera Interface */
 #define CICR0          __REG(0x50000000)
 #define CICR1          __REG(0x50000004)
 #define CICR0_FOM      (1 << 0)        /* FIFO-overrun mask */
 
 #define CICR1_TBIT     (1 << 31)       /* Transparency bit */
-#define CICR1_RGBT_CONV        (0x3 << 30)     /* RGBT conversion mask */
+#define CICR1_RGBT_CONV        (0x3 << 29)     /* RGBT conversion mask */
 #define CICR1_PPL      (0x7ff << 15)   /* Pixels per line mask */
 #define CICR1_RGB_CONV (0x7 << 12)     /* RGB conversion mask */
 #define CICR1_RGB_F    (1 << 11)       /* RGB format */
index 644f7609b523f7fd617cbf291054e2aae5a991fe..d5a48a96dea73471c3cf22e94d73b4f67131fd5b 100644 (file)
@@ -53,4 +53,6 @@ struct pxa27x_keypad_platform_data {
 
 #define KEY(row, col, val)     (((row) << 28) | ((col) << 24) | (val))
 
+extern void pxa_set_keypad_info(struct pxa27x_keypad_platform_data *info);
+
 #endif /* __ASM_ARCH_PXA27x_KEYPAD_H */
diff --git a/include/asm-arm/arch-pxa/pxa2xx-gpio.h b/include/asm-arm/arch-pxa/pxa2xx-gpio.h
new file mode 100644 (file)
index 0000000..763313c
--- /dev/null
@@ -0,0 +1,357 @@
+#ifndef __ASM_ARCH_PXA2XX_GPIO_H
+#define __ASM_ARCH_PXA2XX_GPIO_H
+
+/* GPIO alternate function assignments */
+
+#define GPIO1_RST              1       /* reset */
+#define GPIO6_MMCCLK           6       /* MMC Clock */
+#define GPIO7_48MHz            7       /* 48 MHz clock output */
+#define GPIO8_MMCCS0           8       /* MMC Chip Select 0 */
+#define GPIO9_MMCCS1           9       /* MMC Chip Select 1 */
+#define GPIO10_RTCCLK          10      /* real time clock (1 Hz) */
+#define GPIO11_3_6MHz          11      /* 3.6 MHz oscillator out */
+#define GPIO12_32KHz           12      /* 32 kHz out */
+#define GPIO12_CIF_DD_7                12      /* Camera data pin 7 */
+#define GPIO13_MBGNT           13      /* memory controller grant */
+#define GPIO14_MBREQ           14      /* alternate bus master request */
+#define GPIO15_nCS_1           15      /* chip select 1 */
+#define GPIO16_PWM0            16      /* PWM0 output */
+#define GPIO17_PWM1            17      /* PWM1 output */
+#define GPIO17_CIF_DD_6                17      /* Camera data pin 6 */
+#define GPIO18_RDY             18      /* Ext. Bus Ready */
+#define GPIO19_DREQ1           19      /* External DMA Request */
+#define GPIO20_DREQ0           20      /* External DMA Request */
+#define GPIO23_SCLK            23      /* SSP clock */
+#define GPIO23_CIF_MCLK                23      /* Camera Master Clock */
+#define GPIO24_SFRM            24      /* SSP Frame */
+#define GPIO24_CIF_FV          24      /* Camera frame start signal */
+#define GPIO25_STXD            25      /* SSP transmit */
+#define GPIO25_CIF_LV          25      /* Camera line start signal */
+#define GPIO26_SRXD            26      /* SSP receive */
+#define GPIO26_CIF_PCLK                26      /* Camera Pixel Clock */
+#define GPIO27_SEXTCLK         27      /* SSP ext_clk */
+#define GPIO27_CIF_DD_0                27      /* Camera data pin 0 */
+#define GPIO28_BITCLK          28      /* AC97/I2S bit_clk */
+#define GPIO29_SDATA_IN                29      /* AC97 Sdata_in0 / I2S Sdata_in */
+#define GPIO30_SDATA_OUT       30      /* AC97/I2S Sdata_out */
+#define GPIO31_SYNC            31      /* AC97/I2S sync */
+#define GPIO32_SDATA_IN1       32      /* AC97 Sdata_in1 */
+#define GPIO32_SYSCLK          32      /* I2S System Clock */
+#define GPIO32_MMCCLK          32      /* MMC Clock (PXA270) */
+#define GPIO33_nCS_5           33      /* chip select 5 */
+#define GPIO34_FFRXD           34      /* FFUART receive */
+#define GPIO34_MMCCS0          34      /* MMC Chip Select 0 */
+#define GPIO35_FFCTS           35      /* FFUART Clear to send */
+#define GPIO36_FFDCD           36      /* FFUART Data carrier detect */
+#define GPIO37_FFDSR           37      /* FFUART data set ready */
+#define GPIO38_FFRI            38      /* FFUART Ring Indicator */
+#define GPIO39_MMCCS1          39      /* MMC Chip Select 1 */
+#define GPIO39_FFTXD           39      /* FFUART transmit data */
+#define GPIO40_FFDTR           40      /* FFUART data terminal Ready */
+#define GPIO41_FFRTS           41      /* FFUART request to send */
+#define GPIO42_BTRXD           42      /* BTUART receive data */
+#define GPIO42_HWRXD           42      /* HWUART receive data */
+#define GPIO42_CIF_MCLK                42      /* Camera Master Clock */
+#define GPIO43_BTTXD           43      /* BTUART transmit data */
+#define GPIO43_HWTXD           43      /* HWUART transmit data */
+#define GPIO43_CIF_FV          43      /* Camera frame start signal */
+#define GPIO44_BTCTS           44      /* BTUART clear to send */
+#define GPIO44_HWCTS           44      /* HWUART clear to send */
+#define GPIO44_CIF_LV          44      /* Camera line start signal */
+#define GPIO45_BTRTS           45      /* BTUART request to send */
+#define GPIO45_HWRTS           45      /* HWUART request to send */
+#define GPIO45_AC97_SYSCLK     45      /* AC97 System Clock */
+#define GPIO45_CIF_PCLK                45      /* Camera Pixel Clock */
+#define GPIO46_ICPRXD          46      /* ICP receive data */
+#define GPIO46_STRXD           46      /* STD_UART receive data */
+#define GPIO47_ICPTXD          47      /* ICP transmit data */
+#define GPIO47_STTXD           47      /* STD_UART transmit data */
+#define GPIO47_CIF_DD_0                47      /* Camera data pin 0 */
+#define GPIO48_nPOE            48      /* Output Enable for Card Space */
+#define GPIO48_CIF_DD_5                48      /* Camera data pin 5 */
+#define GPIO49_nPWE            49      /* Write Enable for Card Space */
+#define GPIO50_nPIOR           50      /* I/O Read for Card Space */
+#define GPIO50_CIF_DD_3                50      /* Camera data pin 3 */
+#define GPIO51_nPIOW           51      /* I/O Write for Card Space */
+#define GPIO51_CIF_DD_2                51      /* Camera data pin 2 */
+#define GPIO52_nPCE_1          52      /* Card Enable for Card Space */
+#define GPIO52_CIF_DD_4                52      /* Camera data pin 4 */
+#define GPIO53_nPCE_2          53      /* Card Enable for Card Space */
+#define GPIO53_MMCCLK          53      /* MMC Clock */
+#define GPIO53_CIF_MCLK                53      /* Camera Master Clock */
+#define GPIO54_MMCCLK          54      /* MMC Clock */
+#define GPIO54_pSKTSEL         54      /* Socket Select for Card Space */
+#define GPIO54_nPCE_2          54      /* Card Enable for Card Space (PXA27x) */
+#define GPIO54_CIF_PCLK                54      /* Camera Pixel Clock */
+#define GPIO55_nPREG           55      /* Card Address bit 26 */
+#define GPIO55_CIF_DD_1                55      /* Camera data pin 1 */
+#define GPIO56_nPWAIT          56      /* Wait signal for Card Space */
+#define GPIO57_nIOIS16         57      /* Bus Width select for I/O Card Space */
+#define GPIO58_LDD_0           58      /* LCD data pin 0 */
+#define GPIO59_LDD_1           59      /* LCD data pin 1 */
+#define GPIO60_LDD_2           60      /* LCD data pin 2 */
+#define GPIO61_LDD_3           61      /* LCD data pin 3 */
+#define GPIO62_LDD_4           62      /* LCD data pin 4 */
+#define GPIO63_LDD_5           63      /* LCD data pin 5 */
+#define GPIO64_LDD_6           64      /* LCD data pin 6 */
+#define GPIO65_LDD_7           65      /* LCD data pin 7 */
+#define GPIO66_LDD_8           66      /* LCD data pin 8 */
+#define GPIO66_MBREQ           66      /* alternate bus master req */
+#define GPIO67_LDD_9           67      /* LCD data pin 9 */
+#define GPIO67_MMCCS0          67      /* MMC Chip Select 0 */
+#define GPIO68_LDD_10          68      /* LCD data pin 10 */
+#define GPIO68_MMCCS1          68      /* MMC Chip Select 1 */
+#define GPIO69_LDD_11          69      /* LCD data pin 11 */
+#define GPIO69_MMCCLK          69      /* MMC_CLK */
+#define GPIO70_LDD_12          70      /* LCD data pin 12 */
+#define GPIO70_RTCCLK          70      /* Real Time clock (1 Hz) */
+#define GPIO71_LDD_13          71      /* LCD data pin 13 */
+#define GPIO71_3_6MHz          71      /* 3.6 MHz Oscillator clock */
+#define GPIO72_LDD_14          72      /* LCD data pin 14 */
+#define GPIO72_32kHz           72      /* 32 kHz clock */
+#define GPIO73_LDD_15          73      /* LCD data pin 15 */
+#define GPIO73_MBGNT           73      /* Memory controller grant */
+#define GPIO74_LCD_FCLK                74      /* LCD Frame clock */
+#define GPIO75_LCD_LCLK                75      /* LCD line clock */
+#define GPIO76_LCD_PCLK                76      /* LCD Pixel clock */
+#define GPIO77_LCD_ACBIAS      77      /* LCD AC Bias */
+#define GPIO78_nCS_2           78      /* chip select 2 */
+#define GPIO79_nCS_3           79      /* chip select 3 */
+#define GPIO80_nCS_4           80      /* chip select 4 */
+#define GPIO81_NSCLK           81      /* NSSP clock */
+#define GPIO81_CIF_DD_0                81      /* Camera data pin 0 */
+#define GPIO82_NSFRM           82      /* NSSP Frame */
+#define GPIO82_CIF_DD_5                82      /* Camera data pin 5 */
+#define GPIO83_NSTXD           83      /* NSSP transmit */
+#define GPIO83_CIF_DD_4                83      /* Camera data pin 4 */
+#define GPIO84_NSRXD           84      /* NSSP receive */
+#define GPIO84_CIF_FV          84      /* Camera frame start signal */
+#define GPIO85_nPCE_1          85      /* Card Enable for Card Space (PXA27x) */
+#define GPIO85_CIF_LV          85      /* Camera line start signal */
+#define GPIO90_CIF_DD_4                90      /* Camera data pin 4 */
+#define GPIO91_CIF_DD_5                91      /* Camera data pin 5 */
+#define GPIO92_MMCDAT0         92      /* MMC DAT0 (PXA27x) */
+#define GPIO93_CIF_DD_6                93      /* Camera data pin 6 */
+#define GPIO94_CIF_DD_5                94      /* Camera data pin 5 */
+#define GPIO95_CIF_DD_4                95      /* Camera data pin 4 */
+#define GPIO98_CIF_DD_0                98      /* Camera data pin 0 */
+#define GPIO102_nPCE_1         102     /* PCMCIA (PXA27x) */
+#define GPIO103_CIF_DD_3       103     /* Camera data pin 3 */
+#define GPIO104_CIF_DD_2       104     /* Camera data pin 2 */
+#define GPIO105_CIF_DD_1       105     /* Camera data pin 1 */
+#define GPIO106_CIF_DD_9       106     /* Camera data pin 9 */
+#define GPIO107_CIF_DD_8       107     /* Camera data pin 8 */
+#define GPIO108_CIF_DD_7       108     /* Camera data pin 7 */
+#define GPIO109_MMCDAT1                109     /* MMC DAT1 (PXA27x) */
+#define GPIO110_MMCDAT2                110     /* MMC DAT2 (PXA27x) */
+#define GPIO110_MMCCS0         110     /* MMC Chip Select 0 (PXA27x) */
+#define GPIO111_MMCDAT3                111     /* MMC DAT3 (PXA27x) */
+#define GPIO111_MMCCS1         111     /* MMC Chip Select 1 (PXA27x) */
+#define GPIO112_MMCCMD         112     /* MMC CMD (PXA27x) */
+#define GPIO113_I2S_SYSCLK     113     /* I2S System Clock (PXA27x) */
+#define GPIO113_AC97_RESET_N   113     /* AC97 NRESET on (PXA27x) */
+#define GPIO114_CIF_DD_1       114     /* Camera data pin 1 */
+#define GPIO115_CIF_DD_3       115     /* Camera data pin 3 */
+#define GPIO116_CIF_DD_2       116     /* Camera data pin 2 */
+
+/* GPIO alternate function mode & direction */
+
+#define GPIO_IN                        0x000
+#define GPIO_OUT               0x080
+#define GPIO_ALT_FN_1_IN       0x100
+#define GPIO_ALT_FN_1_OUT      0x180
+#define GPIO_ALT_FN_2_IN       0x200
+#define GPIO_ALT_FN_2_OUT      0x280
+#define GPIO_ALT_FN_3_IN       0x300
+#define GPIO_ALT_FN_3_OUT      0x380
+#define GPIO_MD_MASK_NR                0x07f
+#define GPIO_MD_MASK_DIR       0x080
+#define GPIO_MD_MASK_FN                0x300
+#define GPIO_DFLT_LOW          0x400
+#define GPIO_DFLT_HIGH         0x800
+
+#define GPIO1_RTS_MD           ( 1 | GPIO_ALT_FN_1_IN)
+#define GPIO6_MMCCLK_MD                ( 6 | GPIO_ALT_FN_1_OUT)
+#define GPIO7_48MHz_MD         ( 7 | GPIO_ALT_FN_1_OUT)
+#define GPIO8_MMCCS0_MD                ( 8 | GPIO_ALT_FN_1_OUT)
+#define GPIO9_MMCCS1_MD                ( 9 | GPIO_ALT_FN_1_OUT)
+#define GPIO10_RTCCLK_MD       (10 | GPIO_ALT_FN_1_OUT)
+#define GPIO11_3_6MHz_MD       (11 | GPIO_ALT_FN_1_OUT)
+#define GPIO12_32KHz_MD                (12 | GPIO_ALT_FN_1_OUT)
+#define GPIO12_CIF_DD_7_MD     (12 | GPIO_ALT_FN_2_IN)
+#define GPIO13_MBGNT_MD                (13 | GPIO_ALT_FN_2_OUT)
+#define GPIO14_MBREQ_MD                (14 | GPIO_ALT_FN_1_IN)
+#define GPIO15_nCS_1_MD                (15 | GPIO_ALT_FN_2_OUT)
+#define GPIO16_PWM0_MD         (16 | GPIO_ALT_FN_2_OUT)
+#define GPIO17_PWM1_MD         (17 | GPIO_ALT_FN_2_OUT)
+#define GPIO17_CIF_DD_6_MD     (17 | GPIO_ALT_FN_2_IN)
+#define GPIO18_RDY_MD          (18 | GPIO_ALT_FN_1_IN)
+#define GPIO19_DREQ1_MD                (19 | GPIO_ALT_FN_1_IN)
+#define GPIO20_DREQ0_MD                (20 | GPIO_ALT_FN_1_IN)
+#define GPIO23_CIF_MCLK_MD     (23 | GPIO_ALT_FN_1_OUT)
+#define GPIO23_SCLK_MD         (23 | GPIO_ALT_FN_2_OUT)
+#define GPIO24_CIF_FV_MD       (24 | GPIO_ALT_FN_1_OUT)
+#define GPIO24_SFRM_MD         (24 | GPIO_ALT_FN_2_OUT)
+#define GPIO25_CIF_LV_MD       (25 | GPIO_ALT_FN_1_OUT)
+#define GPIO25_STXD_MD         (25 | GPIO_ALT_FN_2_OUT)
+#define GPIO26_SRXD_MD         (26 | GPIO_ALT_FN_1_IN)
+#define GPIO26_CIF_PCLK_MD     (26 | GPIO_ALT_FN_2_IN)
+#define GPIO27_SEXTCLK_MD      (27 | GPIO_ALT_FN_1_IN)
+#define GPIO27_CIF_DD_0_MD     (27 | GPIO_ALT_FN_3_IN)
+#define GPIO28_BITCLK_AC97_MD  (28 | GPIO_ALT_FN_1_IN)
+#define GPIO28_BITCLK_IN_I2S_MD        (28 | GPIO_ALT_FN_2_IN)
+#define GPIO28_BITCLK_OUT_I2S_MD       (28 | GPIO_ALT_FN_1_OUT)
+#define GPIO29_SDATA_IN_AC97_MD        (29 | GPIO_ALT_FN_1_IN)
+#define GPIO29_SDATA_IN_I2S_MD (29 | GPIO_ALT_FN_2_IN)
+#define GPIO30_SDATA_OUT_AC97_MD       (30 | GPIO_ALT_FN_2_OUT)
+#define GPIO30_SDATA_OUT_I2S_MD        (30 | GPIO_ALT_FN_1_OUT)
+#define GPIO31_SYNC_I2S_MD     (31 | GPIO_ALT_FN_1_OUT)
+#define GPIO31_SYNC_AC97_MD    (31 | GPIO_ALT_FN_2_OUT)
+#define GPIO32_SDATA_IN1_AC97_MD       (32 | GPIO_ALT_FN_1_IN)
+#define GPIO32_SYSCLK_I2S_MD   (32 | GPIO_ALT_FN_1_OUT)
+#define GPIO32_MMCCLK_MD       (32 | GPIO_ALT_FN_2_OUT)
+#define GPIO33_nCS_5_MD                (33 | GPIO_ALT_FN_2_OUT)
+#define GPIO34_FFRXD_MD                (34 | GPIO_ALT_FN_1_IN)
+#define GPIO34_MMCCS0_MD       (34 | GPIO_ALT_FN_2_OUT)
+#define GPIO35_FFCTS_MD                (35 | GPIO_ALT_FN_1_IN)
+#define GPIO35_KP_MKOUT6_MD    (35 | GPIO_ALT_FN_2_OUT)
+#define GPIO36_FFDCD_MD                (36 | GPIO_ALT_FN_1_IN)
+#define GPIO37_FFDSR_MD                (37 | GPIO_ALT_FN_1_IN)
+#define GPIO38_FFRI_MD         (38 | GPIO_ALT_FN_1_IN)
+#define GPIO39_MMCCS1_MD       (39 | GPIO_ALT_FN_1_OUT)
+#define GPIO39_FFTXD_MD                (39 | GPIO_ALT_FN_2_OUT)
+#define GPIO40_FFDTR_MD                (40 | GPIO_ALT_FN_2_OUT)
+#define GPIO41_FFRTS_MD                (41 | GPIO_ALT_FN_2_OUT)
+#define GPIO41_KP_MKOUT7_MD    (41 | GPIO_ALT_FN_1_OUT)
+#define GPIO42_BTRXD_MD                (42 | GPIO_ALT_FN_1_IN)
+#define GPIO42_HWRXD_MD                (42 | GPIO_ALT_FN_3_IN)
+#define GPIO42_CIF_MCLK_MD     (42 | GPIO_ALT_FN_3_OUT)
+#define GPIO43_BTTXD_MD                (43 | GPIO_ALT_FN_2_OUT)
+#define GPIO43_HWTXD_MD                (43 | GPIO_ALT_FN_3_OUT)
+#define GPIO43_CIF_FV_MD       (43 | GPIO_ALT_FN_3_OUT)
+#define GPIO44_BTCTS_MD                (44 | GPIO_ALT_FN_1_IN)
+#define GPIO44_HWCTS_MD                (44 | GPIO_ALT_FN_3_IN)
+#define GPIO44_CIF_LV_MD       (44 | GPIO_ALT_FN_3_OUT)
+#define GPIO45_CIF_PCLK_MD     (45 | GPIO_ALT_FN_3_IN)
+#define GPIO45_BTRTS_MD                (45 | GPIO_ALT_FN_2_OUT)
+#define GPIO45_HWRTS_MD                (45 | GPIO_ALT_FN_3_OUT)
+#define GPIO45_SYSCLK_AC97_MD  (45 | GPIO_ALT_FN_1_OUT)
+#define GPIO46_ICPRXD_MD       (46 | GPIO_ALT_FN_1_IN)
+#define GPIO46_STRXD_MD                (46 | GPIO_ALT_FN_2_IN)
+#define GPIO47_CIF_DD_0_MD     (47 | GPIO_ALT_FN_1_IN)
+#define GPIO47_ICPTXD_MD       (47 | GPIO_ALT_FN_2_OUT)
+#define GPIO47_STTXD_MD                (47 | GPIO_ALT_FN_1_OUT)
+#define GPIO48_CIF_DD_5_MD     (48 | GPIO_ALT_FN_1_IN)
+#define GPIO48_nPOE_MD         (48 | GPIO_ALT_FN_2_OUT)
+#define GPIO48_HWTXD_MD                (48 | GPIO_ALT_FN_1_OUT)
+#define GPIO48_nPOE_MD         (48 | GPIO_ALT_FN_2_OUT)
+#define GPIO49_HWRXD_MD                (49 | GPIO_ALT_FN_1_IN)
+#define GPIO49_nPWE_MD         (49 | GPIO_ALT_FN_2_OUT)
+#define GPIO50_CIF_DD_3_MD     (50 | GPIO_ALT_FN_1_IN)
+#define GPIO50_nPIOR_MD                (50 | GPIO_ALT_FN_2_OUT)
+#define GPIO50_HWCTS_MD                (50 | GPIO_ALT_FN_1_IN)
+#define GPIO50_CIF_DD_3_MD     (50 | GPIO_ALT_FN_1_IN)
+#define GPIO51_CIF_DD_2_MD     (51 | GPIO_ALT_FN_1_IN)
+#define GPIO51_nPIOW_MD                (51 | GPIO_ALT_FN_2_OUT)
+#define GPIO51_HWRTS_MD                (51 | GPIO_ALT_FN_1_OUT)
+#define GPIO51_CIF_DD_2_MD     (51 | GPIO_ALT_FN_1_IN)
+#define GPIO52_nPCE_1_MD       (52 | GPIO_ALT_FN_2_OUT)
+#define GPIO52_CIF_DD_4_MD     (52 | GPIO_ALT_FN_1_IN)
+#define GPIO53_nPCE_2_MD       (53 | GPIO_ALT_FN_2_OUT)
+#define GPIO53_MMCCLK_MD       (53 | GPIO_ALT_FN_1_OUT)
+#define GPIO53_CIF_MCLK_MD     (53 | GPIO_ALT_FN_2_OUT)
+#define GPIO54_MMCCLK_MD       (54 | GPIO_ALT_FN_1_OUT)
+#define GPIO54_nPCE_2_MD       (54 | GPIO_ALT_FN_2_OUT)
+#define GPIO54_pSKTSEL_MD      (54 | GPIO_ALT_FN_2_OUT)
+#define GPIO54_CIF_PCLK_MD     (54 | GPIO_ALT_FN_3_IN)
+#define GPIO55_nPREG_MD                (55 | GPIO_ALT_FN_2_OUT)
+#define GPIO55_CIF_DD_1_MD     (55 | GPIO_ALT_FN_1_IN)
+#define GPIO56_nPWAIT_MD       (56 | GPIO_ALT_FN_1_IN)
+#define GPIO57_nIOIS16_MD      (57 | GPIO_ALT_FN_1_IN)
+#define GPIO58_LDD_0_MD                (58 | GPIO_ALT_FN_2_OUT)
+#define GPIO59_LDD_1_MD                (59 | GPIO_ALT_FN_2_OUT)
+#define GPIO60_LDD_2_MD                (60 | GPIO_ALT_FN_2_OUT)
+#define GPIO61_LDD_3_MD                (61 | GPIO_ALT_FN_2_OUT)
+#define GPIO62_LDD_4_MD                (62 | GPIO_ALT_FN_2_OUT)
+#define GPIO63_LDD_5_MD                (63 | GPIO_ALT_FN_2_OUT)
+#define GPIO64_LDD_6_MD                (64 | GPIO_ALT_FN_2_OUT)
+#define GPIO65_LDD_7_MD                (65 | GPIO_ALT_FN_2_OUT)
+#define GPIO66_LDD_8_MD                (66 | GPIO_ALT_FN_2_OUT)
+#define GPIO66_MBREQ_MD                (66 | GPIO_ALT_FN_1_IN)
+#define GPIO67_LDD_9_MD                (67 | GPIO_ALT_FN_2_OUT)
+#define GPIO67_MMCCS0_MD       (67 | GPIO_ALT_FN_1_OUT)
+#define GPIO68_LDD_10_MD       (68 | GPIO_ALT_FN_2_OUT)
+#define GPIO68_MMCCS1_MD       (68 | GPIO_ALT_FN_1_OUT)
+#define GPIO69_LDD_11_MD       (69 | GPIO_ALT_FN_2_OUT)
+#define GPIO69_MMCCLK_MD       (69 | GPIO_ALT_FN_1_OUT)
+#define GPIO70_LDD_12_MD       (70 | GPIO_ALT_FN_2_OUT)
+#define GPIO70_RTCCLK_MD       (70 | GPIO_ALT_FN_1_OUT)
+#define GPIO71_LDD_13_MD       (71 | GPIO_ALT_FN_2_OUT)
+#define GPIO71_3_6MHz_MD       (71 | GPIO_ALT_FN_1_OUT)
+#define GPIO72_LDD_14_MD       (72 | GPIO_ALT_FN_2_OUT)
+#define GPIO72_32kHz_MD                (72 | GPIO_ALT_FN_1_OUT)
+#define GPIO73_LDD_15_MD       (73 | GPIO_ALT_FN_2_OUT)
+#define GPIO73_MBGNT_MD                (73 | GPIO_ALT_FN_1_OUT)
+#define GPIO74_LCD_FCLK_MD     (74 | GPIO_ALT_FN_2_OUT)
+#define GPIO75_LCD_LCLK_MD     (75 | GPIO_ALT_FN_2_OUT)
+#define GPIO76_LCD_PCLK_MD     (76 | GPIO_ALT_FN_2_OUT)
+#define GPIO77_LCD_ACBIAS_MD   (77 | GPIO_ALT_FN_2_OUT)
+#define GPIO78_nCS_2_MD                (78 | GPIO_ALT_FN_2_OUT)
+#define GPIO78_nPCE_2_MD       (78 | GPIO_ALT_FN_1_OUT)
+#define GPIO79_nCS_3_MD                (79 | GPIO_ALT_FN_2_OUT)
+#define GPIO79_pSKTSEL_MD      (79 | GPIO_ALT_FN_1_OUT)
+#define GPIO80_nCS_4_MD                (80 | GPIO_ALT_FN_2_OUT)
+#define GPIO81_NSSP_CLK_OUT    (81 | GPIO_ALT_FN_1_OUT)
+#define GPIO81_NSSP_CLK_IN     (81 | GPIO_ALT_FN_1_IN)
+#define GPIO81_CIF_DD_0_MD     (81 | GPIO_ALT_FN_2_IN)
+#define GPIO82_NSSP_FRM_OUT    (82 | GPIO_ALT_FN_1_OUT)
+#define GPIO82_NSSP_FRM_IN     (82 | GPIO_ALT_FN_1_IN)
+#define GPIO82_CIF_DD_5_MD     (82 | GPIO_ALT_FN_3_IN)
+#define GPIO83_NSSP_TX         (83 | GPIO_ALT_FN_1_OUT)
+#define GPIO83_NSSP_RX         (83 | GPIO_ALT_FN_2_IN)
+#define GPIO83_CIF_DD_4_MD     (83 | GPIO_ALT_FN_3_IN)
+#define GPIO84_NSSP_TX         (84 | GPIO_ALT_FN_1_OUT)
+#define GPIO84_NSSP_RX         (84 | GPIO_ALT_FN_2_IN)
+#define GPIO84_CIF_FV_MD       (84 | GPIO_ALT_FN_3_IN)
+#define GPIO85_nPCE_1_MD       (85 | GPIO_ALT_FN_1_OUT)
+#define GPIO85_CIF_LV_MD       (85 | GPIO_ALT_FN_3_IN)
+#define GPIO86_nPCE_1_MD       (86 | GPIO_ALT_FN_1_OUT)
+#define GPIO90_CIF_DD_4_MD     (90 | GPIO_ALT_FN_3_IN)
+#define GPIO91_CIF_DD_5_MD     (91 | GPIO_ALT_FN_3_IN)
+#define GPIO92_MMCDAT0_MD      (92 | GPIO_ALT_FN_1_OUT)
+#define GPIO93_CIF_DD_6_MD     (93 | GPIO_ALT_FN_2_IN)
+#define GPIO94_CIF_DD_5_MD     (94 | GPIO_ALT_FN_2_IN)
+#define GPIO95_CIF_DD_4_MD     (95 | GPIO_ALT_FN_2_IN)
+#define GPIO95_KP_MKIN6_MD     (95 | GPIO_ALT_FN_3_IN)
+#define GPIO96_KP_DKIN3_MD     (96 | GPIO_ALT_FN_1_IN)
+#define GPIO97_KP_MKIN3_MD     (97 | GPIO_ALT_FN_3_IN)
+#define GPIO98_CIF_DD_0_MD     (98 | GPIO_ALT_FN_2_IN)
+#define GPIO100_KP_MKIN0_MD    (100 | GPIO_ALT_FN_1_IN)
+#define GPIO101_KP_MKIN1_MD    (101 | GPIO_ALT_FN_1_IN)
+#define GPIO102_nPCE_1_MD      (102 | GPIO_ALT_FN_1_OUT)
+#define GPIO102_KP_MKIN2_MD    (102 | GPIO_ALT_FN_1_IN)
+#define GPIO103_CIF_DD_3_MD    (103 | GPIO_ALT_FN_1_IN)
+#define GPIO103_KP_MKOUT0_MD   (103 | GPIO_ALT_FN_2_OUT)
+#define GPIO104_CIF_DD_2_MD    (104 | GPIO_ALT_FN_1_IN)
+#define GPIO104_pSKTSEL_MD     (104 | GPIO_ALT_FN_1_OUT)
+#define GPIO104_KP_MKOUT1_MD   (104 | GPIO_ALT_FN_2_OUT)
+#define GPIO105_CIF_DD_1_MD    (105 | GPIO_ALT_FN_1_IN)
+#define GPIO105_KP_MKOUT2_MD   (105 | GPIO_ALT_FN_2_OUT)
+#define GPIO106_CIF_DD_9_MD    (106 | GPIO_ALT_FN_1_IN)
+#define GPIO106_KP_MKOUT3_MD   (106 | GPIO_ALT_FN_2_OUT)
+#define GPIO107_CIF_DD_8_MD    (107 | GPIO_ALT_FN_1_IN)
+#define GPIO107_KP_MKOUT4_MD   (107 | GPIO_ALT_FN_2_OUT)
+#define GPIO108_CIF_DD_7_MD    (108 | GPIO_ALT_FN_1_IN)
+#define GPIO108_KP_MKOUT5_MD   (108 | GPIO_ALT_FN_2_OUT)
+#define GPIO109_MMCDAT1_MD     (109 | GPIO_ALT_FN_1_OUT)
+#define GPIO110_MMCDAT2_MD     (110 | GPIO_ALT_FN_1_OUT)
+#define GPIO110_MMCCS0_MD      (110 | GPIO_ALT_FN_1_OUT)
+#define GPIO111_MMCDAT3_MD     (111 | GPIO_ALT_FN_1_OUT)
+#define GPIO110_MMCCS1_MD      (111 | GPIO_ALT_FN_1_OUT)
+#define GPIO112_MMCCMD_MD      (112 | GPIO_ALT_FN_1_OUT)
+#define GPIO113_I2S_SYSCLK_MD  (113 | GPIO_ALT_FN_1_OUT)
+#define GPIO113_AC97_RESET_N_MD        (113 | GPIO_ALT_FN_2_OUT)
+#define GPIO117_I2CSCL_MD      (117 | GPIO_ALT_FN_1_IN)
+#define GPIO118_I2CSDA_MD      (118 | GPIO_ALT_FN_1_IN)
+
+#endif /* __ASM_ARCH_PXA2XX_GPIO_H */
index 8e1b3ead827fc017fa35c7e09ad3e2681845c544..fe9364c83a28b3f384ba0085bf1ea6170bb167e6 100644 (file)
 
 #ifndef __ASM_ARCH_PXA3XX_REGS_H
 #define __ASM_ARCH_PXA3XX_REGS_H
+
+/*
+ * Oscillator Configuration Register (OSCC)
+ */
+#define OSCC           __REG(0x41350000)  /* Oscillator Configuration Register */
+
+#define OSCC_PEN       (1 << 11)       /* 13MHz POUT */
+
+
 /*
  * Service Power Management Unit (MPMU)
  */
index c05e4faf85a6f47b8641d2f8dffd067797156f69..c5b6fde6907c4f0fc743827381f5d7b6c65f673a 100644 (file)
 /*
  * SCOOP2 internal GPIOs
  */
+#define TOSA_SCOOP_GPIO_BASE           NR_BUILTIN_GPIO
 #define TOSA_SCOOP_PXA_VCORE1          SCOOP_GPCR_PA11
 #define TOSA_SCOOP_TC6393_REST_IN      SCOOP_GPCR_PA12
-#define TOSA_SCOOP_IR_POWERDWN         SCOOP_GPCR_PA13
-#define TOSA_SCOOP_SD_WP               SCOOP_GPCR_PA14
-#define TOSA_SCOOP_PWR_ON              SCOOP_GPCR_PA15
+#define TOSA_GPIO_IR_POWERDWN          (TOSA_SCOOP_GPIO_BASE + 2)
+#define TOSA_GPIO_SD_WP                        (TOSA_SCOOP_GPIO_BASE + 3)
+#define TOSA_GPIO_PWR_ON               (TOSA_SCOOP_GPIO_BASE + 4)
 #define TOSA_SCOOP_AUD_PWR_ON          SCOOP_GPCR_PA16
 #define TOSA_SCOOP_BT_RESET            SCOOP_GPCR_PA17
 #define TOSA_SCOOP_BT_PWR_EN           SCOOP_GPCR_PA18
@@ -35,7 +36,7 @@
 
 /* GPIO Direction   1 : output mode / 0:input mode */
 #define TOSA_SCOOP_IO_DIR     ( TOSA_SCOOP_PXA_VCORE1 | TOSA_SCOOP_TC6393_REST_IN | \
-               TOSA_SCOOP_IR_POWERDWN | TOSA_SCOOP_PWR_ON | TOSA_SCOOP_AUD_PWR_ON |\
+               TOSA_SCOOP_AUD_PWR_ON |\
                TOSA_SCOOP_BT_RESET | TOSA_SCOOP_BT_PWR_EN )
 /* GPIO out put level when init   1: Hi */
 #define TOSA_SCOOP_IO_OUT     ( TOSA_SCOOP_TC6393_REST_IN )
 /*
  * SCOOP2 jacket GPIOs
  */
-#define TOSA_SCOOP_JC_BT_LED           SCOOP_GPCR_PA11
-#define TOSA_SCOOP_JC_NOTE_LED         SCOOP_GPCR_PA12
-#define TOSA_SCOOP_JC_CHRG_ERR_LED     SCOOP_GPCR_PA13
-#define TOSA_SCOOP_JC_USB_PULLUP       SCOOP_GPCR_PA14
+#define TOSA_SCOOP_JC_GPIO_BASE                (NR_BUILTIN_GPIO + 12)
+#define TOSA_GPIO_BT_LED               (TOSA_SCOOP_JC_GPIO_BASE + 0)
+#define TOSA_GPIO_NOTE_LED             (TOSA_SCOOP_JC_GPIO_BASE + 1)
+#define TOSA_GPIO_CHRG_ERR_LED         (TOSA_SCOOP_JC_GPIO_BASE + 2)
+#define TOSA_GPIO_USB_PULLUP           (TOSA_SCOOP_JC_GPIO_BASE + 3)
 #define TOSA_SCOOP_JC_TC6393_SUSPEND   SCOOP_GPCR_PA15
 #define TOSA_SCOOP_JC_TC3693_L3V_ON    SCOOP_GPCR_PA16
 #define TOSA_SCOOP_JC_WLAN_DETECT      SCOOP_GPCR_PA17
-#define TOSA_SCOOP_JC_WLAN_LED         SCOOP_GPCR_PA18
+#define TOSA_GPIO_WLAN_LED             (TOSA_SCOOP_JC_GPIO_BASE + 7)
 #define TOSA_SCOOP_JC_CARD_LIMIT_SEL   SCOOP_GPCR_PA19
 
 /* GPIO Direction   1 : output mode / 0:input mode */
-#define TOSA_SCOOP_JC_IO_DIR ( TOSA_SCOOP_JC_BT_LED | TOSA_SCOOP_JC_NOTE_LED | \
-               TOSA_SCOOP_JC_CHRG_ERR_LED | TOSA_SCOOP_JC_USB_PULLUP | \
+#define TOSA_SCOOP_JC_IO_DIR ( \
                TOSA_SCOOP_JC_TC6393_SUSPEND | TOSA_SCOOP_JC_TC3693_L3V_ON | \
-               TOSA_SCOOP_JC_WLAN_LED | TOSA_SCOOP_JC_CARD_LIMIT_SEL )
-/* GPIO out put level when init   1: Hi */
-#define TOSA_SCOOP_JC_IO_OUT ( 0 )
+               TOSA_SCOOP_JC_CARD_LIMIT_SEL )
 
 /*
  * Timing Generator
 #define TG_PINICTL                     0x06
 #define TG_HPOSCTL                     0x07
 
-/*
- * LED
- */
-#define TOSA_SCOOP_LED_BLUE            TOSA_SCOOP_GPCR_PA11
-#define TOSA_SCOOP_LED_GREEN           TOSA_SCOOP_GPCR_PA12
-#define TOSA_SCOOP_LED_ORANGE          TOSA_SCOOP_GPCR_PA13
-#define TOSA_SCOOP_LED_WLAN            TOSA_SCOOP_GPCR_PA18
-
-
 /*
  * PXA GPIOs
  */
 
 #define TOSA_IRQ_GPIO_MAIN_BAT_LOW     IRQ_GPIO(TOSA_GPIO_MAIN_BAT_LOW)
 
-extern struct platform_device tosascoop_jc_device;
-extern struct platform_device tosascoop_device;
-
 #define TOSA_KEY_SYNC          KEY_102ND /* ??? */
 
-
 #ifndef CONFIG_KEYBOARD_TOSA_USE_EXT_KEYCODES
 #define TOSA_KEY_RECORD                KEY_YEN
 #define TOSA_KEY_ADDRESSBOOK   KEY_KATAKANA
index 5f717d64ea7dd0aab71e421f87bc2cfcd160c0fd..4881b80f0f9009a90c5dedc3bebbcea2631723e0 100644 (file)
@@ -18,6 +18,8 @@ extern struct platform_mmc_slot zylonite_mmc_slot[];
 extern int gpio_backlight;
 extern int gpio_eth_irq;
 
+extern int wm9713_irq;
+
 extern int lcd_id;
 extern int lcd_orientation;
 
index 3e437b7f425a09af6fe2cc99d014d6e2a2482100..206f7a752882253ed693d4c31918f370dcedd827 100644 (file)
 /*
  * RealView EB + ARM11MPCore peripheral addresses
  */
+#define REALVIEW_EB_UART0_BASE         0x10009000      /* UART 0 */
+#define REALVIEW_EB_UART1_BASE         0x1000A000      /* UART 1 */
+#define REALVIEW_EB_UART2_BASE         0x1000B000      /* UART 2 */
+#define REALVIEW_EB_UART3_BASE         0x1000C000      /* UART 3 */
+#define REALVIEW_EB_SSP_BASE           0x1000D000      /* Synchronous Serial Port */
+#define REALVIEW_EB_WATCHDOG_BASE      0x10010000      /* watchdog interface */
+#define REALVIEW_EB_TIMER0_1_BASE      0x10011000      /* Timer 0 and 1 */
+#define REALVIEW_EB_TIMER2_3_BASE      0x10012000      /* Timer 2 and 3 */
+#define REALVIEW_EB_GPIO0_BASE         0x10013000      /* GPIO port 0 */
+#define REALVIEW_EB_RTC_BASE           0x10017000      /* Real Time Clock */
+#define REALVIEW_EB_CLCD_BASE          0x10020000      /* CLCD */
+#define REALVIEW_EB_GIC_CPU_BASE       0x10040000      /* Generic interrupt controller CPU interface */
+#define REALVIEW_EB_GIC_DIST_BASE      0x10041000      /* Generic interrupt controller distributor */
+#define REALVIEW_EB_SMC_BASE           0x10080000      /* Static memory controller */
+
+#define REALVIEW_EB_FLASH_BASE         0x40000000
+#define REALVIEW_EB_FLASH_SIZE         SZ_64M
+#define REALVIEW_EB_ETH_BASE           0x4E000000      /* Ethernet */
+#define REALVIEW_EB_USB_BASE           0x4F000000      /* USB */
+
 #ifdef CONFIG_REALVIEW_EB_ARM11MP_REVB
 #define REALVIEW_EB11MP_SCU_BASE       0x10100000      /* SCU registers */
 #define REALVIEW_EB11MP_GIC_CPU_BASE   0x10100100      /* Generic interrupt controller CPU interface */
diff --git a/include/asm-arm/arch-realview/board-pb1176.h b/include/asm-arm/arch-realview/board-pb1176.h
new file mode 100644 (file)
index 0000000..48ce9c8
--- /dev/null
@@ -0,0 +1,152 @@
+/*
+ * include/asm-arm/arch-realview/board-pb1176.h
+ *
+ * Copyright (C) 2008 ARM Limited
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ */
+
+#ifndef __ASM_ARCH_BOARD_PB1176_H
+#define __ASM_ARCH_BOARD_PB1176_H
+
+#include <asm/arch/platform.h>
+
+/*
+ * Peripheral addresses
+ */
+#define REALVIEW_PB1176_SCTL_BASE              0x10100000 /* System controller */
+#define REALVIEW_PB1176_SMC_BASE               0x10111000 /* SMC */
+#define REALVIEW_PB1176_DMC_BASE               0x10109000 /* DMC configuration */
+#define REALVIEW_PB1176_SDRAM67_BASE           0x70000000 /* SDRAM banks 6 and 7 */
+#define REALVIEW_PB1176_FLASH_BASE             0x30000000
+#define REALVIEW_PB1176_FLASH_SIZE             SZ_64M
+
+#define REALVIEW_PB1176_TIMER0_1_BASE          0x10104000 /* Timer 0 and 1 */
+#define REALVIEW_PB1176_TIMER2_3_BASE          0x10105000 /* Timer 2 and 3 */
+#define REALVIEW_PB1176_TIMER4_5_BASE          0x10106000 /* Timer 4 and 5 */
+#define REALVIEW_PB1176_WATCHDOG_BASE          0x10107000 /* watchdog interface */
+#define REALVIEW_PB1176_RTC_BASE               0x10108000 /* Real Time Clock */
+#define REALVIEW_PB1176_GPIO0_BASE             0x1010A000 /* GPIO port 0 */
+#define REALVIEW_PB1176_SSP_BASE               0x1010B000 /* Synchronous Serial Port */
+#define REALVIEW_PB1176_UART0_BASE             0x1010C000 /* UART 0 */
+#define REALVIEW_PB1176_UART1_BASE             0x1010D000 /* UART 1 */
+#define REALVIEW_PB1176_UART2_BASE             0x1010E000 /* UART 2 */
+#define REALVIEW_PB1176_UART3_BASE             0x1010F000 /* UART 3 */
+#define REALVIEW_PB1176_CLCD_BASE              0x10112000 /* CLCD */
+#define REALVIEW_PB1176_ETH_BASE               0x3A000000 /* Ethernet */
+#define REALVIEW_PB1176_USB_BASE               0x3B000000 /* USB */
+
+/*
+ * PCI regions
+ */
+#define REALVIEW_PB1176_PCI_BASE               0x60000000 /* PCI self config */
+#define REALVIEW_PB1176_PCI_CFG_BASE           0x61000000 /* PCI config */
+#define REALVIEW_PB1176_PCI_IO_BASE0           0x62000000 /* PCI IO region */
+#define REALVIEW_PB1176_PCI_MEM_BASE0          0x63000000 /* Memory region 1 */
+#define REALVIEW_PB1176_PCI_MEM_BASE1          0x64000000 /* Memory region 2 */
+#define REALVIEW_PB1176_PCI_MEM_BASE2          0x68000000 /* Memory region 3 */
+
+#define REALVIEW_PB1176_PCI_BASE_SIZE          0x01000000 /* 16MB */
+#define REALVIEW_PB1176_PCI_CFG_BASE_SIZE      0x01000000 /* 16MB */
+#define REALVIEW_PB1176_PCI_IO_BASE0_SIZE      0x01000000 /* 16MB */
+#define REALVIEW_PB1176_PCI_MEM_BASE0_SIZE     0x01000000 /* 16MB */
+#define REALVIEW_PB1176_PCI_MEM_BASE1_SIZE     0x04000000 /* 64MB */
+#define REALVIEW_PB1176_PCI_MEM_BASE2_SIZE     0x08000000 /* 128MB */
+
+#define REALVIEW_DC1176_GIC_CPU_BASE           0x10120000 /* GIC CPU interface, on devchip */
+#define REALVIEW_DC1176_GIC_DIST_BASE          0x10121000 /* GIC distributor, on devchip */
+#define REALVIEW_PB1176_GIC_CPU_BASE           0x10040000 /* GIC CPU interface, on FPGA */
+#define REALVIEW_PB1176_GIC_DIST_BASE          0x10041000 /* GIC distributor, on FPGA */
+#define REALVIEW_PB1176_L220_BASE              0x10110000 /* L220 registers */
+
+/*
+ * Irqs
+ */
+#define IRQ_DC1176_GIC_START                   32
+#define IRQ_PB1176_GIC_START                   64
+
+/*
+ * ARM1176 DevChip interrupt sources (primary GIC)
+ */
+#define IRQ_DC1176_WATCHDOG    (IRQ_DC1176_GIC_START + 0)      /* Watchdog timer */
+#define IRQ_DC1176_SOFTINT     (IRQ_DC1176_GIC_START + 1)      /* Software interrupt */
+#define IRQ_DC1176_COMMRx      (IRQ_DC1176_GIC_START + 2)      /* Debug Comm Rx interrupt */
+#define IRQ_DC1176_COMMTx      (IRQ_DC1176_GIC_START + 3)      /* Debug Comm Tx interrupt */
+#define IRQ_DC1176_TIMER0      (IRQ_DC1176_GIC_START + 8)      /* Timer 0 */
+#define IRQ_DC1176_TIMER1      (IRQ_DC1176_GIC_START + 9)      /* Timer 1 */
+#define IRQ_DC1176_TIMER2      (IRQ_DC1176_GIC_START + 10)     /* Timer 2 */
+#define IRQ_DC1176_APC         (IRQ_DC1176_GIC_START + 11)
+#define IRQ_DC1176_IEC         (IRQ_DC1176_GIC_START + 12)
+#define IRQ_DC1176_L2CC                (IRQ_DC1176_GIC_START + 13)
+#define IRQ_DC1176_RTC         (IRQ_DC1176_GIC_START + 14)
+#define IRQ_DC1176_CLCD                (IRQ_DC1176_GIC_START + 15)     /* CLCD controller */
+#define IRQ_DC1176_UART0       (IRQ_DC1176_GIC_START + 18)     /* UART 0 on development chip */
+#define IRQ_DC1176_UART1       (IRQ_DC1176_GIC_START + 19)     /* UART 1 on development chip */
+#define IRQ_DC1176_UART2       (IRQ_DC1176_GIC_START + 20)     /* UART 2 on development chip */
+#define IRQ_DC1176_UART3       (IRQ_DC1176_GIC_START + 21)     /* UART 3 on development chip */
+
+#define IRQ_DC1176_PB_IRQ2     (IRQ_DC1176_GIC_START + 30)     /* tile GIC */
+#define IRQ_DC1176_PB_IRQ1     (IRQ_DC1176_GIC_START + 31)     /* main GIC */
+
+/*
+ * RealView PB1176 interrupt sources (secondary GIC)
+ */
+#define IRQ_PB1176_MMCI0A      (IRQ_PB1176_GIC_START + 1)      /* Multimedia Card 0A */
+#define IRQ_PB1176_MMCI0B      (IRQ_PB1176_GIC_START + 2)      /* Multimedia Card 0A */
+#define IRQ_PB1176_KMI0                (IRQ_PB1176_GIC_START + 3)      /* Keyboard/Mouse port 0 */
+#define IRQ_PB1176_KMI1                (IRQ_PB1176_GIC_START + 4)      /* Keyboard/Mouse port 1 */
+#define IRQ_PB1176_SCI         (IRQ_PB1176_GIC_START + 5)
+#define IRQ_PB1176_UART4       (IRQ_PB1176_GIC_START + 6)      /* UART 4 on baseboard */
+#define IRQ_PB1176_CHARLCD     (IRQ_PB1176_GIC_START + 7)      /* Character LCD */
+#define IRQ_PB1176_GPIO1       (IRQ_PB1176_GIC_START + 8)
+#define IRQ_PB1176_GPIO2       (IRQ_PB1176_GIC_START + 9)
+#define IRQ_PB1176_ETH         (IRQ_PB1176_GIC_START + 10)     /* Ethernet controller */
+#define IRQ_PB1176_USB         (IRQ_PB1176_GIC_START + 11)     /* USB controller */
+
+#define IRQ_PB1176_PISMO       (IRQ_PB1176_GIC_START + 16)
+
+#define IRQ_PB1176_AACI                (IRQ_PB1176_GIC_START + 19)     /* Audio Codec */
+
+#define IRQ_PB1176_TIMER0_1    (IRQ_PB1176_GIC_START + 22)
+#define IRQ_PB1176_TIMER2_3    (IRQ_PB1176_GIC_START + 23)
+#define IRQ_PB1176_DMAC                (IRQ_PB1176_GIC_START + 24)     /* DMA controller */
+#define IRQ_PB1176_RTC         (IRQ_PB1176_GIC_START + 25)     /* Real Time Clock */
+
+#define IRQ_PB1176_GPIO0       -1
+#define IRQ_PB1176_SSP         -1
+#define IRQ_PB1176_SCTL                -1
+
+#define NR_GIC_PB1176          2
+
+/*
+ * Only define NR_IRQS if less than NR_IRQS_PB1176
+ */
+#define NR_IRQS_PB1176         (IRQ_DC1176_GIC_START + 96)
+
+#if defined(CONFIG_MACH_REALVIEW_PB1176)
+
+#if !defined(NR_IRQS) || (NR_IRQS < NR_IRQS_PB1176)
+#undef NR_IRQS
+#define NR_IRQS                        NR_IRQS_PB1176
+#endif
+
+#if !defined(MAX_GIC_NR) || (MAX_GIC_NR < NR_GIC_PB1176)
+#undef MAX_GIC_NR
+#define MAX_GIC_NR             NR_GIC_PB1176
+#endif
+
+#endif /* CONFIG_MACH_REALVIEW_PB1176 */
+
+#endif /* __ASM_ARCH_BOARD_PB1176_H */
diff --git a/include/asm-arm/arch-realview/board-pb11mp.h b/include/asm-arm/arch-realview/board-pb11mp.h
new file mode 100644 (file)
index 0000000..a1294d9
--- /dev/null
@@ -0,0 +1,186 @@
+/*
+ * include/asm-arm/arch-realview/board-pb11mp.h
+ *
+ * Copyright (C) 2008 ARM Limited
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ */
+
+#ifndef __ASM_ARCH_BOARD_PB11MP_H
+#define __ASM_ARCH_BOARD_PB11MP_H
+
+#include <asm/arch/platform.h>
+
+/*
+ * Peripheral addresses
+ */
+#define REALVIEW_PB11MP_UART0_BASE             0x10009000      /* UART 0 */
+#define REALVIEW_PB11MP_UART1_BASE             0x1000A000      /* UART 1 */
+#define REALVIEW_PB11MP_UART2_BASE             0x1000B000      /* UART 2 */
+#define REALVIEW_PB11MP_UART3_BASE             0x1000C000      /* UART 3 */
+#define REALVIEW_PB11MP_SSP_BASE               0x1000D000      /* Synchronous Serial Port */
+#define REALVIEW_PB11MP_WATCHDOG0_BASE         0x1000F000      /* Watchdog 0 */
+#define REALVIEW_PB11MP_WATCHDOG_BASE          0x10010000      /* watchdog interface */
+#define REALVIEW_PB11MP_TIMER0_1_BASE          0x10011000      /* Timer 0 and 1 */
+#define REALVIEW_PB11MP_TIMER2_3_BASE          0x10012000      /* Timer 2 and 3 */
+#define REALVIEW_PB11MP_GPIO0_BASE             0x10013000      /* GPIO port 0 */
+#define REALVIEW_PB11MP_RTC_BASE               0x10017000      /* Real Time Clock */
+#define REALVIEW_PB11MP_TIMER4_5_BASE          0x10018000      /* Timer 4/5 */
+#define REALVIEW_PB11MP_TIMER6_7_BASE          0x10019000      /* Timer 6/7 */
+#define REALVIEW_PB11MP_SCTL_BASE              0x1001A000      /* System Controller */
+#define REALVIEW_PB11MP_CLCD_BASE              0x10020000      /* CLCD */
+#define REALVIEW_PB11MP_ONB_SRAM_BASE          0x10060000      /* On-board SRAM */
+#define REALVIEW_PB11MP_DMC_BASE               0x100E0000      /* DMC configuration */
+#define REALVIEW_PB11MP_SMC_BASE               0x100E1000      /* SMC configuration */
+#define REALVIEW_PB11MP_CAN_BASE               0x100E2000      /* CAN bus */
+#define REALVIEW_PB11MP_CF_BASE                        0x18000000      /* Compact flash */
+#define REALVIEW_PB11MP_CF_MEM_BASE            0x18003000      /* SMC for Compact flash */
+#define REALVIEW_PB11MP_GIC_CPU_BASE           0x1E000000      /* Generic interrupt controller CPU interface */
+#define REALVIEW_PB11MP_FLASH0_BASE            0x40000000
+#define REALVIEW_PB11MP_FLASH0_SIZE            SZ_64M
+#define REALVIEW_PB11MP_FLASH1_BASE            0x44000000
+#define REALVIEW_PB11MP_FLASH1_SIZE            SZ_64M
+#define REALVIEW_PB11MP_ETH_BASE               0x4E000000      /* Ethernet */
+#define REALVIEW_PB11MP_USB_BASE               0x4F000000      /* USB */
+#define REALVIEW_PB11MP_GIC_DIST_BASE          0x1E001000      /* Generic interrupt controller distributor */
+#define REALVIEW_PB11MP_LT_BASE                        0xC0000000      /* Logic Tile expansion */
+#define REALVIEW_PB11MP_SDRAM6_BASE            0x70000000      /* SDRAM bank 6 256MB */
+#define REALVIEW_PB11MP_SDRAM7_BASE            0x80000000      /* SDRAM bank 7 256MB */
+
+#define REALVIEW_PB11MP_SYS_PLD_CTRL1          0x74
+
+/*
+ * PB11MPCore PCI regions
+ */
+#define REALVIEW_PB11MP_PCI_BASE               0x90040000      /* PCI-X Unit base */
+#define REALVIEW_PB11MP_PCI_IO_BASE            0x90050000      /* IO Region on AHB */
+#define REALVIEW_PB11MP_PCI_MEM_BASE           0xA0000000      /* MEM Region on AHB */
+
+#define REALVIEW_PB11MP_PCI_BASE_SIZE          0x10000         /* 16 Kb */
+#define REALVIEW_PB11MP_PCI_IO_SIZE            0x1000          /* 4 Kb */
+#define REALVIEW_PB11MP_PCI_MEM_SIZE           0x20000000      /* 512 MB */
+
+/*
+ * Testchip peripheral and fpga gic regions
+ */
+#define REALVIEW_TC11MP_SCU_BASE               0x1F000000      /* IRQ, Test chip */
+#define REALVIEW_TC11MP_GIC_CPU_BASE           0x1F000100      /* Test chip interrupt controller CPU interface */
+#define REALVIEW_TC11MP_TWD_BASE               0x1F000700
+#define REALVIEW_TC11MP_TWD_SIZE               0x00000100
+#define REALVIEW_TC11MP_GIC_DIST_BASE          0x1F001000      /* Test chip interrupt controller distributor */
+#define REALVIEW_TC11MP_L220_BASE              0x1F002000      /* L220 registers */
+
+/*
+ * Irqs
+ */
+#define IRQ_TC11MP_GIC_START                   32
+#define IRQ_PB11MP_GIC_START                   64
+
+/*
+ * ARM11MPCore test chip interrupt sources (primary GIC on the test chip)
+ */
+#define IRQ_TC11MP_AACI                (IRQ_TC11MP_GIC_START + 0)
+#define IRQ_TC11MP_TIMER0_1    (IRQ_TC11MP_GIC_START + 1)
+#define IRQ_TC11MP_TIMER2_3    (IRQ_TC11MP_GIC_START + 2)
+#define IRQ_TC11MP_USB         (IRQ_TC11MP_GIC_START + 3)
+#define IRQ_TC11MP_UART0       (IRQ_TC11MP_GIC_START + 4)
+#define IRQ_TC11MP_UART1       (IRQ_TC11MP_GIC_START + 5)
+#define IRQ_TC11MP_RTC         (IRQ_TC11MP_GIC_START + 6)
+#define IRQ_TC11MP_KMI0                (IRQ_TC11MP_GIC_START + 7)
+#define IRQ_TC11MP_KMI1                (IRQ_TC11MP_GIC_START + 8)
+#define IRQ_TC11MP_ETH         (IRQ_TC11MP_GIC_START + 9)
+#define IRQ_TC11MP_PB_IRQ1     (IRQ_TC11MP_GIC_START + 10)             /* main GIC */
+#define IRQ_TC11MP_PB_IRQ2     (IRQ_TC11MP_GIC_START + 11)             /* tile GIC */
+#define IRQ_TC11MP_PB_FIQ1     (IRQ_TC11MP_GIC_START + 12)             /* main GIC */
+#define IRQ_TC11MP_PB_FIQ2     (IRQ_TC11MP_GIC_START + 13)             /* tile GIC */
+#define IRQ_TC11MP_MMCI0A      (IRQ_TC11MP_GIC_START + 14)
+#define IRQ_TC11MP_MMCI0B      (IRQ_TC11MP_GIC_START + 15)
+
+#define IRQ_TC11MP_PMU_CPU0    (IRQ_TC11MP_GIC_START + 17)
+#define IRQ_TC11MP_PMU_CPU1    (IRQ_TC11MP_GIC_START + 18)
+#define IRQ_TC11MP_PMU_CPU2    (IRQ_TC11MP_GIC_START + 19)
+#define IRQ_TC11MP_PMU_CPU3    (IRQ_TC11MP_GIC_START + 20)
+#define IRQ_TC11MP_PMU_SCU0    (IRQ_TC11MP_GIC_START + 21)
+#define IRQ_TC11MP_PMU_SCU1    (IRQ_TC11MP_GIC_START + 22)
+#define IRQ_TC11MP_PMU_SCU2    (IRQ_TC11MP_GIC_START + 23)
+#define IRQ_TC11MP_PMU_SCU3    (IRQ_TC11MP_GIC_START + 24)
+#define IRQ_TC11MP_PMU_SCU4    (IRQ_TC11MP_GIC_START + 25)
+#define IRQ_TC11MP_PMU_SCU5    (IRQ_TC11MP_GIC_START + 26)
+#define IRQ_TC11MP_PMU_SCU6    (IRQ_TC11MP_GIC_START + 27)
+#define IRQ_TC11MP_PMU_SCU7    (IRQ_TC11MP_GIC_START + 28)
+
+#define IRQ_TC11MP_L220_EVENT  (IRQ_TC11MP_GIC_START + 29)
+#define IRQ_TC11MP_L220_SLAVE  (IRQ_TC11MP_GIC_START + 30)
+#define IRQ_TC11MP_L220_DECODE (IRQ_TC11MP_GIC_START + 31)
+
+/*
+ * RealView PB11MPCore GIC interrupt sources (secondary GIC on the board)
+ */
+#define IRQ_PB11MP_WATCHDOG    (IRQ_PB11MP_GIC_START + 0)      /* Watchdog timer */
+#define IRQ_PB11MP_SOFT                (IRQ_PB11MP_GIC_START + 1)      /* Software interrupt */
+#define IRQ_PB11MP_COMMRx      (IRQ_PB11MP_GIC_START + 2)      /* Debug Comm Rx interrupt */
+#define IRQ_PB11MP_COMMTx      (IRQ_PB11MP_GIC_START + 3)      /* Debug Comm Tx interrupt */
+#define IRQ_PB11MP_GPIO0       (IRQ_PB11MP_GIC_START + 6)      /* GPIO 0 */
+#define IRQ_PB11MP_GPIO1       (IRQ_PB11MP_GIC_START + 7)      /* GPIO 1 */
+#define IRQ_PB11MP_GPIO2       (IRQ_PB11MP_GIC_START + 8)      /* GPIO 2 */
+                                                               /* 9 reserved */
+#define IRQ_PB11MP_RTC_GIC1    (IRQ_PB11MP_GIC_START + 10)     /* Real Time Clock */
+#define IRQ_PB11MP_SSP         (IRQ_PB11MP_GIC_START + 11)     /* Synchronous Serial Port */
+#define IRQ_PB11MP_UART0_GIC1  (IRQ_PB11MP_GIC_START + 12)     /* UART 0 on development chip */
+#define IRQ_PB11MP_UART1_GIC1  (IRQ_PB11MP_GIC_START + 13)     /* UART 1 on development chip */
+#define IRQ_PB11MP_UART2       (IRQ_PB11MP_GIC_START + 14)     /* UART 2 on development chip */
+#define IRQ_PB11MP_UART3       (IRQ_PB11MP_GIC_START + 15)     /* UART 3 on development chip */
+#define IRQ_PB11MP_SCI         (IRQ_PB11MP_GIC_START + 16)     /* Smart Card Interface */
+#define IRQ_PB11MP_MMCI0A_GIC1 (IRQ_PB11MP_GIC_START + 17)     /* Multimedia Card 0A */
+#define IRQ_PB11MP_MMCI0B_GIC1 (IRQ_PB11MP_GIC_START + 18)     /* Multimedia Card 0B */
+#define IRQ_PB11MP_AACI_GIC1   (IRQ_PB11MP_GIC_START + 19)     /* Audio Codec */
+#define IRQ_PB11MP_KMI0_GIC1   (IRQ_PB11MP_GIC_START + 20)     /* Keyboard/Mouse port 0 */
+#define IRQ_PB11MP_KMI1_GIC1   (IRQ_PB11MP_GIC_START + 21)     /* Keyboard/Mouse port 1 */
+#define IRQ_PB11MP_CHARLCD     (IRQ_PB11MP_GIC_START + 22)     /* Character LCD */
+#define IRQ_PB11MP_CLCD                (IRQ_PB11MP_GIC_START + 23)     /* CLCD controller */
+#define IRQ_PB11MP_DMAC                (IRQ_PB11MP_GIC_START + 24)     /* DMA controller */
+#define IRQ_PB11MP_PWRFAIL     (IRQ_PB11MP_GIC_START + 25)     /* Power failure */
+#define IRQ_PB11MP_PISMO       (IRQ_PB11MP_GIC_START + 26)     /* PISMO interface */
+#define IRQ_PB11MP_DoC         (IRQ_PB11MP_GIC_START + 27)     /* Disk on Chip memory controller */
+#define IRQ_PB11MP_ETH_GIC1    (IRQ_PB11MP_GIC_START + 28)     /* Ethernet controller */
+#define IRQ_PB11MP_USB_GIC1    (IRQ_PB11MP_GIC_START + 29)     /* USB controller */
+#define IRQ_PB11MP_TSPEN       (IRQ_PB11MP_GIC_START + 30)     /* Touchscreen pen */
+#define IRQ_PB11MP_TSKPAD      (IRQ_PB11MP_GIC_START + 31)     /* Touchscreen keypad */
+
+#define IRQ_PB11MP_SMC         -1
+#define IRQ_PB11MP_SCTL                -1
+
+#define NR_GIC_PB11MP          2
+
+/*
+ * Only define NR_IRQS if less than NR_IRQS_PB11MP
+ */
+#define NR_IRQS_PB11MP         (IRQ_TC11MP_GIC_START + 96)
+
+#if defined(CONFIG_MACH_REALVIEW_PB11MP)
+
+#if !defined(NR_IRQS) || (NR_IRQS < NR_IRQS_PB11MP)
+#undef NR_IRQS
+#define NR_IRQS                        NR_IRQS_PB11MP
+#endif
+
+#if !defined(MAX_GIC_NR) || (MAX_GIC_NR < NR_GIC_PB11MP)
+#undef MAX_GIC_NR
+#define MAX_GIC_NR             NR_GIC_PB11MP
+#endif
+
+#endif /* CONFIG_MACH_REALVIEW_PB11MP */
+
+#endif /* __ASM_ARCH_BOARD_PB11MP_H */
index f17efc65518a6464b1bee7fa0fbfa9d6f77cb546..c8c860c3c26efd197937de1d8e421e224c0f9150 100644 (file)
@@ -15,7 +15,7 @@
                mrc     p15, 0, \rx, c1, c0
                tst     \rx, #1                 @ MMU enabled?
                moveq   \rx,      #0x10000000
-               movne   \rx,      #0xf1000000   @ virtual base
+               movne   \rx,      #0xf0000000   @ virtual base
                orr     \rx, \rx, #0x00009000
                .endm
 
index bad8d7ce9bfe480e30b69c15dbfc75dfaf489cd0..1ee8313ceb6a98d485558178fe78c0a3c31f7ce3 100644 (file)
@@ -25,7 +25,7 @@
 #include <asm/sizes.h>
 
 /* macro to get at IO space when running virtually */
-#define IO_ADDRESS(x)          ((((x) & 0x0effffff) | (((x) >> 4) & 0x0f000000)) + 0xf0000000)
+#define IO_ADDRESS(x)          (((x) & 0x0fffffff) + 0xf0000000)
 #define __io_address(n)                __io(IO_ADDRESS(n))
 
 #endif
index ad0c911002fc29ddcfd0449c14cfa38ab9a49e36..ccbac59235c6634a260df0bf3e7695697e0c815b 100644 (file)
@@ -23,6 +23,8 @@
 #define __ASM_ARCH_IRQS_H
 
 #include <asm/arch/board-eb.h>
+#include <asm/arch/board-pb11mp.h>
+#include <asm/arch/board-pb1176.h>
 
 #define IRQ_LOCALTIMER         29
 #define IRQ_LOCALWDOG          30
index 4fd351b5e4a2172a325e0edb45be7de43e68c0cb..424c0aaf46a0c6c1cc481e5897ace62316d7754b 100644 (file)
@@ -32,9 +32,6 @@
 #define REALVIEW_SSRAM_BASE           /* REALVIEW_SSMC_BASE ? */
 #define REALVIEW_SSRAM_SIZE           SZ_2M
 
-#define REALVIEW_FLASH_BASE           0x40000000
-#define REALVIEW_FLASH_SIZE           SZ_64M
-
 /* 
  *  SDRAM
  */
 #define REALVIEW_INTREG_CARDINSERT   0x03    /* Signal insertion of MMC card                   */
 
 /*
- * REALVIEW peripheral addresses
+ * RealView common peripheral addresses
  */
 #define REALVIEW_SCTL_BASE            0x10001000       /* System controller */
 #define REALVIEW_I2C_BASE             0x10002000       /* I2C control */
-       /* Reserved 0x10003000 */
 #define REALVIEW_AACI_BASE            0x10004000       /* Audio */
 #define REALVIEW_MMCI0_BASE           0x10005000       /* MMC interface */
 #define REALVIEW_KMI0_BASE            0x10006000       /* KMI interface */
 #define REALVIEW_KMI1_BASE            0x10007000       /* KMI 2nd interface */
 #define REALVIEW_CHAR_LCD_BASE        0x10008000       /* Character LCD */
-#define REALVIEW_UART0_BASE           0x10009000       /* UART 0 */
-#define REALVIEW_UART1_BASE           0x1000A000       /* UART 1 */
-#define REALVIEW_UART2_BASE           0x1000B000       /* UART 2 */
-#define REALVIEW_UART3_BASE           0x1000C000       /* UART 3 */
-#define REALVIEW_SSP_BASE             0x1000D000       /* Synchronous Serial Port */
 #define REALVIEW_SCI_BASE             0x1000E000       /* Smart card controller */
-       /* Reserved 0x1000F000 */
-#define REALVIEW_WATCHDOG_BASE        0x10010000       /* watchdog interface */
-#define REALVIEW_TIMER0_1_BASE        0x10011000       /* Timer 0 and 1 */
-#define REALVIEW_TIMER2_3_BASE        0x10012000       /* Timer 2 and 3 */
-#define REALVIEW_GPIO0_BASE           0x10013000       /* GPIO port 0 */
 #define REALVIEW_GPIO1_BASE           0x10014000       /* GPIO port 1 */
 #define REALVIEW_GPIO2_BASE           0x10015000       /* GPIO port 2 */
-       /* Reserved 0x10016000 */
-#define REALVIEW_RTC_BASE             0x10017000       /* Real Time Clock */
 #define REALVIEW_DMC_BASE             0x10018000       /* DMC configuration */
-#define REALVIEW_PCI_CORE_BASE        0x10019000       /* PCI configuration */
-       /* Reserved 0x1001A000 - 0x1001FFFF */
-#define REALVIEW_CLCD_BASE            0x10020000       /* CLCD */
 #define REALVIEW_DMAC_BASE            0x10030000       /* DMA controller */
-#define REALVIEW_GIC_CPU_BASE         0x10040000       /* Generic interrupt controller CPU interface */
-#define REALVIEW_GIC_DIST_BASE        0x10041000       /* Generic interrupt controller distributor */
-#define REALVIEW_SMC_BASE             0x10080000       /* SMC */
-       /* Reserved 0x10090000 - 0x100EFFFF */
-
-#define REALVIEW_ETH_BASE             0x4E000000       /* Ethernet */
 
 /* PCI space */
 #define REALVIEW_PCI_BASE             0x41000000       /* PCI Interface */
index 08b3db883c361fb1ad20484d650589b88b146c87..d55802d645af5258781ecdb36a62232b508aa4c3 100644 (file)
@@ -1,8 +1,13 @@
 #ifndef __ASMARM_ARCH_SCU_H
 #define __ASMARM_ARCH_SCU_H
 
-#include <asm/arch/board-eb.h>
-
-#define SCU_BASE       REALVIEW_EB11MP_SCU_BASE
+/*
+ * SCU registers
+ */
+#define SCU_CTRL               0x00
+#define SCU_CONFIG             0x04
+#define SCU_CPU_STATUS         0x08
+#define SCU_INVALIDATE         0x0c
+#define SCU_FPGA_REVISION      0x10
 
 #endif
index 3d5c2db07a2688c5b564a2ea046dda2e719d8a65..4c905d7a13a11cd7f2b6a2f8634e138c302f5216 100644 (file)
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 #include <asm/hardware.h>
+#include <asm/mach-types.h>
 
-#include <asm/arch/platform.h>
+#include <asm/arch/board-eb.h>
+#include <asm/arch/board-pb11mp.h>
+#include <asm/arch/board-pb1176.h>
 
-#define AMBA_UART_DR   (*(volatile unsigned char *) (REALVIEW_UART0_BASE + 0x00))
-#define AMBA_UART_LCRH (*(volatile unsigned char *) (REALVIEW_UART0_BASE + 0x2c))
-#define AMBA_UART_CR   (*(volatile unsigned char *) (REALVIEW_UART0_BASE + 0x30))
-#define AMBA_UART_FR   (*(volatile unsigned char *) (REALVIEW_UART0_BASE + 0x18))
+#define AMBA_UART_DR(base)     (*(volatile unsigned char *)((base) + 0x00))
+#define AMBA_UART_LCRH(base)   (*(volatile unsigned char *)((base) + 0x2c))
+#define AMBA_UART_CR(base)     (*(volatile unsigned char *)((base) + 0x30))
+#define AMBA_UART_FR(base)     (*(volatile unsigned char *)((base) + 0x18))
+
+/*
+ * Return the UART base address
+ */
+static inline unsigned long get_uart_base(void)
+{
+       if (machine_is_realview_eb())
+               return REALVIEW_EB_UART0_BASE;
+       else if (machine_is_realview_pb11mp())
+               return REALVIEW_PB11MP_UART0_BASE;
+       else if (machine_is_realview_pb1176())
+               return REALVIEW_PB1176_UART0_BASE;
+       else
+               return 0;
+}
 
 /*
  * This does not append a newline
  */
 static inline void putc(int c)
 {
-       while (AMBA_UART_FR & (1 << 5))
+       unsigned long base = get_uart_base();
+
+       while (AMBA_UART_FR(base) & (1 << 5))
                barrier();
 
-       AMBA_UART_DR = c;
+       AMBA_UART_DR(base) = c;
 }
 
 static inline void flush(void)
 {
-       while (AMBA_UART_FR & (1 << 3))
+       unsigned long base = get_uart_base();
+
+       while (AMBA_UART_FR(base) & (1 << 3))
                barrier();
 }
 
index dba9df9d8713bcc2cedf4dde5ff48dacbd86431a..ecae9e7f5e45a6aa34b78324e29ec9acab1a446c 100644 (file)
@@ -137,7 +137,7 @@ s3c2410_get_pll(unsigned int pllval, unsigned int baseclk)
 
 #define S3C2412_CLKDIVN_PDIVN          (1<<2)
 #define S3C2412_CLKDIVN_HDIVN_MASK     (3<<0)
-#define S3C2421_CLKDIVN_ARMDIVN                (1<<3)
+#define S3C2412_CLKDIVN_ARMDIVN                (1<<3)
 #define S3C2412_CLKDIVN_DVSEN          (1<<4)
 #define S3C2412_CLKDIVN_HALFHCLK       (1<<5)
 #define S3C2412_CLKDIVN_USB48DIV       (1<<6)
index 0ad75d716ded62c0fde3227df1ec0df4f8e66657..497dd06e2c992f5a4466317984580a9232eeb059 100644 (file)
 #define S3C2410_GPD14_INP      (0x00 << 28)
 #define S3C2410_GPD14_OUTP     (0x01 << 28)
 #define S3C2410_GPD14_VD22     (0x02 << 28)
+#define S3C2410_GPD14_nSS1     (0x03 << 28)
 
 #define S3C2410_GPD15           S3C2410_GPIONO(S3C2410_GPIO_BANKD, 15)
 #define S3C2410_GPD15_INP      (0x00 << 30)
 #define S3C2410_GPD15_OUTP     (0x01 << 30)
 #define S3C2410_GPD15_VD23     (0x02 << 30)
+#define S3C2410_GPD15_nSS0     (0x03 << 30)
 
 #define S3C2410_GPD_PUPDIS(x)  (1<<(x))
 
 #define S3C2410_GPG2_INP      (0x00 << 4)
 #define S3C2410_GPG2_OUTP     (0x01 << 4)
 #define S3C2410_GPG2_EINT10   (0x02 << 4)
+#define S3C2410_GPG2_nSS0     (0x03 << 4)
 #define S3C2400_GPG2_CDCLK    (0x02 << 4)
 
 #define S3C2410_GPG3          S3C2410_GPIONO(S3C2410_GPIO_BANKG, 3)
 #define S3C2410_GPG3_INP      (0x00 << 6)
 #define S3C2410_GPG3_OUTP     (0x01 << 6)
 #define S3C2410_GPG3_EINT11   (0x02 << 6)
+#define S3C2410_GPG3_nSS1     (0x03 << 6)
 #define S3C2400_GPG3_I2SSDO   (0x02 << 6)
 #define S3C2400_GPG3_I2SSDI   (0x03 << 6)
 
diff --git a/include/asm-arm/arch-s3c2410/regs-s3c2412-mem.h b/include/asm-arm/arch-s3c2410/regs-s3c2412-mem.h
new file mode 100644 (file)
index 0000000..c8c793e
--- /dev/null
@@ -0,0 +1,29 @@
+/* linux/include/asm-arm/arch-s3c2410/regs-s3c2412-mem.h
+ *
+ * Copyright (c) 2008 Simtec Electronics
+ *     Ben Dooks <ben@simtec.co.uk>
+ *     http://armlinux.simtec.co.uk/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * S3C2412 memory register definitions
+*/
+
+#ifndef __ASM_ARM_REGS_S3C2412_MEM
+#define __ASM_ARM_REGS_S3C2412_MEM
+
+#ifndef S3C2412_MEMREG
+#define S3C2412_MEMREG(x) (S3C24XX_VA_MEMCTRL + (x))
+#endif
+
+#define S3C2412_BANKCFG                        S3C2412_MEMREG(0x00)
+#define S3C2412_BANKCON1               S3C2412_MEMREG(0x04)
+#define S3C2412_BANKCON2               S3C2412_MEMREG(0x08)
+#define S3C2412_BANKCON3               S3C2412_MEMREG(0x0C)
+
+#define S3C2412_REFRESH                        S3C2412_MEMREG(0x10)
+#define S3C2412_TIMEOUT                        S3C2412_MEMREG(0x14)
+
+#endif /*  __ASM_ARM_REGS_S3C2412_MEM */
diff --git a/include/asm-arm/arch-s3c2410/system-reset.h b/include/asm-arm/arch-s3c2410/system-reset.h
new file mode 100644 (file)
index 0000000..1615bce
--- /dev/null
@@ -0,0 +1,64 @@
+/* linux/include/asm-arm/arch-s3c2410/system-reset.h
+ *
+ * Copyright (c) 2008 Simtec Electronics
+ *     Ben Dooks <ben@simtec.co.uk>
+ *
+ * S3C2410 - System define for arch_reset() function
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+*/
+
+#include <asm/hardware.h>
+#include <asm/io.h>
+
+#include <asm/plat-s3c/regs-watchdog.h>
+#include <asm/arch/regs-clock.h>
+
+#include <linux/clk.h>
+#include <linux/err.h>
+
+extern void (*s3c24xx_reset_hook)(void);
+
+static void
+arch_reset(char mode)
+{
+       struct clk *wdtclk;
+
+       if (mode == 's') {
+               cpu_reset(0);
+       }
+
+       if (s3c24xx_reset_hook)
+               s3c24xx_reset_hook();
+
+       printk("arch_reset: attempting watchdog reset\n");
+
+       __raw_writel(0, S3C2410_WTCON);   /* disable watchdog, to be safe  */
+
+       wdtclk = clk_get(NULL, "watchdog");
+       if (!IS_ERR(wdtclk)) {
+               clk_enable(wdtclk);
+       } else
+               printk(KERN_WARNING "%s: warning: cannot get watchdog clock\n", __func__);
+
+       /* put initial values into count and data */
+       __raw_writel(0x80, S3C2410_WTCNT);
+       __raw_writel(0x80, S3C2410_WTDAT);
+
+       /* set the watchdog to go and reset... */
+       __raw_writel(S3C2410_WTCON_ENABLE|S3C2410_WTCON_DIV16|S3C2410_WTCON_RSTEN |
+                    S3C2410_WTCON_PRESCALE(0x20), S3C2410_WTCON);
+
+       /* wait for reset to assert... */
+       mdelay(500);
+
+       printk(KERN_ERR "Watchdog reset failed to assert reset\n");
+
+       /* delay to allow the serial port to show the message */
+       mdelay(50);
+
+       /* we'll take a jump through zero as a poor second */
+       cpu_reset(0);
+}
index 14de4e596f87b170661faad4cabe21deeb7019aa..ad258085e53b571c82693e4a55179cfdd4a26e1f 100644 (file)
 #include <asm/arch/idle.h>
 #include <asm/arch/reset.h>
 
-#include <asm/plat-s3c/regs-watchdog.h>
 #include <asm/arch/regs-clock.h>
 
-#include <linux/clk.h>
-#include <linux/err.h>
-
 void (*s3c24xx_idle)(void);
 void (*s3c24xx_reset_hook)(void);
 
@@ -59,44 +55,4 @@ static void arch_idle(void)
                s3c24xx_default_idle();
 }
 
-static void
-arch_reset(char mode)
-{
-       struct clk *wdtclk;
-
-       if (mode == 's') {
-               cpu_reset(0);
-       }
-
-       if (s3c24xx_reset_hook)
-               s3c24xx_reset_hook();
-
-       printk("arch_reset: attempting watchdog reset\n");
-
-       __raw_writel(0, S3C2410_WTCON);   /* disable watchdog, to be safe  */
-
-       wdtclk = clk_get(NULL, "watchdog");
-       if (!IS_ERR(wdtclk)) {
-               clk_enable(wdtclk);
-       } else
-               printk(KERN_WARNING "%s: warning: cannot get watchdog clock\n", __func__);
-
-       /* put initial values into count and data */
-       __raw_writel(0x80, S3C2410_WTCNT);
-       __raw_writel(0x80, S3C2410_WTDAT);
-
-       /* set the watchdog to go and reset... */
-       __raw_writel(S3C2410_WTCON_ENABLE|S3C2410_WTCON_DIV16|S3C2410_WTCON_RSTEN |
-                    S3C2410_WTCON_PRESCALE(0x20), S3C2410_WTCON);
-
-       /* wait for reset to assert... */
-       mdelay(500);
-
-       printk(KERN_ERR "Watchdog reset failed to assert reset\n");
-
-       /* delay to allow the serial port to show the message */
-       mdelay(50);
-
-       /* we'll take a jump through zero as a poor second */
-       cpu_reset(0);
-}
+#include <asm/arch/system-reset.h>
index e7a9d26e22a8b0a4baa1d0de08b65d672e418a79..93d3395b102dcd2d6348d70fe599f4838bd63290 100644 (file)
 
 #include <asm/hardware.h>
 #include <asm/irq.h>
-
-static inline int gpio_request(unsigned gpio, const char *label)
-{
-       return 0;
-}
-
-static inline void gpio_free(unsigned gpio)
-{
-       return;
-}
-
-extern int gpio_direction_input(unsigned gpio);
-extern int gpio_direction_output(unsigned gpio, int value);
-
+#include <asm-generic/gpio.h>
 
 static inline int gpio_get_value(unsigned gpio)
 {
-       return GPLR & GPIO_GPIO(gpio);
+       if (__builtin_constant_p(gpio) && (gpio <= GPIO_MAX))
+               return GPLR & GPIO_GPIO(gpio);
+       else
+               return __gpio_get_value(gpio);
 }
 
 static inline void gpio_set_value(unsigned gpio, int value)
 {
-       if (value)
-               GPSR = GPIO_GPIO(gpio);
+       if (__builtin_constant_p(gpio) && (gpio <= GPIO_MAX))
+               if (value)
+                       GPSR = GPIO_GPIO(gpio);
+               else
+                       GPCR = GPIO_GPIO(gpio);
        else
-               GPCR = GPIO_GPIO(gpio);
+               __gpio_set_value(gpio, value);
 }
 
-#include <asm-generic/gpio.h>                  /* cansleep wrappers */
+#define gpio_cansleep  __gpio_cansleep
 
 static inline unsigned gpio_to_irq(unsigned gpio)
 {
index 715e18a4add107bb230f6d522664e61cc7e47b84..3479de9266e5584ec6c404ea08786347d121e03c 100644 (file)
@@ -20,6 +20,10 @@ extern struct processor {
         * get data abort address/flags
         */
        void (*_data_abort)(unsigned long pc);
+       /*
+        * Retrieve prefetch fault address
+        */
+       unsigned long (*_prefetch_abort)(unsigned long lr);
        /*
         * Set up any processor specifics
         */
index 22274ce8137509175dcd2664e2632edac0a167e7..a97a182ba28732a4d9d22ae353efcf695696bd46 100644 (file)
  *       v6_early      - ARMv6 generic early abort handler
  *       v7_early      - ARMv7 generic early abort handler
  */
-#undef CPU_ABORT_HANDLER
-#undef MULTI_ABORT
+#undef CPU_DABORT_HANDLER
+#undef MULTI_DABORT
 
 #if defined(CONFIG_CPU_ARM610)
-# ifdef CPU_ABORT_HANDLER
-#  define MULTI_ABORT 1
+# ifdef CPU_DABORT_HANDLER
+#  define MULTI_DABORT 1
 # else
-#  define CPU_ABORT_HANDLER cpu_arm6_data_abort
+#  define CPU_DABORT_HANDLER cpu_arm6_data_abort
 # endif
 #endif
 
 #if defined(CONFIG_CPU_ARM710)
-# ifdef CPU_ABORT_HANDLER
-#  define MULTI_ABORT 1
+# ifdef CPU_DABORT_HANDLER
+#  define MULTI_DABORT 1
 # else
-#  define CPU_ABORT_HANDLER cpu_arm7_data_abort
+#  define CPU_DABORT_HANDLER cpu_arm7_data_abort
 # endif
 #endif
 
 #ifdef CONFIG_CPU_ABRT_LV4T
-# ifdef CPU_ABORT_HANDLER
-#  define MULTI_ABORT 1
+# ifdef CPU_DABORT_HANDLER
+#  define MULTI_DABORT 1
 # else
-#  define CPU_ABORT_HANDLER v4t_late_abort
+#  define CPU_DABORT_HANDLER v4t_late_abort
 # endif
 #endif
 
 #ifdef CONFIG_CPU_ABRT_EV4
-# ifdef CPU_ABORT_HANDLER
-#  define MULTI_ABORT 1
+# ifdef CPU_DABORT_HANDLER
+#  define MULTI_DABORT 1
 # else
-#  define CPU_ABORT_HANDLER v4_early_abort
+#  define CPU_DABORT_HANDLER v4_early_abort
 # endif
 #endif
 
 #ifdef CONFIG_CPU_ABRT_EV4T
-# ifdef CPU_ABORT_HANDLER
-#  define MULTI_ABORT 1
+# ifdef CPU_DABORT_HANDLER
+#  define MULTI_DABORT 1
 # else
-#  define CPU_ABORT_HANDLER v4t_early_abort
+#  define CPU_DABORT_HANDLER v4t_early_abort
 # endif
 #endif
 
 #ifdef CONFIG_CPU_ABRT_EV5TJ
-# ifdef CPU_ABORT_HANDLER
-#  define MULTI_ABORT 1
+# ifdef CPU_DABORT_HANDLER
+#  define MULTI_DABORT 1
 # else
-#  define CPU_ABORT_HANDLER v5tj_early_abort
+#  define CPU_DABORT_HANDLER v5tj_early_abort
 # endif
 #endif
 
 #ifdef CONFIG_CPU_ABRT_EV5T
-# ifdef CPU_ABORT_HANDLER
-#  define MULTI_ABORT 1
+# ifdef CPU_DABORT_HANDLER
+#  define MULTI_DABORT 1
 # else
-#  define CPU_ABORT_HANDLER v5t_early_abort
+#  define CPU_DABORT_HANDLER v5t_early_abort
 # endif
 #endif
 
 #ifdef CONFIG_CPU_ABRT_EV6
-# ifdef CPU_ABORT_HANDLER
-#  define MULTI_ABORT 1
+# ifdef CPU_DABORT_HANDLER
+#  define MULTI_DABORT 1
 # else
-#  define CPU_ABORT_HANDLER v6_early_abort
+#  define CPU_DABORT_HANDLER v6_early_abort
 # endif
 #endif
 
 #ifdef CONFIG_CPU_ABRT_EV7
-# ifdef CPU_ABORT_HANDLER
-#  define MULTI_ABORT 1
+# ifdef CPU_DABORT_HANDLER
+#  define MULTI_DABORT 1
 # else
-#  define CPU_ABORT_HANDLER v7_early_abort
+#  define CPU_DABORT_HANDLER v7_early_abort
 # endif
 #endif
 
-#ifndef CPU_ABORT_HANDLER
+#ifndef CPU_DABORT_HANDLER
 #error Unknown data abort handler type
 #endif
 
+/*
+ * Prefetch abort handler.  If the CPU has an IFAR use that, otherwise
+ * use the address of the aborted instruction
+ */
+#undef CPU_PABORT_HANDLER
+#undef MULTI_PABORT
+
+#ifdef CONFIG_CPU_PABRT_IFAR
+# ifdef CPU_PABORT_HANDLER
+#  define MULTI_PABORT 1
+# else
+#  define CPU_PABORT_HANDLER(reg, insn)        mrc p15, 0, reg, cr6, cr0, 2
+# endif
+#endif
+
+#ifdef CONFIG_CPU_PABRT_NOIFAR
+# ifdef CPU_PABORT_HANDLER
+#  define MULTI_PABORT 1
+# else
+#  define CPU_PABORT_HANDLER(reg, insn)        mov reg, insn
+# endif
+#endif
+
+#ifndef CPU_PABORT_HANDLER
+#error Unknown prefetch abort handler type
+#endif
+
 #endif
diff --git a/include/asm-arm/hardware/arm_scu.h b/include/asm-arm/hardware/arm_scu.h
deleted file mode 100644 (file)
index 7d28eb5..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-#ifndef ASMARM_HARDWARE_ARM_SCU_H
-#define ASMARM_HARDWARE_ARM_SCU_H
-
-#include <asm/arch/scu.h>
-
-/*
- * SCU registers
- */
-#define SCU_CTRL               0x00
-#define SCU_CONFIG             0x04
-#define SCU_CPU_STATUS         0x08
-#define SCU_INVALIDATE         0x0c
-#define SCU_FPGA_REVISION      0x10
-
-#endif
index ede377ec91470e11472c1059b7dc55c790b28074..18f6937f50103d1ec60d04412c67613b2b739eae 100644 (file)
@@ -29,6 +29,7 @@ extern void gpio_line_config(int line, int direction);
 extern int  gpio_line_get(int line);
 extern void gpio_line_set(int line, int value);
 extern int init_atu;
+extern int iop3xx_get_init_atu(void);
 #endif
 
 
@@ -112,14 +113,6 @@ extern int init_atu;
 #define IOP3XX_INIT_ATU_DISABLE -1
 #define IOP3XX_INIT_ATU_ENABLE  1
 
-#ifdef CONFIG_IOP3XX_ATU
-#define iop3xx_get_init_atu(x) (init_atu == IOP3XX_INIT_ATU_DEFAULT ?\
-                               IOP3XX_INIT_ATU_ENABLE : init_atu)
-#else
-#define iop3xx_get_init_atu(x) (init_atu == IOP3XX_INIT_ATU_DEFAULT ?\
-                               IOP3XX_INIT_ATU_DISABLE : init_atu)
-#endif
-
 /* Messaging Unit  */
 #define IOP3XX_IMR0            (volatile u32 *)IOP3XX_REG_ADDR(0x0310)
 #define IOP3XX_IMR1            (volatile u32 *)IOP3XX_REG_ADDR(0x0314)
index d37bf7443264c347141ae9550dfbda9d59dedd85..dfb8330599f9cc698ff4514fb6f5f698f7966118 100644 (file)
@@ -40,6 +40,7 @@ struct scoop_config {
        unsigned short io_dir;
        unsigned short suspend_clr;
        unsigned short suspend_set;
+       int gpio_base;
 };
 
 /* Structure for linking scoop devices to PCMCIA sockets */
@@ -62,7 +63,7 @@ struct scoop_pcmcia_config {
 extern struct scoop_pcmcia_config *platform_scoop_config;
 
 void reset_scoop(struct device *dev);
-unsigned short set_scoop_gpio(struct device *dev, unsigned short bit);
-unsigned short reset_scoop_gpio(struct device *dev, unsigned short bit);
+unsigned short __deprecated set_scoop_gpio(struct device *dev, unsigned short bit);
+unsigned short __deprecated reset_scoop_gpio(struct device *dev, unsigned short bit);
 unsigned short read_scoop_reg(struct device *dev, unsigned short reg);
 void write_scoop_reg(struct device *dev, unsigned short reg, unsigned short data);
index 01a1391d3014a15baca81894c32836d8bca15e3b..81f4c899a555b5949df821f313af262ba5303c49 100644 (file)
@@ -15,6 +15,7 @@
 #define HWCAP_JAVA     256
 #define HWCAP_IWMMXT   512
 #define HWCAP_CRUNCH   1024
+#define HWCAP_THUMBEE  2048
 
 #if defined(__KERNEL__) && !defined(__ASSEMBLY__)
 /*
index 24621c49a0c73abaa778a9b1d60801c23f409bc8..9d4f6b5ea4190645129497cdc0af908917fafbe0 100644 (file)
@@ -55,6 +55,7 @@ void pci_common_init(struct hw_pci *);
 extern int iop3xx_pci_setup(int nr, struct pci_sys_data *);
 extern struct pci_bus *iop3xx_pci_scan_bus(int nr, struct pci_sys_data *);
 extern void iop3xx_pci_preinit(void);
+extern void iop3xx_pci_preinit_cond(void);
 
 extern int dc21285_setup(int nr, struct pci_sys_data *);
 extern struct pci_bus *dc21285_scan_bus(int nr, struct pci_sys_data *);
index d9bfb39adabf02650ad0d4410c8e8c461b508069..9ba4d7136e6b2dfeaf714df43f35be6c616da9ba 100644 (file)
@@ -217,7 +217,10 @@ static inline __deprecated void *bus_to_virt(unsigned long x)
 #ifndef CONFIG_DISCONTIGMEM
 
 #define ARCH_PFN_OFFSET                PHYS_PFN_OFFSET
+
+#ifndef CONFIG_SPARSEMEM
 #define pfn_valid(pfn)         ((pfn) >= PHYS_PFN_OFFSET && (pfn) < (PHYS_PFN_OFFSET + max_mapnr))
+#endif
 
 #define virt_to_page(kaddr)    pfn_to_page(__pa(kaddr) >> PAGE_SHIFT)
 #define virt_addr_valid(kaddr) ((unsigned long)(kaddr) >= PAGE_OFFSET && (unsigned long)(kaddr) < (unsigned long)high_memory)
diff --git a/include/asm-arm/plat-orion/ehci-orion.h b/include/asm-arm/plat-orion/ehci-orion.h
new file mode 100644 (file)
index 0000000..7857056
--- /dev/null
@@ -0,0 +1,19 @@
+/*
+ * include/asm-arm/plat-orion/ehci-orion.h
+ *
+ * This file is licensed under the terms of the GNU General Public
+ * License version 2.  This program is licensed "as is" without any
+ * warranty of any kind, whether express or implied.
+ */
+
+#ifndef __ASM_PLAT_ORION_EHCI_ORION_H
+#define __ASM_PLAT_ORION_EHCI_ORION_H
+
+#include <linux/mbus.h>
+
+struct orion_ehci_data {
+       struct mbus_dram_target_info    *dram;
+};
+
+
+#endif
diff --git a/include/asm-arm/plat-orion/irq.h b/include/asm-arm/plat-orion/irq.h
new file mode 100644 (file)
index 0000000..94aeed9
--- /dev/null
@@ -0,0 +1,17 @@
+/*
+ * include/asm-arm/plat-orion/irq.h
+ *
+ * Marvell Orion SoC IRQ handling.
+ *
+ * This file is licensed under the terms of the GNU General Public
+ * License version 2.  This program is licensed "as is" without any
+ * warranty of any kind, whether express or implied.
+ */
+
+#ifndef __ASM_PLAT_ORION_IRQ_H
+#define __ASM_PLAT_ORION_IRQ_H
+
+void orion_irq_init(unsigned int irq_start, void __iomem *maskaddr);
+
+
+#endif
similarity index 64%
rename from include/asm-arm/arch-orion/platform.h
rename to include/asm-arm/plat-orion/orion_nand.h
index 143c38e2fa0baccd6460b23712d707455a457a19..ffd3852a0dd79757577fd0b80a58f0788b7f9e43 100644 (file)
@@ -1,15 +1,13 @@
 /*
- * asm-arm/arch-orion/platform.h
- *
- * Tzachi Perelstein <tzachi@marvell.com>
+ * include/asm-arm/plat-orion/orion_nand.h
  *
  * This file is licensed under the terms of the GNU General Public
- * License version 2. This program is licensed "as is" without any
+ * License version 2.  This program is licensed "as is" without any
  * warranty of any kind, whether express or implied.
  */
 
-#ifndef __ASM_ARCH_PLATFORM_H__
-#define __ASM_ARCH_PLATFORM_H__
+#ifndef __ASM_PLAT_ORION_ORION_NAND_H
+#define __ASM_PLAT_ORION_ORION_NAND_H
 
 /*
  * Device bus NAND private data
@@ -22,4 +20,5 @@ struct orion_nand_data {
        u8 width;       /* buswidth */
 };
 
+
 #endif
diff --git a/include/asm-arm/plat-orion/pcie.h b/include/asm-arm/plat-orion/pcie.h
new file mode 100644 (file)
index 0000000..6434ac6
--- /dev/null
@@ -0,0 +1,31 @@
+/*
+ * include/asm-arm/plat-orion/pcie.h
+ *
+ * Marvell Orion SoC PCIe handling.
+ *
+ * This file is licensed under the terms of the GNU General Public
+ * License version 2.  This program is licensed "as is" without any
+ * warranty of any kind, whether express or implied.
+ */
+
+#ifndef __ASM_PLAT_ORION_PCIE_H
+#define __ASM_PLAT_ORION_PCIE_H
+
+u32 orion_pcie_dev_id(void __iomem *base);
+u32 orion_pcie_rev(void __iomem *base);
+int orion_pcie_link_up(void __iomem *base);
+int orion_pcie_get_local_bus_nr(void __iomem *base);
+void orion_pcie_set_local_bus_nr(void __iomem *base, int nr);
+void orion_pcie_setup(void __iomem *base,
+                     struct mbus_dram_target_info *dram);
+int orion_pcie_rd_conf(void __iomem *base, struct pci_bus *bus,
+                      u32 devfn, int where, int size, u32 *val);
+int orion_pcie_rd_conf_tlp(void __iomem *base, struct pci_bus *bus,
+                          u32 devfn, int where, int size, u32 *val);
+int orion_pcie_rd_conf_wa(void __iomem *wa_base, struct pci_bus *bus,
+                         u32 devfn, int where, int size, u32 *val);
+int orion_pcie_wr_conf(void __iomem *base, struct pci_bus *bus,
+                      u32 devfn, int where, int size, u32 val);
+
+
+#endif
diff --git a/include/asm-arm/plat-orion/time.h b/include/asm-arm/plat-orion/time.h
new file mode 100644 (file)
index 0000000..0e85cc8
--- /dev/null
@@ -0,0 +1,17 @@
+/*
+ * include/asm-arm/plat-orion/time.h
+ *
+ * Marvell Orion SoC time handling.
+ *
+ * This file is licensed under the terms of the GNU General Public
+ * License version 2.  This program is licensed "as is" without any
+ * warranty of any kind, whether express or implied.
+ */
+
+#ifndef __ASM_PLAT_ORION_TIME_H
+#define __ASM_PLAT_ORION_TIME_H
+
+void orion_time_init(unsigned int irq, unsigned int tclk);
+
+
+#endif
diff --git a/include/asm-arm/sparsemem.h b/include/asm-arm/sparsemem.h
new file mode 100644 (file)
index 0000000..2771581
--- /dev/null
@@ -0,0 +1,10 @@
+#ifndef ASMARM_SPARSEMEM_H
+#define ASMARM_SPARSEMEM_H
+
+#include <asm/memory.h>
+
+#define MAX_PHYSADDR_BITS      32
+#define MAX_PHYSMEM_BITS       32
+#define SECTION_SIZE_BITS      NODE_MEM_SIZE_BITS
+
+#endif
index 41784357a2040a8c9636d035c522a50ce941b8f2..f5a6647863114ccfe5fa8f88a8bab88ce29b48aa 100644 (file)
@@ -62,6 +62,9 @@ struct thread_info {
        struct crunch_state     crunchstate;
        union fp_state          fpstate __attribute__((aligned(8)));
        union vfp_state         vfpstate;
+#ifdef CONFIG_ARM_THUMBEE
+       unsigned long           thumbee_state;  /* ThumbEE Handler Base register */
+#endif
        struct restart_block    restart_block;
 };
 
index 88e868b7aae07a92c3d7bfde3911d3b50b019dd7..7c570082b1e0c6850471a3cfaf182f1dad28f88b 100644 (file)
 #define __NR_kexec_load                        (__NR_SYSCALL_BASE+347)
 #define __NR_utimensat                 (__NR_SYSCALL_BASE+348)
 #define __NR_signalfd                  (__NR_SYSCALL_BASE+349)
-#define __NR_timerfd                   (__NR_SYSCALL_BASE+350)
+#define __NR_timerfd_create            (__NR_SYSCALL_BASE+350)
 #define __NR_eventfd                   (__NR_SYSCALL_BASE+351)
 #define __NR_fallocate                 (__NR_SYSCALL_BASE+352)
+#define __NR_timerfd_settime           (__NR_SYSCALL_BASE+353)
+#define __NR_timerfd_gettime           (__NR_SYSCALL_BASE+354)
 
 /*
  * The following SWIs are ARM private.
index 7597b0bd2f01d6527f5f8db835c0c10a2521b6b0..a4e2d28bfb5884c52af09f110fa543d776386f57 100644 (file)
@@ -38,9 +38,7 @@ struct platform_device *
 at32_add_device_lcdc(unsigned int id, struct atmel_lcdfb_info *data,
                     unsigned long fbmem_start, unsigned long fbmem_len);
 
-struct usba_platform_data {
-       int vbus_pin;
-};
+struct usba_platform_data;
 struct platform_device *
 at32_add_device_usba(unsigned int id, struct usba_platform_data *data);
 
@@ -68,7 +66,10 @@ struct platform_device *at32_add_device_pwm(u32 mask);
 struct platform_device *
 at32_add_device_ssc(unsigned int id, unsigned int flags);
 
-struct platform_device *at32_add_device_twi(unsigned int id);
+struct i2c_board_info;
+struct platform_device *at32_add_device_twi(unsigned int id,
+                                           struct i2c_board_info *b,
+                                           unsigned int n);
 struct platform_device *at32_add_device_mci(unsigned int id);
 struct platform_device *at32_add_device_ac97c(unsigned int id);
 struct platform_device *at32_add_device_abdac(unsigned int id);
diff --git a/include/asm-avr32/arch-at32ap/pm.h b/include/asm-avr32/arch-at32ap/pm.h
new file mode 100644 (file)
index 0000000..356e430
--- /dev/null
@@ -0,0 +1,48 @@
+/*
+ * AVR32 AP Power Management.
+ *
+ * Copyright (C) 2008 Atmel Corporation
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+#ifndef __ASM_AVR32_ARCH_PM_H
+#define __ASM_AVR32_ARCH_PM_H
+
+/* Possible arguments to the "sleep" instruction */
+#define CPU_SLEEP_IDLE         0
+#define CPU_SLEEP_FROZEN       1
+#define CPU_SLEEP_STANDBY      2
+#define CPU_SLEEP_STOP         3
+#define CPU_SLEEP_STATIC       5
+
+#ifndef __ASSEMBLY__
+extern void cpu_enter_idle(void);
+
+extern bool disable_idle_sleep;
+
+static inline void cpu_disable_idle_sleep(void)
+{
+       disable_idle_sleep = true;
+}
+
+static inline void cpu_enable_idle_sleep(void)
+{
+       disable_idle_sleep = false;
+}
+
+static inline void cpu_idle_sleep(void)
+{
+       /*
+        * If we're using the COUNT and COMPARE registers for
+        * timekeeping, we can't use the IDLE state.
+        */
+       if (disable_idle_sleep)
+               cpu_relax();
+       else
+               cpu_enter_idle();
+}
+#endif
+
+#endif /* __ASM_AVR32_ARCH_PM_H */
diff --git a/include/asm-avr32/arch-at32ap/time.h b/include/asm-avr32/arch-at32ap/time.h
deleted file mode 100644 (file)
index cc8a434..0000000
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * Copyright (C) 2007 Atmel Corporation
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-
-#ifndef _ASM_AVR32_ARCH_AT32AP_TIME_H
-#define _ASM_AVR32_ARCH_AT32AP_TIME_H
-
-#include <linux/platform_device.h>
-
-extern struct irqaction timer_irqaction;
-extern struct platform_device at32_systc0_device;
-extern void local_timer_interrupt(int irq, void *dev_id);
-
-#define TIMER_BCR                                      0x000000c0
-#define TIMER_BCR_SYNC                                          0
-#define TIMER_BMR                                      0x000000c4
-#define TIMER_BMR_TC0XC0S                                       0
-#define TIMER_BMR_TC1XC1S                                       2
-#define TIMER_BMR_TC2XC2S                                       4
-#define TIMER_CCR                                      0x00000000
-#define TIMER_CCR_CLKDIS                                        1
-#define TIMER_CCR_CLKEN                                                 0
-#define TIMER_CCR_SWTRG                                                 2
-#define TIMER_CMR                                      0x00000004
-#define TIMER_CMR_ABETRG                                       10
-#define TIMER_CMR_ACPA                                         16
-#define TIMER_CMR_ACPC                                         18
-#define TIMER_CMR_AEEVT                                                20
-#define TIMER_CMR_ASWTRG                                       22
-#define TIMER_CMR_BCPB                                         24
-#define TIMER_CMR_BCPC                                         26
-#define TIMER_CMR_BEEVT                                                28
-#define TIMER_CMR_BSWTRG                                       30
-#define TIMER_CMR_BURST                                                 4
-#define TIMER_CMR_CLKI                                          3
-#define TIMER_CMR_CPCDIS                                        7
-#define TIMER_CMR_CPCSTOP                                       6
-#define TIMER_CMR_CPCTRG                                       14
-#define TIMER_CMR_EEVT                                         10
-#define TIMER_CMR_EEVTEDG                                       8
-#define TIMER_CMR_ENETRG                                       12
-#define TIMER_CMR_ETRGEDG                                       8
-#define TIMER_CMR_LDBDIS                                        7
-#define TIMER_CMR_LDBSTOP                                       6
-#define TIMER_CMR_LDRA                                         16
-#define TIMER_CMR_LDRB                                         18
-#define TIMER_CMR_TCCLKS                                        0
-#define TIMER_CMR_WAVE                                         15
-#define TIMER_CMR_WAVSEL                                       13
-#define TIMER_CV                                       0x00000010
-#define TIMER_CV_CV                                             0
-#define TIMER_IDR                                      0x00000028
-#define TIMER_IDR_COVFS                                                 0
-#define TIMER_IDR_CPAS                                          2
-#define TIMER_IDR_CPBS                                          3
-#define TIMER_IDR_CPCS                                          4
-#define TIMER_IDR_ETRGS                                                 7
-#define TIMER_IDR_LDRAS                                                 5
-#define TIMER_IDR_LDRBS                                                 6
-#define TIMER_IDR_LOVRS                                                 1
-#define TIMER_IER                                      0x00000024
-#define TIMER_IER_COVFS                                                 0
-#define TIMER_IER_CPAS                                          2
-#define TIMER_IER_CPBS                                          3
-#define TIMER_IER_CPCS                                          4
-#define TIMER_IER_ETRGS                                                 7
-#define TIMER_IER_LDRAS                                                 5
-#define TIMER_IER_LDRBS                                                 6
-#define TIMER_IER_LOVRS                                                 1
-#define TIMER_IMR                                      0x0000002c
-#define TIMER_IMR_COVFS                                                 0
-#define TIMER_IMR_CPAS                                          2
-#define TIMER_IMR_CPBS                                          3
-#define TIMER_IMR_CPCS                                          4
-#define TIMER_IMR_ETRGS                                                 7
-#define TIMER_IMR_LDRAS                                                 5
-#define TIMER_IMR_LDRBS                                                 6
-#define TIMER_IMR_LOVRS                                                 1
-#define TIMER_RA                                       0x00000014
-#define TIMER_RA_RA                                             0
-#define TIMER_RB                                       0x00000018
-#define TIMER_RB_RB                                             0
-#define TIMER_RC                                       0x0000001c
-#define TIMER_RC_RC                                             0
-#define TIMER_SR                                       0x00000020
-#define TIMER_SR_CLKSTA                                                16
-#define TIMER_SR_COVFS                                          0
-#define TIMER_SR_CPAS                                           2
-#define TIMER_SR_CPBS                                           3
-#define TIMER_SR_CPCS                                           4
-#define TIMER_SR_ETRGS                                          7
-#define TIMER_SR_LDRAS                                          5
-#define TIMER_SR_LDRBS                                          6
-#define TIMER_SR_LOVRS                                          1
-#define TIMER_SR_MTIOA                                         17
-#define TIMER_SR_MTIOB                                         18
-
-/* Bit manipulation macros */
-#define TIMER_BIT(name)                (1 << TIMER_##name)
-#define TIMER_BF(name,value)   ((value) << TIMER_##name)
-
-/* Register access macros */
-#define timer_read(port,instance,reg) \
-       __raw_readl(port + (0x40 * instance) + TIMER_##reg)
-#define timer_write(port,instance,reg,value) \
-       __raw_writel((value), port + (0x40 * instance) + TIMER_##reg)
-
-#endif /* _ASM_AVR32_ARCH_AT32AP_TIME_H */
index 515c7618952ba2ef17fbdc94a9860eb4f24a7c39..a2c64f404b9823d82aead2c7470112caeadde94c 100644 (file)
 #include <asm/asm-offsets.h>
 #include <asm/thread_info.h>
 
-#define mask_interrupts                ssrf    SR_GM_BIT
-#define mask_exceptions                ssrf    SR_EM_BIT
-#define unmask_interrupts      csrf    SR_GM_BIT
-#define unmask_exceptions      csrf    SR_EM_BIT
+#define mask_interrupts                ssrf    SYSREG_GM_OFFSET
+#define mask_exceptions                ssrf    SYSREG_EM_OFFSET
+#define unmask_interrupts      csrf    SYSREG_GM_OFFSET
+#define unmask_exceptions      csrf    SYSREG_EM_OFFSET
 
 #ifdef CONFIG_FRAME_POINTER
        .macro  save_fp
diff --git a/include/asm-avr32/intc.h b/include/asm-avr32/intc.h
deleted file mode 100644 (file)
index 1ac9ca7..0000000
+++ /dev/null
@@ -1,128 +0,0 @@
-#ifndef __ASM_AVR32_INTC_H
-#define __ASM_AVR32_INTC_H
-
-#include <linux/sysdev.h>
-#include <linux/interrupt.h>
-
-struct irq_controller;
-struct irqaction;
-struct pt_regs;
-
-struct platform_device;
-
-/* Information about the internal interrupt controller */
-struct intc_device {
-       /* ioremapped address of configuration block */
-       void __iomem *regs;
-
-       /* the physical device */
-       struct platform_device *pdev;
-
-       /* Number of interrupt lines per group. */
-       unsigned int irqs_per_group;
-
-       /* The highest group ID + 1 */
-       unsigned int nr_groups;
-
-       /*
-        * Bitfield indicating which groups are actually in use.  The
-        * size of the array is
-        * ceil(group_max / (8 * sizeof(unsigned int))).
-        */
-       unsigned int group_mask[];
-};
-
-struct irq_controller_class {
-       /*
-        * A short name identifying this kind of controller.
-        */
-       const char *typename;
-       /*
-        * Handle the IRQ.  Must do any necessary acking and masking.
-        */
-       irqreturn_t (*handle)(int irq, void *dev_id, struct pt_regs *regs);
-       /*
-        * Register a new IRQ handler.
-        */
-       int (*setup)(struct irq_controller *ctrl, unsigned int irq,
-                    struct irqaction *action);
-       /*
-        * Unregister a IRQ handler.
-        */
-       void (*free)(struct irq_controller *ctrl, unsigned int irq,
-                    void *dev_id);
-       /*
-        * Mask the IRQ in the interrupt controller.
-        */
-       void (*mask)(struct irq_controller *ctrl, unsigned int irq);
-       /*
-        * Unmask the IRQ in the interrupt controller.
-        */
-       void (*unmask)(struct irq_controller *ctrl, unsigned int irq);
-       /*
-        * Set the type of the IRQ. See below for possible types.
-        * Return -EINVAL if a given type is not supported
-        */
-       int (*set_type)(struct irq_controller *ctrl, unsigned int irq,
-                       unsigned int type);
-       /*
-        * Return the IRQ type currently set
-        */
-       unsigned int (*get_type)(struct irq_controller *ctrl, unsigned int irq);
-};
-
-struct irq_controller {
-       struct irq_controller_class *class;
-       unsigned int irq_group;
-       unsigned int first_irq;
-       unsigned int nr_irqs;
-       struct list_head list;
-};
-
-struct intc_group_desc {
-       struct irq_controller *ctrl;
-       irqreturn_t (*handle)(int, void *, struct pt_regs *);
-       unsigned long flags;
-       void *dev_id;
-       const char *devname;
-};
-
-/*
- * The internal interrupt controller.  Defined in board/part-specific
- * devices.c.
- * TODO: Should probably be defined per-cpu.
- */
-extern struct intc_device intc;
-
-extern int request_internal_irq(unsigned int irq,
-                               irqreturn_t (*handler)(int, void *, struct pt_regs *),
-                               unsigned long irqflags,
-                               const char *devname, void *dev_id);
-extern void free_internal_irq(unsigned int irq);
-
-/* Only used by time_init() */
-extern int setup_internal_irq(unsigned int irq, struct intc_group_desc *desc);
-
-/*
- * Set interrupt priority for a given group. `group' can be found by
- * using irq_to_group(irq). Priority can be from 0 (lowest) to 3
- * (highest). Higher-priority interrupts will preempt lower-priority
- * interrupts (unless interrupts are masked globally).
- *
- * This function does not check for conflicts within a group.
- */
-extern int intc_set_priority(unsigned int group,
-                            unsigned int priority);
-
-/*
- * Returns a bitmask of pending interrupts in a group.
- */
-extern unsigned long intc_get_pending(unsigned int group);
-
-/*
- * Register a new external interrupt controller.  Returns the first
- * external IRQ number that is assigned to the new controller.
- */
-extern int intc_register_controller(struct irq_controller *ctrl);
-
-#endif /* __ASM_AVR32_INTC_H */
index 9315724c059675d7bdcda46007c63c9260afda7c..c563b7720c1ad7f8034100c64dd223e13e81d079 100644 (file)
 #ifndef __ASSEMBLER__
 int nmi_enable(void);
 void nmi_disable(void);
+
+/*
+ * Returns a bitmask of pending interrupts in a group.
+ */
+extern unsigned long intc_get_pending(unsigned int group);
 #endif
 
 #endif /* __ASM_AVR32_IOCTLS_H */
index 5582968feee853220432ac4b503c038c4beb7d0f..cbbc5ca9728bb94558513df79d18904633b84ca9 100644 (file)
@@ -8,13 +8,11 @@
 #ifndef __ASM_AVR32_PAGE_H
 #define __ASM_AVR32_PAGE_H
 
+#include <linux/const.h>
+
 /* PAGE_SHIFT determines the page size */
 #define PAGE_SHIFT     12
-#ifdef __ASSEMBLY__
-#define PAGE_SIZE      (1 << PAGE_SHIFT)
-#else
-#define PAGE_SIZE      (1UL << PAGE_SHIFT)
-#endif
+#define PAGE_SIZE      (_AC(1, UL) << PAGE_SHIFT)
 #define PAGE_MASK      (~(PAGE_SIZE-1))
 #define PTE_MASK       PAGE_MASK
 
diff --git a/include/asm-avr32/serial.h b/include/asm-avr32/serial.h
new file mode 100644 (file)
index 0000000..5ecaebc
--- /dev/null
@@ -0,0 +1,13 @@
+#ifndef _ASM_SERIAL_H
+#define _ASM_SERIAL_H
+
+/*
+ * This assumes you have a 1.8432 MHz clock for your UART.
+ *
+ * It'd be nice if someone built a serial card with a 24.576 MHz
+ * clock, since the 16550A is capable of handling a top speed of 1.5
+ * megabits/second; but this requires the faster clock.
+ */
+#define BASE_BAUD (1843200 / 16)
+
+#endif /* _ASM_SERIAL_H */
diff --git a/include/asm-avr32/xor.h b/include/asm-avr32/xor.h
new file mode 100644 (file)
index 0000000..99c87aa
--- /dev/null
@@ -0,0 +1,6 @@
+#ifndef _ASM_XOR_H
+#define _ASM_XOR_H
+
+#include <asm-generic/xor.h>
+
+#endif
index 5abaa2cee8dbd7da51d937ab4c77bc85daaa25e9..16d493574ba8cb97e4ee78a2cd62420909e4b6bd 100644 (file)
@@ -33,7 +33,6 @@
 #include <linux/slab.h>
 #include <asm/irq.h>
 #include <asm/signal.h>
-#include <asm/semaphore.h>
 
 #include <linux/kernel.h>
 #include <asm/mach/dma.h>
index abe7298742ac23f59ffa65c0e3e51f3638a35b9d..94272435270552b4fe0b266c00796ec1aa4fbd9c 100644 (file)
@@ -5,10 +5,8 @@
 
 #error NUMA not supported yet
 
-#else /* !CONFIG_NUMA */
+#endif /* CONFIG_NUMA */
 
 #include <asm-generic/topology.h>
 
-#endif /* CONFIG_NUMA */
-
 #endif /* _ASM_TOPOLOGY_H */
index 342a2a0105c4c070f988d39afc90f46d52dca12d..a6aea79bca4f369b51f0e384e15bfabcdd7e13c5 100644 (file)
@@ -27,6 +27,8 @@
 #ifndef _ASM_GENERIC_TOPOLOGY_H
 #define _ASM_GENERIC_TOPOLOGY_H
 
+#ifndef        CONFIG_NUMA
+
 /* Other architectures wishing to use this simple topology API should fill
    in the below functions as appropriate in their own <asm/topology.h> file. */
 #ifndef cpu_to_node
                                )
 #endif
 
+#endif /* CONFIG_NUMA */
+
+/* returns pointer to cpumask for specified node */
+#ifndef node_to_cpumask_ptr
+
+#define        node_to_cpumask_ptr(v, node)                                    \
+               cpumask_t _##v = node_to_cpumask(node), *v = &_##v
+
+#define node_to_cpumask_ptr_next(v, node)                              \
+                         _##v = node_to_cpumask(node)
+#endif
+
 #endif /* _ASM_GENERIC_TOPOLOGY_H */
index 6f6d69e39ff59075af1637eb986ae1aefb855bc9..ee118b901de479e065ccc1cf361c1db141680f4c 100644 (file)
@@ -9,7 +9,6 @@
 #define _ASM_IA64_SN_NODEPDA_H
 
 
-#include <asm/semaphore.h>
 #include <asm/irq.h>
 #include <asm/sn/arch.h>
 #include <asm/sn/intr.h>
index 2d67b72b18d07049d5ba0f46fea96369605a39ba..f2f72ef2a8974cc3496dc0fd92435626f708a7e8 100644 (file)
@@ -93,7 +93,7 @@ void build_cpu_to_node_map(void);
        .cache_nice_tries       = 2,                    \
        .busy_idx               = 3,                    \
        .idle_idx               = 2,                    \
-       .newidle_idx            = 0, /* unused */       \
+       .newidle_idx            = 2,                    \
        .wake_idx               = 1,                    \
        .forkexec_idx           = 1,                    \
        .flags                  = SD_LOAD_BALANCE       \
@@ -116,6 +116,11 @@ void build_cpu_to_node_map(void);
 #define smt_capable()                          (smp_num_siblings > 1)
 #endif
 
+#define pcibus_to_cpumask(bus) (pcibus_to_node(bus) == -1 ? \
+                                       CPU_MASK_ALL : \
+                                       node_to_cpumask(pcibus_to_node(bus)) \
+                               )
+
 #include <asm-generic/topology.h>
 
 #endif /* _ASM_IA64_TOPOLOGY_H */
index 5f640e5424751196ee64d91b1f0a11b74bcbe39b..7381916dfcbb298a8e1e6e66628b5b6c5a2de6fa 100644 (file)
@@ -1,5 +1,6 @@
 include include/asm-generic/Kbuild.asm
 
+header-y += a.out.h
 header-y += auxvec.h
 header-y += ioctls.h
 header-y += mman.h
@@ -23,7 +24,6 @@ header-y += sigcontext.h
 header-y += statfs.h
 header-y += ps3fb.h
 
-unifdef-y += a.out.h
 unifdef-y += asm-compat.h
 unifdef-y += bootx.h
 unifdef-y += byteorder.h
index 4aa220718b19a09b00cd137ca384bc4a7fa9f292..98324c5a82867cfa5ace5179de635220ab5d01a4 100644 (file)
  * 2 of the License, or (at your option) any later version.
  */
 
+#include <linux/lmb.h>
+
 #include <asm/types.h>
 #include <asm/page.h>
 #include <asm/prom.h>
-#include <asm/lmb.h>
 #include <asm/firmware.h>
 
 struct mschunks_map {
index 220d9a781ab9c0f64030f15e45543472a950de2f..a99a749294753b3a77688a203998111ef01eff13 100644 (file)
@@ -312,24 +312,26 @@ static __inline__ int fls(unsigned int x)
        asm ("cntlzw %0,%1" : "=r" (lz) : "r" (x));
        return 32 - lz;
 }
+
+/*
+ * 64-bit can do this using one cntlzd (count leading zeroes doubleword)
+ * instruction; for 32-bit we use the generic version, which does two
+ * 32-bit fls calls.
+ */
+#ifdef __powerpc64__
+static __inline__ int fls64(__u64 x)
+{
+       int lz;
+
+       asm ("cntlzd %0,%1" : "=r" (lz) : "r" (x));
+       return 64 - lz;
+}
+#else
 #include <asm-generic/bitops/fls64.h>
+#endif /* __powerpc64__ */
 
 #include <asm-generic/bitops/hweight.h>
-
-#define find_first_zero_bit(addr, size) find_next_zero_bit((addr), (size), 0)
-unsigned long find_next_zero_bit(const unsigned long *addr,
-                                unsigned long size, unsigned long offset);
-/**
- * find_first_bit - find the first set bit in a memory region
- * @addr: The address to start the search at
- * @size: The maximum size to search
- *
- * Returns the bit-number of the first set bit, not the number of the byte
- * containing a bit.
- */
-#define find_first_bit(addr, size) find_next_bit((addr), (size), 0)
-unsigned long find_next_bit(const unsigned long *addr,
-                           unsigned long size, unsigned long offset);
+#include <asm-generic/bitops/find.h>
 
 /* Little-endian versions */
 
index 77e39dad9728e7614a98d4976098c5b9510ed4b9..ede38ffe466a2e4e0ad857b1fd1e47a04990e35e 100644 (file)
@@ -4,6 +4,20 @@
 #include <linux/compiler.h>
 #include <linux/types.h>
 
+/* Opcodes common to CPM1 and CPM2
+*/
+#define CPM_CR_INIT_TRX                ((ushort)0x0000)
+#define CPM_CR_INIT_RX         ((ushort)0x0001)
+#define CPM_CR_INIT_TX         ((ushort)0x0002)
+#define CPM_CR_HUNT_MODE       ((ushort)0x0003)
+#define CPM_CR_STOP_TX         ((ushort)0x0004)
+#define CPM_CR_GRA_STOP_TX     ((ushort)0x0005)
+#define CPM_CR_RESTART_TX      ((ushort)0x0006)
+#define CPM_CR_CLOSE_RX_BD     ((ushort)0x0007)
+#define CPM_CR_SET_GADDR       ((ushort)0x0008)
+#define CPM_CR_SET_TIMER       ((ushort)0x0008)
+#define CPM_CR_STOP_IDMA       ((ushort)0x000b)
+
 /* Buffer descriptors used by many of the CPM protocols. */
 typedef struct cpm_buf_desc {
        ushort  cbd_sc;         /* Status and Control */
index b2ebd6ac6daef2b6d63a9fe89f439a9159d878c3..3df439678006b6dc06d3a8cdff7251997bb597a3 100644 (file)
 #define CPM_CR_CHAN    ((ushort)0x00f0)
 #define CPM_CR_FLG     ((ushort)0x0001)
 
-/* Some commands (there are more...later)
-*/
-#define CPM_CR_INIT_TRX                ((ushort)0x0000)
-#define CPM_CR_INIT_RX         ((ushort)0x0001)
-#define CPM_CR_INIT_TX         ((ushort)0x0002)
-#define CPM_CR_HUNT_MODE       ((ushort)0x0003)
-#define CPM_CR_STOP_TX         ((ushort)0x0004)
-#define CPM_CR_GRA_STOP_TX     ((ushort)0x0005)
-#define CPM_CR_RESTART_TX      ((ushort)0x0006)
-#define CPM_CR_CLOSE_RX_BD     ((ushort)0x0007)
-#define CPM_CR_SET_GADDR       ((ushort)0x0008)
-#define CPM_CR_SET_TIMER       CPM_CR_SET_GADDR
-
 /* Channel numbers.
 */
 #define CPM_CR_CH_SCC1         ((ushort)0x0000)
index b93a53eb55c17061bbb29bf8615f9929ca284d28..4c85ed9cd43f6acc66c709f061e1e1b835c19f6a 100644 (file)
 
 #define CPM_CR_FCC_PAGE(x)     (x + 0x04)
 
-/* Some opcodes (there are more...later)
+/* CPM2-specific opcodes (see cpm.h for common opcodes)
 */
-#define CPM_CR_INIT_TRX                ((ushort)0x0000)
-#define CPM_CR_INIT_RX         ((ushort)0x0001)
-#define CPM_CR_INIT_TX         ((ushort)0x0002)
-#define CPM_CR_HUNT_MODE       ((ushort)0x0003)
-#define CPM_CR_STOP_TX         ((ushort)0x0004)
-#define CPM_CR_GRA_STOP_TX     ((ushort)0x0005)
-#define CPM_CR_RESTART_TX      ((ushort)0x0006)
-#define CPM_CR_SET_GADDR       ((ushort)0x0008)
 #define CPM_CR_START_IDMA      ((ushort)0x0009)
-#define CPM_CR_STOP_IDMA       ((ushort)0x000b)
 
 #define mk_cr_cmd(PG, SBC, MCN, OP) \
        ((PG << 26) | (SBC << 21) | (MCN << 6) | OP)
index 8485c28b5f47efa58d0eb752d45f2c5a3a483661..fb11b0c459b832912cabee81141517a38d136ba6 100644 (file)
@@ -35,7 +35,7 @@ static inline cpumask_t cpu_thread_mask_to_cores(cpumask_t threads)
 
        res = CPU_MASK_NONE;
        for (i = 0; i < NR_CPUS; i += threads_per_core) {
-               cpus_shift_right(tmp, threads_core_mask, i);
+               cpus_shift_left(tmp, threads_core_mask, i);
                if (cpus_intersects(threads, tmp))
                        cpu_set(i, res);
        }
index be6c879e8760b11ba3b92de41e39f72622b6fb4f..f8398ce80372ebabaad97f58e5f10caa7dd3bad4 100644 (file)
@@ -82,6 +82,19 @@ static inline void __mtdcri(int base_addr, int base_data, int reg,
        spin_unlock_irqrestore(&dcr_ind_lock, flags);
 }
 
+static inline void __dcri_clrset(int base_addr, int base_data, int reg,
+                                unsigned clr, unsigned set)
+{
+       unsigned long flags;
+       unsigned int val;
+
+       spin_lock_irqsave(&dcr_ind_lock, flags);
+       __mtdcr(base_addr, reg);
+       val = (__mfdcr(base_data) & ~clr) | set;
+       __mtdcr(base_data, val);
+       spin_unlock_irqrestore(&dcr_ind_lock, flags);
+}
+
 #define mfdcri(base, reg)      __mfdcri(DCRN_ ## base ## _CONFIG_ADDR, \
                                         DCRN_ ## base ## _CONFIG_DATA, \
                                         reg)
@@ -90,6 +103,10 @@ static inline void __mtdcri(int base_addr, int base_data, int reg,
                                         DCRN_ ## base ## _CONFIG_DATA, \
                                         reg, data)
 
+#define dcri_clrset(base, reg, clr, set)       __dcri_clrset(DCRN_ ## base ## _CONFIG_ADDR,    \
+                                                             DCRN_ ## base ## _CONFIG_DATA,    \
+                                                             reg, clr, set)
+
 #endif /* __ASSEMBLY__ */
 #endif /* __KERNEL__ */
 #endif /* _ASM_POWERPC_DCR_NATIVE_H */
index 9f1fb98fcdc6ad370e7962b6391f06ce1123694e..29b0ecef980a54e77b05432a8a35328a038104df 100644 (file)
 #define SDR0_UART3             0x0123
 #define SDR0_CUST0             0x4000
 
+/*
+ * All those DCR register addresses are offsets from the base address
+ * for the SRAM0 controller (e.g. 0x20 on 440GX). The base address is
+ * excluded here and configured in the device tree.
+ */
+#define DCRN_SRAM0_SB0CR       0x00
+#define DCRN_SRAM0_SB1CR       0x01
+#define DCRN_SRAM0_SB2CR       0x02
+#define DCRN_SRAM0_SB3CR       0x03
+#define  SRAM_SBCR_BU_MASK     0x00000180
+#define  SRAM_SBCR_BS_64KB     0x00000800
+#define  SRAM_SBCR_BU_RO       0x00000080
+#define  SRAM_SBCR_BU_RW       0x00000180
+#define DCRN_SRAM0_BEAR                0x04
+#define DCRN_SRAM0_BESR0       0x05
+#define DCRN_SRAM0_BESR1       0x06
+#define DCRN_SRAM0_PMEG                0x07
+#define DCRN_SRAM0_CID         0x08
+#define DCRN_SRAM0_REVID       0x09
+#define DCRN_SRAM0_DPC         0x0a
+#define  SRAM_DPC_ENABLE       0x80000000
+
+/*
+ * All those DCR register addresses are offsets from the base address
+ * for the SRAM0 controller (e.g. 0x30 on 440GX). The base address is
+ * excluded here and configured in the device tree.
+ */
+#define DCRN_L2C0_CFG          0x00
+#define  L2C_CFG_L2M           0x80000000
+#define  L2C_CFG_ICU           0x40000000
+#define  L2C_CFG_DCU           0x20000000
+#define  L2C_CFG_DCW_MASK      0x1e000000
+#define  L2C_CFG_TPC           0x01000000
+#define  L2C_CFG_CPC           0x00800000
+#define  L2C_CFG_FRAN          0x00200000
+#define  L2C_CFG_SS_MASK       0x00180000
+#define  L2C_CFG_SS_256                0x00000000
+#define  L2C_CFG_CPIM          0x00040000
+#define  L2C_CFG_TPIM          0x00020000
+#define  L2C_CFG_LIM           0x00010000
+#define  L2C_CFG_PMUX_MASK     0x00007000
+#define  L2C_CFG_PMUX_SNP      0x00000000
+#define  L2C_CFG_PMUX_IF       0x00001000
+#define  L2C_CFG_PMUX_DF       0x00002000
+#define  L2C_CFG_PMUX_DS       0x00003000
+#define  L2C_CFG_PMIM          0x00000800
+#define  L2C_CFG_TPEI          0x00000400
+#define  L2C_CFG_CPEI          0x00000200
+#define  L2C_CFG_NAM           0x00000100
+#define  L2C_CFG_SMCM          0x00000080
+#define  L2C_CFG_NBRM          0x00000040
+#define  L2C_CFG_RDBW          0x00000008      /* only 460EX/GT */
+#define DCRN_L2C0_CMD          0x01
+#define  L2C_CMD_CLR           0x80000000
+#define  L2C_CMD_DIAG          0x40000000
+#define  L2C_CMD_INV           0x20000000
+#define  L2C_CMD_CCP           0x10000000
+#define  L2C_CMD_CTE           0x08000000
+#define  L2C_CMD_STRC          0x04000000
+#define  L2C_CMD_STPC          0x02000000
+#define  L2C_CMD_RPMC          0x01000000
+#define  L2C_CMD_HCC           0x00800000
+#define DCRN_L2C0_ADDR         0x02
+#define DCRN_L2C0_DATA         0x03
+#define DCRN_L2C0_SR           0x04
+#define  L2C_SR_CC             0x80000000
+#define  L2C_SR_CPE            0x40000000
+#define  L2C_SR_TPE            0x20000000
+#define  L2C_SR_LRU            0x10000000
+#define  L2C_SR_PCS            0x08000000
+#define DCRN_L2C0_REVID                0x05
+#define DCRN_L2C0_SNP0         0x06
+#define DCRN_L2C0_SNP1         0x07
+#define  L2C_SNP_BA_MASK       0xffff0000
+#define  L2C_SNP_SSR_MASK      0x0000f000
+#define  L2C_SNP_SSR_32G       0x0000f000
+#define  L2C_SNP_ESR           0x00000800
+
 #endif /* __DCR_REGS_H__ */
index 39abdb02fdefa1485acc2f543327eb5bc57803ed..329148b5acc6478fb37afedb7affb3c89738eb37 100644 (file)
@@ -228,18 +228,18 @@ label##_pSeries:                                                  \
 BEGIN_FW_FTR_SECTION;                          \
        stb     r11,PACAHARDIRQEN(r13);         \
 END_FW_FTR_SECTION_IFCLR(FW_FEATURE_ISERIES);  \
+       TRACE_DISABLE_INTS;                     \
 BEGIN_FW_FTR_SECTION;                          \
        mfmsr   r10;                            \
        ori     r10,r10,MSR_EE;                 \
        mtmsrd  r10,1;                          \
 END_FW_FTR_SECTION_IFSET(FW_FEATURE_ISERIES)
-
 #else
 #define DISABLE_INTS                           \
        li      r11,0;                          \
        stb     r11,PACASOFTIRQEN(r13);         \
-       stb     r11,PACAHARDIRQEN(r13)
-
+       stb     r11,PACAHARDIRQEN(r13);         \
+       TRACE_DISABLE_INTS
 #endif /* CONFIG_PPC_ISERIES */
 
 #define ENABLE_INTS                            \
diff --git a/include/asm-powerpc/fsl_lbc.h b/include/asm-powerpc/fsl_lbc.h
new file mode 100644 (file)
index 0000000..303f548
--- /dev/null
@@ -0,0 +1,311 @@
+/* Freescale Local Bus Controller
+ *
+ * Copyright (c) 2006-2007 Freescale Semiconductor
+ *
+ * Authors: Nick Spence <nick.spence@freescale.com>,
+ *          Scott Wood <scottwood@freescale.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#ifndef __ASM_FSL_LBC_H
+#define __ASM_FSL_LBC_H
+
+#include <linux/types.h>
+#include <linux/spinlock.h>
+#include <asm/io.h>
+
+struct fsl_lbc_bank {
+       __be32 br;             /**< Base Register  */
+#define BR_BA           0xFFFF8000
+#define BR_BA_SHIFT             15
+#define BR_PS           0x00001800
+#define BR_PS_SHIFT             11
+#define BR_PS_8         0x00000800  /* Port Size 8 bit */
+#define BR_PS_16        0x00001000  /* Port Size 16 bit */
+#define BR_PS_32        0x00001800  /* Port Size 32 bit */
+#define BR_DECC         0x00000600
+#define BR_DECC_SHIFT            9
+#define BR_DECC_OFF     0x00000000  /* HW ECC checking and generation off */
+#define BR_DECC_CHK     0x00000200  /* HW ECC checking on, generation off */
+#define BR_DECC_CHK_GEN 0x00000400  /* HW ECC checking and generation on */
+#define BR_WP           0x00000100
+#define BR_WP_SHIFT              8
+#define BR_MSEL         0x000000E0
+#define BR_MSEL_SHIFT            5
+#define BR_MS_GPCM      0x00000000  /* GPCM */
+#define BR_MS_FCM       0x00000020  /* FCM */
+#define BR_MS_SDRAM     0x00000060  /* SDRAM */
+#define BR_MS_UPMA      0x00000080  /* UPMA */
+#define BR_MS_UPMB      0x000000A0  /* UPMB */
+#define BR_MS_UPMC      0x000000C0  /* UPMC */
+#define BR_V            0x00000001
+#define BR_V_SHIFT               0
+#define BR_RES          ~(BR_BA|BR_PS|BR_DECC|BR_WP|BR_MSEL|BR_V)
+
+       __be32 or;             /**< Base Register  */
+#define OR0 0x5004
+#define OR1 0x500C
+#define OR2 0x5014
+#define OR3 0x501C
+#define OR4 0x5024
+#define OR5 0x502C
+#define OR6 0x5034
+#define OR7 0x503C
+
+#define OR_FCM_AM               0xFFFF8000
+#define OR_FCM_AM_SHIFT                 15
+#define OR_FCM_BCTLD            0x00001000
+#define OR_FCM_BCTLD_SHIFT              12
+#define OR_FCM_PGS              0x00000400
+#define OR_FCM_PGS_SHIFT                10
+#define OR_FCM_CSCT             0x00000200
+#define OR_FCM_CSCT_SHIFT                9
+#define OR_FCM_CST              0x00000100
+#define OR_FCM_CST_SHIFT                 8
+#define OR_FCM_CHT              0x00000080
+#define OR_FCM_CHT_SHIFT                 7
+#define OR_FCM_SCY              0x00000070
+#define OR_FCM_SCY_SHIFT                 4
+#define OR_FCM_SCY_1            0x00000010
+#define OR_FCM_SCY_2            0x00000020
+#define OR_FCM_SCY_3            0x00000030
+#define OR_FCM_SCY_4            0x00000040
+#define OR_FCM_SCY_5            0x00000050
+#define OR_FCM_SCY_6            0x00000060
+#define OR_FCM_SCY_7            0x00000070
+#define OR_FCM_RST              0x00000008
+#define OR_FCM_RST_SHIFT                 3
+#define OR_FCM_TRLX             0x00000004
+#define OR_FCM_TRLX_SHIFT                2
+#define OR_FCM_EHTR             0x00000002
+#define OR_FCM_EHTR_SHIFT                1
+};
+
+struct fsl_lbc_regs {
+       struct fsl_lbc_bank bank[8];
+       u8 res0[0x28];
+       __be32 mar;             /**< UPM Address Register */
+       u8 res1[0x4];
+       __be32 mamr;            /**< UPMA Mode Register */
+#define MxMR_OP_NO     (0 << 28) /**< normal operation */
+#define MxMR_OP_WA     (1 << 28) /**< write array */
+#define MxMR_OP_RA     (2 << 28) /**< read array */
+#define MxMR_OP_RP     (3 << 28) /**< run pattern */
+#define MxMR_MAD       0x3f      /**< machine address */
+       __be32 mbmr;            /**< UPMB Mode Register */
+       __be32 mcmr;            /**< UPMC Mode Register */
+       u8 res2[0x8];
+       __be32 mrtpr;           /**< Memory Refresh Timer Prescaler Register */
+       __be32 mdr;             /**< UPM Data Register */
+       u8 res3[0x4];
+       __be32 lsor;            /**< Special Operation Initiation Register */
+       __be32 lsdmr;           /**< SDRAM Mode Register */
+       u8 res4[0x8];
+       __be32 lurt;            /**< UPM Refresh Timer */
+       __be32 lsrt;            /**< SDRAM Refresh Timer */
+       u8 res5[0x8];
+       __be32 ltesr;           /**< Transfer Error Status Register */
+#define LTESR_BM   0x80000000
+#define LTESR_FCT  0x40000000
+#define LTESR_PAR  0x20000000
+#define LTESR_WP   0x04000000
+#define LTESR_ATMW 0x00800000
+#define LTESR_ATMR 0x00400000
+#define LTESR_CS   0x00080000
+#define LTESR_CC   0x00000001
+#define LTESR_NAND_MASK (LTESR_FCT | LTESR_PAR | LTESR_CC)
+       __be32 ltedr;           /**< Transfer Error Disable Register */
+       __be32 lteir;           /**< Transfer Error Interrupt Register */
+       __be32 lteatr;          /**< Transfer Error Attributes Register */
+       __be32 ltear;           /**< Transfer Error Address Register */
+       u8 res6[0xC];
+       __be32 lbcr;            /**< Configuration Register */
+#define LBCR_LDIS  0x80000000
+#define LBCR_LDIS_SHIFT    31
+#define LBCR_BCTLC 0x00C00000
+#define LBCR_BCTLC_SHIFT   22
+#define LBCR_AHD   0x00200000
+#define LBCR_LPBSE 0x00020000
+#define LBCR_LPBSE_SHIFT   17
+#define LBCR_EPAR  0x00010000
+#define LBCR_EPAR_SHIFT    16
+#define LBCR_BMT   0x0000FF00
+#define LBCR_BMT_SHIFT      8
+#define LBCR_INIT  0x00040000
+       __be32 lcrr;            /**< Clock Ratio Register */
+#define LCRR_DBYP    0x80000000
+#define LCRR_DBYP_SHIFT      31
+#define LCRR_BUFCMDC 0x30000000
+#define LCRR_BUFCMDC_SHIFT   28
+#define LCRR_ECL     0x03000000
+#define LCRR_ECL_SHIFT       24
+#define LCRR_EADC    0x00030000
+#define LCRR_EADC_SHIFT      16
+#define LCRR_CLKDIV  0x0000000F
+#define LCRR_CLKDIV_SHIFT     0
+       u8 res7[0x8];
+       __be32 fmr;             /**< Flash Mode Register */
+#define FMR_CWTO     0x0000F000
+#define FMR_CWTO_SHIFT       12
+#define FMR_BOOT     0x00000800
+#define FMR_ECCM     0x00000100
+#define FMR_AL       0x00000030
+#define FMR_AL_SHIFT          4
+#define FMR_OP       0x00000003
+#define FMR_OP_SHIFT          0
+       __be32 fir;             /**< Flash Instruction Register */
+#define FIR_OP0      0xF0000000
+#define FIR_OP0_SHIFT        28
+#define FIR_OP1      0x0F000000
+#define FIR_OP1_SHIFT        24
+#define FIR_OP2      0x00F00000
+#define FIR_OP2_SHIFT        20
+#define FIR_OP3      0x000F0000
+#define FIR_OP3_SHIFT        16
+#define FIR_OP4      0x0000F000
+#define FIR_OP4_SHIFT        12
+#define FIR_OP5      0x00000F00
+#define FIR_OP5_SHIFT         8
+#define FIR_OP6      0x000000F0
+#define FIR_OP6_SHIFT         4
+#define FIR_OP7      0x0000000F
+#define FIR_OP7_SHIFT         0
+#define FIR_OP_NOP   0x0       /* No operation and end of sequence */
+#define FIR_OP_CA    0x1        /* Issue current column address */
+#define FIR_OP_PA    0x2        /* Issue current block+page address */
+#define FIR_OP_UA    0x3        /* Issue user defined address */
+#define FIR_OP_CM0   0x4        /* Issue command from FCR[CMD0] */
+#define FIR_OP_CM1   0x5        /* Issue command from FCR[CMD1] */
+#define FIR_OP_CM2   0x6        /* Issue command from FCR[CMD2] */
+#define FIR_OP_CM3   0x7        /* Issue command from FCR[CMD3] */
+#define FIR_OP_WB    0x8        /* Write FBCR bytes from FCM buffer */
+#define FIR_OP_WS    0x9        /* Write 1 or 2 bytes from MDR[AS] */
+#define FIR_OP_RB    0xA        /* Read FBCR bytes to FCM buffer */
+#define FIR_OP_RS    0xB        /* Read 1 or 2 bytes to MDR[AS] */
+#define FIR_OP_CW0   0xC        /* Wait then issue FCR[CMD0] */
+#define FIR_OP_CW1   0xD        /* Wait then issue FCR[CMD1] */
+#define FIR_OP_RBW   0xE        /* Wait then read FBCR bytes */
+#define FIR_OP_RSW   0xE        /* Wait then read 1 or 2 bytes */
+       __be32 fcr;             /**< Flash Command Register */
+#define FCR_CMD0     0xFF000000
+#define FCR_CMD0_SHIFT       24
+#define FCR_CMD1     0x00FF0000
+#define FCR_CMD1_SHIFT       16
+#define FCR_CMD2     0x0000FF00
+#define FCR_CMD2_SHIFT        8
+#define FCR_CMD3     0x000000FF
+#define FCR_CMD3_SHIFT        0
+       __be32 fbar;            /**< Flash Block Address Register */
+#define FBAR_BLK     0x00FFFFFF
+       __be32 fpar;            /**< Flash Page Address Register */
+#define FPAR_SP_PI   0x00007C00
+#define FPAR_SP_PI_SHIFT     10
+#define FPAR_SP_MS   0x00000200
+#define FPAR_SP_CI   0x000001FF
+#define FPAR_SP_CI_SHIFT      0
+#define FPAR_LP_PI   0x0003F000
+#define FPAR_LP_PI_SHIFT     12
+#define FPAR_LP_MS   0x00000800
+#define FPAR_LP_CI   0x000007FF
+#define FPAR_LP_CI_SHIFT      0
+       __be32 fbcr;            /**< Flash Byte Count Register */
+#define FBCR_BC      0x00000FFF
+       u8 res11[0x8];
+       u8 res8[0xF00];
+};
+
+extern struct fsl_lbc_regs __iomem *fsl_lbc_regs;
+extern spinlock_t fsl_lbc_lock;
+
+/*
+ * FSL UPM routines
+ */
+struct fsl_upm {
+       __be32 __iomem *mxmr;
+       int width;
+};
+
+extern int fsl_lbc_find(phys_addr_t addr_base);
+extern int fsl_upm_find(phys_addr_t addr_base, struct fsl_upm *upm);
+
+/**
+ * fsl_upm_start_pattern - start UPM patterns execution
+ * @upm:       pointer to the fsl_upm structure obtained via fsl_upm_find
+ * @pat_offset:        UPM pattern offset for the command to be executed
+ *
+ * This routine programmes UPM so the next memory access that hits an UPM
+ * will trigger pattern execution, starting at pat_offset.
+ */
+static inline void fsl_upm_start_pattern(struct fsl_upm *upm, u8 pat_offset)
+{
+       clrsetbits_be32(upm->mxmr, MxMR_MAD, MxMR_OP_RP | pat_offset);
+}
+
+/**
+ * fsl_upm_end_pattern - end UPM patterns execution
+ * @upm:       pointer to the fsl_upm structure obtained via fsl_upm_find
+ *
+ * This routine reverts UPM to normal operation mode.
+ */
+static inline void fsl_upm_end_pattern(struct fsl_upm *upm)
+{
+       clrbits32(upm->mxmr, MxMR_OP_RP);
+
+       while (in_be32(upm->mxmr) & MxMR_OP_RP)
+               cpu_relax();
+}
+
+/**
+ * fsl_upm_run_pattern - actually run an UPM pattern
+ * @upm:       pointer to the fsl_upm structure obtained via fsl_upm_find
+ * @io_base:   remapped pointer to where memory access should happen
+ * @mar:       MAR register content during pattern execution
+ *
+ * This function triggers dummy write to the memory specified by the io_base,
+ * thus UPM pattern actually executed. Note that mar usage depends on the
+ * pre-programmed AMX bits in the UPM RAM.
+ */
+static inline int fsl_upm_run_pattern(struct fsl_upm *upm,
+                                     void __iomem *io_base, u32 mar)
+{
+       int ret = 0;
+       unsigned long flags;
+
+       spin_lock_irqsave(&fsl_lbc_lock, flags);
+
+       out_be32(&fsl_lbc_regs->mar, mar << (32 - upm->width));
+
+       switch (upm->width) {
+       case 8:
+               out_8(io_base, 0x0);
+               break;
+       case 16:
+               out_be16(io_base, 0x0);
+               break;
+       case 32:
+               out_be32(io_base, 0x0);
+               break;
+       default:
+               ret = -EINVAL;
+               break;
+       }
+
+       spin_unlock_irqrestore(&fsl_lbc_lock, flags);
+
+       return ret;
+}
+
+#endif /* __ASM_FSL_LBC_H */
diff --git a/include/asm-powerpc/gpio.h b/include/asm-powerpc/gpio.h
new file mode 100644 (file)
index 0000000..77ad3a8
--- /dev/null
@@ -0,0 +1,56 @@
+/*
+ * Generic GPIO API implementation for PowerPC.
+ *
+ * Copyright (c) 2007-2008  MontaVista Software, Inc.
+ *
+ * Author: Anton Vorontsov <avorontsov@ru.mvista.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ */
+
+#ifndef __ASM_POWERPC_GPIO_H
+#define __ASM_POWERPC_GPIO_H
+
+#include <linux/errno.h>
+#include <asm-generic/gpio.h>
+
+#ifdef CONFIG_HAVE_GPIO_LIB
+
+/*
+ * We don't (yet) implement inlined/rapid versions for on-chip gpios.
+ * Just call gpiolib.
+ */
+static inline int gpio_get_value(unsigned int gpio)
+{
+       return __gpio_get_value(gpio);
+}
+
+static inline void gpio_set_value(unsigned int gpio, int value)
+{
+       __gpio_set_value(gpio, value);
+}
+
+static inline int gpio_cansleep(unsigned int gpio)
+{
+       return __gpio_cansleep(gpio);
+}
+
+/*
+ * Not implemented, yet.
+ */
+static inline int gpio_to_irq(unsigned int gpio)
+{
+       return -ENOSYS;
+}
+
+static inline int irq_to_gpio(unsigned int irq)
+{
+       return -EINVAL;
+}
+
+#endif /* CONFIG_HAVE_GPIO_LIB */
+
+#endif /* __ASM_POWERPC_GPIO_H */
index a7b60bf639e0896f5b1099ee29c664c20fa0d33a..ad8c9f7fd0e359f8edb08db45e645b4632b9c5c8 100644 (file)
@@ -27,7 +27,7 @@ static inline unsigned long local_get_flags(void)
        return flags;
 }
 
-static inline unsigned long local_irq_disable(void)
+static inline unsigned long raw_local_irq_disable(void)
 {
        unsigned long flags, zero;
 
@@ -39,14 +39,15 @@ static inline unsigned long local_irq_disable(void)
        return flags;
 }
 
-extern void local_irq_restore(unsigned long);
+extern void raw_local_irq_restore(unsigned long);
 extern void iseries_handle_interrupts(void);
 
-#define local_irq_enable()     local_irq_restore(1)
-#define local_save_flags(flags)        ((flags) = local_get_flags())
-#define local_irq_save(flags)  ((flags) = local_irq_disable())
+#define raw_local_irq_enable()         raw_local_irq_restore(1)
+#define raw_local_save_flags(flags)    ((flags) = local_get_flags())
+#define raw_local_irq_save(flags)      ((flags) = raw_local_irq_disable())
 
-#define irqs_disabled()                (local_get_flags() == 0)
+#define raw_irqs_disabled()            (local_get_flags() == 0)
+#define raw_irqs_disabled_flags(flags) ((flags) == 0)
 
 #define __hard_irq_enable()    __mtmsrd(mfmsr() | MSR_EE, 1)
 #define __hard_irq_disable()   __mtmsrd(mfmsr() & ~MSR_EE, 1)
index 82a452615097abe24be4ee29281b5a2c16476e0c..7b6f411db3e680c17cf6c819268ba73988f7399e 100644 (file)
@@ -20,6 +20,7 @@
 #ifdef __KERNEL__
 
 #include <linux/kernel.h>
+#include <asm/io.h>
 
 #define QE_IMMAP_SIZE  (1024 * 1024)   /* 1MB from 1MB+IMMR */
 
@@ -468,7 +469,7 @@ struct qe_immap {
        u8                      res18[0xC0000]; /* 0x140000 - 0x200000 */
 } __attribute__ ((packed));
 
-extern struct qe_immap *qe_immr;
+extern struct qe_immap __iomem *qe_immr;
 extern phys_addr_t get_qe_base(void);
 
 static inline unsigned long immrbar_virt_to_phys(void *address)
index 7970cbaeaa5457a257a126b88dae3da829e4fe60..cc6fdba33660c015a466d202ab0aff55405df96b 100644 (file)
@@ -2,30 +2,43 @@
  * include/asm-powerpc/irqflags.h
  *
  * IRQ flags handling
- *
- * This file gets included from lowlevel asm headers too, to provide
- * wrapped versions of the local_irq_*() APIs, based on the
- * raw_local_irq_*() macros from the lowlevel headers.
  */
 #ifndef _ASM_IRQFLAGS_H
 #define _ASM_IRQFLAGS_H
 
+#ifndef __ASSEMBLY__
 /*
  * Get definitions for raw_local_save_flags(x), etc.
  */
 #include <asm-powerpc/hw_irq.h>
 
+#else
+#ifdef CONFIG_TRACE_IRQFLAGS
 /*
- * Do the CPU's IRQ-state tracing from assembly code. We call a
- * C function, so save all the C-clobbered registers:
+ * Most of the CPU's IRQ-state tracing is done from assembly code; we
+ * have to call a C function so call a wrapper that saves all the
+ * C-clobbered registers.
  */
-#ifdef CONFIG_TRACE_IRQFLAGS
-
-#error No support on PowerPC yet for CONFIG_TRACE_IRQFLAGS
-
+#define TRACE_ENABLE_INTS      bl .trace_hardirqs_on
+#define TRACE_DISABLE_INTS     bl .trace_hardirqs_off
+#define TRACE_AND_RESTORE_IRQ_PARTIAL(en,skip) \
+       cmpdi   en, 0;                          \
+       bne     95f;                            \
+       stb     en,PACASOFTIRQEN(r13);          \
+       bl      .trace_hardirqs_off;            \
+       b       skip;                           \
+95:    bl      .trace_hardirqs_on;             \
+       li      en,1;
+#define TRACE_AND_RESTORE_IRQ(en)              \
+       TRACE_AND_RESTORE_IRQ_PARTIAL(en,96f);  \
+96:    stb     en,PACASOFTIRQEN(r13)
 #else
-# define TRACE_IRQS_ON
-# define TRACE_IRQS_OFF
+#define TRACE_ENABLE_INTS
+#define TRACE_DISABLE_INTS
+#define TRACE_AND_RESTORE_IRQ_PARTIAL(en,skip)
+#define TRACE_AND_RESTORE_IRQ(en)              \
+       stb     en,PACASOFTIRQEN(r13)
+#endif
 #endif
 
 #endif
diff --git a/include/asm-powerpc/iseries/alpaca.h b/include/asm-powerpc/iseries/alpaca.h
new file mode 100644 (file)
index 0000000..c0cce67
--- /dev/null
@@ -0,0 +1,31 @@
+/*
+ * Copyright Â© 2008  Stephen Rothwell IBM Corporation
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+ */
+#ifndef _ASM_POWERPC_ISERIES_ALPACA_H
+#define _ASM_POWERPC_ISERIES_ALPACA_H
+
+/*
+ * This is the part of the paca that the iSeries hypervisor
+ * needs to be statically initialised. Immediately after boot
+ * we switch to the normal Linux paca.
+ */
+struct alpaca {
+       struct lppaca *lppaca_ptr;      /* Pointer to LpPaca for PLIC */
+       const void *reg_save_ptr;       /* Pointer to LpRegSave for PLIC */
+};
+
+#endif /* _ASM_POWERPC_ISERIES_ALPACA_H */
diff --git a/include/asm-powerpc/iseries/it_lp_reg_save.h b/include/asm-powerpc/iseries/it_lp_reg_save.h
deleted file mode 100644 (file)
index 5403b75..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Copyright (C) 2001  Mike Corrigan IBM Corporation
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
- */
-#ifndef _ASM_POWERPC_ISERIES_IT_LP_REG_SAVE_H
-#define _ASM_POWERPC_ISERIES_IT_LP_REG_SAVE_H
-
-/*
- * This control block contains the data that is shared between PLIC
- * and the OS
- */
-
-struct ItLpRegSave {
-       u32     xDesc;          // Eye catcher  "LpRS" ebcdic   000-003
-       u16     xSize;          // Size of this class           004-005
-       u8      xInUse;         // Area is live                 006-007
-       u8      xRsvd1[9];      // Reserved                     007-00F
-
-       u8      xFixedRegSave[352]; // Fixed Register Save Area 010-16F
-       u32     xCTRL;          // Control Register             170-173
-       u32     xDEC;           // Decrementer                  174-177
-       u32     xFPSCR;         // FP Status and Control Reg    178-17B
-       u32     xPVR;           // Processor Version Number     17C-17F
-
-       u64     xMMCR0;         // Monitor Mode Control Reg 0   180-187
-       u32     xPMC1;          // Perf Monitor Counter 1       188-18B
-       u32     xPMC2;          // Perf Monitor Counter 2       18C-18F
-       u32     xPMC3;          // Perf Monitor Counter 3       190-193
-       u32     xPMC4;          // Perf Monitor Counter 4       194-197
-       u32     xPIR;           // Processor ID Reg             198-19B
-
-       u32     xMMCR1;         // Monitor Mode Control Reg 1   19C-19F
-       u32     xMMCRA;         // Monitor Mode Control Reg A   1A0-1A3
-       u32     xPMC5;          // Perf Monitor Counter 5       1A4-1A7
-       u32     xPMC6;          // Perf Monitor Counter 6       1A8-1AB
-       u32     xPMC7;          // Perf Monitor Counter 7       1AC-1AF
-       u32     xPMC8;          // Perf Monitor Counter 8       1B0-1B3
-       u32     xTSC;           // Thread Switch Control        1B4-1B7
-       u32     xTST;           // Thread Switch Timeout        1B8-1BB
-       u32     xRsvd;          // Reserved                     1BC-1BF
-
-       u64     xACCR;          // Address Compare Control Reg  1C0-1C7
-       u64     xIMR;           // Instruction Match Register   1C8-1CF
-       u64     xSDR1;          // Storage Description Reg 1    1D0-1D7
-       u64     xSPRG0;         // Special Purpose Reg General0 1D8-1DF
-       u64     xSPRG1;         // Special Purpose Reg General1 1E0-1E7
-       u64     xSPRG2;         // Special Purpose Reg General2 1E8-1EF
-       u64     xSPRG3;         // Special Purpose Reg General3 1F0-1F7
-       u64     xTB;            // Time Base Register           1F8-1FF
-
-       u64     xFPR[32];       // Floating Point Registers     200-2FF
-
-       u64     xMSR;           // Machine State Register       300-307
-       u64     xNIA;           // Next Instruction Address     308-30F
-
-       u64     xDABR;          // Data Address Breakpoint Reg  310-317
-       u64     xIABR;          // Inst Address Breakpoint Reg  318-31F
-
-       u64     xHID0;          // HW Implementation Dependent0 320-327
-
-       u64     xHID4;          // HW Implementation Dependent4 328-32F
-       u64     xSCOMd;         // SCON Data Reg (SPRG4)        330-337
-       u64     xSCOMc;         // SCON Command Reg (SPRG5)     338-33F
-       u64     xSDAR;          // Sample Data Address Register 340-347
-       u64     xSIAR;          // Sample Inst Address Register 348-34F
-
-       u8      xRsvd3[176];    // Reserved                     350-3FF
-};
-
-extern struct ItLpRegSave iseries_reg_save[];
-
-#endif /* _ASM_POWERPC_ISERIES_IT_LP_REG_SAVE_H */
index 5d1dc48a0bb830229f0dd90ae561ab71d6b769f1..6f5fdf0a19ae6e3cfc9e5490ced23720763dfd53 100644 (file)
@@ -1,81 +1,15 @@
 #ifndef _ASM_POWERPC_LMB_H
 #define _ASM_POWERPC_LMB_H
-#ifdef __KERNEL__
 
-/*
- * Definitions for talking to the Open Firmware PROM on
- * Power Macintosh computers.
- *
- * Copyright (C) 2001 Peter Bergner, IBM Corp.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version
- * 2 of the License, or (at your option) any later version.
- */
+#include <asm/udbg.h>
 
-#include <linux/init.h>
-#include <asm/prom.h>
+#define LMB_DBG(fmt...) udbg_printf(fmt)
 
-#define MAX_LMB_REGIONS 128
+#ifdef CONFIG_PPC32
+extern phys_addr_t lowmem_end_addr;
+#define LMB_REAL_LIMIT lowmem_end_addr
+#else
+#define LMB_REAL_LIMIT 0
+#endif
 
-struct lmb_property {
-       unsigned long base;
-       unsigned long size;
-};
-
-struct lmb_region {
-       unsigned long cnt;
-       unsigned long size;
-       struct lmb_property region[MAX_LMB_REGIONS+1];
-};
-
-struct lmb {
-       unsigned long debug;
-       unsigned long rmo_size;
-       struct lmb_region memory;
-       struct lmb_region reserved;
-};
-
-extern struct lmb lmb;
-
-extern void __init lmb_init(void);
-extern void __init lmb_analyze(void);
-extern long __init lmb_add(unsigned long base, unsigned long size);
-extern long __init lmb_reserve(unsigned long base, unsigned long size);
-extern unsigned long __init lmb_alloc(unsigned long size, unsigned long align);
-extern unsigned long __init lmb_alloc_base(unsigned long size,
-               unsigned long align, unsigned long max_addr);
-extern unsigned long __init __lmb_alloc_base(unsigned long size,
-               unsigned long align, unsigned long max_addr);
-extern unsigned long __init lmb_phys_mem_size(void);
-extern unsigned long __init lmb_end_of_DRAM(void);
-extern void __init lmb_enforce_memory_limit(unsigned long memory_limit);
-extern int __init lmb_is_reserved(unsigned long addr);
-
-extern void lmb_dump_all(void);
-
-static inline unsigned long
-lmb_size_bytes(struct lmb_region *type, unsigned long region_nr)
-{
-       return type->region[region_nr].size;
-}
-static inline unsigned long
-lmb_size_pages(struct lmb_region *type, unsigned long region_nr)
-{
-       return lmb_size_bytes(type, region_nr) >> PAGE_SHIFT;
-}
-static inline unsigned long
-lmb_start_pfn(struct lmb_region *type, unsigned long region_nr)
-{
-       return type->region[region_nr].base >> PAGE_SHIFT;
-}
-static inline unsigned long
-lmb_end_pfn(struct lmb_region *type, unsigned long region_nr)
-{
-       return lmb_start_pfn(type, region_nr) +
-              lmb_size_pages(type, region_nr);
-}
-
-#endif /* __KERNEL__ */
 #endif /* _ASM_POWERPC_LMB_H */
index 0872ec228c1e45d1e27c094f37a8c948823850bf..54ed64df95b878c26ae7ac6a3d91865acdf99849 100644 (file)
@@ -68,6 +68,8 @@ struct machdep_calls {
                                       unsigned long vflags,
                                       int psize, int ssize);
        long            (*hpte_remove)(unsigned long hpte_group);
+       void            (*hpte_removebolted)(unsigned long ea,
+                                            int psize, int ssize);
        void            (*flush_hash_range)(unsigned long number, int local);
 
        /* special for kexec, to be called in real mode, linar mapping is
@@ -196,9 +198,6 @@ struct machdep_calls {
           May be NULL. */
        void            (*init)(void);
 
-       void            (*setup_io_mappings)(void);
-
-       void            (*early_serial_map)(void);
        void            (*kgdb_map_scc)(void);
 
        /*
index 3a6cb1a513b73e2078fc27f2528304383f58ad4e..079c06eae4466d4319cafed887a6faa25d6cd930 100644 (file)
@@ -2,7 +2,7 @@
 #define __MACIO_ASIC_H__
 #ifdef __KERNEL__
 
-#include <asm/of_device.h>
+#include <linux/of_device.h>
 
 extern struct bus_type macio_bus_type;
 
index 7d37f77043ac70d7f4ce072d0e5047c3b5231714..3d108676584c8ef6cf0c4ac7e3cb813939a358a8 100644 (file)
@@ -53,8 +53,6 @@
 
 #ifndef __ASSEMBLY__
 
-typedef unsigned long phys_addr_t;
-
 typedef struct {
        unsigned long id;
        unsigned long vdso_base;
index 62772ae839ca73728ca86df9085482c3594a53ec..c8b02d97f75378c6c42b81c3adadfed7a57ffbd8 100644 (file)
@@ -53,8 +53,6 @@
 
 #ifndef __ASSEMBLY__
 
-typedef unsigned long long phys_addr_t;
-
 typedef struct {
        unsigned long id;
        unsigned long vdso_base;
index 952bd8899f2fedec9ac21df3a8e60bfb1816d8b1..9db877eb88db4f28d1eefce0321add39ce85ca82 100644 (file)
 #define SPRN_M_TW      799
 
 #ifndef __ASSEMBLY__
-typedef unsigned long phys_addr_t;
-
 typedef struct {
        unsigned long id;
        unsigned long vdso_base;
index 37580004cd7a3095400705c4e4c683c9c3744707..925d93cf64d8596f5b376a6b7740cc7193b25a95 100644 (file)
 
 #ifndef __ASSEMBLY__
 
-#ifndef CONFIG_PHYS_64BIT
-typedef unsigned long phys_addr_t;
-#else
-typedef unsigned long long phys_addr_t;
-#endif
-
 typedef struct {
        unsigned long id;
        unsigned long vdso_base;
index 4bd735be3833be841711e5baea3f21c799b7eabf..6e21ca618ec352874e472a2f59b6da40cea22ae4 100644 (file)
@@ -84,8 +84,6 @@ typedef struct {
        unsigned long vdso_base;
 } mm_context_t;
 
-typedef unsigned long phys_addr_t;
-
 #endif /* !__ASSEMBLY__ */
 
 #endif /* _ASM_POWERPC_MMU_HASH32_H_ */
index 2864fa3989ea4d40efd456b1b18b4daec5f48af3..0dff76776044dde1c5ced93d86079f875fb0a062 100644 (file)
@@ -469,9 +469,6 @@ static inline unsigned long get_vsid(unsigned long context, unsigned long ea,
                                 VSID_MODULUS_256M)
 #define KERNEL_VSID(ea)                VSID_SCRAMBLE(GET_ESID(ea))
 
-/* Physical address used by some IO functions */
-typedef unsigned long phys_addr_t;
-
 #endif /* __ASSEMBLY__ */
 
 #endif /* _ASM_POWERPC_MMU_HASH64_H_ */
index 748b35ab37b5aa7fdf02291149777d3117803467..eb61b9c1edfdf91b167bddb4f306e9b2ad43afe4 100644 (file)
@@ -42,10 +42,7 @@ struct task_struct;
  * Defines the layout of the paca.
  *
  * This structure is not directly accessed by firmware or the service
- * processor except for the first two pointers that point to the
- * lppaca area and the ItLpRegSave area for this CPU.  The lppaca
- * object is currently contained within the PACA but it doesn't need
- * to be.
+ * processor.
  */
 struct paca_struct {
        /*
@@ -55,14 +52,7 @@ struct paca_struct {
         * avoid cacheline bouncing.
         */
 
-       /*
-        * MAGIC: These first two pointers can't be moved - they're
-        * accessed by the firmware
-        */
        struct lppaca *lppaca_ptr;      /* Pointer to LpPaca for PLIC */
-#ifdef CONFIG_PPC_ISERIES
-       void *reg_save_ptr; /* Pointer to LpRegSave for PLIC */
-#endif /* CONFIG_PPC_ISERIES */
 
        /*
         * MAGIC: the spinlock functions in arch/powerpc/lib/locks.c 
index df47bbb6ea1348e6c6ad95898baa911e819823b7..6c850609b847c01900db5ec9fdb7f40cce92eede 100644 (file)
@@ -53,6 +53,7 @@
 
 #define PAGE_OFFSET     ASM_CONST(CONFIG_KERNEL_START)
 #define KERNELBASE      (PAGE_OFFSET + PHYSICAL_START)
+#define LOAD_OFFSET    PAGE_OFFSET
 
 #ifdef CONFIG_FLATMEM
 #define pfn_valid(pfn)         ((pfn) < max_mapnr)
index 65ea19eec9562b80c06f18bdf518f4ea23e447e1..51f8134b5939393e66072a66935f642e7f322f55 100644 (file)
@@ -3,8 +3,6 @@
 
 #define VM_DATA_DEFAULT_FLAGS  VM_DATA_DEFAULT_FLAGS32
 
-#define PPC_MEMSTART   0
-
 #ifdef CONFIG_NOT_COHERENT_CACHE
 #define ARCH_KMALLOC_MINALIGN  L1_CACHE_BYTES
 #endif
index b4526ff3a50d4eb5bef209cf31dd1a98ad171f2f..19fd7933e2d91a682231428641b2fa5ee52ac559 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2006 PA Semi, Inc
+ * Copyright (C) 2006-2008 PA Semi, Inc
  *
  * Hardware register layout and descriptor formats for the on-board
  * DMA engine on PA Semi PWRficient. Used by ethernet, function and security
@@ -40,6 +40,11 @@ enum {
        PAS_DMA_COM_TXSTA = 0x104,      /* Transmit Status Register   */
        PAS_DMA_COM_RXCMD = 0x108,      /* Receive Command Register   */
        PAS_DMA_COM_RXSTA = 0x10c,      /* Receive Status Register    */
+       PAS_DMA_COM_CFG   = 0x114,      /* Common config reg          */
+       PAS_DMA_TXF_SFLG0 = 0x140,      /* Set flags                  */
+       PAS_DMA_TXF_SFLG1 = 0x144,      /* Set flags                  */
+       PAS_DMA_TXF_CFLG0 = 0x148,      /* Set flags                  */
+       PAS_DMA_TXF_CFLG1 = 0x14c,      /* Set flags                  */
 };
 
 
@@ -123,11 +128,16 @@ enum {
 #define    PAS_DMA_TXCHAN_TCMDSTA_DA   0x00000100
 #define PAS_DMA_TXCHAN_CFG(c)     (0x304+(c)*_PAS_DMA_TXCHAN_STRIDE)
 #define    PAS_DMA_TXCHAN_CFG_TY_IFACE 0x00000000      /* Type = interface */
+#define    PAS_DMA_TXCHAN_CFG_TY_COPY  0x00000001      /* Type = copy only */
+#define    PAS_DMA_TXCHAN_CFG_TY_FUNC  0x00000002      /* Type = function */
+#define    PAS_DMA_TXCHAN_CFG_TY_XOR   0x00000003      /* Type = xor only */
 #define    PAS_DMA_TXCHAN_CFG_TATTR_M  0x0000003c
 #define    PAS_DMA_TXCHAN_CFG_TATTR_S  2
 #define    PAS_DMA_TXCHAN_CFG_TATTR(x) (((x) << PAS_DMA_TXCHAN_CFG_TATTR_S) & \
                                         PAS_DMA_TXCHAN_CFG_TATTR_M)
-#define    PAS_DMA_TXCHAN_CFG_WT_M     0x000001c0
+#define    PAS_DMA_TXCHAN_CFG_LPDQ     0x00000800
+#define    PAS_DMA_TXCHAN_CFG_LPSQ     0x00000400
+#define    PAS_DMA_TXCHAN_CFG_WT_M     0x000003c0
 #define    PAS_DMA_TXCHAN_CFG_WT_S     6
 #define    PAS_DMA_TXCHAN_CFG_WT(x)    (((x) << PAS_DMA_TXCHAN_CFG_WT_S) & \
                                         PAS_DMA_TXCHAN_CFG_WT_M)
@@ -394,11 +404,62 @@ enum {
                                 XCT_COPY_LLEN_M)
 #define XCT_COPY_SE            0x0000000000000001ull
 
+/* Function descriptor fields */
+#define XCT_FUN_T              0x8000000000000000ull
+#define XCT_FUN_ST             0x4000000000000000ull
+#define XCT_FUN_RR_M           0x3000000000000000ull
+#define XCT_FUN_RR_NORES       0x0000000000000000ull
+#define XCT_FUN_RR_8BRES       0x1000000000000000ull
+#define XCT_FUN_RR_24BRES      0x2000000000000000ull
+#define XCT_FUN_RR_40BRES      0x3000000000000000ull
+#define XCT_FUN_I              0x0800000000000000ull
+#define XCT_FUN_O              0x0400000000000000ull
+#define XCT_FUN_E              0x0200000000000000ull
+#define XCT_FUN_FUN_M          0x01c0000000000000ull
+#define XCT_FUN_FUN_S          54
+#define XCT_FUN_FUN(x)         ((((long)(x)) << XCT_FUN_FUN_S) & XCT_FUN_FUN_M)
+#define XCT_FUN_CRM_M          0x0038000000000000ull
+#define XCT_FUN_CRM_NOP                0x0000000000000000ull
+#define XCT_FUN_CRM_SIG                0x0008000000000000ull
+#define XCT_FUN_LLEN_M         0x0007ffff00000000ull
+#define XCT_FUN_LLEN_S         32
+#define XCT_FUN_LLEN(x)                ((((long)(x)) << XCT_FUN_LLEN_S) & XCT_FUN_LLEN_M)
+#define XCT_FUN_SHL_M          0x00000000f8000000ull
+#define XCT_FUN_SHL_S          27
+#define XCT_FUN_SHL(x)         ((((long)(x)) << XCT_FUN_SHL_S) & XCT_FUN_SHL_M)
+#define XCT_FUN_CHL_M          0x0000000007c00000ull
+#define XCT_FUN_HSZ_M          0x00000000003c0000ull
+#define XCT_FUN_ALG_M          0x0000000000038000ull
+#define XCT_FUN_HP             0x0000000000004000ull
+#define XCT_FUN_BCM_M          0x0000000000003800ull
+#define XCT_FUN_BCP_M          0x0000000000000600ull
+#define XCT_FUN_SIG_M          0x00000000000001f0ull
+#define XCT_FUN_SIG_TCP4       0x0000000000000140ull
+#define XCT_FUN_SIG_TCP6       0x0000000000000150ull
+#define XCT_FUN_SIG_UDP4       0x0000000000000160ull
+#define XCT_FUN_SIG_UDP6       0x0000000000000170ull
+#define XCT_FUN_A              0x0000000000000008ull
+#define XCT_FUN_C              0x0000000000000004ull
+#define XCT_FUN_AL2            0x0000000000000002ull
+#define XCT_FUN_SE             0x0000000000000001ull
+
+/* Function descriptor 8byte result fields */
+#define XCT_FUNRES_8B_CS_M     0x0000ffff00000000ull
+#define XCT_FUNRES_8B_CS_S     32
+#define XCT_FUNRES_8B_CRC_M    0x00000000ffffffffull
+#define XCT_FUNRES_8B_CRC_S    0
+
 /* Control descriptor fields */
 #define CTRL_CMD_T             0x8000000000000000ull
 #define CTRL_CMD_META_EVT      0x2000000000000000ull
 #define CTRL_CMD_O             0x0400000000000000ull
-#define CTRL_CMD_REG_M         0x000000000000000full
+#define CTRL_CMD_ETYPE_M       0x0038000000000000ull
+#define CTRL_CMD_ETYPE_EXT     0x0000000000000000ull
+#define CTRL_CMD_ETYPE_WSET    0x0020000000000000ull
+#define CTRL_CMD_ETYPE_WCLR    0x0028000000000000ull
+#define CTRL_CMD_ETYPE_SET     0x0030000000000000ull
+#define CTRL_CMD_ETYPE_CLR     0x0038000000000000ull
+#define CTRL_CMD_REG_M         0x000000000000007full
 #define CTRL_CMD_REG_S         0
 #define CTRL_CMD_REG(x)                ((((long)(x)) << CTRL_CMD_REG_S) & \
                                 CTRL_CMD_REG_M)
@@ -461,6 +522,16 @@ extern void *pasemi_dma_alloc_buf(struct pasemi_dmachan *chan, int size,
 extern void pasemi_dma_free_buf(struct pasemi_dmachan *chan, int size,
                                dma_addr_t *handle);
 
+/* Routines to allocate flags (events) for channel syncronization */
+extern int  pasemi_dma_alloc_flag(void);
+extern void pasemi_dma_free_flag(int flag);
+extern void pasemi_dma_set_flag(int flag);
+extern void pasemi_dma_clear_flag(int flag);
+
+/* Routines to allocate function engines */
+extern int  pasemi_dma_alloc_fun(void);
+extern void pasemi_dma_free_fun(int fun);
+
 /* Initialize the library, must be called before any other functions */
 extern int pasemi_dma_init(void);
 
index e5802c62f4283f337f62a04a3d20f350e09774f0..b95d033ae6e60eceabac04fbe3432b5f2f630d9a 100644 (file)
@@ -117,7 +117,7 @@ struct pci_controller {
 
 #ifndef CONFIG_PPC64
 
-static inline struct pci_controller *pci_bus_to_host(struct pci_bus *bus)
+static inline struct pci_controller *pci_bus_to_host(const struct pci_bus *bus)
 {
        return bus->sysdata;
 }
@@ -235,7 +235,7 @@ extern void pcibios_fixup_new_pci_devices(struct pci_bus *bus);
 
 extern int pcibios_remove_root_bus(struct pci_controller *phb);
 
-static inline struct pci_controller *pci_bus_to_host(struct pci_bus *bus)
+static inline struct pci_controller *pci_bus_to_host(const struct pci_bus *bus)
 {
        struct device_node *busdn = bus->sysdata;
 
index 2c79f550272bf08bade81d3ec7cd3eb88e02895a..daea7692d070fc9ac28aecee8f2dfd5ecdab480d 100644 (file)
@@ -98,9 +98,6 @@ extern int icache_44x_need_flush;
 #define USER_PTRS_PER_PGD      (TASK_SIZE / PGDIR_SIZE)
 #define FIRST_USER_ADDRESS     0
 
-#define USER_PGD_PTRS (PAGE_OFFSET >> PGDIR_SHIFT)
-#define KERNEL_PGD_PTRS (PTRS_PER_PGD-USER_PGD_PTRS)
-
 #define pte_ERROR(e) \
        printk("%s:%d: bad pte %llx.\n", __FILE__, __LINE__, \
                (unsigned long long)pte_val(e))
@@ -420,7 +417,8 @@ extern int icache_44x_need_flush;
 #define _PAGE_IO       (_PAGE_KERNEL | _PAGE_NO_CACHE | _PAGE_GUARDED)
 #define _PAGE_RAM      (_PAGE_KERNEL | _PAGE_HWEXEC)
 
-#if defined(CONFIG_KGDB) || defined(CONFIG_XMON) || defined(CONFIG_BDI_SWITCH)
+#if defined(CONFIG_KGDB) || defined(CONFIG_XMON) || defined(CONFIG_BDI_SWITCH) ||\
+       defined(CONFIG_KPROBES)
 /* We want the debuggers to be able to set breakpoints anywhere, so
  * don't write protect the kernel text */
 #define _PAGE_RAM_TEXT _PAGE_RAM
@@ -692,7 +690,7 @@ extern pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn,
 #define pmd_page_vaddr(pmd)    \
        ((unsigned long) (pmd_val(pmd) & PAGE_MASK))
 #define pmd_page(pmd)          \
-       (mem_map + (__pa(pmd_val(pmd)) >> PAGE_SHIFT))
+       pfn_to_page((__pa(pmd_val(pmd)) >> PAGE_SHIFT))
 #endif
 
 /* to find an entry in a kernel page-table-directory */
diff --git a/include/asm-powerpc/phyp_dump.h b/include/asm-powerpc/phyp_dump.h
new file mode 100644 (file)
index 0000000..fa74c6c
--- /dev/null
@@ -0,0 +1,47 @@
+/*
+ * Hypervisor-assisted dump
+ *
+ * Linas Vepstas, Manish Ahuja 2008
+ * Copyright 2008 IBM Corp.
+ *
+ *      This program is free software; you can redistribute it and/or
+ *      modify it under the terms of the GNU General Public License
+ *      as published by the Free Software Foundation; either version
+ *      2 of the License, or (at your option) any later version.
+ */
+
+#ifndef _PPC64_PHYP_DUMP_H
+#define _PPC64_PHYP_DUMP_H
+
+#ifdef CONFIG_PHYP_DUMP
+
+/* The RMR region will be saved for later dumping
+ * whenever the kernel crashes. Set this to 256MB. */
+#define PHYP_DUMP_RMR_START 0x0
+#define PHYP_DUMP_RMR_END   (1UL<<28)
+
+struct phyp_dump {
+       /* Memory that is reserved during very early boot. */
+       unsigned long init_reserve_start;
+       unsigned long init_reserve_size;
+       /* cmd line options during boot */
+       unsigned long reserve_bootvar;
+       unsigned long phyp_dump_at_boot;
+       /* Check status during boot if dump supported, active & present*/
+       unsigned long phyp_dump_configured;
+       unsigned long phyp_dump_is_active;
+       /* store cpu & hpte size */
+       unsigned long cpu_state_size;
+       unsigned long hpte_region_size;
+       /* previous scratch area values */
+       unsigned long reserved_scratch_addr;
+       unsigned long reserved_scratch_size;
+};
+
+extern struct phyp_dump *phyp_dump_info;
+
+int early_init_dt_scan_phyp_dump(unsigned long node,
+               const char *uname, int depth, void *data);
+
+#endif /* CONFIG_PHYP_DUMP */
+#endif /* _PPC64_PHYP_DUMP_H */
index 2259d4ce3846f3b1badc3b52977d1658c9aed3e5..e1dc090748dff7b3774197f2fb28d0b3fffb7747 100644 (file)
@@ -29,8 +29,6 @@
 
 #ifdef __KERNEL__
 
-#include <asm/of_device.h>
-
 #define PMI_TYPE_FREQ_CHANGE   0x01
 #define PMI_READ_TYPE          0
 #define PMI_READ_DATA0         1
diff --git a/include/asm-powerpc/ppc4xx.h b/include/asm-powerpc/ppc4xx.h
new file mode 100644 (file)
index 0000000..033039a
--- /dev/null
@@ -0,0 +1,18 @@
+/*
+ * PPC4xx Prototypes and definitions
+ *
+ * Copyright 2008 DENX Software Engineering, Stefan Roese <sr@denx.de>
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ */
+
+#ifndef __ASM_POWERPC_PPC4xx_H__
+#define __ASM_POWERPC_PPC4xx_H__
+
+extern void ppc4xx_reset_system(char *cmd);
+
+#endif /* __ASM_POWERPC_PPC4xx_H__ */
index 2b693673eff442bcc0726e50f624e462aa85a1d4..9e8ed6824e152e24a12a0cdfa3705aeafef97ecc 100644 (file)
@@ -434,8 +434,11 @@ struct ps3_sys_manager_ops {
 };
 
 void ps3_sys_manager_register_ops(const struct ps3_sys_manager_ops *ops);
-void ps3_sys_manager_power_off(void);
-void ps3_sys_manager_restart(void);
+void __noreturn ps3_sys_manager_power_off(void);
+void __noreturn ps3_sys_manager_restart(void);
+void __noreturn ps3_sys_manager_halt(void);
+int ps3_sys_manager_get_wol(void);
+void ps3_sys_manager_set_wol(int state);
 
 struct ps3_prealloc {
     const char *name;
index 891d68932f39975143b7dcc42fe4e0fbf96a414a..39023dde1cc4c869ed9d7f4ed9b8baa623206ad7 100644 (file)
@@ -58,6 +58,11 @@ struct pt_regs {
 #define __ARCH_WANT_COMPAT_SYS_PTRACE
 
 #define STACK_FRAME_OVERHEAD   112     /* size of minimum stack frame */
+#define STACK_FRAME_LR_SAVE    2       /* Location of LR in stack frame */
+#define STACK_FRAME_REGS_MARKER        ASM_CONST(0x7265677368657265)
+#define STACK_INT_FRAME_SIZE   (sizeof(struct pt_regs) + \
+                                       STACK_FRAME_OVERHEAD + 288)
+#define STACK_FRAME_MARKER     12
 
 /* Size of dummy stack frame allocated when calling signal handler. */
 #define __SIGNAL_FRAMESIZE     128
@@ -66,6 +71,10 @@ struct pt_regs {
 #else /* __powerpc64__ */
 
 #define STACK_FRAME_OVERHEAD   16      /* size of minimum stack frame */
+#define STACK_FRAME_LR_SAVE    1       /* Location of LR in stack frame */
+#define STACK_FRAME_REGS_MARKER        ASM_CONST(0x72656773)
+#define STACK_INT_FRAME_SIZE   (sizeof(struct pt_regs) + STACK_FRAME_OVERHEAD)
+#define STACK_FRAME_MARKER     2
 
 /* Size of stack frame allocated when calling signal handler. */
 #define __SIGNAL_FRAMESIZE     64
index 430dc77b35fcbb73f1509326d794f64f1a990970..c3be6e2e1490625cf7ac8d45daf62785bc7155d0 100644 (file)
@@ -85,6 +85,7 @@ extern int par_io_data_set(u8 port, u8 pin, u8 val);
 /* QE internal API */
 int qe_issue_cmd(u32 cmd, u32 device, u8 mcn_protocol, u32 cmd_input);
 enum qe_clock qe_clock_source(const char *source);
+unsigned int qe_get_brg_clk(void);
 int qe_setbrg(enum qe_clock brg, unsigned int rate, unsigned int multiplier);
 int qe_get_snum(void);
 void qe_put_snum(u8 snum);
@@ -92,7 +93,16 @@ unsigned long qe_muram_alloc(int size, int align);
 int qe_muram_free(unsigned long offset);
 unsigned long qe_muram_alloc_fixed(unsigned long offset, int size);
 void qe_muram_dump(void);
-void *qe_muram_addr(unsigned long offset);
+
+static inline void __iomem *qe_muram_addr(unsigned long offset)
+{
+       return (void __iomem *)&qe_immr->muram[offset];
+}
+
+static inline unsigned long qe_muram_offset(void __iomem *addr)
+{
+       return addr - (void __iomem *)qe_immr->muram;
+}
 
 /* Structure that defines QE firmware binary files.
  *
index cefc14728cc567535f99ea6b417afa68ff667158..a6cc93b78b981eaff6fb3f4944afcb686563e572 100644 (file)
@@ -32,11 +32,20 @@ struct rw_semaphore {
 #define RWSEM_ACTIVE_WRITE_BIAS                (RWSEM_WAITING_BIAS + RWSEM_ACTIVE_BIAS)
        spinlock_t              wait_lock;
        struct list_head        wait_list;
+#ifdef CONFIG_DEBUG_LOCK_ALLOC
+       struct lockdep_map      dep_map;
+#endif
 };
 
+#ifdef CONFIG_DEBUG_LOCK_ALLOC
+# define __RWSEM_DEP_MAP_INIT(lockname) , .dep_map = { .name = #lockname }
+#else
+# define __RWSEM_DEP_MAP_INIT(lockname)
+#endif
+
 #define __RWSEM_INITIALIZER(name) \
-       { RWSEM_UNLOCKED_VALUE, SPIN_LOCK_UNLOCKED, \
-         LIST_HEAD_INIT((name).wait_list) }
+       { RWSEM_UNLOCKED_VALUE, __SPIN_LOCK_UNLOCKED((name).wait_lock), \
+         LIST_HEAD_INIT((name).wait_list) __RWSEM_DEP_MAP_INIT(name) }
 
 #define DECLARE_RWSEM(name)            \
        struct rw_semaphore name = __RWSEM_INITIALIZER(name)
@@ -46,12 +55,15 @@ extern struct rw_semaphore *rwsem_down_write_failed(struct rw_semaphore *sem);
 extern struct rw_semaphore *rwsem_wake(struct rw_semaphore *sem);
 extern struct rw_semaphore *rwsem_downgrade_wake(struct rw_semaphore *sem);
 
-static inline void init_rwsem(struct rw_semaphore *sem)
-{
-       sem->count = RWSEM_UNLOCKED_VALUE;
-       spin_lock_init(&sem->wait_lock);
-       INIT_LIST_HEAD(&sem->wait_list);
-}
+extern void __init_rwsem(struct rw_semaphore *sem, const char *name,
+                        struct lock_class_key *key);
+
+#define init_rwsem(sem)                                        \
+       do {                                            \
+               static struct lock_class_key __key;     \
+                                                       \
+               __init_rwsem((sem), #sem, &__key);      \
+       } while (0)
 
 /*
  * lock for reading
@@ -78,7 +90,7 @@ static inline int __down_read_trylock(struct rw_semaphore *sem)
 /*
  * lock for writing
  */
-static inline void __down_write(struct rw_semaphore *sem)
+static inline void __down_write_nested(struct rw_semaphore *sem, int subclass)
 {
        int tmp;
 
@@ -88,6 +100,11 @@ static inline void __down_write(struct rw_semaphore *sem)
                rwsem_down_write_failed(sem);
 }
 
+static inline void __down_write(struct rw_semaphore *sem)
+{
+       __down_write_nested(sem, 0);
+}
+
 static inline int __down_write_trylock(struct rw_semaphore *sem)
 {
        int tmp;
index e8b493d52b4f68a6807ed25475262b47e4defbd7..9aea8e9f0bd144ba5ba6086554a4f0cafaad6e81 100644 (file)
@@ -15,6 +15,7 @@
 
 #ifdef CONFIG_MEMORY_HOTPLUG
 extern void create_section_mapping(unsigned long start, unsigned long end);
+extern int remove_section_mapping(unsigned long start, unsigned long end);
 #ifdef CONFIG_NUMA
 extern int hot_add_scn_to_nid(unsigned long scn_addr);
 #else
index cc4cfceac67c16af4dc5326720ec0dda77fd6227..258c939931902c91fcd28f345220c6254aa747c2 100644 (file)
@@ -19,6 +19,7 @@
  *
  * (the type definitions are in asm/spinlock_types.h)
  */
+#include <linux/irqflags.h>
 #ifdef CONFIG_PPC64
 #include <asm/paca.h>
 #include <asm/hvcall.h>
index aa40f92c298d66ef2de5341bc62bf1a9fbe28806..e40010abcaf134f53bbcf639bf6999b856a42a2a 100644 (file)
@@ -7,6 +7,7 @@
 #define __HAVE_ARCH_STRNCPY
 #define __HAVE_ARCH_STRLEN
 #define __HAVE_ARCH_STRCMP
+#define __HAVE_ARCH_STRNCMP
 #define __HAVE_ARCH_STRCAT
 #define __HAVE_ARCH_MEMSET
 #define __HAVE_ARCH_MEMCPY
@@ -18,6 +19,7 @@ extern char * strcpy(char *,const char *);
 extern char * strncpy(char *,const char *, __kernel_size_t);
 extern __kernel_size_t strlen(const char *);
 extern int strcmp(const char *,const char *);
+extern int strncmp(const char *, const char *, __kernel_size_t);
 extern char * strcat(char *, const char *);
 extern void * memset(void *,int,__kernel_size_t);
 extern void * memcpy(void *,const void *,__kernel_size_t);
index 29552ff182aa161204490d48bb26d9ec1e613e2e..fab1674b31b6beb989478cc8ed65894decdef84d 100644 (file)
@@ -5,6 +5,7 @@
 #define _ASM_POWERPC_SYSTEM_H
 
 #include <linux/kernel.h>
+#include <linux/irqflags.h>
 
 #include <asm/hw_irq.h>
 
index ca23b681ad058e7f984d9bffff2f1b71af52382e..100c6fbfc587058d889b657e61e2b180ae1b2e13 100644 (file)
@@ -96,11 +96,10 @@ static inline void sysfs_remove_device_from_node(struct sys_device *dev,
 {
 }
 
+#endif /* CONFIG_NUMA */
 
 #include <asm-generic/topology.h>
 
-#endif /* CONFIG_NUMA */
-
 #ifdef CONFIG_SMP
 #include <asm/cputable.h>
 #define smt_capable()          (cpu_has_feature(CPU_FTR_SMT))
index 903fd1932436a0f696f51f509777382b6a24707d..c243a6ac60e528506b9c4fc48bea7f6146d818b5 100644 (file)
@@ -84,6 +84,13 @@ typedef unsigned long long u64;
 
 typedef __vector128 vector128;
 
+/* Physical address used by some IO functions */
+#if defined(CONFIG_PPC64) || defined(CONFIG_PHYS_64BIT)
+typedef u64 phys_addr_t;
+#else
+typedef u32 phys_addr_t;
+#endif
+
 #ifdef __powerpc64__
 typedef u64 dma_addr_t;
 #else
index 1379a4f76de3bf51af5273949dfb5c96e4f6a82b..3909a2eec286d8b38a364c8263149ce8ba975eec 100644 (file)
@@ -31,7 +31,6 @@
 
 #include <asm/mmu.h>
 #include <asm/ocp_ids.h>
-#include <asm/semaphore.h>
 
 #ifdef CONFIG_PPC_OCP
 
index cfda7d5bf0262544ae61e2437b5ed7f297518d9e..121b2ecddfc35d46042677e1304913461937b71d 100644 (file)
@@ -25,7 +25,7 @@ static void __init check_bugs(void)
        case CPU_SH7619:
                *p++ = '2';
                break;
-       case CPU_SH7203 ... CPU_SH7263:
+       case CPU_SH7203 ... CPU_MXG:
                *p++ = '2';
                *p++ = 'a';
                break;
index ec028c649215542843871530de938f8ec2b98bce..da46e67ae26d422449e31f51c28b9ce43b3a8eaf 100644 (file)
 #ifndef __ASM_CPU_SH4_FREQ_H
 #define __ASM_CPU_SH4_FREQ_H
 
-#if defined(CONFIG_CPU_SUBTYPE_SH7722) || defined(CONFIG_CPU_SUBTYPE_SH7366)
+#if defined(CONFIG_CPU_SUBTYPE_SH7722) || \
+    defined(CONFIG_CPU_SUBTYPE_SH7723) || \
+    defined(CONFIG_CPU_SUBTYPE_SH7366)
 #define FRQCR                  0xa4150000
 #define VCLKCR                 0xa4150004
 #define SCLKACR                        0xa4150008
 #define SCLKBCR                        0xa415000c
-#if defined(CONFIG_CPU_SUBTYPE_SH7722)
 #define IrDACLKCR              0xa4150010
-#endif
 #elif defined(CONFIG_CPU_SUBTYPE_SH7763) || \
       defined(CONFIG_CPU_SUBTYPE_SH7780)
 #define        FRQCR                   0xffc80000
index f3d0f53275e491dfed87625fc87b32e7dc9fa485..25b1e6adfe8ca938a410fd7bea8b93f1f6c1aad8 100644 (file)
@@ -1,7 +1,12 @@
 #ifndef __ASM_SH_CPU_SH4_RTC_H
 #define __ASM_SH_CPU_SH4_RTC_H
 
+#ifdef CONFIG_CPU_SUBTYPE_SH7723
+#define rtc_reg_size           sizeof(u16)
+#else
 #define rtc_reg_size           sizeof(u32)
+#endif
+
 #define RTC_BIT_INVERTED       0x40    /* bug on SH7750, SH7750S */
 #define RTC_DEF_CAPABILITIES   RTC_CAP_4_DIGIT_YEAR
 
diff --git a/include/asm-sh/migor.h b/include/asm-sh/migor.h
new file mode 100644 (file)
index 0000000..2329363
--- /dev/null
@@ -0,0 +1,58 @@
+#ifndef __ASM_SH_MIGOR_H
+#define __ASM_SH_MIGOR_H
+
+/*
+ * linux/include/asm-sh/migor.h
+ *
+ * Copyright (C) 2008 Renesas Solutions
+ *
+ * Portions Copyright (C) 2007 Nobuhiro Iwamatsu
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License. See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+ */
+#include <asm/addrspace.h>
+
+/* GPIO */
+#define MSTPCR0 0xa4150030
+#define MSTPCR1 0xa4150034
+#define MSTPCR2 0xa4150038
+
+#define PORT_PACR 0xa4050100
+#define PORT_PDCR 0xa4050106
+#define PORT_PECR 0xa4050108
+#define PORT_PHCR 0xa405010e
+#define PORT_PJCR 0xa4050110
+#define PORT_PKCR 0xa4050112
+#define PORT_PLCR 0xa4050114
+#define PORT_PMCR 0xa4050116
+#define PORT_PRCR 0xa405011c
+#define PORT_PWCR 0xa4050146
+#define PORT_PXCR 0xa4050148
+#define PORT_PYCR 0xa405014a
+#define PORT_PZCR 0xa405014c
+#define PORT_PADR 0xa4050120
+#define PORT_PWDR 0xa4050166
+
+#define PORT_HIZCRA 0xa4050158
+#define PORT_HIZCRC 0xa405015c
+
+#define PORT_MSELCRB 0xa4050182
+
+#define MSTPCR1 0xa4150034
+#define MSTPCR2 0xa4150038
+
+#define PORT_PSELA 0xa405014e
+#define PORT_PSELB 0xa4050150
+#define PORT_PSELC 0xa4050152
+#define PORT_PSELD 0xa4050154
+
+#define PORT_HIZCRA 0xa4050158
+#define PORT_HIZCRB 0xa405015a
+#define PORT_HIZCRC 0xa405015c
+
+#define BSC_CS6ABCR 0xfec1001c
+
+#endif /* __ASM_SH_MIGOR_H */
index ec707b98e5b91a88e9e21a6aa076490ae1ba6987..b7c7ce80f03e110007c75e2a1b32e4b2d2379cda 100644 (file)
@@ -16,7 +16,7 @@ enum cpu_type {
        CPU_SH7619,
 
        /* SH-2A types */
-       CPU_SH7203, CPU_SH7206, CPU_SH7263,
+       CPU_SH7203, CPU_SH7206, CPU_SH7263, CPU_MXG,
 
        /* SH-3 types */
        CPU_SH7705, CPU_SH7706, CPU_SH7707,
@@ -29,7 +29,8 @@ enum cpu_type {
        CPU_SH7760, CPU_SH4_202, CPU_SH4_501,
 
        /* SH-4A types */
-       CPU_SH7763, CPU_SH7770, CPU_SH7780, CPU_SH7781, CPU_SH7785, CPU_SHX3,
+       CPU_SH7763, CPU_SH7770, CPU_SH7780, CPU_SH7781, CPU_SH7785,
+       CPU_SH7723, CPU_SHX3,
 
        /* SH4AL-DSP types */
        CPU_SH7343, CPU_SH7722, CPU_SH7366,
index 1770460a4616e6a7980dc5f142a6fcb1066b8b71..a33838f23a6d879b1b443554f66c36b1d6e685a8 100644 (file)
 #define PA_SCSPTR1      (PA_BCR+0x0524) /* SCIF1 Serial Port control */
 #define PA_SCLSR1       (PA_BCR+0x0528) /* SCIF1 Line Status control */
 #define PA_SCRER1       (PA_BCR+0x052c) /* SCIF1 Serial Error control */
-#define PA_ICCR         (PA_BCR+0x0600) /* Serial control */
-#define PA_SAR          (PA_BCR+0x0602) /* Serial Slave control */
-#define PA_MDR          (PA_BCR+0x0604) /* Serial Mode control */
-#define PA_ADR1         (PA_BCR+0x0606) /* Serial Address1 control */
-#define PA_DAR1         (PA_BCR+0x0646) /* Serial Data1 control */
+#define PA_SMCR         (PA_BCR+0x0600) /* 2-wire Serial control */
+#define PA_SMSMADR      (PA_BCR+0x0602) /* 2-wire Serial Slave control */
+#define PA_SMMR         (PA_BCR+0x0604) /* 2-wire Serial Mode control */
+#define PA_SMSADR1      (PA_BCR+0x0606) /* 2-wire Serial Address1 control */
+#define PA_SMTRDR1      (PA_BCR+0x0646) /* 2-wire Serial Data1 control */
 #define PA_VERREG       (PA_BCR+0x0700) /* FPGA Version Register */
 #define PA_POFF         (PA_BCR+0x0800) /* System Power Off control */
 #define PA_PMR          (PA_BCR+0x0900) /*  */
 #define PA_SCFCR       (PA_BCR+0x040c) /* SCIF FIFO control */
 #define PA_SCFDR       (PA_BCR+0x040e) /* SCIF FIFO data control */
 #define PA_SCLSR       (PA_BCR+0x0412) /* SCIF Line Status control */
-#define PA_ICCR                (PA_BCR+0x0500) /* Serial control */
-#define PA_SAR         (PA_BCR+0x0502) /* Serial Slave control */
-#define PA_MDR         (PA_BCR+0x0504) /* Serial Mode control */
-#define PA_ADR1                (PA_BCR+0x0506) /* Serial Address1 control */
-#define PA_DAR1                (PA_BCR+0x0546) /* Serial Data1 control */
+#define PA_SMCR                (PA_BCR+0x0500) /* 2-wire Serial control */
+#define PA_SMSMADR     (PA_BCR+0x0502) /* 2-wire Serial Slave control */
+#define PA_SMMR                (PA_BCR+0x0504) /* 2-wire Serial Mode control */
+#define PA_SMSADR1     (PA_BCR+0x0506) /* 2-wire Serial Address1 control */
+#define PA_SMTRDR1     (PA_BCR+0x0546) /* 2-wire Serial Data1 control */
 #define PA_VERREG      (PA_BCR+0x0600) /* FPGA Version Register */
 
 #define PA_AX88796L    0xa5800400      /* AX88796L Area */
 #define IRQ_TP                 (HL_FPGA_IRQ_BASE + 12)
 #define IRQ_RTC                        (HL_FPGA_IRQ_BASE + 13)
 #define IRQ_TH_ALERT           (HL_FPGA_IRQ_BASE + 14)
+#define IRQ_SCIF0              (HL_FPGA_IRQ_BASE + 15)
+#define IRQ_SCIF1              (HL_FPGA_IRQ_BASE + 16)
 
 unsigned char *highlander_init_irq_r7780mp(void);
 unsigned char *highlander_init_irq_r7780rp(void);
diff --git a/include/asm-sh/se7721.h b/include/asm-sh/se7721.h
new file mode 100644 (file)
index 0000000..b957f60
--- /dev/null
@@ -0,0 +1,70 @@
+/*
+ * Copyright (C) 2008 Renesas Solutions Corp.
+ *
+ * Hitachi UL SolutionEngine 7721 Support.
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+ */
+
+#ifndef __ASM_SH_SE7721_H
+#define __ASM_SH_SE7721_H
+#include <asm/addrspace.h>
+
+/* Box specific addresses. */
+#define SE_AREA0_WIDTH 2               /* Area0: 32bit */
+#define PA_ROM         0xa0000000      /* EPROM */
+#define PA_ROM_SIZE    0x00200000      /* EPROM size 2M byte */
+#define PA_FROM                0xa1000000      /* Flash-ROM */
+#define PA_FROM_SIZE   0x01000000      /* Flash-ROM size 16M byte */
+#define PA_EXT1                0xa4000000
+#define PA_EXT1_SIZE   0x04000000
+#define PA_SDRAM       0xaC000000      /* SDRAM(Area3) 64MB */
+#define PA_SDRAM_SIZE  0x04000000
+
+#define PA_EXT4                0xb0000000
+#define PA_EXT4_SIZE   0x04000000
+
+#define PA_PERIPHERAL  0xB8000000
+
+#define PA_PCIC                PA_PERIPHERAL
+#define PA_MRSHPC      (PA_PERIPHERAL + 0x003fffe0)
+#define PA_MRSHPC_MW1  (PA_PERIPHERAL + 0x00400000)
+#define PA_MRSHPC_MW2  (PA_PERIPHERAL + 0x00500000)
+#define PA_MRSHPC_IO   (PA_PERIPHERAL + 0x00600000)
+#define MRSHPC_OPTION  (PA_MRSHPC + 6)
+#define MRSHPC_CSR     (PA_MRSHPC + 8)
+#define MRSHPC_ISR     (PA_MRSHPC + 10)
+#define MRSHPC_ICR     (PA_MRSHPC + 12)
+#define MRSHPC_CPWCR   (PA_MRSHPC + 14)
+#define MRSHPC_MW0CR1  (PA_MRSHPC + 16)
+#define MRSHPC_MW1CR1  (PA_MRSHPC + 18)
+#define MRSHPC_IOWCR1  (PA_MRSHPC + 20)
+#define MRSHPC_MW0CR2  (PA_MRSHPC + 22)
+#define MRSHPC_MW1CR2  (PA_MRSHPC + 24)
+#define MRSHPC_IOWCR2  (PA_MRSHPC + 26)
+#define MRSHPC_CDCR    (PA_MRSHPC + 28)
+#define MRSHPC_PCIC_INFO       (PA_MRSHPC + 30)
+
+#define PA_LED         0xB6800000      /* 8bit LED */
+#define PA_FPGA                0xB7000000      /* FPGA base address */
+
+#define MRSHPC_IRQ0    10
+
+#define FPGA_ILSR1     (PA_FPGA + 0x02)
+#define FPGA_ILSR2     (PA_FPGA + 0x03)
+#define FPGA_ILSR3     (PA_FPGA + 0x04)
+#define FPGA_ILSR4     (PA_FPGA + 0x05)
+#define FPGA_ILSR5     (PA_FPGA + 0x06)
+#define FPGA_ILSR6     (PA_FPGA + 0x07)
+#define FPGA_ILSR7     (PA_FPGA + 0x08)
+#define FPGA_ILSR8     (PA_FPGA + 0x09)
+
+void init_se7721_IRQ(void);
+
+#define __IO_PREFIX            se7721
+#include <asm/io_generic.h>
+
+#endif  /* __ASM_SH_SE7721_H */
index e0e89fcb8388846ea3b228485bba339e622b051d..3690fe5857a4714d38f6cc1592cd820369bab01b 100644 (file)
@@ -77,6 +77,8 @@
 #define PORT_PSELA      0xA405014EUL
 #define PORT_PYCR       0xA405014AUL
 #define PORT_PZCR       0xA405014CUL
+#define PORT_HIZCRA     0xA4050158UL
+#define PORT_HIZCRC     0xA405015CUL
 
 /* IRQ */
 #define IRQ0_IRQ        32
diff --git a/include/asm-sh/sh_keysc.h b/include/asm-sh/sh_keysc.h
new file mode 100644 (file)
index 0000000..b5a4dd5
--- /dev/null
@@ -0,0 +1,13 @@
+#ifndef __ASM_KEYSC_H__
+#define __ASM_KEYSC_H__
+
+#define SH_KEYSC_MAXKEYS 30
+
+struct sh_keysc_info {
+       enum { SH_KEYSC_MODE_1, SH_KEYSC_MODE_2, SH_KEYSC_MODE_3 } mode;
+       int scan_timing; /* 0 -> 7, see KYCR1, SCN[2:0] */
+       int delay;
+       int keycodes[SH_KEYSC_MAXKEYS];
+};
+
+#endif /* __ASM_KEYSC_H__ */
index 5145aa2a0ce9de652304a7ed5b69ab9682797b34..e65b6b822cb3722731cf5d4d5bb21673050ac9bb 100644 (file)
@@ -146,6 +146,8 @@ extern unsigned int instruction_size(unsigned int insn);
 
 extern unsigned long cached_to_uncached;
 
+extern struct dentry *sh_debugfs_root;
+
 /* XXX
  * disable hlt during certain critical i/o operations
  */
index f402a3b1cfa48fd4b0d626d80ef3837305c4f41a..34cdb28e8f4429c2deb7ed7e96ec9e07c50bbd98 100644 (file)
@@ -16,7 +16,7 @@
        .cache_nice_tries       = 2,                    \
        .busy_idx               = 3,                    \
        .idle_idx               = 2,                    \
-       .newidle_idx            = 0,                    \
+       .newidle_idx            = 2,                    \
        .wake_idx               = 1,                    \
        .forkexec_idx           = 1,                    \
        .flags                  = SD_LOAD_BALANCE       \
index c0318b60889398e60c95d5632f9b10d071fbe72f..1e41fda74bd38a0ae459ba884b598b9ed78425ce 100644 (file)
@@ -55,13 +55,10 @@ static inline void set_fs(mm_segment_t s)
  * If we don't have an MMU (or if its disabled) the only thing we really have
  * to look out for is if the address resides somewhere outside of what
  * available RAM we have.
- *
- * TODO: This check could probably also stand to be restricted somewhat more..
- * though it still does the Right Thing(tm) for the time being.
  */
 static inline int __access_ok(unsigned long addr, unsigned long size)
 {
-       return ((addr >= memory_start) && ((addr + size) < memory_end));
+       return 1;
 }
 #else /* CONFIG_MMU */
 #define __addr_ok(addr) \
index dbe7a586be5b12e77d5a87df291bdf1886dfaac5..d3978e068e2bbb9be764d6150ad7a30a16d12ffe 100644 (file)
@@ -280,7 +280,7 @@ static inline void sun_fd_enable_dma(void)
 
 /* Our low-level entry point in arch/sparc/kernel/entry.S */
 extern int sparc_floppy_request_irq(int irq, unsigned long flags,
-                                   irqreturn_t (*irq_handler)(int irq, void *));
+                                   irq_handler_t irq_handler);
 
 static int sun_fd_request_irq(void)
 {
diff --git a/include/asm-sparc64/lmb.h b/include/asm-sparc64/lmb.h
new file mode 100644 (file)
index 0000000..6a352cb
--- /dev/null
@@ -0,0 +1,10 @@
+#ifndef _SPARC64_LMB_H
+#define _SPARC64_LMB_H
+
+#include <asm/oplib.h>
+
+#define LMB_DBG(fmt...) prom_printf(fmt)
+
+#define LMB_REAL_LIMIT 0
+
+#endif /* !(_SPARC64_LMB_H) */
index ed8affbf96cb804f3a97ec46d610fdec19345a2b..2faed7ecb092a7893c89c573b7ac9870e060d8a7 100644 (file)
                                + (CONFIG_PHYSICAL_ALIGN - 1)) \
                                & ~(CONFIG_PHYSICAL_ALIGN - 1))
 
+#ifdef CONFIG_X86_64
+#define BOOT_HEAP_SIZE 0x7000
+#define BOOT_STACK_SIZE        0x4000
+#else
+#define BOOT_HEAP_SIZE 0x4000
+#define BOOT_STACK_SIZE        0x1000
+#endif
+
 #endif /* _ASM_BOOT_H */
index 58f790f4df5253fe80c3a9ed34b2b1d4bb91b4ef..a1a4dc7fe6ece75087cc33e33d3c60e2477cd586 100644 (file)
@@ -1,5 +1,237 @@
+#ifndef _ASM_DMA_MAPPING_H_
+#define _ASM_DMA_MAPPING_H_
+
+/*
+ * IOMMU interface. See Documentation/DMA-mapping.txt and DMA-API.txt for
+ * documentation.
+ */
+
+#include <linux/scatterlist.h>
+#include <asm/io.h>
+#include <asm/swiotlb.h>
+
+extern dma_addr_t bad_dma_address;
+extern int iommu_merge;
+extern struct device fallback_dev;
+extern int panic_on_overflow;
+extern int forbid_dac;
+extern int force_iommu;
+
+struct dma_mapping_ops {
+       int             (*mapping_error)(dma_addr_t dma_addr);
+       void*           (*alloc_coherent)(struct device *dev, size_t size,
+                               dma_addr_t *dma_handle, gfp_t gfp);
+       void            (*free_coherent)(struct device *dev, size_t size,
+                               void *vaddr, dma_addr_t dma_handle);
+       dma_addr_t      (*map_single)(struct device *hwdev, phys_addr_t ptr,
+                               size_t size, int direction);
+       /* like map_single, but doesn't check the device mask */
+       dma_addr_t      (*map_simple)(struct device *hwdev, phys_addr_t ptr,
+                               size_t size, int direction);
+       void            (*unmap_single)(struct device *dev, dma_addr_t addr,
+                               size_t size, int direction);
+       void            (*sync_single_for_cpu)(struct device *hwdev,
+                               dma_addr_t dma_handle, size_t size,
+                               int direction);
+       void            (*sync_single_for_device)(struct device *hwdev,
+                               dma_addr_t dma_handle, size_t size,
+                               int direction);
+       void            (*sync_single_range_for_cpu)(struct device *hwdev,
+                               dma_addr_t dma_handle, unsigned long offset,
+                               size_t size, int direction);
+       void            (*sync_single_range_for_device)(struct device *hwdev,
+                               dma_addr_t dma_handle, unsigned long offset,
+                               size_t size, int direction);
+       void            (*sync_sg_for_cpu)(struct device *hwdev,
+                               struct scatterlist *sg, int nelems,
+                               int direction);
+       void            (*sync_sg_for_device)(struct device *hwdev,
+                               struct scatterlist *sg, int nelems,
+                               int direction);
+       int             (*map_sg)(struct device *hwdev, struct scatterlist *sg,
+                               int nents, int direction);
+       void            (*unmap_sg)(struct device *hwdev,
+                               struct scatterlist *sg, int nents,
+                               int direction);
+       int             (*dma_supported)(struct device *hwdev, u64 mask);
+       int             is_phys;
+};
+
+extern const struct dma_mapping_ops *dma_ops;
+
+static inline int dma_mapping_error(dma_addr_t dma_addr)
+{
+       if (dma_ops->mapping_error)
+               return dma_ops->mapping_error(dma_addr);
+
+       return (dma_addr == bad_dma_address);
+}
+
+#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f)
+#define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h)
+
+void *dma_alloc_coherent(struct device *dev, size_t size,
+                          dma_addr_t *dma_handle, gfp_t flag);
+
+void dma_free_coherent(struct device *dev, size_t size,
+                        void *vaddr, dma_addr_t dma_handle);
+
+
+extern int dma_supported(struct device *hwdev, u64 mask);
+extern int dma_set_mask(struct device *dev, u64 mask);
+
+static inline dma_addr_t
+dma_map_single(struct device *hwdev, void *ptr, size_t size,
+              int direction)
+{
+       BUG_ON(!valid_dma_direction(direction));
+       return dma_ops->map_single(hwdev, virt_to_phys(ptr), size, direction);
+}
+
+static inline void
+dma_unmap_single(struct device *dev, dma_addr_t addr, size_t size,
+                int direction)
+{
+       BUG_ON(!valid_dma_direction(direction));
+       if (dma_ops->unmap_single)
+               dma_ops->unmap_single(dev, addr, size, direction);
+}
+
+static inline int
+dma_map_sg(struct device *hwdev, struct scatterlist *sg,
+          int nents, int direction)
+{
+       BUG_ON(!valid_dma_direction(direction));
+       return dma_ops->map_sg(hwdev, sg, nents, direction);
+}
+
+static inline void
+dma_unmap_sg(struct device *hwdev, struct scatterlist *sg, int nents,
+            int direction)
+{
+       BUG_ON(!valid_dma_direction(direction));
+       if (dma_ops->unmap_sg)
+               dma_ops->unmap_sg(hwdev, sg, nents, direction);
+}
+
+static inline void
+dma_sync_single_for_cpu(struct device *hwdev, dma_addr_t dma_handle,
+                       size_t size, int direction)
+{
+       BUG_ON(!valid_dma_direction(direction));
+       if (dma_ops->sync_single_for_cpu)
+               dma_ops->sync_single_for_cpu(hwdev, dma_handle, size,
+                                            direction);
+       flush_write_buffers();
+}
+
+static inline void
+dma_sync_single_for_device(struct device *hwdev, dma_addr_t dma_handle,
+                          size_t size, int direction)
+{
+       BUG_ON(!valid_dma_direction(direction));
+       if (dma_ops->sync_single_for_device)
+               dma_ops->sync_single_for_device(hwdev, dma_handle, size,
+                                               direction);
+       flush_write_buffers();
+}
+
+static inline void
+dma_sync_single_range_for_cpu(struct device *hwdev, dma_addr_t dma_handle,
+                             unsigned long offset, size_t size, int direction)
+{
+       BUG_ON(!valid_dma_direction(direction));
+       if (dma_ops->sync_single_range_for_cpu)
+               dma_ops->sync_single_range_for_cpu(hwdev, dma_handle, offset,
+                                                  size, direction);
+
+       flush_write_buffers();
+}
+
+static inline void
+dma_sync_single_range_for_device(struct device *hwdev, dma_addr_t dma_handle,
+                                unsigned long offset, size_t size,
+                                int direction)
+{
+       BUG_ON(!valid_dma_direction(direction));
+       if (dma_ops->sync_single_range_for_device)
+               dma_ops->sync_single_range_for_device(hwdev, dma_handle,
+                                                     offset, size, direction);
+
+       flush_write_buffers();
+}
+
+static inline void
+dma_sync_sg_for_cpu(struct device *hwdev, struct scatterlist *sg,
+                   int nelems, int direction)
+{
+       BUG_ON(!valid_dma_direction(direction));
+       if (dma_ops->sync_sg_for_cpu)
+               dma_ops->sync_sg_for_cpu(hwdev, sg, nelems, direction);
+       flush_write_buffers();
+}
+
+static inline void
+dma_sync_sg_for_device(struct device *hwdev, struct scatterlist *sg,
+                      int nelems, int direction)
+{
+       BUG_ON(!valid_dma_direction(direction));
+       if (dma_ops->sync_sg_for_device)
+               dma_ops->sync_sg_for_device(hwdev, sg, nelems, direction);
+
+       flush_write_buffers();
+}
+
+static inline dma_addr_t dma_map_page(struct device *dev, struct page *page,
+                                     size_t offset, size_t size,
+                                     int direction)
+{
+       BUG_ON(!valid_dma_direction(direction));
+       return dma_ops->map_single(dev, page_to_phys(page)+offset,
+                                  size, direction);
+}
+
+static inline void dma_unmap_page(struct device *dev, dma_addr_t addr,
+                                 size_t size, int direction)
+{
+       dma_unmap_single(dev, addr, size, direction);
+}
+
+static inline void
+dma_cache_sync(struct device *dev, void *vaddr, size_t size,
+       enum dma_data_direction dir)
+{
+       flush_write_buffers();
+}
+
+static inline int dma_get_cache_alignment(void)
+{
+       /* no easy way to get cache size on all x86, so return the
+        * maximum possible, to be safe */
+       return boot_cpu_data.x86_clflush_size;
+}
+
+#define dma_is_consistent(d, h)        (1)
+
 #ifdef CONFIG_X86_32
-# include "dma-mapping_32.h"
-#else
-# include "dma-mapping_64.h"
+#  define ARCH_HAS_DMA_DECLARE_COHERENT_MEMORY
+struct dma_coherent_mem {
+       void            *virt_base;
+       u32             device_base;
+       int             size;
+       int             flags;
+       unsigned long   *bitmap;
+};
+
+extern int
+dma_declare_coherent_memory(struct device *dev, dma_addr_t bus_addr,
+                           dma_addr_t device_addr, size_t size, int flags);
+
+extern void
+dma_release_declared_memory(struct device *dev);
+
+extern void *
+dma_mark_declared_memory_occupied(struct device *dev,
+                                 dma_addr_t device_addr, size_t size);
+#endif /* CONFIG_X86_32 */
 #endif
diff --git a/include/asm-x86/dma-mapping_32.h b/include/asm-x86/dma-mapping_32.h
deleted file mode 100644 (file)
index 55f01bd..0000000
+++ /dev/null
@@ -1,187 +0,0 @@
-#ifndef _ASM_I386_DMA_MAPPING_H
-#define _ASM_I386_DMA_MAPPING_H
-
-#include <linux/mm.h>
-#include <linux/scatterlist.h>
-
-#include <asm/cache.h>
-#include <asm/io.h>
-#include <asm/bug.h>
-
-#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f)
-#define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h)
-
-void *dma_alloc_coherent(struct device *dev, size_t size,
-                          dma_addr_t *dma_handle, gfp_t flag);
-
-void dma_free_coherent(struct device *dev, size_t size,
-                        void *vaddr, dma_addr_t dma_handle);
-
-static inline dma_addr_t
-dma_map_single(struct device *dev, void *ptr, size_t size,
-              enum dma_data_direction direction)
-{
-       BUG_ON(!valid_dma_direction(direction));
-       WARN_ON(size == 0);
-       flush_write_buffers();
-       return virt_to_phys(ptr);
-}
-
-static inline void
-dma_unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size,
-                enum dma_data_direction direction)
-{
-       BUG_ON(!valid_dma_direction(direction));
-}
-
-static inline int
-dma_map_sg(struct device *dev, struct scatterlist *sglist, int nents,
-          enum dma_data_direction direction)
-{
-       struct scatterlist *sg;
-       int i;
-
-       BUG_ON(!valid_dma_direction(direction));
-       WARN_ON(nents == 0 || sglist[0].length == 0);
-
-       for_each_sg(sglist, sg, nents, i) {
-               BUG_ON(!sg_page(sg));
-
-               sg->dma_address = sg_phys(sg);
-       }
-
-       flush_write_buffers();
-       return nents;
-}
-
-static inline dma_addr_t
-dma_map_page(struct device *dev, struct page *page, unsigned long offset,
-            size_t size, enum dma_data_direction direction)
-{
-       BUG_ON(!valid_dma_direction(direction));
-       return page_to_phys(page) + offset;
-}
-
-static inline void
-dma_unmap_page(struct device *dev, dma_addr_t dma_address, size_t size,
-              enum dma_data_direction direction)
-{
-       BUG_ON(!valid_dma_direction(direction));
-}
-
-
-static inline void
-dma_unmap_sg(struct device *dev, struct scatterlist *sg, int nhwentries,
-            enum dma_data_direction direction)
-{
-       BUG_ON(!valid_dma_direction(direction));
-}
-
-static inline void
-dma_sync_single_for_cpu(struct device *dev, dma_addr_t dma_handle, size_t size,
-                       enum dma_data_direction direction)
-{
-}
-
-static inline void
-dma_sync_single_for_device(struct device *dev, dma_addr_t dma_handle, size_t size,
-                       enum dma_data_direction direction)
-{
-       flush_write_buffers();
-}
-
-static inline void
-dma_sync_single_range_for_cpu(struct device *dev, dma_addr_t dma_handle,
-                             unsigned long offset, size_t size,
-                             enum dma_data_direction direction)
-{
-}
-
-static inline void
-dma_sync_single_range_for_device(struct device *dev, dma_addr_t dma_handle,
-                                unsigned long offset, size_t size,
-                                enum dma_data_direction direction)
-{
-       flush_write_buffers();
-}
-
-static inline void
-dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg, int nelems,
-                   enum dma_data_direction direction)
-{
-}
-
-static inline void
-dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg, int nelems,
-                   enum dma_data_direction direction)
-{
-       flush_write_buffers();
-}
-
-static inline int
-dma_mapping_error(dma_addr_t dma_addr)
-{
-       return 0;
-}
-
-extern int forbid_dac;
-
-static inline int
-dma_supported(struct device *dev, u64 mask)
-{
-        /*
-         * we fall back to GFP_DMA when the mask isn't all 1s,
-         * so we can't guarantee allocations that must be
-         * within a tighter range than GFP_DMA..
-         */
-        if(mask < 0x00ffffff)
-                return 0;
-
-       /* Work around chipset bugs */
-       if (forbid_dac > 0 && mask > 0xffffffffULL)
-               return 0;
-
-       return 1;
-}
-
-static inline int
-dma_set_mask(struct device *dev, u64 mask)
-{
-       if(!dev->dma_mask || !dma_supported(dev, mask))
-               return -EIO;
-
-       *dev->dma_mask = mask;
-
-       return 0;
-}
-
-static inline int
-dma_get_cache_alignment(void)
-{
-       /* no easy way to get cache size on all x86, so return the
-        * maximum possible, to be safe */
-       return (1 << INTERNODE_CACHE_SHIFT);
-}
-
-#define dma_is_consistent(d, h)        (1)
-
-static inline void
-dma_cache_sync(struct device *dev, void *vaddr, size_t size,
-              enum dma_data_direction direction)
-{
-       flush_write_buffers();
-}
-
-#define ARCH_HAS_DMA_DECLARE_COHERENT_MEMORY
-extern int
-dma_declare_coherent_memory(struct device *dev, dma_addr_t bus_addr,
-                           dma_addr_t device_addr, size_t size, int flags);
-
-extern void
-dma_release_declared_memory(struct device *dev);
-
-extern void *
-dma_mark_declared_memory_occupied(struct device *dev,
-                                 dma_addr_t device_addr, size_t size);
-
-#endif
diff --git a/include/asm-x86/dma-mapping_64.h b/include/asm-x86/dma-mapping_64.h
deleted file mode 100644 (file)
index ecd0f61..0000000
+++ /dev/null
@@ -1,202 +0,0 @@
-#ifndef _X8664_DMA_MAPPING_H
-#define _X8664_DMA_MAPPING_H 1
-
-/*
- * IOMMU interface. See Documentation/DMA-mapping.txt and DMA-API.txt for
- * documentation.
- */
-
-#include <linux/scatterlist.h>
-#include <asm/io.h>
-#include <asm/swiotlb.h>
-
-struct dma_mapping_ops {
-       int             (*mapping_error)(dma_addr_t dma_addr);
-       void*           (*alloc_coherent)(struct device *dev, size_t size,
-                                dma_addr_t *dma_handle, gfp_t gfp);
-       void            (*free_coherent)(struct device *dev, size_t size,
-                                void *vaddr, dma_addr_t dma_handle);
-       dma_addr_t      (*map_single)(struct device *hwdev, void *ptr,
-                                size_t size, int direction);
-       /* like map_single, but doesn't check the device mask */
-       dma_addr_t      (*map_simple)(struct device *hwdev, char *ptr,
-                                size_t size, int direction);
-       void            (*unmap_single)(struct device *dev, dma_addr_t addr,
-                               size_t size, int direction);
-       void            (*sync_single_for_cpu)(struct device *hwdev,
-                               dma_addr_t dma_handle, size_t size,
-                               int direction);
-       void            (*sync_single_for_device)(struct device *hwdev,
-                                dma_addr_t dma_handle, size_t size,
-                               int direction);
-       void            (*sync_single_range_for_cpu)(struct device *hwdev,
-                                dma_addr_t dma_handle, unsigned long offset,
-                               size_t size, int direction);
-       void            (*sync_single_range_for_device)(struct device *hwdev,
-                               dma_addr_t dma_handle, unsigned long offset,
-                               size_t size, int direction);
-       void            (*sync_sg_for_cpu)(struct device *hwdev,
-                                struct scatterlist *sg, int nelems,
-                               int direction);
-       void            (*sync_sg_for_device)(struct device *hwdev,
-                               struct scatterlist *sg, int nelems,
-                               int direction);
-       int             (*map_sg)(struct device *hwdev, struct scatterlist *sg,
-                               int nents, int direction);
-       void            (*unmap_sg)(struct device *hwdev,
-                               struct scatterlist *sg, int nents,
-                               int direction);
-       int             (*dma_supported)(struct device *hwdev, u64 mask);
-       int             is_phys;
-};
-
-extern dma_addr_t bad_dma_address;
-extern const struct dma_mapping_ops* dma_ops;
-extern int iommu_merge;
-
-static inline int dma_mapping_error(dma_addr_t dma_addr)
-{
-       if (dma_ops->mapping_error)
-               return dma_ops->mapping_error(dma_addr);
-
-       return (dma_addr == bad_dma_address);
-}
-
-#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f)
-#define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h)
-
-#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f)
-#define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h)
-
-extern void *dma_alloc_coherent(struct device *dev, size_t size,
-                               dma_addr_t *dma_handle, gfp_t gfp);
-extern void dma_free_coherent(struct device *dev, size_t size, void *vaddr,
-                             dma_addr_t dma_handle);
-
-static inline dma_addr_t
-dma_map_single(struct device *hwdev, void *ptr, size_t size,
-              int direction)
-{
-       BUG_ON(!valid_dma_direction(direction));
-       return dma_ops->map_single(hwdev, ptr, size, direction);
-}
-
-static inline void
-dma_unmap_single(struct device *dev, dma_addr_t addr,size_t size,
-                int direction)
-{
-       BUG_ON(!valid_dma_direction(direction));
-       dma_ops->unmap_single(dev, addr, size, direction);
-}
-
-#define dma_map_page(dev,page,offset,size,dir) \
-       dma_map_single((dev), page_address(page)+(offset), (size), (dir))
-
-#define dma_unmap_page dma_unmap_single
-
-static inline void
-dma_sync_single_for_cpu(struct device *hwdev, dma_addr_t dma_handle,
-                       size_t size, int direction)
-{
-       BUG_ON(!valid_dma_direction(direction));
-       if (dma_ops->sync_single_for_cpu)
-               dma_ops->sync_single_for_cpu(hwdev, dma_handle, size,
-                                            direction);
-       flush_write_buffers();
-}
-
-static inline void
-dma_sync_single_for_device(struct device *hwdev, dma_addr_t dma_handle,
-                          size_t size, int direction)
-{
-       BUG_ON(!valid_dma_direction(direction));
-       if (dma_ops->sync_single_for_device)
-               dma_ops->sync_single_for_device(hwdev, dma_handle, size,
-                                               direction);
-       flush_write_buffers();
-}
-
-static inline void
-dma_sync_single_range_for_cpu(struct device *hwdev, dma_addr_t dma_handle,
-                             unsigned long offset, size_t size, int direction)
-{
-       BUG_ON(!valid_dma_direction(direction));
-       if (dma_ops->sync_single_range_for_cpu) {
-               dma_ops->sync_single_range_for_cpu(hwdev, dma_handle, offset, size, direction);
-       }
-
-       flush_write_buffers();
-}
-
-static inline void
-dma_sync_single_range_for_device(struct device *hwdev, dma_addr_t dma_handle,
-                                unsigned long offset, size_t size, int direction)
-{
-       BUG_ON(!valid_dma_direction(direction));
-       if (dma_ops->sync_single_range_for_device)
-               dma_ops->sync_single_range_for_device(hwdev, dma_handle,
-                                                     offset, size, direction);
-
-       flush_write_buffers();
-}
-
-static inline void
-dma_sync_sg_for_cpu(struct device *hwdev, struct scatterlist *sg,
-                   int nelems, int direction)
-{
-       BUG_ON(!valid_dma_direction(direction));
-       if (dma_ops->sync_sg_for_cpu)
-               dma_ops->sync_sg_for_cpu(hwdev, sg, nelems, direction);
-       flush_write_buffers();
-}
-
-static inline void
-dma_sync_sg_for_device(struct device *hwdev, struct scatterlist *sg,
-                      int nelems, int direction)
-{
-       BUG_ON(!valid_dma_direction(direction));
-       if (dma_ops->sync_sg_for_device) {
-               dma_ops->sync_sg_for_device(hwdev, sg, nelems, direction);
-       }
-
-       flush_write_buffers();
-}
-
-static inline int
-dma_map_sg(struct device *hwdev, struct scatterlist *sg, int nents, int direction)
-{
-       BUG_ON(!valid_dma_direction(direction));
-       return dma_ops->map_sg(hwdev, sg, nents, direction);
-}
-
-static inline void
-dma_unmap_sg(struct device *hwdev, struct scatterlist *sg, int nents,
-            int direction)
-{
-       BUG_ON(!valid_dma_direction(direction));
-       dma_ops->unmap_sg(hwdev, sg, nents, direction);
-}
-
-extern int dma_supported(struct device *hwdev, u64 mask);
-
-/* same for gart, swiotlb, and nommu */
-static inline int dma_get_cache_alignment(void)
-{
-       return boot_cpu_data.x86_clflush_size;
-}
-
-#define dma_is_consistent(d, h) 1
-
-extern int dma_set_mask(struct device *dev, u64 mask);
-
-static inline void
-dma_cache_sync(struct device *dev, void *vaddr, size_t size,
-       enum dma_data_direction dir)
-{
-       flush_write_buffers();
-}
-
-extern struct device fallback_dev;
-extern int panic_on_overflow;
-
-#endif /* _X8664_DMA_MAPPING_H */
index 43b1a8bd4b349c15694cd4d490e793b8b40c340e..a9f7c6ec32bf7ecad8041a7db1af54c4f2a47393 100644 (file)
@@ -24,7 +24,7 @@ extern void update_e820(void);
 extern int e820_all_mapped(unsigned long start, unsigned long end,
                           unsigned type);
 extern int e820_any_mapped(u64 start, u64 end, unsigned type);
-extern void find_max_pfn(void);
+extern void propagate_e820_map(void);
 extern void register_bootmem_low_pages(unsigned long max_low_pfn);
 extern void add_memory_region(unsigned long long start,
                              unsigned long long size, int type);
index f1b96932746be9ec9de3fd6b37d3f6b49adaf9e3..b02ea6e17de8b6a097c722f28d2c726f5e39514d 100644 (file)
@@ -117,6 +117,7 @@ extern struct genapic *genapic;
 enum uv_system_type {UV_NONE, UV_LEGACY_APIC, UV_X2APIC, UV_NON_UNIQUE_APIC};
 #define get_uv_system_type()           UV_NONE
 #define is_uv_system()                 0
+#define uv_wakeup_secondary(a, b)      1
 
 
 #endif
index 54522b814f1c796e36f30c65632b30a35eb8d1a8..da2adb45f6e3949476ac0a4d2c1aa1cbb2024986 100644 (file)
@@ -21,8 +21,9 @@
 
 extern void fpu_init(void);
 extern void mxcsr_feature_mask_init(void);
-extern void init_fpu(struct task_struct *child);
+extern int init_fpu(struct task_struct *child);
 extern asmlinkage void math_state_restore(void);
+extern void init_thread_xstate(void);
 
 extern user_regset_active_fn fpregs_active, xfpregs_active;
 extern user_regset_get_fn fpregs_get, xfpregs_get, fpregs_soft_get;
@@ -117,24 +118,22 @@ static inline void __save_init_fpu(struct task_struct *tsk)
        /* Using "fxsaveq %0" would be the ideal choice, but is only supported
           starting with gas 2.16. */
        __asm__ __volatile__("fxsaveq %0"
-                            : "=m" (tsk->thread.i387.fxsave));
+                            : "=m" (tsk->thread.xstate->fxsave));
 #elif 0
        /* Using, as a workaround, the properly prefixed form below isn't
           accepted by any binutils version so far released, complaining that
           the same type of prefix is used twice if an extended register is
           needed for addressing (fix submitted to mainline 2005-11-21). */
        __asm__ __volatile__("rex64/fxsave %0"
-                            : "=m" (tsk->thread.i387.fxsave));
+                            : "=m" (tsk->thread.xstate->fxsave));
 #else
        /* This, however, we can work around by forcing the compiler to select
           an addressing mode that doesn't require extended registers. */
-       __asm__ __volatile__("rex64/fxsave %P2(%1)"
-                            : "=m" (tsk->thread.i387.fxsave)
-                            : "cdaSDb" (tsk),
-                               "i" (offsetof(__typeof__(*tsk),
-                                             thread.i387.fxsave)));
+       __asm__ __volatile__("rex64/fxsave (%1)"
+                            : "=m" (tsk->thread.xstate->fxsave)
+                            : "cdaSDb" (&tsk->thread.xstate->fxsave));
 #endif
-       clear_fpu_state(&tsk->thread.i387.fxsave);
+       clear_fpu_state(&tsk->thread.xstate->fxsave);
        task_thread_info(tsk)->status &= ~TS_USEDFPU;
 }
 
@@ -148,7 +147,7 @@ static inline int save_i387(struct _fpstate __user *buf)
        int err = 0;
 
        BUILD_BUG_ON(sizeof(struct user_i387_struct) !=
-                       sizeof(tsk->thread.i387.fxsave));
+                       sizeof(tsk->thread.xstate->fxsave));
 
        if ((unsigned long)buf % 16)
                printk("save_i387: bad fpstate %p\n", buf);
@@ -164,7 +163,7 @@ static inline int save_i387(struct _fpstate __user *buf)
                task_thread_info(tsk)->status &= ~TS_USEDFPU;
                stts();
        } else {
-               if (__copy_to_user(buf, &tsk->thread.i387.fxsave,
+               if (__copy_to_user(buf, &tsk->thread.xstate->fxsave,
                                   sizeof(struct i387_fxsave_struct)))
                        return -1;
        }
@@ -201,7 +200,7 @@ static inline void restore_fpu(struct task_struct *tsk)
                "nop ; frstor %1",
                "fxrstor %1",
                X86_FEATURE_FXSR,
-               "m" ((tsk)->thread.i387.fxsave));
+               "m" (tsk->thread.xstate->fxsave));
 }
 
 /* We need a safe address that is cheap to find and that is already
@@ -225,8 +224,8 @@ static inline void __save_init_fpu(struct task_struct *tsk)
                "fxsave %[fx]\n"
                "bt $7,%[fsw] ; jnc 1f ; fnclex\n1:",
                X86_FEATURE_FXSR,
-               [fx] "m" (tsk->thread.i387.fxsave),
-               [fsw] "m" (tsk->thread.i387.fxsave.swd) : "memory");
+               [fx] "m" (tsk->thread.xstate->fxsave),
+               [fsw] "m" (tsk->thread.xstate->fxsave.swd) : "memory");
        /* AMD K7/K8 CPUs don't save/restore FDP/FIP/FOP unless an exception
           is pending.  Clear the x87 state here by setting it to fixed
           values. safe_address is a random variable that should be in L1 */
@@ -327,25 +326,25 @@ static inline void clear_fpu(struct task_struct *tsk)
 static inline unsigned short get_fpu_cwd(struct task_struct *tsk)
 {
        if (cpu_has_fxsr) {
-               return tsk->thread.i387.fxsave.cwd;
+               return tsk->thread.xstate->fxsave.cwd;
        } else {
-               return (unsigned short)tsk->thread.i387.fsave.cwd;
+               return (unsigned short)tsk->thread.xstate->fsave.cwd;
        }
 }
 
 static inline unsigned short get_fpu_swd(struct task_struct *tsk)
 {
        if (cpu_has_fxsr) {
-               return tsk->thread.i387.fxsave.swd;
+               return tsk->thread.xstate->fxsave.swd;
        } else {
-               return (unsigned short)tsk->thread.i387.fsave.swd;
+               return (unsigned short)tsk->thread.xstate->fsave.swd;
        }
 }
 
 static inline unsigned short get_fpu_mxcsr(struct task_struct *tsk)
 {
        if (cpu_has_xmm) {
-               return tsk->thread.i387.fxsave.mxcsr;
+               return tsk->thread.xstate->fxsave.mxcsr;
        } else {
                return MXCSR_DEFAULT;
        }
index 32c22ae0709f1c13236b6fe31fb22734ba70a7cd..22e87c9f6a80551be4ed7108a87a83e4551a15ab 100644 (file)
@@ -9,7 +9,8 @@ struct bootnode {
        u64 end;
 };
 
-extern int compute_hash_shift(struct bootnode *nodes, int numnodes);
+extern int compute_hash_shift(struct bootnode *nodes, int numblks,
+                             int *nodeids);
 
 #define ZONE_ALIGN (1UL << (MAX_ORDER+PAGE_SHIFT))
 
index df867e5d80b197a220c8cd84967a8adf9b6c88db..f330234ffa5c568888aeabf92c1e7a49d91335dc 100644 (file)
@@ -22,6 +22,7 @@ extern int (*pci_config_read)(int seg, int bus, int dev, int fn,
 extern int (*pci_config_write)(int seg, int bus, int dev, int fn,
                               int reg, int len, u32 value);
 
+extern void dma32_reserve_bootmem(void);
 extern void pci_iommu_alloc(void);
 
 /* The PCI address space does equal the physical memory
index 6e26c7c717a23a15255869f2b864350faf21d597..e6bf92ddeb21ded7de69cff3f37120df56520291 100644 (file)
@@ -354,7 +354,7 @@ struct i387_soft_struct {
        u32                     entry_eip;
 };
 
-union i387_union {
+union thread_xstate {
        struct i387_fsave_struct        fsave;
        struct i387_fxsave_struct       fxsave;
        struct i387_soft_struct         soft;
@@ -365,6 +365,9 @@ DECLARE_PER_CPU(struct orig_ist, orig_ist);
 #endif
 
 extern void print_cpu_info(struct cpuinfo_x86 *);
+extern unsigned int xstate_size;
+extern void free_thread_xstate(struct task_struct *);
+extern struct kmem_cache *task_xstate_cachep;
 extern void init_scattered_cpuid_features(struct cpuinfo_x86 *c);
 extern unsigned int init_intel_cacheinfo(struct cpuinfo_x86 *c);
 extern unsigned short num_cache_leaves;
@@ -397,8 +400,8 @@ struct thread_struct {
        unsigned long           cr2;
        unsigned long           trap_no;
        unsigned long           error_code;
-       /* Floating point info: */
-       union i387_union        i387 __attribute__((aligned(16)));;
+       /* floating point and extended processor state */
+       union thread_xstate     *xstate;
 #ifdef CONFIG_X86_32
        /* Virtual 86 mode info */
        struct vm86_struct __user *vm86_info;
@@ -918,4 +921,11 @@ extern void start_thread(struct pt_regs *regs, unsigned long new_ip,
 
 #define KSTK_EIP(task)         (task_pt_regs(task)->ip)
 
+/* Get/set a process' ability to use the timestamp counter instruction */
+#define GET_TSC_CTL(adr)       get_tsc_mode((adr))
+#define SET_TSC_CTL(val)       set_tsc_mode((val))
+
+extern int get_tsc_mode(unsigned long adr);
+extern int set_tsc_mode(unsigned int val);
+
 #endif
index d13c197866d627daa572c6928034e639dc2b17f2..c0432061f81a0f0609e8b115e3c23e4ff6cdcbb4 100644 (file)
@@ -11,9 +11,7 @@ struct scatterlist {
        unsigned int    offset;
        unsigned int    length;
        dma_addr_t      dma_address;
-#ifdef CONFIG_X86_64
        unsigned int    dma_length;
-#endif
 };
 
 #define ARCH_HAS_SG_CHAIN
index d5fd12f2abdbb141668c205dd424de8c91de90e4..77244f17993f303d8e80e8af7b0f71e50e69f0a7 100644 (file)
@@ -1,5 +1,14 @@
+#ifndef _ASM_X86_THREAD_INFO_H
 #ifdef CONFIG_X86_32
 # include "thread_info_32.h"
 #else
 # include "thread_info_64.h"
 #endif
+
+#ifndef __ASSEMBLY__
+extern void arch_task_cache_init(void);
+extern void free_thread_info(struct thread_info *ti);
+extern int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src);
+#define arch_task_cache_init arch_task_cache_init
+#endif
+#endif /* _ASM_X86_THREAD_INFO_H */
index 4e053fa561a9c5e643336d10e68d835e8863e1b8..53185996209664c82588904ca3429844696ab9b2 100644 (file)
@@ -102,8 +102,6 @@ static inline struct thread_info *current_thread_info(void)
        __get_free_pages(GFP_KERNEL, get_order(THREAD_SIZE)))
 #endif
 
-#define free_thread_info(info) free_pages((unsigned long)(info), get_order(THREAD_SIZE))
-
 #else /* !__ASSEMBLY__ */
 
 /* how to get the thread information struct from ASM */
index 1e5c6f6152cd109ad2d3f19b2848a2846c0bfbe1..ed664e874decb873d83bad65ba2eb5a549dab69d 100644 (file)
@@ -85,8 +85,6 @@ static inline struct thread_info *stack_thread_info(void)
 #define alloc_thread_info(tsk)                                         \
        ((struct thread_info *)__get_free_pages(THREAD_FLAGS, THREAD_ORDER))
 
-#define free_thread_info(ti) free_pages((unsigned long) (ti), THREAD_ORDER)
-
 #else /* !__ASSEMBLY__ */
 
 /* how to get the thread information struct from ASM */
@@ -126,6 +124,7 @@ static inline struct thread_info *stack_thread_info(void)
 #define TIF_DEBUGCTLMSR                25      /* uses thread_struct.debugctlmsr */
 #define TIF_DS_AREA_MSR                26      /* uses thread_struct.ds_area_msr */
 #define TIF_BTS_TRACE_TS       27      /* record scheduling event timestamps */
+#define TIF_NOTSC              28      /* TSC is not accessible in userland */
 
 #define _TIF_SYSCALL_TRACE     (1 << TIF_SYSCALL_TRACE)
 #define _TIF_SIGPENDING                (1 << TIF_SIGPENDING)
@@ -147,6 +146,7 @@ static inline struct thread_info *stack_thread_info(void)
 #define _TIF_DEBUGCTLMSR       (1 << TIF_DEBUGCTLMSR)
 #define _TIF_DS_AREA_MSR       (1 << TIF_DS_AREA_MSR)
 #define _TIF_BTS_TRACE_TS      (1 << TIF_BTS_TRACE_TS)
+#define _TIF_NOTSC             (1 << TIF_NOTSC)
 
 /* work to do on interrupt/exception return */
 #define _TIF_WORK_MASK                                                 \
@@ -160,7 +160,7 @@ static inline struct thread_info *stack_thread_info(void)
 
 /* flags to check in __switch_to() */
 #define _TIF_WORK_CTXSW                                                        \
-       (_TIF_IO_BITMAP|_TIF_DEBUGCTLMSR|_TIF_DS_AREA_MSR|_TIF_BTS_TRACE_TS)
+       (_TIF_IO_BITMAP|_TIF_DEBUGCTLMSR|_TIF_DS_AREA_MSR|_TIF_BTS_TRACE_TS|_TIF_NOTSC)
 #define _TIF_WORK_CTXSW_PREV _TIF_WORK_CTXSW
 #define _TIF_WORK_CTXSW_NEXT (_TIF_WORK_CTXSW|_TIF_DEBUG)
 
index 81a29eb08ac4113f5a5f5d57752fef9b390ae153..22073268b4814ec97a7ddab151e01c1807eabcc8 100644 (file)
@@ -88,6 +88,17 @@ static inline int cpu_to_node(int cpu)
 #endif
        return per_cpu(x86_cpu_to_node_map, cpu);
 }
+
+#ifdef CONFIG_NUMA
+
+/* Returns a pointer to the cpumask of CPUs on Node 'node'. */
+#define node_to_cpumask_ptr(v, node)           \
+               cpumask_t *v = &(node_to_cpumask_map[node])
+
+#define node_to_cpumask_ptr_next(v, node)      \
+                          v = &(node_to_cpumask_map[node])
+#endif
+
 #endif /* CONFIG_X86_64 */
 
 /*
@@ -136,17 +147,13 @@ extern unsigned long node_remap_size[];
 
 # define SD_CACHE_NICE_TRIES   2
 # define SD_IDLE_IDX           2
-# define SD_NEWIDLE_IDX                0
+# define SD_NEWIDLE_IDX                2
 # define SD_FORKEXEC_IDX       1
 
 #endif
 
 /* sched_domains SD_NODE_INIT for NUMAQ machines */
 #define SD_NODE_INIT (struct sched_domain) {           \
-       .span                   = CPU_MASK_NONE,        \
-       .parent                 = NULL,                 \
-       .child                  = NULL,                 \
-       .groups                 = NULL,                 \
        .min_interval           = 8,                    \
        .max_interval           = 32,                   \
        .busy_factor            = 32,                   \
@@ -164,7 +171,6 @@ extern unsigned long node_remap_size[];
                                | SD_WAKE_BALANCE,      \
        .last_balance           = jiffies,              \
        .balance_interval       = 1,                    \
-       .nr_balance_failed      = 0,                    \
 }
 
 #ifdef CONFIG_X86_64_ACPI_NUMA
@@ -174,10 +180,10 @@ extern int __node_distance(int, int);
 
 #else /* CONFIG_NUMA */
 
-#include <asm-generic/topology.h>
-
 #endif
 
+#include <asm-generic/topology.h>
+
 extern cpumask_t cpu_coregroup_map(int cpu);
 
 #ifdef ENABLE_TOPO_DEFINES
index d2d8eb5b55f532365f9277b5f776109626f7ed4b..0434bd8349a7456f27f8ca95c18b472e07c1ba8e 100644 (file)
@@ -18,6 +18,7 @@ extern unsigned int cpu_khz;
 extern unsigned int tsc_khz;
 
 extern void disable_TSC(void);
+extern void enable_TSC(void);
 
 static inline cycles_t get_cycles(void)
 {
index b856a2a590d96c8b376b3c2ebcdb3f0fbc6be022..9a26c83a2c9e98cdb6d70f74856f22b58db518b5 100644 (file)
@@ -27,7 +27,10 @@ extern int __devexit __pata_platform_remove(struct device *dev);
 /*
  * Marvell SATA private data
  */
+struct mbus_dram_target_info;
+
 struct mv_sata_platform_data {
+       struct mbus_dram_target_info    *dram;
        int     n_ports; /* number of sata ports */
 };
 
diff --git a/include/linux/atmel_tc.h b/include/linux/atmel_tc.h
new file mode 100644 (file)
index 0000000..53ba65e
--- /dev/null
@@ -0,0 +1,252 @@
+/*
+ * Timer/Counter Unit (TC) registers.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ */
+
+#ifndef ATMEL_TC_H
+#define ATMEL_TC_H
+
+#include <linux/compiler.h>
+#include <linux/list.h>
+
+/*
+ * Many 32-bit Atmel SOCs include one or more TC blocks, each of which holds
+ * three general-purpose 16-bit timers.  These timers share one register bank.
+ * Depending on the SOC, each timer may have its own clock and IRQ, or those
+ * may be shared by the whole TC block.
+ *
+ * These TC blocks may have up to nine external pins:  TCLK0..2 signals for
+ * clocks or clock gates, and per-timer TIOA and TIOB signals used for PWM
+ * or triggering.  Those pins need to be set up for use with the TC block,
+ * else they will be used as GPIOs or for a different controller.
+ *
+ * Although we expect each TC block to have a platform_device node, those
+ * nodes are not what drivers bind to.  Instead, they ask for a specific
+ * TC block, by number ... which is a common approach on systems with many
+ * timers.  Then they use clk_get() and platform_get_irq() to get clock and
+ * IRQ resources.
+ */
+
+struct clk;
+
+/**
+ * struct atmel_tc - information about a Timer/Counter Block
+ * @pdev: physical device
+ * @iomem: resource associated with the I/O register
+ * @regs: mapping through which the I/O registers can be accessed
+ * @irq: irq for each of the three channels
+ * @clk: internal clock source for each of the three channels
+ * @node: list node, for tclib internal use
+ *
+ * On some platforms, each TC channel has its own clocks and IRQs,
+ * while on others, all TC channels share the same clock and IRQ.
+ * Drivers should clk_enable() all the clocks they need even though
+ * all the entries in @clk may point to the same physical clock.
+ * Likewise, drivers should request irqs independently for each
+ * channel, but they must use IRQF_SHARED in case some of the entries
+ * in @irq are actually the same IRQ.
+ */
+struct atmel_tc {
+       struct platform_device  *pdev;
+       struct resource         *iomem;
+       void __iomem            *regs;
+       int                     irq[3];
+       struct clk              *clk[3];
+       struct list_head        node;
+};
+
+extern struct atmel_tc *atmel_tc_alloc(unsigned block, const char *name);
+extern void atmel_tc_free(struct atmel_tc *tc);
+
+/* platform-specific ATMEL_TC_TIMER_CLOCKx divisors (0 means 32KiHz) */
+extern const u8 atmel_tc_divisors[5];
+
+
+/*
+ * Two registers have block-wide controls.  These are: configuring the three
+ * "external" clocks (or event sources) used by the timer channels; and
+ * synchronizing the timers by resetting them all at once.
+ *
+ * "External" can mean "external to chip" using the TCLK0, TCLK1, or TCLK2
+ * signals.  Or, it can mean "external to timer", using the TIOA output from
+ * one of the other two timers that's being run in waveform mode.
+ */
+
+#define ATMEL_TC_BCR   0xc0            /* TC Block Control Register */
+#define     ATMEL_TC_SYNC      (1 << 0)        /* synchronize timers */
+
+#define ATMEL_TC_BMR   0xc4            /* TC Block Mode Register */
+#define     ATMEL_TC_TC0XC0S   (3 << 0)        /* external clock 0 source */
+#define        ATMEL_TC_TC0XC0S_TCLK0  (0 << 0)
+#define        ATMEL_TC_TC0XC0S_NONE   (1 << 0)
+#define        ATMEL_TC_TC0XC0S_TIOA1  (2 << 0)
+#define        ATMEL_TC_TC0XC0S_TIOA2  (3 << 0)
+#define     ATMEL_TC_TC1XC1S   (3 << 2)        /* external clock 1 source */
+#define        ATMEL_TC_TC1XC1S_TCLK1  (0 << 2)
+#define        ATMEL_TC_TC1XC1S_NONE   (1 << 2)
+#define        ATMEL_TC_TC1XC1S_TIOA0  (2 << 2)
+#define        ATMEL_TC_TC1XC1S_TIOA2  (3 << 2)
+#define     ATMEL_TC_TC2XC2S   (3 << 4)        /* external clock 2 source */
+#define        ATMEL_TC_TC2XC2S_TCLK2  (0 << 4)
+#define        ATMEL_TC_TC2XC2S_NONE   (1 << 4)
+#define        ATMEL_TC_TC2XC2S_TIOA0  (2 << 4)
+#define        ATMEL_TC_TC2XC2S_TIOA1  (3 << 4)
+
+
+/*
+ * Each TC block has three "channels", each with one counter and controls.
+ *
+ * Note that the semantics of ATMEL_TC_TIMER_CLOCKx (input clock selection
+ * when it's not "external") is silicon-specific.  AT91 platforms use one
+ * set of definitions; AVR32 platforms use a different set.  Don't hard-wire
+ * such knowledge into your code, use the global "atmel_tc_divisors" ...
+ * where index N is the divisor for clock N+1, else zero to indicate it uses
+ * the 32 KiHz clock.
+ *
+ * The timers can be chained in various ways, and operated in "waveform"
+ * generation mode (including PWM) or "capture" mode (to time events).  In
+ * both modes, behavior can be configured in many ways.
+ *
+ * Each timer has two I/O pins, TIOA and TIOB.  Waveform mode uses TIOA as a
+ * PWM output, and TIOB as either another PWM or as a trigger.  Capture mode
+ * uses them only as inputs.
+ */
+#define ATMEL_TC_CHAN(idx)     ((idx)*0x40)
+#define ATMEL_TC_REG(idx, reg) (ATMEL_TC_CHAN(idx) + ATMEL_TC_ ## reg)
+
+#define ATMEL_TC_CCR   0x00            /* Channel Control Register */
+#define     ATMEL_TC_CLKEN     (1 << 0)        /* clock enable */
+#define     ATMEL_TC_CLKDIS    (1 << 1)        /* clock disable */
+#define     ATMEL_TC_SWTRG     (1 << 2)        /* software trigger */
+
+#define ATMEL_TC_CMR   0x04            /* Channel Mode Register */
+
+/* Both modes share some CMR bits */
+#define     ATMEL_TC_TCCLKS    (7 << 0)        /* clock source */
+#define        ATMEL_TC_TIMER_CLOCK1   (0 << 0)
+#define        ATMEL_TC_TIMER_CLOCK2   (1 << 0)
+#define        ATMEL_TC_TIMER_CLOCK3   (2 << 0)
+#define        ATMEL_TC_TIMER_CLOCK4   (3 << 0)
+#define        ATMEL_TC_TIMER_CLOCK5   (4 << 0)
+#define        ATMEL_TC_XC0            (5 << 0)
+#define        ATMEL_TC_XC1            (6 << 0)
+#define        ATMEL_TC_XC2            (7 << 0)
+#define     ATMEL_TC_CLKI      (1 << 3)        /* clock invert */
+#define     ATMEL_TC_BURST     (3 << 4)        /* clock gating */
+#define        ATMEL_TC_GATE_NONE      (0 << 4)
+#define        ATMEL_TC_GATE_XC0       (1 << 4)
+#define        ATMEL_TC_GATE_XC1       (2 << 4)
+#define        ATMEL_TC_GATE_XC2       (3 << 4)
+#define     ATMEL_TC_WAVE      (1 << 15)       /* true = Waveform mode */
+
+/* CAPTURE mode CMR bits */
+#define     ATMEL_TC_LDBSTOP   (1 << 6)        /* counter stops on RB load */
+#define     ATMEL_TC_LDBDIS    (1 << 7)        /* counter disable on RB load */
+#define     ATMEL_TC_ETRGEDG   (3 << 8)        /* external trigger edge */
+#define        ATMEL_TC_ETRGEDG_NONE   (0 << 8)
+#define        ATMEL_TC_ETRGEDG_RISING (1 << 8)
+#define        ATMEL_TC_ETRGEDG_FALLING        (2 << 8)
+#define        ATMEL_TC_ETRGEDG_BOTH   (3 << 8)
+#define     ATMEL_TC_ABETRG    (1 << 10)       /* external trigger is TIOA? */
+#define     ATMEL_TC_CPCTRG    (1 << 14)       /* RC compare trigger enable */
+#define     ATMEL_TC_LDRA      (3 << 16)       /* RA loading edge (of TIOA) */
+#define        ATMEL_TC_LDRA_NONE      (0 << 16)
+#define        ATMEL_TC_LDRA_RISING    (1 << 16)
+#define        ATMEL_TC_LDRA_FALLING   (2 << 16)
+#define        ATMEL_TC_LDRA_BOTH      (3 << 16)
+#define     ATMEL_TC_LDRB      (3 << 18)       /* RB loading edge (of TIOA) */
+#define        ATMEL_TC_LDRB_NONE      (0 << 18)
+#define        ATMEL_TC_LDRB_RISING    (1 << 18)
+#define        ATMEL_TC_LDRB_FALLING   (2 << 18)
+#define        ATMEL_TC_LDRB_BOTH      (3 << 18)
+
+/* WAVEFORM mode CMR bits */
+#define     ATMEL_TC_CPCSTOP   (1 <<  6)       /* RC compare stops counter */
+#define     ATMEL_TC_CPCDIS    (1 <<  7)       /* RC compare disables counter */
+#define     ATMEL_TC_EEVTEDG   (3 <<  8)       /* external event edge */
+#define        ATMEL_TC_EEVTEDG_NONE   (0 << 8)
+#define        ATMEL_TC_EEVTEDG_RISING (1 << 8)
+#define        ATMEL_TC_EEVTEDG_FALLING        (2 << 8)
+#define        ATMEL_TC_EEVTEDG_BOTH   (3 << 8)
+#define     ATMEL_TC_EEVT      (3 << 10)       /* external event source */
+#define        ATMEL_TC_EEVT_TIOB      (0 << 10)
+#define        ATMEL_TC_EEVT_XC0       (1 << 10)
+#define        ATMEL_TC_EEVT_XC1       (2 << 10)
+#define        ATMEL_TC_EEVT_XC2       (3 << 10)
+#define     ATMEL_TC_ENETRG    (1 << 12)       /* external event is trigger */
+#define     ATMEL_TC_WAVESEL   (3 << 13)       /* waveform type */
+#define        ATMEL_TC_WAVESEL_UP     (0 << 13)
+#define        ATMEL_TC_WAVESEL_UPDOWN (1 << 13)
+#define        ATMEL_TC_WAVESEL_UP_AUTO        (2 << 13)
+#define        ATMEL_TC_WAVESEL_UPDOWN_AUTO (3 << 13)
+#define     ATMEL_TC_ACPA      (3 << 16)       /* RA compare changes TIOA */
+#define        ATMEL_TC_ACPA_NONE      (0 << 16)
+#define        ATMEL_TC_ACPA_SET       (1 << 16)
+#define        ATMEL_TC_ACPA_CLEAR     (2 << 16)
+#define        ATMEL_TC_ACPA_TOGGLE    (3 << 16)
+#define     ATMEL_TC_ACPC      (3 << 18)       /* RC compare changes TIOA */
+#define        ATMEL_TC_ACPC_NONE      (0 << 18)
+#define        ATMEL_TC_ACPC_SET       (1 << 18)
+#define        ATMEL_TC_ACPC_CLEAR     (2 << 18)
+#define        ATMEL_TC_ACPC_TOGGLE    (3 << 18)
+#define     ATMEL_TC_AEEVT     (3 << 20)       /* external event changes TIOA */
+#define        ATMEL_TC_AEEVT_NONE     (0 << 20)
+#define        ATMEL_TC_AEEVT_SET      (1 << 20)
+#define        ATMEL_TC_AEEVT_CLEAR    (2 << 20)
+#define        ATMEL_TC_AEEVT_TOGGLE   (3 << 20)
+#define     ATMEL_TC_ASWTRG    (3 << 22)       /* software trigger changes TIOA */
+#define        ATMEL_TC_ASWTRG_NONE    (0 << 22)
+#define        ATMEL_TC_ASWTRG_SET     (1 << 22)
+#define        ATMEL_TC_ASWTRG_CLEAR   (2 << 22)
+#define        ATMEL_TC_ASWTRG_TOGGLE  (3 << 22)
+#define     ATMEL_TC_BCPB      (3 << 24)       /* RB compare changes TIOB */
+#define        ATMEL_TC_BCPB_NONE      (0 << 24)
+#define        ATMEL_TC_BCPB_SET       (1 << 24)
+#define        ATMEL_TC_BCPB_CLEAR     (2 << 24)
+#define        ATMEL_TC_BCPB_TOGGLE    (3 << 24)
+#define     ATMEL_TC_BCPC      (3 << 26)       /* RC compare changes TIOB */
+#define        ATMEL_TC_BCPC_NONE      (0 << 26)
+#define        ATMEL_TC_BCPC_SET       (1 << 26)
+#define        ATMEL_TC_BCPC_CLEAR     (2 << 26)
+#define        ATMEL_TC_BCPC_TOGGLE    (3 << 26)
+#define     ATMEL_TC_BEEVT     (3 << 28)       /* external event changes TIOB */
+#define        ATMEL_TC_BEEVT_NONE     (0 << 28)
+#define        ATMEL_TC_BEEVT_SET      (1 << 28)
+#define        ATMEL_TC_BEEVT_CLEAR    (2 << 28)
+#define        ATMEL_TC_BEEVT_TOGGLE   (3 << 28)
+#define     ATMEL_TC_BSWTRG    (3 << 30)       /* software trigger changes TIOB */
+#define        ATMEL_TC_BSWTRG_NONE    (0 << 30)
+#define        ATMEL_TC_BSWTRG_SET     (1 << 30)
+#define        ATMEL_TC_BSWTRG_CLEAR   (2 << 30)
+#define        ATMEL_TC_BSWTRG_TOGGLE  (3 << 30)
+
+#define ATMEL_TC_CV    0x10            /* counter Value */
+#define ATMEL_TC_RA    0x14            /* register A */
+#define ATMEL_TC_RB    0x18            /* register B */
+#define ATMEL_TC_RC    0x1c            /* register C */
+
+#define ATMEL_TC_SR    0x20            /* status (read-only) */
+/* Status-only flags */
+#define     ATMEL_TC_CLKSTA    (1 << 16)       /* clock enabled */
+#define     ATMEL_TC_MTIOA     (1 << 17)       /* TIOA mirror */
+#define     ATMEL_TC_MTIOB     (1 << 18)       /* TIOB mirror */
+
+#define ATMEL_TC_IER   0x24            /* interrupt enable (write-only) */
+#define ATMEL_TC_IDR   0x28            /* interrupt disable (write-only) */
+#define ATMEL_TC_IMR   0x2c            /* interrupt mask (read-only) */
+
+/* Status and IRQ flags */
+#define     ATMEL_TC_COVFS     (1 <<  0)       /* counter overflow */
+#define     ATMEL_TC_LOVRS     (1 <<  1)       /* load overrun */
+#define     ATMEL_TC_CPAS      (1 <<  2)       /* RA compare */
+#define     ATMEL_TC_CPBS      (1 <<  3)       /* RB compare */
+#define     ATMEL_TC_CPCS      (1 <<  4)       /* RC compare */
+#define     ATMEL_TC_LDRAS     (1 <<  5)       /* RA loading */
+#define     ATMEL_TC_LDRBS     (1 <<  6)       /* RB loading */
+#define     ATMEL_TC_ETRGS     (1 <<  7)       /* external trigger */
+
+#endif
index 574b201b99d8b0f31c268434546c4930ceb94eb7..794ad74b1d61ec51e079e2864217a0dee07c7149 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * class_container.h - a generic container for all classes
+ * attribute_container.h - a generic container for all classes
  *
  * Copyright (c) 2005 - James Bottomley <James.Bottomley@steeleye.com>
  *
@@ -18,7 +18,7 @@ struct attribute_container {
        struct klist            containers;
        struct class            *class;
        struct attribute_group  *grp;
-       struct class_device_attribute **attrs;
+       struct device_attribute **attrs;
        int (*match)(struct attribute_container *, struct device *);
 #define        ATTRIBUTE_CONTAINER_NO_CLASSDEVS        0x01
        unsigned long           flags;
@@ -41,31 +41,31 @@ int __must_check attribute_container_unregister(struct attribute_container *cont
 void attribute_container_create_device(struct device *dev,
                                       int (*fn)(struct attribute_container *,
                                                 struct device *,
-                                                struct class_device *));
+                                                struct device *));
 void attribute_container_add_device(struct device *dev,
                                    int (*fn)(struct attribute_container *,
                                              struct device *,
-                                             struct class_device *));
+                                             struct device *));
 void attribute_container_remove_device(struct device *dev,
                                       void (*fn)(struct attribute_container *,
                                                  struct device *,
-                                                 struct class_device *));
+                                                 struct device *));
 void attribute_container_device_trigger(struct device *dev, 
                                        int (*fn)(struct attribute_container *,
                                                  struct device *,
-                                                 struct class_device *));
+                                                 struct device *));
 void attribute_container_trigger(struct device *dev, 
                                 int (*fn)(struct attribute_container *,
                                           struct device *));
-int attribute_container_add_attrs(struct class_device *classdev);
-int attribute_container_add_class_device(struct class_device *classdev);
+int attribute_container_add_attrs(struct device *classdev);
+int attribute_container_add_class_device(struct device *classdev);
 int attribute_container_add_class_device_adapter(struct attribute_container *cont,
                                                 struct device *dev,
-                                                struct class_device *classdev);
-void attribute_container_remove_attrs(struct class_device *classdev);
-void attribute_container_class_device_del(struct class_device *classdev);
-struct attribute_container *attribute_container_classdev_to_container(struct class_device *);
-struct class_device *attribute_container_find_class_device(struct attribute_container *, struct device *);
-struct class_device_attribute **attribute_container_classdev_to_attrs(const struct class_device *classdev);
+                                                struct device *classdev);
+void attribute_container_remove_attrs(struct device *classdev);
+void attribute_container_class_device_del(struct device *classdev);
+struct attribute_container *attribute_container_classdev_to_container(struct device *);
+struct device *attribute_container_find_class_device(struct attribute_container *, struct device *);
+struct device_attribute **attribute_container_classdev_to_attrs(const struct device *classdev);
 
 #endif
index acad1105d94287af0cba3322e3368efe1b4f38fb..1dbe074f1c645fed22e55484f26cdd90cc325bfb 100644 (file)
@@ -108,6 +108,7 @@ extern int __bitmap_weight(const unsigned long *bitmap, int bits);
 
 extern int bitmap_scnprintf(char *buf, unsigned int len,
                        const unsigned long *src, int nbits);
+extern int bitmap_scnprintf_len(unsigned int len);
 extern int __bitmap_parse(const char *buf, unsigned int buflen, int is_user,
                        unsigned long *dst, int nbits);
 extern int bitmap_parse_user(const char __user *ubuf, unsigned int ulen,
index 60e377b520f8e242c003b2973ac6fc8df4605e40..e8406c55c6d31885a3adddfba69a40378c961c19 100644 (file)
@@ -55,7 +55,7 @@ struct sg_io_v4 {
 
 #if defined(CONFIG_BLK_DEV_BSG)
 struct bsg_class_device {
-       struct class_device *class_dev;
+       struct device *class_dev;
        struct device *dev;
        int minor;
        struct request_queue *queue;
index 0be8d65bc3c8538b62c2f5493dcc8c4008b96a54..f212fa98283e83425ea9db7ee2ba5e3de55e173b 100644 (file)
@@ -23,7 +23,6 @@
 #include <linux/node.h>
 #include <linux/compiler.h>
 #include <linux/cpumask.h>
-#include <asm/semaphore.h>
 #include <linux/mutex.h>
 
 struct cpu {
index 7047f58306a7a24fba73076f255551c59866cc4e..259c8051155d9e34c783f9499b606ac780f8dd84 100644 (file)
@@ -222,8 +222,13 @@ int __next_cpu(int n, const cpumask_t *srcp);
 #define next_cpu(n, src)       ({ (void)(src); 1; })
 #endif
 
+#ifdef CONFIG_HAVE_CPUMASK_OF_CPU_MAP
+extern cpumask_t *cpumask_of_cpu_map;
+#define cpumask_of_cpu(cpu)    (cpumask_of_cpu_map[cpu])
+
+#else
 #define cpumask_of_cpu(cpu)                                            \
-({                                                                     \
+(*({                                                                   \
        typeof(_unused_cpumask_arg_) m;                                 \
        if (sizeof(m) == sizeof(unsigned long)) {                       \
                m.bits[0] = 1UL<<(cpu);                                 \
@@ -231,8 +236,9 @@ int __next_cpu(int n, const cpumask_t *srcp);
                cpus_clear(m);                                          \
                cpu_set((cpu), m);                                      \
        }                                                               \
-       m;                                                              \
-})
+       &m;                                                             \
+}))
+#endif
 
 #define CPU_MASK_LAST_WORD BITMAP_LAST_WORD_MASK(NR_CPUS)
 
@@ -243,6 +249,8 @@ int __next_cpu(int n, const cpumask_t *srcp);
        [BITS_TO_LONGS(NR_CPUS)-1] = CPU_MASK_LAST_WORD                 \
 } }
 
+#define CPU_MASK_ALL_PTR       (&CPU_MASK_ALL)
+
 #else
 
 #define CPU_MASK_ALL                                                   \
@@ -251,6 +259,10 @@ int __next_cpu(int n, const cpumask_t *srcp);
        [BITS_TO_LONGS(NR_CPUS)-1] = CPU_MASK_LAST_WORD                 \
 } }
 
+/* cpu_mask_all is in init/main.c */
+extern cpumask_t cpu_mask_all;
+#define CPU_MASK_ALL_PTR       (&cpu_mask_all)
+
 #endif
 
 #define CPU_MASK_NONE                                                  \
@@ -273,6 +285,13 @@ static inline int __cpumask_scnprintf(char *buf, int len,
        return bitmap_scnprintf(buf, len, srcp->bits, nbits);
 }
 
+#define cpumask_scnprintf_len(len) \
+                       __cpumask_scnprintf_len((len))
+static inline int __cpumask_scnprintf_len(int len)
+{
+       return bitmap_scnprintf_len(len);
+}
+
 #define cpumask_parse_user(ubuf, ulen, dst) \
                        __cpumask_parse_user((ubuf), (ulen), &(dst), NR_CPUS)
 static inline int __cpumask_parse_user(const char __user *buf, int len,
index 0a26be353cb3763c8541ad3594bf6162f1a3b2ec..726761e2400365c1e5dc92d627dee8f2e06c837c 100644 (file)
@@ -20,8 +20,8 @@ extern int number_of_cpusets; /* How many cpusets are defined in system? */
 extern int cpuset_init_early(void);
 extern int cpuset_init(void);
 extern void cpuset_init_smp(void);
-extern cpumask_t cpuset_cpus_allowed(struct task_struct *p);
-extern cpumask_t cpuset_cpus_allowed_locked(struct task_struct *p);
+extern void cpuset_cpus_allowed(struct task_struct *p, cpumask_t *mask);
+extern void cpuset_cpus_allowed_locked(struct task_struct *p, cpumask_t *mask);
 extern nodemask_t cpuset_mems_allowed(struct task_struct *p);
 #define cpuset_current_mems_allowed (current->mems_allowed)
 void cpuset_init_current_mems_allowed(void);
@@ -84,13 +84,14 @@ static inline int cpuset_init_early(void) { return 0; }
 static inline int cpuset_init(void) { return 0; }
 static inline void cpuset_init_smp(void) {}
 
-static inline cpumask_t cpuset_cpus_allowed(struct task_struct *p)
+static inline void cpuset_cpus_allowed(struct task_struct *p, cpumask_t *mask)
 {
-       return cpu_possible_map;
+       *mask = cpu_possible_map;
 }
-static inline cpumask_t cpuset_cpus_allowed_locked(struct task_struct *p)
+static inline void cpuset_cpus_allowed_locked(struct task_struct *p,
+                                                               cpumask_t *mask)
 {
-       return cpu_possible_map;
+       *mask = cpu_possible_map;
 }
 
 static inline nodemask_t cpuset_mems_allowed(struct task_struct *p)
index 2258d89bf5236fed75a7ce231c50fb25c088fb26..1a060265aceae6f31b2875d86f660dc9baaee1ab 100644 (file)
@@ -20,7 +20,7 @@
 #include <linux/types.h>
 #include <linux/module.h>
 #include <linux/pm.h>
-#include <asm/semaphore.h>
+#include <linux/semaphore.h>
 #include <asm/atomic.h>
 #include <asm/device.h>
 
@@ -429,7 +429,6 @@ struct device {
        struct kobject kobj;
        char    bus_id[BUS_ID_SIZE];    /* position on parent bus */
        struct device_type      *type;
-       unsigned                is_registered:1;
        unsigned                uevent_suppress:1;
 
        struct semaphore        sem;    /* semaphore to synchronize calls to
@@ -475,6 +474,9 @@ struct device {
        void    (*release)(struct device *dev);
 };
 
+/* Get the wakeup routines, which depend on struct device */
+#include <linux/pm_wakeup.h>
+
 #ifdef CONFIG_NUMA
 static inline int dev_to_node(struct device *dev)
 {
@@ -506,7 +508,7 @@ static inline void dev_set_drvdata(struct device *dev, void *data)
 
 static inline int device_is_registered(struct device *dev)
 {
-       return dev->is_registered;
+       return dev->kobj.state_in_sysfs;
 }
 
 void driver_init(void);
@@ -543,20 +545,6 @@ extern struct device *device_create(struct class *cls, struct device *parent,
                                    dev_t devt, const char *fmt, ...)
                                    __attribute__((format(printf, 4, 5)));
 extern void device_destroy(struct class *cls, dev_t devt);
-#ifdef CONFIG_PM_SLEEP
-extern void destroy_suspended_device(struct class *cls, dev_t devt);
-extern void device_pm_schedule_removal(struct device *);
-#else /* !CONFIG_PM_SLEEP */
-static inline void destroy_suspended_device(struct class *cls, dev_t devt)
-{
-       device_destroy(cls, devt);
-}
-
-static inline void device_pm_schedule_removal(struct device *dev)
-{
-       device_unregister(dev);
-}
-#endif /* !CONFIG_PM_SLEEP */
 
 /*
  * Platform "fixup" functions - allow the platform to have their say
@@ -608,21 +596,16 @@ extern const char *dev_driver_string(struct device *dev);
 #define dev_dbg(dev, format, arg...)           \
        dev_printk(KERN_DEBUG , dev , format , ## arg)
 #else
-static inline int __attribute__ ((format (printf, 2, 3)))
-dev_dbg(struct device *dev, const char *fmt, ...)
-{
-       return 0;
-}
+#define dev_dbg(dev, format, arg...)           \
+       ({ if (0) dev_printk(KERN_DEBUG, dev, format, ##arg); 0; })
 #endif
 
 #ifdef VERBOSE_DEBUG
 #define dev_vdbg       dev_dbg
 #else
-static inline int __attribute__ ((format (printf, 2, 3)))
-dev_vdbg(struct device *dev, const char *fmt, ...)
-{
-       return 0;
-}
+
+#define dev_vdbg(dev, format, arg...)          \
+       ({ if (0) dev_printk(KERN_DEBUG, dev, format, ##arg); 0; })
 #endif
 
 /* Create alias, so I can be autoloaded. */
index 14813b5958022bbc608430999729b6519a58a246..a5f359a7ad0ef84d2829872f904f50014abe71f9 100644 (file)
@@ -18,6 +18,7 @@
 #include <linux/proc_fs.h>
 #include <linux/rtc.h>
 #include <linux/ioport.h>
+#include <linux/pfn.h>
 
 #include <asm/page.h>
 #include <asm/system.h>
@@ -394,4 +395,10 @@ struct efi_generic_dev_path {
        u16 length;
 } __attribute ((packed));
 
+static inline void memrange_efi_to_native(u64 *addr, u64 *npages)
+{
+       *npages = PFN_UP(*addr + (*npages<<EFI_PAGE_SHIFT)) - PFN_DOWN(*addr);
+       *addr &= PAGE_MASK;
+}
+
 #endif /* _LINUX_EFI_H */
index a5978f18ca403cb653d62eef23b1f1121b5de9a1..4332442b1b5719bd042f3c21c673979ea3b16bc3 100644 (file)
@@ -82,7 +82,8 @@ struct enclosure_component_callbacks {
 
 struct enclosure_component {
        void *scratch;
-       struct class_device cdev;
+       struct device cdev;
+       struct device *dev;
        enum enclosure_component_type type;
        int number;
        int fault;
@@ -94,20 +95,20 @@ struct enclosure_component {
 struct enclosure_device {
        void *scratch;
        struct list_head node;
-       struct class_device cdev;
+       struct device edev;
        struct enclosure_component_callbacks *cb;
        int components;
        struct enclosure_component component[0];
 };
 
 static inline struct enclosure_device *
-to_enclosure_device(struct class_device *dev)
+to_enclosure_device(struct device *dev)
 {
-       return container_of(dev, struct enclosure_device, cdev);
+       return container_of(dev, struct enclosure_device, edev);
 }
 
 static inline struct enclosure_component *
-to_enclosure_component(struct class_device *dev)
+to_enclosure_component(struct device *dev)
 {
        return container_of(dev, struct enclosure_component, cdev);
 }
index 7239baac81a9e29dda405b16116762f260ed95f2..653477021e4c545b9f4dcc983587ceb26eb11eac 100644 (file)
@@ -61,6 +61,7 @@ extern struct kmem_cache *filp_cachep;
 
 extern void __fput(struct file *);
 extern void fput(struct file *);
+extern void drop_file_write_access(struct file *file);
 
 struct file_operations;
 struct vfsmount;
index b84b848431f24a61a37e2d8a535534fcf0681554..0c609e71c3790cdd09ddce6ae51aa61d0d0f5e9a 100644 (file)
@@ -287,9 +287,9 @@ extern int dir_notify_enable;
 #include <linux/pid.h>
 #include <linux/mutex.h>
 #include <linux/capability.h>
+#include <linux/semaphore.h>
 
 #include <asm/atomic.h>
-#include <asm/semaphore.h>
 #include <asm/byteorder.h>
 
 struct export_operations;
@@ -776,6 +776,9 @@ static inline int ra_has_index(struct file_ra_state *ra, pgoff_t index)
                index <  ra->start + ra->size);
 }
 
+#define FILE_MNT_WRITE_TAKEN   1
+#define FILE_MNT_WRITE_RELEASED        2
+
 struct file {
        /*
         * fu_list becomes invalid after file_free is called and queued via
@@ -810,6 +813,9 @@ struct file {
        spinlock_t              f_ep_lock;
 #endif /* #ifdef CONFIG_EPOLL */
        struct address_space    *f_mapping;
+#ifdef CONFIG_DEBUG_WRITECOUNT
+       unsigned long f_mnt_write_state;
+#endif
 };
 extern spinlock_t files_lock;
 #define file_list_lock() spin_lock(&files_lock);
@@ -818,6 +824,49 @@ extern spinlock_t files_lock;
 #define get_file(x)    atomic_inc(&(x)->f_count)
 #define file_count(x)  atomic_read(&(x)->f_count)
 
+#ifdef CONFIG_DEBUG_WRITECOUNT
+static inline void file_take_write(struct file *f)
+{
+       WARN_ON(f->f_mnt_write_state != 0);
+       f->f_mnt_write_state = FILE_MNT_WRITE_TAKEN;
+}
+static inline void file_release_write(struct file *f)
+{
+       f->f_mnt_write_state |= FILE_MNT_WRITE_RELEASED;
+}
+static inline void file_reset_write(struct file *f)
+{
+       f->f_mnt_write_state = 0;
+}
+static inline void file_check_state(struct file *f)
+{
+       /*
+        * At this point, either both or neither of these bits
+        * should be set.
+        */
+       WARN_ON(f->f_mnt_write_state == FILE_MNT_WRITE_TAKEN);
+       WARN_ON(f->f_mnt_write_state == FILE_MNT_WRITE_RELEASED);
+}
+static inline int file_check_writeable(struct file *f)
+{
+       if (f->f_mnt_write_state == FILE_MNT_WRITE_TAKEN)
+               return 0;
+       printk(KERN_WARNING "writeable file with no "
+                           "mnt_want_write()\n");
+       WARN_ON(1);
+       return -EINVAL;
+}
+#else /* !CONFIG_DEBUG_WRITECOUNT */
+static inline void file_take_write(struct file *filp) {}
+static inline void file_release_write(struct file *filp) {}
+static inline void file_reset_write(struct file *filp) {}
+static inline void file_check_state(struct file *filp) {}
+static inline int file_check_writeable(struct file *filp)
+{
+       return 0;
+}
+#endif /* CONFIG_DEBUG_WRITECOUNT */
+
 #define        MAX_NON_LFS     ((1UL<<31) - 1)
 
 /* Page cache limit. The filesystems should put that into their s_maxbytes 
@@ -1735,7 +1784,8 @@ extern struct file *create_read_pipe(struct file *f);
 extern struct file *create_write_pipe(void);
 extern void free_write_pipe(struct file *);
 
-extern int open_namei(int dfd, const char *, int, int, struct nameidata *);
+extern struct file *do_filp_open(int dfd, const char *pathname,
+               int open_flag, int mode);
 extern int may_open(struct nameidata *, int, int);
 
 extern int kernel_read(struct file *, unsigned long, char *, unsigned long);
index 8df29ca48a1347f5e90ecb2da6933c7e05ad1651..394a8405dd74d96c1c09ec269de52457bd685bb0 100644 (file)
@@ -34,7 +34,7 @@
 #include <linux/hil.h>
 #include <linux/time.h>
 #include <linux/interrupt.h>
-#include <asm/semaphore.h>
+#include <linux/semaphore.h>
 #include <linux/serio.h>
 #include <linux/list.h>
 
index 42131820bb892e368aafa15fa557b71274e593f4..85d11916e9ea48a878f54eb3aff5045a8ec2b2c7 100644 (file)
@@ -44,15 +44,7 @@ struct hwrng {
 /** Register a new Hardware Random Number Generator driver. */
 extern int hwrng_register(struct hwrng *rng);
 /** Unregister a Hardware Random Number Generator driver. */
-extern void __hwrng_unregister(struct hwrng *rng, bool suspended);
-static inline void hwrng_unregister(struct hwrng *rng)
-{
-       __hwrng_unregister(rng, false);
-}
-static inline void hwrng_unregister_suspended(struct hwrng *rng)
-{
-       __hwrng_unregister(rng, true);
-}
+extern void hwrng_unregister(struct hwrng *rng);
 
 #endif /* __KERNEL__ */
 #endif /* LINUX_HWRANDOM_H_ */
index 7021635ed6a00163b93e1a8b868eb9c5d3af24c3..918c5354d9b8967825c12882852803b0e6470785 100644 (file)
@@ -152,5 +152,35 @@ extern int tps65010_config_vregs1(unsigned value);
  */
 extern int tps65013_set_low_pwr(unsigned mode);
 
+
+struct i2c_client;
+
+/**
+ * struct tps65010_board - packages GPIO and LED lines
+ * @base: the GPIO number to assign to GPIO-1
+ * @outmask: bit (N-1) is set to allow GPIO-N to be used as an
+ *     (open drain) output
+ * @setup: optional callback issued once the GPIOs are valid
+ * @teardown: optional callback issued before the GPIOs are invalidated
+ * @context: optional parameter passed to setup() and teardown()
+ *
+ * Board data may be used to package the GPIO (and LED) lines for use
+ * in by the generic GPIO and LED frameworks.  The first four GPIOs
+ * starting at gpio_base are GPIO1..GPIO4.  The next two are LED1/nPG
+ * and LED2 (with hardware blinking capability, not currently exposed).
+ *
+ * The @setup callback may be used with the kind of board-specific glue
+ * which hands the (now-valid) GPIOs to other drivers, or which puts
+ * devices in their initial states using these GPIOs.
+ */
+struct tps65010_board {
+       int                             base;
+       unsigned                        outmask;
+
+       int             (*setup)(struct i2c_client *client, void *context);
+       int             (*teardown)(struct i2c_client *client, void *context);
+       void            *context;
+};
+
 #endif /*  __LINUX_I2C_TPS65010_H */
 
index 7da5b98d90e6af4724bacbc074221d300e8fafe1..e92170dda245b3241ef8ae597ace7b43ad2b7f72 100644 (file)
@@ -33,9 +33,9 @@
 #include <linux/mempool.h>
 #include <linux/mutex.h>
 #include <linux/scatterlist.h>
+#include <linux/semaphore.h>   /* Needed for MUTEX init macros */
 
 #include <asm/io.h>
-#include <asm/semaphore.h>     /* Needed for MUTEX init macros */
 
 /* message queue empty */
 #define I2O_QUEUE_EMPTY                0xffffffff
index 6c39482fd1a10e7eb4a7a74c17c3e29a000bfd66..5f3e82ae901a94a54a7e99602dca5f06052191d4 100644 (file)
@@ -23,7 +23,6 @@
 #include <asm/byteorder.h>
 #include <asm/system.h>
 #include <asm/io.h>
-#include <asm/semaphore.h>
 #include <asm/mutex.h>
 
 #if defined(CONFIG_CRIS) || defined(CONFIG_FRV)
index 40743e0328457116f44c8427a686ca740381a3cc..6fb7f1788570dc0a3cd428e5b8518672261819c4 100644 (file)
@@ -24,7 +24,6 @@
 #include <linux/if_ether.h>
 #include <linux/if.h>
 #include <linux/netdevice.h>
-#include <asm/semaphore.h>
 #include <linux/ppp_channel.h>
 #endif /* __KERNEL__ */
 #include <linux/if_pppol2tp.h>
index 1f74e1d7415fe9042e2e71467b40e4a56184ffa8..37a6f5bc4a92ab5262fcb75e161b0de94114b98b 100644 (file)
@@ -151,6 +151,9 @@ extern struct group_info init_groups;
        .cpus_allowed   = CPU_MASK_ALL,                                 \
        .mm             = NULL,                                         \
        .active_mm      = &init_mm,                                     \
+       .se             = {                                             \
+               .group_node     = LIST_HEAD_INIT(tsk.se.group_node),    \
+       },                                                              \
        .rt             = {                                             \
                .run_list       = LIST_HEAD_INIT(tsk.rt.run_list),      \
                .time_slice     = HZ,                                   \
index 412e025bc5c7a6f290d6d665de94d6e6ecf808d4..e600c4e9b8c5b179eebdcaea3769f5bcba49f18a 100644 (file)
 
 #define irqs_disabled()                                                \
 ({                                                             \
-       unsigned long flags;                                    \
+       unsigned long _flags;                                   \
                                                                \
-       raw_local_save_flags(flags);                            \
-       raw_irqs_disabled_flags(flags);                         \
+       raw_local_save_flags(_flags);                           \
+       raw_irqs_disabled_flags(_flags);                        \
 })
 
 #define irqs_disabled_flags(flags)     raw_irqs_disabled_flags(flags)
diff --git a/include/linux/iscsi_ibft.h b/include/linux/iscsi_ibft.h
new file mode 100644 (file)
index 0000000..6092487
--- /dev/null
@@ -0,0 +1,50 @@
+/*
+ *  Copyright 2007 Red Hat, Inc.
+ *  by Peter Jones <pjones@redhat.com>
+ *  Copyright 2007 IBM, Inc.
+ *  by Konrad Rzeszutek <konradr@linux.vnet.ibm.com>
+ *  Copyright 2008
+ *  by Konrad Rzeszutek <ketuzsezr@darnok.org>
+ *
+ * This code exposes the iSCSI Boot Format Table to userland via sysfs.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License v2.0 as published by
+ * the Free Software Foundation
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#ifndef ISCSI_IBFT_H
+#define ISCSI_IBFT_H
+
+struct ibft_table_header {
+       char signature[4];
+       u32 length;
+       u8 revision;
+       u8 checksum;
+       char oem_id[6];
+       char oem_table_id[8];
+       char reserved[24];
+} __attribute__((__packed__));
+
+/*
+ * Logical location of iSCSI Boot Format Table.
+ * If the value is NULL there is no iBFT on the machine.
+ */
+extern struct ibft_table_header *ibft_addr;
+
+/*
+ * Routine used to find and reserve the iSCSI Boot Format Table. The
+ * mapped address is set in the ibft_addr variable.
+ */
+#ifdef CONFIG_ISCSI_IBFT_FIND
+extern void __init reserve_ibft_region(void);
+#else
+static inline void reserve_ibft_region(void) { }
+#endif
+
+#endif /* ISCSI_IBFT_H */
index 423f58272188d58e9bf6155fe452710c3d61bf16..07a9b52a265418cb4b213ae8b1fff8e6eefbdd9d 100644 (file)
@@ -32,8 +32,6 @@
 #include <linux/timer.h>
 #include <linux/lockdep.h>
 
-#include <asm/semaphore.h>
-
 #define journal_oom_retry 1
 
 /*
index 2cbf6fdb17993409c40c4cc67db62a633ec858db..05e2b307161a4d7bee5482c5a9851e1110371aa4 100644 (file)
@@ -30,8 +30,6 @@
 #include <linux/bit_spinlock.h>
 #include <linux/mutex.h>
 #include <linux/timer.h>
-
-#include <asm/semaphore.h>
 #endif
 
 #define journal_oom_retry 1
index e0b5b684d83f2969816f051acb2e1158da2fe06d..e377e34e589e8e5d3a2f2b566f35f54006648c87 100644 (file)
@@ -134,6 +134,22 @@ static inline u64 get_jiffies_64(void)
         ((__s64)(a) - (__s64)(b) >= 0))
 #define time_before_eq64(a,b)  time_after_eq64(b,a)
 
+/*
+ * These four macros compare jiffies and 'a' for convenience.
+ */
+
+/* time_is_before_jiffies(a) return true if a is before jiffies */
+#define time_is_before_jiffies(a) time_after(jiffies, a)
+
+/* time_is_after_jiffies(a) return true if a is after jiffies */
+#define time_is_after_jiffies(a) time_before(jiffies, a)
+
+/* time_is_before_eq_jiffies(a) return true if a is before or equal to jiffies*/
+#define time_is_before_eq_jiffies(a) time_after_eq(jiffies, a)
+
+/* time_is_after_eq_jiffies(a) return true if a is after or equal to jiffies*/
+#define time_is_after_eq_jiffies(a) time_before_eq(jiffies, a)
+
 /*
  * Have the 32 bit jiffies value wrap 5 minutes after boot
  * so jiffies wrap bugs show up earlier.
index 2df44e77327002938f08d345f34e5e773cc37363..cd6d02cf854d8e22d566c169326644ed5f708865 100644 (file)
@@ -293,10 +293,8 @@ extern void print_hex_dump_bytes(const char *prefix_str, int prefix_type,
 #define pr_debug(fmt, arg...) \
        printk(KERN_DEBUG fmt, ##arg)
 #else
-static inline int __attribute__ ((format (printf, 1, 2))) pr_debug(const char * fmt, ...)
-{
-       return 0;
-}
+#define pr_debug(fmt, arg...) \
+       ({ if (0) printk(KERN_DEBUG fmt, ##arg); 0; })
 #endif
 
 /*
index 8c4350a9ed87c40a78709045821dbff46b2a760e..a53e932f80fb29dc724ea5f6aa69fb042f536f54 100644 (file)
@@ -48,7 +48,6 @@ typedef struct kcapi_carddef {
 #include <linux/list.h>
 #include <linux/skbuff.h>
 #include <linux/workqueue.h>
-#include <asm/semaphore.h>
 
 #define        KCI_CONTRUP     0       /* arg: struct capi_profile */
 #define        KCI_CONTRDOWN   1       /* arg: NULL */
index 2cd7fa73d1af88df51e6bb0daf2084dbf381ca0f..ce5983225be4e6430cadbff9cc5cbf448a66e647 100644 (file)
@@ -327,4 +327,10 @@ extern void ktime_get_ts(struct timespec *ts);
 /* Get the real (wall-) time in timespec format: */
 #define ktime_get_real_ts(ts)  getnstimeofday(ts)
 
+static inline ktime_t ns_to_ktime(u64 ns)
+{
+       static const ktime_t ktime_zero = { .tv64 = 0 };
+       return ktime_add_ns(ktime_zero, ns);
+}
+
 #endif
index 0201f6f51ceab72892ce6b2c167d8dceaa2a23d5..b07e3d400bd6b6ad91d2465a76285fc80b6b444d 100644 (file)
@@ -59,15 +59,7 @@ struct led_classdev {
 
 extern int led_classdev_register(struct device *parent,
                                 struct led_classdev *led_cdev);
-extern void __led_classdev_unregister(struct led_classdev *led_cdev, bool sus);
-static inline void led_classdev_unregister(struct led_classdev *lcd)
-{
-       __led_classdev_unregister(lcd, false);
-}
-static inline void led_classdev_unregister_suspended(struct led_classdev *lcd)
-{
-       __led_classdev_unregister(lcd, true);
-}
+extern void led_classdev_unregister(struct led_classdev *lcd);
 extern void led_classdev_suspend(struct led_classdev *led_cdev);
 extern void led_classdev_resume(struct led_classdev *led_cdev);
 
index 165734a2dd47318af7864ce187f613cfbead6ffb..07ed56f7a767bfda737db92a1b21318cb2a4f033 100644 (file)
@@ -443,7 +443,7 @@ enum link_pm {
        MAX_PERFORMANCE,
        MEDIUM_POWER,
 };
-extern struct class_device_attribute class_device_attr_link_power_management_policy;
+extern struct device_attribute dev_attr_link_power_management_policy;
 
 #ifdef CONFIG_ATA_SFF
 struct ata_ioports {
index 75ce2cb4ff6ebc92a8fcaa557a9bd7b6b9b9b1b6..dac16f99c70115ba4e4f1cee8b18f5f1b0f050c8 100644 (file)
@@ -631,31 +631,14 @@ static inline void list_splice_init_rcu(struct list_head *list,
  * as long as the traversal is guarded by rcu_read_lock().
  */
 #define list_for_each_rcu(pos, head) \
-       for (pos = (head)->next; \
-               prefetch(rcu_dereference(pos)->next), pos != (head); \
-               pos = pos->next)
+       for (pos = rcu_dereference((head)->next); \
+               prefetch(pos->next), pos != (head); \
+               pos = rcu_dereference(pos->next))
 
 #define __list_for_each_rcu(pos, head) \
-       for (pos = (head)->next; \
-               rcu_dereference(pos) != (head); \
-               pos = pos->next)
-
-/**
- * list_for_each_safe_rcu
- * @pos:       the &struct list_head to use as a loop cursor.
- * @n:         another &struct list_head to use as temporary storage
- * @head:      the head for your list.
- *
- * Iterate over an rcu-protected list, safe against removal of list entry.
- *
- * This list-traversal primitive may safely run concurrently with
- * the _rcu list-mutation primitives such as list_add_rcu()
- * as long as the traversal is guarded by rcu_read_lock().
- */
-#define list_for_each_safe_rcu(pos, n, head) \
-       for (pos = (head)->next; \
-               n = rcu_dereference(pos)->next, pos != (head); \
-               pos = n)
+       for (pos = rcu_dereference((head)->next); \
+               pos != (head); \
+               pos = rcu_dereference(pos->next))
 
 /**
  * list_for_each_entry_rcu     -       iterate over rcu list of given type
@@ -668,10 +651,9 @@ static inline void list_splice_init_rcu(struct list_head *list,
  * as long as the traversal is guarded by rcu_read_lock().
  */
 #define list_for_each_entry_rcu(pos, head, member) \
-       for (pos = list_entry((head)->next, typeof(*pos), member); \
-               prefetch(rcu_dereference(pos)->member.next), \
-                       &pos->member != (head); \
-               pos = list_entry(pos->member.next, typeof(*pos), member))
+       for (pos = list_entry(rcu_dereference((head)->next), typeof(*pos), member); \
+               prefetch(pos->member.next), &pos->member != (head); \
+               pos = list_entry(rcu_dereference(pos->member.next), typeof(*pos), member))
 
 
 /**
@@ -686,9 +668,9 @@ static inline void list_splice_init_rcu(struct list_head *list,
  * as long as the traversal is guarded by rcu_read_lock().
  */
 #define list_for_each_continue_rcu(pos, head) \
-       for ((pos) = (pos)->next; \
-               prefetch(rcu_dereference((pos))->next), (pos) != (head); \
-               (pos) = (pos)->next)
+       for ((pos) = rcu_dereference((pos)->next); \
+               prefetch((pos)->next), (pos) != (head); \
+               (pos) = rcu_dereference((pos)->next))
 
 /*
  * Double linked lists with a single pointer list head.
@@ -986,10 +968,10 @@ static inline void hlist_add_after_rcu(struct hlist_node *prev,
  * as long as the traversal is guarded by rcu_read_lock().
  */
 #define hlist_for_each_entry_rcu(tpos, pos, head, member)               \
-       for (pos = (head)->first;                                        \
-            rcu_dereference(pos) && ({ prefetch(pos->next); 1;}) &&     \
+       for (pos = rcu_dereference((head)->first);                       \
+               pos && ({ prefetch(pos->next); 1;}) &&                   \
                ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1;}); \
-            pos = pos->next)
+            pos = rcu_dereference(pos->next))
 
 #else
 #warning "don't include kernel headers in userspace"
diff --git a/include/linux/lmb.h b/include/linux/lmb.h
new file mode 100644 (file)
index 0000000..271153d
--- /dev/null
@@ -0,0 +1,85 @@
+#ifndef _LINUX_LMB_H
+#define _LINUX_LMB_H
+#ifdef __KERNEL__
+
+/*
+ * Logical memory blocks.
+ *
+ * Copyright (C) 2001 Peter Bergner, IBM Corp.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ */
+
+#include <linux/init.h>
+#include <linux/mm.h>
+
+#define MAX_LMB_REGIONS 128
+
+struct lmb_property {
+       u64 base;
+       u64 size;
+};
+
+struct lmb_region {
+       unsigned long cnt;
+       u64 size;
+       struct lmb_property region[MAX_LMB_REGIONS+1];
+};
+
+struct lmb {
+       unsigned long debug;
+       u64 rmo_size;
+       struct lmb_region memory;
+       struct lmb_region reserved;
+};
+
+extern struct lmb lmb;
+
+extern void __init lmb_init(void);
+extern void __init lmb_analyze(void);
+extern long __init lmb_add(u64 base, u64 size);
+extern long __init lmb_reserve(u64 base, u64 size);
+extern u64 __init lmb_alloc_nid(u64 size, u64 align, int nid,
+                               u64 (*nid_range)(u64, u64, int *));
+extern u64 __init lmb_alloc(u64 size, u64 align);
+extern u64 __init lmb_alloc_base(u64 size,
+               u64, u64 max_addr);
+extern u64 __init __lmb_alloc_base(u64 size,
+               u64 align, u64 max_addr);
+extern u64 __init lmb_phys_mem_size(void);
+extern u64 __init lmb_end_of_DRAM(void);
+extern void __init lmb_enforce_memory_limit(u64 memory_limit);
+extern int __init lmb_is_reserved(u64 addr);
+
+extern void lmb_dump_all(void);
+
+static inline u64
+lmb_size_bytes(struct lmb_region *type, unsigned long region_nr)
+{
+       return type->region[region_nr].size;
+}
+static inline u64
+lmb_size_pages(struct lmb_region *type, unsigned long region_nr)
+{
+       return lmb_size_bytes(type, region_nr) >> PAGE_SHIFT;
+}
+static inline u64
+lmb_start_pfn(struct lmb_region *type, unsigned long region_nr)
+{
+       return type->region[region_nr].base >> PAGE_SHIFT;
+}
+static inline u64
+lmb_end_pfn(struct lmb_region *type, unsigned long region_nr)
+{
+       return lmb_start_pfn(type, region_nr) +
+              lmb_size_pages(type, region_nr);
+}
+
+#include <asm/lmb.h>
+
+#endif /* __KERNEL__ */
+
+#endif /* _LINUX_LMB_H */
diff --git a/include/linux/mbus.h b/include/linux/mbus.h
new file mode 100644 (file)
index 0000000..c11ff29
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+ * Marvell MBUS common definitions.
+ *
+ * Copyright (C) 2008 Marvell Semiconductor
+ *
+ * This file is licensed under the terms of the GNU General Public
+ * License version 2.  This program is licensed "as is" without any
+ * warranty of any kind, whether express or implied.
+ */
+
+#ifndef __LINUX_MBUS_H
+#define __LINUX_MBUS_H
+
+struct mbus_dram_target_info
+{
+       /*
+        * The 4-bit MBUS target ID of the DRAM controller.
+        */
+       u8              mbus_dram_target_id;
+
+       /*
+        * The base address, size, and MBUS attribute ID for each
+        * of the possible DRAM chip selects.  Peripherals are
+        * required to support at least 4 decode windows.
+        */
+       int             num_cs;
+       struct mbus_dram_window {
+               u8      cs_index;
+               u8      mbus_attr;
+               u32     base;
+               u32     size;
+       } cs[4];
+};
+
+
+#endif
index 33f0ff0cf63483cc776d4878d1ec24f1ab45e437..f80e0e331cb7e0f923feed2c26bb2cc03bd28e22 100644 (file)
@@ -18,8 +18,7 @@
 #include <linux/sysdev.h>
 #include <linux/node.h>
 #include <linux/compiler.h>
-
-#include <asm/semaphore.h>
+#include <linux/mutex.h>
 
 struct memory_block {
        unsigned long phys_index;
@@ -30,7 +29,7 @@ struct memory_block {
         * created long after the critical areas during
         * initialization.
         */
-       struct semaphore state_sem;
+       struct mutex state_mutex;
        int phys_device;                /* to which fru does this belong? */
        void *hw;                       /* optional pointer to fw/hw data */
        int (*phys_callback)(struct memory_block *);
index 3e686ec6a9678d82694ffc9c22bccc1bdf89a12a..37a5cdb03918ffcee2a390b12fe391cdfbf62e69 100644 (file)
@@ -276,7 +276,7 @@ struct memstick_host {
 #define MEMSTICK_CAP_PAR8          4
 
        struct work_struct  media_checker;
-       struct class_device cdev;
+       struct device       dev;
 
        struct memstick_dev *card;
        unsigned int        retries;
diff --git a/include/linux/mfd/htc-egpio.h b/include/linux/mfd/htc-egpio.h
new file mode 100644 (file)
index 0000000..b4201c9
--- /dev/null
@@ -0,0 +1,57 @@
+/*
+ * HTC simple EGPIO irq and gpio extender
+ */
+
+#ifndef __HTC_EGPIO_H__
+#define __HTC_EGPIO_H__
+
+#include <linux/gpio.h>
+
+/* Descriptive values for all-in or all-out htc_egpio_chip descriptors. */
+#define HTC_EGPIO_OUTPUT (~0)
+#define HTC_EGPIO_INPUT  0
+
+/**
+ * struct htc_egpio_chip - descriptor to create gpio_chip for register range
+ * @reg_start: index of first register
+ * @gpio_base: gpio number of first pin in this register range
+ * @num_gpios: number of gpios in this register range, max BITS_PER_LONG
+ *    (number of registers = DIV_ROUND_UP(num_gpios, reg_width))
+ * @direction: bitfield, '0' = input, '1' = output,
+ */
+struct htc_egpio_chip {
+       int           reg_start;
+       int           gpio_base;
+       int           num_gpios;
+       unsigned long direction;
+       unsigned long initial_values;
+};
+
+/**
+ * struct htc_egpio_platform_data - description provided by the arch
+ * @irq_base: beginning of available IRQs (eg, IRQ_BOARD_START)
+ * @num_irqs: number of irqs
+ * @reg_width: number of bits per register, either 8 or 16 bit
+ * @bus_width: alignment of the registers, either 16 or 32 bit
+ * @invert_acks: set if chip requires writing '0' to ack an irq, instead of '1'
+ * @ack_register: location of the irq/ack register
+ * @chip: pointer to array of htc_egpio_chip descriptors
+ * @num_chips: number of egpio chip descriptors
+ */
+struct htc_egpio_platform_data {
+       int                   bus_width;
+       int                   reg_width;
+
+       int                   irq_base;
+       int                   num_irqs;
+       int                   invert_acks;
+       int                   ack_register;
+
+       struct htc_egpio_chip *chip;
+       int                   num_chips;
+};
+
+/* Determine the wakeup irq, to be called during early resume */
+extern int htc_egpio_get_wakeup_irq(struct device *dev);
+
+#endif
diff --git a/include/linux/mfd/htc-pasic3.h b/include/linux/mfd/htc-pasic3.h
new file mode 100644 (file)
index 0000000..b4294f1
--- /dev/null
@@ -0,0 +1,55 @@
+/*
+ * HTC PASIC3 driver - LEDs and DS1WM
+ *
+ * Copyright (c) 2007 Philipp Zabel <philipp.zabel@gmail.com>
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file COPYING in the main directory of this archive for
+ * more details.
+ *
+ */
+
+#ifndef __PASIC3_H
+#define __PASIC3_H
+
+#include <linux/platform_device.h>
+#include <linux/leds.h>
+
+extern void pasic3_write_register(struct device *dev, u32 reg, u8 val);
+extern u8 pasic3_read_register(struct device *dev, u32 reg);
+
+/*
+ * mask for registers 0x20,0x21,0x22
+ */
+#define PASIC3_MASK_LED0 0x04
+#define PASIC3_MASK_LED1 0x08
+#define PASIC3_MASK_LED2 0x40
+
+/*
+ * bits in register 0x06
+ */
+#define PASIC3_BIT2_LED0 0x08
+#define PASIC3_BIT2_LED1 0x10
+#define PASIC3_BIT2_LED2 0x20
+
+struct pasic3_led {
+       struct led_classdev         led;
+       unsigned int                hw_num;
+       unsigned int                bit2;
+       unsigned int                mask;
+       struct pasic3_leds_machinfo *pdata;
+};
+
+struct pasic3_leds_machinfo {
+       unsigned int      num_leds;
+       unsigned int      power_gpio;
+       struct pasic3_led *leds;
+};
+
+struct pasic3_platform_data {
+       struct pasic3_leds_machinfo *led_pdata;
+       unsigned int                 bus_shift;
+       unsigned int                 clock_rate;
+};
+
+#endif
index 24b30b9b4f8a807f0b154f959ad871dd06735be5..26433ec520b313c5b4faf7d44df3d2a6d1366905 100644 (file)
@@ -43,15 +43,7 @@ struct miscdevice  {
 };
 
 extern int misc_register(struct miscdevice * misc);
-extern int __misc_deregister(struct miscdevice *misc, bool suspended);
-static inline int misc_deregister(struct miscdevice *misc)
-{
-       return __misc_deregister(misc, false);
-}
-static inline int misc_deregister_suspended(struct miscdevice *misc)
-{
-       return __misc_deregister(misc, true);
-}
+extern int misc_deregister(struct miscdevice *misc);
 
 #define MODULE_ALIAS_MISCDEV(minor)                            \
        MODULE_ALIAS("char-major-" __stringify(MISC_MAJOR)      \
index 5ee2df217cdfbd05cad3ea32de6777db52c271c6..d6600e3f7e4579e6cb8f476bac437c2c035b2573 100644 (file)
@@ -14,6 +14,7 @@
 
 #include <linux/types.h>
 #include <linux/list.h>
+#include <linux/nodemask.h>
 #include <linux/spinlock.h>
 #include <asm/atomic.h>
 
@@ -28,8 +29,10 @@ struct mnt_namespace;
 #define MNT_NOATIME    0x08
 #define MNT_NODIRATIME 0x10
 #define MNT_RELATIME   0x20
+#define MNT_READONLY   0x40    /* does the user want this to be r/o? */
 
 #define MNT_SHRINKABLE 0x100
+#define MNT_IMBALANCED_WRITE_COUNT     0x200 /* just for debugging */
 
 #define MNT_SHARED     0x1000  /* if the vfsmount is a shared mount */
 #define MNT_UNBINDABLE 0x2000  /* if the vfsmount is a unbindable mount */
@@ -62,6 +65,11 @@ struct vfsmount {
        int mnt_expiry_mark;            /* true if marked for expiry */
        int mnt_pinned;
        int mnt_ghosts;
+       /*
+        * This value is not stable unless all of the mnt_writers[] spinlocks
+        * are held, and all mnt_writer[]s on this mount have 0 as their ->count
+        */
+       atomic_t __mnt_writers;
 };
 
 static inline struct vfsmount *mntget(struct vfsmount *mnt)
@@ -71,9 +79,12 @@ static inline struct vfsmount *mntget(struct vfsmount *mnt)
        return mnt;
 }
 
+extern int mnt_want_write(struct vfsmount *mnt);
+extern void mnt_drop_write(struct vfsmount *mnt);
 extern void mntput_no_expire(struct vfsmount *mnt);
 extern void mnt_pin(struct vfsmount *mnt);
 extern void mnt_unpin(struct vfsmount *mnt);
+extern int __mnt_is_readonly(struct vfsmount *mnt);
 
 static inline void mntput(struct vfsmount *mnt)
 {
index 6981016dcc258fc89a0956ca6d9cb41ef3f771ba..59a61bdc98b69b58da4f6f9797c131a275c690d1 100644 (file)
@@ -62,6 +62,7 @@ extern struct property *of_find_property(const struct device_node *np,
                                         int *lenp);
 extern int of_device_is_compatible(const struct device_node *device,
                                   const char *);
+extern int of_device_is_available(const struct device_node *device);
 extern const void *of_get_property(const struct device_node *node,
                                const char *name,
                                int *lenp);
diff --git a/include/linux/of_gpio.h b/include/linux/of_gpio.h
new file mode 100644 (file)
index 0000000..2ee97e9
--- /dev/null
@@ -0,0 +1,69 @@
+/*
+ * OF helpers for the GPIO API
+ *
+ * Copyright (c) 2007-2008  MontaVista Software, Inc.
+ *
+ * Author: Anton Vorontsov <avorontsov@ru.mvista.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ */
+
+#ifndef __LINUX_OF_GPIO_H
+#define __LINUX_OF_GPIO_H
+
+#include <linux/errno.h>
+#include <asm/gpio.h>
+
+#ifdef CONFIG_OF_GPIO
+
+/*
+ * Generic OF GPIO chip
+ */
+struct of_gpio_chip {
+       struct gpio_chip gc;
+       int gpio_cells;
+       int (*xlate)(struct of_gpio_chip *of_gc, struct device_node *np,
+                    const void *gpio_spec);
+};
+
+static inline struct of_gpio_chip *to_of_gpio_chip(struct gpio_chip *gc)
+{
+       return container_of(gc, struct of_gpio_chip, gc);
+}
+
+/*
+ * OF GPIO chip for memory mapped banks
+ */
+struct of_mm_gpio_chip {
+       struct of_gpio_chip of_gc;
+       void (*save_regs)(struct of_mm_gpio_chip *mm_gc);
+       void __iomem *regs;
+};
+
+static inline struct of_mm_gpio_chip *to_of_mm_gpio_chip(struct gpio_chip *gc)
+{
+       struct of_gpio_chip *of_gc = to_of_gpio_chip(gc);
+
+       return container_of(of_gc, struct of_mm_gpio_chip, of_gc);
+}
+
+extern int of_get_gpio(struct device_node *np, int index);
+extern int of_mm_gpiochip_add(struct device_node *np,
+                             struct of_mm_gpio_chip *mm_gc);
+extern int of_gpio_simple_xlate(struct of_gpio_chip *of_gc,
+                               struct device_node *np,
+                               const void *gpio_spec);
+#else
+
+/* Drivers may not strictly depend on the GPIO support, so let them link. */
+static inline int of_get_gpio(struct device_node *np, int index)
+{
+       return -ENOSYS;
+}
+
+#endif /* CONFIG_OF_GPIO */
+
+#endif /* __LINUX_OF_GPIO_H */
diff --git a/include/linux/of_i2c.h b/include/linux/of_i2c.h
new file mode 100644 (file)
index 0000000..2e5a967
--- /dev/null
@@ -0,0 +1,24 @@
+/*
+ * Generic I2C API implementation for PowerPC.
+ *
+ * Copyright (c) 2008 Jochen Friedrich <jochen@scram.de>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ */
+
+#ifndef __LINUX_OF_I2C_H
+#define __LINUX_OF_I2C_H
+
+#include <linux/i2c.h>
+
+#ifdef CONFIG_OF_I2C
+
+void of_register_i2c_devices(struct i2c_adapter *adap,
+                            struct device_node *adap_node);
+
+#endif /* CONFIG_OF_I2C */
+
+#endif /* __LINUX_OF_I2C_H */
index d1ad546c8c9e955e10b2a4b6d8bb1cabe1cb1318..dcb9e01a69ca9672879be141eb7d449b3297445b 100644 (file)
@@ -101,9 +101,9 @@ typedef enum {
 #include <linux/spinlock.h>
 #include <linux/wait.h>
 #include <linux/irqreturn.h>
+#include <linux/semaphore.h>
 #include <asm/system.h>
 #include <asm/ptrace.h>
-#include <asm/semaphore.h>
 
 /* Define this later. */
 struct parport;
index 015b735811b436e87a99ffbc5bb27f4ede1226cc..1de72cbbe0d1af6a4ea9891adb659aaddfcd478d 100644 (file)
@@ -183,8 +183,9 @@ typedef struct pm_message {
 struct dev_pm_info {
        pm_message_t            power_state;
        unsigned                can_wakeup:1;
-#ifdef CONFIG_PM_SLEEP
        unsigned                should_wakeup:1;
+       bool                    sleeping:1;     /* Owned by the PM core */
+#ifdef CONFIG_PM_SLEEP
        struct list_head        entry;
 #endif
 };
@@ -197,11 +198,6 @@ extern void device_resume(void);
 extern int device_suspend(pm_message_t state);
 extern int device_prepare_suspend(pm_message_t state);
 
-#define device_set_wakeup_enable(dev,val) \
-       ((dev)->power.should_wakeup = !!(val))
-#define device_may_wakeup(dev) \
-       (device_can_wakeup(dev) && (dev)->power.should_wakeup)
-
 extern void __suspend_report_result(const char *function, void *fn, int ret);
 
 #define suspend_report_result(fn, ret)                                 \
@@ -209,20 +205,6 @@ extern void __suspend_report_result(const char *function, void *fn, int ret);
                __suspend_report_result(__FUNCTION__, fn, ret);         \
        } while (0)
 
-/*
- * Platform hook to activate device wakeup capability, if that's not already
- * handled by enable_irq_wake() etc.
- * Returns zero on success, else negative errno
- */
-extern int (*platform_enable_wakeup)(struct device *dev, int is_on);
-
-static inline int call_platform_enable_wakeup(struct device *dev, int is_on)
-{
-       if (platform_enable_wakeup)
-               return (*platform_enable_wakeup)(dev, is_on);
-       return 0;
-}
-
 #else /* !CONFIG_PM_SLEEP */
 
 static inline int device_suspend(pm_message_t state)
@@ -230,29 +212,10 @@ static inline int device_suspend(pm_message_t state)
        return 0;
 }
 
-#define device_set_wakeup_enable(dev,val)      do{}while(0)
-#define device_may_wakeup(dev)                 (0)
-
-#define suspend_report_result(fn, ret) do { } while (0)
-
-static inline int call_platform_enable_wakeup(struct device *dev, int is_on)
-{
-       return 0;
-}
+#define suspend_report_result(fn, ret)         do {} while (0)
 
 #endif /* !CONFIG_PM_SLEEP */
 
-/* changes to device_may_wakeup take effect on the next pm state change.
- * by default, devices should wakeup if they can.
- */
-#define device_can_wakeup(dev) \
-       ((dev)->power.can_wakeup)
-#define device_init_wakeup(dev,val) \
-       do { \
-               device_can_wakeup(dev) = !!(val); \
-               device_set_wakeup_enable(dev,val); \
-       } while(0)
-
 /*
  * Global Power Management flags
  * Used to keep APM and ACPI from both being active
diff --git a/include/linux/pm_wakeup.h b/include/linux/pm_wakeup.h
new file mode 100644 (file)
index 0000000..f0d0b2c
--- /dev/null
@@ -0,0 +1,90 @@
+/*
+ *  pm_wakeup.h - Power management wakeup interface
+ *
+ *  Copyright (C) 2008 Alan Stern
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#ifndef _LINUX_PM_WAKEUP_H
+#define _LINUX_PM_WAKEUP_H
+
+#ifndef _DEVICE_H_
+# error "please don't include this file directly"
+#endif
+
+#ifdef CONFIG_PM
+
+/* changes to device_may_wakeup take effect on the next pm state change.
+ * by default, devices should wakeup if they can.
+ */
+static inline void device_init_wakeup(struct device *dev, int val)
+{
+       dev->power.can_wakeup = dev->power.should_wakeup = !!val;
+}
+
+static inline int device_can_wakeup(struct device *dev)
+{
+       return dev->power.can_wakeup;
+}
+
+static inline void device_set_wakeup_enable(struct device *dev, int val)
+{
+       dev->power.should_wakeup = !!val;
+}
+
+static inline int device_may_wakeup(struct device *dev)
+{
+       return dev->power.can_wakeup & dev->power.should_wakeup;
+}
+
+/*
+ * Platform hook to activate device wakeup capability, if that's not already
+ * handled by enable_irq_wake() etc.
+ * Returns zero on success, else negative errno
+ */
+extern int (*platform_enable_wakeup)(struct device *dev, int is_on);
+
+static inline int call_platform_enable_wakeup(struct device *dev, int is_on)
+{
+       if (platform_enable_wakeup)
+               return (*platform_enable_wakeup)(dev, is_on);
+       return 0;
+}
+
+#else /* !CONFIG_PM */
+
+/* For some reason the next two routines work even without CONFIG_PM */
+static inline void device_init_wakeup(struct device *dev, int val)
+{
+       dev->power.can_wakeup = !!val;
+}
+
+static inline int device_can_wakeup(struct device *dev)
+{
+       return dev->power.can_wakeup;
+}
+
+#define device_set_wakeup_enable(dev, val)     do {} while (0)
+#define device_may_wakeup(dev)                 0
+
+static inline int call_platform_enable_wakeup(struct device *dev, int is_on)
+{
+       return 0;
+}
+
+#endif /* !CONFIG_PM */
+
+#endif /* _LINUX_PM_WAKEUP_H */
index 3800639775aee4706734b1aa9bb3e55104fe4f3b..5c80b1939636ec556f775692aa5ed27aba5986b4 100644 (file)
 #define PR_CAPBSET_READ 23
 #define PR_CAPBSET_DROP 24
 
+/* Get/set the process' ability to use the timestamp counter instruction */
+#define PR_GET_TSC 25
+#define PR_SET_TSC 26
+# define PR_TSC_ENABLE         1       /* allow the use of the timestamp counter */
+# define PR_TSC_SIGSEGV                2       /* throw a SIGSEGV instead of reading the TSC */
+
 #endif /* _LINUX_PRCTL_H */
index fbaeda79b2e99fc41815760309e7509ebf4408d1..8ab630b67fcca8c3d0d58237915f2a8b3f0d936a 100644 (file)
@@ -19,7 +19,6 @@
 #define _MD_H
 
 #include <linux/blkdev.h>
-#include <asm/semaphore.h>
 #include <linux/major.h>
 #include <linux/ioctl.h>
 #include <linux/types.h>
index d22ad392242ac811bf1c432c89b4c18592dbd987..6b537f1ac96c1caabf6a86ac57313b61cd963361 100644 (file)
@@ -53,20 +53,20 @@ struct raid_data {
 #define DEFINE_RAID_ATTRIBUTE(type, attr)                                    \
 static inline void                                                           \
 raid_set_##attr(struct raid_template *r, struct device *dev, type value) {    \
-       struct class_device *cdev =                                           \
+       struct device *device =                                               \
                attribute_container_find_class_device(&r->raid_attrs.ac, dev);\
        struct raid_data *rd;                                                 \
-       BUG_ON(!cdev);                                                        \
-       rd = class_get_devdata(cdev);                                         \
+       BUG_ON(!device);                                                      \
+       rd = dev_get_drvdata(device);                                         \
        rd->attr = value;                                                     \
 }                                                                            \
 static inline type                                                           \
 raid_get_##attr(struct raid_template *r, struct device *dev) {               \
-       struct class_device *cdev =                                           \
+       struct device *device =                                               \
                attribute_container_find_class_device(&r->raid_attrs.ac, dev);\
        struct raid_data *rd;                                                 \
-       BUG_ON(!cdev);                                                        \
-       rd = class_get_devdata(cdev);                                         \
+       BUG_ON(!device);                                                      \
+       rd = dev_get_drvdata(device);                                         \
        return rd->attr;                                                      \
 }
 
index 6a1e7afb099bc981f91a23ac9698e7244bab4aa0..311380e5fe8915a1d85f6999f524bcd4330f0141 100644 (file)
@@ -61,7 +61,6 @@ struct sched_param {
 #include <linux/mm_types.h>
 
 #include <asm/system.h>
-#include <asm/semaphore.h>
 #include <asm/page.h>
 #include <asm/ptrace.h>
 #include <asm/cputime.h>
@@ -704,6 +703,7 @@ enum cpu_idle_type {
 #define SD_POWERSAVINGS_BALANCE        256     /* Balance for power savings */
 #define SD_SHARE_PKG_RESOURCES 512     /* Domain members share cpu pkg resources */
 #define SD_SERIALIZE           1024    /* Only a single load balancing instance */
+#define SD_WAKE_IDLE_FAR       2048    /* Gain latency sacrificing cache hit */
 
 #define BALANCE_FOR_MC_POWER   \
        (sched_smt_power_savings ? SD_POWERSAVINGS_BALANCE : 0)
@@ -733,12 +733,31 @@ struct sched_group {
        u32 reciprocal_cpu_power;
 };
 
+enum sched_domain_level {
+       SD_LV_NONE = 0,
+       SD_LV_SIBLING,
+       SD_LV_MC,
+       SD_LV_CPU,
+       SD_LV_NODE,
+       SD_LV_ALLNODES,
+       SD_LV_MAX
+};
+
+struct sched_domain_attr {
+       int relax_domain_level;
+};
+
+#define SD_ATTR_INIT   (struct sched_domain_attr) {    \
+       .relax_domain_level = -1,                       \
+}
+
 struct sched_domain {
        /* These fields must be setup */
        struct sched_domain *parent;    /* top domain must be null terminated */
        struct sched_domain *child;     /* bottom domain must be null terminated */
        struct sched_group *groups;     /* the balancing groups of the domain */
        cpumask_t span;                 /* span of all CPUs in this domain */
+       int first_cpu;                  /* cache of the first cpu in this domain */
        unsigned long min_interval;     /* Minimum balance interval ms */
        unsigned long max_interval;     /* Maximum balance interval ms */
        unsigned int busy_factor;       /* less balancing by factor if busy */
@@ -750,6 +769,7 @@ struct sched_domain {
        unsigned int wake_idx;
        unsigned int forkexec_idx;
        int flags;                      /* See SD_* */
+       enum sched_domain_level level;
 
        /* Runtime fields. */
        unsigned long last_balance;     /* init to jiffies. units in jiffies */
@@ -789,7 +809,8 @@ struct sched_domain {
 #endif
 };
 
-extern void partition_sched_domains(int ndoms_new, cpumask_t *doms_new);
+extern void partition_sched_domains(int ndoms_new, cpumask_t *doms_new,
+                                   struct sched_domain_attr *dattr_new);
 extern int arch_reinit_sched_domains(void);
 
 #endif /* CONFIG_SMP */
@@ -889,7 +910,8 @@ struct sched_class {
        void (*set_curr_task) (struct rq *rq);
        void (*task_tick) (struct rq *rq, struct task_struct *p, int queued);
        void (*task_new) (struct rq *rq, struct task_struct *p);
-       void (*set_cpus_allowed)(struct task_struct *p, cpumask_t *newmask);
+       void (*set_cpus_allowed)(struct task_struct *p,
+                                const cpumask_t *newmask);
 
        void (*join_domain)(struct rq *rq);
        void (*leave_domain)(struct rq *rq);
@@ -923,6 +945,7 @@ struct load_weight {
 struct sched_entity {
        struct load_weight      load;           /* for load-balancing */
        struct rb_node          run_node;
+       struct list_head        group_node;
        unsigned int            on_rq;
 
        u64                     exec_start;
@@ -982,6 +1005,7 @@ struct sched_rt_entity {
        unsigned long timeout;
        int nr_cpus_allowed;
 
+       struct sched_rt_entity *back;
 #ifdef CONFIG_RT_GROUP_SCHED
        struct sched_rt_entity  *parent;
        /* rq on which this entity is (to be) queued: */
@@ -1502,15 +1526,21 @@ static inline void put_task_struct(struct task_struct *t)
 #define used_math() tsk_used_math(current)
 
 #ifdef CONFIG_SMP
-extern int set_cpus_allowed(struct task_struct *p, cpumask_t new_mask);
+extern int set_cpus_allowed_ptr(struct task_struct *p,
+                               const cpumask_t *new_mask);
 #else
-static inline int set_cpus_allowed(struct task_struct *p, cpumask_t new_mask)
+static inline int set_cpus_allowed_ptr(struct task_struct *p,
+                                      const cpumask_t *new_mask)
 {
-       if (!cpu_isset(0, new_mask))
+       if (!cpu_isset(0, *new_mask))
                return -EINVAL;
        return 0;
 }
 #endif
+static inline int set_cpus_allowed(struct task_struct *p, cpumask_t new_mask)
+{
+       return set_cpus_allowed_ptr(p, &new_mask);
+}
 
 extern unsigned long long sched_clock(void);
 
@@ -1551,7 +1581,6 @@ static inline void wake_up_idle_cpu(int cpu) { }
 extern unsigned int sysctl_sched_latency;
 extern unsigned int sysctl_sched_min_granularity;
 extern unsigned int sysctl_sched_wakeup_granularity;
-extern unsigned int sysctl_sched_batch_wakeup_granularity;
 extern unsigned int sysctl_sched_child_runs_first;
 extern unsigned int sysctl_sched_features;
 extern unsigned int sysctl_sched_migration_cost;
@@ -1564,6 +1593,10 @@ int sched_nr_latency_handler(struct ctl_table *table, int write,
 extern unsigned int sysctl_sched_rt_period;
 extern int sysctl_sched_rt_runtime;
 
+int sched_rt_handler(struct ctl_table *table, int write,
+               struct file *filp, void __user *buffer, size_t *lenp,
+               loff_t *ppos);
+
 extern unsigned int sysctl_sched_compat_yield;
 
 #ifdef CONFIG_RT_MUTEXES
@@ -2031,7 +2064,7 @@ static inline void arch_pick_mmap_layout(struct mm_struct *mm)
 }
 #endif
 
-extern long sched_setaffinity(pid_t pid, cpumask_t new_mask);
+extern long sched_setaffinity(pid_t pid, const cpumask_t *new_mask);
 extern long sched_getaffinity(pid_t pid, cpumask_t *mask);
 
 extern int sched_mc_power_savings, sched_smt_power_savings;
@@ -2041,8 +2074,11 @@ extern void normalize_rt_tasks(void);
 #ifdef CONFIG_GROUP_SCHED
 
 extern struct task_group init_task_group;
+#ifdef CONFIG_USER_SCHED
+extern struct task_group root_task_group;
+#endif
 
-extern struct task_group *sched_create_group(void);
+extern struct task_group *sched_create_group(struct task_group *parent);
 extern void sched_destroy_group(struct task_group *tg);
 extern void sched_move_task(struct task_struct *tsk);
 #ifdef CONFIG_FAIR_GROUP_SCHED
@@ -2053,6 +2089,9 @@ extern unsigned long sched_group_shares(struct task_group *tg);
 extern int sched_group_set_rt_runtime(struct task_group *tg,
                                      long rt_runtime_us);
 extern long sched_group_rt_runtime(struct task_group *tg);
+extern int sched_group_set_rt_period(struct task_group *tg,
+                                     long rt_period_us);
+extern long sched_group_rt_period(struct task_group *tg);
 #endif
 #endif
 
index 11fd9f2c40932e5112204eb44331223ac2ce022b..299ec4b314123e31bf014153ab28a328ea050f26 100644 (file)
@@ -242,6 +242,7 @@ typedef unsigned char *sk_buff_data_t;
  *     @queue_mapping: Queue mapping for multiqueue devices
  *     @tc_index: Traffic control index
  *     @tc_verd: traffic control verdict
+ *     @ndisc_nodetype: router type (from link layer)
  *     @dma_cookie: a cookie to one of several possible DMA operations
  *             done by skb DMA functions
  *     @secmark: security marking
index 4c2577bd1c859c332821b2be75a378010d258c46..8df6d1382ac8280b7446df8af3898ea8b0b4d588 100644 (file)
@@ -60,7 +60,6 @@ struct getcpu_cache;
 #include <linux/capability.h>
 #include <linux/list.h>
 #include <linux/sem.h>
-#include <asm/semaphore.h>
 #include <asm/siginfo.h>
 #include <asm/signal.h>
 #include <linux/quota.h>
index f752e73bf977e98381b95070096522c84e2ed5a1..f2767bc6b73517bea32d2e34ed362a8e61b794f1 100644 (file)
@@ -45,12 +45,16 @@ struct sysdev_class_attribute {
        ssize_t (*store)(struct sysdev_class *, const char *, size_t);
 };
 
-#define SYSDEV_CLASS_ATTR(_name,_mode,_show,_store)            \
-struct sysdev_class_attribute attr_##_name = {                         \
+#define _SYSDEV_CLASS_ATTR(_name,_mode,_show,_store)           \
+{                                                              \
        .attr = {.name = __stringify(_name), .mode = _mode },   \
        .show   = _show,                                        \
        .store  = _store,                                       \
-};
+}
+
+#define SYSDEV_CLASS_ATTR(_name,_mode,_show,_store)            \
+       struct sysdev_class_attribute attr_##_name =            \
+               _SYSDEV_CLASS_ATTR(_name,_mode,_show,_store)
 
 
 extern int sysdev_class_register(struct sysdev_class *);
@@ -100,15 +104,16 @@ struct sysdev_attribute {
 };
 
 
-#define _SYSDEV_ATTR(_name,_mode,_show,_store)                 \
+#define _SYSDEV_ATTR(_name, _mode, _show, _store)              \
 {                                                              \
        .attr = { .name = __stringify(_name), .mode = _mode },  \
        .show   = _show,                                        \
        .store  = _store,                                       \
 }
 
-#define SYSDEV_ATTR(_name,_mode,_show,_store)          \
-struct sysdev_attribute attr_##_name = _SYSDEV_ATTR(_name,_mode,_show,_store);
+#define SYSDEV_ATTR(_name, _mode, _show, _store)               \
+       struct sysdev_attribute attr_##_name =                  \
+               _SYSDEV_ATTR(_name, _mode, _show, _store);
 
 extern int sysdev_create_file(struct sys_device *, struct sysdev_attribute *);
 extern void sysdev_remove_file(struct sys_device *, struct sysdev_attribute *);
index 802710438a9e8a3b548d9549770268cb1ac2316b..03378e3515b3fd073b23bf517057fa4708d5bf43 100644 (file)
@@ -131,7 +131,6 @@ static inline int sysfs_create_dir(struct kobject *kobj)
 
 static inline void sysfs_remove_dir(struct kobject *kobj)
 {
-       ;
 }
 
 static inline int sysfs_rename_dir(struct kobject *kobj, const char *new_name)
@@ -160,7 +159,6 @@ static inline int sysfs_chmod_file(struct kobject *kobj,
 static inline void sysfs_remove_file(struct kobject *kobj,
                                     const struct attribute *attr)
 {
-       ;
 }
 
 static inline int sysfs_create_bin_file(struct kobject *kobj,
@@ -169,10 +167,9 @@ static inline int sysfs_create_bin_file(struct kobject *kobj,
        return 0;
 }
 
-static inline int sysfs_remove_bin_file(struct kobject *kobj,
-                                       struct bin_attribute *attr)
+static inline void sysfs_remove_bin_file(struct kobject *kobj,
+                                        struct bin_attribute *attr)
 {
-       return 0;
 }
 
 static inline int sysfs_create_link(struct kobject *kobj,
@@ -183,7 +180,6 @@ static inline int sysfs_create_link(struct kobject *kobj,
 
 static inline void sysfs_remove_link(struct kobject *kobj, const char *name)
 {
-       ;
 }
 
 static inline int sysfs_create_group(struct kobject *kobj,
@@ -195,7 +191,6 @@ static inline int sysfs_create_group(struct kobject *kobj,
 static inline void sysfs_remove_group(struct kobject *kobj,
                                      const struct attribute_group *grp)
 {
-       ;
 }
 
 static inline int sysfs_add_file_to_group(struct kobject *kobj,
index bd14f8b30f0998a874ecc33a220a673da5aae9c8..4bb7074a2c3a5d018ff13eee399d82a2be6c10e6 100644 (file)
 #endif
 
 #ifndef nr_cpus_node
-#define nr_cpus_node(node)                                                     \
-       ({                                                                      \
-               cpumask_t __tmp__;                                              \
-               __tmp__ = node_to_cpumask(node);                                \
-               cpus_weight(__tmp__);                                           \
+#define nr_cpus_node(node)                             \
+       ({                                              \
+               node_to_cpumask_ptr(__tmp__, node);     \
+               cpus_weight(*__tmp__);                  \
        })
 #endif
 
-#define for_each_node_with_cpus(node)                                          \
-       for_each_online_node(node)                                              \
+#define for_each_node_with_cpus(node)                  \
+       for_each_online_node(node)                      \
                if (nr_cpus_node(node))
 
 void arch_update_cpu_topology(void);
@@ -80,7 +79,9 @@ void arch_update_cpu_topology(void);
  * by defining their own arch-specific initializer in include/asm/topology.h.
  * A definition there will automagically override these default initializers
  * and allow arch-specific performance tuning of sched_domains.
+ * (Only non-zero and non-null fields need be specified.)
  */
+
 #ifdef CONFIG_SCHED_SMT
 /* MCD - Do we really need this?  It is always on if CONFIG_SCHED_SMT is,
  * so can't we drop this in favor of CONFIG_SCHED_SMT?
@@ -89,20 +90,10 @@ void arch_update_cpu_topology(void);
 /* Common values for SMT siblings */
 #ifndef SD_SIBLING_INIT
 #define SD_SIBLING_INIT (struct sched_domain) {                \
-       .span                   = CPU_MASK_NONE,        \
-       .parent                 = NULL,                 \
-       .child                  = NULL,                 \
-       .groups                 = NULL,                 \
        .min_interval           = 1,                    \
        .max_interval           = 2,                    \
        .busy_factor            = 64,                   \
        .imbalance_pct          = 110,                  \
-       .cache_nice_tries       = 0,                    \
-       .busy_idx               = 0,                    \
-       .idle_idx               = 0,                    \
-       .newidle_idx            = 0,                    \
-       .wake_idx               = 0,                    \
-       .forkexec_idx           = 0,                    \
        .flags                  = SD_LOAD_BALANCE       \
                                | SD_BALANCE_NEWIDLE    \
                                | SD_BALANCE_FORK       \
@@ -112,7 +103,6 @@ void arch_update_cpu_topology(void);
                                | SD_SHARE_CPUPOWER,    \
        .last_balance           = jiffies,              \
        .balance_interval       = 1,                    \
-       .nr_balance_failed      = 0,                    \
 }
 #endif
 #endif /* CONFIG_SCHED_SMT */
@@ -121,18 +111,12 @@ void arch_update_cpu_topology(void);
 /* Common values for MC siblings. for now mostly derived from SD_CPU_INIT */
 #ifndef SD_MC_INIT
 #define SD_MC_INIT (struct sched_domain) {             \
-       .span                   = CPU_MASK_NONE,        \
-       .parent                 = NULL,                 \
-       .child                  = NULL,                 \
-       .groups                 = NULL,                 \
        .min_interval           = 1,                    \
        .max_interval           = 4,                    \
        .busy_factor            = 64,                   \
        .imbalance_pct          = 125,                  \
        .cache_nice_tries       = 1,                    \
        .busy_idx               = 2,                    \
-       .idle_idx               = 0,                    \
-       .newidle_idx            = 0,                    \
        .wake_idx               = 1,                    \
        .forkexec_idx           = 1,                    \
        .flags                  = SD_LOAD_BALANCE       \
@@ -144,7 +128,6 @@ void arch_update_cpu_topology(void);
                                | BALANCE_FOR_MC_POWER, \
        .last_balance           = jiffies,              \
        .balance_interval       = 1,                    \
-       .nr_balance_failed      = 0,                    \
 }
 #endif
 #endif /* CONFIG_SCHED_MC */
@@ -152,10 +135,6 @@ void arch_update_cpu_topology(void);
 /* Common values for CPUs */
 #ifndef SD_CPU_INIT
 #define SD_CPU_INIT (struct sched_domain) {            \
-       .span                   = CPU_MASK_NONE,        \
-       .parent                 = NULL,                 \
-       .child                  = NULL,                 \
-       .groups                 = NULL,                 \
        .min_interval           = 1,                    \
        .max_interval           = 4,                    \
        .busy_factor            = 64,                   \
@@ -174,16 +153,11 @@ void arch_update_cpu_topology(void);
                                | BALANCE_FOR_PKG_POWER,\
        .last_balance           = jiffies,              \
        .balance_interval       = 1,                    \
-       .nr_balance_failed      = 0,                    \
 }
 #endif
 
 /* sched_domains SD_ALLNODES_INIT for NUMA machines */
 #define SD_ALLNODES_INIT (struct sched_domain) {       \
-       .span                   = CPU_MASK_NONE,        \
-       .parent                 = NULL,                 \
-       .child                  = NULL,                 \
-       .groups                 = NULL,                 \
        .min_interval           = 64,                   \
        .max_interval           = 64*num_online_cpus(), \
        .busy_factor            = 128,                  \
@@ -191,14 +165,10 @@ void arch_update_cpu_topology(void);
        .cache_nice_tries       = 1,                    \
        .busy_idx               = 3,                    \
        .idle_idx               = 3,                    \
-       .newidle_idx            = 0, /* unused */       \
-       .wake_idx               = 0, /* unused */       \
-       .forkexec_idx           = 0, /* unused */       \
        .flags                  = SD_LOAD_BALANCE       \
                                | SD_SERIALIZE, \
        .last_balance           = jiffies,              \
        .balance_interval       = 64,                   \
-       .nr_balance_failed      = 0,                    \
 }
 
 #ifdef CONFIG_NUMA
index 6696cf79c4f72744a6e3494f1c9b82d5def8271e..eaec1ea9558ee6aa8267050a212267f3394dcc4a 100644 (file)
@@ -17,11 +17,11 @@ struct transport_container;
 struct transport_class {
        struct class class;
        int (*setup)(struct transport_container *, struct device *,
-                    struct class_device *);
+                    struct device *);
        int (*configure)(struct transport_container *, struct device *,
-                        struct class_device *);
+                        struct device *);
        int (*remove)(struct transport_container *, struct device *,
-                     struct class_device *);
+                     struct device *);
 };
 
 #define DECLARE_TRANSPORT_CLASS(cls, nm, su, rm, cfg)                  \
diff --git a/include/linux/usb/atmel_usba_udc.h b/include/linux/usb/atmel_usba_udc.h
new file mode 100644 (file)
index 0000000..6311fa2
--- /dev/null
@@ -0,0 +1,22 @@
+/*
+ * Platform data definitions for Atmel USBA gadget driver.
+ */
+#ifndef __LINUX_USB_USBA_H
+#define __LINUX_USB_USBA_H
+
+struct usba_ep_data {
+       char    *name;
+       int     index;
+       int     fifo_size;
+       int     nr_banks;
+       int     can_dma;
+       int     can_isoc;
+};
+
+struct usba_platform_data {
+       int                     vbus_pin;
+       int                     num_ep;
+       struct usba_ep_data     ep[0];
+};
+
+#endif /* __LINUX_USB_USBA_H */
index 95bf4bac44cb3babc459fb0f0e7313d15a91069e..2dcbecce3f61201a13710d104bc69f746f265823 100644 (file)
@@ -1051,7 +1051,7 @@ struct ib_device {
        struct ib_dma_mapping_ops   *dma_ops;
 
        struct module               *owner;
-       struct class_device          class_dev;
+       struct device                dev;
        struct kobject               *ports_parent;
        struct list_head             port_list;
 
index 98724ba65a79751d483e4aeb3ec4cd449b17bb2d..e78d3b62d8ec76d5bce350f9f996bcdd26439670 100644 (file)
@@ -32,7 +32,6 @@
 #include <scsi/sas.h>
 #include <linux/libata.h>
 #include <linux/list.h>
-#include <asm/semaphore.h>
 #include <scsi/scsi_device.h>
 #include <scsi/scsi_cmnd.h>
 #include <scsi/scsi_transport_sas.h>
index ab7acbe809602b94e693da7fac9bc12a8ad47a89..b8b19e2f57bbece76e739752961ce91979512f23 100644 (file)
@@ -156,8 +156,8 @@ struct scsi_device {
 
        int timeout;
 
-       struct device           sdev_gendev;
-       struct class_device     sdev_classdev;
+       struct device           sdev_gendev,
+                               sdev_dev;
 
        struct execute_work     ew; /* used to get process context on put */
 
@@ -167,9 +167,9 @@ struct scsi_device {
 #define        to_scsi_device(d)       \
        container_of(d, struct scsi_device, sdev_gendev)
 #define        class_to_sdev(d)        \
-       container_of(d, struct scsi_device, sdev_classdev)
+       container_of(d, struct scsi_device, sdev_dev)
 #define transport_class_to_sdev(class_dev) \
-       to_scsi_device(class_dev->dev)
+       to_scsi_device(class_dev->parent)
 
 #define sdev_printk(prefix, sdev, fmt, a...)   \
        dev_printk(prefix, &(sdev)->sdev_gendev, fmt, ##a)
@@ -220,7 +220,7 @@ static inline struct scsi_target *scsi_target(struct scsi_device *sdev)
        return to_scsi_target(sdev->sdev_gendev.parent);
 }
 #define transport_class_to_starget(class_dev) \
-       to_scsi_target(class_dev->dev)
+       to_scsi_target(class_dev->parent)
 
 #define starget_printk(prefix, starget, fmt, a...)     \
        dev_printk(prefix, &(starget)->dev, fmt, ##a)
index 49132862bfaaf7098bcdb72b0cb5e833976b89cc..d967d6dc7a28d7de7d58eb40b4a2258c4187c2a8 100644 (file)
@@ -470,7 +470,7 @@ struct scsi_host_template {
        /*
         * Pointer to the sysfs class properties for this host, NULL terminated.
         */
-       struct class_device_attribute **shost_attrs;
+       struct device_attribute **shost_attrs;
 
        /*
         * Pointer to the SCSI device properties for this host, NULL terminated.
@@ -655,8 +655,7 @@ struct Scsi_Host {
        enum scsi_host_state shost_state;
 
        /* ldm bits */
-       struct device           shost_gendev;
-       struct class_device     shost_classdev;
+       struct device           shost_gendev, shost_dev;
 
        /*
         * List of hosts per template.
@@ -683,7 +682,7 @@ struct Scsi_Host {
 };
 
 #define                class_to_shost(d)       \
-       container_of(d, struct Scsi_Host, shost_classdev)
+       container_of(d, struct Scsi_Host, shost_dev)
 
 #define shost_printk(prefix, shost, fmt, a...) \
        dev_printk(prefix, &(shost)->shost_gendev, fmt, ##a)
index 0dfef752f0e27c7c9009a2dbe378522322d453a4..490bd13a634cc7eff4e61bfab5104b1e28047e2a 100644 (file)
@@ -80,7 +80,7 @@ struct scsi_transport_template {
 };
 
 #define transport_class_to_shost(tc) \
-       dev_to_shost((tc)->dev)
+       dev_to_shost((tc)->parent)
 
 
 /* Private area maintenance. The driver requested allocations come
index 4769efd4db24ec745cd4f5baff15fcfa76e12e5c..06f72bab9df0af520039506ece89079d549178aa 100644 (file)
@@ -163,8 +163,8 @@ enum fc_tgtid_binding_type  {
 
 
 /* Macro for use in defining Virtual Port attributes */
-#define FC_VPORT_ATTR(_name,_mode,_show,_store)                                \
-struct class_device_attribute class_device_attr_vport_##_name =        \
+#define FC_VPORT_ATTR(_name,_mode,_show,_store)                \
+struct device_attribute dev_attr_vport_##_name =       \
        __ATTR(_name,_mode,_show,_store)
 
 
@@ -234,8 +234,8 @@ struct fc_vport {
 
 #define        dev_to_vport(d)                         \
        container_of(d, struct fc_vport, dev)
-#define transport_class_to_vport(classdev)     \
-       dev_to_vport(classdev->dev)
+#define transport_class_to_vport(dev)          \
+       dev_to_vport(dev->parent)
 #define vport_to_shost(v)                      \
        (v->shost)
 #define vport_to_shost_channel(v)              \
@@ -271,7 +271,7 @@ struct fc_rport_identifiers {
 
 /* Macro for use in defining Remote Port attributes */
 #define FC_RPORT_ATTR(_name,_mode,_show,_store)                                \
-struct class_device_attribute class_device_attr_rport_##_name =        \
+struct device_attribute dev_attr_rport_##_name =       \
        __ATTR(_name,_mode,_show,_store)
 
 
@@ -341,8 +341,8 @@ struct fc_rport {   /* aka fc_starget_attrs */
 
 #define        dev_to_rport(d)                         \
        container_of(d, struct fc_rport, dev)
-#define transport_class_to_rport(classdev)     \
-       dev_to_rport(classdev->dev)
+#define transport_class_to_rport(dev)  \
+       dev_to_rport(dev->parent)
 #define rport_to_shost(r)                      \
        dev_to_shost(r->dev.parent)
 
index 09125fa95b93a1d834957e7a66cfed67e77e4278..61ad3594aad65c3fc4259e7d4a112c161a9e83bb 100644 (file)
@@ -80,8 +80,8 @@ struct sas_phy {
 
 #define dev_to_phy(d) \
        container_of((d), struct sas_phy, dev)
-#define transport_class_to_phy(cdev) \
-       dev_to_phy((cdev)->dev)
+#define transport_class_to_phy(dev) \
+       dev_to_phy((dev)->parent)
 #define phy_to_shost(phy) \
        dev_to_shost((phy)->dev.parent)
 
@@ -96,8 +96,8 @@ struct sas_rphy {
 
 #define dev_to_rphy(d) \
        container_of((d), struct sas_rphy, dev)
-#define transport_class_to_rphy(cdev) \
-       dev_to_rphy((cdev)->dev)
+#define transport_class_to_rphy(dev) \
+       dev_to_rphy((dev)->parent)
 #define rphy_to_shost(rphy) \
        dev_to_shost((rphy)->dev.parent)
 #define target_to_rphy(targ) \
@@ -152,8 +152,8 @@ struct sas_port {
 
 #define dev_to_sas_port(d) \
        container_of((d), struct sas_port, dev)
-#define transport_class_to_sas_port(cdev) \
-       dev_to_sas_port((cdev)->dev)
+#define transport_class_to_sas_port(dev) \
+       dev_to_sas_port((dev)->parent)
 
 struct sas_phy_linkrates {
        enum sas_linkrate maximum_linkrate;
index 8ea9f7358ac1dde7a8a28d9442f366304b2e2929..4f032d48cb6ec9a14b9dc2d0632981accfb0f592 100644 (file)
@@ -34,7 +34,7 @@
 struct scsi_disk {
        struct scsi_driver *driver;     /* always &sd_template */
        struct scsi_device *device;
-       struct class_device cdev;
+       struct device   dev;
        struct gendisk  *disk;
        unsigned int    openers;        /* protected by BKL for now, yuck */
        sector_t        capacity;       /* size in 512-byte sectors */
@@ -46,7 +46,7 @@ struct scsi_disk {
        unsigned        RCD : 1;        /* state of disk RCD bit, unused */
        unsigned        DPOFUA : 1;     /* state of disk DPOFUA bit */
 };
-#define to_scsi_disk(obj) container_of(obj,struct scsi_disk,cdev)
+#define to_scsi_disk(obj) container_of(obj,struct scsi_disk,dev)
 
 #define sd_printk(prefix, sdsk, fmt, a...)                             \
         (sdsk)->disk ?                                                 \
index 7fccf09bb95ad8adeb929829dc1bb624c84ffc82..ba3a389fab94dcef61341973de66ae12992892cf 100644 (file)
@@ -328,6 +328,13 @@ config RT_GROUP_SCHED
        depends on EXPERIMENTAL
        depends on GROUP_SCHED
        default n
+       help
+         This feature lets you explicitly allocate real CPU bandwidth
+         to users or control groups (depending on the "Basis for grouping tasks"
+         setting below. If enabled, it will also make it impossible to
+         schedule realtime tasks for non-root users until you allocate
+         realtime bandwidth for them.
+         See Documentation/sched-rt-group.txt for more information.
 
 choice
        depends on GROUP_SCHED
index 99ce94930b09302f7af89f75c07d7daa6a7ef668..833a67df1f7e06c121c4b9b982893592ca7219df 100644 (file)
@@ -359,10 +359,31 @@ static void __init smp_init(void)
 #endif
 
 static inline void setup_per_cpu_areas(void) { }
+static inline void setup_nr_cpu_ids(void) { }
 static inline void smp_prepare_cpus(unsigned int maxcpus) { }
 
 #else
 
+#if NR_CPUS > BITS_PER_LONG
+cpumask_t cpu_mask_all __read_mostly = CPU_MASK_ALL;
+EXPORT_SYMBOL(cpu_mask_all);
+#endif
+
+/* Setup number of possible processor ids */
+int nr_cpu_ids __read_mostly = NR_CPUS;
+EXPORT_SYMBOL(nr_cpu_ids);
+
+/* An arch may set nr_cpu_ids earlier if needed, so this would be redundant */
+static void __init setup_nr_cpu_ids(void)
+{
+       int cpu, highest_cpu = 0;
+
+       for_each_possible_cpu(cpu)
+               highest_cpu = cpu;
+
+       nr_cpu_ids = highest_cpu + 1;
+}
+
 #ifndef CONFIG_HAVE_SETUP_PER_CPU_AREA
 unsigned long __per_cpu_offset[NR_CPUS] __read_mostly;
 
@@ -537,6 +558,7 @@ asmlinkage void __init start_kernel(void)
        setup_command_line(command_line);
        unwind_setup();
        setup_per_cpu_areas();
+       setup_nr_cpu_ids();
        smp_prepare_boot_cpu(); /* arch-specific boot-cpu hooks */
 
        /*
@@ -811,7 +833,7 @@ static int __init kernel_init(void * unused)
        /*
         * init can run on any cpu.
         */
-       set_cpus_allowed(current, CPU_MASK_ALL);
+       set_cpus_allowed_ptr(current, CPU_MASK_ALL_PTR);
        /*
         * Tell the world that we're going to be the grim
         * reaper of innocent orphaned children.
index 60f7a27f7a9e4ddeacb1eb95e1d867860b964f3c..94fd3b08fb77036d35ecd1a337785f1847fe1613 100644 (file)
@@ -598,6 +598,7 @@ static struct file *do_create(struct dentry *dir, struct dentry *dentry,
                        int oflag, mode_t mode, struct mq_attr __user *u_attr)
 {
        struct mq_attr attr;
+       struct file *result;
        int ret;
 
        if (u_attr) {
@@ -612,13 +613,24 @@ static struct file *do_create(struct dentry *dir, struct dentry *dentry,
        }
 
        mode &= ~current->fs->umask;
+       ret = mnt_want_write(mqueue_mnt);
+       if (ret)
+               goto out;
        ret = vfs_create(dir->d_inode, dentry, mode, NULL);
        dentry->d_fsdata = NULL;
        if (ret)
-               goto out;
-
-       return dentry_open(dentry, mqueue_mnt, oflag);
-
+               goto out_drop_write;
+
+       result = dentry_open(dentry, mqueue_mnt, oflag);
+       /*
+        * dentry_open() took a persistent mnt_want_write(),
+        * so we can now drop this one.
+        */
+       mnt_drop_write(mqueue_mnt);
+       return result;
+
+out_drop_write:
+       mnt_drop_write(mqueue_mnt);
 out:
        dput(dentry);
        mntput(mqueue_mnt);
@@ -742,8 +754,11 @@ asmlinkage long sys_mq_unlink(const char __user *u_name)
        inode = dentry->d_inode;
        if (inode)
                atomic_inc(&inode->i_count);
-
+       err = mnt_want_write(mqueue_mnt);
+       if (err)
+               goto out_err;
        err = vfs_unlink(dentry->d_parent->d_inode, dentry);
+       mnt_drop_write(mqueue_mnt);
 out_err:
        dput(dentry);
 
index 9c48abfcd4a528ced37ea31cc0315d03c7691e78..e1ef04870c2a12122fddfd3a712ed6e6d2a441ea 100644 (file)
@@ -445,7 +445,7 @@ asmlinkage long compat_sys_sched_setaffinity(compat_pid_t pid,
        if (retval)
                return retval;
 
-       return sched_setaffinity(pid, new_mask);
+       return sched_setaffinity(pid, &new_mask);
 }
 
 asmlinkage long compat_sys_sched_getaffinity(compat_pid_t pid, unsigned int len,
index 2eff3f63abed6c91c2bbcb1c8d0eccbb97d54c7d..2011ad8d26973fae39a373aa4121ea2fd3f0b8d1 100644 (file)
@@ -232,9 +232,9 @@ static int _cpu_down(unsigned int cpu, int tasks_frozen)
 
        /* Ensure that we are not runnable on dying cpu */
        old_allowed = current->cpus_allowed;
-       tmp = CPU_MASK_ALL;
+       cpus_setall(tmp);
        cpu_clear(cpu, tmp);
-       set_cpus_allowed(current, tmp);
+       set_cpus_allowed_ptr(current, &tmp);
 
        p = __stop_machine_run(take_cpu_down, &tcd_param, cpu);
 
@@ -268,7 +268,7 @@ static int _cpu_down(unsigned int cpu, int tasks_frozen)
 out_thread:
        err = kthread_stop(p);
 out_allowed:
-       set_cpus_allowed(current, old_allowed);
+       set_cpus_allowed_ptr(current, &old_allowed);
 out_release:
        cpu_hotplug_done();
        return err;
index a1b61f414228ea031cc40ea9ea17ab95e264ceaf..8b35fbd8292f2d5b53b613eab630c67af87ec6f8 100644 (file)
@@ -98,6 +98,9 @@ struct cpuset {
        /* partition number for rebuild_sched_domains() */
        int pn;
 
+       /* for custom sched domain */
+       int relax_domain_level;
+
        /* used for walking a cpuset heirarchy */
        struct list_head stack_list;
 };
@@ -478,6 +481,16 @@ static int cpusets_overlap(struct cpuset *a, struct cpuset *b)
        return cpus_intersects(a->cpus_allowed, b->cpus_allowed);
 }
 
+static void
+update_domain_attr(struct sched_domain_attr *dattr, struct cpuset *c)
+{
+       if (!dattr)
+               return;
+       if (dattr->relax_domain_level < c->relax_domain_level)
+               dattr->relax_domain_level = c->relax_domain_level;
+       return;
+}
+
 /*
  * rebuild_sched_domains()
  *
@@ -553,12 +566,14 @@ static void rebuild_sched_domains(void)
        int csn;                /* how many cpuset ptrs in csa so far */
        int i, j, k;            /* indices for partition finding loops */
        cpumask_t *doms;        /* resulting partition; i.e. sched domains */
+       struct sched_domain_attr *dattr;  /* attributes for custom domains */
        int ndoms;              /* number of sched domains in result */
        int nslot;              /* next empty doms[] cpumask_t slot */
 
        q = NULL;
        csa = NULL;
        doms = NULL;
+       dattr = NULL;
 
        /* Special case for the 99% of systems with one, full, sched domain */
        if (is_sched_load_balance(&top_cpuset)) {
@@ -566,6 +581,11 @@ static void rebuild_sched_domains(void)
                doms = kmalloc(sizeof(cpumask_t), GFP_KERNEL);
                if (!doms)
                        goto rebuild;
+               dattr = kmalloc(sizeof(struct sched_domain_attr), GFP_KERNEL);
+               if (dattr) {
+                       *dattr = SD_ATTR_INIT;
+                       update_domain_attr(dattr, &top_cpuset);
+               }
                *doms = top_cpuset.cpus_allowed;
                goto rebuild;
        }
@@ -622,6 +642,7 @@ restart:
        doms = kmalloc(ndoms * sizeof(cpumask_t), GFP_KERNEL);
        if (!doms)
                goto rebuild;
+       dattr = kmalloc(ndoms * sizeof(struct sched_domain_attr), GFP_KERNEL);
 
        for (nslot = 0, i = 0; i < csn; i++) {
                struct cpuset *a = csa[i];
@@ -644,12 +665,15 @@ restart:
                        }
 
                        cpus_clear(*dp);
+                       if (dattr)
+                               *(dattr + nslot) = SD_ATTR_INIT;
                        for (j = i; j < csn; j++) {
                                struct cpuset *b = csa[j];
 
                                if (apn == b->pn) {
                                        cpus_or(*dp, *dp, b->cpus_allowed);
                                        b->pn = -1;
+                                       update_domain_attr(dattr, b);
                                }
                        }
                        nslot++;
@@ -660,7 +684,7 @@ restart:
 rebuild:
        /* Have scheduler rebuild sched domains */
        get_online_cpus();
-       partition_sched_domains(ndoms, doms);
+       partition_sched_domains(ndoms, doms, dattr);
        put_online_cpus();
 
 done:
@@ -668,6 +692,7 @@ done:
                kfifo_free(q);
        kfree(csa);
        /* Don't kfree(doms) -- partition_sched_domains() does that. */
+       /* Don't kfree(dattr) -- partition_sched_domains() does that. */
 }
 
 static inline int started_after_time(struct task_struct *t1,
@@ -729,7 +754,7 @@ int cpuset_test_cpumask(struct task_struct *tsk, struct cgroup_scanner *scan)
  */
 void cpuset_change_cpumask(struct task_struct *tsk, struct cgroup_scanner *scan)
 {
-       set_cpus_allowed(tsk, (cgroup_cs(scan->cg))->cpus_allowed);
+       set_cpus_allowed_ptr(tsk, &((cgroup_cs(scan->cg))->cpus_allowed));
 }
 
 /**
@@ -1011,6 +1036,21 @@ static int update_memory_pressure_enabled(struct cpuset *cs, char *buf)
        return 0;
 }
 
+static int update_relax_domain_level(struct cpuset *cs, char *buf)
+{
+       int val = simple_strtol(buf, NULL, 10);
+
+       if (val < 0)
+               val = -1;
+
+       if (val != cs->relax_domain_level) {
+               cs->relax_domain_level = val;
+               rebuild_sched_domains();
+       }
+
+       return 0;
+}
+
 /*
  * update_flag - read a 0 or a 1 in a file and update associated flag
  * bit:        the bit to update (CS_CPU_EXCLUSIVE, CS_MEM_EXCLUSIVE,
@@ -1178,7 +1218,7 @@ static void cpuset_attach(struct cgroup_subsys *ss,
 
        mutex_lock(&callback_mutex);
        guarantee_online_cpus(cs, &cpus);
-       set_cpus_allowed(tsk, cpus);
+       set_cpus_allowed_ptr(tsk, &cpus);
        mutex_unlock(&callback_mutex);
 
        from = oldcs->mems_allowed;
@@ -1202,6 +1242,7 @@ typedef enum {
        FILE_CPU_EXCLUSIVE,
        FILE_MEM_EXCLUSIVE,
        FILE_SCHED_LOAD_BALANCE,
+       FILE_SCHED_RELAX_DOMAIN_LEVEL,
        FILE_MEMORY_PRESSURE_ENABLED,
        FILE_MEMORY_PRESSURE,
        FILE_SPREAD_PAGE,
@@ -1256,6 +1297,9 @@ static ssize_t cpuset_common_file_write(struct cgroup *cont,
        case FILE_SCHED_LOAD_BALANCE:
                retval = update_flag(CS_SCHED_LOAD_BALANCE, cs, buffer);
                break;
+       case FILE_SCHED_RELAX_DOMAIN_LEVEL:
+               retval = update_relax_domain_level(cs, buffer);
+               break;
        case FILE_MEMORY_MIGRATE:
                retval = update_flag(CS_MEMORY_MIGRATE, cs, buffer);
                break;
@@ -1354,6 +1398,9 @@ static ssize_t cpuset_common_file_read(struct cgroup *cont,
        case FILE_SCHED_LOAD_BALANCE:
                *s++ = is_sched_load_balance(cs) ? '1' : '0';
                break;
+       case FILE_SCHED_RELAX_DOMAIN_LEVEL:
+               s += sprintf(s, "%d", cs->relax_domain_level);
+               break;
        case FILE_MEMORY_MIGRATE:
                *s++ = is_memory_migrate(cs) ? '1' : '0';
                break;
@@ -1424,6 +1471,13 @@ static struct cftype cft_sched_load_balance = {
        .private = FILE_SCHED_LOAD_BALANCE,
 };
 
+static struct cftype cft_sched_relax_domain_level = {
+       .name = "sched_relax_domain_level",
+       .read = cpuset_common_file_read,
+       .write = cpuset_common_file_write,
+       .private = FILE_SCHED_RELAX_DOMAIN_LEVEL,
+};
+
 static struct cftype cft_memory_migrate = {
        .name = "memory_migrate",
        .read = cpuset_common_file_read,
@@ -1475,6 +1529,9 @@ static int cpuset_populate(struct cgroup_subsys *ss, struct cgroup *cont)
                return err;
        if ((err = cgroup_add_file(cont, ss, &cft_sched_load_balance)) < 0)
                return err;
+       if ((err = cgroup_add_file(cont, ss,
+                                       &cft_sched_relax_domain_level)) < 0)
+               return err;
        if ((err = cgroup_add_file(cont, ss, &cft_memory_pressure)) < 0)
                return err;
        if ((err = cgroup_add_file(cont, ss, &cft_spread_page)) < 0)
@@ -1555,10 +1612,11 @@ static struct cgroup_subsys_state *cpuset_create(
        if (is_spread_slab(parent))
                set_bit(CS_SPREAD_SLAB, &cs->flags);
        set_bit(CS_SCHED_LOAD_BALANCE, &cs->flags);
-       cs->cpus_allowed = CPU_MASK_NONE;
-       cs->mems_allowed = NODE_MASK_NONE;
+       cpus_clear(cs->cpus_allowed);
+       nodes_clear(cs->mems_allowed);
        cs->mems_generation = cpuset_mems_generation++;
        fmeter_init(&cs->fmeter);
+       cs->relax_domain_level = -1;
 
        cs->parent = parent;
        number_of_cpusets++;
@@ -1625,12 +1683,13 @@ int __init cpuset_init(void)
 {
        int err = 0;
 
-       top_cpuset.cpus_allowed = CPU_MASK_ALL;
-       top_cpuset.mems_allowed = NODE_MASK_ALL;
+       cpus_setall(top_cpuset.cpus_allowed);
+       nodes_setall(top_cpuset.mems_allowed);
 
        fmeter_init(&top_cpuset.fmeter);
        top_cpuset.mems_generation = cpuset_mems_generation++;
        set_bit(CS_SCHED_LOAD_BALANCE, &top_cpuset.flags);
+       top_cpuset.relax_domain_level = -1;
 
        err = register_filesystem(&cpuset_fs_type);
        if (err < 0)
@@ -1844,6 +1903,7 @@ void __init cpuset_init_smp(void)
 
  * cpuset_cpus_allowed - return cpus_allowed mask from a tasks cpuset.
  * @tsk: pointer to task_struct from which to obtain cpuset->cpus_allowed.
+ * @pmask: pointer to cpumask_t variable to receive cpus_allowed set.
  *
  * Description: Returns the cpumask_t cpus_allowed of the cpuset
  * attached to the specified @tsk.  Guaranteed to return some non-empty
@@ -1851,35 +1911,27 @@ void __init cpuset_init_smp(void)
  * tasks cpuset.
  **/
 
-cpumask_t cpuset_cpus_allowed(struct task_struct *tsk)
+void cpuset_cpus_allowed(struct task_struct *tsk, cpumask_t *pmask)
 {
-       cpumask_t mask;
-
        mutex_lock(&callback_mutex);
-       mask = cpuset_cpus_allowed_locked(tsk);
+       cpuset_cpus_allowed_locked(tsk, pmask);
        mutex_unlock(&callback_mutex);
-
-       return mask;
 }
 
 /**
  * cpuset_cpus_allowed_locked - return cpus_allowed mask from a tasks cpuset.
  * Must be called with callback_mutex held.
  **/
-cpumask_t cpuset_cpus_allowed_locked(struct task_struct *tsk)
+void cpuset_cpus_allowed_locked(struct task_struct *tsk, cpumask_t *pmask)
 {
-       cpumask_t mask;
-
        task_lock(tsk);
-       guarantee_online_cpus(task_cs(tsk), &mask);
+       guarantee_online_cpus(task_cs(tsk), pmask);
        task_unlock(tsk);
-
-       return mask;
 }
 
 void cpuset_init_current_mems_allowed(void)
 {
-       current->mems_allowed = NODE_MASK_ALL;
+       nodes_setall(current->mems_allowed);
 }
 
 /**
@@ -2261,8 +2313,16 @@ void cpuset_task_status_allowed(struct seq_file *m, struct task_struct *task)
        m->count += cpumask_scnprintf(m->buf + m->count, m->size - m->count,
                                        task->cpus_allowed);
        seq_printf(m, "\n");
+       seq_printf(m, "Cpus_allowed_list:\t");
+       m->count += cpulist_scnprintf(m->buf + m->count, m->size - m->count,
+                                       task->cpus_allowed);
+       seq_printf(m, "\n");
        seq_printf(m, "Mems_allowed:\t");
        m->count += nodemask_scnprintf(m->buf + m->count, m->size - m->count,
                                        task->mems_allowed);
        seq_printf(m, "\n");
+       seq_printf(m, "Mems_allowed_list:\t");
+       m->count += nodelist_scnprintf(m->buf + m->count, m->size - m->count,
+                                       task->mems_allowed);
+       seq_printf(m, "\n");
 }
index 9c042f901570e1b789d40fdbda111739c733cdb4..89fe414645e9b76aa777a0de7b5e9d6777814a0f 100644 (file)
@@ -132,6 +132,14 @@ void __put_task_struct(struct task_struct *tsk)
                free_task(tsk);
 }
 
+/*
+ * macro override instead of weak attribute alias, to workaround
+ * gcc 4.1.0 and 4.1.1 bugs with weak attribute and empty functions.
+ */
+#ifndef arch_task_cache_init
+#define arch_task_cache_init()
+#endif
+
 void __init fork_init(unsigned long mempages)
 {
 #ifndef __HAVE_ARCH_TASK_STRUCT_ALLOCATOR
@@ -144,6 +152,9 @@ void __init fork_init(unsigned long mempages)
                        ARCH_MIN_TASKALIGN, SLAB_PANIC, NULL);
 #endif
 
+       /* do the arch specific task caches init */
+       arch_task_cache_init();
+
        /*
         * The default maximum number of threads is set to a safe
         * value: the thread structures can take up at most half
@@ -163,6 +174,13 @@ void __init fork_init(unsigned long mempages)
                init_task.signal->rlim[RLIMIT_NPROC];
 }
 
+int __attribute__((weak)) arch_dup_task_struct(struct task_struct *dst,
+                                              struct task_struct *src)
+{
+       *dst = *src;
+       return 0;
+}
+
 static struct task_struct *dup_task_struct(struct task_struct *orig)
 {
        struct task_struct *tsk;
@@ -181,15 +199,15 @@ static struct task_struct *dup_task_struct(struct task_struct *orig)
                return NULL;
        }
 
-       *tsk = *orig;
+       err = arch_dup_task_struct(tsk, orig);
+       if (err)
+               goto out;
+
        tsk->stack = ti;
 
        err = prop_local_init_single(&tsk->dirties);
-       if (err) {
-               free_thread_info(ti);
-               free_task_struct(tsk);
-               return NULL;
-       }
+       if (err)
+               goto out;
 
        setup_thread_stack(tsk, orig);
 
@@ -205,6 +223,11 @@ static struct task_struct *dup_task_struct(struct task_struct *orig)
 #endif
        tsk->splice_pipe = NULL;
        return tsk;
+
+out:
+       free_thread_info(ti);
+       free_task_struct(tsk);
+       return NULL;
 }
 
 #ifdef CONFIG_MMU
index c642ef75069f28f4b230bea197dcbf86e3ea4b95..f78777abe769e1e3608b8f751d1c996f05aeea13 100644 (file)
@@ -1238,51 +1238,50 @@ void hrtimer_run_pending(void)
 /*
  * Called from hardirq context every jiffy
  */
-static inline void run_hrtimer_queue(struct hrtimer_cpu_base *cpu_base,
-                                    int index)
+void hrtimer_run_queues(void)
 {
        struct rb_node *node;
-       struct hrtimer_clock_base *base = &cpu_base->clock_base[index];
+       struct hrtimer_cpu_base *cpu_base = &__get_cpu_var(hrtimer_bases);
+       struct hrtimer_clock_base *base;
+       int index, gettime = 1;
 
-       if (!base->first)
+       if (hrtimer_hres_active())
                return;
 
-       if (base->get_softirq_time)
-               base->softirq_time = base->get_softirq_time();
-
-       spin_lock(&cpu_base->lock);
+       for (index = 0; index < HRTIMER_MAX_CLOCK_BASES; index++) {
+               base = &cpu_base->clock_base[index];
 
-       while ((node = base->first)) {
-               struct hrtimer *timer;
-
-               timer = rb_entry(node, struct hrtimer, node);
-               if (base->softirq_time.tv64 <= timer->expires.tv64)
-                       break;
-
-               if (timer->cb_mode == HRTIMER_CB_SOFTIRQ) {
-                       __remove_hrtimer(timer, base, HRTIMER_STATE_PENDING, 0);
-                       list_add_tail(&timer->cb_entry,
-                                       &base->cpu_base->cb_pending);
+               if (!base->first)
                        continue;
+
+               if (base->get_softirq_time)
+                       base->softirq_time = base->get_softirq_time();
+               else if (gettime) {
+                       hrtimer_get_softirq_time(cpu_base);
+                       gettime = 0;
                }
 
-               __run_hrtimer(timer);
-       }
-       spin_unlock(&cpu_base->lock);
-}
+               spin_lock(&cpu_base->lock);
 
-void hrtimer_run_queues(void)
-{
-       struct hrtimer_cpu_base *cpu_base = &__get_cpu_var(hrtimer_bases);
-       int i;
+               while ((node = base->first)) {
+                       struct hrtimer *timer;
 
-       if (hrtimer_hres_active())
-               return;
+                       timer = rb_entry(node, struct hrtimer, node);
+                       if (base->softirq_time.tv64 <= timer->expires.tv64)
+                               break;
 
-       hrtimer_get_softirq_time(cpu_base);
+                       if (timer->cb_mode == HRTIMER_CB_SOFTIRQ) {
+                               __remove_hrtimer(timer, base,
+                                       HRTIMER_STATE_PENDING, 0);
+                               list_add_tail(&timer->cb_entry,
+                                       &base->cpu_base->cb_pending);
+                               continue;
+                       }
 
-       for (i = 0; i < HRTIMER_MAX_CLOCK_BASES; i++)
-               run_hrtimer_queue(cpu_base, i);
+                       __run_hrtimer(timer);
+               }
+               spin_unlock(&cpu_base->lock);
+       }
 }
 
 /*
index fdb3fbe2b0c4cbb2e0512098c24a0a5a83f21c0d..964964baefa23c2a8bdee504aa053d078ba29ad9 100644 (file)
@@ -47,7 +47,7 @@ void dynamic_irq_init(unsigned int irq)
        desc->irq_count = 0;
        desc->irqs_unhandled = 0;
 #ifdef CONFIG_SMP
-       desc->affinity = CPU_MASK_ALL;
+       cpus_setall(desc->affinity);
 #endif
        spin_unlock_irqrestore(&desc->lock, flags);
 }
index 06a0e27756516e047e5df59b91d4b4fc8d81753f..6782dce93d018b15d0a789187c8179d023a991e7 100644 (file)
@@ -29,7 +29,6 @@
 #include <asm/uaccess.h>
 #include <asm/io.h>
 #include <asm/system.h>
-#include <asm/semaphore.h>
 #include <asm/sections.h>
 
 /* Per cpu memory for storing cpu states in case of system crash. */
index 22be3ff3f363ac71a319deeb2f55fd0ccbe27c26..e2764047ec03ed123acd3546ff4357341302cabb 100644 (file)
@@ -165,7 +165,7 @@ static int ____call_usermodehelper(void *data)
        }
 
        /* We can run anywhere, unlike our parent keventd(). */
-       set_cpus_allowed(current, CPU_MASK_ALL);
+       set_cpus_allowed_ptr(current, CPU_MASK_ALL_PTR);
 
        /*
         * Our parent is keventd, which runs with elevated scheduling priority.
index 0ac887882f908502425deeebcda4c678812443cb..92cf6930ab51a74e034ae9db30d72b21e9a84e9d 100644 (file)
@@ -13,7 +13,6 @@
 #include <linux/file.h>
 #include <linux/module.h>
 #include <linux/mutex.h>
-#include <asm/semaphore.h>
 
 #define KTHREAD_NICE_LEVEL (-5)
 
@@ -180,6 +179,7 @@ void kthread_bind(struct task_struct *k, unsigned int cpu)
        wait_task_inactive(k);
        set_task_cpu(k, cpu);
        k->cpus_allowed = cpumask_of_cpu(cpu);
+       k->rt.nr_cpus_allowed = 1;
 }
 EXPORT_SYMBOL(kthread_bind);
 
index b4e3c85abe74658d8df264080897f9bacf8b9278..7c74dab0d21b9fcd2235b507b5e450459e042ef6 100644 (file)
@@ -64,8 +64,8 @@ account_global_scheduler_latency(struct task_struct *tsk, struct latency_record
                return;
 
        for (i = 0; i < MAXLR; i++) {
-               int q;
-               int same = 1;
+               int q, same = 1;
+
                /* Nothing stored: */
                if (!latency_record[i].backtrace[0]) {
                        if (firstnonnull > i)
@@ -73,12 +73,15 @@ account_global_scheduler_latency(struct task_struct *tsk, struct latency_record
                        continue;
                }
                for (q = 0 ; q < LT_BACKTRACEDEPTH ; q++) {
-                       if (latency_record[i].backtrace[q] !=
-                               lat->backtrace[q])
+                       unsigned long record = lat->backtrace[q];
+
+                       if (latency_record[i].backtrace[q] != record) {
                                same = 0;
-                       if (same && lat->backtrace[q] == 0)
                                break;
-                       if (same && lat->backtrace[q] == ULONG_MAX)
+                       }
+
+                       /* 0 and ULONG_MAX entries mean end of backtrace: */
+                       if (record == 0 || record == ULONG_MAX)
                                break;
                }
                if (same) {
@@ -143,14 +146,18 @@ account_scheduler_latency(struct task_struct *tsk, int usecs, int inter)
        for (i = 0; i < LT_SAVECOUNT ; i++) {
                struct latency_record *mylat;
                int same = 1;
+
                mylat = &tsk->latency_record[i];
                for (q = 0 ; q < LT_BACKTRACEDEPTH ; q++) {
-                       if (mylat->backtrace[q] !=
-                               lat.backtrace[q])
+                       unsigned long record = lat.backtrace[q];
+
+                       if (mylat->backtrace[q] != record) {
                                same = 0;
-                       if (same && lat.backtrace[q] == 0)
                                break;
-                       if (same && lat.backtrace[q] == ULONG_MAX)
+                       }
+
+                       /* 0 and ULONG_MAX entries mean end of backtrace: */
+                       if (record == 0 || record == ULONG_MAX)
                                break;
                }
                if (same) {
index 5d437bffd8dc7a4219fe471eab6a8699ed08e3df..8d6cccc6c3cf99870f76b00202a2775bd5e2a54f 100644 (file)
@@ -43,7 +43,6 @@
 #include <linux/mutex.h>
 #include <linux/unwind.h>
 #include <asm/uaccess.h>
-#include <asm/semaphore.h>
 #include <asm/cacheflush.h>
 #include <linux/license.h>
 #include <asm/sections.h>
@@ -664,7 +663,7 @@ static void free_module(struct module *mod);
 
 static void wait_for_zero_refcount(struct module *mod)
 {
-       /* Since we might sleep for some time, drop the semaphore first */
+       /* Since we might sleep for some time, release the mutex first */
        mutex_unlock(&module_mutex);
        for (;;) {
                DEBUGP("Looking at refcount...\n");
index a9b04203a66d217096aab486069995c24757788c..8476956ffd9238a378f6c5671649900776939dd0 100644 (file)
@@ -37,7 +37,6 @@
 #include <linux/mutex.h>
 
 #include <asm/uaccess.h>
-#include <asm/semaphore.h>
 #include <linux/list.h>
 #include <linux/init.h>
 #include <linux/compiler.h>
index 3b7a1b055122a698c0f97a05eae8cbe6a229bb6f..606d7387265ccee0c030c0afdf317ede0d943f26 100644 (file)
@@ -23,7 +23,6 @@
 #include <linux/highmem.h>
 #include <linux/mutex.h>
 #include <asm/sections.h>
-#include <asm/semaphore.h>
 #include <asm/irq_regs.h>
 #include <asm/ptrace.h>
 
index fdb34e86f923f188113e7945e63c572c805c65a2..67e392ed5496e97c54100edaa2557e2813d6faa8 100644 (file)
@@ -323,9 +323,8 @@ static int ptrace_setoptions(struct task_struct *child, long data)
        return (data & ~PTRACE_O_MASK) ? -EINVAL : 0;
 }
 
-static int ptrace_getsiginfo(struct task_struct *child, siginfo_t __user * data)
+static int ptrace_getsiginfo(struct task_struct *child, siginfo_t *info)
 {
-       siginfo_t lastinfo;
        int error = -ESRCH;
 
        read_lock(&tasklist_lock);
@@ -333,31 +332,25 @@ static int ptrace_getsiginfo(struct task_struct *child, siginfo_t __user * data)
                error = -EINVAL;
                spin_lock_irq(&child->sighand->siglock);
                if (likely(child->last_siginfo != NULL)) {
-                       lastinfo = *child->last_siginfo;
+                       *info = *child->last_siginfo;
                        error = 0;
                }
                spin_unlock_irq(&child->sighand->siglock);
        }
        read_unlock(&tasklist_lock);
-       if (!error)
-               return copy_siginfo_to_user(data, &lastinfo);
        return error;
 }
 
-static int ptrace_setsiginfo(struct task_struct *child, siginfo_t __user * data)
+static int ptrace_setsiginfo(struct task_struct *child, const siginfo_t *info)
 {
-       siginfo_t newinfo;
        int error = -ESRCH;
 
-       if (copy_from_user(&newinfo, data, sizeof (siginfo_t)))
-               return -EFAULT;
-
        read_lock(&tasklist_lock);
        if (likely(child->sighand != NULL)) {
                error = -EINVAL;
                spin_lock_irq(&child->sighand->siglock);
                if (likely(child->last_siginfo != NULL)) {
-                       *child->last_siginfo = newinfo;
+                       *child->last_siginfo = *info;
                        error = 0;
                }
                spin_unlock_irq(&child->sighand->siglock);
@@ -424,6 +417,7 @@ int ptrace_request(struct task_struct *child, long request,
                   long addr, long data)
 {
        int ret = -EIO;
+       siginfo_t siginfo;
 
        switch (request) {
        case PTRACE_PEEKTEXT:
@@ -442,12 +436,22 @@ int ptrace_request(struct task_struct *child, long request,
        case PTRACE_GETEVENTMSG:
                ret = put_user(child->ptrace_message, (unsigned long __user *) data);
                break;
+
        case PTRACE_GETSIGINFO:
-               ret = ptrace_getsiginfo(child, (siginfo_t __user *) data);
+               ret = ptrace_getsiginfo(child, &siginfo);
+               if (!ret)
+                       ret = copy_siginfo_to_user((siginfo_t __user *) data,
+                                                  &siginfo);
                break;
+
        case PTRACE_SETSIGINFO:
-               ret = ptrace_setsiginfo(child, (siginfo_t __user *) data);
+               if (copy_from_user(&siginfo, (siginfo_t __user *) data,
+                                  sizeof siginfo))
+                       ret = -EFAULT;
+               else
+                       ret = ptrace_setsiginfo(child, &siginfo);
                break;
+
        case PTRACE_DETACH:      /* detach a process that was attached. */
                ret = ptrace_detach(child, data);
                break;
@@ -616,6 +620,7 @@ int compat_ptrace_request(struct task_struct *child, compat_long_t request,
 {
        compat_ulong_t __user *datap = compat_ptr(data);
        compat_ulong_t word;
+       siginfo_t siginfo;
        int ret;
 
        switch (request) {
@@ -638,6 +643,23 @@ int compat_ptrace_request(struct task_struct *child, compat_long_t request,
                ret = put_user((compat_ulong_t) child->ptrace_message, datap);
                break;
 
+       case PTRACE_GETSIGINFO:
+               ret = ptrace_getsiginfo(child, &siginfo);
+               if (!ret)
+                       ret = copy_siginfo_to_user32(
+                               (struct compat_siginfo __user *) datap,
+                               &siginfo);
+               break;
+
+       case PTRACE_SETSIGINFO:
+               memset(&siginfo, 0, sizeof siginfo);
+               if (copy_siginfo_from_user32(
+                           &siginfo, (struct compat_siginfo __user *) datap))
+                       ret = -EFAULT;
+               else
+                       ret = ptrace_setsiginfo(child, &siginfo);
+               break;
+
        default:
                ret = ptrace_request(child, request, addr, data);
        }
index e9517014b57c100af5926165d2131992f0589401..e1cdf196a51507ae644c8a7369b599c5233f8604 100644 (file)
@@ -1007,10 +1007,10 @@ void __synchronize_sched(void)
        if (sched_getaffinity(0, &oldmask) < 0)
                oldmask = cpu_possible_map;
        for_each_online_cpu(cpu) {
-               sched_setaffinity(0, cpumask_of_cpu(cpu));
+               sched_setaffinity(0, &cpumask_of_cpu(cpu));
                schedule();
        }
-       sched_setaffinity(0, oldmask);
+       sched_setaffinity(0, &oldmask);
 }
 EXPORT_SYMBOL_GPL(__synchronize_sched);
 
index fd599829e72a5d49a5852272ba234be8c38accaf..47894f919d4ea2848263a3e1a5ec5218f27237e3 100644 (file)
@@ -723,9 +723,10 @@ static int rcu_idle_cpu;   /* Force all torture tasks off this CPU */
  */
 static void rcu_torture_shuffle_tasks(void)
 {
-       cpumask_t tmp_mask = CPU_MASK_ALL;
+       cpumask_t tmp_mask;
        int i;
 
+       cpus_setall(tmp_mask);
        get_online_cpus();
 
        /* No point in shuffling if there is only one online CPU (ex: UP) */
@@ -737,25 +738,27 @@ static void rcu_torture_shuffle_tasks(void)
        if (rcu_idle_cpu != -1)
                cpu_clear(rcu_idle_cpu, tmp_mask);
 
-       set_cpus_allowed(current, tmp_mask);
+       set_cpus_allowed_ptr(current, &tmp_mask);
 
        if (reader_tasks) {
                for (i = 0; i < nrealreaders; i++)
                        if (reader_tasks[i])
-                               set_cpus_allowed(reader_tasks[i], tmp_mask);
+                               set_cpus_allowed_ptr(reader_tasks[i],
+                                                    &tmp_mask);
        }
 
        if (fakewriter_tasks) {
                for (i = 0; i < nfakewriters; i++)
                        if (fakewriter_tasks[i])
-                               set_cpus_allowed(fakewriter_tasks[i], tmp_mask);
+                               set_cpus_allowed_ptr(fakewriter_tasks[i],
+                                                    &tmp_mask);
        }
 
        if (writer_task)
-               set_cpus_allowed(writer_task, tmp_mask);
+               set_cpus_allowed_ptr(writer_task, &tmp_mask);
 
        if (stats_task)
-               set_cpus_allowed(stats_task, tmp_mask);
+               set_cpus_allowed_ptr(stats_task, &tmp_mask);
 
        if (rcu_idle_cpu == -1)
                rcu_idle_cpu = num_online_cpus() - 1;
index 8dcdec6fe0fe0983f4a90e8d51e501871974d383..57ba7ea9b744558949a6f07bc3f4f11b6a94d483 100644 (file)
 #include <linux/unistd.h>
 #include <linux/pagemap.h>
 #include <linux/hrtimer.h>
+#include <linux/tick.h>
+#include <linux/bootmem.h>
+#include <linux/debugfs.h>
+#include <linux/ctype.h>
 
 #include <asm/tlb.h>
 #include <asm/irq_regs.h>
@@ -114,6 +118,11 @@ unsigned long long __attribute__((weak)) sched_clock(void)
  */
 #define DEF_TIMESLICE          (100 * HZ / 1000)
 
+/*
+ * single value that denotes runtime == period, ie unlimited time.
+ */
+#define RUNTIME_INF    ((u64)~0ULL)
+
 #ifdef CONFIG_SMP
 /*
  * Divide a load by a sched group cpu_power : (load / sg->__cpu_power)
@@ -155,6 +164,84 @@ struct rt_prio_array {
        struct list_head queue[MAX_RT_PRIO];
 };
 
+struct rt_bandwidth {
+       /* nests inside the rq lock: */
+       spinlock_t              rt_runtime_lock;
+       ktime_t                 rt_period;
+       u64                     rt_runtime;
+       struct hrtimer          rt_period_timer;
+};
+
+static struct rt_bandwidth def_rt_bandwidth;
+
+static int do_sched_rt_period_timer(struct rt_bandwidth *rt_b, int overrun);
+
+static enum hrtimer_restart sched_rt_period_timer(struct hrtimer *timer)
+{
+       struct rt_bandwidth *rt_b =
+               container_of(timer, struct rt_bandwidth, rt_period_timer);
+       ktime_t now;
+       int overrun;
+       int idle = 0;
+
+       for (;;) {
+               now = hrtimer_cb_get_time(timer);
+               overrun = hrtimer_forward(timer, now, rt_b->rt_period);
+
+               if (!overrun)
+                       break;
+
+               idle = do_sched_rt_period_timer(rt_b, overrun);
+       }
+
+       return idle ? HRTIMER_NORESTART : HRTIMER_RESTART;
+}
+
+static
+void init_rt_bandwidth(struct rt_bandwidth *rt_b, u64 period, u64 runtime)
+{
+       rt_b->rt_period = ns_to_ktime(period);
+       rt_b->rt_runtime = runtime;
+
+       spin_lock_init(&rt_b->rt_runtime_lock);
+
+       hrtimer_init(&rt_b->rt_period_timer,
+                       CLOCK_MONOTONIC, HRTIMER_MODE_REL);
+       rt_b->rt_period_timer.function = sched_rt_period_timer;
+       rt_b->rt_period_timer.cb_mode = HRTIMER_CB_IRQSAFE_NO_SOFTIRQ;
+}
+
+static void start_rt_bandwidth(struct rt_bandwidth *rt_b)
+{
+       ktime_t now;
+
+       if (rt_b->rt_runtime == RUNTIME_INF)
+               return;
+
+       if (hrtimer_active(&rt_b->rt_period_timer))
+               return;
+
+       spin_lock(&rt_b->rt_runtime_lock);
+       for (;;) {
+               if (hrtimer_active(&rt_b->rt_period_timer))
+                       break;
+
+               now = hrtimer_cb_get_time(&rt_b->rt_period_timer);
+               hrtimer_forward(&rt_b->rt_period_timer, now, rt_b->rt_period);
+               hrtimer_start(&rt_b->rt_period_timer,
+                             rt_b->rt_period_timer.expires,
+                             HRTIMER_MODE_ABS);
+       }
+       spin_unlock(&rt_b->rt_runtime_lock);
+}
+
+#ifdef CONFIG_RT_GROUP_SCHED
+static void destroy_rt_bandwidth(struct rt_bandwidth *rt_b)
+{
+       hrtimer_cancel(&rt_b->rt_period_timer);
+}
+#endif
+
 #ifdef CONFIG_GROUP_SCHED
 
 #include <linux/cgroup.h>
@@ -181,29 +268,39 @@ struct task_group {
        struct sched_rt_entity **rt_se;
        struct rt_rq **rt_rq;
 
-       u64 rt_runtime;
+       struct rt_bandwidth rt_bandwidth;
 #endif
 
        struct rcu_head rcu;
        struct list_head list;
+
+       struct task_group *parent;
+       struct list_head siblings;
+       struct list_head children;
 };
 
+#ifdef CONFIG_USER_SCHED
+
+/*
+ * Root task group.
+ *     Every UID task group (including init_task_group aka UID-0) will
+ *     be a child to this group.
+ */
+struct task_group root_task_group;
+
 #ifdef CONFIG_FAIR_GROUP_SCHED
 /* Default task group's sched entity on each cpu */
 static DEFINE_PER_CPU(struct sched_entity, init_sched_entity);
 /* Default task group's cfs_rq on each cpu */
 static DEFINE_PER_CPU(struct cfs_rq, init_cfs_rq) ____cacheline_aligned_in_smp;
-
-static struct sched_entity *init_sched_entity_p[NR_CPUS];
-static struct cfs_rq *init_cfs_rq_p[NR_CPUS];
 #endif
 
 #ifdef CONFIG_RT_GROUP_SCHED
 static DEFINE_PER_CPU(struct sched_rt_entity, init_sched_rt_entity);
 static DEFINE_PER_CPU(struct rt_rq, init_rt_rq) ____cacheline_aligned_in_smp;
-
-static struct sched_rt_entity *init_sched_rt_entity_p[NR_CPUS];
-static struct rt_rq *init_rt_rq_p[NR_CPUS];
+#endif
+#else
+#define root_task_group init_task_group
 #endif
 
 /* task_group_lock serializes add/remove of task groups and also changes to
@@ -221,23 +318,15 @@ static DEFINE_MUTEX(doms_cur_mutex);
 # define INIT_TASK_GROUP_LOAD  NICE_0_LOAD
 #endif
 
+#define MIN_SHARES     2
+
 static int init_task_group_load = INIT_TASK_GROUP_LOAD;
 #endif
 
 /* Default task group.
  *     Every task in system belong to this group at bootup.
  */
-struct task_group init_task_group = {
-#ifdef CONFIG_FAIR_GROUP_SCHED
-       .se     = init_sched_entity_p,
-       .cfs_rq = init_cfs_rq_p,
-#endif
-
-#ifdef CONFIG_RT_GROUP_SCHED
-       .rt_se  = init_sched_rt_entity_p,
-       .rt_rq  = init_rt_rq_p,
-#endif
-};
+struct task_group init_task_group;
 
 /* return group to which a task belongs */
 static inline struct task_group *task_group(struct task_struct *p)
@@ -297,8 +386,12 @@ struct cfs_rq {
 
        struct rb_root tasks_timeline;
        struct rb_node *rb_leftmost;
-       struct rb_node *rb_load_balance_curr;
-       /* 'curr' points to currently running entity on this cfs_rq.
+
+       struct list_head tasks;
+       struct list_head *balance_iterator;
+
+       /*
+        * 'curr' points to currently running entity on this cfs_rq.
         * It is set to NULL otherwise (i.e when none are currently running).
         */
        struct sched_entity *curr, *next;
@@ -318,6 +411,43 @@ struct cfs_rq {
         */
        struct list_head leaf_cfs_rq_list;
        struct task_group *tg;  /* group that "owns" this runqueue */
+
+#ifdef CONFIG_SMP
+       unsigned long task_weight;
+       unsigned long shares;
+       /*
+        * We need space to build a sched_domain wide view of the full task
+        * group tree, in order to avoid depending on dynamic memory allocation
+        * during the load balancing we place this in the per cpu task group
+        * hierarchy. This limits the load balancing to one instance per cpu,
+        * but more should not be needed anyway.
+        */
+       struct aggregate_struct {
+               /*
+                *   load = weight(cpus) * f(tg)
+                *
+                * Where f(tg) is the recursive weight fraction assigned to
+                * this group.
+                */
+               unsigned long load;
+
+               /*
+                * part of the group weight distributed to this span.
+                */
+               unsigned long shares;
+
+               /*
+                * The sum of all runqueue weights within this span.
+                */
+               unsigned long rq_weight;
+
+               /*
+                * Weight contributed by tasks; this is the part we can
+                * influence by moving tasks around.
+                */
+               unsigned long task_weight;
+       } aggregate;
+#endif
 #endif
 };
 
@@ -334,6 +464,9 @@ struct rt_rq {
 #endif
        int rt_throttled;
        u64 rt_time;
+       u64 rt_runtime;
+       /* Nests inside the rq lock: */
+       spinlock_t rt_runtime_lock;
 
 #ifdef CONFIG_RT_GROUP_SCHED
        unsigned long rt_nr_boosted;
@@ -396,6 +529,7 @@ struct rq {
        unsigned long cpu_load[CPU_LOAD_IDX_MAX];
        unsigned char idle_at_tick;
 #ifdef CONFIG_NO_HZ
+       unsigned long last_tick_seen;
        unsigned char in_nohz_recently;
 #endif
        /* capture load from *all* tasks on this cpu: */
@@ -405,8 +539,6 @@ struct rq {
 
        struct cfs_rq cfs;
        struct rt_rq rt;
-       u64 rt_period_expire;
-       int rt_throttled;
 
 #ifdef CONFIG_FAIR_GROUP_SCHED
        /* list of leaf cfs_rq on this cpu: */
@@ -499,6 +631,32 @@ static inline int cpu_of(struct rq *rq)
 #endif
 }
 
+#ifdef CONFIG_NO_HZ
+static inline bool nohz_on(int cpu)
+{
+       return tick_get_tick_sched(cpu)->nohz_mode != NOHZ_MODE_INACTIVE;
+}
+
+static inline u64 max_skipped_ticks(struct rq *rq)
+{
+       return nohz_on(cpu_of(rq)) ? jiffies - rq->last_tick_seen + 2 : 1;
+}
+
+static inline void update_last_tick_seen(struct rq *rq)
+{
+       rq->last_tick_seen = jiffies;
+}
+#else
+static inline u64 max_skipped_ticks(struct rq *rq)
+{
+       return 1;
+}
+
+static inline void update_last_tick_seen(struct rq *rq)
+{
+}
+#endif
+
 /*
  * Update the per-runqueue clock, as finegrained as the platform can give
  * us, but without assuming monotonicity, etc.:
@@ -523,9 +681,12 @@ static void __update_rq_clock(struct rq *rq)
                /*
                 * Catch too large forward jumps too:
                 */
-               if (unlikely(clock + delta > rq->tick_timestamp + TICK_NSEC)) {
-                       if (clock < rq->tick_timestamp + TICK_NSEC)
-                               clock = rq->tick_timestamp + TICK_NSEC;
+               u64 max_jump = max_skipped_ticks(rq) * TICK_NSEC;
+               u64 max_time = rq->tick_timestamp + max_jump;
+
+               if (unlikely(clock + delta > max_time)) {
+                       if (clock < max_time)
+                               clock = max_time;
                        else
                                clock++;
                        rq->clock_overflows++;
@@ -561,23 +722,6 @@ static void update_rq_clock(struct rq *rq)
 #define task_rq(p)             cpu_rq(task_cpu(p))
 #define cpu_curr(cpu)          (cpu_rq(cpu)->curr)
 
-unsigned long rt_needs_cpu(int cpu)
-{
-       struct rq *rq = cpu_rq(cpu);
-       u64 delta;
-
-       if (!rq->rt_throttled)
-               return 0;
-
-       if (rq->clock > rq->rt_period_expire)
-               return 1;
-
-       delta = rq->rt_period_expire - rq->clock;
-       do_div(delta, NSEC_PER_SEC / HZ);
-
-       return (unsigned long)delta;
-}
-
 /*
  * Tunables that become constants when CONFIG_SCHED_DEBUG is off:
  */
@@ -590,22 +734,137 @@ unsigned long rt_needs_cpu(int cpu)
 /*
  * Debugging: various feature bits
  */
+
+#define SCHED_FEAT(name, enabled)      \
+       __SCHED_FEAT_##name ,
+
 enum {
-       SCHED_FEAT_NEW_FAIR_SLEEPERS    = 1,
-       SCHED_FEAT_WAKEUP_PREEMPT       = 2,
-       SCHED_FEAT_START_DEBIT          = 4,
-       SCHED_FEAT_HRTICK               = 8,
-       SCHED_FEAT_DOUBLE_TICK          = 16,
+#include "sched_features.h"
 };
 
+#undef SCHED_FEAT
+
+#define SCHED_FEAT(name, enabled)      \
+       (1UL << __SCHED_FEAT_##name) * enabled |
+
 const_debug unsigned int sysctl_sched_features =
-               SCHED_FEAT_NEW_FAIR_SLEEPERS    * 1 |
-               SCHED_FEAT_WAKEUP_PREEMPT       * 1 |
-               SCHED_FEAT_START_DEBIT          * 1 |
-               SCHED_FEAT_HRTICK               * 1 |
-               SCHED_FEAT_DOUBLE_TICK          * 0;
+#include "sched_features.h"
+       0;
+
+#undef SCHED_FEAT
+
+#ifdef CONFIG_SCHED_DEBUG
+#define SCHED_FEAT(name, enabled)      \
+       #name ,
 
-#define sched_feat(x) (sysctl_sched_features & SCHED_FEAT_##x)
+__read_mostly char *sched_feat_names[] = {
+#include "sched_features.h"
+       NULL
+};
+
+#undef SCHED_FEAT
+
+int sched_feat_open(struct inode *inode, struct file *filp)
+{
+       filp->private_data = inode->i_private;
+       return 0;
+}
+
+static ssize_t
+sched_feat_read(struct file *filp, char __user *ubuf,
+               size_t cnt, loff_t *ppos)
+{
+       char *buf;
+       int r = 0;
+       int len = 0;
+       int i;
+
+       for (i = 0; sched_feat_names[i]; i++) {
+               len += strlen(sched_feat_names[i]);
+               len += 4;
+       }
+
+       buf = kmalloc(len + 2, GFP_KERNEL);
+       if (!buf)
+               return -ENOMEM;
+
+       for (i = 0; sched_feat_names[i]; i++) {
+               if (sysctl_sched_features & (1UL << i))
+                       r += sprintf(buf + r, "%s ", sched_feat_names[i]);
+               else
+                       r += sprintf(buf + r, "NO_%s ", sched_feat_names[i]);
+       }
+
+       r += sprintf(buf + r, "\n");
+       WARN_ON(r >= len + 2);
+
+       r = simple_read_from_buffer(ubuf, cnt, ppos, buf, r);
+
+       kfree(buf);
+
+       return r;
+}
+
+static ssize_t
+sched_feat_write(struct file *filp, const char __user *ubuf,
+               size_t cnt, loff_t *ppos)
+{
+       char buf[64];
+       char *cmp = buf;
+       int neg = 0;
+       int i;
+
+       if (cnt > 63)
+               cnt = 63;
+
+       if (copy_from_user(&buf, ubuf, cnt))
+               return -EFAULT;
+
+       buf[cnt] = 0;
+
+       if (strncmp(buf, "NO_", 3) == 0) {
+               neg = 1;
+               cmp += 3;
+       }
+
+       for (i = 0; sched_feat_names[i]; i++) {
+               int len = strlen(sched_feat_names[i]);
+
+               if (strncmp(cmp, sched_feat_names[i], len) == 0) {
+                       if (neg)
+                               sysctl_sched_features &= ~(1UL << i);
+                       else
+                               sysctl_sched_features |= (1UL << i);
+                       break;
+               }
+       }
+
+       if (!sched_feat_names[i])
+               return -EINVAL;
+
+       filp->f_pos += cnt;
+
+       return cnt;
+}
+
+static struct file_operations sched_feat_fops = {
+       .open   = sched_feat_open,
+       .read   = sched_feat_read,
+       .write  = sched_feat_write,
+};
+
+static __init int sched_init_debug(void)
+{
+       debugfs_create_file("sched_features", 0644, NULL, NULL,
+                       &sched_feat_fops);
+
+       return 0;
+}
+late_initcall(sched_init_debug);
+
+#endif
+
+#define sched_feat(x) (sysctl_sched_features & (1UL << __SCHED_FEAT_##x))
 
 /*
  * Number of tasks to iterate in a single balance run.
@@ -627,16 +886,52 @@ static __read_mostly int scheduler_running;
  */
 int sysctl_sched_rt_runtime = 950000;
 
-/*
- * single value that denotes runtime == period, ie unlimited time.
- */
-#define RUNTIME_INF    ((u64)~0ULL)
+static inline u64 global_rt_period(void)
+{
+       return (u64)sysctl_sched_rt_period * NSEC_PER_USEC;
+}
+
+static inline u64 global_rt_runtime(void)
+{
+       if (sysctl_sched_rt_period < 0)
+               return RUNTIME_INF;
+
+       return (u64)sysctl_sched_rt_runtime * NSEC_PER_USEC;
+}
+
+static const unsigned long long time_sync_thresh = 100000;
+
+static DEFINE_PER_CPU(unsigned long long, time_offset);
+static DEFINE_PER_CPU(unsigned long long, prev_cpu_time);
 
 /*
- * For kernel-internal use: high-speed (but slightly incorrect) per-cpu
- * clock constructed from sched_clock():
+ * Global lock which we take every now and then to synchronize
+ * the CPUs time. This method is not warp-safe, but it's good
+ * enough to synchronize slowly diverging time sources and thus
+ * it's good enough for tracing:
  */
-unsigned long long cpu_clock(int cpu)
+static DEFINE_SPINLOCK(time_sync_lock);
+static unsigned long long prev_global_time;
+
+static unsigned long long __sync_cpu_clock(cycles_t time, int cpu)
+{
+       unsigned long flags;
+
+       spin_lock_irqsave(&time_sync_lock, flags);
+
+       if (time < prev_global_time) {
+               per_cpu(time_offset, cpu) += prev_global_time - time;
+               time = prev_global_time;
+       } else {
+               prev_global_time = time;
+       }
+
+       spin_unlock_irqrestore(&time_sync_lock, flags);
+
+       return time;
+}
+
+static unsigned long long __cpu_clock(int cpu)
 {
        unsigned long long now;
        unsigned long flags;
@@ -657,6 +952,24 @@ unsigned long long cpu_clock(int cpu)
 
        return now;
 }
+
+/*
+ * For kernel-internal use: high-speed (but slightly incorrect) per-cpu
+ * clock constructed from sched_clock():
+ */
+unsigned long long cpu_clock(int cpu)
+{
+       unsigned long long prev_cpu_time, time, delta_time;
+
+       prev_cpu_time = per_cpu(prev_cpu_time, cpu);
+       time = __cpu_clock(cpu) + per_cpu(time_offset, cpu);
+       delta_time = time-prev_cpu_time;
+
+       if (unlikely(delta_time > time_sync_thresh))
+               time = __sync_cpu_clock(time, cpu);
+
+       return time;
+}
 EXPORT_SYMBOL_GPL(cpu_clock);
 
 #ifndef prepare_arch_switch
@@ -1116,6 +1429,9 @@ static void __resched_task(struct task_struct *p, int tif_bit)
  */
 #define SRR(x, y) (((x) + (1UL << ((y) - 1))) >> (y))
 
+/*
+ * delta *= weight / lw
+ */
 static unsigned long
 calc_delta_mine(unsigned long delta_exec, unsigned long weight,
                struct load_weight *lw)
@@ -1138,12 +1454,6 @@ calc_delta_mine(unsigned long delta_exec, unsigned long weight,
        return (unsigned long)min(tmp, (u64)(unsigned long)LONG_MAX);
 }
 
-static inline unsigned long
-calc_delta_fair(unsigned long delta_exec, struct load_weight *lw)
-{
-       return calc_delta_mine(delta_exec, NICE_0_LOAD, lw);
-}
-
 static inline void update_load_add(struct load_weight *lw, unsigned long inc)
 {
        lw->weight += inc;
@@ -1241,11 +1551,390 @@ static void cpuacct_charge(struct task_struct *tsk, u64 cputime);
 static inline void cpuacct_charge(struct task_struct *tsk, u64 cputime) {}
 #endif
 
+static inline void inc_cpu_load(struct rq *rq, unsigned long load)
+{
+       update_load_add(&rq->load, load);
+}
+
+static inline void dec_cpu_load(struct rq *rq, unsigned long load)
+{
+       update_load_sub(&rq->load, load);
+}
+
 #ifdef CONFIG_SMP
 static unsigned long source_load(int cpu, int type);
 static unsigned long target_load(int cpu, int type);
 static unsigned long cpu_avg_load_per_task(int cpu);
 static int task_hot(struct task_struct *p, u64 now, struct sched_domain *sd);
+
+#ifdef CONFIG_FAIR_GROUP_SCHED
+
+/*
+ * Group load balancing.
+ *
+ * We calculate a few balance domain wide aggregate numbers; load and weight.
+ * Given the pictures below, and assuming each item has equal weight:
+ *
+ *         root          1 - thread
+ *         / | \         A - group
+ *        A  1  B
+ *       /|\   / \
+ *      C 2 D 3   4
+ *      |   |
+ *      5   6
+ *
+ * load:
+ *    A and B get 1/3-rd of the total load. C and D get 1/3-rd of A's 1/3-rd,
+ *    which equals 1/9-th of the total load.
+ *
+ * shares:
+ *    The weight of this group on the selected cpus.
+ *
+ * rq_weight:
+ *    Direct sum of all the cpu's their rq weight, e.g. A would get 3 while
+ *    B would get 2.
+ *
+ * task_weight:
+ *    Part of the rq_weight contributed by tasks; all groups except B would
+ *    get 1, B gets 2.
+ */
+
+static inline struct aggregate_struct *
+aggregate(struct task_group *tg, struct sched_domain *sd)
+{
+       return &tg->cfs_rq[sd->first_cpu]->aggregate;
+}
+
+typedef void (*aggregate_func)(struct task_group *, struct sched_domain *);
+
+/*
+ * Iterate the full tree, calling @down when first entering a node and @up when
+ * leaving it for the final time.
+ */
+static
+void aggregate_walk_tree(aggregate_func down, aggregate_func up,
+                        struct sched_domain *sd)
+{
+       struct task_group *parent, *child;
+
+       rcu_read_lock();
+       parent = &root_task_group;
+down:
+       (*down)(parent, sd);
+       list_for_each_entry_rcu(child, &parent->children, siblings) {
+               parent = child;
+               goto down;
+
+up:
+               continue;
+       }
+       (*up)(parent, sd);
+
+       child = parent;
+       parent = parent->parent;
+       if (parent)
+               goto up;
+       rcu_read_unlock();
+}
+
+/*
+ * Calculate the aggregate runqueue weight.
+ */
+static
+void aggregate_group_weight(struct task_group *tg, struct sched_domain *sd)
+{
+       unsigned long rq_weight = 0;
+       unsigned long task_weight = 0;
+       int i;
+
+       for_each_cpu_mask(i, sd->span) {
+               rq_weight += tg->cfs_rq[i]->load.weight;
+               task_weight += tg->cfs_rq[i]->task_weight;
+       }
+
+       aggregate(tg, sd)->rq_weight = rq_weight;
+       aggregate(tg, sd)->task_weight = task_weight;
+}
+
+/*
+ * Redistribute tg->shares amongst all tg->cfs_rq[]s.
+ */
+static void __aggregate_redistribute_shares(struct task_group *tg)
+{
+       int i, max_cpu = smp_processor_id();
+       unsigned long rq_weight = 0;
+       unsigned long shares, max_shares = 0, shares_rem = tg->shares;
+
+       for_each_possible_cpu(i)
+               rq_weight += tg->cfs_rq[i]->load.weight;
+
+       for_each_possible_cpu(i) {
+               /*
+                * divide shares proportional to the rq_weights.
+                */
+               shares = tg->shares * tg->cfs_rq[i]->load.weight;
+               shares /= rq_weight + 1;
+
+               tg->cfs_rq[i]->shares = shares;
+
+               if (shares > max_shares) {
+                       max_shares = shares;
+                       max_cpu = i;
+               }
+               shares_rem -= shares;
+       }
+
+       /*
+        * Ensure it all adds up to tg->shares; we can loose a few
+        * due to rounding down when computing the per-cpu shares.
+        */
+       if (shares_rem)
+               tg->cfs_rq[max_cpu]->shares += shares_rem;
+}
+
+/*
+ * Compute the weight of this group on the given cpus.
+ */
+static
+void aggregate_group_shares(struct task_group *tg, struct sched_domain *sd)
+{
+       unsigned long shares = 0;
+       int i;
+
+again:
+       for_each_cpu_mask(i, sd->span)
+               shares += tg->cfs_rq[i]->shares;
+
+       /*
+        * When the span doesn't have any shares assigned, but does have
+        * tasks to run do a machine wide rebalance (should be rare).
+        */
+       if (unlikely(!shares && aggregate(tg, sd)->rq_weight)) {
+               __aggregate_redistribute_shares(tg);
+               goto again;
+       }
+
+       aggregate(tg, sd)->shares = shares;
+}
+
+/*
+ * Compute the load fraction assigned to this group, relies on the aggregate
+ * weight and this group's parent's load, i.e. top-down.
+ */
+static
+void aggregate_group_load(struct task_group *tg, struct sched_domain *sd)
+{
+       unsigned long load;
+
+       if (!tg->parent) {
+               int i;
+
+               load = 0;
+               for_each_cpu_mask(i, sd->span)
+                       load += cpu_rq(i)->load.weight;
+
+       } else {
+               load = aggregate(tg->parent, sd)->load;
+
+               /*
+                * shares is our weight in the parent's rq so
+                * shares/parent->rq_weight gives our fraction of the load
+                */
+               load *= aggregate(tg, sd)->shares;
+               load /= aggregate(tg->parent, sd)->rq_weight + 1;
+       }
+
+       aggregate(tg, sd)->load = load;
+}
+
+static void __set_se_shares(struct sched_entity *se, unsigned long shares);
+
+/*
+ * Calculate and set the cpu's group shares.
+ */
+static void
+__update_group_shares_cpu(struct task_group *tg, struct sched_domain *sd,
+                         int tcpu)
+{
+       int boost = 0;
+       unsigned long shares;
+       unsigned long rq_weight;
+
+       if (!tg->se[tcpu])
+               return;
+
+       rq_weight = tg->cfs_rq[tcpu]->load.weight;
+
+       /*
+        * If there are currently no tasks on the cpu pretend there is one of
+        * average load so that when a new task gets to run here it will not
+        * get delayed by group starvation.
+        */
+       if (!rq_weight) {
+               boost = 1;
+               rq_weight = NICE_0_LOAD;
+       }
+
+       /*
+        *           \Sum shares * rq_weight
+        * shares =  -----------------------
+        *               \Sum rq_weight
+        *
+        */
+       shares = aggregate(tg, sd)->shares * rq_weight;
+       shares /= aggregate(tg, sd)->rq_weight + 1;
+
+       /*
+        * record the actual number of shares, not the boosted amount.
+        */
+       tg->cfs_rq[tcpu]->shares = boost ? 0 : shares;
+
+       if (shares < MIN_SHARES)
+               shares = MIN_SHARES;
+
+       __set_se_shares(tg->se[tcpu], shares);
+}
+
+/*
+ * Re-adjust the weights on the cpu the task came from and on the cpu the
+ * task went to.
+ */
+static void
+__move_group_shares(struct task_group *tg, struct sched_domain *sd,
+                   int scpu, int dcpu)
+{
+       unsigned long shares;
+
+       shares = tg->cfs_rq[scpu]->shares + tg->cfs_rq[dcpu]->shares;
+
+       __update_group_shares_cpu(tg, sd, scpu);
+       __update_group_shares_cpu(tg, sd, dcpu);
+
+       /*
+        * ensure we never loose shares due to rounding errors in the
+        * above redistribution.
+        */
+       shares -= tg->cfs_rq[scpu]->shares + tg->cfs_rq[dcpu]->shares;
+       if (shares)
+               tg->cfs_rq[dcpu]->shares += shares;
+}
+
+/*
+ * Because changing a group's shares changes the weight of the super-group
+ * we need to walk up the tree and change all shares until we hit the root.
+ */
+static void
+move_group_shares(struct task_group *tg, struct sched_domain *sd,
+                 int scpu, int dcpu)
+{
+       while (tg) {
+               __move_group_shares(tg, sd, scpu, dcpu);
+               tg = tg->parent;
+       }
+}
+
+static
+void aggregate_group_set_shares(struct task_group *tg, struct sched_domain *sd)
+{
+       unsigned long shares = aggregate(tg, sd)->shares;
+       int i;
+
+       for_each_cpu_mask(i, sd->span) {
+               struct rq *rq = cpu_rq(i);
+               unsigned long flags;
+
+               spin_lock_irqsave(&rq->lock, flags);
+               __update_group_shares_cpu(tg, sd, i);
+               spin_unlock_irqrestore(&rq->lock, flags);
+       }
+
+       aggregate_group_shares(tg, sd);
+
+       /*
+        * ensure we never loose shares due to rounding errors in the
+        * above redistribution.
+        */
+       shares -= aggregate(tg, sd)->shares;
+       if (shares) {
+               tg->cfs_rq[sd->first_cpu]->shares += shares;
+               aggregate(tg, sd)->shares += shares;
+       }
+}
+
+/*
+ * Calculate the accumulative weight and recursive load of each task group
+ * while walking down the tree.
+ */
+static
+void aggregate_get_down(struct task_group *tg, struct sched_domain *sd)
+{
+       aggregate_group_weight(tg, sd);
+       aggregate_group_shares(tg, sd);
+       aggregate_group_load(tg, sd);
+}
+
+/*
+ * Rebalance the cpu shares while walking back up the tree.
+ */
+static
+void aggregate_get_up(struct task_group *tg, struct sched_domain *sd)
+{
+       aggregate_group_set_shares(tg, sd);
+}
+
+static DEFINE_PER_CPU(spinlock_t, aggregate_lock);
+
+static void __init init_aggregate(void)
+{
+       int i;
+
+       for_each_possible_cpu(i)
+               spin_lock_init(&per_cpu(aggregate_lock, i));
+}
+
+static int get_aggregate(struct sched_domain *sd)
+{
+       if (!spin_trylock(&per_cpu(aggregate_lock, sd->first_cpu)))
+               return 0;
+
+       aggregate_walk_tree(aggregate_get_down, aggregate_get_up, sd);
+       return 1;
+}
+
+static void put_aggregate(struct sched_domain *sd)
+{
+       spin_unlock(&per_cpu(aggregate_lock, sd->first_cpu));
+}
+
+static void cfs_rq_set_shares(struct cfs_rq *cfs_rq, unsigned long shares)
+{
+       cfs_rq->shares = shares;
+}
+
+#else
+
+static inline void init_aggregate(void)
+{
+}
+
+static inline int get_aggregate(struct sched_domain *sd)
+{
+       return 0;
+}
+
+static inline void put_aggregate(struct sched_domain *sd)
+{
+}
+#endif
+
+#else /* CONFIG_SMP */
+
+#ifdef CONFIG_FAIR_GROUP_SCHED
+static void cfs_rq_set_shares(struct cfs_rq *cfs_rq, unsigned long shares)
+{
+}
+#endif
+
 #endif /* CONFIG_SMP */
 
 #include "sched_stats.h"
@@ -1258,26 +1947,14 @@ static int task_hot(struct task_struct *p, u64 now, struct sched_domain *sd);
 
 #define sched_class_highest (&rt_sched_class)
 
-static inline void inc_load(struct rq *rq, const struct task_struct *p)
-{
-       update_load_add(&rq->load, p->se.load.weight);
-}
-
-static inline void dec_load(struct rq *rq, const struct task_struct *p)
-{
-       update_load_sub(&rq->load, p->se.load.weight);
-}
-
-static void inc_nr_running(struct task_struct *p, struct rq *rq)
+static void inc_nr_running(struct rq *rq)
 {
        rq->nr_running++;
-       inc_load(rq, p);
 }
 
-static void dec_nr_running(struct task_struct *p, struct rq *rq)
+static void dec_nr_running(struct rq *rq)
 {
        rq->nr_running--;
-       dec_load(rq, p);
 }
 
 static void set_load_weight(struct task_struct *p)
@@ -1369,7 +2046,7 @@ static void activate_task(struct rq *rq, struct task_struct *p, int wakeup)
                rq->nr_uninterruptible--;
 
        enqueue_task(rq, p, wakeup);
-       inc_nr_running(p, rq);
+       inc_nr_running(rq);
 }
 
 /*
@@ -1381,7 +2058,7 @@ static void deactivate_task(struct rq *rq, struct task_struct *p, int sleep)
                rq->nr_uninterruptible++;
 
        dequeue_task(rq, p, sleep);
-       dec_nr_running(p, rq);
+       dec_nr_running(rq);
 }
 
 /**
@@ -1438,7 +2115,7 @@ task_hot(struct task_struct *p, u64 now, struct sched_domain *sd)
        /*
         * Buddy candidates are cache hot:
         */
-       if (&p->se == cfs_rq_of(&p->se)->next)
+       if (sched_feat(CACHE_HOT_BUDDY) && (&p->se == cfs_rq_of(&p->se)->next))
                return 1;
 
        if (p->sched_class != &fair_sched_class)
@@ -1728,17 +2405,17 @@ find_idlest_group(struct sched_domain *sd, struct task_struct *p, int this_cpu)
  * find_idlest_cpu - find the idlest cpu among the cpus in group.
  */
 static int
-find_idlest_cpu(struct sched_group *group, struct task_struct *p, int this_cpu)
+find_idlest_cpu(struct sched_group *group, struct task_struct *p, int this_cpu,
+               cpumask_t *tmp)
 {
-       cpumask_t tmp;
        unsigned long load, min_load = ULONG_MAX;
        int idlest = -1;
        int i;
 
        /* Traverse only the allowed CPUs */
-       cpus_and(tmp, group->cpumask, p->cpus_allowed);
+       cpus_and(*tmp, group->cpumask, p->cpus_allowed);
 
-       for_each_cpu_mask(i, tmp) {
+       for_each_cpu_mask(i, *tmp) {
                load = weighted_cpuload(i);
 
                if (load < min_load || (load == min_load && i == this_cpu)) {
@@ -1777,7 +2454,7 @@ static int sched_balance_self(int cpu, int flag)
        }
 
        while (sd) {
-               cpumask_t span;
+               cpumask_t span, tmpmask;
                struct sched_group *group;
                int new_cpu, weight;
 
@@ -1793,7 +2470,7 @@ static int sched_balance_self(int cpu, int flag)
                        continue;
                }
 
-               new_cpu = find_idlest_cpu(group, t, cpu);
+               new_cpu = find_idlest_cpu(group, t, cpu, &tmpmask);
                if (new_cpu == -1 || new_cpu == cpu) {
                        /* Now try balancing at a lower domain level of cpu */
                        sd = sd->child;
@@ -1839,6 +2516,9 @@ static int try_to_wake_up(struct task_struct *p, unsigned int state, int sync)
        long old_state;
        struct rq *rq;
 
+       if (!sched_feat(SYNC_WAKEUPS))
+               sync = 0;
+
        smp_wmb();
        rq = task_rq_lock(p, &flags);
        old_state = p->state;
@@ -1955,6 +2635,7 @@ static void __sched_fork(struct task_struct *p)
 
        INIT_LIST_HEAD(&p->rt.run_list);
        p->se.on_rq = 0;
+       INIT_LIST_HEAD(&p->se.group_node);
 
 #ifdef CONFIG_PREEMPT_NOTIFIERS
        INIT_HLIST_HEAD(&p->preempt_notifiers);
@@ -2030,7 +2711,7 @@ void wake_up_new_task(struct task_struct *p, unsigned long clone_flags)
                 * management (if any):
                 */
                p->sched_class->task_new(rq, p);
-               inc_nr_running(p, rq);
+               inc_nr_running(rq);
        }
        check_preempt_curr(rq, p);
 #ifdef CONFIG_SMP
@@ -2674,7 +3355,7 @@ static int move_one_task(struct rq *this_rq, int this_cpu, struct rq *busiest,
 static struct sched_group *
 find_busiest_group(struct sched_domain *sd, int this_cpu,
                   unsigned long *imbalance, enum cpu_idle_type idle,
-                  int *sd_idle, cpumask_t *cpus, int *balance)
+                  int *sd_idle, const cpumask_t *cpus, int *balance)
 {
        struct sched_group *busiest = NULL, *this = NULL, *group = sd->groups;
        unsigned long max_load, avg_load, total_load, this_load, total_pwr;
@@ -2975,7 +3656,7 @@ ret:
  */
 static struct rq *
 find_busiest_queue(struct sched_group *group, enum cpu_idle_type idle,
-                  unsigned long imbalance, cpumask_t *cpus)
+                  unsigned long imbalance, const cpumask_t *cpus)
 {
        struct rq *busiest = NULL, *rq;
        unsigned long max_load = 0;
@@ -3014,14 +3695,18 @@ find_busiest_queue(struct sched_group *group, enum cpu_idle_type idle,
  */
 static int load_balance(int this_cpu, struct rq *this_rq,
                        struct sched_domain *sd, enum cpu_idle_type idle,
-                       int *balance)
+                       int *balance, cpumask_t *cpus)
 {
        int ld_moved, all_pinned = 0, active_balance = 0, sd_idle = 0;
        struct sched_group *group;
        unsigned long imbalance;
        struct rq *busiest;
-       cpumask_t cpus = CPU_MASK_ALL;
        unsigned long flags;
+       int unlock_aggregate;
+
+       cpus_setall(*cpus);
+
+       unlock_aggregate = get_aggregate(sd);
 
        /*
         * When power savings policy is enabled for the parent domain, idle
@@ -3037,7 +3722,7 @@ static int load_balance(int this_cpu, struct rq *this_rq,
 
 redo:
        group = find_busiest_group(sd, this_cpu, &imbalance, idle, &sd_idle,
-                                  &cpus, balance);
+                                  cpus, balance);
 
        if (*balance == 0)
                goto out_balanced;
@@ -3047,7 +3732,7 @@ redo:
                goto out_balanced;
        }
 
-       busiest = find_busiest_queue(group, idle, imbalance, &cpus);
+       busiest = find_busiest_queue(group, idle, imbalance, cpus);
        if (!busiest) {
                schedstat_inc(sd, lb_nobusyq[idle]);
                goto out_balanced;
@@ -3080,8 +3765,8 @@ redo:
 
                /* All tasks on this runqueue were pinned by CPU affinity */
                if (unlikely(all_pinned)) {
-                       cpu_clear(cpu_of(busiest), cpus);
-                       if (!cpus_empty(cpus))
+                       cpu_clear(cpu_of(busiest), *cpus);
+                       if (!cpus_empty(*cpus))
                                goto redo;
                        goto out_balanced;
                }
@@ -3138,8 +3823,9 @@ redo:
 
        if (!ld_moved && !sd_idle && sd->flags & SD_SHARE_CPUPOWER &&
            !test_sd_parent(sd, SD_POWERSAVINGS_BALANCE))
-               return -1;
-       return ld_moved;
+               ld_moved = -1;
+
+       goto out;
 
 out_balanced:
        schedstat_inc(sd, lb_balanced[idle]);
@@ -3154,8 +3840,13 @@ out_one_pinned:
 
        if (!sd_idle && sd->flags & SD_SHARE_CPUPOWER &&
            !test_sd_parent(sd, SD_POWERSAVINGS_BALANCE))
-               return -1;
-       return 0;
+               ld_moved = -1;
+       else
+               ld_moved = 0;
+out:
+       if (unlock_aggregate)
+               put_aggregate(sd);
+       return ld_moved;
 }
 
 /*
@@ -3166,7 +3857,8 @@ out_one_pinned:
  * this_rq is locked.
  */
 static int
-load_balance_newidle(int this_cpu, struct rq *this_rq, struct sched_domain *sd)
+load_balance_newidle(int this_cpu, struct rq *this_rq, struct sched_domain *sd,
+                       cpumask_t *cpus)
 {
        struct sched_group *group;
        struct rq *busiest = NULL;
@@ -3174,7 +3866,8 @@ load_balance_newidle(int this_cpu, struct rq *this_rq, struct sched_domain *sd)
        int ld_moved = 0;
        int sd_idle = 0;
        int all_pinned = 0;
-       cpumask_t cpus = CPU_MASK_ALL;
+
+       cpus_setall(*cpus);
 
        /*
         * When power savings policy is enabled for the parent domain, idle
@@ -3189,14 +3882,13 @@ load_balance_newidle(int this_cpu, struct rq *this_rq, struct sched_domain *sd)
        schedstat_inc(sd, lb_count[CPU_NEWLY_IDLE]);
 redo:
        group = find_busiest_group(sd, this_cpu, &imbalance, CPU_NEWLY_IDLE,
-                                  &sd_idle, &cpus, NULL);
+                                  &sd_idle, cpus, NULL);
        if (!group) {
                schedstat_inc(sd, lb_nobusyg[CPU_NEWLY_IDLE]);
                goto out_balanced;
        }
 
-       busiest = find_busiest_queue(group, CPU_NEWLY_IDLE, imbalance,
-                               &cpus);
+       busiest = find_busiest_queue(group, CPU_NEWLY_IDLE, imbalance, cpus);
        if (!busiest) {
                schedstat_inc(sd, lb_nobusyq[CPU_NEWLY_IDLE]);
                goto out_balanced;
@@ -3218,8 +3910,8 @@ redo:
                spin_unlock(&busiest->lock);
 
                if (unlikely(all_pinned)) {
-                       cpu_clear(cpu_of(busiest), cpus);
-                       if (!cpus_empty(cpus))
+                       cpu_clear(cpu_of(busiest), *cpus);
+                       if (!cpus_empty(*cpus))
                                goto redo;
                }
        }
@@ -3253,6 +3945,7 @@ static void idle_balance(int this_cpu, struct rq *this_rq)
        struct sched_domain *sd;
        int pulled_task = -1;
        unsigned long next_balance = jiffies + HZ;
+       cpumask_t tmpmask;
 
        for_each_domain(this_cpu, sd) {
                unsigned long interval;
@@ -3262,8 +3955,8 @@ static void idle_balance(int this_cpu, struct rq *this_rq)
 
                if (sd->flags & SD_BALANCE_NEWIDLE)
                        /* If we've pulled tasks over stop searching: */
-                       pulled_task = load_balance_newidle(this_cpu,
-                                                               this_rq, sd);
+                       pulled_task = load_balance_newidle(this_cpu, this_rq,
+                                                          sd, &tmpmask);
 
                interval = msecs_to_jiffies(sd->balance_interval);
                if (time_after(next_balance, sd->last_balance + interval))
@@ -3422,6 +4115,7 @@ static void rebalance_domains(int cpu, enum cpu_idle_type idle)
        /* Earliest time when we have to do rebalance again */
        unsigned long next_balance = jiffies + 60*HZ;
        int update_next_balance = 0;
+       cpumask_t tmp;
 
        for_each_domain(cpu, sd) {
                if (!(sd->flags & SD_LOAD_BALANCE))
@@ -3445,7 +4139,7 @@ static void rebalance_domains(int cpu, enum cpu_idle_type idle)
                }
 
                if (time_after_eq(jiffies, sd->last_balance + interval)) {
-                       if (load_balance(cpu, rq, sd, idle, &balance)) {
+                       if (load_balance(cpu, rq, sd, idle, &balance, &tmp)) {
                                /*
                                 * We've pulled tasks over so either we're no
                                 * longer idle, or one of our SMT siblings is
@@ -3561,7 +4255,7 @@ static inline void trigger_load_balance(struct rq *rq, int cpu)
                         */
                        int ilb = first_cpu(nohz.cpu_mask);
 
-                       if (ilb != NR_CPUS)
+                       if (ilb < nr_cpu_ids)
                                resched_cpu(ilb);
                }
        }
@@ -3765,9 +4459,9 @@ void scheduler_tick(void)
                rq->clock_underflows++;
        }
        rq->tick_timestamp = rq->clock;
+       update_last_tick_seen(rq);
        update_cpu_load(rq);
        curr->sched_class->task_tick(rq, curr, 0);
-       update_sched_rt_period(rq);
        spin_unlock(&rq->lock);
 
 #ifdef CONFIG_SMP
@@ -4367,10 +5061,8 @@ void set_user_nice(struct task_struct *p, long nice)
                goto out_unlock;
        }
        on_rq = p->se.on_rq;
-       if (on_rq) {
+       if (on_rq)
                dequeue_task(rq, p, 0);
-               dec_load(rq, p);
-       }
 
        p->static_prio = NICE_TO_PRIO(nice);
        set_load_weight(p);
@@ -4380,7 +5072,6 @@ void set_user_nice(struct task_struct *p, long nice)
 
        if (on_rq) {
                enqueue_task(rq, p, 0);
-               inc_load(rq, p);
                /*
                 * If the task increased its priority or is running and
                 * lowered its priority, then reschedule its CPU:
@@ -4602,7 +5293,7 @@ recheck:
         * Do not allow realtime tasks into groups that have no runtime
         * assigned.
         */
-       if (rt_policy(policy) && task_group(p)->rt_runtime == 0)
+       if (rt_policy(policy) && task_group(p)->rt_bandwidth.rt_runtime == 0)
                return -EPERM;
 #endif
 
@@ -4764,9 +5455,10 @@ out_unlock:
        return retval;
 }
 
-long sched_setaffinity(pid_t pid, cpumask_t new_mask)
+long sched_setaffinity(pid_t pid, const cpumask_t *in_mask)
 {
        cpumask_t cpus_allowed;
+       cpumask_t new_mask = *in_mask;
        struct task_struct *p;
        int retval;
 
@@ -4797,13 +5489,13 @@ long sched_setaffinity(pid_t pid, cpumask_t new_mask)
        if (retval)
                goto out_unlock;
 
-       cpus_allowed = cpuset_cpus_allowed(p);
+       cpuset_cpus_allowed(p, &cpus_allowed);
        cpus_and(new_mask, new_mask, cpus_allowed);
  again:
-       retval = set_cpus_allowed(p, new_mask);
+       retval = set_cpus_allowed_ptr(p, &new_mask);
 
        if (!retval) {
-               cpus_allowed = cpuset_cpus_allowed(p);
+               cpuset_cpus_allowed(p, &cpus_allowed);
                if (!cpus_subset(new_mask, cpus_allowed)) {
                        /*
                         * We must have raced with a concurrent cpuset
@@ -4847,7 +5539,7 @@ asmlinkage long sys_sched_setaffinity(pid_t pid, unsigned int len,
        if (retval)
                return retval;
 
-       return sched_setaffinity(pid, new_mask);
+       return sched_setaffinity(pid, &new_mask);
 }
 
 /*
@@ -5309,7 +6001,6 @@ static inline void sched_init_granularity(void)
                sysctl_sched_latency = limit;
 
        sysctl_sched_wakeup_granularity *= factor;
-       sysctl_sched_batch_wakeup_granularity *= factor;
 }
 
 #ifdef CONFIG_SMP
@@ -5338,7 +6029,7 @@ static inline void sched_init_granularity(void)
  * task must not exit() & deallocate itself prematurely. The
  * call is not atomic; no spinlocks may be held.
  */
-int set_cpus_allowed(struct task_struct *p, cpumask_t new_mask)
+int set_cpus_allowed_ptr(struct task_struct *p, const cpumask_t *new_mask)
 {
        struct migration_req req;
        unsigned long flags;
@@ -5346,23 +6037,23 @@ int set_cpus_allowed(struct task_struct *p, cpumask_t new_mask)
        int ret = 0;
 
        rq = task_rq_lock(p, &flags);
-       if (!cpus_intersects(new_mask, cpu_online_map)) {
+       if (!cpus_intersects(*new_mask, cpu_online_map)) {
                ret = -EINVAL;
                goto out;
        }
 
        if (p->sched_class->set_cpus_allowed)
-               p->sched_class->set_cpus_allowed(p, &new_mask);
+               p->sched_class->set_cpus_allowed(p, new_mask);
        else {
-               p->cpus_allowed = new_mask;
-               p->rt.nr_cpus_allowed = cpus_weight(new_mask);
+               p->cpus_allowed = *new_mask;
+               p->rt.nr_cpus_allowed = cpus_weight(*new_mask);
        }
 
        /* Can the task run on the task's current CPU? If so, we're done */
-       if (cpu_isset(task_cpu(p), new_mask))
+       if (cpu_isset(task_cpu(p), *new_mask))
                goto out;
 
-       if (migrate_task(p, any_online_cpu(new_mask), &req)) {
+       if (migrate_task(p, any_online_cpu(*new_mask), &req)) {
                /* Need help from migration thread: drop lock and wait. */
                task_rq_unlock(rq, &flags);
                wake_up_process(rq->migration_thread);
@@ -5375,7 +6066,7 @@ out:
 
        return ret;
 }
-EXPORT_SYMBOL_GPL(set_cpus_allowed);
+EXPORT_SYMBOL_GPL(set_cpus_allowed_ptr);
 
 /*
  * Move (not current) task off this cpu, onto dest cpu. We're doing
@@ -5513,12 +6204,14 @@ static void move_task_off_dead_cpu(int dead_cpu, struct task_struct *p)
                dest_cpu = any_online_cpu(mask);
 
                /* On any allowed CPU? */
-               if (dest_cpu == NR_CPUS)
+               if (dest_cpu >= nr_cpu_ids)
                        dest_cpu = any_online_cpu(p->cpus_allowed);
 
                /* No more Mr. Nice Guy. */
-               if (dest_cpu == NR_CPUS) {
-                       cpumask_t cpus_allowed = cpuset_cpus_allowed_locked(p);
+               if (dest_cpu >= nr_cpu_ids) {
+                       cpumask_t cpus_allowed;
+
+                       cpuset_cpus_allowed_locked(p, &cpus_allowed);
                        /*
                         * Try to stay on the same cpuset, where the
                         * current cpuset may be a subset of all cpus.
@@ -5554,7 +6247,7 @@ static void move_task_off_dead_cpu(int dead_cpu, struct task_struct *p)
  */
 static void migrate_nr_uninterruptible(struct rq *rq_src)
 {
-       struct rq *rq_dest = cpu_rq(any_online_cpu(CPU_MASK_ALL));
+       struct rq *rq_dest = cpu_rq(any_online_cpu(*CPU_MASK_ALL_PTR));
        unsigned long flags;
 
        local_irq_save(flags);
@@ -5966,20 +6659,16 @@ void __init migration_init(void)
 
 #ifdef CONFIG_SMP
 
-/* Number of possible processor ids */
-int nr_cpu_ids __read_mostly = NR_CPUS;
-EXPORT_SYMBOL(nr_cpu_ids);
-
 #ifdef CONFIG_SCHED_DEBUG
 
-static int sched_domain_debug_one(struct sched_domain *sd, int cpu, int level)
+static int sched_domain_debug_one(struct sched_domain *sd, int cpu, int level,
+                                 cpumask_t *groupmask)
 {
        struct sched_group *group = sd->groups;
-       cpumask_t groupmask;
-       char str[NR_CPUS];
+       char str[256];
 
-       cpumask_scnprintf(str, NR_CPUS, sd->span);
-       cpus_clear(groupmask);
+       cpulist_scnprintf(str, sizeof(str), sd->span);
+       cpus_clear(*groupmask);
 
        printk(KERN_DEBUG "%*s domain %d: ", level, "", level);
 
@@ -6023,25 +6712,25 @@ static int sched_domain_debug_one(struct sched_domain *sd, int cpu, int level)
                        break;
                }
 
-               if (cpus_intersects(groupmask, group->cpumask)) {
+               if (cpus_intersects(*groupmask, group->cpumask)) {
                        printk(KERN_CONT "\n");
                        printk(KERN_ERR "ERROR: repeated CPUs\n");
                        break;
                }
 
-               cpus_or(groupmask, groupmask, group->cpumask);
+               cpus_or(*groupmask, *groupmask, group->cpumask);
 
-               cpumask_scnprintf(str, NR_CPUS, group->cpumask);
+               cpulist_scnprintf(str, sizeof(str), group->cpumask);
                printk(KERN_CONT " %s", str);
 
                group = group->next;
        } while (group != sd->groups);
        printk(KERN_CONT "\n");
 
-       if (!cpus_equal(sd->span, groupmask))
+       if (!cpus_equal(sd->span, *groupmask))
                printk(KERN_ERR "ERROR: groups don't span domain->span\n");
 
-       if (sd->parent && !cpus_subset(groupmask, sd->parent->span))
+       if (sd->parent && !cpus_subset(*groupmask, sd->parent->span))
                printk(KERN_ERR "ERROR: parent span is not a superset "
                        "of domain->span\n");
        return 0;
@@ -6049,6 +6738,7 @@ static int sched_domain_debug_one(struct sched_domain *sd, int cpu, int level)
 
 static void sched_domain_debug(struct sched_domain *sd, int cpu)
 {
+       cpumask_t *groupmask;
        int level = 0;
 
        if (!sd) {
@@ -6058,14 +6748,21 @@ static void sched_domain_debug(struct sched_domain *sd, int cpu)
 
        printk(KERN_DEBUG "CPU%d attaching sched-domain:\n", cpu);
 
+       groupmask = kmalloc(sizeof(cpumask_t), GFP_KERNEL);
+       if (!groupmask) {
+               printk(KERN_DEBUG "Cannot load-balance (out of memory)\n");
+               return;
+       }
+
        for (;;) {
-               if (sched_domain_debug_one(sd, cpu, level))
+               if (sched_domain_debug_one(sd, cpu, level, groupmask))
                        break;
                level++;
                sd = sd->parent;
                if (!sd)
                        break;
        }
+       kfree(groupmask);
 }
 #else
 # define sched_domain_debug(sd, cpu) do { } while (0)
@@ -6253,30 +6950,33 @@ __setup("isolcpus=", isolated_cpu_setup);
  * and ->cpu_power to 0.
  */
 static void
-init_sched_build_groups(cpumask_t span, const cpumask_t *cpu_map,
+init_sched_build_groups(const cpumask_t *span, const cpumask_t *cpu_map,
                        int (*group_fn)(int cpu, const cpumask_t *cpu_map,
-                                       struct sched_group **sg))
+                                       struct sched_group **sg,
+                                       cpumask_t *tmpmask),
+                       cpumask_t *covered, cpumask_t *tmpmask)
 {
        struct sched_group *first = NULL, *last = NULL;
-       cpumask_t covered = CPU_MASK_NONE;
        int i;
 
-       for_each_cpu_mask(i, span) {
+       cpus_clear(*covered);
+
+       for_each_cpu_mask(i, *span) {
                struct sched_group *sg;
-               int group = group_fn(i, cpu_map, &sg);
+               int group = group_fn(i, cpu_map, &sg, tmpmask);
                int j;
 
-               if (cpu_isset(i, covered))
+               if (cpu_isset(i, *covered))
                        continue;
 
-               sg->cpumask = CPU_MASK_NONE;
+               cpus_clear(sg->cpumask);
                sg->__cpu_power = 0;
 
-               for_each_cpu_mask(j, span) {
-                       if (group_fn(j, cpu_map, NULL) != group)
+               for_each_cpu_mask(j, *span) {
+                       if (group_fn(j, cpu_map, NULL, tmpmask) != group)
                                continue;
 
-                       cpu_set(j, covered);
+                       cpu_set(j, *covered);
                        cpu_set(j, sg->cpumask);
                }
                if (!first)
@@ -6302,7 +7002,7 @@ init_sched_build_groups(cpumask_t span, const cpumask_t *cpu_map,
  *
  * Should use nodemask_t.
  */
-static int find_next_best_node(int node, unsigned long *used_nodes)
+static int find_next_best_node(int node, nodemask_t *used_nodes)
 {
        int i, n, val, min_val, best_node = 0;
 
@@ -6316,7 +7016,7 @@ static int find_next_best_node(int node, unsigned long *used_nodes)
                        continue;
 
                /* Skip already used nodes */
-               if (test_bit(n, used_nodes))
+               if (node_isset(n, *used_nodes))
                        continue;
 
                /* Simple min distance search */
@@ -6328,40 +7028,36 @@ static int find_next_best_node(int node, unsigned long *used_nodes)
                }
        }
 
-       set_bit(best_node, used_nodes);
+       node_set(best_node, *used_nodes);
        return best_node;
 }
 
 /**
  * sched_domain_node_span - get a cpumask for a node's sched_domain
  * @node: node whose cpumask we're constructing
- * @size: number of nodes to include in this span
  *
  * Given a node, construct a good cpumask for its sched_domain to span. It
  * should be one that prevents unnecessary balancing, but also spreads tasks
  * out optimally.
  */
-static cpumask_t sched_domain_node_span(int node)
+static void sched_domain_node_span(int node, cpumask_t *span)
 {
-       DECLARE_BITMAP(used_nodes, MAX_NUMNODES);
-       cpumask_t span, nodemask;
+       nodemask_t used_nodes;
+       node_to_cpumask_ptr(nodemask, node);
        int i;
 
-       cpus_clear(span);
-       bitmap_zero(used_nodes, MAX_NUMNODES);
+       cpus_clear(*span);
+       nodes_clear(used_nodes);
 
-       nodemask = node_to_cpumask(node);
-       cpus_or(span, span, nodemask);
-       set_bit(node, used_nodes);
+       cpus_or(*span, *span, *nodemask);
+       node_set(node, used_nodes);
 
        for (i = 1; i < SD_NODES_PER_DOMAIN; i++) {
-               int next_node = find_next_best_node(node, used_nodes);
+               int next_node = find_next_best_node(node, &used_nodes);
 
-               nodemask = node_to_cpumask(next_node);
-               cpus_or(span, span, nodemask);
+               node_to_cpumask_ptr_next(nodemask, next_node);
+               cpus_or(*span, *span, *nodemask);
        }
-
-       return span;
 }
 #endif
 
@@ -6375,7 +7071,8 @@ static DEFINE_PER_CPU(struct sched_domain, cpu_domains);
 static DEFINE_PER_CPU(struct sched_group, sched_group_cpus);
 
 static int
-cpu_to_cpu_group(int cpu, const cpumask_t *cpu_map, struct sched_group **sg)
+cpu_to_cpu_group(int cpu, const cpumask_t *cpu_map, struct sched_group **sg,
+                cpumask_t *unused)
 {
        if (sg)
                *sg = &per_cpu(sched_group_cpus, cpu);
@@ -6393,19 +7090,22 @@ static DEFINE_PER_CPU(struct sched_group, sched_group_core);
 
 #if defined(CONFIG_SCHED_MC) && defined(CONFIG_SCHED_SMT)
 static int
-cpu_to_core_group(int cpu, const cpumask_t *cpu_map, struct sched_group **sg)
+cpu_to_core_group(int cpu, const cpumask_t *cpu_map, struct sched_group **sg,
+                 cpumask_t *mask)
 {
        int group;
-       cpumask_t mask = per_cpu(cpu_sibling_map, cpu);
-       cpus_and(mask, mask, *cpu_map);
-       group = first_cpu(mask);
+
+       *mask = per_cpu(cpu_sibling_map, cpu);
+       cpus_and(*mask, *mask, *cpu_map);
+       group = first_cpu(*mask);
        if (sg)
                *sg = &per_cpu(sched_group_core, group);
        return group;
 }
 #elif defined(CONFIG_SCHED_MC)
 static int
-cpu_to_core_group(int cpu, const cpumask_t *cpu_map, struct sched_group **sg)
+cpu_to_core_group(int cpu, const cpumask_t *cpu_map, struct sched_group **sg,
+                 cpumask_t *unused)
 {
        if (sg)
                *sg = &per_cpu(sched_group_core, cpu);
@@ -6417,17 +7117,18 @@ static DEFINE_PER_CPU(struct sched_domain, phys_domains);
 static DEFINE_PER_CPU(struct sched_group, sched_group_phys);
 
 static int
-cpu_to_phys_group(int cpu, const cpumask_t *cpu_map, struct sched_group **sg)
+cpu_to_phys_group(int cpu, const cpumask_t *cpu_map, struct sched_group **sg,
+                 cpumask_t *mask)
 {
        int group;
 #ifdef CONFIG_SCHED_MC
-       cpumask_t mask = cpu_coregroup_map(cpu);
-       cpus_and(mask, mask, *cpu_map);
-       group = first_cpu(mask);
+       *mask = cpu_coregroup_map(cpu);
+       cpus_and(*mask, *mask, *cpu_map);
+       group = first_cpu(*mask);
 #elif defined(CONFIG_SCHED_SMT)
-       cpumask_t mask = per_cpu(cpu_sibling_map, cpu);
-       cpus_and(mask, mask, *cpu_map);
-       group = first_cpu(mask);
+       *mask = per_cpu(cpu_sibling_map, cpu);
+       cpus_and(*mask, *mask, *cpu_map);
+       group = first_cpu(*mask);
 #else
        group = cpu;
 #endif
@@ -6443,19 +7144,19 @@ cpu_to_phys_group(int cpu, const cpumask_t *cpu_map, struct sched_group **sg)
  * gets dynamically allocated.
  */
 static DEFINE_PER_CPU(struct sched_domain, node_domains);
-static struct sched_group **sched_group_nodes_bycpu[NR_CPUS];
+static struct sched_group ***sched_group_nodes_bycpu;
 
 static DEFINE_PER_CPU(struct sched_domain, allnodes_domains);
 static DEFINE_PER_CPU(struct sched_group, sched_group_allnodes);
 
 static int cpu_to_allnodes_group(int cpu, const cpumask_t *cpu_map,
-                                struct sched_group **sg)
+                                struct sched_group **sg, cpumask_t *nodemask)
 {
-       cpumask_t nodemask = node_to_cpumask(cpu_to_node(cpu));
        int group;
 
-       cpus_and(nodemask, nodemask, *cpu_map);
-       group = first_cpu(nodemask);
+       *nodemask = node_to_cpumask(cpu_to_node(cpu));
+       cpus_and(*nodemask, *nodemask, *cpu_map);
+       group = first_cpu(*nodemask);
 
        if (sg)
                *sg = &per_cpu(sched_group_allnodes, group);
@@ -6491,7 +7192,7 @@ static void init_numa_sched_groups_power(struct sched_group *group_head)
 
 #ifdef CONFIG_NUMA
 /* Free memory allocated for various sched_group structures */
-static void free_sched_groups(const cpumask_t *cpu_map)
+static void free_sched_groups(const cpumask_t *cpu_map, cpumask_t *nodemask)
 {
        int cpu, i;
 
@@ -6503,11 +7204,11 @@ static void free_sched_groups(const cpumask_t *cpu_map)
                        continue;
 
                for (i = 0; i < MAX_NUMNODES; i++) {
-                       cpumask_t nodemask = node_to_cpumask(i);
                        struct sched_group *oldsg, *sg = sched_group_nodes[i];
 
-                       cpus_and(nodemask, nodemask, *cpu_map);
-                       if (cpus_empty(nodemask))
+                       *nodemask = node_to_cpumask(i);
+                       cpus_and(*nodemask, *nodemask, *cpu_map);
+                       if (cpus_empty(*nodemask))
                                continue;
 
                        if (sg == NULL)
@@ -6525,7 +7226,7 @@ next_sg:
        }
 }
 #else
-static void free_sched_groups(const cpumask_t *cpu_map)
+static void free_sched_groups(const cpumask_t *cpu_map, cpumask_t *nodemask)
 {
 }
 #endif
@@ -6572,24 +7273,117 @@ static void init_sched_groups_power(int cpu, struct sched_domain *sd)
                return;
        }
 
-       /*
-        * add cpu_power of each child group to this groups cpu_power
-        */
-       group = child->groups;
-       do {
-               sg_inc_cpu_power(sd->groups, group->__cpu_power);
-               group = group->next;
-       } while (group != child->groups);
+       /*
+        * add cpu_power of each child group to this groups cpu_power
+        */
+       group = child->groups;
+       do {
+               sg_inc_cpu_power(sd->groups, group->__cpu_power);
+               group = group->next;
+       } while (group != child->groups);
+}
+
+/*
+ * Initializers for schedule domains
+ * Non-inlined to reduce accumulated stack pressure in build_sched_domains()
+ */
+
+#define        SD_INIT(sd, type)       sd_init_##type(sd)
+#define SD_INIT_FUNC(type)     \
+static noinline void sd_init_##type(struct sched_domain *sd)   \
+{                                                              \
+       memset(sd, 0, sizeof(*sd));                             \
+       *sd = SD_##type##_INIT;                                 \
+       sd->level = SD_LV_##type;                               \
+}
+
+SD_INIT_FUNC(CPU)
+#ifdef CONFIG_NUMA
+ SD_INIT_FUNC(ALLNODES)
+ SD_INIT_FUNC(NODE)
+#endif
+#ifdef CONFIG_SCHED_SMT
+ SD_INIT_FUNC(SIBLING)
+#endif
+#ifdef CONFIG_SCHED_MC
+ SD_INIT_FUNC(MC)
+#endif
+
+/*
+ * To minimize stack usage kmalloc room for cpumasks and share the
+ * space as the usage in build_sched_domains() dictates.  Used only
+ * if the amount of space is significant.
+ */
+struct allmasks {
+       cpumask_t tmpmask;                      /* make this one first */
+       union {
+               cpumask_t nodemask;
+               cpumask_t this_sibling_map;
+               cpumask_t this_core_map;
+       };
+       cpumask_t send_covered;
+
+#ifdef CONFIG_NUMA
+       cpumask_t domainspan;
+       cpumask_t covered;
+       cpumask_t notcovered;
+#endif
+};
+
+#if    NR_CPUS > 128
+#define        SCHED_CPUMASK_ALLOC             1
+#define        SCHED_CPUMASK_FREE(v)           kfree(v)
+#define        SCHED_CPUMASK_DECLARE(v)        struct allmasks *v
+#else
+#define        SCHED_CPUMASK_ALLOC             0
+#define        SCHED_CPUMASK_FREE(v)
+#define        SCHED_CPUMASK_DECLARE(v)        struct allmasks _v, *v = &_v
+#endif
+
+#define        SCHED_CPUMASK_VAR(v, a)         cpumask_t *v = (cpumask_t *) \
+                       ((unsigned long)(a) + offsetof(struct allmasks, v))
+
+static int default_relax_domain_level = -1;
+
+static int __init setup_relax_domain_level(char *str)
+{
+       default_relax_domain_level = simple_strtoul(str, NULL, 0);
+       return 1;
+}
+__setup("relax_domain_level=", setup_relax_domain_level);
+
+static void set_domain_attribute(struct sched_domain *sd,
+                                struct sched_domain_attr *attr)
+{
+       int request;
+
+       if (!attr || attr->relax_domain_level < 0) {
+               if (default_relax_domain_level < 0)
+                       return;
+               else
+                       request = default_relax_domain_level;
+       } else
+               request = attr->relax_domain_level;
+       if (request < sd->level) {
+               /* turn off idle balance on this domain */
+               sd->flags &= ~(SD_WAKE_IDLE|SD_BALANCE_NEWIDLE);
+       } else {
+               /* turn on idle balance on this domain */
+               sd->flags |= (SD_WAKE_IDLE_FAR|SD_BALANCE_NEWIDLE);
+       }
 }
 
 /*
  * Build sched domains for a given set of cpus and attach the sched domains
  * to the individual cpus
  */
-static int build_sched_domains(const cpumask_t *cpu_map)
+static int __build_sched_domains(const cpumask_t *cpu_map,
+                                struct sched_domain_attr *attr)
 {
        int i;
        struct root_domain *rd;
+       SCHED_CPUMASK_DECLARE(allmasks);
+       cpumask_t *tmpmask;
 #ifdef CONFIG_NUMA
        struct sched_group **sched_group_nodes = NULL;
        int sd_allnodes = 0;
@@ -6603,39 +7397,65 @@ static int build_sched_domains(const cpumask_t *cpu_map)
                printk(KERN_WARNING "Can not alloc sched group node list\n");
                return -ENOMEM;
        }
-       sched_group_nodes_bycpu[first_cpu(*cpu_map)] = sched_group_nodes;
 #endif
 
        rd = alloc_rootdomain();
        if (!rd) {
                printk(KERN_WARNING "Cannot alloc root domain\n");
+#ifdef CONFIG_NUMA
+               kfree(sched_group_nodes);
+#endif
+               return -ENOMEM;
+       }
+
+#if SCHED_CPUMASK_ALLOC
+       /* get space for all scratch cpumask variables */
+       allmasks = kmalloc(sizeof(*allmasks), GFP_KERNEL);
+       if (!allmasks) {
+               printk(KERN_WARNING "Cannot alloc cpumask array\n");
+               kfree(rd);
+#ifdef CONFIG_NUMA
+               kfree(sched_group_nodes);
+#endif
                return -ENOMEM;
        }
+#endif
+       tmpmask = (cpumask_t *)allmasks;
+
+
+#ifdef CONFIG_NUMA
+       sched_group_nodes_bycpu[first_cpu(*cpu_map)] = sched_group_nodes;
+#endif
 
        /*
         * Set up domains for cpus specified by the cpu_map.
         */
        for_each_cpu_mask(i, *cpu_map) {
                struct sched_domain *sd = NULL, *p;
-               cpumask_t nodemask = node_to_cpumask(cpu_to_node(i));
+               SCHED_CPUMASK_VAR(nodemask, allmasks);
 
-               cpus_and(nodemask, nodemask, *cpu_map);
+               *nodemask = node_to_cpumask(cpu_to_node(i));
+               cpus_and(*nodemask, *nodemask, *cpu_map);
 
 #ifdef CONFIG_NUMA
                if (cpus_weight(*cpu_map) >
-                               SD_NODES_PER_DOMAIN*cpus_weight(nodemask)) {
+                               SD_NODES_PER_DOMAIN*cpus_weight(*nodemask)) {
                        sd = &per_cpu(allnodes_domains, i);
-                       *sd = SD_ALLNODES_INIT;
+                       SD_INIT(sd, ALLNODES);
+                       set_domain_attribute(sd, attr);
                        sd->span = *cpu_map;
-                       cpu_to_allnodes_group(i, cpu_map, &sd->groups);
+                       sd->first_cpu = first_cpu(sd->span);
+                       cpu_to_allnodes_group(i, cpu_map, &sd->groups, tmpmask);
                        p = sd;
                        sd_allnodes = 1;
                } else
                        p = NULL;
 
                sd = &per_cpu(node_domains, i);
-               *sd = SD_NODE_INIT;
-               sd->span = sched_domain_node_span(cpu_to_node(i));
+               SD_INIT(sd, NODE);
+               set_domain_attribute(sd, attr);
+               sched_domain_node_span(cpu_to_node(i), &sd->span);
+               sd->first_cpu = first_cpu(sd->span);
                sd->parent = p;
                if (p)
                        p->child = sd;
@@ -6644,94 +7464,120 @@ static int build_sched_domains(const cpumask_t *cpu_map)
 
                p = sd;
                sd = &per_cpu(phys_domains, i);
-               *sd = SD_CPU_INIT;
-               sd->span = nodemask;
+               SD_INIT(sd, CPU);
+               set_domain_attribute(sd, attr);
+               sd->span = *nodemask;
+               sd->first_cpu = first_cpu(sd->span);
                sd->parent = p;
                if (p)
                        p->child = sd;
-               cpu_to_phys_group(i, cpu_map, &sd->groups);
+               cpu_to_phys_group(i, cpu_map, &sd->groups, tmpmask);
 
 #ifdef CONFIG_SCHED_MC
                p = sd;
                sd = &per_cpu(core_domains, i);
-               *sd = SD_MC_INIT;
+               SD_INIT(sd, MC);
+               set_domain_attribute(sd, attr);
                sd->span = cpu_coregroup_map(i);
+               sd->first_cpu = first_cpu(sd->span);
                cpus_and(sd->span, sd->span, *cpu_map);
                sd->parent = p;
                p->child = sd;
-               cpu_to_core_group(i, cpu_map, &sd->groups);
+               cpu_to_core_group(i, cpu_map, &sd->groups, tmpmask);
 #endif
 
 #ifdef CONFIG_SCHED_SMT
                p = sd;
                sd = &per_cpu(cpu_domains, i);
-               *sd = SD_SIBLING_INIT;
+               SD_INIT(sd, SIBLING);
+               set_domain_attribute(sd, attr);
                sd->span = per_cpu(cpu_sibling_map, i);
+               sd->first_cpu = first_cpu(sd->span);
                cpus_and(sd->span, sd->span, *cpu_map);
                sd->parent = p;
                p->child = sd;
-               cpu_to_cpu_group(i, cpu_map, &sd->groups);
+               cpu_to_cpu_group(i, cpu_map, &sd->groups, tmpmask);
 #endif
        }
 
 #ifdef CONFIG_SCHED_SMT
        /* Set up CPU (sibling) groups */
        for_each_cpu_mask(i, *cpu_map) {
-               cpumask_t this_sibling_map = per_cpu(cpu_sibling_map, i);
-               cpus_and(this_sibling_map, this_sibling_map, *cpu_map);
-               if (i != first_cpu(this_sibling_map))
+               SCHED_CPUMASK_VAR(this_sibling_map, allmasks);
+               SCHED_CPUMASK_VAR(send_covered, allmasks);
+
+               *this_sibling_map = per_cpu(cpu_sibling_map, i);
+               cpus_and(*this_sibling_map, *this_sibling_map, *cpu_map);
+               if (i != first_cpu(*this_sibling_map))
                        continue;
 
                init_sched_build_groups(this_sibling_map, cpu_map,
-                                       &cpu_to_cpu_group);
+                                       &cpu_to_cpu_group,
+                                       send_covered, tmpmask);
        }
 #endif
 
 #ifdef CONFIG_SCHED_MC
        /* Set up multi-core groups */
        for_each_cpu_mask(i, *cpu_map) {
-               cpumask_t this_core_map = cpu_coregroup_map(i);
-               cpus_and(this_core_map, this_core_map, *cpu_map);
-               if (i != first_cpu(this_core_map))
+               SCHED_CPUMASK_VAR(this_core_map, allmasks);
+               SCHED_CPUMASK_VAR(send_covered, allmasks);
+
+               *this_core_map = cpu_coregroup_map(i);
+               cpus_and(*this_core_map, *this_core_map, *cpu_map);
+               if (i != first_cpu(*this_core_map))
                        continue;
+
                init_sched_build_groups(this_core_map, cpu_map,
-                                       &cpu_to_core_group);
+                                       &cpu_to_core_group,
+                                       send_covered, tmpmask);
        }
 #endif
 
        /* Set up physical groups */
        for (i = 0; i < MAX_NUMNODES; i++) {
-               cpumask_t nodemask = node_to_cpumask(i);
+               SCHED_CPUMASK_VAR(nodemask, allmasks);
+               SCHED_CPUMASK_VAR(send_covered, allmasks);
 
-               cpus_and(nodemask, nodemask, *cpu_map);
-               if (cpus_empty(nodemask))
+               *nodemask = node_to_cpumask(i);
+               cpus_and(*nodemask, *nodemask, *cpu_map);
+               if (cpus_empty(*nodemask))
                        continue;
 
-               init_sched_build_groups(nodemask, cpu_map, &cpu_to_phys_group);
+               init_sched_build_groups(nodemask, cpu_map,
+                                       &cpu_to_phys_group,
+                                       send_covered, tmpmask);
        }
 
 #ifdef CONFIG_NUMA
        /* Set up node groups */
-       if (sd_allnodes)
-               init_sched_build_groups(*cpu_map, cpu_map,
-                                       &cpu_to_allnodes_group);
+       if (sd_allnodes) {
+               SCHED_CPUMASK_VAR(send_covered, allmasks);
+
+               init_sched_build_groups(cpu_map, cpu_map,
+                                       &cpu_to_allnodes_group,
+                                       send_covered, tmpmask);
+       }
 
        for (i = 0; i < MAX_NUMNODES; i++) {
                /* Set up node groups */
                struct sched_group *sg, *prev;
-               cpumask_t nodemask = node_to_cpumask(i);
-               cpumask_t domainspan;
-               cpumask_t covered = CPU_MASK_NONE;
+               SCHED_CPUMASK_VAR(nodemask, allmasks);
+               SCHED_CPUMASK_VAR(domainspan, allmasks);
+               SCHED_CPUMASK_VAR(covered, allmasks);
                int j;
 
-               cpus_and(nodemask, nodemask, *cpu_map);
-               if (cpus_empty(nodemask)) {
+               *nodemask = node_to_cpumask(i);
+               cpus_clear(*covered);
+
+               cpus_and(*nodemask, *nodemask, *cpu_map);
+               if (cpus_empty(*nodemask)) {
                        sched_group_nodes[i] = NULL;
                        continue;
                }
 
-               domainspan = sched_domain_node_span(i);
-               cpus_and(domainspan, domainspan, *cpu_map);
+               sched_domain_node_span(i, domainspan);
+               cpus_and(*domainspan, *domainspan, *cpu_map);
 
                sg = kmalloc_node(sizeof(struct sched_group), GFP_KERNEL, i);
                if (!sg) {
@@ -6740,31 +7586,31 @@ static int build_sched_domains(const cpumask_t *cpu_map)
                        goto error;
                }
                sched_group_nodes[i] = sg;
-               for_each_cpu_mask(j, nodemask) {
+               for_each_cpu_mask(j, *nodemask) {
                        struct sched_domain *sd;
 
                        sd = &per_cpu(node_domains, j);
                        sd->groups = sg;
                }
                sg->__cpu_power = 0;
-               sg->cpumask = nodemask;
+               sg->cpumask = *nodemask;
                sg->next = sg;
-               cpus_or(covered, covered, nodemask);
+               cpus_or(*covered, *covered, *nodemask);
                prev = sg;
 
                for (j = 0; j < MAX_NUMNODES; j++) {
-                       cpumask_t tmp, notcovered;
+                       SCHED_CPUMASK_VAR(notcovered, allmasks);
                        int n = (i + j) % MAX_NUMNODES;
+                       node_to_cpumask_ptr(pnodemask, n);
 
-                       cpus_complement(notcovered, covered);
-                       cpus_and(tmp, notcovered, *cpu_map);
-                       cpus_and(tmp, tmp, domainspan);
-                       if (cpus_empty(tmp))
+                       cpus_complement(*notcovered, *covered);
+                       cpus_and(*tmpmask, *notcovered, *cpu_map);
+                       cpus_and(*tmpmask, *tmpmask, *domainspan);
+                       if (cpus_empty(*tmpmask))
                                break;
 
-                       nodemask = node_to_cpumask(n);
-                       cpus_and(tmp, tmp, nodemask);
-                       if (cpus_empty(tmp))
+                       cpus_and(*tmpmask, *tmpmask, *pnodemask);
+                       if (cpus_empty(*tmpmask))
                                continue;
 
                        sg = kmalloc_node(sizeof(struct sched_group),
@@ -6775,9 +7621,9 @@ static int build_sched_domains(const cpumask_t *cpu_map)
                                goto error;
                        }
                        sg->__cpu_power = 0;
-                       sg->cpumask = tmp;
+                       sg->cpumask = *tmpmask;
                        sg->next = prev->next;
-                       cpus_or(covered, covered, tmp);
+                       cpus_or(*covered, *covered, *tmpmask);
                        prev->next = sg;
                        prev = sg;
                }
@@ -6813,7 +7659,8 @@ static int build_sched_domains(const cpumask_t *cpu_map)
        if (sd_allnodes) {
                struct sched_group *sg;
 
-               cpu_to_allnodes_group(first_cpu(*cpu_map), cpu_map, &sg);
+               cpu_to_allnodes_group(first_cpu(*cpu_map), cpu_map, &sg,
+                                                               tmpmask);
                init_numa_sched_groups_power(sg);
        }
 #endif
@@ -6831,17 +7678,26 @@ static int build_sched_domains(const cpumask_t *cpu_map)
                cpu_attach_domain(sd, rd, i);
        }
 
+       SCHED_CPUMASK_FREE((void *)allmasks);
        return 0;
 
 #ifdef CONFIG_NUMA
 error:
-       free_sched_groups(cpu_map);
+       free_sched_groups(cpu_map, tmpmask);
+       SCHED_CPUMASK_FREE((void *)allmasks);
        return -ENOMEM;
 #endif
 }
 
+static int build_sched_domains(const cpumask_t *cpu_map)
+{
+       return __build_sched_domains(cpu_map, NULL);
+}
+
 static cpumask_t *doms_cur;    /* current sched domains */
 static int ndoms_cur;          /* number of sched domains in 'doms_cur' */
+static struct sched_domain_attr *dattr_cur;    /* attribues of custom domains
+                                                  in 'doms_cur' */
 
 /*
  * Special case: If a kmalloc of a doms_cur partition (array of
@@ -6869,15 +7725,17 @@ static int arch_init_sched_domains(const cpumask_t *cpu_map)
        if (!doms_cur)
                doms_cur = &fallback_doms;
        cpus_andnot(*doms_cur, *cpu_map, cpu_isolated_map);
+       dattr_cur = NULL;
        err = build_sched_domains(doms_cur);
        register_sched_domain_sysctl();
 
        return err;
 }
 
-static void arch_destroy_sched_domains(const cpumask_t *cpu_map)
+static void arch_destroy_sched_domains(const cpumask_t *cpu_map,
+                                      cpumask_t *tmpmask)
 {
-       free_sched_groups(cpu_map);
+       free_sched_groups(cpu_map, tmpmask);
 }
 
 /*
@@ -6886,6 +7744,7 @@ static void arch_destroy_sched_domains(const cpumask_t *cpu_map)
  */
 static void detach_destroy_domains(const cpumask_t *cpu_map)
 {
+       cpumask_t tmpmask;
        int i;
 
        unregister_sched_domain_sysctl();
@@ -6893,7 +7752,23 @@ static void detach_destroy_domains(const cpumask_t *cpu_map)
        for_each_cpu_mask(i, *cpu_map)
                cpu_attach_domain(NULL, &def_root_domain, i);
        synchronize_sched();
-       arch_destroy_sched_domains(cpu_map);
+       arch_destroy_sched_domains(cpu_map, &tmpmask);
+}
+
+/* handle null as "default" */
+static int dattrs_equal(struct sched_domain_attr *cur, int idx_cur,
+                       struct sched_domain_attr *new, int idx_new)
+{
+       struct sched_domain_attr tmp;
+
+       /* fast path */
+       if (!new && !cur)
+               return 1;
+
+       tmp = SD_ATTR_INIT;
+       return !memcmp(cur ? (cur + idx_cur) : &tmp,
+                       new ? (new + idx_new) : &tmp,
+                       sizeof(struct sched_domain_attr));
 }
 
 /*
@@ -6917,7 +7792,8 @@ static void detach_destroy_domains(const cpumask_t *cpu_map)
  *
  * Call with hotplug lock held
  */
-void partition_sched_domains(int ndoms_new, cpumask_t *doms_new)
+void partition_sched_domains(int ndoms_new, cpumask_t *doms_new,
+                            struct sched_domain_attr *dattr_new)
 {
        int i, j;
 
@@ -6930,12 +7806,14 @@ void partition_sched_domains(int ndoms_new, cpumask_t *doms_new)
                ndoms_new = 1;
                doms_new = &fallback_doms;
                cpus_andnot(doms_new[0], cpu_online_map, cpu_isolated_map);
+               dattr_new = NULL;
        }
 
        /* Destroy deleted domains */
        for (i = 0; i < ndoms_cur; i++) {
                for (j = 0; j < ndoms_new; j++) {
-                       if (cpus_equal(doms_cur[i], doms_new[j]))
+                       if (cpus_equal(doms_cur[i], doms_new[j])
+                           && dattrs_equal(dattr_cur, i, dattr_new, j))
                                goto match1;
                }
                /* no match - a current sched domain not in new doms_new[] */
@@ -6947,11 +7825,13 @@ match1:
        /* Build new domains */
        for (i = 0; i < ndoms_new; i++) {
                for (j = 0; j < ndoms_cur; j++) {
-                       if (cpus_equal(doms_new[i], doms_cur[j]))
+                       if (cpus_equal(doms_new[i], doms_cur[j])
+                           && dattrs_equal(dattr_new, i, dattr_cur, j))
                                goto match2;
                }
                /* no match - add a new doms_new */
-               build_sched_domains(doms_new + i);
+               __build_sched_domains(doms_new + i,
+                                       dattr_new ? dattr_new + i : NULL);
 match2:
                ;
        }
@@ -6959,7 +7839,9 @@ match2:
        /* Remember the new sched domains */
        if (doms_cur != &fallback_doms)
                kfree(doms_cur);
+       kfree(dattr_cur);       /* kfree(NULL) is safe */
        doms_cur = doms_new;
+       dattr_cur = dattr_new;
        ndoms_cur = ndoms_new;
 
        register_sched_domain_sysctl();
@@ -7086,6 +7968,11 @@ void __init sched_init_smp(void)
 {
        cpumask_t non_isolated_cpus;
 
+#if defined(CONFIG_NUMA)
+       sched_group_nodes_bycpu = kzalloc(nr_cpu_ids * sizeof(void **),
+                                                               GFP_KERNEL);
+       BUG_ON(sched_group_nodes_bycpu == NULL);
+#endif
        get_online_cpus();
        arch_init_sched_domains(&cpu_online_map);
        cpus_andnot(non_isolated_cpus, cpu_possible_map, cpu_isolated_map);
@@ -7096,13 +7983,18 @@ void __init sched_init_smp(void)
        hotcpu_notifier(update_sched_domains, 0);
 
        /* Move init over to a non-isolated CPU */
-       if (set_cpus_allowed(current, non_isolated_cpus) < 0)
+       if (set_cpus_allowed_ptr(current, &non_isolated_cpus) < 0)
                BUG();
        sched_init_granularity();
 }
 #else
 void __init sched_init_smp(void)
 {
+#if defined(CONFIG_NUMA)
+       sched_group_nodes_bycpu = kzalloc(nr_cpu_ids * sizeof(void **),
+                                                               GFP_KERNEL);
+       BUG_ON(sched_group_nodes_bycpu == NULL);
+#endif
        sched_init_granularity();
 }
 #endif /* CONFIG_SMP */
@@ -7117,6 +8009,7 @@ int in_sched_functions(unsigned long addr)
 static void init_cfs_rq(struct cfs_rq *cfs_rq, struct rq *rq)
 {
        cfs_rq->tasks_timeline = RB_ROOT;
+       INIT_LIST_HEAD(&cfs_rq->tasks);
 #ifdef CONFIG_FAIR_GROUP_SCHED
        cfs_rq->rq = rq;
 #endif
@@ -7146,6 +8039,8 @@ static void init_rt_rq(struct rt_rq *rt_rq, struct rq *rq)
 
        rt_rq->rt_time = 0;
        rt_rq->rt_throttled = 0;
+       rt_rq->rt_runtime = 0;
+       spin_lock_init(&rt_rq->rt_runtime_lock);
 
 #ifdef CONFIG_RT_GROUP_SCHED
        rt_rq->rt_nr_boosted = 0;
@@ -7154,10 +8049,11 @@ static void init_rt_rq(struct rt_rq *rt_rq, struct rq *rq)
 }
 
 #ifdef CONFIG_FAIR_GROUP_SCHED
-static void init_tg_cfs_entry(struct rq *rq, struct task_group *tg,
-               struct cfs_rq *cfs_rq, struct sched_entity *se,
-               int cpu, int add)
+static void init_tg_cfs_entry(struct task_group *tg, struct cfs_rq *cfs_rq,
+                               struct sched_entity *se, int cpu, int add,
+                               struct sched_entity *parent)
 {
+       struct rq *rq = cpu_rq(cpu);
        tg->cfs_rq[cpu] = cfs_rq;
        init_cfs_rq(cfs_rq, rq);
        cfs_rq->tg = tg;
@@ -7165,45 +8061,132 @@ static void init_tg_cfs_entry(struct rq *rq, struct task_group *tg,
                list_add(&cfs_rq->leaf_cfs_rq_list, &rq->leaf_cfs_rq_list);
 
        tg->se[cpu] = se;
-       se->cfs_rq = &rq->cfs;
+       /* se could be NULL for init_task_group */
+       if (!se)
+               return;
+
+       if (!parent)
+               se->cfs_rq = &rq->cfs;
+       else
+               se->cfs_rq = parent->my_q;
+
        se->my_q = cfs_rq;
        se->load.weight = tg->shares;
        se->load.inv_weight = div64_64(1ULL<<32, se->load.weight);
-       se->parent = NULL;
+       se->parent = parent;
 }
 #endif
 
 #ifdef CONFIG_RT_GROUP_SCHED
-static void init_tg_rt_entry(struct rq *rq, struct task_group *tg,
-               struct rt_rq *rt_rq, struct sched_rt_entity *rt_se,
-               int cpu, int add)
+static void init_tg_rt_entry(struct task_group *tg, struct rt_rq *rt_rq,
+               struct sched_rt_entity *rt_se, int cpu, int add,
+               struct sched_rt_entity *parent)
 {
+       struct rq *rq = cpu_rq(cpu);
+
        tg->rt_rq[cpu] = rt_rq;
        init_rt_rq(rt_rq, rq);
        rt_rq->tg = tg;
        rt_rq->rt_se = rt_se;
+       rt_rq->rt_runtime = tg->rt_bandwidth.rt_runtime;
        if (add)
                list_add(&rt_rq->leaf_rt_rq_list, &rq->leaf_rt_rq_list);
 
        tg->rt_se[cpu] = rt_se;
+       if (!rt_se)
+               return;
+
+       if (!parent)
+               rt_se->rt_rq = &rq->rt;
+       else
+               rt_se->rt_rq = parent->my_q;
+
        rt_se->rt_rq = &rq->rt;
        rt_se->my_q = rt_rq;
-       rt_se->parent = NULL;
+       rt_se->parent = parent;
        INIT_LIST_HEAD(&rt_se->run_list);
 }
 #endif
 
 void __init sched_init(void)
 {
-       int highest_cpu = 0;
        int i, j;
+       unsigned long alloc_size = 0, ptr;
+
+#ifdef CONFIG_FAIR_GROUP_SCHED
+       alloc_size += 2 * nr_cpu_ids * sizeof(void **);
+#endif
+#ifdef CONFIG_RT_GROUP_SCHED
+       alloc_size += 2 * nr_cpu_ids * sizeof(void **);
+#endif
+#ifdef CONFIG_USER_SCHED
+       alloc_size *= 2;
+#endif
+       /*
+        * As sched_init() is called before page_alloc is setup,
+        * we use alloc_bootmem().
+        */
+       if (alloc_size) {
+               ptr = (unsigned long)alloc_bootmem_low(alloc_size);
+
+#ifdef CONFIG_FAIR_GROUP_SCHED
+               init_task_group.se = (struct sched_entity **)ptr;
+               ptr += nr_cpu_ids * sizeof(void **);
+
+               init_task_group.cfs_rq = (struct cfs_rq **)ptr;
+               ptr += nr_cpu_ids * sizeof(void **);
+
+#ifdef CONFIG_USER_SCHED
+               root_task_group.se = (struct sched_entity **)ptr;
+               ptr += nr_cpu_ids * sizeof(void **);
+
+               root_task_group.cfs_rq = (struct cfs_rq **)ptr;
+               ptr += nr_cpu_ids * sizeof(void **);
+#endif
+#endif
+#ifdef CONFIG_RT_GROUP_SCHED
+               init_task_group.rt_se = (struct sched_rt_entity **)ptr;
+               ptr += nr_cpu_ids * sizeof(void **);
+
+               init_task_group.rt_rq = (struct rt_rq **)ptr;
+               ptr += nr_cpu_ids * sizeof(void **);
+
+#ifdef CONFIG_USER_SCHED
+               root_task_group.rt_se = (struct sched_rt_entity **)ptr;
+               ptr += nr_cpu_ids * sizeof(void **);
+
+               root_task_group.rt_rq = (struct rt_rq **)ptr;
+               ptr += nr_cpu_ids * sizeof(void **);
+#endif
+#endif
+       }
 
 #ifdef CONFIG_SMP
+       init_aggregate();
        init_defrootdomain();
 #endif
 
+       init_rt_bandwidth(&def_rt_bandwidth,
+                       global_rt_period(), global_rt_runtime());
+
+#ifdef CONFIG_RT_GROUP_SCHED
+       init_rt_bandwidth(&init_task_group.rt_bandwidth,
+                       global_rt_period(), global_rt_runtime());
+#ifdef CONFIG_USER_SCHED
+       init_rt_bandwidth(&root_task_group.rt_bandwidth,
+                       global_rt_period(), RUNTIME_INF);
+#endif
+#endif
+
 #ifdef CONFIG_GROUP_SCHED
        list_add(&init_task_group.list, &task_groups);
+       INIT_LIST_HEAD(&init_task_group.children);
+
+#ifdef CONFIG_USER_SCHED
+       INIT_LIST_HEAD(&root_task_group.children);
+       init_task_group.parent = &root_task_group;
+       list_add(&init_task_group.siblings, &root_task_group.children);
+#endif
 #endif
 
        for_each_possible_cpu(i) {
@@ -7214,26 +8197,68 @@ void __init sched_init(void)
                lockdep_set_class(&rq->lock, &rq->rq_lock_key);
                rq->nr_running = 0;
                rq->clock = 1;
+               update_last_tick_seen(rq);
                init_cfs_rq(&rq->cfs, rq);
                init_rt_rq(&rq->rt, rq);
 #ifdef CONFIG_FAIR_GROUP_SCHED
                init_task_group.shares = init_task_group_load;
                INIT_LIST_HEAD(&rq->leaf_cfs_rq_list);
-               init_tg_cfs_entry(rq, &init_task_group,
+#ifdef CONFIG_CGROUP_SCHED
+               /*
+                * How much cpu bandwidth does init_task_group get?
+                *
+                * In case of task-groups formed thr' the cgroup filesystem, it
+                * gets 100% of the cpu resources in the system. This overall
+                * system cpu resource is divided among the tasks of
+                * init_task_group and its child task-groups in a fair manner,
+                * based on each entity's (task or task-group's) weight
+                * (se->load.weight).
+                *
+                * In other words, if init_task_group has 10 tasks of weight
+                * 1024) and two child groups A0 and A1 (of weight 1024 each),
+                * then A0's share of the cpu resource is:
+                *
+                *      A0's bandwidth = 1024 / (10*1024 + 1024 + 1024) = 8.33%
+                *
+                * We achieve this by letting init_task_group's tasks sit
+                * directly in rq->cfs (i.e init_task_group->se[] = NULL).
+                */
+               init_tg_cfs_entry(&init_task_group, &rq->cfs, NULL, i, 1, NULL);
+#elif defined CONFIG_USER_SCHED
+               root_task_group.shares = NICE_0_LOAD;
+               init_tg_cfs_entry(&root_task_group, &rq->cfs, NULL, i, 0, NULL);
+               /*
+                * In case of task-groups formed thr' the user id of tasks,
+                * init_task_group represents tasks belonging to root user.
+                * Hence it forms a sibling of all subsequent groups formed.
+                * In this case, init_task_group gets only a fraction of overall
+                * system cpu resource, based on the weight assigned to root
+                * user's cpu share (INIT_TASK_GROUP_LOAD). This is accomplished
+                * by letting tasks of init_task_group sit in a separate cfs_rq
+                * (init_cfs_rq) and having one entity represent this group of
+                * tasks in rq->cfs (i.e init_task_group->se[] != NULL).
+                */
+               init_tg_cfs_entry(&init_task_group,
                                &per_cpu(init_cfs_rq, i),
-                               &per_cpu(init_sched_entity, i), i, 1);
+                               &per_cpu(init_sched_entity, i), i, 1,
+                               root_task_group.se[i]);
 
 #endif
+#endif /* CONFIG_FAIR_GROUP_SCHED */
+
+               rq->rt.rt_runtime = def_rt_bandwidth.rt_runtime;
 #ifdef CONFIG_RT_GROUP_SCHED
-               init_task_group.rt_runtime =
-                       sysctl_sched_rt_runtime * NSEC_PER_USEC;
                INIT_LIST_HEAD(&rq->leaf_rt_rq_list);
-               init_tg_rt_entry(rq, &init_task_group,
+#ifdef CONFIG_CGROUP_SCHED
+               init_tg_rt_entry(&init_task_group, &rq->rt, NULL, i, 1, NULL);
+#elif defined CONFIG_USER_SCHED
+               init_tg_rt_entry(&root_task_group, &rq->rt, NULL, i, 0, NULL);
+               init_tg_rt_entry(&init_task_group,
                                &per_cpu(init_rt_rq, i),
-                               &per_cpu(init_sched_rt_entity, i), i, 1);
+                               &per_cpu(init_sched_rt_entity, i), i, 1,
+                               root_task_group.rt_se[i]);
+#endif
 #endif
-               rq->rt_period_expire = 0;
-               rq->rt_throttled = 0;
 
                for (j = 0; j < CPU_LOAD_IDX_MAX; j++)
                        rq->cpu_load[j] = 0;
@@ -7250,7 +8275,6 @@ void __init sched_init(void)
 #endif
                init_rq_hrtick(rq);
                atomic_set(&rq->nr_iowait, 0);
-               highest_cpu = i;
        }
 
        set_load_weight(&init_task);
@@ -7260,7 +8284,6 @@ void __init sched_init(void)
 #endif
 
 #ifdef CONFIG_SMP
-       nr_cpu_ids = highest_cpu + 1;
        open_softirq(SCHED_SOFTIRQ, run_rebalance_domains, NULL);
 #endif
 
@@ -7419,8 +8442,6 @@ void set_curr_task(int cpu, struct task_struct *p)
 
 #endif
 
-#ifdef CONFIG_GROUP_SCHED
-
 #ifdef CONFIG_FAIR_GROUP_SCHED
 static void free_fair_sched_group(struct task_group *tg)
 {
@@ -7437,17 +8458,18 @@ static void free_fair_sched_group(struct task_group *tg)
        kfree(tg->se);
 }
 
-static int alloc_fair_sched_group(struct task_group *tg)
+static
+int alloc_fair_sched_group(struct task_group *tg, struct task_group *parent)
 {
        struct cfs_rq *cfs_rq;
-       struct sched_entity *se;
+       struct sched_entity *se, *parent_se;
        struct rq *rq;
        int i;
 
-       tg->cfs_rq = kzalloc(sizeof(cfs_rq) * NR_CPUS, GFP_KERNEL);
+       tg->cfs_rq = kzalloc(sizeof(cfs_rq) * nr_cpu_ids, GFP_KERNEL);
        if (!tg->cfs_rq)
                goto err;
-       tg->se = kzalloc(sizeof(se) * NR_CPUS, GFP_KERNEL);
+       tg->se = kzalloc(sizeof(se) * nr_cpu_ids, GFP_KERNEL);
        if (!tg->se)
                goto err;
 
@@ -7466,7 +8488,8 @@ static int alloc_fair_sched_group(struct task_group *tg)
                if (!se)
                        goto err;
 
-               init_tg_cfs_entry(rq, tg, cfs_rq, se, i, 0);
+               parent_se = parent ? parent->se[i] : NULL;
+               init_tg_cfs_entry(tg, cfs_rq, se, i, 0, parent_se);
        }
 
        return 1;
@@ -7490,7 +8513,8 @@ static inline void free_fair_sched_group(struct task_group *tg)
 {
 }
 
-static inline int alloc_fair_sched_group(struct task_group *tg)
+static inline
+int alloc_fair_sched_group(struct task_group *tg, struct task_group *parent)
 {
        return 1;
 }
@@ -7509,6 +8533,8 @@ static void free_rt_sched_group(struct task_group *tg)
 {
        int i;
 
+       destroy_rt_bandwidth(&tg->rt_bandwidth);
+
        for_each_possible_cpu(i) {
                if (tg->rt_rq)
                        kfree(tg->rt_rq[i]);
@@ -7520,21 +8546,23 @@ static void free_rt_sched_group(struct task_group *tg)
        kfree(tg->rt_se);
 }
 
-static int alloc_rt_sched_group(struct task_group *tg)
+static
+int alloc_rt_sched_group(struct task_group *tg, struct task_group *parent)
 {
        struct rt_rq *rt_rq;
-       struct sched_rt_entity *rt_se;
+       struct sched_rt_entity *rt_se, *parent_se;
        struct rq *rq;
        int i;
 
-       tg->rt_rq = kzalloc(sizeof(rt_rq) * NR_CPUS, GFP_KERNEL);
+       tg->rt_rq = kzalloc(sizeof(rt_rq) * nr_cpu_ids, GFP_KERNEL);
        if (!tg->rt_rq)
                goto err;
-       tg->rt_se = kzalloc(sizeof(rt_se) * NR_CPUS, GFP_KERNEL);
+       tg->rt_se = kzalloc(sizeof(rt_se) * nr_cpu_ids, GFP_KERNEL);
        if (!tg->rt_se)
                goto err;
 
-       tg->rt_runtime = 0;
+       init_rt_bandwidth(&tg->rt_bandwidth,
+                       ktime_to_ns(def_rt_bandwidth.rt_period), 0);
 
        for_each_possible_cpu(i) {
                rq = cpu_rq(i);
@@ -7549,7 +8577,8 @@ static int alloc_rt_sched_group(struct task_group *tg)
                if (!rt_se)
                        goto err;
 
-               init_tg_rt_entry(rq, tg, rt_rq, rt_se, i, 0);
+               parent_se = parent ? parent->rt_se[i] : NULL;
+               init_tg_rt_entry(tg, rt_rq, rt_se, i, 0, parent_se);
        }
 
        return 1;
@@ -7573,7 +8602,8 @@ static inline void free_rt_sched_group(struct task_group *tg)
 {
 }
 
-static inline int alloc_rt_sched_group(struct task_group *tg)
+static inline
+int alloc_rt_sched_group(struct task_group *tg, struct task_group *parent)
 {
        return 1;
 }
@@ -7587,6 +8617,7 @@ static inline void unregister_rt_sched_group(struct task_group *tg, int cpu)
 }
 #endif
 
+#ifdef CONFIG_GROUP_SCHED
 static void free_sched_group(struct task_group *tg)
 {
        free_fair_sched_group(tg);
@@ -7595,7 +8626,7 @@ static void free_sched_group(struct task_group *tg)
 }
 
 /* allocate runqueue etc for a new task group */
-struct task_group *sched_create_group(void)
+struct task_group *sched_create_group(struct task_group *parent)
 {
        struct task_group *tg;
        unsigned long flags;
@@ -7605,10 +8636,10 @@ struct task_group *sched_create_group(void)
        if (!tg)
                return ERR_PTR(-ENOMEM);
 
-       if (!alloc_fair_sched_group(tg))
+       if (!alloc_fair_sched_group(tg, parent))
                goto err;
 
-       if (!alloc_rt_sched_group(tg))
+       if (!alloc_rt_sched_group(tg, parent))
                goto err;
 
        spin_lock_irqsave(&task_group_lock, flags);
@@ -7617,6 +8648,12 @@ struct task_group *sched_create_group(void)
                register_rt_sched_group(tg, i);
        }
        list_add_rcu(&tg->list, &task_groups);
+
+       WARN_ON(!parent); /* root should already exist */
+
+       tg->parent = parent;
+       list_add_rcu(&tg->siblings, &parent->children);
+       INIT_LIST_HEAD(&tg->children);
        spin_unlock_irqrestore(&task_group_lock, flags);
 
        return tg;
@@ -7645,6 +8682,7 @@ void sched_destroy_group(struct task_group *tg)
                unregister_rt_sched_group(tg, i);
        }
        list_del_rcu(&tg->list);
+       list_del_rcu(&tg->siblings);
        spin_unlock_irqrestore(&task_group_lock, flags);
 
        /* wait for possible concurrent references to cfs_rqs complete */
@@ -7688,16 +8726,14 @@ void sched_move_task(struct task_struct *tsk)
 
        task_rq_unlock(rq, &flags);
 }
+#endif
 
 #ifdef CONFIG_FAIR_GROUP_SCHED
-static void set_se_shares(struct sched_entity *se, unsigned long shares)
+static void __set_se_shares(struct sched_entity *se, unsigned long shares)
 {
        struct cfs_rq *cfs_rq = se->cfs_rq;
-       struct rq *rq = cfs_rq->rq;
        int on_rq;
 
-       spin_lock_irq(&rq->lock);
-
        on_rq = se->on_rq;
        if (on_rq)
                dequeue_entity(cfs_rq, se, 0);
@@ -7707,8 +8743,17 @@ static void set_se_shares(struct sched_entity *se, unsigned long shares)
 
        if (on_rq)
                enqueue_entity(cfs_rq, se, 0);
+}
 
-       spin_unlock_irq(&rq->lock);
+static void set_se_shares(struct sched_entity *se, unsigned long shares)
+{
+       struct cfs_rq *cfs_rq = se->cfs_rq;
+       struct rq *rq = cfs_rq->rq;
+       unsigned long flags;
+
+       spin_lock_irqsave(&rq->lock, flags);
+       __set_se_shares(se, shares);
+       spin_unlock_irqrestore(&rq->lock, flags);
 }
 
 static DEFINE_MUTEX(shares_mutex);
@@ -7718,13 +8763,19 @@ int sched_group_set_shares(struct task_group *tg, unsigned long shares)
        int i;
        unsigned long flags;
 
+       /*
+        * We can't change the weight of the root cgroup.
+        */
+       if (!tg->se[0])
+               return -EINVAL;
+
        /*
         * A weight of 0 or 1 can cause arithmetics problems.
         * (The default weight is 1024 - so there's no practical
         *  limitation from this.)
         */
-       if (shares < 2)
-               shares = 2;
+       if (shares < MIN_SHARES)
+               shares = MIN_SHARES;
 
        mutex_lock(&shares_mutex);
        if (tg->shares == shares)
@@ -7733,6 +8784,7 @@ int sched_group_set_shares(struct task_group *tg, unsigned long shares)
        spin_lock_irqsave(&task_group_lock, flags);
        for_each_possible_cpu(i)
                unregister_fair_sched_group(tg, i);
+       list_del_rcu(&tg->siblings);
        spin_unlock_irqrestore(&task_group_lock, flags);
 
        /* wait for any ongoing reference to this group to finish */
@@ -7743,8 +8795,13 @@ int sched_group_set_shares(struct task_group *tg, unsigned long shares)
         * w/o tripping rebalance_share or load_balance_fair.
         */
        tg->shares = shares;
-       for_each_possible_cpu(i)
-               set_se_shares(tg->se[i], shares);
+       for_each_possible_cpu(i) {
+               /*
+                * force a rebalance
+                */
+               cfs_rq_set_shares(tg->cfs_rq[i], 0);
+               set_se_shares(tg->se[i], shares/nr_cpu_ids);
+       }
 
        /*
         * Enable load balance activity on this group, by inserting it back on
@@ -7753,6 +8810,7 @@ int sched_group_set_shares(struct task_group *tg, unsigned long shares)
        spin_lock_irqsave(&task_group_lock, flags);
        for_each_possible_cpu(i)
                register_fair_sched_group(tg, i);
+       list_add_rcu(&tg->siblings, &tg->parent->children);
        spin_unlock_irqrestore(&task_group_lock, flags);
 done:
        mutex_unlock(&shares_mutex);
@@ -7779,26 +8837,58 @@ static unsigned long to_ratio(u64 period, u64 runtime)
        return div64_64(runtime << 16, period);
 }
 
+#ifdef CONFIG_CGROUP_SCHED
+static int __rt_schedulable(struct task_group *tg, u64 period, u64 runtime)
+{
+       struct task_group *tgi, *parent = tg->parent;
+       unsigned long total = 0;
+
+       if (!parent) {
+               if (global_rt_period() < period)
+                       return 0;
+
+               return to_ratio(period, runtime) <
+                       to_ratio(global_rt_period(), global_rt_runtime());
+       }
+
+       if (ktime_to_ns(parent->rt_bandwidth.rt_period) < period)
+               return 0;
+
+       rcu_read_lock();
+       list_for_each_entry_rcu(tgi, &parent->children, siblings) {
+               if (tgi == tg)
+                       continue;
+
+               total += to_ratio(ktime_to_ns(tgi->rt_bandwidth.rt_period),
+                               tgi->rt_bandwidth.rt_runtime);
+       }
+       rcu_read_unlock();
+
+       return total + to_ratio(period, runtime) <
+               to_ratio(ktime_to_ns(parent->rt_bandwidth.rt_period),
+                               parent->rt_bandwidth.rt_runtime);
+}
+#elif defined CONFIG_USER_SCHED
 static int __rt_schedulable(struct task_group *tg, u64 period, u64 runtime)
 {
        struct task_group *tgi;
        unsigned long total = 0;
        unsigned long global_ratio =
-               to_ratio(sysctl_sched_rt_period,
-                        sysctl_sched_rt_runtime < 0 ?
-                               RUNTIME_INF : sysctl_sched_rt_runtime);
+               to_ratio(global_rt_period(), global_rt_runtime());
 
        rcu_read_lock();
        list_for_each_entry_rcu(tgi, &task_groups, list) {
                if (tgi == tg)
                        continue;
 
-               total += to_ratio(period, tgi->rt_runtime);
+               total += to_ratio(ktime_to_ns(tgi->rt_bandwidth.rt_period),
+                               tgi->rt_bandwidth.rt_runtime);
        }
        rcu_read_unlock();
 
        return total + to_ratio(period, runtime) < global_ratio;
 }
+#endif
 
 /* Must be called with tasklist_lock held */
 static inline int tg_has_rt_tasks(struct task_group *tg)
@@ -7811,19 +8901,14 @@ static inline int tg_has_rt_tasks(struct task_group *tg)
        return 0;
 }
 
-int sched_group_set_rt_runtime(struct task_group *tg, long rt_runtime_us)
+static int tg_set_bandwidth(struct task_group *tg,
+               u64 rt_period, u64 rt_runtime)
 {
-       u64 rt_runtime, rt_period;
-       int err = 0;
-
-       rt_period = (u64)sysctl_sched_rt_period * NSEC_PER_USEC;
-       rt_runtime = (u64)rt_runtime_us * NSEC_PER_USEC;
-       if (rt_runtime_us == -1)
-               rt_runtime = RUNTIME_INF;
+       int i, err = 0;
 
        mutex_lock(&rt_constraints_mutex);
        read_lock(&tasklist_lock);
-       if (rt_runtime_us == 0 && tg_has_rt_tasks(tg)) {
+       if (rt_runtime == 0 && tg_has_rt_tasks(tg)) {
                err = -EBUSY;
                goto unlock;
        }
@@ -7831,7 +8916,19 @@ int sched_group_set_rt_runtime(struct task_group *tg, long rt_runtime_us)
                err = -EINVAL;
                goto unlock;
        }
-       tg->rt_runtime = rt_runtime;
+
+       spin_lock_irq(&tg->rt_bandwidth.rt_runtime_lock);
+       tg->rt_bandwidth.rt_period = ns_to_ktime(rt_period);
+       tg->rt_bandwidth.rt_runtime = rt_runtime;
+
+       for_each_possible_cpu(i) {
+               struct rt_rq *rt_rq = tg->rt_rq[i];
+
+               spin_lock(&rt_rq->rt_runtime_lock);
+               rt_rq->rt_runtime = rt_runtime;
+               spin_unlock(&rt_rq->rt_runtime_lock);
+       }
+       spin_unlock_irq(&tg->rt_bandwidth.rt_runtime_lock);
  unlock:
        read_unlock(&tasklist_lock);
        mutex_unlock(&rt_constraints_mutex);
@@ -7839,19 +8936,109 @@ int sched_group_set_rt_runtime(struct task_group *tg, long rt_runtime_us)
        return err;
 }
 
+int sched_group_set_rt_runtime(struct task_group *tg, long rt_runtime_us)
+{
+       u64 rt_runtime, rt_period;
+
+       rt_period = ktime_to_ns(tg->rt_bandwidth.rt_period);
+       rt_runtime = (u64)rt_runtime_us * NSEC_PER_USEC;
+       if (rt_runtime_us < 0)
+               rt_runtime = RUNTIME_INF;
+
+       return tg_set_bandwidth(tg, rt_period, rt_runtime);
+}
+
 long sched_group_rt_runtime(struct task_group *tg)
 {
        u64 rt_runtime_us;
 
-       if (tg->rt_runtime == RUNTIME_INF)
+       if (tg->rt_bandwidth.rt_runtime == RUNTIME_INF)
                return -1;
 
-       rt_runtime_us = tg->rt_runtime;
+       rt_runtime_us = tg->rt_bandwidth.rt_runtime;
        do_div(rt_runtime_us, NSEC_PER_USEC);
        return rt_runtime_us;
 }
+
+int sched_group_set_rt_period(struct task_group *tg, long rt_period_us)
+{
+       u64 rt_runtime, rt_period;
+
+       rt_period = (u64)rt_period_us * NSEC_PER_USEC;
+       rt_runtime = tg->rt_bandwidth.rt_runtime;
+
+       return tg_set_bandwidth(tg, rt_period, rt_runtime);
+}
+
+long sched_group_rt_period(struct task_group *tg)
+{
+       u64 rt_period_us;
+
+       rt_period_us = ktime_to_ns(tg->rt_bandwidth.rt_period);
+       do_div(rt_period_us, NSEC_PER_USEC);
+       return rt_period_us;
+}
+
+static int sched_rt_global_constraints(void)
+{
+       int ret = 0;
+
+       mutex_lock(&rt_constraints_mutex);
+       if (!__rt_schedulable(NULL, 1, 0))
+               ret = -EINVAL;
+       mutex_unlock(&rt_constraints_mutex);
+
+       return ret;
+}
+#else
+static int sched_rt_global_constraints(void)
+{
+       unsigned long flags;
+       int i;
+
+       spin_lock_irqsave(&def_rt_bandwidth.rt_runtime_lock, flags);
+       for_each_possible_cpu(i) {
+               struct rt_rq *rt_rq = &cpu_rq(i)->rt;
+
+               spin_lock(&rt_rq->rt_runtime_lock);
+               rt_rq->rt_runtime = global_rt_runtime();
+               spin_unlock(&rt_rq->rt_runtime_lock);
+       }
+       spin_unlock_irqrestore(&def_rt_bandwidth.rt_runtime_lock, flags);
+
+       return 0;
+}
 #endif
-#endif /* CONFIG_GROUP_SCHED */
+
+int sched_rt_handler(struct ctl_table *table, int write,
+               struct file *filp, void __user *buffer, size_t *lenp,
+               loff_t *ppos)
+{
+       int ret;
+       int old_period, old_runtime;
+       static DEFINE_MUTEX(mutex);
+
+       mutex_lock(&mutex);
+       old_period = sysctl_sched_rt_period;
+       old_runtime = sysctl_sched_rt_runtime;
+
+       ret = proc_dointvec(table, write, filp, buffer, lenp, ppos);
+
+       if (!ret && write) {
+               ret = sched_rt_global_constraints();
+               if (ret) {
+                       sysctl_sched_rt_period = old_period;
+                       sysctl_sched_rt_runtime = old_runtime;
+               } else {
+                       def_rt_bandwidth.rt_runtime = global_rt_runtime();
+                       def_rt_bandwidth.rt_period =
+                               ns_to_ktime(global_rt_period());
+               }
+       }
+       mutex_unlock(&mutex);
+
+       return ret;
+}
 
 #ifdef CONFIG_CGROUP_SCHED
 
@@ -7865,7 +9052,7 @@ static inline struct task_group *cgroup_tg(struct cgroup *cgrp)
 static struct cgroup_subsys_state *
 cpu_cgroup_create(struct cgroup_subsys *ss, struct cgroup *cgrp)
 {
-       struct task_group *tg;
+       struct task_group *tg, *parent;
 
        if (!cgrp->parent) {
                /* This is early initialization for the top cgroup */
@@ -7873,11 +9060,8 @@ cpu_cgroup_create(struct cgroup_subsys *ss, struct cgroup *cgrp)
                return &init_task_group.css;
        }
 
-       /* we support only 1-level deep hierarchical scheduler atm */
-       if (cgrp->parent->parent)
-               return ERR_PTR(-EINVAL);
-
-       tg = sched_create_group();
+       parent = cgroup_tg(cgrp->parent);
+       tg = sched_create_group(parent);
        if (IS_ERR(tg))
                return ERR_PTR(-ENOMEM);
 
@@ -7901,7 +9085,7 @@ cpu_cgroup_can_attach(struct cgroup_subsys *ss, struct cgroup *cgrp,
 {
 #ifdef CONFIG_RT_GROUP_SCHED
        /* Don't accept realtime tasks when there is no way for them to run */
-       if (rt_task(tsk) && cgroup_tg(cgrp)->rt_runtime == 0)
+       if (rt_task(tsk) && cgroup_tg(cgrp)->rt_bandwidth.rt_runtime == 0)
                return -EINVAL;
 #else
        /* We don't support RT-tasks being in separate groups */
@@ -7935,7 +9119,7 @@ static u64 cpu_shares_read_uint(struct cgroup *cgrp, struct cftype *cft)
 #endif
 
 #ifdef CONFIG_RT_GROUP_SCHED
-static int cpu_rt_runtime_write(struct cgroup *cgrp, struct cftype *cft,
+static ssize_t cpu_rt_runtime_write(struct cgroup *cgrp, struct cftype *cft,
                                struct file *file,
                                const char __user *userbuf,
                                size_t nbytes, loff_t *unused_ppos)
@@ -7979,6 +9163,17 @@ static ssize_t cpu_rt_runtime_read(struct cgroup *cgrp, struct cftype *cft,
 
        return simple_read_from_buffer(buf, nbytes, ppos, tmp, len);
 }
+
+static int cpu_rt_period_write_uint(struct cgroup *cgrp, struct cftype *cftype,
+               u64 rt_period_us)
+{
+       return sched_group_set_rt_period(cgroup_tg(cgrp), rt_period_us);
+}
+
+static u64 cpu_rt_period_read_uint(struct cgroup *cgrp, struct cftype *cft)
+{
+       return sched_group_rt_period(cgroup_tg(cgrp));
+}
 #endif
 
 static struct cftype cpu_files[] = {
@@ -7995,6 +9190,11 @@ static struct cftype cpu_files[] = {
                .read = cpu_rt_runtime_read,
                .write = cpu_rt_runtime_write,
        },
+       {
+               .name = "rt_period_us",
+               .read_uint = cpu_rt_period_read_uint,
+               .write_uint = cpu_rt_period_write_uint,
+       },
 #endif
 };
 
@@ -8035,9 +9235,9 @@ struct cpuacct {
 struct cgroup_subsys cpuacct_subsys;
 
 /* return cpu accounting group corresponding to this container */
-static inline struct cpuacct *cgroup_ca(struct cgroup *cont)
+static inline struct cpuacct *cgroup_ca(struct cgroup *cgrp)
 {
-       return container_of(cgroup_subsys_state(cont, cpuacct_subsys_id),
+       return container_of(cgroup_subsys_state(cgrp, cpuacct_subsys_id),
                            struct cpuacct, css);
 }
 
@@ -8050,7 +9250,7 @@ static inline struct cpuacct *task_ca(struct task_struct *tsk)
 
 /* create a new cpu accounting group */
 static struct cgroup_subsys_state *cpuacct_create(
-       struct cgroup_subsys *ss, struct cgroup *cont)
+       struct cgroup_subsys *ss, struct cgroup *cgrp)
 {
        struct cpuacct *ca = kzalloc(sizeof(*ca), GFP_KERNEL);
 
@@ -8068,18 +9268,18 @@ static struct cgroup_subsys_state *cpuacct_create(
 
 /* destroy an existing cpu accounting group */
 static void
-cpuacct_destroy(struct cgroup_subsys *ss, struct cgroup *cont)
+cpuacct_destroy(struct cgroup_subsys *ss, struct cgroup *cgrp)
 {
-       struct cpuacct *ca = cgroup_ca(cont);
+       struct cpuacct *ca = cgroup_ca(cgrp);
 
        free_percpu(ca->cpuusage);
        kfree(ca);
 }
 
 /* return total cpu usage (in nanoseconds) of a group */
-static u64 cpuusage_read(struct cgroup *cont, struct cftype *cft)
+static u64 cpuusage_read(struct cgroup *cgrp, struct cftype *cft)
 {
-       struct cpuacct *ca = cgroup_ca(cont);
+       struct cpuacct *ca = cgroup_ca(cgrp);
        u64 totalcpuusage = 0;
        int i;
 
@@ -8098,16 +9298,40 @@ static u64 cpuusage_read(struct cgroup *cont, struct cftype *cft)
        return totalcpuusage;
 }
 
+static int cpuusage_write(struct cgroup *cgrp, struct cftype *cftype,
+                                                               u64 reset)
+{
+       struct cpuacct *ca = cgroup_ca(cgrp);
+       int err = 0;
+       int i;
+
+       if (reset) {
+               err = -EINVAL;
+               goto out;
+       }
+
+       for_each_possible_cpu(i) {
+               u64 *cpuusage = percpu_ptr(ca->cpuusage, i);
+
+               spin_lock_irq(&cpu_rq(i)->lock);
+               *cpuusage = 0;
+               spin_unlock_irq(&cpu_rq(i)->lock);
+       }
+out:
+       return err;
+}
+
 static struct cftype files[] = {
        {
                .name = "usage",
                .read_uint = cpuusage_read,
+               .write_uint = cpuusage_write,
        },
 };
 
-static int cpuacct_populate(struct cgroup_subsys *ss, struct cgroup *cont)
+static int cpuacct_populate(struct cgroup_subsys *ss, struct cgroup *cgrp)
 {
-       return cgroup_add_files(cont, ss, files, ARRAY_SIZE(files));
+       return cgroup_add_files(cgrp, ss, files, ARRAY_SIZE(files));
 }
 
 /*
index ef358ba0768353cfd2e8bde743fa4901ab9141a7..f3f4af4b8b0fb8ffa4e24da75f5982358c44cc3e 100644 (file)
@@ -67,14 +67,24 @@ print_task(struct seq_file *m, struct rq *rq, struct task_struct *p)
                (long long)(p->nvcsw + p->nivcsw),
                p->prio);
 #ifdef CONFIG_SCHEDSTATS
-       SEQ_printf(m, "%9Ld.%06ld %9Ld.%06ld %9Ld.%06ld\n",
+       SEQ_printf(m, "%9Ld.%06ld %9Ld.%06ld %9Ld.%06ld",
                SPLIT_NS(p->se.vruntime),
                SPLIT_NS(p->se.sum_exec_runtime),
                SPLIT_NS(p->se.sum_sleep_runtime));
 #else
-       SEQ_printf(m, "%15Ld %15Ld %15Ld.%06ld %15Ld.%06ld %15Ld.%06ld\n",
+       SEQ_printf(m, "%15Ld %15Ld %15Ld.%06ld %15Ld.%06ld %15Ld.%06ld",
                0LL, 0LL, 0LL, 0L, 0LL, 0L, 0LL, 0L);
 #endif
+
+#ifdef CONFIG_CGROUP_SCHED
+       {
+               char path[64];
+
+               cgroup_path(task_group(p)->css.cgroup, path, sizeof(path));
+               SEQ_printf(m, " %s", path);
+       }
+#endif
+       SEQ_printf(m, "\n");
 }
 
 static void print_rq(struct seq_file *m, struct rq *rq, int rq_cpu)
@@ -109,7 +119,21 @@ void print_cfs_rq(struct seq_file *m, int cpu, struct cfs_rq *cfs_rq)
        struct sched_entity *last;
        unsigned long flags;
 
-       SEQ_printf(m, "\ncfs_rq\n");
+#if !defined(CONFIG_CGROUP_SCHED) || !defined(CONFIG_USER_SCHED)
+       SEQ_printf(m, "\ncfs_rq[%d]:\n", cpu);
+#else
+       char path[128] = "";
+       struct cgroup *cgroup = NULL;
+       struct task_group *tg = cfs_rq->tg;
+
+       if (tg)
+               cgroup = tg->css.cgroup;
+
+       if (cgroup)
+               cgroup_path(cgroup, path, sizeof(path));
+
+       SEQ_printf(m, "\ncfs_rq[%d]:%s\n", cpu, path);
+#endif
 
        SEQ_printf(m, "  .%-30s: %Ld.%06ld\n", "exec_clock",
                        SPLIT_NS(cfs_rq->exec_clock));
@@ -143,6 +167,11 @@ void print_cfs_rq(struct seq_file *m, int cpu, struct cfs_rq *cfs_rq)
 #endif
        SEQ_printf(m, "  .%-30s: %ld\n", "nr_spread_over",
                        cfs_rq->nr_spread_over);
+#ifdef CONFIG_FAIR_GROUP_SCHED
+#ifdef CONFIG_SMP
+       SEQ_printf(m, "  .%-30s: %lu\n", "shares", cfs_rq->shares);
+#endif
+#endif
 }
 
 static void print_cpu(struct seq_file *m, int cpu)
@@ -214,7 +243,6 @@ static int sched_debug_show(struct seq_file *m, void *v)
        PN(sysctl_sched_latency);
        PN(sysctl_sched_min_granularity);
        PN(sysctl_sched_wakeup_granularity);
-       PN(sysctl_sched_batch_wakeup_granularity);
        PN(sysctl_sched_child_runs_first);
        P(sysctl_sched_features);
 #undef PN
index 0080968d3e4a88e883a7905f409e22013abc8d55..89fa32b4edf27d500c3d6c644596ffc4afb881f5 100644 (file)
@@ -61,25 +61,15 @@ const_debug unsigned int sysctl_sched_child_runs_first = 1;
  */
 unsigned int __read_mostly sysctl_sched_compat_yield;
 
-/*
- * SCHED_BATCH wake-up granularity.
- * (default: 10 msec * (1 + ilog(ncpus)), units: nanoseconds)
- *
- * This option delays the preemption effects of decoupled workloads
- * and reduces their over-scheduling. Synchronous workloads will still
- * have immediate wakeup/sleep latencies.
- */
-unsigned int sysctl_sched_batch_wakeup_granularity = 10000000UL;
-
 /*
  * SCHED_OTHER wake-up granularity.
- * (default: 5 msec * (1 + ilog(ncpus)), units: nanoseconds)
+ * (default: 10 msec * (1 + ilog(ncpus)), units: nanoseconds)
  *
  * This option delays the preemption effects of decoupled workloads
  * and reduces their over-scheduling. Synchronous workloads will still
  * have immediate wakeup/sleep latencies.
  */
-unsigned int sysctl_sched_wakeup_granularity = 5000000UL;
+unsigned int sysctl_sched_wakeup_granularity = 10000000UL;
 
 const_debug unsigned int sysctl_sched_migration_cost = 500000UL;
 
@@ -87,6 +77,11 @@ const_debug unsigned int sysctl_sched_migration_cost = 500000UL;
  * CFS operations on generic schedulable entities:
  */
 
+static inline struct task_struct *task_of(struct sched_entity *se)
+{
+       return container_of(se, struct task_struct, se);
+}
+
 #ifdef CONFIG_FAIR_GROUP_SCHED
 
 /* cpu runqueue to which this cfs_rq is attached */
@@ -98,6 +93,54 @@ static inline struct rq *rq_of(struct cfs_rq *cfs_rq)
 /* An entity is a task if it doesn't "own" a runqueue */
 #define entity_is_task(se)     (!se->my_q)
 
+/* Walk up scheduling entities hierarchy */
+#define for_each_sched_entity(se) \
+               for (; se; se = se->parent)
+
+static inline struct cfs_rq *task_cfs_rq(struct task_struct *p)
+{
+       return p->se.cfs_rq;
+}
+
+/* runqueue on which this entity is (to be) queued */
+static inline struct cfs_rq *cfs_rq_of(struct sched_entity *se)
+{
+       return se->cfs_rq;
+}
+
+/* runqueue "owned" by this group */
+static inline struct cfs_rq *group_cfs_rq(struct sched_entity *grp)
+{
+       return grp->my_q;
+}
+
+/* Given a group's cfs_rq on one cpu, return its corresponding cfs_rq on
+ * another cpu ('this_cpu')
+ */
+static inline struct cfs_rq *cpu_cfs_rq(struct cfs_rq *cfs_rq, int this_cpu)
+{
+       return cfs_rq->tg->cfs_rq[this_cpu];
+}
+
+/* Iterate thr' all leaf cfs_rq's on a runqueue */
+#define for_each_leaf_cfs_rq(rq, cfs_rq) \
+       list_for_each_entry_rcu(cfs_rq, &rq->leaf_cfs_rq_list, leaf_cfs_rq_list)
+
+/* Do the two (enqueued) entities belong to the same group ? */
+static inline int
+is_same_group(struct sched_entity *se, struct sched_entity *pse)
+{
+       if (se->cfs_rq == pse->cfs_rq)
+               return 1;
+
+       return 0;
+}
+
+static inline struct sched_entity *parent_entity(struct sched_entity *se)
+{
+       return se->parent;
+}
+
 #else  /* CONFIG_FAIR_GROUP_SCHED */
 
 static inline struct rq *rq_of(struct cfs_rq *cfs_rq)
@@ -107,13 +150,49 @@ static inline struct rq *rq_of(struct cfs_rq *cfs_rq)
 
 #define entity_is_task(se)     1
 
-#endif /* CONFIG_FAIR_GROUP_SCHED */
+#define for_each_sched_entity(se) \
+               for (; se; se = NULL)
 
-static inline struct task_struct *task_of(struct sched_entity *se)
+static inline struct cfs_rq *task_cfs_rq(struct task_struct *p)
 {
-       return container_of(se, struct task_struct, se);
+       return &task_rq(p)->cfs;
+}
+
+static inline struct cfs_rq *cfs_rq_of(struct sched_entity *se)
+{
+       struct task_struct *p = task_of(se);
+       struct rq *rq = task_rq(p);
+
+       return &rq->cfs;
+}
+
+/* runqueue "owned" by this group */
+static inline struct cfs_rq *group_cfs_rq(struct sched_entity *grp)
+{
+       return NULL;
+}
+
+static inline struct cfs_rq *cpu_cfs_rq(struct cfs_rq *cfs_rq, int this_cpu)
+{
+       return &cpu_rq(this_cpu)->cfs;
+}
+
+#define for_each_leaf_cfs_rq(rq, cfs_rq) \
+               for (cfs_rq = &rq->cfs; cfs_rq; cfs_rq = NULL)
+
+static inline int
+is_same_group(struct sched_entity *se, struct sched_entity *pse)
+{
+       return 1;
+}
+
+static inline struct sched_entity *parent_entity(struct sched_entity *se)
+{
+       return NULL;
 }
 
+#endif /* CONFIG_FAIR_GROUP_SCHED */
+
 
 /**************************************************************
  * Scheduling class tree data structure manipulation methods:
@@ -254,6 +333,34 @@ int sched_nr_latency_handler(struct ctl_table *table, int write,
 }
 #endif
 
+/*
+ * delta *= w / rw
+ */
+static inline unsigned long
+calc_delta_weight(unsigned long delta, struct sched_entity *se)
+{
+       for_each_sched_entity(se) {
+               delta = calc_delta_mine(delta,
+                               se->load.weight, &cfs_rq_of(se)->load);
+       }
+
+       return delta;
+}
+
+/*
+ * delta *= rw / w
+ */
+static inline unsigned long
+calc_delta_fair(unsigned long delta, struct sched_entity *se)
+{
+       for_each_sched_entity(se) {
+               delta = calc_delta_mine(delta,
+                               cfs_rq_of(se)->load.weight, &se->load);
+       }
+
+       return delta;
+}
+
 /*
  * The idea is to set a period in which each task runs once.
  *
@@ -283,29 +390,54 @@ static u64 __sched_period(unsigned long nr_running)
  */
 static u64 sched_slice(struct cfs_rq *cfs_rq, struct sched_entity *se)
 {
-       return calc_delta_mine(__sched_period(cfs_rq->nr_running),
-                              se->load.weight, &cfs_rq->load);
+       return calc_delta_weight(__sched_period(cfs_rq->nr_running), se);
 }
 
 /*
- * We calculate the vruntime slice.
+ * We calculate the vruntime slice of a to be inserted task
  *
- * vs = s/w = p/rw
+ * vs = s*rw/w = p
  */
-static u64 __sched_vslice(unsigned long rq_weight, unsigned long nr_running)
+static u64 sched_vslice_add(struct cfs_rq *cfs_rq, struct sched_entity *se)
 {
-       u64 vslice = __sched_period(nr_running);
+       unsigned long nr_running = cfs_rq->nr_running;
 
-       vslice *= NICE_0_LOAD;
-       do_div(vslice, rq_weight);
+       if (!se->on_rq)
+               nr_running++;
 
-       return vslice;
+       return __sched_period(nr_running);
 }
 
-static u64 sched_vslice_add(struct cfs_rq *cfs_rq, struct sched_entity *se)
+/*
+ * The goal of calc_delta_asym() is to be asymmetrically around NICE_0_LOAD, in
+ * that it favours >=0 over <0.
+ *
+ *   -20         |
+ *               |
+ *     0 --------+-------
+ *             .'
+ *    19     .'
+ *
+ */
+static unsigned long
+calc_delta_asym(unsigned long delta, struct sched_entity *se)
 {
-       return __sched_vslice(cfs_rq->load.weight + se->load.weight,
-                       cfs_rq->nr_running + 1);
+       struct load_weight lw = {
+               .weight = NICE_0_LOAD,
+               .inv_weight = 1UL << (WMULT_SHIFT-NICE_0_SHIFT)
+       };
+
+       for_each_sched_entity(se) {
+               struct load_weight *se_lw = &se->load;
+
+               if (se->load.weight < NICE_0_LOAD)
+                       se_lw = &lw;
+
+               delta = calc_delta_mine(delta,
+                               cfs_rq_of(se)->load.weight, se_lw);
+       }
+
+       return delta;
 }
 
 /*
@@ -322,11 +454,7 @@ __update_curr(struct cfs_rq *cfs_rq, struct sched_entity *curr,
 
        curr->sum_exec_runtime += delta_exec;
        schedstat_add(cfs_rq, exec_clock, delta_exec);
-       delta_exec_weighted = delta_exec;
-       if (unlikely(curr->load.weight != NICE_0_LOAD)) {
-               delta_exec_weighted = calc_delta_fair(delta_exec_weighted,
-                                                       &curr->load);
-       }
+       delta_exec_weighted = calc_delta_fair(delta_exec, curr);
        curr->vruntime += delta_exec_weighted;
 }
 
@@ -413,20 +541,43 @@ update_stats_curr_start(struct cfs_rq *cfs_rq, struct sched_entity *se)
  * Scheduling class queueing methods:
  */
 
+#if defined CONFIG_SMP && defined CONFIG_FAIR_GROUP_SCHED
+static void
+add_cfs_task_weight(struct cfs_rq *cfs_rq, unsigned long weight)
+{
+       cfs_rq->task_weight += weight;
+}
+#else
+static inline void
+add_cfs_task_weight(struct cfs_rq *cfs_rq, unsigned long weight)
+{
+}
+#endif
+
 static void
 account_entity_enqueue(struct cfs_rq *cfs_rq, struct sched_entity *se)
 {
        update_load_add(&cfs_rq->load, se->load.weight);
+       if (!parent_entity(se))
+               inc_cpu_load(rq_of(cfs_rq), se->load.weight);
+       if (entity_is_task(se))
+               add_cfs_task_weight(cfs_rq, se->load.weight);
        cfs_rq->nr_running++;
        se->on_rq = 1;
+       list_add(&se->group_node, &cfs_rq->tasks);
 }
 
 static void
 account_entity_dequeue(struct cfs_rq *cfs_rq, struct sched_entity *se)
 {
        update_load_sub(&cfs_rq->load, se->load.weight);
+       if (!parent_entity(se))
+               dec_cpu_load(rq_of(cfs_rq), se->load.weight);
+       if (entity_is_task(se))
+               add_cfs_task_weight(cfs_rq, -se->load.weight);
        cfs_rq->nr_running--;
        se->on_rq = 0;
+       list_del_init(&se->group_node);
 }
 
 static void enqueue_sleeper(struct cfs_rq *cfs_rq, struct sched_entity *se)
@@ -510,8 +661,12 @@ place_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int initial)
 
        if (!initial) {
                /* sleeps upto a single latency don't count. */
-               if (sched_feat(NEW_FAIR_SLEEPERS))
-                       vruntime -= sysctl_sched_latency;
+               if (sched_feat(NEW_FAIR_SLEEPERS)) {
+                       if (sched_feat(NORMALIZED_SLEEPER))
+                               vruntime -= calc_delta_weight(sysctl_sched_latency, se);
+                       else
+                               vruntime -= sysctl_sched_latency;
+               }
 
                /* ensure we never gain time by being placed backwards. */
                vruntime = max_vruntime(se->vruntime, vruntime);
@@ -627,20 +782,16 @@ set_next_entity(struct cfs_rq *cfs_rq, struct sched_entity *se)
        se->prev_sum_exec_runtime = se->sum_exec_runtime;
 }
 
+static int
+wakeup_preempt_entity(struct sched_entity *curr, struct sched_entity *se);
+
 static struct sched_entity *
 pick_next(struct cfs_rq *cfs_rq, struct sched_entity *se)
 {
-       s64 diff, gran;
-
        if (!cfs_rq->next)
                return se;
 
-       diff = cfs_rq->next->vruntime - se->vruntime;
-       if (diff < 0)
-               return se;
-
-       gran = calc_delta_fair(sysctl_sched_wakeup_granularity, &cfs_rq->load);
-       if (diff > gran)
+       if (wakeup_preempt_entity(cfs_rq->next, se) != 0)
                return se;
 
        return cfs_rq->next;
@@ -708,101 +859,6 @@ entity_tick(struct cfs_rq *cfs_rq, struct sched_entity *curr, int queued)
  * CFS operations on tasks:
  */
 
-#ifdef CONFIG_FAIR_GROUP_SCHED
-
-/* Walk up scheduling entities hierarchy */
-#define for_each_sched_entity(se) \
-               for (; se; se = se->parent)
-
-static inline struct cfs_rq *task_cfs_rq(struct task_struct *p)
-{
-       return p->se.cfs_rq;
-}
-
-/* runqueue on which this entity is (to be) queued */
-static inline struct cfs_rq *cfs_rq_of(struct sched_entity *se)
-{
-       return se->cfs_rq;
-}
-
-/* runqueue "owned" by this group */
-static inline struct cfs_rq *group_cfs_rq(struct sched_entity *grp)
-{
-       return grp->my_q;
-}
-
-/* Given a group's cfs_rq on one cpu, return its corresponding cfs_rq on
- * another cpu ('this_cpu')
- */
-static inline struct cfs_rq *cpu_cfs_rq(struct cfs_rq *cfs_rq, int this_cpu)
-{
-       return cfs_rq->tg->cfs_rq[this_cpu];
-}
-
-/* Iterate thr' all leaf cfs_rq's on a runqueue */
-#define for_each_leaf_cfs_rq(rq, cfs_rq) \
-       list_for_each_entry_rcu(cfs_rq, &rq->leaf_cfs_rq_list, leaf_cfs_rq_list)
-
-/* Do the two (enqueued) entities belong to the same group ? */
-static inline int
-is_same_group(struct sched_entity *se, struct sched_entity *pse)
-{
-       if (se->cfs_rq == pse->cfs_rq)
-               return 1;
-
-       return 0;
-}
-
-static inline struct sched_entity *parent_entity(struct sched_entity *se)
-{
-       return se->parent;
-}
-
-#else  /* CONFIG_FAIR_GROUP_SCHED */
-
-#define for_each_sched_entity(se) \
-               for (; se; se = NULL)
-
-static inline struct cfs_rq *task_cfs_rq(struct task_struct *p)
-{
-       return &task_rq(p)->cfs;
-}
-
-static inline struct cfs_rq *cfs_rq_of(struct sched_entity *se)
-{
-       struct task_struct *p = task_of(se);
-       struct rq *rq = task_rq(p);
-
-       return &rq->cfs;
-}
-
-/* runqueue "owned" by this group */
-static inline struct cfs_rq *group_cfs_rq(struct sched_entity *grp)
-{
-       return NULL;
-}
-
-static inline struct cfs_rq *cpu_cfs_rq(struct cfs_rq *cfs_rq, int this_cpu)
-{
-       return &cpu_rq(this_cpu)->cfs;
-}
-
-#define for_each_leaf_cfs_rq(rq, cfs_rq) \
-               for (cfs_rq = &rq->cfs; cfs_rq; cfs_rq = NULL)
-
-static inline int
-is_same_group(struct sched_entity *se, struct sched_entity *pse)
-{
-       return 1;
-}
-
-static inline struct sched_entity *parent_entity(struct sched_entity *se)
-{
-       return NULL;
-}
-
-#endif /* CONFIG_FAIR_GROUP_SCHED */
-
 #ifdef CONFIG_SCHED_HRTICK
 static void hrtick_start_fair(struct rq *rq, struct task_struct *p)
 {
@@ -916,7 +972,7 @@ static void yield_task_fair(struct rq *rq)
        /*
         * Already in the rightmost position?
         */
-       if (unlikely(rightmost->vruntime < se->vruntime))
+       if (unlikely(!rightmost || rightmost->vruntime < se->vruntime))
                return;
 
        /*
@@ -955,7 +1011,9 @@ static int wake_idle(int cpu, struct task_struct *p)
                return cpu;
 
        for_each_domain(cpu, sd) {
-               if (sd->flags & SD_WAKE_IDLE) {
+               if ((sd->flags & SD_WAKE_IDLE)
+                   || ((sd->flags & SD_WAKE_IDLE_FAR)
+                       && !task_hot(p, task_rq(p)->clock, sd))) {
                        cpus_and(tmp, sd->span, p->cpus_allowed);
                        for_each_cpu_mask(i, tmp) {
                                if (idle_cpu(i)) {
@@ -1099,6 +1157,58 @@ out:
 }
 #endif /* CONFIG_SMP */
 
+static unsigned long wakeup_gran(struct sched_entity *se)
+{
+       unsigned long gran = sysctl_sched_wakeup_granularity;
+
+       /*
+        * More easily preempt - nice tasks, while not making it harder for
+        * + nice tasks.
+        */
+       gran = calc_delta_asym(sysctl_sched_wakeup_granularity, se);
+
+       return gran;
+}
+
+/*
+ * Should 'se' preempt 'curr'.
+ *
+ *             |s1
+ *        |s2
+ *   |s3
+ *         g
+ *      |<--->|c
+ *
+ *  w(c, s1) = -1
+ *  w(c, s2) =  0
+ *  w(c, s3) =  1
+ *
+ */
+static int
+wakeup_preempt_entity(struct sched_entity *curr, struct sched_entity *se)
+{
+       s64 gran, vdiff = curr->vruntime - se->vruntime;
+
+       if (vdiff < 0)
+               return -1;
+
+       gran = wakeup_gran(curr);
+       if (vdiff > gran)
+               return 1;
+
+       return 0;
+}
+
+/* return depth at which a sched entity is present in the hierarchy */
+static inline int depth_se(struct sched_entity *se)
+{
+       int depth = 0;
+
+       for_each_sched_entity(se)
+               depth++;
+
+       return depth;
+}
 
 /*
  * Preempt the current task with a newly woken task if needed:
@@ -1108,7 +1218,7 @@ static void check_preempt_wakeup(struct rq *rq, struct task_struct *p)
        struct task_struct *curr = rq->curr;
        struct cfs_rq *cfs_rq = task_cfs_rq(curr);
        struct sched_entity *se = &curr->se, *pse = &p->se;
-       unsigned long gran;
+       int se_depth, pse_depth;
 
        if (unlikely(rt_prio(p->prio))) {
                update_rq_clock(rq);
@@ -1133,20 +1243,33 @@ static void check_preempt_wakeup(struct rq *rq, struct task_struct *p)
        if (!sched_feat(WAKEUP_PREEMPT))
                return;
 
-       while (!is_same_group(se, pse)) {
+       /*
+        * preemption test can be made between sibling entities who are in the
+        * same cfs_rq i.e who have a common parent. Walk up the hierarchy of
+        * both tasks until we find their ancestors who are siblings of common
+        * parent.
+        */
+
+       /* First walk up until both entities are at same depth */
+       se_depth = depth_se(se);
+       pse_depth = depth_se(pse);
+
+       while (se_depth > pse_depth) {
+               se_depth--;
                se = parent_entity(se);
+       }
+
+       while (pse_depth > se_depth) {
+               pse_depth--;
                pse = parent_entity(pse);
        }
 
-       gran = sysctl_sched_wakeup_granularity;
-       /*
-        * More easily preempt - nice tasks, while not making
-        * it harder for + nice tasks.
-        */
-       if (unlikely(se->load.weight > NICE_0_LOAD))
-               gran = calc_delta_fair(gran, &se->load);
+       while (!is_same_group(se, pse)) {
+               se = parent_entity(se);
+               pse = parent_entity(pse);
+       }
 
-       if (pse->vruntime + gran < se->vruntime)
+       if (wakeup_preempt_entity(se, pse) == 1)
                resched_task(curr);
 }
 
@@ -1197,15 +1320,27 @@ static void put_prev_task_fair(struct rq *rq, struct task_struct *prev)
  * the current task:
  */
 static struct task_struct *
-__load_balance_iterator(struct cfs_rq *cfs_rq, struct rb_node *curr)
+__load_balance_iterator(struct cfs_rq *cfs_rq, struct list_head *next)
 {
-       struct task_struct *p;
+       struct task_struct *p = NULL;
+       struct sched_entity *se;
+
+       if (next == &cfs_rq->tasks)
+               return NULL;
+
+       /* Skip over entities that are not tasks */
+       do {
+               se = list_entry(next, struct sched_entity, group_node);
+               next = next->next;
+       } while (next != &cfs_rq->tasks && !entity_is_task(se));
 
-       if (!curr)
+       if (next == &cfs_rq->tasks)
                return NULL;
 
-       p = rb_entry(curr, struct task_struct, se.run_node);
-       cfs_rq->rb_load_balance_curr = rb_next(curr);
+       cfs_rq->balance_iterator = next;
+
+       if (entity_is_task(se))
+               p = task_of(se);
 
        return p;
 }
@@ -1214,85 +1349,100 @@ static struct task_struct *load_balance_start_fair(void *arg)
 {
        struct cfs_rq *cfs_rq = arg;
 
-       return __load_balance_iterator(cfs_rq, first_fair(cfs_rq));
+       return __load_balance_iterator(cfs_rq, cfs_rq->tasks.next);
 }
 
 static struct task_struct *load_balance_next_fair(void *arg)
 {
        struct cfs_rq *cfs_rq = arg;
 
-       return __load_balance_iterator(cfs_rq, cfs_rq->rb_load_balance_curr);
+       return __load_balance_iterator(cfs_rq, cfs_rq->balance_iterator);
 }
 
-#ifdef CONFIG_FAIR_GROUP_SCHED
-static int cfs_rq_best_prio(struct cfs_rq *cfs_rq)
+static unsigned long
+__load_balance_fair(struct rq *this_rq, int this_cpu, struct rq *busiest,
+               unsigned long max_load_move, struct sched_domain *sd,
+               enum cpu_idle_type idle, int *all_pinned, int *this_best_prio,
+               struct cfs_rq *cfs_rq)
 {
-       struct sched_entity *curr;
-       struct task_struct *p;
-
-       if (!cfs_rq->nr_running || !first_fair(cfs_rq))
-               return MAX_PRIO;
-
-       curr = cfs_rq->curr;
-       if (!curr)
-               curr = __pick_next_entity(cfs_rq);
+       struct rq_iterator cfs_rq_iterator;
 
-       p = task_of(curr);
+       cfs_rq_iterator.start = load_balance_start_fair;
+       cfs_rq_iterator.next = load_balance_next_fair;
+       cfs_rq_iterator.arg = cfs_rq;
 
-       return p->prio;
+       return balance_tasks(this_rq, this_cpu, busiest,
+                       max_load_move, sd, idle, all_pinned,
+                       this_best_prio, &cfs_rq_iterator);
 }
-#endif
 
+#ifdef CONFIG_FAIR_GROUP_SCHED
 static unsigned long
 load_balance_fair(struct rq *this_rq, int this_cpu, struct rq *busiest,
                  unsigned long max_load_move,
                  struct sched_domain *sd, enum cpu_idle_type idle,
                  int *all_pinned, int *this_best_prio)
 {
-       struct cfs_rq *busy_cfs_rq;
        long rem_load_move = max_load_move;
-       struct rq_iterator cfs_rq_iterator;
-
-       cfs_rq_iterator.start = load_balance_start_fair;
-       cfs_rq_iterator.next = load_balance_next_fair;
+       int busiest_cpu = cpu_of(busiest);
+       struct task_group *tg;
 
-       for_each_leaf_cfs_rq(busiest, busy_cfs_rq) {
-#ifdef CONFIG_FAIR_GROUP_SCHED
-               struct cfs_rq *this_cfs_rq;
+       rcu_read_lock();
+       list_for_each_entry(tg, &task_groups, list) {
                long imbalance;
-               unsigned long maxload;
+               unsigned long this_weight, busiest_weight;
+               long rem_load, max_load, moved_load;
+
+               /*
+                * empty group
+                */
+               if (!aggregate(tg, sd)->task_weight)
+                       continue;
+
+               rem_load = rem_load_move * aggregate(tg, sd)->rq_weight;
+               rem_load /= aggregate(tg, sd)->load + 1;
+
+               this_weight = tg->cfs_rq[this_cpu]->task_weight;
+               busiest_weight = tg->cfs_rq[busiest_cpu]->task_weight;
+
+               imbalance = (busiest_weight - this_weight) / 2;
 
-               this_cfs_rq = cpu_cfs_rq(busy_cfs_rq, this_cpu);
+               if (imbalance < 0)
+                       imbalance = busiest_weight;
 
-               imbalance = busy_cfs_rq->load.weight - this_cfs_rq->load.weight;
-               /* Don't pull if this_cfs_rq has more load than busy_cfs_rq */
-               if (imbalance <= 0)
+               max_load = max(rem_load, imbalance);
+               moved_load = __load_balance_fair(this_rq, this_cpu, busiest,
+                               max_load, sd, idle, all_pinned, this_best_prio,
+                               tg->cfs_rq[busiest_cpu]);
+
+               if (!moved_load)
                        continue;
 
-               /* Don't pull more than imbalance/2 */
-               imbalance /= 2;
-               maxload = min(rem_load_move, imbalance);
+               move_group_shares(tg, sd, busiest_cpu, this_cpu);
 
-               *this_best_prio = cfs_rq_best_prio(this_cfs_rq);
-#else
-# define maxload rem_load_move
-#endif
-               /*
-                * pass busy_cfs_rq argument into
-                * load_balance_[start|next]_fair iterators
-                */
-               cfs_rq_iterator.arg = busy_cfs_rq;
-               rem_load_move -= balance_tasks(this_rq, this_cpu, busiest,
-                                              maxload, sd, idle, all_pinned,
-                                              this_best_prio,
-                                              &cfs_rq_iterator);
+               moved_load *= aggregate(tg, sd)->load;
+               moved_load /= aggregate(tg, sd)->rq_weight + 1;
 
-               if (rem_load_move <= 0)
+               rem_load_move -= moved_load;
+               if (rem_load_move < 0)
                        break;
        }
+       rcu_read_unlock();
 
        return max_load_move - rem_load_move;
 }
+#else
+static unsigned long
+load_balance_fair(struct rq *this_rq, int this_cpu, struct rq *busiest,
+                 unsigned long max_load_move,
+                 struct sched_domain *sd, enum cpu_idle_type idle,
+                 int *all_pinned, int *this_best_prio)
+{
+       return __load_balance_fair(this_rq, this_cpu, busiest,
+                       max_load_move, sd, idle, all_pinned,
+                       this_best_prio, &busiest->cfs);
+}
+#endif
 
 static int
 move_one_task_fair(struct rq *this_rq, int this_cpu, struct rq *busiest,
@@ -1461,16 +1611,40 @@ static const struct sched_class fair_sched_class = {
 };
 
 #ifdef CONFIG_SCHED_DEBUG
+static void
+print_cfs_rq_tasks(struct seq_file *m, struct cfs_rq *cfs_rq, int depth)
+{
+       struct sched_entity *se;
+
+       if (!cfs_rq)
+               return;
+
+       list_for_each_entry_rcu(se, &cfs_rq->tasks, group_node) {
+               int i;
+
+               for (i = depth; i; i--)
+                       seq_puts(m, "  ");
+
+               seq_printf(m, "%lu %s %lu\n",
+                               se->load.weight,
+                               entity_is_task(se) ? "T" : "G",
+                               calc_delta_weight(SCHED_LOAD_SCALE, se)
+                               );
+               if (!entity_is_task(se))
+                       print_cfs_rq_tasks(m, group_cfs_rq(se), depth + 1);
+       }
+}
+
 static void print_cfs_stats(struct seq_file *m, int cpu)
 {
        struct cfs_rq *cfs_rq;
 
-#ifdef CONFIG_FAIR_GROUP_SCHED
-       print_cfs_rq(m, cpu, &cpu_rq(cpu)->cfs);
-#endif
        rcu_read_lock();
        for_each_leaf_cfs_rq(cpu_rq(cpu), cfs_rq)
                print_cfs_rq(m, cpu, cfs_rq);
+
+       seq_printf(m, "\nWeight tree:\n");
+       print_cfs_rq_tasks(m, &cpu_rq(cpu)->cfs, 1);
        rcu_read_unlock();
 }
 #endif
diff --git a/kernel/sched_features.h b/kernel/sched_features.h
new file mode 100644 (file)
index 0000000..1c7283c
--- /dev/null
@@ -0,0 +1,10 @@
+SCHED_FEAT(NEW_FAIR_SLEEPERS, 1)
+SCHED_FEAT(WAKEUP_PREEMPT, 1)
+SCHED_FEAT(START_DEBIT, 1)
+SCHED_FEAT(AFFINE_WAKEUPS, 1)
+SCHED_FEAT(CACHE_HOT_BUDDY, 1)
+SCHED_FEAT(SYNC_WAKEUPS, 1)
+SCHED_FEAT(HRTICK, 1)
+SCHED_FEAT(DOUBLE_TICK, 0)
+SCHED_FEAT(NORMALIZED_SLEEPER, 1)
+SCHED_FEAT(DEADLINE, 1)
index 0a6d2e516420516cb1d0c35a5345db1f356f71ab..c2730a5a4f056c04526cb56008b772fe26712072 100644 (file)
@@ -62,7 +62,12 @@ static inline u64 sched_rt_runtime(struct rt_rq *rt_rq)
        if (!rt_rq->tg)
                return RUNTIME_INF;
 
-       return rt_rq->tg->rt_runtime;
+       return rt_rq->rt_runtime;
+}
+
+static inline u64 sched_rt_period(struct rt_rq *rt_rq)
+{
+       return ktime_to_ns(rt_rq->tg->rt_bandwidth.rt_period);
 }
 
 #define for_each_leaf_rt_rq(rt_rq, rq) \
@@ -127,14 +132,39 @@ static int rt_se_boosted(struct sched_rt_entity *rt_se)
        return p->prio != p->normal_prio;
 }
 
+#ifdef CONFIG_SMP
+static inline cpumask_t sched_rt_period_mask(void)
+{
+       return cpu_rq(smp_processor_id())->rd->span;
+}
+#else
+static inline cpumask_t sched_rt_period_mask(void)
+{
+       return cpu_online_map;
+}
+#endif
+
+static inline
+struct rt_rq *sched_rt_period_rt_rq(struct rt_bandwidth *rt_b, int cpu)
+{
+       return container_of(rt_b, struct task_group, rt_bandwidth)->rt_rq[cpu];
+}
+
+static inline struct rt_bandwidth *sched_rt_bandwidth(struct rt_rq *rt_rq)
+{
+       return &rt_rq->tg->rt_bandwidth;
+}
+
 #else
 
 static inline u64 sched_rt_runtime(struct rt_rq *rt_rq)
 {
-       if (sysctl_sched_rt_runtime == -1)
-               return RUNTIME_INF;
+       return rt_rq->rt_runtime;
+}
 
-       return (u64)sysctl_sched_rt_runtime * NSEC_PER_USEC;
+static inline u64 sched_rt_period(struct rt_rq *rt_rq)
+{
+       return ktime_to_ns(def_rt_bandwidth.rt_period);
 }
 
 #define for_each_leaf_rt_rq(rt_rq, rq) \
@@ -173,6 +203,102 @@ static inline int rt_rq_throttled(struct rt_rq *rt_rq)
 {
        return rt_rq->rt_throttled;
 }
+
+static inline cpumask_t sched_rt_period_mask(void)
+{
+       return cpu_online_map;
+}
+
+static inline
+struct rt_rq *sched_rt_period_rt_rq(struct rt_bandwidth *rt_b, int cpu)
+{
+       return &cpu_rq(cpu)->rt;
+}
+
+static inline struct rt_bandwidth *sched_rt_bandwidth(struct rt_rq *rt_rq)
+{
+       return &def_rt_bandwidth;
+}
+
+#endif
+
+static int do_sched_rt_period_timer(struct rt_bandwidth *rt_b, int overrun)
+{
+       int i, idle = 1;
+       cpumask_t span;
+
+       if (rt_b->rt_runtime == RUNTIME_INF)
+               return 1;
+
+       span = sched_rt_period_mask();
+       for_each_cpu_mask(i, span) {
+               int enqueue = 0;
+               struct rt_rq *rt_rq = sched_rt_period_rt_rq(rt_b, i);
+               struct rq *rq = rq_of_rt_rq(rt_rq);
+
+               spin_lock(&rq->lock);
+               if (rt_rq->rt_time) {
+                       u64 runtime;
+
+                       spin_lock(&rt_rq->rt_runtime_lock);
+                       runtime = rt_rq->rt_runtime;
+                       rt_rq->rt_time -= min(rt_rq->rt_time, overrun*runtime);
+                       if (rt_rq->rt_throttled && rt_rq->rt_time < runtime) {
+                               rt_rq->rt_throttled = 0;
+                               enqueue = 1;
+                       }
+                       if (rt_rq->rt_time || rt_rq->rt_nr_running)
+                               idle = 0;
+                       spin_unlock(&rt_rq->rt_runtime_lock);
+               }
+
+               if (enqueue)
+                       sched_rt_rq_enqueue(rt_rq);
+               spin_unlock(&rq->lock);
+       }
+
+       return idle;
+}
+
+#ifdef CONFIG_SMP
+static int balance_runtime(struct rt_rq *rt_rq)
+{
+       struct rt_bandwidth *rt_b = sched_rt_bandwidth(rt_rq);
+       struct root_domain *rd = cpu_rq(smp_processor_id())->rd;
+       int i, weight, more = 0;
+       u64 rt_period;
+
+       weight = cpus_weight(rd->span);
+
+       spin_lock(&rt_b->rt_runtime_lock);
+       rt_period = ktime_to_ns(rt_b->rt_period);
+       for_each_cpu_mask(i, rd->span) {
+               struct rt_rq *iter = sched_rt_period_rt_rq(rt_b, i);
+               s64 diff;
+
+               if (iter == rt_rq)
+                       continue;
+
+               spin_lock(&iter->rt_runtime_lock);
+               diff = iter->rt_runtime - iter->rt_time;
+               if (diff > 0) {
+                       do_div(diff, weight);
+                       if (rt_rq->rt_runtime + diff > rt_period)
+                               diff = rt_period - rt_rq->rt_runtime;
+                       iter->rt_runtime -= diff;
+                       rt_rq->rt_runtime += diff;
+                       more = 1;
+                       if (rt_rq->rt_runtime == rt_period) {
+                               spin_unlock(&iter->rt_runtime_lock);
+                               break;
+                       }
+               }
+               spin_unlock(&iter->rt_runtime_lock);
+       }
+       spin_unlock(&rt_b->rt_runtime_lock);
+
+       return more;
+}
 #endif
 
 static inline int rt_se_prio(struct sched_rt_entity *rt_se)
@@ -197,12 +323,24 @@ static int sched_rt_runtime_exceeded(struct rt_rq *rt_rq)
        if (rt_rq->rt_throttled)
                return rt_rq_throttled(rt_rq);
 
+       if (sched_rt_runtime(rt_rq) >= sched_rt_period(rt_rq))
+               return 0;
+
+#ifdef CONFIG_SMP
        if (rt_rq->rt_time > runtime) {
-               struct rq *rq = rq_of_rt_rq(rt_rq);
+               int more;
 
-               rq->rt_throttled = 1;
-               rt_rq->rt_throttled = 1;
+               spin_unlock(&rt_rq->rt_runtime_lock);
+               more = balance_runtime(rt_rq);
+               spin_lock(&rt_rq->rt_runtime_lock);
 
+               if (more)
+                       runtime = sched_rt_runtime(rt_rq);
+       }
+#endif
+
+       if (rt_rq->rt_time > runtime) {
+               rt_rq->rt_throttled = 1;
                if (rt_rq_throttled(rt_rq)) {
                        sched_rt_rq_dequeue(rt_rq);
                        return 1;
@@ -212,29 +350,6 @@ static int sched_rt_runtime_exceeded(struct rt_rq *rt_rq)
        return 0;
 }
 
-static void update_sched_rt_period(struct rq *rq)
-{
-       struct rt_rq *rt_rq;
-       u64 period;
-
-       while (rq->clock > rq->rt_period_expire) {
-               period = (u64)sysctl_sched_rt_period * NSEC_PER_USEC;
-               rq->rt_period_expire += period;
-
-               for_each_leaf_rt_rq(rt_rq, rq) {
-                       u64 runtime = sched_rt_runtime(rt_rq);
-
-                       rt_rq->rt_time -= min(rt_rq->rt_time, runtime);
-                       if (rt_rq->rt_throttled && rt_rq->rt_time < runtime) {
-                               rt_rq->rt_throttled = 0;
-                               sched_rt_rq_enqueue(rt_rq);
-                       }
-               }
-
-               rq->rt_throttled = 0;
-       }
-}
-
 /*
  * Update the current task's runtime statistics. Skip current tasks that
  * are not in our scheduling class.
@@ -259,9 +374,15 @@ static void update_curr_rt(struct rq *rq)
        curr->se.exec_start = rq->clock;
        cpuacct_charge(curr, delta_exec);
 
-       rt_rq->rt_time += delta_exec;
-       if (sched_rt_runtime_exceeded(rt_rq))
-               resched_task(curr);
+       for_each_sched_rt_entity(rt_se) {
+               rt_rq = rt_rq_of_se(rt_se);
+
+               spin_lock(&rt_rq->rt_runtime_lock);
+               rt_rq->rt_time += delta_exec;
+               if (sched_rt_runtime_exceeded(rt_rq))
+                       resched_task(curr);
+               spin_unlock(&rt_rq->rt_runtime_lock);
+       }
 }
 
 static inline
@@ -284,6 +405,11 @@ void inc_rt_tasks(struct sched_rt_entity *rt_se, struct rt_rq *rt_rq)
 #ifdef CONFIG_RT_GROUP_SCHED
        if (rt_se_boosted(rt_se))
                rt_rq->rt_nr_boosted++;
+
+       if (rt_rq->tg)
+               start_rt_bandwidth(&rt_rq->tg->rt_bandwidth);
+#else
+       start_rt_bandwidth(&def_rt_bandwidth);
 #endif
 }
 
@@ -353,27 +479,21 @@ static void dequeue_rt_entity(struct sched_rt_entity *rt_se)
 /*
  * Because the prio of an upper entry depends on the lower
  * entries, we must remove entries top - down.
- *
- * XXX: O(1/2 h^2) because we can only walk up, not down the chain.
- *      doesn't matter much for now, as h=2 for GROUP_SCHED.
  */
 static void dequeue_rt_stack(struct task_struct *p)
 {
-       struct sched_rt_entity *rt_se, *top_se;
+       struct sched_rt_entity *rt_se, *back = NULL;
 
-       /*
-        * dequeue all, top - down.
-        */
-       do {
-               rt_se = &p->rt;
-               top_se = NULL;
-               for_each_sched_rt_entity(rt_se) {
-                       if (on_rt_rq(rt_se))
-                               top_se = rt_se;
-               }
-               if (top_se)
-                       dequeue_rt_entity(top_se);
-       } while (top_se);
+       rt_se = &p->rt;
+       for_each_sched_rt_entity(rt_se) {
+               rt_se->back = back;
+               back = rt_se;
+       }
+
+       for (rt_se = back; rt_se; rt_se = rt_se->back) {
+               if (on_rt_rq(rt_se))
+                       dequeue_rt_entity(rt_se);
+       }
 }
 
 /*
@@ -393,6 +513,8 @@ static void enqueue_task_rt(struct rq *rq, struct task_struct *p, int wakeup)
         */
        for_each_sched_rt_entity(rt_se)
                enqueue_rt_entity(rt_se);
+
+       inc_cpu_load(rq, p->se.load.weight);
 }
 
 static void dequeue_task_rt(struct rq *rq, struct task_struct *p, int sleep)
@@ -412,6 +534,8 @@ static void dequeue_task_rt(struct rq *rq, struct task_struct *p, int sleep)
                if (rt_rq && rt_rq->rt_nr_running)
                        enqueue_rt_entity(rt_se);
        }
+
+       dec_cpu_load(rq, p->se.load.weight);
 }
 
 /*
@@ -1001,7 +1125,8 @@ move_one_task_rt(struct rq *this_rq, int this_cpu, struct rq *busiest,
        return 0;
 }
 
-static void set_cpus_allowed_rt(struct task_struct *p, cpumask_t *new_mask)
+static void set_cpus_allowed_rt(struct task_struct *p,
+                               const cpumask_t *new_mask)
 {
        int weight = cpus_weight(*new_mask);
 
index 5b32433e7ee5719cb061956e53ec4ef2a242d903..5bae2e0c3ff293b665e0428ce2942c6e9ac1db0b 100644 (file)
@@ -9,6 +9,11 @@
 static int show_schedstat(struct seq_file *seq, void *v)
 {
        int cpu;
+       int mask_len = NR_CPUS/32 * 9;
+       char *mask_str = kmalloc(mask_len, GFP_KERNEL);
+
+       if (mask_str == NULL)
+               return -ENOMEM;
 
        seq_printf(seq, "version %d\n", SCHEDSTAT_VERSION);
        seq_printf(seq, "timestamp %lu\n", jiffies);
@@ -36,9 +41,8 @@ static int show_schedstat(struct seq_file *seq, void *v)
                preempt_disable();
                for_each_domain(cpu, sd) {
                        enum cpu_idle_type itype;
-                       char mask_str[NR_CPUS];
 
-                       cpumask_scnprintf(mask_str, NR_CPUS, sd->span);
+                       cpumask_scnprintf(mask_str, mask_len, sd->span);
                        seq_printf(seq, "domain%d %s", dcount++, mask_str);
                        for (itype = CPU_IDLE; itype < CPU_MAX_IDLE_TYPES;
                                        itype++) {
index 31e9f2a4792847388b524d313bc389bd8cd4cf20..3c44956ee7e2312d30f28bc68a5b9825a7da657a 100644 (file)
@@ -356,7 +356,8 @@ void open_softirq(int nr, void (*action)(struct softirq_action*), void *data)
 /* Tasklets */
 struct tasklet_head
 {
-       struct tasklet_struct *list;
+       struct tasklet_struct *head;
+       struct tasklet_struct **tail;
 };
 
 /* Some compilers disobey section attribute on statics when not
@@ -369,8 +370,9 @@ void __tasklet_schedule(struct tasklet_struct *t)
        unsigned long flags;
 
        local_irq_save(flags);
-       t->next = __get_cpu_var(tasklet_vec).list;
-       __get_cpu_var(tasklet_vec).list = t;
+       t->next = NULL;
+       *__get_cpu_var(tasklet_vec).tail = t;
+       __get_cpu_var(tasklet_vec).tail = &(t->next);
        raise_softirq_irqoff(TASKLET_SOFTIRQ);
        local_irq_restore(flags);
 }
@@ -382,8 +384,9 @@ void __tasklet_hi_schedule(struct tasklet_struct *t)
        unsigned long flags;
 
        local_irq_save(flags);
-       t->next = __get_cpu_var(tasklet_hi_vec).list;
-       __get_cpu_var(tasklet_hi_vec).list = t;
+       t->next = NULL;
+       *__get_cpu_var(tasklet_hi_vec).tail = t;
+       __get_cpu_var(tasklet_hi_vec).tail = &(t->next);
        raise_softirq_irqoff(HI_SOFTIRQ);
        local_irq_restore(flags);
 }
@@ -395,8 +398,9 @@ static void tasklet_action(struct softirq_action *a)
        struct tasklet_struct *list;
 
        local_irq_disable();
-       list = __get_cpu_var(tasklet_vec).list;
-       __get_cpu_var(tasklet_vec).list = NULL;
+       list = __get_cpu_var(tasklet_vec).head;
+       __get_cpu_var(tasklet_vec).head = NULL;
+       __get_cpu_var(tasklet_vec).tail = &__get_cpu_var(tasklet_vec).head;
        local_irq_enable();
 
        while (list) {
@@ -416,8 +420,9 @@ static void tasklet_action(struct softirq_action *a)
                }
 
                local_irq_disable();
-               t->next = __get_cpu_var(tasklet_vec).list;
-               __get_cpu_var(tasklet_vec).list = t;
+               t->next = NULL;
+               *__get_cpu_var(tasklet_vec).tail = t;
+               __get_cpu_var(tasklet_vec).tail = &(t->next);
                __raise_softirq_irqoff(TASKLET_SOFTIRQ);
                local_irq_enable();
        }
@@ -428,8 +433,9 @@ static void tasklet_hi_action(struct softirq_action *a)
        struct tasklet_struct *list;
 
        local_irq_disable();
-       list = __get_cpu_var(tasklet_hi_vec).list;
-       __get_cpu_var(tasklet_hi_vec).list = NULL;
+       list = __get_cpu_var(tasklet_hi_vec).head;
+       __get_cpu_var(tasklet_hi_vec).head = NULL;
+       __get_cpu_var(tasklet_hi_vec).tail = &__get_cpu_var(tasklet_hi_vec).head;
        local_irq_enable();
 
        while (list) {
@@ -449,8 +455,9 @@ static void tasklet_hi_action(struct softirq_action *a)
                }
 
                local_irq_disable();
-               t->next = __get_cpu_var(tasklet_hi_vec).list;
-               __get_cpu_var(tasklet_hi_vec).list = t;
+               t->next = NULL;
+               *__get_cpu_var(tasklet_hi_vec).tail = t;
+               __get_cpu_var(tasklet_hi_vec).tail = &(t->next);
                __raise_softirq_irqoff(HI_SOFTIRQ);
                local_irq_enable();
        }
@@ -487,6 +494,15 @@ EXPORT_SYMBOL(tasklet_kill);
 
 void __init softirq_init(void)
 {
+       int cpu;
+
+       for_each_possible_cpu(cpu) {
+               per_cpu(tasklet_vec, cpu).tail =
+                       &per_cpu(tasklet_vec, cpu).head;
+               per_cpu(tasklet_hi_vec, cpu).tail =
+                       &per_cpu(tasklet_hi_vec, cpu).head;
+       }
+
        open_softirq(TASKLET_SOFTIRQ, tasklet_action, NULL);
        open_softirq(HI_SOFTIRQ, tasklet_hi_action, NULL);
 }
@@ -555,9 +571,12 @@ void tasklet_kill_immediate(struct tasklet_struct *t, unsigned int cpu)
                return;
 
        /* CPU is dead, so no lock needed. */
-       for (i = &per_cpu(tasklet_vec, cpu).list; *i; i = &(*i)->next) {
+       for (i = &per_cpu(tasklet_vec, cpu).head; *i; i = &(*i)->next) {
                if (*i == t) {
                        *i = t->next;
+                       /* If this was the tail element, move the tail ptr */
+                       if (*i == NULL)
+                               per_cpu(tasklet_vec, cpu).tail = i;
                        return;
                }
        }
@@ -566,20 +585,20 @@ void tasklet_kill_immediate(struct tasklet_struct *t, unsigned int cpu)
 
 static void takeover_tasklets(unsigned int cpu)
 {
-       struct tasklet_struct **i;
-
        /* CPU is dead, so no lock needed. */
        local_irq_disable();
 
        /* Find end, append list for that CPU. */
-       for (i = &__get_cpu_var(tasklet_vec).list; *i; i = &(*i)->next);
-       *i = per_cpu(tasklet_vec, cpu).list;
-       per_cpu(tasklet_vec, cpu).list = NULL;
+       *__get_cpu_var(tasklet_vec).tail = per_cpu(tasklet_vec, cpu).head;
+       __get_cpu_var(tasklet_vec).tail = per_cpu(tasklet_vec, cpu).tail;
+       per_cpu(tasklet_vec, cpu).head = NULL;
+       per_cpu(tasklet_vec, cpu).tail = &per_cpu(tasklet_vec, cpu).head;
        raise_softirq_irqoff(TASKLET_SOFTIRQ);
 
-       for (i = &__get_cpu_var(tasklet_hi_vec).list; *i; i = &(*i)->next);
-       *i = per_cpu(tasklet_hi_vec, cpu).list;
-       per_cpu(tasklet_hi_vec, cpu).list = NULL;
+       *__get_cpu_var(tasklet_hi_vec).tail = per_cpu(tasklet_hi_vec, cpu).head;
+       __get_cpu_var(tasklet_hi_vec).tail = per_cpu(tasklet_hi_vec, cpu).tail;
+       per_cpu(tasklet_hi_vec, cpu).head = NULL;
+       per_cpu(tasklet_hi_vec, cpu).tail = &per_cpu(tasklet_hi_vec, cpu).head;
        raise_softirq_irqoff(HI_SOFTIRQ);
 
        local_irq_enable();
index 6f4e0e13f70c337c531be43b0d3cc5296c972c71..dc25b0baaa96944df5a61cc3cfef356f7f0c3bbd 100644 (file)
@@ -11,7 +11,6 @@
 #include <linux/interrupt.h>
 
 #include <asm/atomic.h>
-#include <asm/semaphore.h>
 #include <asm/uaccess.h>
 
 /* Since we effect priority and affinity (both of which are visible
@@ -35,7 +34,7 @@ static int stopmachine(void *cpu)
        int irqs_disabled = 0;
        int prepared = 0;
 
-       set_cpus_allowed(current, cpumask_of_cpu((int)(long)cpu));
+       set_cpus_allowed_ptr(current, &cpumask_of_cpu((int)(long)cpu));
 
        /* Ack: we are alive */
        smp_mb(); /* Theoretically the ack = 0 might not be on this CPU yet. */
index a626116af5db96b58f47434eb47c6af23da6535e..6a0cc71ee88d61e1afdd47e960a841515dad8a3c 100644 (file)
 #ifndef SET_ENDIAN
 # define SET_ENDIAN(a,b)       (-EINVAL)
 #endif
+#ifndef GET_TSC_CTL
+# define GET_TSC_CTL(a)                (-EINVAL)
+#endif
+#ifndef SET_TSC_CTL
+# define SET_TSC_CTL(a)                (-EINVAL)
+#endif
 
 /*
  * this is where the system-wide overflow UID and GID are defined, for
@@ -1737,7 +1743,12 @@ asmlinkage long sys_prctl(int option, unsigned long arg2, unsigned long arg3,
 #else
                        return -EINVAL;
 #endif
-
+               case PR_GET_TSC:
+                       error = GET_TSC_CTL(arg2);
+                       break;
+               case PR_SET_TSC:
+                       error = SET_TSC_CTL(arg2);
+                       break;
                default:
                        error = -EINVAL;
                        break;
index b2a2d6889babc898794e7c7fb7907ef59a3b487b..fd3364827ccf0a838c79fe240016c93cedd508e4 100644 (file)
@@ -268,17 +268,6 @@ static struct ctl_table kern_table[] = {
                .extra1         = &min_wakeup_granularity_ns,
                .extra2         = &max_wakeup_granularity_ns,
        },
-       {
-               .ctl_name       = CTL_UNNUMBERED,
-               .procname       = "sched_batch_wakeup_granularity_ns",
-               .data           = &sysctl_sched_batch_wakeup_granularity,
-               .maxlen         = sizeof(unsigned int),
-               .mode           = 0644,
-               .proc_handler   = &proc_dointvec_minmax,
-               .strategy       = &sysctl_intvec,
-               .extra1         = &min_wakeup_granularity_ns,
-               .extra2         = &max_wakeup_granularity_ns,
-       },
        {
                .ctl_name       = CTL_UNNUMBERED,
                .procname       = "sched_child_runs_first",
@@ -318,7 +307,7 @@ static struct ctl_table kern_table[] = {
                .data           = &sysctl_sched_rt_period,
                .maxlen         = sizeof(unsigned int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = &sched_rt_handler,
        },
        {
                .ctl_name       = CTL_UNNUMBERED,
@@ -326,7 +315,7 @@ static struct ctl_table kern_table[] = {
                .data           = &sysctl_sched_rt_runtime,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = &sched_rt_handler,
        },
        {
                .ctl_name       = CTL_UNNUMBERED,
index fdfa0c745bb612f45c2b639827c3533bb6c29120..57a1f02e5ec07fc20a6715d40d7fe41855449727 100644 (file)
@@ -262,7 +262,7 @@ out:
 void tick_broadcast_on_off(unsigned long reason, int *oncpu)
 {
        if (!cpu_isset(*oncpu, cpu_online_map))
-               printk(KERN_ERR "tick-braodcast: ignoring broadcast for "
+               printk(KERN_ERR "tick-broadcast: ignoring broadcast for "
                       "offline CPU #%d\n", *oncpu);
        else
                smp_call_function_single(*oncpu, tick_do_broadcast_on_off,
index 69dba0c71727b70828fbd9b3122392feba4c2f3c..d358d4e3a95806c2ff71544947dee234809fdb88 100644 (file)
@@ -191,7 +191,6 @@ u64 get_cpu_idle_time_us(int cpu, u64 *last_update_time)
 void tick_nohz_stop_sched_tick(void)
 {
        unsigned long seq, last_jiffies, next_jiffies, delta_jiffies, flags;
-       unsigned long rt_jiffies;
        struct tick_sched *ts;
        ktime_t last_update, expires, now;
        struct clock_event_device *dev = __get_cpu_var(tick_cpu_device).evtdev;
@@ -243,10 +242,6 @@ void tick_nohz_stop_sched_tick(void)
        next_jiffies = get_next_timer_interrupt(last_jiffies);
        delta_jiffies = next_jiffies - last_jiffies;
 
-       rt_jiffies = rt_needs_cpu(cpu);
-       if (rt_jiffies && rt_jiffies < delta_jiffies)
-               delta_jiffies = rt_jiffies;
-
        if (rcu_needs_cpu(cpu))
                delta_jiffies = 1;
        /*
index a3fa587c350c598063a17c903beeee99fe0f47e0..2d6087c7cf9820fb4a16c43fdd75ed9f33d16bca 100644 (file)
@@ -178,6 +178,7 @@ static void change_clocksource(void)
        if (clock == new)
                return;
 
+       new->cycle_last = 0;
        now = clocksource_read(new);
        nsec =  __get_nsec_offset();
        timespec_add_ns(&xtime, nsec);
@@ -295,6 +296,7 @@ static int timekeeping_resume(struct sys_device *dev)
        timespec_add_ns(&xtime, timekeeping_suspend_nsecs);
        update_xtime_cache(0);
        /* re-base the last cycle value */
+       clock->cycle_last = 0;
        clock->cycle_last = clocksource_read(clock);
        clock->error = 0;
        timekeeping_suspended = 0;
index 7132022a040cc764b1c8cdd53744e7398e05502d..debce602bfddd9f117ec5fb98ad0023176eb7f7b 100644 (file)
@@ -101,7 +101,7 @@ static int sched_create_user(struct user_struct *up)
 {
        int rc = 0;
 
-       up->tg = sched_create_group();
+       up->tg = sched_create_group(&root_task_group);
        if (IS_ERR(up->tg))
                rc = -ENOMEM;
 
@@ -193,6 +193,33 @@ static ssize_t cpu_rt_runtime_store(struct kobject *kobj,
 
 static struct kobj_attribute cpu_rt_runtime_attr =
        __ATTR(cpu_rt_runtime, 0644, cpu_rt_runtime_show, cpu_rt_runtime_store);
+
+static ssize_t cpu_rt_period_show(struct kobject *kobj,
+                                  struct kobj_attribute *attr,
+                                  char *buf)
+{
+       struct user_struct *up = container_of(kobj, struct user_struct, kobj);
+
+       return sprintf(buf, "%lu\n", sched_group_rt_period(up->tg));
+}
+
+static ssize_t cpu_rt_period_store(struct kobject *kobj,
+                                   struct kobj_attribute *attr,
+                                   const char *buf, size_t size)
+{
+       struct user_struct *up = container_of(kobj, struct user_struct, kobj);
+       unsigned long rt_period;
+       int rc;
+
+       sscanf(buf, "%lu", &rt_period);
+
+       rc = sched_group_set_rt_period(up->tg, rt_period);
+
+       return (rc ? rc : size);
+}
+
+static struct kobj_attribute cpu_rt_period_attr =
+       __ATTR(cpu_rt_period, 0644, cpu_rt_period_show, cpu_rt_period_store);
 #endif
 
 /* default attributes per uid directory */
@@ -202,6 +229,7 @@ static struct attribute *uids_attributes[] = {
 #endif
 #ifdef CONFIG_RT_GROUP_SCHED
        &cpu_rt_runtime_attr.attr,
+       &cpu_rt_period_attr.attr,
 #endif
        NULL
 };
index ba3d104994d914643e4c673b1058e0c4a57cd813..2d53dc092e8b1670bd26e6e3c6210f01caa54a29 100644 (file)
@@ -141,4 +141,7 @@ config HAS_DMA
 config CHECK_SIGNATURE
        bool
 
+config HAVE_LMB
+       boolean
+
 endmenu
index 95de3102bc87c61afe3289b117ffc16099a8df16..623ef24c23812894c1617f0db781fb3065d6bdf2 100644 (file)
@@ -427,6 +427,16 @@ config DEBUG_VM
 
          If unsure, say N.
 
+config DEBUG_WRITECOUNT
+       bool "Debug filesystem writers count"
+       depends on DEBUG_KERNEL
+       help
+         Enable this to catch wrong use of the writers count in struct
+         vfsmount.  This will increase the size of each file struct by
+         32 bits.
+
+         If unsure, say N.
+
 config DEBUG_LIST
        bool "Debug linked list manipulation"
        depends on DEBUG_KERNEL
index 4d7649c326f63d0ebab7932c15659ea899154036..bf8000fc7d48e771eb560f10fde894c64bffbb63 100644 (file)
@@ -68,6 +68,8 @@ obj-$(CONFIG_FAULT_INJECTION) += fault-inject.o
 
 lib-$(CONFIG_GENERIC_BUG) += bug.o
 
+obj-$(CONFIG_HAVE_LMB) += lmb.o
+
 hostprogs-y    := gen_crc32table
 clean-files    := crc32table.h
 
index 2c9242e3fed01ca348b4171db2c0d89333fa357e..a6939e18d7bb3bc4f8d0caba8004e6b075bd3983 100644 (file)
@@ -315,6 +315,22 @@ int bitmap_scnprintf(char *buf, unsigned int buflen,
 }
 EXPORT_SYMBOL(bitmap_scnprintf);
 
+/**
+ * bitmap_scnprintf_len - return buffer length needed to convert
+ * bitmap to an ASCII hex string.
+ * @len: number of bits to be converted
+ */
+int bitmap_scnprintf_len(unsigned int len)
+{
+       /* we need 9 chars per word for 32 bit words (8 hexdigits + sep/null) */
+       int bitslen = ALIGN(len, CHUNKSZ);
+       int wordlen = CHUNKSZ / 4;
+       int buflen = (bitslen / wordlen) * (wordlen + 1) * sizeof(char);
+
+       return buflen;
+}
+EXPORT_SYMBOL(bitmap_scnprintf_len);
+
 /**
  * __bitmap_parse - convert an ASCII hex string into a bitmap.
  * @buf: pointer to buffer containing string.
index fbc11a336bc57ba94e598c4edf83eccb4cc24017..cd3e82530b03b7099d9ee6f777623a0140a43a0c 100644 (file)
@@ -8,7 +8,7 @@
 #include <linux/smp_lock.h>
 #include <linux/module.h>
 #include <linux/kallsyms.h>
-#include <asm/semaphore.h>
+#include <linux/semaphore.h>
 
 /*
  * The 'big kernel semaphore'
index 0d03252f87a8535db2a9fe00632560c6fa337f24..2c6490370922ccddf939db20e6bf0b71fcbf9526 100644 (file)
@@ -58,11 +58,6 @@ static int create_dir(struct kobject *kobj)
        return error;
 }
 
-static inline struct kobject *to_kobj(struct list_head *entry)
-{
-       return container_of(entry, struct kobject, entry);
-}
-
 static int get_kobj_path_length(struct kobject *kobj)
 {
        int length = 1;
@@ -592,8 +587,15 @@ static void kobject_release(struct kref *kref)
  */
 void kobject_put(struct kobject *kobj)
 {
-       if (kobj)
+       if (kobj) {
+               if (!kobj->state_initialized) {
+                       printk(KERN_WARNING "kobject: '%s' (%p): is not "
+                              "initialized, yet kobject_put() is being "
+                              "called.\n", kobject_name(kobj), kobj);
+                       WARN_ON(1);
+               }
                kref_put(&kobj->kref, kobject_release);
+       }
 }
 
 static void dynamic_kobj_release(struct kobject *kobj)
@@ -745,12 +747,11 @@ void kset_unregister(struct kset *k)
  */
 struct kobject *kset_find_obj(struct kset *kset, const char *name)
 {
-       struct list_head *entry;
+       struct kobject *k;
        struct kobject *ret = NULL;
 
        spin_lock(&kset->list_lock);
-       list_for_each(entry, &kset->list) {
-               struct kobject *k = to_kobj(entry);
+       list_for_each_entry(k, &kset->list, entry) {
                if (kobject_name(k) && !strcmp(kobject_name(k), name)) {
                        ret = kobject_get(k);
                        break;
diff --git a/lib/lmb.c b/lib/lmb.c
new file mode 100644 (file)
index 0000000..896e283
--- /dev/null
+++ b/lib/lmb.c
@@ -0,0 +1,428 @@
+/*
+ * Procedures for maintaining information about logical memory blocks.
+ *
+ * Peter Bergner, IBM Corp.    June 2001.
+ * Copyright (C) 2001 Peter Bergner.
+ *
+ *      This program is free software; you can redistribute it and/or
+ *      modify it under the terms of the GNU General Public License
+ *      as published by the Free Software Foundation; either version
+ *      2 of the License, or (at your option) any later version.
+ */
+
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/bitops.h>
+#include <linux/lmb.h>
+
+#define LMB_ALLOC_ANYWHERE     0
+
+struct lmb lmb;
+
+void lmb_dump_all(void)
+{
+#ifdef DEBUG
+       unsigned long i;
+
+       pr_debug("lmb_dump_all:\n");
+       pr_debug("    memory.cnt                  = 0x%lx\n", lmb.memory.cnt);
+       pr_debug("    memory.size                 = 0x%llx\n",
+           (unsigned long long)lmb.memory.size);
+       for (i=0; i < lmb.memory.cnt ;i++) {
+               pr_debug("    memory.region[0x%x].base       = 0x%llx\n",
+                   i, (unsigned long long)lmb.memory.region[i].base);
+               pr_debug("                    .size     = 0x%llx\n",
+                   (unsigned long long)lmb.memory.region[i].size);
+       }
+
+       pr_debug("    reserved.cnt        = 0x%lx\n", lmb.reserved.cnt);
+       pr_debug("    reserved.size       = 0x%lx\n", lmb.reserved.size);
+       for (i=0; i < lmb.reserved.cnt ;i++) {
+               pr_debug("    reserved.region[0x%x].base       = 0x%llx\n",
+                   i, (unsigned long long)lmb.reserved.region[i].base);
+               pr_debug("                    .size     = 0x%llx\n",
+                   (unsigned long long)lmb.reserved.region[i].size);
+       }
+#endif /* DEBUG */
+}
+
+static unsigned long __init lmb_addrs_overlap(u64 base1, u64 size1,
+               u64 base2, u64 size2)
+{
+       return ((base1 < (base2 + size2)) && (base2 < (base1 + size1)));
+}
+
+static long __init lmb_addrs_adjacent(u64 base1, u64 size1,
+               u64 base2, u64 size2)
+{
+       if (base2 == base1 + size1)
+               return 1;
+       else if (base1 == base2 + size2)
+               return -1;
+
+       return 0;
+}
+
+static long __init lmb_regions_adjacent(struct lmb_region *rgn,
+               unsigned long r1, unsigned long r2)
+{
+       u64 base1 = rgn->region[r1].base;
+       u64 size1 = rgn->region[r1].size;
+       u64 base2 = rgn->region[r2].base;
+       u64 size2 = rgn->region[r2].size;
+
+       return lmb_addrs_adjacent(base1, size1, base2, size2);
+}
+
+static void __init lmb_remove_region(struct lmb_region *rgn, unsigned long r)
+{
+       unsigned long i;
+
+       for (i = r; i < rgn->cnt - 1; i++) {
+               rgn->region[i].base = rgn->region[i + 1].base;
+               rgn->region[i].size = rgn->region[i + 1].size;
+       }
+       rgn->cnt--;
+}
+
+/* Assumption: base addr of region 1 < base addr of region 2 */
+static void __init lmb_coalesce_regions(struct lmb_region *rgn,
+               unsigned long r1, unsigned long r2)
+{
+       rgn->region[r1].size += rgn->region[r2].size;
+       lmb_remove_region(rgn, r2);
+}
+
+void __init lmb_init(void)
+{
+       /* Create a dummy zero size LMB which will get coalesced away later.
+        * This simplifies the lmb_add() code below...
+        */
+       lmb.memory.region[0].base = 0;
+       lmb.memory.region[0].size = 0;
+       lmb.memory.cnt = 1;
+
+       /* Ditto. */
+       lmb.reserved.region[0].base = 0;
+       lmb.reserved.region[0].size = 0;
+       lmb.reserved.cnt = 1;
+}
+
+void __init lmb_analyze(void)
+{
+       int i;
+
+       lmb.memory.size = 0;
+
+       for (i = 0; i < lmb.memory.cnt; i++)
+               lmb.memory.size += lmb.memory.region[i].size;
+}
+
+static long __init lmb_add_region(struct lmb_region *rgn, u64 base, u64 size)
+{
+       unsigned long coalesced = 0;
+       long adjacent, i;
+
+       if ((rgn->cnt == 1) && (rgn->region[0].size == 0)) {
+               rgn->region[0].base = base;
+               rgn->region[0].size = size;
+               return 0;
+       }
+
+       /* First try and coalesce this LMB with another. */
+       for (i = 0; i < rgn->cnt; i++) {
+               u64 rgnbase = rgn->region[i].base;
+               u64 rgnsize = rgn->region[i].size;
+
+               if ((rgnbase == base) && (rgnsize == size))
+                       /* Already have this region, so we're done */
+                       return 0;
+
+               adjacent = lmb_addrs_adjacent(base, size, rgnbase, rgnsize);
+               if (adjacent > 0) {
+                       rgn->region[i].base -= size;
+                       rgn->region[i].size += size;
+                       coalesced++;
+                       break;
+               } else if (adjacent < 0) {
+                       rgn->region[i].size += size;
+                       coalesced++;
+                       break;
+               }
+       }
+
+       if ((i < rgn->cnt - 1) && lmb_regions_adjacent(rgn, i, i+1)) {
+               lmb_coalesce_regions(rgn, i, i+1);
+               coalesced++;
+       }
+
+       if (coalesced)
+               return coalesced;
+       if (rgn->cnt >= MAX_LMB_REGIONS)
+               return -1;
+
+       /* Couldn't coalesce the LMB, so add it to the sorted table. */
+       for (i = rgn->cnt - 1; i >= 0; i--) {
+               if (base < rgn->region[i].base) {
+                       rgn->region[i+1].base = rgn->region[i].base;
+                       rgn->region[i+1].size = rgn->region[i].size;
+               } else {
+                       rgn->region[i+1].base = base;
+                       rgn->region[i+1].size = size;
+                       break;
+               }
+       }
+
+       if (base < rgn->region[0].base) {
+               rgn->region[0].base = base;
+               rgn->region[0].size = size;
+       }
+       rgn->cnt++;
+
+       return 0;
+}
+
+long __init lmb_add(u64 base, u64 size)
+{
+       struct lmb_region *_rgn = &lmb.memory;
+
+       /* On pSeries LPAR systems, the first LMB is our RMO region. */
+       if (base == 0)
+               lmb.rmo_size = size;
+
+       return lmb_add_region(_rgn, base, size);
+
+}
+
+long __init lmb_reserve(u64 base, u64 size)
+{
+       struct lmb_region *_rgn = &lmb.reserved;
+
+       BUG_ON(0 == size);
+
+       return lmb_add_region(_rgn, base, size);
+}
+
+long __init lmb_overlaps_region(struct lmb_region *rgn, u64 base, u64 size)
+{
+       unsigned long i;
+
+       for (i = 0; i < rgn->cnt; i++) {
+               u64 rgnbase = rgn->region[i].base;
+               u64 rgnsize = rgn->region[i].size;
+               if (lmb_addrs_overlap(base, size, rgnbase, rgnsize))
+                       break;
+       }
+
+       return (i < rgn->cnt) ? i : -1;
+}
+
+static u64 lmb_align_down(u64 addr, u64 size)
+{
+       return addr & ~(size - 1);
+}
+
+static u64 lmb_align_up(u64 addr, u64 size)
+{
+       return (addr + (size - 1)) & ~(size - 1);
+}
+
+static u64 __init lmb_alloc_nid_unreserved(u64 start, u64 end,
+                                          u64 size, u64 align)
+{
+       u64 base, res_base;
+       long j;
+
+       base = lmb_align_down((end - size), align);
+       while (start <= base) {
+               j = lmb_overlaps_region(&lmb.reserved, base, size);
+               if (j < 0) {
+                       /* this area isn't reserved, take it */
+                       if (lmb_add_region(&lmb.reserved, base,
+                                          lmb_align_up(size, align)) < 0)
+                               base = ~(u64)0;
+                       return base;
+               }
+               res_base = lmb.reserved.region[j].base;
+               if (res_base < size)
+                       break;
+               base = lmb_align_down(res_base - size, align);
+       }
+
+       return ~(u64)0;
+}
+
+static u64 __init lmb_alloc_nid_region(struct lmb_property *mp,
+                                      u64 (*nid_range)(u64, u64, int *),
+                                      u64 size, u64 align, int nid)
+{
+       u64 start, end;
+
+       start = mp->base;
+       end = start + mp->size;
+
+       start = lmb_align_up(start, align);
+       while (start < end) {
+               u64 this_end;
+               int this_nid;
+
+               this_end = nid_range(start, end, &this_nid);
+               if (this_nid == nid) {
+                       u64 ret = lmb_alloc_nid_unreserved(start, this_end,
+                                                          size, align);
+                       if (ret != ~(u64)0)
+                               return ret;
+               }
+               start = this_end;
+       }
+
+       return ~(u64)0;
+}
+
+u64 __init lmb_alloc_nid(u64 size, u64 align, int nid,
+                        u64 (*nid_range)(u64 start, u64 end, int *nid))
+{
+       struct lmb_region *mem = &lmb.memory;
+       int i;
+
+       for (i = 0; i < mem->cnt; i++) {
+               u64 ret = lmb_alloc_nid_region(&mem->region[i],
+                                              nid_range,
+                                              size, align, nid);
+               if (ret != ~(u64)0)
+                       return ret;
+       }
+
+       return lmb_alloc(size, align);
+}
+
+u64 __init lmb_alloc(u64 size, u64 align)
+{
+       return lmb_alloc_base(size, align, LMB_ALLOC_ANYWHERE);
+}
+
+u64 __init lmb_alloc_base(u64 size, u64 align, u64 max_addr)
+{
+       u64 alloc;
+
+       alloc = __lmb_alloc_base(size, align, max_addr);
+
+       if (alloc == 0)
+               panic("ERROR: Failed to allocate 0x%llx bytes below 0x%llx.\n",
+                     (unsigned long long) size, (unsigned long long) max_addr);
+
+       return alloc;
+}
+
+u64 __init __lmb_alloc_base(u64 size, u64 align, u64 max_addr)
+{
+       long i, j;
+       u64 base = 0;
+       u64 res_base;
+
+       BUG_ON(0 == size);
+
+       /* On some platforms, make sure we allocate lowmem */
+       /* Note that LMB_REAL_LIMIT may be LMB_ALLOC_ANYWHERE */
+       if (max_addr == LMB_ALLOC_ANYWHERE)
+               max_addr = LMB_REAL_LIMIT;
+
+       for (i = lmb.memory.cnt - 1; i >= 0; i--) {
+               u64 lmbbase = lmb.memory.region[i].base;
+               u64 lmbsize = lmb.memory.region[i].size;
+
+               if (lmbsize < size)
+                       continue;
+               if (max_addr == LMB_ALLOC_ANYWHERE)
+                       base = lmb_align_down(lmbbase + lmbsize - size, align);
+               else if (lmbbase < max_addr) {
+                       base = min(lmbbase + lmbsize, max_addr);
+                       base = lmb_align_down(base - size, align);
+               } else
+                       continue;
+
+               while (base && lmbbase <= base) {
+                       j = lmb_overlaps_region(&lmb.reserved, base, size);
+                       if (j < 0) {
+                               /* this area isn't reserved, take it */
+                               if (lmb_add_region(&lmb.reserved, base,
+                                                  size) < 0)
+                                       return 0;
+                               return base;
+                       }
+                       res_base = lmb.reserved.region[j].base;
+                       if (res_base < size)
+                               break;
+                       base = lmb_align_down(res_base - size, align);
+               }
+       }
+       return 0;
+}
+
+/* You must call lmb_analyze() before this. */
+u64 __init lmb_phys_mem_size(void)
+{
+       return lmb.memory.size;
+}
+
+u64 __init lmb_end_of_DRAM(void)
+{
+       int idx = lmb.memory.cnt - 1;
+
+       return (lmb.memory.region[idx].base + lmb.memory.region[idx].size);
+}
+
+/* You must call lmb_analyze() after this. */
+void __init lmb_enforce_memory_limit(u64 memory_limit)
+{
+       unsigned long i;
+       u64 limit;
+       struct lmb_property *p;
+
+       if (!memory_limit)
+               return;
+
+       /* Truncate the lmb regions to satisfy the memory limit. */
+       limit = memory_limit;
+       for (i = 0; i < lmb.memory.cnt; i++) {
+               if (limit > lmb.memory.region[i].size) {
+                       limit -= lmb.memory.region[i].size;
+                       continue;
+               }
+
+               lmb.memory.region[i].size = limit;
+               lmb.memory.cnt = i + 1;
+               break;
+       }
+
+       if (lmb.memory.region[0].size < lmb.rmo_size)
+               lmb.rmo_size = lmb.memory.region[0].size;
+
+       /* And truncate any reserves above the limit also. */
+       for (i = 0; i < lmb.reserved.cnt; i++) {
+               p = &lmb.reserved.region[i];
+
+               if (p->base > memory_limit)
+                       p->size = 0;
+               else if ((p->base + p->size) > memory_limit)
+                       p->size = memory_limit - p->base;
+
+               if (p->size == 0) {
+                       lmb_remove_region(&lmb.reserved, i);
+                       i--;
+               }
+       }
+}
+
+int __init lmb_is_reserved(u64 addr)
+{
+       int i;
+
+       for (i = 0; i < lmb.reserved.cnt; i++) {
+               u64 upper = lmb.reserved.region[i].base +
+                       lmb.reserved.region[i].size - 1;
+               if ((addr >= lmb.reserved.region[i].base) && (addr <= upper))
+                       return 1;
+       }
+       return 0;
+}
index 3ea2db94d5b01bbe64501b2ac1bea68ec99ccf84..06d04cfa93390e1ac13d0348876ba3045ebf594a 100644 (file)
@@ -45,7 +45,6 @@
 #include <linux/rslib.h>
 #include <linux/slab.h>
 #include <linux/mutex.h>
-#include <asm/semaphore.h>
 
 /* This list holds all currently allocated rs control structures */
 static LIST_HEAD (rslist);
index b0012e27fea8796da01cfb2172d1d5930c60d22f..f4026bae6eedadb9e077e3500480fc47feb25624 100644 (file)
@@ -82,9 +82,10 @@ EXPORT_SYMBOL_GPL(percpu_populate);
 int __percpu_populate_mask(void *__pdata, size_t size, gfp_t gfp,
                           cpumask_t *mask)
 {
-       cpumask_t populated = CPU_MASK_NONE;
+       cpumask_t populated;
        int cpu;
 
+       cpus_clear(populated);
        for_each_cpu_mask(cpu, *mask)
                if (unlikely(!percpu_populate(__pdata, size, gfp, cpu))) {
                        __percpu_depopulate_mask(__pdata, &populated);
index 7469c503580dcf6402000cc339359175a9b417fc..0fb33027127120460a05ddc2bb827d7b26d31aaa 100644 (file)
@@ -208,7 +208,7 @@ int online_pages(unsigned long pfn, unsigned long nr_pages)
        /*
         * This doesn't need a lock to do pfn_to_page().
         * The section can't be removed here because of the
-        * memory_block->state_sem.
+        * memory_block->state_mutex.
         */
        zone = page_zone(pfn_to_page(pfn));
        pgdat_resize_lock(zone->zone_pgdat, &flags);
index 402a504f12283f23cb510ec9ebfce4d0d52eea29..32e796af12a16c756b70051426195e8983227cdc 100644 (file)
@@ -2029,6 +2029,7 @@ static int find_next_best_node(int node, nodemask_t *used_node_mask)
        int n, val;
        int min_val = INT_MAX;
        int best_node = -1;
+       node_to_cpumask_ptr(tmp, 0);
 
        /* Use the local node if we haven't already */
        if (!node_isset(node, *used_node_mask)) {
@@ -2037,7 +2038,6 @@ static int find_next_best_node(int node, nodemask_t *used_node_mask)
        }
 
        for_each_node_state(n, N_HIGH_MEMORY) {
-               cpumask_t tmp;
 
                /* Don't want a node to appear more than once */
                if (node_isset(n, *used_node_mask))
@@ -2050,8 +2050,8 @@ static int find_next_best_node(int node, nodemask_t *used_node_mask)
                val += (n < node);
 
                /* Give preference to headless and unused nodes */
-               tmp = node_to_cpumask(n);
-               if (!cpus_empty(tmp))
+               node_to_cpumask_ptr_next(tmp, n);
+               if (!cpus_empty(*tmp))
                        val += PENALTY_FOR_NODE_WITH_CPUS;
 
                /* Slight preference for less loaded node */
index 8f6ee073c0e3f44a14a40fe1351006b1246e4523..0ceacff56457d10c607a36a51da040af806465d4 100644 (file)
@@ -187,8 +187,8 @@ static int pdflush(void *dummy)
         * This is needed as pdflush's are dynamically created and destroyed.
         * The boottime pdflush's are easily placed w/o these 2 lines.
         */
-       cpus_allowed = cpuset_cpus_allowed(current);
-       set_cpus_allowed(current, cpus_allowed);
+       cpuset_cpus_allowed(current, &cpus_allowed);
+       set_cpus_allowed_ptr(current, &cpus_allowed);
 
        return __pdflush(&my_work);
 }
index 04b308c3bc547f72762521fa5a45170713546e41..03927cb5ec9e119ca06cf337d69de017303d82ba 100644 (file)
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -1160,14 +1160,13 @@ static void __cpuinit cpuup_canceled(long cpu)
        struct kmem_cache *cachep;
        struct kmem_list3 *l3 = NULL;
        int node = cpu_to_node(cpu);
+       node_to_cpumask_ptr(mask, node);
 
        list_for_each_entry(cachep, &cache_chain, next) {
                struct array_cache *nc;
                struct array_cache *shared;
                struct array_cache **alien;
-               cpumask_t mask;
 
-               mask = node_to_cpumask(node);
                /* cpu is dead; no one can alloc from it. */
                nc = cachep->array[cpu];
                cachep->array[cpu] = NULL;
@@ -1183,7 +1182,7 @@ static void __cpuinit cpuup_canceled(long cpu)
                if (nc)
                        free_block(cachep, nc->entry, nc->avail, node);
 
-               if (!cpus_empty(mask)) {
+               if (!cpus_empty(*mask)) {
                        spin_unlock_irq(&l3->list_lock);
                        goto free_array_cache;
                }
index 4046434046e68b0a45864c019a095fab088420ee..f80a5b7c057ffc387ba87e50b038f8e3756e1084 100644 (file)
@@ -1647,11 +1647,10 @@ static int kswapd(void *p)
        struct reclaim_state reclaim_state = {
                .reclaimed_slab = 0,
        };
-       cpumask_t cpumask;
+       node_to_cpumask_ptr(cpumask, pgdat->node_id);
 
-       cpumask = node_to_cpumask(pgdat->node_id);
-       if (!cpus_empty(cpumask))
-               set_cpus_allowed(tsk, cpumask);
+       if (!cpus_empty(*cpumask))
+               set_cpus_allowed_ptr(tsk, cpumask);
        current->reclaim_state = &reclaim_state;
 
        /*
@@ -1880,17 +1879,16 @@ out:
 static int __devinit cpu_callback(struct notifier_block *nfb,
                                  unsigned long action, void *hcpu)
 {
-       pg_data_t *pgdat;
-       cpumask_t mask;
        int nid;
 
        if (action == CPU_ONLINE || action == CPU_ONLINE_FROZEN) {
                for_each_node_state(nid, N_HIGH_MEMORY) {
-                       pgdat = NODE_DATA(nid);
-                       mask = node_to_cpumask(pgdat->node_id);
-                       if (any_online_cpu(mask) != NR_CPUS)
+                       pg_data_t *pgdat = NODE_DATA(nid);
+                       node_to_cpumask_ptr(mask, pgdat->node_id);
+
+                       if (any_online_cpu(*mask) < nr_cpu_ids)
                                /* One of our CPUs online: restore mask */
-                               set_cpus_allowed(pgdat->kswapd, mask);
+                               set_cpus_allowed_ptr(pgdat->kswapd, mask);
                }
        }
        return NOTIFY_OK;
index a77531c139b7d85dbb6f11297d7cea363acd7074..19991175fdeb4bca0f2e357ae7dfa5545dc72371 100644 (file)
@@ -23,7 +23,6 @@
 #include <linux/mutex.h>
 #include <net/flow.h>
 #include <asm/atomic.h>
-#include <asm/semaphore.h>
 #include <linux/security.h>
 
 struct flow_cache_entry {
index a4c1b36f4bc7293c6260583362f43338c132dd5b..9dfe2470962c7dd966f93243cdefb29b377f914e 100644 (file)
@@ -27,7 +27,6 @@
 #include <net/xfrm.h>
 
 #include <asm/ioctls.h>
-#include <asm/semaphore.h>
 #include <linux/spinlock.h>
 #include <linux/timer.h>
 #include <linux/delay.h>
index fb53ddfea5b5b77e09a1a6372ed93aee6fc87209..a75807b971b3e1b452d6b272ab3b8077afebd4d1 100644 (file)
@@ -14,7 +14,6 @@
  *   - Adaptive compression.
  */
 #include <linux/module.h>
-#include <asm/semaphore.h>
 #include <linux/crypto.h>
 #include <linux/err.h>
 #include <linux/pfkeyv2.h>
index 0c95cd5872f333e6a99ef691f00f0692e9db39a7..2767841a8cefc19377a96506e2f2c4e1c2db7586 100644 (file)
@@ -259,6 +259,7 @@ config NF_NAT_PROTO_SCTP
        tristate
        default NF_NAT && NF_CT_PROTO_SCTP
        depends on NF_NAT && NF_CT_PROTO_SCTP
+       select LIBCRC32C
 
 config NF_NAT_FTP
        tristate
index e3dcfa2f436bade207d6b03711868cd30f5531bf..ee6de425ce6b8c28873c8fdd0148b19c584f6d7f 100644 (file)
@@ -34,7 +34,6 @@
 #include <net/ip.h>
 #include <net/xfrm.h>
 #include <net/ipcomp.h>
-#include <asm/semaphore.h>
 #include <linux/crypto.h>
 #include <linux/err.h>
 #include <linux/pfkeyv2.h>
index 65b3ba57a3b7b639fef7c9850afe236bd4a0af53..9f4900069561547772d04ca232f36f720605fcee 100644 (file)
@@ -781,7 +781,7 @@ static int set_expected_rtp_rtcp(struct sk_buff *skb,
                    nfct_help(exp->master)->helper != nfct_help(ct)->helper ||
                    exp->class != class)
                        break;
-
+#ifdef CONFIG_NF_NAT_NEEDED
                if (exp->tuple.src.l3num == AF_INET && !direct_rtp &&
                    (exp->saved_ip != exp->tuple.dst.u3.ip ||
                     exp->saved_proto.udp.port != exp->tuple.dst.u.udp.port) &&
@@ -791,6 +791,7 @@ static int set_expected_rtp_rtcp(struct sk_buff *skb,
                        tuple.dst.u.udp.port    = exp->saved_proto.udp.port;
                        direct_rtp = 1;
                } else
+#endif
                        skip_expect = 1;
        } while (!skip_expect);
        rcu_read_unlock();
index d1ff3f885c5de5017d1b2fe21a0233eba88d7ea4..1ebf65294405976788168815b8420df757f4a7aa 100644 (file)
@@ -760,8 +760,10 @@ static int rose_connect(struct socket *sock, struct sockaddr *uaddr, int addr_le
 
        rose->neighbour = rose_get_neigh(&addr->srose_addr, &cause,
                                         &diagnostic);
-       if (!rose->neighbour)
-               return -ENETUNREACH;
+       if (!rose->neighbour) {
+               err = -ENETUNREACH;
+               goto out_release;
+       }
 
        rose->lci = rose_new_lci(rose->neighbour);
        if (!rose->lci) {
index a290e1523297783da4e491ad547e17cdeb5da675..090af78d68b5a4d010757b7d725721a1db3141fc 100644 (file)
@@ -301,7 +301,6 @@ static inline int
 svc_pool_map_set_cpumask(unsigned int pidx, cpumask_t *oldmask)
 {
        struct svc_pool_map *m = &svc_pool_map;
-       unsigned int node; /* or cpu */
 
        /*
         * The caller checks for sv_nrpools > 1, which
@@ -314,16 +313,23 @@ svc_pool_map_set_cpumask(unsigned int pidx, cpumask_t *oldmask)
        default:
                return 0;
        case SVC_POOL_PERCPU:
-               node = m->pool_to[pidx];
+       {
+               unsigned int cpu = m->pool_to[pidx];
+
                *oldmask = current->cpus_allowed;
-               set_cpus_allowed(current, cpumask_of_cpu(node));
+               set_cpus_allowed_ptr(current, &cpumask_of_cpu(cpu));
                return 1;
+       }
        case SVC_POOL_PERNODE:
-               node = m->pool_to[pidx];
+       {
+               unsigned int node = m->pool_to[pidx];
+               node_to_cpumask_ptr(nodecpumask, node);
+
                *oldmask = current->cpus_allowed;
-               set_cpus_allowed(current, node_to_cpumask(node));
+               set_cpus_allowed_ptr(current, nodecpumask);
                return 1;
        }
+       }
 }
 
 /*
index 2851d0d15048e8d958668f2eaa9129220f274010..1454afcc06c48e962298ac9934b3dfbe35965dcc 100644 (file)
@@ -819,7 +819,11 @@ static int unix_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
                 */
                mode = S_IFSOCK |
                       (SOCK_INODE(sock)->i_mode & ~current->fs->umask);
+               err = mnt_want_write(nd.path.mnt);
+               if (err)
+                       goto out_mknod_dput;
                err = vfs_mknod(nd.path.dentry->d_inode, dentry, mode, 0);
+               mnt_drop_write(nd.path.mnt);
                if (err)
                        goto out_mknod_dput;
                mutex_unlock(&nd.path.dentry->d_inode->i_mutex);
similarity index 74%
rename from Documentation/firmware_class/firmware_sample_driver.c
rename to samples/firmware_class/firmware_sample_driver.c
index 6865cbe075ec3549cf033fa3c11c07bb0ee4eef6..165cff98032e70810ff866afcd51f324cda1efa9 100644 (file)
@@ -12,8 +12,7 @@
 #include <linux/init.h>
 #include <linux/device.h>
 #include <linux/string.h>
-
-#include "linux/firmware.h"
+#include <linux/firmware.h>
 
 static struct device ghost_device = {
        .bus_id    = "ghost0",
@@ -31,38 +30,44 @@ static void sample_firmware_load(char *firmware, int size)
 static void sample_probe_default(void)
 {
        /* uses the default method to get the firmware */
-        const struct firmware *fw_entry;
-       printk(KERN_INFO "firmware_sample_driver: a ghost device got inserted :)\n");
+       const struct firmware *fw_entry;
+       int retval;
+
+       printk(KERN_INFO "firmware_sample_driver: "
+               "a ghost device got inserted :)\n");
 
-        if(request_firmware(&fw_entry, "sample_driver_fw", &ghost_device)!=0)
-       {
+       retval = request_firmware(&fw_entry, "sample_driver_fw", &ghost_device);
+       if (retval) {
                printk(KERN_ERR
                       "firmware_sample_driver: Firmware not available\n");
                return;
        }
-       
+
        sample_firmware_load(fw_entry->data, fw_entry->size);
 
        release_firmware(fw_entry);
 
        /* finish setting up the device */
 }
+
 static void sample_probe_specific(void)
 {
+       int retval;
        /* Uses some specific hotplug support to get the firmware from
         * userspace  directly into the hardware, or via some sysfs file */
 
        /* NOTE: This currently doesn't work */
 
-       printk(KERN_INFO "firmware_sample_driver: a ghost device got inserted :)\n");
+       printk(KERN_INFO "firmware_sample_driver: "
+               "a ghost device got inserted :)\n");
 
-        if(request_firmware(NULL, "sample_driver_fw", &ghost_device)!=0)
-       {
+       retval = request_firmware(NULL, "sample_driver_fw", &ghost_device);
+       if (retval) {
                printk(KERN_ERR
                       "firmware_sample_driver: Firmware load failed\n");
                return;
        }
-       
+
        /* request_firmware blocks until userspace finished, so at
         * this point the firmware should be already in the device */
 
@@ -70,7 +75,7 @@ static void sample_probe_specific(void)
 }
 static void sample_probe_async_cont(const struct firmware *fw, void *context)
 {
-       if(!fw){
+       if (!fw) {
                printk(KERN_ERR
                       "firmware_sample_driver: firmware load failed\n");
                return;
@@ -80,19 +85,18 @@ static void sample_probe_async_cont(const struct firmware *fw, void *context)
               (char *)context);
        sample_firmware_load(fw->data, fw->size);
 }
+
 static void sample_probe_async(void)
 {
        /* Let's say that I can't sleep */
        int error;
-       error = request_firmware_nowait (THIS_MODULE, FW_ACTION_NOHOTPLUG,
-                                        "sample_driver_fw", &ghost_device,
-                                        "my device pointer",
-                                        sample_probe_async_cont);
-       if(error){
-               printk(KERN_ERR 
-                      "firmware_sample_driver:"
+       error = request_firmware_nowait(THIS_MODULE, FW_ACTION_NOHOTPLUG,
+                                       "sample_driver_fw", &ghost_device,
+                                       "my device pointer",
+                                       sample_probe_async_cont);
+       if (error)
+               printk(KERN_ERR "firmware_sample_driver:"
                       " request_firmware_nowait failed\n");
-       }
 }
 
 static int sample_init(void)
@@ -105,11 +109,12 @@ static int sample_init(void)
        sample_probe_async();
        return 0;
 }
+
 static void __exit sample_exit(void)
 {
 }
 
-module_init (sample_init);
-module_exit (sample_exit);
+module_init(sample_init);
+module_exit(sample_exit);
 
 MODULE_LICENSE("GPL");
similarity index 90%
rename from Documentation/firmware_class/firmware_sample_firmware_class.c
rename to samples/firmware_class/firmware_sample_firmware_class.c
index 2de62854f0e5c90aa6643b0b72d59cc8e96758f7..9392116e47b009e1ef02f69f85ecff247f5b78b8 100644 (file)
@@ -25,30 +25,27 @@ MODULE_LICENSE("GPL");
 
 static inline struct class_device *to_class_dev(struct kobject *obj)
 {
-       return container_of(obj,struct class_device,kobj);
+       return container_of(obj, struct class_device, kobj);
 }
+
 static inline
 struct class_device_attribute *to_class_dev_attr(struct attribute *_attr)
 {
-       return container_of(_attr,struct class_device_attribute,attr);
+       return container_of(_attr, struct class_device_attribute, attr);
 }
 
-int sysfs_create_bin_file(struct kobject * kobj, struct bin_attribute * attr);
-int sysfs_remove_bin_file(struct kobject * kobj, struct bin_attribute * attr);
-
 struct firmware_priv {
        char fw_id[FIRMWARE_NAME_MAX];
        s32 loading:2;
        u32 abort:1;
 };
 
-extern struct class firmware_class;
-
 static ssize_t firmware_loading_show(struct class_device *class_dev, char *buf)
 {
        struct firmware_priv *fw_priv = class_get_devdata(class_dev);
        return sprintf(buf, "%d\n", fw_priv->loading);
 }
+
 static ssize_t firmware_loading_store(struct class_device *class_dev,
                                      const char *buf, size_t count)
 {
@@ -56,8 +53,8 @@ static ssize_t firmware_loading_store(struct class_device *class_dev,
        int prev_loading = fw_priv->loading;
 
        fw_priv->loading = simple_strtol(buf, NULL, 10);
-       
-       switch(fw_priv->loading){
+
+       switch (fw_priv->loading) {
        case -1:
                /* abort load an panic */
                break;
@@ -65,7 +62,7 @@ static ssize_t firmware_loading_store(struct class_device *class_dev,
                /* setup load */
                break;
        case 0:
-               if(prev_loading==1){
+               if (prev_loading == 1) {
                        /* finish load and get the device back to working
                         * state */
                }
@@ -130,29 +127,29 @@ static int fw_setup_class_device(struct class_device *class_dev,
        class_dev->class = &firmware_class,
        class_set_devdata(class_dev, fw_priv);
        retval = class_device_register(class_dev);
-       if (retval){
+       if (retval) {
                printk(KERN_ERR "%s: class_device_register failed\n",
-                      __FUNCTION__);
+                      __func__);
                goto error_free_fw_priv;
        }
 
        retval = sysfs_create_bin_file(&class_dev->kobj, &firmware_attr_data);
-       if (retval){
+       if (retval) {
                printk(KERN_ERR "%s: sysfs_create_bin_file failed\n",
-                      __FUNCTION__);
+                      __func__);
                goto error_unreg_class_dev;
        }
 
        retval = class_device_create_file(class_dev,
                                          &class_device_attr_loading);
-       if (retval){
+       if (retval) {
                printk(KERN_ERR "%s: class_device_create_file failed\n",
-                      __FUNCTION__);
+                      __func__);
                goto error_remove_data;
        }
 
        goto out;
-       
+
 error_remove_data:
        sysfs_remove_bin_file(&class_dev->kobj, &firmware_attr_data);
 error_unreg_class_dev:
@@ -183,16 +180,16 @@ static int __init firmware_sample_init(void)
 
        device_initialize(&my_device);
        class_dev = kmalloc(sizeof(struct class_device), GFP_KERNEL);
-       if(!class_dev)
+       if (!class_dev)
                return -ENOMEM;
 
        error = fw_setup_class_device(class_dev, "my_firmware_image",
                                      &my_device);
-       if(error){
+       if (error) {
                kfree(class_dev);
                return error;
        }
-        return 0;
+       return 0;
 
 }
 static void __exit firmware_sample_exit(void)
@@ -202,6 +199,6 @@ static void __exit firmware_sample_exit(void)
        kfree(fw_priv);
        kfree(class_dev);
 }
+
 module_init(firmware_sample_init);
 module_exit(firmware_sample_exit);
-
index 348d8687b7c9cad167c6d631ce9e5f1c2038bdf0..769b69db89c13b6f6af68abbfe3167929d81d5e8 100644 (file)
@@ -328,19 +328,52 @@ static int do_pnp_entry(const char *filename,
        return 1;
 }
 
-/* looks like: "pnp:cCdD..." */
-static int do_pnp_card_entry(const char *filename,
-                       struct pnp_card_device_id *id, char *alias)
+/* looks like: "pnp:dD" for every device of the card */
+static void do_pnp_card_entries(void *symval, unsigned long size,
+                               struct module *mod)
 {
-       int i;
+       const unsigned long id_size = sizeof(struct pnp_card_device_id);
+       const unsigned int count = (size / id_size)-1;
+       const struct pnp_card_device_id *cards = symval;
+       unsigned int i;
 
-       sprintf(alias, "pnp:c%s", id->id);
-       for (i = 0; i < PNP_MAX_DEVICES; i++) {
-               if (! *id->devs[i].id)
-                       break;
-               sprintf(alias + strlen(alias), "d%s", id->devs[i].id);
+       device_id_check(mod->name, "pnp", size, id_size, symval);
+
+       for (i = 0; i < count; i++) {
+               unsigned int j;
+               const struct pnp_card_device_id *card = &cards[i];
+
+               for (j = 0; j < PNP_MAX_DEVICES; j++) {
+                       const char *id = (char *)card->devs[j].id;
+                       int i2, j2;
+                       int dup = 0;
+
+                       if (!id[0])
+                               break;
+
+                       /* find duplicate, already added value */
+                       for (i2 = 0; i2 < i && !dup; i2++) {
+                               const struct pnp_card_device_id *card2 = &cards[i2];
+
+                               for (j2 = 0; j2 < PNP_MAX_DEVICES; j2++) {
+                                       const char *id2 = (char *)card2->devs[j2].id;
+
+                                       if (!id2[0])
+                                               break;
+
+                                       if (!strcmp(id, id2)) {
+                                               dup = 1;
+                                               break;
+                                       }
+                               }
+                       }
+
+                       /* add an individual alias for every device entry */
+                       if (!dup)
+                               buf_printf(&mod->dev_table_buf,
+                                          "MODULE_ALIAS(\"pnp:d%s*\");\n", id);
+               }
        }
-       return 1;
 }
 
 /* Looks like: pcmcia:mNcNfNfnNpfnNvaNvbNvcNvdN. */
@@ -634,9 +667,7 @@ void handle_moddevtable(struct module *mod, struct elf_info *info,
                         sizeof(struct pnp_device_id), "pnp",
                         do_pnp_entry, mod);
        else if (sym_is(symname, "__mod_pnp_card_device_table"))
-               do_table(symval, sym->st_size,
-                        sizeof(struct pnp_card_device_id), "pnp_card",
-                        do_pnp_card_entry, mod);
+               do_pnp_card_entries(symval, sym->st_size, mod);
        else if (sym_is(symname, "__mod_pcmcia_device_table"))
                do_table(symval, sym->st_size,
                         sizeof(struct pcmcia_device_id), "pcmcia",
index 26fabad097693ce5ea6e7ab8351e19840ad675bf..7b681692be4793db8723a34b8474cde78156d7c7 100644 (file)
@@ -28,7 +28,6 @@
 #include <linux/percpu.h>
 #include <linux/audit.h>
 #include <asm/uaccess.h>
-#include <asm/semaphore.h>
 
 /* selinuxfs pseudo filesystem for exporting the security policy API.
    Based on the proc code and the fs/nfsd/nfsctl.c code. */
index a996cf1d378ac2323921c04bdc7613150527389f..da0566c4f329ad8d8b61cf9f7e62a612cccbe18b 100644 (file)
@@ -11,7 +11,6 @@
 #include <linux/errno.h>
 #include <linux/string.h>
 #include <linux/spinlock.h>
-#include <asm/semaphore.h>
 #include <linux/slab.h>
 
 #include "security.h"
index 874d17c83c610482df080d8bc597f0e7e6eacf56..3b8b994faad48a87fe0b3c5ef739ac2a63dcac2e 100644 (file)
@@ -45,7 +45,6 @@
 #include <net/xfrm.h>
 #include <net/checksum.h>
 #include <net/udp.h>
-#include <asm/semaphore.h>
 #include <asm/atomic.h>
 
 #include "avc.h"
index 5d86e6809752e701218531deb29088f2f5517855..8704e2825b109f392c27d42ce532ab9cae5d6e82 100644 (file)
@@ -16,6 +16,7 @@
 #include <linux/platform_device.h>
 #include <linux/interrupt.h>
 #include <linux/wait.h>
+#include <linux/clk.h>
 #include <linux/delay.h>
 
 #include <sound/core.h>
@@ -27,6 +28,7 @@
 #include <linux/mutex.h>
 #include <asm/hardware.h>
 #include <asm/arch/pxa-regs.h>
+#include <asm/arch/pxa2xx-gpio.h>
 #include <asm/arch/audio.h>
 
 #include "pxa2xx-pcm.h"
 static DEFINE_MUTEX(car_mutex);
 static DECLARE_WAIT_QUEUE_HEAD(gsr_wq);
 static volatile long gsr_bits;
+static struct clk *ac97_clk;
+#ifdef CONFIG_PXA27x
+static struct clk *ac97conf_clk;
+#endif
 
 /*
  * Beware PXA27x bugs:
@@ -112,9 +118,9 @@ static void pxa2xx_ac97_reset(struct snd_ac97 *ac97)
        gsr_bits = 0;
 #ifdef CONFIG_PXA27x
        /* PXA27x Developers Manual section 13.5.2.2.1 */
-       pxa_set_cken(CKEN_AC97CONF, 1);
+       clk_enable(ac97conf_clk);
        udelay(5);
-       pxa_set_cken(CKEN_AC97CONF, 0);
+       clk_disable(ac97conf_clk);
        GCR = GCR_COLD_RST;
        udelay(50);
 #else
@@ -259,7 +265,7 @@ static int pxa2xx_ac97_do_suspend(struct snd_card *card, pm_message_t state)
        if (platform_ops && platform_ops->suspend)
                platform_ops->suspend(platform_ops->priv);
        GCR |= GCR_ACLINK_OFF;
-       pxa_set_cken(CKEN_AC97, 0);
+       clk_disable(ac97_clk);
 
        return 0;
 }
@@ -268,7 +274,7 @@ static int pxa2xx_ac97_do_resume(struct snd_card *card)
 {
        pxa2xx_audio_ops_t *platform_ops = card->dev->platform_data;
 
-       pxa_set_cken(CKEN_AC97, 1);
+       clk_enable(ac97_clk);
        if (platform_ops && platform_ops->resume)
                platform_ops->resume(platform_ops->priv);
        snd_ac97_resume(pxa2xx_ac97_ac97);
@@ -335,8 +341,21 @@ static int __devinit pxa2xx_ac97_probe(struct platform_device *dev)
 #ifdef CONFIG_PXA27x
        /* Use GPIO 113 as AC97 Reset on Bulverde */
        pxa_gpio_mode(113 | GPIO_ALT_FN_2_OUT);
+       ac97conf_clk = clk_get(&dev->dev, "AC97CONFCLK");
+       if (IS_ERR(ac97conf_clk)) {
+               ret = PTR_ERR(ac97conf_clk);
+               ac97conf_clk = NULL;
+               goto err;
+       }
 #endif
-       pxa_set_cken(CKEN_AC97, 1);
+
+       ac97_clk = clk_get(&dev->dev, "AC97CLK");
+       if (IS_ERR(ac97_clk)) {
+               ret = PTR_ERR(ac97_clk);
+               ac97_clk = NULL;
+               goto err;
+       }
+       clk_enable(ac97_clk);
 
        ret = snd_ac97_bus(card, 0, &pxa2xx_ac97_ops, NULL, &ac97_bus);
        if (ret)
@@ -361,11 +380,19 @@ static int __devinit pxa2xx_ac97_probe(struct platform_device *dev)
  err:
        if (card)
                snd_card_free(card);
-       if (CKEN & (1 << CKEN_AC97)) {
+       if (ac97_clk) {
                GCR |= GCR_ACLINK_OFF;
                free_irq(IRQ_AC97, NULL);
-               pxa_set_cken(CKEN_AC97, 0);
+               clk_disable(ac97_clk);
+               clk_put(ac97_clk);
+               ac97_clk = NULL;
+       }
+#ifdef CONFIG_PXA27x
+       if (ac97conf_clk) {
+               clk_put(ac97conf_clk);
+               ac97conf_clk = NULL;
        }
+#endif
        return ret;
 }
 
@@ -378,7 +405,13 @@ static int __devexit pxa2xx_ac97_remove(struct platform_device *dev)
                platform_set_drvdata(dev, NULL);
                GCR |= GCR_ACLINK_OFF;
                free_irq(IRQ_AC97, NULL);
-               pxa_set_cken(CKEN_AC97, 0);
+               clk_disable(ac97_clk);
+               clk_put(ac97_clk);
+               ac97_clk = NULL;
+#ifdef CONFIG_PXA27x
+               clk_put(ac97conf_clk);
+               ac97conf_clk = NULL;
+#endif
        }
 
        return 0;
index ad3ad9d662f879fea1932c45f16786b6f4e0f685..1347dcf3f80b822a300e522d93abbdd2e6ea3202 100644 (file)
@@ -33,8 +33,7 @@
 #include <sound/soc.h>
 #include <sound/soc-dapm.h>
 
-#include <asm/arch/hardware.h>
-#include <asm/arch/at91_pio.h>
+#include <asm/hardware.h>
 #include <asm/arch/gpio.h>
 
 #include "../codecs/wm8731.h"
 #define        DBG(x...)
 #endif
 
-#define AT91_PIO_TF1   (1 << (AT91_PIN_PB6 - PIN_BASE) % 32)
-#define AT91_PIO_TK1   (1 << (AT91_PIN_PB7 - PIN_BASE) % 32)
-#define AT91_PIO_TD1   (1 << (AT91_PIN_PB8 - PIN_BASE) % 32)
-#define AT91_PIO_RD1   (1 << (AT91_PIN_PB9 - PIN_BASE) % 32)
-#define AT91_PIO_RK1   (1 << (AT91_PIN_PB10 - PIN_BASE) % 32)
-#define AT91_PIO_RF1   (1 << (AT91_PIN_PB11 - PIN_BASE) % 32)
-
 static struct clk *pck1_clk;
 static struct clk *pllb_clk;
 
@@ -276,7 +268,6 @@ static struct platform_device *eti_b1_snd_device;
 static int __init eti_b1_init(void)
 {
        int ret;
-       u32 ssc_pio_lines;
        struct at91_ssc_periph *ssc = eti_b1_dai.cpu_dai->private_data;
 
        if (!request_mem_region(AT91RM9200_BASE_SSC1, SZ_16K, "soc-audio")) {
@@ -310,19 +301,12 @@ static int __init eti_b1_init(void)
                goto fail_io_unmap;
        }
 
-       ssc_pio_lines = AT91_PIO_TF1 | AT91_PIO_TK1 | AT91_PIO_TD1
-                       | AT91_PIO_RD1 /* | AT91_PIO_RK1 */ | AT91_PIO_RF1;
-
-       /* Reset all PIO registers and assign lines to peripheral A */
-       at91_sys_write(AT91_PIOB + PIO_PDR,  ssc_pio_lines);
-       at91_sys_write(AT91_PIOB + PIO_ODR,  ssc_pio_lines);
-       at91_sys_write(AT91_PIOB + PIO_IFDR, ssc_pio_lines);
-       at91_sys_write(AT91_PIOB + PIO_CODR, ssc_pio_lines);
-       at91_sys_write(AT91_PIOB + PIO_IDR,  ssc_pio_lines);
-       at91_sys_write(AT91_PIOB + PIO_MDDR, ssc_pio_lines);
-       at91_sys_write(AT91_PIOB + PIO_PUDR, ssc_pio_lines);
-       at91_sys_write(AT91_PIOB + PIO_ASR,  ssc_pio_lines);
-       at91_sys_write(AT91_PIOB + PIO_OWDR, ssc_pio_lines);
+       at91_set_A_periph(AT91_PIN_PB6, 0);     /* TF1 */
+       at91_set_A_periph(AT91_PIN_PB7, 0);     /* TK1 */
+       at91_set_A_periph(AT91_PIN_PB8, 0);     /* TD1 */
+       at91_set_A_periph(AT91_PIN_PB9, 0);     /* RD1 */
+/*     at91_set_A_periph(AT91_PIN_PB10, 0);*/  /* RK1 */
+       at91_set_A_periph(AT91_PIN_PB11, 0);    /* RF1 */
 
        /*
         * Set PCK1 parent to PLLB and its rate to 12 Mhz.
index 815c15336255d985d9f9e3a23f81c1b370043a47..e17379998802cf82c457062fdbf692a872e7eb24 100644 (file)
@@ -15,6 +15,7 @@
 #include <linux/platform_device.h>
 #include <linux/interrupt.h>
 #include <linux/wait.h>
+#include <linux/clk.h>
 #include <linux/delay.h>
 
 #include <sound/core.h>
@@ -27,6 +28,7 @@
 #include <linux/mutex.h>
 #include <asm/hardware.h>
 #include <asm/arch/pxa-regs.h>
+#include <asm/arch/pxa2xx-gpio.h>
 #include <asm/arch/audio.h>
 
 #include "pxa2xx-pcm.h"
 static DEFINE_MUTEX(car_mutex);
 static DECLARE_WAIT_QUEUE_HEAD(gsr_wq);
 static volatile long gsr_bits;
+static struct clk *ac97_clk;
+#ifdef CONFIG_PXA27x
+static struct clk *ac97conf_clk;
+#endif
 
 /*
  * Beware PXA27x bugs:
@@ -159,9 +165,9 @@ static void pxa2xx_ac97_cold_reset(struct snd_ac97 *ac97)
        gsr_bits = 0;
 #ifdef CONFIG_PXA27x
        /* PXA27x Developers Manual section 13.5.2.2.1 */
-       pxa_set_cken(CKEN_AC97CONF, 1);
+       clk_enable(ac97conf_clk);
        udelay(5);
-       pxa_set_cken(CKEN_AC97CONF, 0);
+       clk_disable(ac97conf_clk);
        GCR = GCR_COLD_RST;
        udelay(50);
 #else
@@ -255,7 +261,7 @@ static int pxa2xx_ac97_suspend(struct platform_device *pdev,
        struct snd_soc_cpu_dai *dai)
 {
        GCR |= GCR_ACLINK_OFF;
-       pxa_set_cken(CKEN_AC97, 0);
+       clk_disable(ac97_clk);
        return 0;
 }
 
@@ -270,7 +276,7 @@ static int pxa2xx_ac97_resume(struct platform_device *pdev,
        /* Use GPIO 113 as AC97 Reset on Bulverde */
        pxa_gpio_mode(113 | GPIO_ALT_FN_2_OUT);
 #endif
-       pxa_set_cken(CKEN_AC97, 1);
+       clk_enable(ac97_clk);
        return 0;
 }
 
@@ -294,16 +300,33 @@ static int pxa2xx_ac97_probe(struct platform_device *pdev)
 #ifdef CONFIG_PXA27x
        /* Use GPIO 113 as AC97 Reset on Bulverde */
        pxa_gpio_mode(113 | GPIO_ALT_FN_2_OUT);
+
+       ac97conf_clk = clk_get(&pdev->dev, "AC97CONFCLK");
+       if (IS_ERR(ac97conf_clk)) {
+               ret = PTR_ERR(ac97conf_clk);
+               ac97conf_clk = NULL;
+               goto err_irq;
+       }
 #endif
-       pxa_set_cken(CKEN_AC97, 1);
+       ac97_clk = clk_get(&pdev->dev, "AC97CLK");
+       if (IS_ERR(ac97_clk)) {
+               ret = PTR_ERR(ac97_clk);
+               ac97_clk = NULL;
+               goto err_irq;
+       }
+       clk_enable(ac97_clk);
        return 0;
 
- err:
-       if (CKEN & (1 << CKEN_AC97)) {
-               GCR |= GCR_ACLINK_OFF;
-               free_irq(IRQ_AC97, NULL);
-               pxa_set_cken(CKEN_AC97, 0);
+ err_irq:
+       GCR |= GCR_ACLINK_OFF;
+#ifdef CONFIG_PXA27x
+       if (ac97conf_clk) {
+               clk_put(ac97conf_clk);
+               ac97conf_clk = NULL;
        }
+#endif
+       free_irq(IRQ_AC97, NULL);
+ err:
        return ret;
 }
 
@@ -311,7 +334,13 @@ static void pxa2xx_ac97_remove(struct platform_device *pdev)
 {
        GCR |= GCR_ACLINK_OFF;
        free_irq(IRQ_AC97, NULL);
-       pxa_set_cken(CKEN_AC97, 0);
+#ifdef CONFIG_PXA27x
+       clk_put(ac97conf_clk);
+       ac97conf_clk = NULL;
+#endif
+       clk_disable(ac97_clk);
+       clk_put(ac97_clk);
+       ac97_clk = NULL;
 }
 
 static int pxa2xx_ac97_hw_params(struct snd_pcm_substream *substream,
index 692b900024891646b96f5f8fb10f7b5339e7c5b2..425071030970bf07fae6f50b3d863cf89d7c9022 100644 (file)
@@ -25,6 +25,7 @@
 
 #include <asm/hardware.h>
 #include <asm/arch/pxa-regs.h>
+#include <asm/arch/pxa2xx-gpio.h>
 #include <asm/arch/audio.h>
 
 #include "pxa2xx-pcm.h"